From: Bjorn Helgaas <helgaas@kernel.org>
To: Sinan Kaya <okaya@codeaurora.org>
Cc: linux-pci@vger.kernel.org, timur@codeaurora.org,
linux-arm-msm@vger.kernel.org,
Bjorn Helgaas <bhelgaas@google.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [PATCH] PCI: rework error checking in the reset path
Date: Wed, 25 Oct 2017 08:45:11 -0500 [thread overview]
Message-ID: <20171025134511.GL21840@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <1508794608-15310-1-git-send-email-okaya@codeaurora.org>
[+cc Alex]
On Mon, Oct 23, 2017 at 05:36:48PM -0400, Sinan Kaya wrote:
> The return codes from various reset types are not consistent. The code is
> assuming that all reset types will return -ENOTTY when things go wrong.
> Instead of relying on negative error status, let's bail out if the
> operation is successful instead.
I like this (no surprise since I suggested something similar at
http://lkml.kernel.org/r/20171011210057.GU25517@bhelgaas-glaptop.roam.corp.google.com),
but I'd like Alex's opinion before merging it.
Previously, we only tried the next reset method if one method failed
with -ENOTTY. With this patch, we'll try the next reset method if one
method fails for any reason, not just -ENOTTY.
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
> drivers/pci/pci.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 6078dfc..a753e07 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -4200,20 +4200,20 @@ int __pci_reset_function_locked(struct pci_dev *dev)
> might_sleep();
>
> rc = pci_dev_specific_reset(dev, 0);
> - if (rc != -ENOTTY)
> + if (!rc)
> return rc;
> if (pcie_has_flr(dev)) {
> pcie_flr(dev);
> return 0;
> }
> rc = pci_af_flr(dev, 0);
> - if (rc != -ENOTTY)
> + if (!rc)
> return rc;
> rc = pci_pm_reset(dev, 0);
> - if (rc != -ENOTTY)
> + if (!rc)
> return rc;
> rc = pci_dev_reset_slot_function(dev, 0);
> - if (rc != -ENOTTY)
> + if (!rc)
> return rc;
> return pci_parent_bus_reset(dev, 0);
> }
> --
> 1.9.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2017-10-25 13:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-23 21:36 Sinan Kaya
2017-10-25 13:45 ` Bjorn Helgaas [this message]
2017-10-25 21:28 ` Alex Williamson
2017-10-25 21:42 ` Sinan Kaya
2017-10-25 22:10 ` Bjorn Helgaas
2017-10-25 22:34 ` Alex Williamson
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=20171025134511.GL21840@bhelgaas-glaptop.roam.corp.google.com \
--to=helgaas@kernel.org \
--cc=alex.williamson@redhat.com \
--cc=bhelgaas@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=okaya@codeaurora.org \
--cc=timur@codeaurora.org \
/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
all inboxes | Powered by JetHome®