Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp558444rdb; Thu, 22 Feb 2024 11:54:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWZOoazjgdOtUVlsL1Kvum6VeM0kDVQkzvsSXxA68J3XCPrYqFfCKHsIa2D1GQxKMMYVe/waEWZe6O/ji/iVO8A47ZReOO7ePBMdbuiLA== X-Google-Smtp-Source: AGHT+IGMtd5BTHIszxm3gRLPF296FxK7FiY2JYjdlk02bcArZRZbotqzL3P6NsQI2OzsrSIjQJwW X-Received: by 2002:a05:622a:1450:b0:42b:eb89:87c4 with SMTP id v16-20020a05622a145000b0042beb8987c4mr222967qtx.33.1708631675394; Thu, 22 Feb 2024 11:54:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708631675; cv=pass; d=google.com; s=arc-20160816; b=QiXtQnXL2mpKLf0Tsv44H0ppdVukogWHhc72k95z7Co5BYLTb6bgutXvPEDMm8BpiA qj6lS8Fpp5Wkfa24FEPK//Cud4rm+jMH76ZRiw5l+GMY2yf/ioM80eBMC2pFybxg0oZ4 9Qx9IG+mHyNAUUjRJ9ZCqxelAaoz3wb3BJ8DAtnzWkf9PiDDgtScTx7yPXjWzBaTDH8D 8hjDljwa3HuDzoLLKYKp0eZlMAH2tqGBJbHp02ZIUfnuAHatlVp9oYxVRJyQo4I1VZBe KJO3FkfPiIDZiGOlYzWKR5TSfdEdlplN1Jt+5WSw06Iw6A4AQ3V7uvZzecBs6Ck9+3+R Vnfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=mWTFSPmaI8x30nEfLg8vHHXNqhnY13Y/4OCxqSUsztI=; fh=s/nBq5W2rUM3MaZuF+v9DhC22BOUmK+daszM0b0cfNE=; b=ywMFN9ewRUNrtEf11sTJihuu1IYjOL7hhsfxRCLZLSmqVS/4Hwe4c9176ArXwk8mAH rGmGtT6z8tPL7Ysbs2sF7DSFTOEcaPiDMSQALubZfoxZjiZAM1YRdgNhUffoEbtpIRC4 aTwTbdAUih0xgHaZ0Y+kS2FgCLt10mQSJWeuGXFV1tn5FHrOpdbVvPb42e0UMopcELF0 JpotrXhUVmOwafoSx9I52h2in3uLQza9p9WUoI2x/3PBIvs1ehwwStslGIc203lG1hIO N5M8LoelnSuJeGQha2JgzQJYDdzCzHelWVHlbuAlxgGTTzMhwgOW1osvNxcH6rSRZ1am sCzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UU9jxoAm; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-77289-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i4-20020ac860c4000000b0042dcfef6dcesi13153272qtm.254.2024.02.22.11.54.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 11:54:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77289-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UU9jxoAm; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-77289-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77289-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2A9C01C22839 for ; Thu, 22 Feb 2024 19:54:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC5FF6AF9C; Thu, 22 Feb 2024 19:54:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UU9jxoAm" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 20AF914B83F; Thu, 22 Feb 2024 19:54:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708631667; cv=none; b=ZUOEOueM9LLSnd9956e6ZIYlj+J/ZfSqkiCZ2QiyS1eC7FTQtFfYR6JrUiD9P8unUE3Rv7MJYXeYBpTj/bJlSu1/MYnX/xQy8mXbJGuT1sd1EfgT+Pu1BdY9JMxYDxojIFwYhAQwlY5ag4I8EVyRvKQPqY/WM2IG/tUFVJEp1Mk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708631667; c=relaxed/simple; bh=lySDqcRVwaUR8G5CVeP0COuKUlFPQsre28mxBWvZRzc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kf2k2/IcPH664sI9KglxHF6/j/VNmVBZ/gIkWDqvHUwiG1LxX50n9BCi8MHsyh33Jqi2IRffeEvcSpoVF569okhGsW9E7+AO+p9n1hR25qkq9U9Ymft4qaYL91NtFWHUcX0fUqDbQRgX1yrzu4CysEqLIb/2Ko9CNnNKu4oRvfI= 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=UU9jxoAm; arc=none smtp.client-ip=198.175.65.16 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=1708631666; x=1740167666; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=lySDqcRVwaUR8G5CVeP0COuKUlFPQsre28mxBWvZRzc=; b=UU9jxoAmuMAcxkYncJKMLev7nefc6xc0ec95mg/BumAAlJh0qbGcyKoT fqinm94u90fr2uleH+xIq11YkmNDFWMA62jXo6qLy+am/ESEZOu/p4PYK /G2AWeF62uxk0odM8ohRItcZBGVi5FJfxcUr3jnWaNG7vtGf/w0pgWWfY b9fB0KzBHIj4QXnM4EbjcR5Vwg2wo4XsfDXWhrU4TP/+2GQuFo53OqVYb GL+q2HzE2YylWJXwZ0RboRHfuLBoSnupJXG7kTBL4kWPzM6qTlRaWNdAE KED+bKqnPHDXsWcsTFuGtsLu5jaLpwodVX6awc/2Z/drB3JSjRVV+oxOU g==; X-IronPort-AV: E=McAfee;i="6600,9927,10992"; a="3041910" X-IronPort-AV: E=Sophos;i="6.06,179,1705392000"; d="scan'208";a="3041910" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2024 11:54:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,179,1705392000"; d="scan'208";a="5588126" Received: from rdegger-desk1.amr.corp.intel.com (HELO [10.209.74.18]) ([10.209.74.18]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2024 11:54:25 -0800 Message-ID: <057c9a17-bbf2-49c5-b7ee-d3357d5b5100@linux.intel.com> Date: Thu, 22 Feb 2024 11:54:24 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V4] PCI/ASPM: Update saved buffers with latest ASPM Content-Language: en-US To: Bjorn Helgaas Cc: Vidya Sagar , bhelgaas@google.com, macro@orcam.me.uk, ajayagarwal@google.com, ilpo.jarvinen@linux.intel.com, david.e.box@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 References: <20240222185434.GA24540@bhelgaas> From: Kuppuswamy Sathyanarayanan In-Reply-To: <20240222185434.GA24540@bhelgaas> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/22/24 10:54 AM, Bjorn Helgaas wrote: > On Thu, Feb 22, 2024 at 10:20:06AM -0800, Kuppuswamy Sathyanarayanan wrote: >> 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' hook >>> is called through PCIe Error Recovery Handler. >>> >>> 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 not to >>> what it was just before the occurrence of the error event. >>> This effectively leads to a mismatch in the ASPM configuration between >>> the device and its upstream parent device. >>> >>> Update the saved configuration state of the device with the latest info >>> whenever there is a change w.r.t ASPM policy. >>> >>> Signed-off-by: Vidya Sagar >>> --- >>> V4: >>> * Rebased on top of pci/aspm branch >>> >>> V3: >>> * Addressed sathyanarayanan.kuppuswamy's review comments >>> >>> V2: >>> * Rebased on top of the tree code >>> * Addressed Bjorn's review comments >>> >>> drivers/pci/pcie/aspm.c | 28 ++++++++++++++++++++++++++-- >>> 3 files changed, 28 insertions(+), 4 deletions(-) >>> >>> 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) >>> pcie_capability_read_word(dev, PCI_EXP_LNKCTL2, &cap[i++]); >>> pcie_capability_read_word(dev, PCI_EXP_SLTCTL2, &cap[i++]); >>> >>> - pci_save_aspm_state(dev); >>> + pci_save_aspm_l1ss_state(dev); >>> pci_save_ltr_state(dev); >>> >>> 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); >>> bool pci_bridge_d3_possible(struct pci_dev *dev); >>> void pci_bridge_d3_update(struct pci_dev *dev); >>> void 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. > > 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. Got it. Change wise, this patch looks fine to me. Reviewed-by: Kuppuswamy Sathyanarayanan > > Bjorn -- Sathyanarayanan Kuppuswamy Linux Kernel Developer