From: Justin Tee <justintee8345@gmail.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Zhuo Chen <chenzhuo.1@bytedance.com>,
James Smart <james.smart@broadcom.com>,
Dick Kennedy <dick.kennedy@broadcom.com>,
Justin Tee <justin.tee@broadcom.com>,
sathyanarayanan.kuppuswamy@linux.intel.com, bhelgaas@google.com,
ruscur@russell.cc, oohall@gmail.com, fancer.lancer@gmail.com,
jdmason@kudzu.us, dave.jiang@intel.com, allenbh@gmail.com,
jejb@linux.ibm.com, martin.petersen@oracle.com,
linux-scsi@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, ntb@lists.linux.dev,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v3 4/9] scsi: lpfc: Change to use pci_aer_clear_uncorrect_error_status()
Date: Thu, 30 Mar 2023 16:43:01 -0700 [thread overview]
Message-ID: <CABPRKS-kMVpEEdJPR6_ru6hjqyjxcVaR+FRWNGS1RRChjeFhCg@mail.gmail.com> (raw)
In-Reply-To: <20230315213537.GA1788623@bhelgaas>
Hi Bjorn,
> But lpfc_aer_cleanup_state() is visible in the
> "lpfc_aer_state_cleanup" sysfs file, so removing it would break any
> userspace that uses it.
>
> If we can rely on the PCI core to clean up AER errors itself
> (admittedly, that might be a big "if"), maybe lpfc_aer_cleanup_state()
> could just become a no-op?
>
> Any comment from the LPFC folks?
We have notified all users of the lpfc_aer_cleanup_state sysfs entry,
and Broadcom LPFC is okay to no-op.
Regards,
Justin
On Wed, Mar 15, 2023 at 2:39 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> On Tue, Dec 06, 2022 at 04:13:35PM -0600, Bjorn Helgaas wrote:
> > On Wed, Sep 28, 2022 at 06:59:41PM +0800, Zhuo Chen wrote:
> > > lpfc_aer_cleanup_state() requires clearing both fatal and non-fatal
> > > uncorrectable error status.
> >
> > I don't know what the point of lpfc_aer_cleanup_state() is. AER
> > errors should be handled and cleared by the PCI core, not by
> > individual drivers. Only lpfc, liquidio, and sky2 touch
> > PCI_ERR_UNCOR_STATUS.
> >
> > But lpfc_aer_cleanup_state() is visible in the
> > "lpfc_aer_state_cleanup" sysfs file, so removing it would break any
> > userspace that uses it.
> >
> > If we can rely on the PCI core to clean up AER errors itself
> > (admittedly, that might be a big "if"), maybe lpfc_aer_cleanup_state()
> > could just become a no-op?
> >
> > Any comment from the LPFC folks?
> >
> > Ideally, I would rather not export pci_aer_clear_nonfatal_status() or
> > pci_aer_clear_uncorrect_error_status() outside the PCI core at all.
>
> Resurrecting this old thread. Zhuo, can you figure out where the PCI
> core clears these errors, include that in the commit log, and propose
> a patch that makes lpfc_aer_cleanup_state() a no-op, by removing the
> pci_aer_clear_nonfatal_status() call completely?
>
> Such a patch could be sent to the SCSI maintainers since it doesn't
> involve the PCI core.
>
> If it turns out that the PCI core *doesn't* clear these errors, we
> should figure out *why* it doesn't and try to change the PCI core so
> it does.
>
> > > But using pci_aer_clear_nonfatal_status()
> > > will only clear non-fatal error status. To clear both fatal and
> > > non-fatal error status, use pci_aer_clear_uncorrect_error_status().
> > >
> > > Signed-off-by: Zhuo Chen <chenzhuo.1@bytedance.com>
> > > ---
> > > drivers/scsi/lpfc/lpfc_attr.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
> > > index 09cf2cd0ae60..d835cc0ba153 100644
> > > --- a/drivers/scsi/lpfc/lpfc_attr.c
> > > +++ b/drivers/scsi/lpfc/lpfc_attr.c
> > > @@ -4689,7 +4689,7 @@ static DEVICE_ATTR_RW(lpfc_aer_support);
> > > * Description:
> > > * If the @buf contains 1 and the device currently has the AER support
> > > * enabled, then invokes the kernel AER helper routine
> > > - * pci_aer_clear_nonfatal_status() to clean up the uncorrectable
> > > + * pci_aer_clear_uncorrect_error_status() to clean up the uncorrectable
> > > * error status register.
> > > *
> > > * Notes:
> > > @@ -4715,7 +4715,7 @@ lpfc_aer_cleanup_state(struct device *dev, struct device_attribute *attr,
> > > return -EINVAL;
> > >
> > > if (phba->hba_flag & HBA_AER_ENABLED)
> > > - rc = pci_aer_clear_nonfatal_status(phba->pcidev);
> > > + rc = pci_aer_clear_uncorrect_error_status(phba->pcidev);
> > >
> > > if (rc == 0)
> > > return strlen(buf);
> > > --
> > > 2.30.1 (Apple Git-130)
> > >
next prev parent reply other threads:[~2023-03-30 23:43 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-28 10:59 [PATCH v3 0/9] PCI/AER: Fix and optimize usage of status clearing api Zhuo Chen
2022-09-28 10:59 ` [PATCH v3 1/9] PCI/AER: Add pci_aer_clear_uncorrect_error_status() to PCI core Zhuo Chen
2023-03-15 21:29 ` Bjorn Helgaas
2022-09-28 10:59 ` [PATCH v3 2/9] PCI/DPC: Use pci_aer_clear_uncorrect_error_status() to clear uncorrectable error status Zhuo Chen
2022-09-28 10:59 ` [PATCH v3 3/9] NTB: Remove pci_aer_clear_nonfatal_status() call Zhuo Chen
2022-09-28 11:03 ` Serge Semin
2022-12-06 18:09 ` Bjorn Helgaas
2022-12-06 21:41 ` Serge Semin
2023-03-15 21:31 ` Bjorn Helgaas
2022-09-28 10:59 ` [PATCH v3 4/9] scsi: lpfc: Change to use pci_aer_clear_uncorrect_error_status() Zhuo Chen
2022-12-06 22:13 ` Bjorn Helgaas
2023-03-15 21:35 ` Bjorn Helgaas
2023-03-30 23:43 ` Justin Tee [this message]
2022-09-28 10:59 ` [PATCH v3 5/9] PCI/AER: Unexport pci_aer_clear_nonfatal_status() Zhuo Chen
2022-09-28 10:59 ` [PATCH v3 6/9] PCI/AER: Move check inside pcie_clear_device_status() Zhuo Chen
2022-09-28 10:59 ` [PATCH v3 7/9] PCI/AER: Use pcie_aer_is_native() to judge whether OS owns AER Zhuo Chen
2022-09-28 10:59 ` [PATCH v3 8/9] PCI/ERR: Clear fatal error status when pci_channel_io_frozen Zhuo Chen
2022-12-06 21:42 ` Bjorn Helgaas
2022-09-28 10:59 ` [PATCH v3 9/9] PCI/AER: Refine status clearing process with api Zhuo Chen
2022-09-28 11:06 ` [PATCH v3 0/9] PCI/AER: Fix and optimize usage of status clearing api Serge Semin
2022-09-28 15:54 ` [External] " Zhuo Chen
2022-11-04 17:20 ` Zhuo Chen
2022-11-24 11:55 ` Zhuo Chen
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=CABPRKS-kMVpEEdJPR6_ru6hjqyjxcVaR+FRWNGS1RRChjeFhCg@mail.gmail.com \
--to=justintee8345@gmail.com \
--cc=allenbh@gmail.com \
--cc=bhelgaas@google.com \
--cc=chenzhuo.1@bytedance.com \
--cc=dave.jiang@intel.com \
--cc=dick.kennedy@broadcom.com \
--cc=fancer.lancer@gmail.com \
--cc=helgaas@kernel.org \
--cc=james.smart@broadcom.com \
--cc=jdmason@kudzu.us \
--cc=jejb@linux.ibm.com \
--cc=justin.tee@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=martin.petersen@oracle.com \
--cc=ntb@lists.linux.dev \
--cc=oohall@gmail.com \
--cc=ruscur@russell.cc \
--cc=sathyanarayanan.kuppuswamy@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;
as well as URLs for NNTP newsgroup(s).