From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xenproject.org,
Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH] xen-pciback: provide a "reset" sysfs file to try harder at an SBR
Date: Wed, 9 Jul 2014 12:10:20 -0400 [thread overview]
Message-ID: <20140709161020.GC31601@laptop.dumpdata.com> (raw)
In-Reply-To: <53BD67C5.8040408@citrix.com>
On Wed, Jul 09, 2014 at 05:03:17PM +0100, David Vrabel wrote:
> On 09/07/14 15:56, Konrad Rzeszutek Wilk wrote:
> >
> > I think for your patch to work it has to de-register what the
> > generic PCI code does in pci_create_capabilities_sysfs:
> >
> > 1339 if (!pci_probe_reset_function(dev)) {
> > 1340 retval = device_create_file(&dev->dev, &reset_attr);
> > 1341 if (retval)
> > 1342 goto error;
> > 1343 dev->reset_fn = 1;
> > 1344 }
>
> It just needs to have the inverse test.
>
> --- a/drivers/xen/xen-pciback/pci_stub.c
> +++ b/drivers/xen/xen-pciback/pci_stub.c
> @@ -151,14 +151,11 @@ static int pcistub_try_create_reset_file(struct
> pci_dev *pci)
> {
> struct xen_pcibk_dev_data *dev_data = pci_get_drvdata(pci);
> struct device *dev = &pci->dev;
> - struct kernfs_node *reset_dirent;
> int ret;
>
> - reset_dirent = sysfs_get_dirent(dev->kobj.sd, "reset");
> - if (reset_dirent) {
> - sysfs_put(reset_dirent);
> + /* Already have a per-function reset? */
> + if (pci_dev_reset(dev, 1) == 0)
OK, however the'reset' in SysFS does not do bus/slot reset.
It only calls 'pci_reset_function' - which is inadequate
in certain cases (GPUs, device does not really go in D3 when
asked too, etc) and that is where bus/slot reset functionality
is needed.
> return 0;
> - }
>
> ret = device_create_file(dev, &dev_attr_reset);
> if (ret < 0)
>
> David
next prev parent reply other threads:[~2014-07-09 16:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-09 14:09 [PATCH] xen-pciback: provide a "reset" sysfs file to try harder at an SBR David Vrabel
2014-07-09 14:22 ` Konrad Rzeszutek Wilk
2014-07-09 14:56 ` Konrad Rzeszutek Wilk
2014-07-09 16:03 ` David Vrabel
2014-07-09 16:10 ` Konrad Rzeszutek Wilk [this message]
2014-07-10 13:37 ` David Vrabel
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=20140709161020.GC31601@laptop.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--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.