From: Bjorn Helgaas <bhelgaas@google.com>
To: Chen Gang <gang.chen.5i5j@gmail.com>
Cc: konrad.wilk@oracle.com, boris.ostrovsky@oracle.com,
david.vrabel@citrix.com, xen-devel@lists.xenproject.org,
linux-pci@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH next] xen: pcifront: Process failure for pcifront_(re)scan_root()
Date: Wed, 5 Nov 2014 21:16:48 -0700 [thread overview]
Message-ID: <20141106041648.GM6168@google.com> (raw)
In-Reply-To: <543206CD.1040505@gmail.com>
On Mon, Oct 06, 2014 at 11:04:45AM +0800, Chen Gang wrote:
> When pcifront_rescan_root() or pcifront_scan_root() fails, need return
> error code, neither set XenbusStateConnected state, just like the other
> areas have done.
>
> For pcifront_rescan_root(), it will return error code ("num_roots = 0;",
> skip xenbus_switch_state return value).
>
> For pcifront_scan_root(), it will return 0 ("num_roots = 0;", set 0 by
> the return value of xenbus_switch_state, which always return 0, at
> present).
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Applied to pci/virtualization for v3.19, with Konrad's ack and my changelog
rework. Thanks!
> ---
> drivers/pci/xen-pcifront.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
> index 53df39a..d78d884 100644
> --- a/drivers/pci/xen-pcifront.c
> +++ b/drivers/pci/xen-pcifront.c
> @@ -866,6 +866,11 @@ static int pcifront_try_connect(struct pcifront_device *pdev)
> xenbus_dev_error(pdev->xdev, err,
> "No PCI Roots found, trying 0000:00");
> err = pcifront_scan_root(pdev, 0, 0);
> + if (err) {
> + xenbus_dev_fatal(pdev->xdev, err,
> + "Error scanning PCI root 0000:00");
> + goto out;
> + }
> num_roots = 0;
> } else if (err != 1) {
> if (err == 0)
> @@ -947,6 +952,11 @@ static int pcifront_attach_devices(struct pcifront_device *pdev)
> xenbus_dev_error(pdev->xdev, err,
> "No PCI Roots found, trying 0000:00");
> err = pcifront_rescan_root(pdev, 0, 0);
> + if (err) {
> + xenbus_dev_fatal(pdev->xdev, err,
> + "Error scanning PCI root 0000:00");
> + goto out;
> + }
> num_roots = 0;
> } else if (err != 1) {
> if (err == 0)
> --
> 1.9.3
next prev parent reply other threads:[~2014-11-06 4:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-06 3:04 [PATCH next] xen: pcifront: Process failure for pcifront_(re)scan_root() Chen Gang
2014-10-15 0:09 ` Bjorn Helgaas
2014-10-15 0:09 ` Bjorn Helgaas
2014-11-06 4:16 ` Bjorn Helgaas [this message]
2014-11-06 4:16 ` Bjorn Helgaas
-- strict thread matches above, loose matches on Subject: below --
2014-10-15 0:20 Chen Gang
2014-10-15 21:03 ` Konrad Rzeszutek Wilk
2014-10-24 22:50 ` Chen Gang
2014-11-05 23:31 ` Bjorn Helgaas
2014-11-05 23:31 ` Bjorn Helgaas
2014-11-06 3:09 ` Konrad Rzeszutek Wilk
2014-11-06 3:09 ` Konrad Rzeszutek Wilk
2014-10-24 22:50 ` Chen Gang
2014-10-15 21:03 ` Konrad Rzeszutek Wilk
2014-10-15 0:20 Chen Gang
2014-10-06 3:04 Chen Gang
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=20141106041648.GM6168@google.com \
--to=bhelgaas@google.com \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=gang.chen.5i5j@gmail.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.