Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp691328lqp; Wed, 12 Jun 2024 13:14:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUQxjNC+Va8b5pwxeX2R4Oeb3XW/TeFMHDkIKg7qm3Y17c5jJI+7H5W87T0ZcJkO2qXd+u/3/179sn8u1saAdRbcEEyClL8OSh/Y4Iguw== X-Google-Smtp-Source: AGHT+IFk+/+KfjNkhYTETQneoe4kzX6LFt0aPAxmDVTMcAapCPSRgDy7uHz6JNsF2Tq+ohxNnXrk X-Received: by 2002:a05:6512:33d0:b0:52c:5f12:c6ba with SMTP id 2adb3069b0e04-52c9a3e2304mr1882544e87.37.1718223285307; Wed, 12 Jun 2024 13:14:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718223285; cv=pass; d=google.com; s=arc-20160816; b=ETWJcACPvxh6si31vNDhwE4A59Ascn/kIurrRmwyzR9TAeOL4xssGeJY3zP2EoOSiM juY0S+DJfvAUMTRJxTTdjuw6IK9WNxpvnBrQbLe/VliqT1XADNajj1C2/6/DagS1+oyP QyknZz9OHOwTwaaqN/GI1U8Z4+l7OQMppZqArntrdvf/poY2tzso8TTRc/Hwxh7GSwrm O9ZOLntNL097upZeIwbjAKGdXM3ONmLV+CRZx44afvh7Plm2t2DU6+S3g7HSoBf9bXyx VUdKWPVTeEyEFgIV7nYPKEdX8DprUGK8lMgb9VjY76B46zsRShyFthmZ7PvJS05bIt3f 5QHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=iGYerIU6RS0x64Gw6K/g/jkS4pFOd+914nZXszVSxm4=; fh=q9QPg/g0ztyzPMyzZIT3jfV7QwpU0ufR6KiWiQI9s0Q=; b=phtFz4JF4vPT2FclsehJSbXJsfqPyyJ+Nx4yr69IlmQmROBRLl0UU+m7eIedbTYyxQ L0COESbv75UTpnUKHaePJb23FBPpaJrB9xbRusOR8vmSHE9tQrcYk4enDOY7J3fiBVm6 Xzrz4KvSM1xr+4md5DOyXh7HswO8ZXZ6nx7584KentFn3BwuTXznCW6Vq6S5b18UGkRm oKorlsUqFQLUwG4DChlTkunvzl9rVk+MDaPYxuvu8qcLnTje5M2PdOS+X9aSKdT7gVcs B2gvF0rIt/NlcxcWg6LcJNjetv8SQMGDhZ4sgYlmh2RYCYm44ol+zhJBsnG2SsEj0+7W MUvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q+4dAogs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-212199-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212199-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f0f009732si467625466b.431.2024.06.12.13.14.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 13:14:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212199-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=@kernel.org header.s=k20201202 header.b=q+4dAogs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-212199-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212199-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 CF9C81F21683 for ; Wed, 12 Jun 2024 20:14:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95A7084D03; Wed, 12 Jun 2024 20:14:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="q+4dAogs" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B92DD5025E; Wed, 12 Jun 2024 20:14:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718223276; cv=none; b=uS/tCNWSfY64WICXqtRl2ngyLNbbocVJM+dJAKPzTlYcXAZKADK3YfiVUs8PynIN0Rh5WPcenz8f5qVkA2lAv/PfU6BjbFJklc7p04aC5DpfPhi2ndjxDwV5aN7SvfzBf6Lm8l/ptRP5v6qxDwKa8GqUw3v/SHTec1DdNwY7OZo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718223276; c=relaxed/simple; bh=MM9GEdJsPlXpFb2M3Z4w8ZvYjz6JLC6YXN3uE1YH/CQ=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=Nv8Oo+AM5qMeWoBGoTJIq4qrCPFLYB8iZH1OWfYVVGk01ErXIirtEqY6zhMHAkYdBvOFX9j488yHnnBLt7wu/cAoJ7R8aduXhYiJ6gOX8R+9GLoiahjs2Iozxs29mih4RuTYBGICr2rHodyRtdytfFMR1xdkIG0wMbM1j+h+QBs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=q+4dAogs; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A3A3C116B1; Wed, 12 Jun 2024 20:14:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718223276; bh=MM9GEdJsPlXpFb2M3Z4w8ZvYjz6JLC6YXN3uE1YH/CQ=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=q+4dAogsM+MDBvicypa93GOR3NSEX3i2GQsRfq/p3UUKrNtBd4zPHl0qvrMGKbsW/ /FhIjUu1O9v79CVCpQ9ejrykFNohAGkJR0pp3zkHOT7Dpjq1fd2RUJ6l+3wSMXIrlv BCkT7e4Ofr0RDuxHHH3+gIBv51PyPhqR5st7FKm6moPBO5s1QgqTrhs7SaFcXePO5N oDC70JtqoDVk5KNcSJ101JG5sSl+oGr6wZn2gBP1i7mcLC0HXmtrF6hKi9HyO1WEoU byC6aO3Ct+eqr44MEatPrpmrVAWSToH+apu/dOlomGskNBRprgazh+NbCnxXVQD/2Y y/l7ybteIRVCQ== Date: Wed, 12 Jun 2024 15:14:32 -0500 From: Bjorn Helgaas To: Songyang Li Cc: bhelgaas@google.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH] PCI: Cancel compilation restrictions on function pcie_clear_device_status Message-ID: <20240612201432.GA1035119@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Jun 12, 2024 at 11:15:43PM +0800, Songyang Li wrote: > On Tue, 11 Jun 2024 17:34:18 -0500, Bjorn Helgaas wrote: > > Unindent this. > > > Add "()" after function names. > > > Please explain what this patch does and why we want it. I can see > > from the patch that it makes it so pcie_clear_device_status() is > > always compiled, but the commit log should say that and should say why > > we need that. > > Thank you for reminding to add "()" after function pcie_clear_device_status. > The following is a revised patch,and it explains why we need that. > Thanks, > > Songyang Li > > From 3c1340522565a44ef25d2045e5bee2c0bdb72b32 Mon Sep 17 00:00:00 2001 > From: Songyang Li > Date: Wed, 12 Jun 2024 22:29:51 +0800 > Subject: [PATCH] PCI: Cancel compilation restrictions on function > pcie_clear_device_status() > > Some PCIe devices do not have AER capabilities, but they have > device status registers. The PCIe device status register and > AER register are independent PCIe capabilities, so it is > unreasonable to use CONFIG_PCIEAER for compilation control of > pcie_clear_device_status(), although which is currently only > used in the "aer.c", "edr.c", and "err.c". Some operating system > configurations do not enable the AER feature, but still expect to > use the device status register for simple RAS. In this case, > pcie_clear_device_status() can be used to clear the device status > regs, so this patch can meet the requirements of this scenario. I think all current any callers of pcie_clear_device_status() are also under CONFIG_PCIEAER, so I don't think this fixes a current problem. As you point out, it might make sense to use pcie_clear_device_status() even without AER, but I think we should include this change at the time when we add such a use. If I'm missing a use with the current kernel, let me know. > Signed-off-by: Songyang Li > --- > drivers/pci/pci.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > mode change 100644 => 100755 drivers/pci/pci.c > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > old mode 100644 > new mode 100755 > index 35fb1f17a589..e6de55be4c45 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -2263,7 +2263,12 @@ int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state) > } > EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state); > > -#ifdef CONFIG_PCIEAER > +/** > + * pcie_clear_device_status - Clear device status. > + * @dev: the PCI device. > + * > + * Clear the device status for the PCI device. > + */ > void pcie_clear_device_status(struct pci_dev *dev) > { > u16 sta; > @@ -2271,7 +2276,6 @@ void pcie_clear_device_status(struct pci_dev *dev) > pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &sta); > pcie_capability_write_word(dev, PCI_EXP_DEVSTA, sta); > } > -#endif > > /** > * pcie_clear_root_pme_status - Clear root port PME interrupt status. > -- > 2.34.1 >