From patchwork Fri Sep 2 23:35:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 1673777 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=kBxHCiXF; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4MKDn32cgPz1yhd for ; Sat, 3 Sep 2022 09:35:51 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229517AbiIBXfu (ORCPT ); Fri, 2 Sep 2022 19:35:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229609AbiIBXft (ORCPT ); Fri, 2 Sep 2022 19:35:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E10B5DEA7D; Fri, 2 Sep 2022 16:35:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7D1C161FCA; Fri, 2 Sep 2022 23:35:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AF38C433D6; Fri, 2 Sep 2022 23:35:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662161746; bh=FmnAhEe5uZ9f3ApuhBxfFu90IRni8tTV6tD+FWbuSa8=; h=From:To:Cc:Subject:Date:From; b=kBxHCiXFgnQoiKbZQA31DL25+Hs1UV9ewHYNNxsUqx+m95UU5zl+bDsRt3dv7KVJw RrBWsLqg6tL4O7EEopzjJakahh8CxxuW0EXVI32+o1abjnkE7LqWWLyraouDnBlqzY ZgKzmYvrvlZruyHoSTyHvRr+MgJSL7oWCjgppUV0gGu86tIz5B/D4dMqnhOlZQVpmw T2wNxoo2C1tii3G1y1rLdsytX9hd1jKXuEv3XyVBK0aaR5aAlhE1RL76eC0iIXkw2j LhZF6vNMr/c10OoAwWEhYvcac6K8RLCxziiZOcLQ+2XVHdhV9djwNH7t0T09NyWi3e OCyFSUAAeaAZw== From: Bjorn Helgaas To: Kai-Heng Feng , Rajvi Jingar , "Rafael J . Wysocki" Cc: Koba Ko , Mika Westerberg , "David E . Box" , Sathyanarayanan Kuppuswamy , linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH v2 0/3] PCI/PM: Always disable PTM for all devices during suspend Date: Fri, 2 Sep 2022 18:35:40 -0500 Message-Id: <20220902233543.390890-1-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Bjorn Helgaas We currently disable PTM for Root Ports during suspend. Leaving PTM enabled for downstream devices causes UR errors if they send PTM Requests. The intent of this series is to: - Unconditionally disable PTM during suspend (even if the driver saves its own state) by moving the disable from pci_prepare_to_sleep() to pci_pm_suspend(). - Disable PTM for all devices by removing the Root Port condition and doing it early in the suspend paths. - Explicitly re-enable PTM during resume, which requires new support in pci_enable_ptm() for Root Ports and Switch Upstream Ports. Bjorn Helgaas (3): PCI/PTM: Preserve PTM Root Select PCI/PTM: Implement pci_enable_ptm() for Root Ports, Switch Upstream Ports PCI/PM: Always disable PTM for all devices during suspend drivers/pci/pci-driver.c | 14 ++++++++++++++ drivers/pci/pci.c | 20 -------------------- drivers/pci/pcie/ptm.c | 36 ++++++++++++++++++++++++++++-------- 3 files changed, 42 insertions(+), 28 deletions(-)