From patchwork Fri Sep 2 23:35:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 602340 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BE7BC6FA89 for ; Fri, 2 Sep 2022 23:36:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230188AbiIBXf6 (ORCPT ); Fri, 2 Sep 2022 19:35:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbiIBXfx (ORCPT ); Fri, 2 Sep 2022 19:35:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EE44DF4C3; Fri, 2 Sep 2022 16:35:51 -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 ams.source.kernel.org (Postfix) with ESMTPS id E46A8B82E0A; Fri, 2 Sep 2022 23:35:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80484C433C1; Fri, 2 Sep 2022 23:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662161748; bh=RT3RQzwcZmsdKMDfRVB08SNXYiMqaAszRBdVwIagBPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iTZt7uElIqBz6mNk1MqXtukLcbo3Q/pD/xTo92Z+6QLOleBITyDBTErabqb85N621 3LjOIyZHMkQDywjG9hRlmdk+Il+NSJt2hplMAALQAZ+xuKtHME4Ek8oqmW5CNYcqdo hyX5nz4eBWGv0YNT8kJNz5REaBzAW657Tc4ZICjXQKz2fiAs4x9PYnNLgNNMy0/LbD 9rY6tPbaJUtJcWom8ZTko3Dcv58qdWOTRWi7T5AB99jY8Lz27AMqkE73ZDxXbiGAGn BpVQxsmDnu7BYid1A1T2IgI6ViO+fR2irWNsyDi8XziMXNJtTxliJ2rL0gvFTrqCPE tzVnKKliVvBow== 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 1/3] PCI/PTM: Preserve PTM Root Select Date: Fri, 2 Sep 2022 18:35:41 -0500 Message-Id: <20220902233543.390890-2-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220902233543.390890-1-helgaas@kernel.org> References: <20220902233543.390890-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Bjorn Helgaas When disabling PTM, there's no need to clear the Root Select bit. We disable PTM during suspend, and we want to re-enable it during resume. Clearing Root Select here makes re-enabling more complicated. Per PCIe r6.0, sec 7.9.15.3, "When set, if the PTM Enable bit is also Set, this Time Source is the PTM Root," so if PTM Enable is cleared, the value of Root Select should be irrelevant. Preserve Root Select to simplify re-enabling PTM. Signed-off-by: Bjorn Helgaas Cc: David E. Box Reviewed-by: Kuppuswamy Sathyanarayanan --- drivers/pci/pcie/ptm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pcie/ptm.c b/drivers/pci/pcie/ptm.c index 368a254e3124..b6a417247ce3 100644 --- a/drivers/pci/pcie/ptm.c +++ b/drivers/pci/pcie/ptm.c @@ -42,7 +42,7 @@ void pci_disable_ptm(struct pci_dev *dev) return; pci_read_config_word(dev, ptm + PCI_PTM_CTRL, &ctrl); - ctrl &= ~(PCI_PTM_CTRL_ENABLE | PCI_PTM_CTRL_ROOT); + ctrl &= ~PCI_PTM_CTRL_ENABLE; pci_write_config_word(dev, ptm + PCI_PTM_CTRL, ctrl); }