Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp623465rdb; Thu, 22 Feb 2024 14:15:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWaYqdUTaz3vwwdsNhXP2kmZiNc2kZ7n73K5DXeY5wQv3WwnPH4Y7NHfYoWa1t1Q4FnfzCARZu23YbZarYKtLOd0SQRnzyyQ7i3jenttw== X-Google-Smtp-Source: AGHT+IGbXMcjGX8O8TmfQCfy7rAjkpzWPhBbxpY2MO8mbsRcfuFgRxNaCrgR42RBUnUKn72v1fSk X-Received: by 2002:a17:906:bcdb:b0:a3e:849b:abab with SMTP id lw27-20020a170906bcdb00b00a3e849bababmr108469ejb.27.1708640112471; Thu, 22 Feb 2024 14:15:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708640112; cv=pass; d=google.com; s=arc-20160816; b=inL6c+ZHNt/EYJYfxKaaYCXXqne36gzkie/yZJnBQUTdg561GVfZpMTM5IdlOauFLy 0aPnm/GTf4iCAkHbpL69XdXBH1xW1MCR2ds8UFinrE8APc98UnsuuCz6rn7f9MMuXlzo KmpmyTGFOlyVqvn8DY3ZlHycEIXt0VsSuoLLpDt5y68HGQt9mayejUOkCUL/dL1vAFiD 2HOhOchjjrC3r9vmGohJGZZeLfZnLA7LKlRofp3W9tqwDwld2C++vk9iTpe+yH9FqYqE qKjCv6I1vHwOjBOn0MvVuwwu21bpHEOwYSnS3ynO/AKVO8kmDwu5pC0va7j6NMWrp/aB RBUQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:organization:autocrypt :references:in-reply-to:date:cc:to:reply-to:from:subject:message-id :dkim-signature; bh=rvbG2YtZMqw4qoq1SK2hNJsq19QImtn0tbTf7da3g6Q=; fh=X5bWCuPi5kDZ1eYeE5DFwGAZ5MUFPPr2KkYuNnLMoBM=; b=PDQJjUsRUk9mxbrRyOik3Oj+JonykzABLPnBw0lEEfQRH4HQJW2gx0r9Simnu2+6aB VKp4CpKvZvJ+MDM2YfUFjYWaHhlSHfZHnzXLZr1Wewt1f5Vhm+RYtJlk5n9MkZfGHRRP zDgKMcktTZyeW3GpnWZ7nUYAjyvAy6kIvaV+i4w3NPg9bgun8nepsXa3I+HHINLCUW0Y JKTfmg2gxTlyrv10ixs4J6NZqQqLDcSf/XBP15C0PstmeGqdB5og0P8EtSsrqpMbGWLY q3C/FaaGe8D59wVTXtbrwF11A9wg7BaIZD0+Y3Yw7IC8azghjOGoysS6mBpE3PAxjMbF WAQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Q2UHzjR7; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-77455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id mc17-20020a170906eb5100b00a3e8323c0c4si4358337ejb.846.2024.02.22.14.15.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:15:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Q2UHzjR7; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-77455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 16F5D1F26469 for ; Thu, 22 Feb 2024 22:15:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 24263137906; Thu, 22 Feb 2024 22:15:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Q2UHzjR7" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C96573F20; Thu, 22 Feb 2024 22:15:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708640102; cv=none; b=KJ2W6EclxRBZz86Ra3eRLLITq2EsJ4kYsT2wj0ykCQtjkncMvmwFbFrh4DJeK+9sBTq9qhpeBmLSP4wFKzdrSJdCv3asYljKEki4ttRRRLfyVjbh1hwhO81o0ZWS4nsDypd6vmz/QDk/q8Mhn6/Ou1NNIPNnRWKvUsP1yw/E5OU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708640102; c=relaxed/simple; bh=cGR6QfVp36GMgGkFzkzQQaTyVm1xEpIt1P0nxWtQPBo=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=MF2PG0poQHAlpGg4uWwdF0kpEFIJFzDskoSYHMXcHJWuOHrY9RAN8nBXfULxX9vzDQ0v4k/xQHfoBR1StZz7kbgp0c5ucxz75KFPmYe9TGtz3Ik7qqir+KqctRHDUjXmj/eNjOl0MnDVNltBx2fOd4rhANR3Tz7MIrKbcFXpvnw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Q2UHzjR7; arc=none smtp.client-ip=192.198.163.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708640101; x=1740176101; h=message-id:subject:from:reply-to:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=cGR6QfVp36GMgGkFzkzQQaTyVm1xEpIt1P0nxWtQPBo=; b=Q2UHzjR7bfoqlyiWWQGds/5mXTi3b3o7JeZnaiz+gLCucj0l1JVTejcB FQ1YLFaIoUOuf5H0QODzwpyq9Uqu43gcDZu+Bpp3iOYU3ZghdV30JzDNp 10X7fuSRnZTU+fYEAKhIOJBYuaF6E8ln6amFKkEXCP5zV62c/BAd2UUGQ aXsZTUC1nuxw1erqcDdZ9HPG1M32X4vAK/Pk8dB+U0BUODWoweFDSbeBn ojhVDrYZtoREjTBYcVnThVtdyhzcIDTfdhIx6FiAnoyKtqkhkKjJiygT7 hGXqZZyj+k5NI+q+MfPsNDyFOqirDzI+YP84rfg8KLxO4de6Xe5FYilO6 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10992"; a="13611153" X-IronPort-AV: E=Sophos;i="6.06,179,1705392000"; d="scan'208";a="13611153" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2024 14:15:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,179,1705392000"; d="scan'208";a="10244497" Received: from linux.intel.com ([10.54.29.200]) by fmviesa005.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2024 14:14:59 -0800 Received: from [10.54.75.156] (debox1-desk1.jf.intel.com [10.54.75.156]) by linux.intel.com (Postfix) with ESMTP id CD33A580DB2; Thu, 22 Feb 2024 14:14:58 -0800 (PST) Message-ID: Subject: Re: [PATCH V4] PCI/ASPM: Update saved buffers with latest ASPM From: "David E. Box" Reply-To: david.e.box@linux.intel.com To: Kuppuswamy Sathyanarayanan , Bjorn Helgaas Cc: Vidya Sagar , bhelgaas@google.com, macro@orcam.me.uk, ajayagarwal@google.com, ilpo.jarvinen@linux.intel.com, hkallweit1@gmail.com, johan+linaro@kernel.org, xueshuai@linux.alibaba.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, treding@nvidia.com, jonathanh@nvidia.com, kthota@nvidia.com, mmaddireddy@nvidia.com, sagar.tv@gmail.com Date: Thu, 22 Feb 2024 14:14:58 -0800 In-Reply-To: <057c9a17-bbf2-49c5-b7ee-d3357d5b5100@linux.intel.com> References: <20240222185434.GA24540@bhelgaas> <057c9a17-bbf2-49c5-b7ee-d3357d5b5100@linux.intel.com> Autocrypt: addr=david.e.box@linux.intel.com; prefer-encrypt=mutual; keydata=mQENBF2w2YABCACw5TpqmFTR6SgsrNqZE8ro1q2lUgVZda26qIi8GeHmVBmu572RfPydisEpCK246rYM5YY9XAps810ZxgFlLyBqpE/rxB4Dqvh04QePD6fQNui/QCSpyZ6j9F8zl0zutOjfNTIQBkcar28hazL9I8CGnnMko21QDl4pkrq1dgLSgl2r2N1a6LJ2l8lLnQ1NJgPAev4BWo4WAwH2rZ94aukzAlkFizjZXmB/6em+lhinTR9hUeXpTwcaAvmCHmrUMxeOyhx+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J+fvZv19bk3lPIQi5lUBuU5rNruDNowCsnvXr+sFxFyTbXw0AQXIsnX+EkMg/JO+/V/UszZiqZPkvHsQipCFVLod/3G/yig9RUO7A/1efRi0E1iJAa6qHrPqE/kJANbz/x+9wcx1VfFwraFXbdT/P2JeOcW/USW89wzMRmOo+AiBSnTI4xvb1s/TxSfoLZvtoj2MR+2PW1zBALWYUKHOzhfFKs3cMufwIIoQUPVqGVeH+u6Asun6ZpNRxdDONop+uEXHe6q6LzI/NnczqoZQLhM8d1XqokYax/IZ4= Organization: David E. Box Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.2 (3.50.2-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, 2024-02-22 at 11:54 -0800, Kuppuswamy Sathyanarayanan wrote: >=20 > On 2/22/24 10:54 AM, Bjorn Helgaas wrote: > > On Thu, Feb 22, 2024 at 10:20:06AM -0800, Kuppuswamy Sathyanarayanan wr= ote: > > > On 2/22/24 9:44 AM, Vidya Sagar wrote: > > > > Many PCIe device drivers save the configuration state of their > > > > respective > > > > devices during probe and restore the same when their 'slot_reset' h= ook > > > > is called through PCIe Error Recovery Handler. > > > >=20 > > > > If the system has a change in ASPM policy after the driver's probe = is > > > > called and before error event occurred, 'slot_reset' hook restores = the > > > > PCIe configuration state to what it was at the time of probe but no= t to > > > > what it was just before the occurrence of the error event. > > > > This effectively leads to a mismatch in the ASPM configuration betw= een > > > > the device and its upstream parent device. > > > >=20 > > > > Update the saved configuration state of the device with the latest = info > > > > whenever there is a change w.r.t ASPM policy. > > > >=20 > > > > Signed-off-by: Vidya Sagar > > > > --- > > > > V4: > > > > * Rebased on top of pci/aspm branch > > > >=20 > > > > V3: > > > > * Addressed sathyanarayanan.kuppuswamy's review comments > > > >=20 > > > > V2: > > > > * Rebased on top of the tree code > > > > * Addressed Bjorn's review comments > > > >=20 > > > > =C2=A0drivers/pci/pcie/aspm.c | 28 ++++++++++++++++++++++++++-- > > > > =C2=A03 files changed, 28 insertions(+), 4 deletions(-) > > > >=20 > > > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > > > > index cfc5b84dc9c9..3db606ba9344 100644 > > > > --- a/drivers/pci/pci.c > > > > +++ b/drivers/pci/pci.c > > > > @@ -1648,7 +1648,7 @@ static int pci_save_pcie_state(struct pci_dev > > > > *dev) > > > > =C2=A0 pcie_capability_read_word(dev, PCI_EXP_LNKCTL2, &cap[i++]); > > > > =C2=A0 pcie_capability_read_word(dev, PCI_EXP_SLTCTL2, &cap[i++]); > > > > =C2=A0 > > > > - pci_save_aspm_state(dev); > > > > + pci_save_aspm_l1ss_state(dev); > > > > =C2=A0 pci_save_ltr_state(dev); > > > > =C2=A0 > > > > =C2=A0 return 0; > > > > diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h > > > > index b217e74966eb..9fe78eb8b07d 100644 > > > > --- a/drivers/pci/pci.h > > > > +++ b/drivers/pci/pci.h > > > > @@ -95,7 +95,7 @@ void pci_msix_init(struct pci_dev *dev); > > > > =C2=A0bool pci_bridge_d3_possible(struct pci_dev *dev); > > > > =C2=A0void pci_bridge_d3_update(struct pci_dev *dev); > > > > =C2=A0void pci_aspm_get_l1ss(struct pci_dev *pdev); > > > > -void pci_save_aspm_state(struct pci_dev *pdev); > > > > +void pci_save_aspm_l1ss_state(struct pci_dev *pdev); > > > is this rename a review request? It is not clear from the commit log > > > why you are doing it? > > David's changes already on pci/aspm added pci_save_aspm_state(), but > > it actually only saves L1SS data, and Vidya needs to save the non-L1SS > > data also. > >=20 > > I think I'm going to rework David's changes a little bit so this is > > named pci_save_aspm_l1ss_state() from the beginning so we won't need > > the rename here. Ack >=20 > Got it. >=20 > Change wise, this patch looks fine to me. >=20 > Reviewed-by: Kuppuswamy Sathyanarayanan > LGTM too. Reviewed-by: David E. Box