From: "Kuppuswamy, Sathyanarayanan" <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Bjorn Helgaas <helgaas@kernel.org>, linux-pci@vger.kernel.org
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Sean Kelley <sean.v.kelley@linux.intel.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
linuxarm@huawei.com, Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH] PCI/ERR: Rename pci_aer_clear_device_status() to pcie_clear_device_status()
Date: Fri, 17 Jul 2020 13:20:22 -0700 [thread overview]
Message-ID: <0cee203b-3ba9-3e42-0caa-92d12b9086fe@linux.intel.com> (raw)
In-Reply-To: <20200717195619.766662-1-helgaas@kernel.org>
Hi Bjorn,
On 7/17/20 12:56 PM, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> pci_aer_clear_device_status() clears the error bits in the PCIe Device
> Status Register (PCI_EXP_DEVSTA). Every PCIe device has this register,
> regardless of whether it supports AER.
Since its not related to AER, can we move it out of AER driver ? May be
to pci.c ?
>
> Rename pci_aer_clear_device_status() to pcie_clear_device_status() to make
> clear that it is PCIe-specific but not AER-specific. No functional change
> intended.
>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
> drivers/pci/pci.h | 4 ++--
> drivers/pci/pcie/aer.c | 4 ++--
> drivers/pci/pcie/err.c | 2 +-
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> index c6c0c455f59f..c5f271e6e276 100644
> --- a/drivers/pci/pci.h
> +++ b/drivers/pci/pci.h
> @@ -657,16 +657,16 @@ void pci_no_aer(void);
> void pci_aer_init(struct pci_dev *dev);
> void pci_aer_exit(struct pci_dev *dev);
> extern const struct attribute_group aer_stats_attr_group;
> +void pcie_clear_device_status(struct pci_dev *dev);
> void pci_aer_clear_fatal_status(struct pci_dev *dev);
> -void pci_aer_clear_device_status(struct pci_dev *dev);
> int pci_aer_clear_status(struct pci_dev *dev);
> int pci_aer_raw_clear_status(struct pci_dev *dev);
> #else
> static inline void pci_no_aer(void) { }
> static inline void pci_aer_init(struct pci_dev *d) { }
> static inline void pci_aer_exit(struct pci_dev *d) { }
> +static inline void pcie_clear_device_status(struct pci_dev *dev) { }
> static inline void pci_aer_clear_fatal_status(struct pci_dev *dev) { }
> -static inline void pci_aer_clear_device_status(struct pci_dev *dev) { }
> static inline int pci_aer_clear_status(struct pci_dev *dev) { return -EINVAL; }
> static inline int pci_aer_raw_clear_status(struct pci_dev *dev) { return -EINVAL; }
> #endif
> diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
> index ca886bf91fd9..d3ea667c8520 100644
> --- a/drivers/pci/pcie/aer.c
> +++ b/drivers/pci/pcie/aer.c
> @@ -241,7 +241,7 @@ int pci_disable_pcie_error_reporting(struct pci_dev *dev)
> }
> EXPORT_SYMBOL_GPL(pci_disable_pcie_error_reporting);
>
> -void pci_aer_clear_device_status(struct pci_dev *dev)
> +void pcie_clear_device_status(struct pci_dev *dev)
> {
> u16 sta;
>
> @@ -947,7 +947,7 @@ static void handle_error_source(struct pci_dev *dev, struct aer_err_info *info)
> if (aer)
> pci_write_config_dword(dev, aer + PCI_ERR_COR_STATUS,
> info->status);
> - pci_aer_clear_device_status(dev);
> + pcie_clear_device_status(dev);
> } else if (info->severity == AER_NONFATAL)
> pcie_do_recovery(dev, pci_channel_io_normal, aer_root_reset);
> else if (info->severity == AER_FATAL)
> diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c
> index 467686ee2d8b..55755bc493f1 100644
> --- a/drivers/pci/pcie/err.c
> +++ b/drivers/pci/pcie/err.c
> @@ -197,7 +197,7 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
> pci_dbg(dev, "broadcast resume message\n");
> pci_walk_bus(bus, report_resume, &status);
>
> - pci_aer_clear_device_status(dev);
> + pcie_clear_device_status(dev);
> pci_aer_clear_nonfatal_status(dev);
> pci_info(dev, "device recovery successful\n");
> return status;
>
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
next prev parent reply other threads:[~2020-07-17 20:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-17 19:56 [PATCH] PCI/ERR: Rename pci_aer_clear_device_status() to pcie_clear_device_status() Bjorn Helgaas
2020-07-17 20:20 ` Kuppuswamy, Sathyanarayanan [this message]
2020-07-21 21:53 ` Bjorn Helgaas
2020-07-21 22:08 ` Kuppuswamy, Sathyanarayanan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0cee203b-3ba9-3e42-0caa-92d12b9086fe@linux.intel.com \
--to=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=lorenzo.pieralisi@arm.com \
--cc=sean.v.kelley@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox