Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3110716rwd; Fri, 16 Jun 2023 12:23:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4TheMlLWync+GKUYyymEUCM/q2YSzZaWBIwgN/a7NlE9Ml6F4PXk6nhLheCWQzzBmaMsFQ X-Received: by 2002:a17:902:f7cf:b0:1b3:d27b:32b0 with SMTP id h15-20020a170902f7cf00b001b3d27b32b0mr2832810plw.7.1686943401860; Fri, 16 Jun 2023 12:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686943401; cv=none; d=google.com; s=arc-20160816; b=yZZMPlDm7zKAMCSQ/OuoiOaw/QVcdgDCCTaaVvgIw3XON+bNwEltrIBX4yGBYo1Cau leX1dYKckpoS5sx7AG/c2wzjOAt8/cZ9W8iqW9v1dk/jiSEf96eS4yhDgShfzvoQcr2b ms41L2BzdcCNfEktUM2a57fd6I+d7txuv2ATQvuit+0+96nktJC4OlCbYFYb3pIJ4xq6 Npj9pyleiLBWuh4VAqyb6y0fTBchj31Ho7UoT9CZDO2i9D0SZg90pSTpo99FXuLOT9qx /B2DIYUIsJWffAlnlDxJ1ybAQw9nxu0YfoX+EByBUntGZmQv2PTBQd0zT+8XNb7no5sP JYMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3XP1/nfRrP34a5bWam3QAM0lnmo+pQduQHwTEkrBIbw=; b=D1xWV/MygHqq6PUQz/uPSK8l436ePaHS6vrC8K4c5/qXVIXvIoyMeTOpOuU516lFYY 68MGkMmwq2oZ2P+1np5cPtsd4u2Pai5Pks/0bx33wTAUh/Jo96pF0DfPc1JnLqfF3rwD tLHtW36WEwvDwXzMtf6zxe5uPeUjiERxkzMW2294x1UaT0phfjikLZlBYF2sE6R9ei/P qxbeXqUbv1RmrK8n/lXCAOSfq98IdmZu6/LPq8IVTdElo4o82VLSLH1GgDVJGJOOdzc0 ra2MHrvZSNGp1RbVM2EJQg2QChzVDSvgXTwYuk0aZPziNslsjfz6XA+V4VYArdM/pCK8 IYQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f5-20020a170902ce8500b001b3c8ef5c69si11154381plg.332.2023.06.16.12.23.09; Fri, 16 Jun 2023 12:23:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345565AbjFPTLB (ORCPT + 99 others); Fri, 16 Jun 2023 15:11:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229739AbjFPTLA (ORCPT ); Fri, 16 Jun 2023 15:11:00 -0400 Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5f64:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B53B830EB; Fri, 16 Jun 2023 12:10:58 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 0812E300002D5; Fri, 16 Jun 2023 21:10:57 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id EBE2C1DED93; Fri, 16 Jun 2023 21:10:56 +0200 (CEST) Date: Fri, 16 Jun 2023 21:10:56 +0200 From: Lukas Wunner To: Ilpo =?iso-8859-1?Q?J=E4rvinen?= Cc: linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , Krzysztof Wilczy??ski , Emmanuel Grumbach , "Rafael J . Wysocki" , Heiner Kallweit , Stefan =?iso-8859-1?Q?M=E4tje?= , Andy Shevchenko , Jesse Barnes , Matthew Garrett , Shaohua Li , Thomas Renninger , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Dean Luick , stable@vger.kernel.org Subject: Re: [PATCH v2 3/9] PCI/ASPM: Use RMW accessors for changing LNKCTL Message-ID: <20230616191056.GA30821@wunner.de> References: <20230517105235.29176-1-ilpo.jarvinen@linux.intel.com> <20230517105235.29176-4-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230517105235.29176-4-ilpo.jarvinen@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, 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-kernel@vger.kernel.org On Wed, May 17, 2023 at 01:52:29PM +0300, Ilpo J?rvinen wrote: > Don't assume that the device is fully under the control of ASPM and use > RMW capability accessors which do proper locking to avoid losing > concurrent updates to the register values. > > If configuration fails in pcie_aspm_configure_common_clock(), the > function attempts to restore the old PCI_EXP_LNKCTL_CCC settings. Store > only the old PCI_EXP_LNKCTL_CCC bit for the relevant devices rather > than the content of the whole LNKCTL registers. It aligns better with > how pcie_lnkctl_clear_and_set() expects its parameter and makes the > code more obvious to understand. [...] > @@ -224,17 +223,14 @@ static bool pcie_retrain_link(struct pcie_link_state *link) > if (!pcie_wait_for_retrain(parent)) > return false; > > - pcie_capability_read_word(parent, PCI_EXP_LNKCTL, ®16); > - reg16 |= PCI_EXP_LNKCTL_RL; > - pcie_capability_write_word(parent, PCI_EXP_LNKCTL, reg16); > + pcie_capability_set_word(parent, PCI_EXP_LNKCTL, PCI_EXP_LNKCTL_RL); > if (parent->clear_retrain_link) { This and several other RMW operations in drivers/pci/pcie/aspm.c are touched by commit b1689799772a ("PCI/ASPM: Use distinct local vars in pcie_retrain_link()") which got applied to pci/enumeration this week: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=enumeration&id=b1689799772a6f4180f918b0ff66e264a3db9796 As a result the $SUBJECT_PATCH no longer applies cleanly and needs to be respun. Thanks, Lukas