From: Joe Perches <joe@perches.com>
To: Bjorn Helgaas <helgaas@kernel.org>,
sathyanarayanan.kuppuswamy@linux.intel.com
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
ashok.raj@intel.com, keith.busch@intel.com
Subject: Re: [PATCH v6 1/9] PCI/ERR: Update error status after reset_link()
Date: Thu, 15 Aug 2019 18:54:44 -0700 [thread overview]
Message-ID: <11b7c586136241512668b23656cbc2e088920117.camel@perches.com> (raw)
In-Reply-To: <20190815221629.GI253360@google.com>
On Thu, 2019-08-15 at 17:16 -0500, Bjorn Helgaas wrote:
> On Fri, Jul 26, 2019 at 02:43:11PM -0700, sathyanarayanan.kuppuswamy@linux.intel.com wrote:
> > From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> >
> > Commit bdb5ac85777d ("PCI/ERR: Handle fatal error recovery") uses
> > reset_link() to recover from fatal errors. But, if the reset is
> > successful there is no need to continue the rest of the error recovery
> > checks. Also, during fatal error recovery, if the initial value of error
> > status is PCI_ERS_RESULT_DISCONNECT or PCI_ERS_RESULT_NO_AER_DRIVER then
> > even after successful recovery (using reset_link()) pcie_do_recovery()
> > will report the recovery result as failure. So update the status of
> > error after reset_link().
[]
> > diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c
[]
> > @@ -204,9 +204,13 @@ void pcie_do_recovery(struct pci_dev *dev, enum pci_channel_state state,
> > else
> > pci_walk_bus(bus, report_normal_detected, &status);
> >
> > - if (state == pci_channel_io_frozen &&
> > - reset_link(dev, service) != PCI_ERS_RESULT_RECOVERED)
> > - goto failed;
> > + if (state == pci_channel_io_frozen) {
> > + status = reset_link(dev, service);
> > + if (status != PCI_ERS_RESULT_RECOVERED)
> > + goto failed;
> > + else
> > + goto done;
>
> This will be easier to read without the negation, i.e.,
>
> if (status == PCI_ERS_RESULT_RECOVERED)
> goto done;
> else
> goto failed;
bikeshed: I think it'd be easier to read without the else
status = reset_link(dev, service);
if (status != PCI_ERS_RESULT_RECOVERED)
goto failed;
goto done;
next prev parent reply other threads:[~2019-08-16 1:54 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-26 21:43 [PATCH v6 0/9] Add Error Disconnect Recover (EDR) support sathyanarayanan.kuppuswamy
2019-07-26 21:43 ` [PATCH v6 1/9] PCI/ERR: Update error status after reset_link() sathyanarayanan.kuppuswamy
2019-08-15 22:16 ` Bjorn Helgaas
2019-08-15 22:52 ` Kuppuswamy Sathyanarayanan
2019-08-16 1:54 ` Joe Perches [this message]
2019-07-26 21:43 ` [PATCH v6 2/9] PCI/ACPI: Add _OSC based negotiation support for DPC sathyanarayanan.kuppuswamy
2019-08-15 22:17 ` Bjorn Helgaas
2019-08-15 23:44 ` Kuppuswamy Sathyanarayanan
2019-07-26 21:43 ` [PATCH v6 3/9] PCI/ACPI: Expose EDR support via _OSC to BIOS sathyanarayanan.kuppuswamy
2019-08-15 22:19 ` Bjorn Helgaas
2019-08-15 23:46 ` Kuppuswamy Sathyanarayanan
2019-07-26 21:43 ` [PATCH v6 4/9] PCI/DPC: Allow dpc_probe() even if firmware first mode is enabled sathyanarayanan.kuppuswamy
2019-07-26 21:43 ` [PATCH v6 5/9] PCI/DPC: Add dpc_process_error() wrapper function sathyanarayanan.kuppuswamy
2019-07-26 21:43 ` [PATCH v6 6/9] PCI/DPC: Add Error Disconnect Recover (EDR) support sathyanarayanan.kuppuswamy
2019-07-26 21:43 ` [PATCH v6 7/9] PCI/AER: Allow clearing Error Status Register in FF mode sathyanarayanan.kuppuswamy
2019-07-26 21:43 ` [PATCH v6 8/9] PCI/DPC: Update comments related to DPC recovery on NON_FATAL errors sathyanarayanan.kuppuswamy
2019-07-26 21:43 ` [PATCH v6 9/9] PCI/DPC: Clear AER registers in EDR mode sathyanarayanan.kuppuswamy
2019-07-26 21:53 ` [PATCH v6 0/9] Add Error Disconnect Recover (EDR) support Keith Busch
2019-07-26 23:31 ` sathyanarayanan kuppuswamy
2019-07-27 0:34 ` Austin.Bolen
2019-07-28 16:10 ` Huong.Nguyen
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=11b7c586136241512668b23656cbc2e088920117.camel@perches.com \
--to=joe@perches.com \
--cc=ashok.raj@intel.com \
--cc=helgaas@kernel.org \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--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).