All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.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 17:03:17 +0100	[thread overview]
Message-ID: <53BD67C5.8040408@citrix.com> (raw)
In-Reply-To: <20140709145629.GD27881@laptop.dumpdata.com>

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)
 		return 0;
-	}

 	ret = device_create_file(dev, &dev_attr_reset);
 	if (ret < 0)

David

  reply	other threads:[~2014-07-09 16:03 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 [this message]
2014-07-09 16:10       ` Konrad Rzeszutek Wilk
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=53BD67C5.8040408@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=konrad.wilk@oracle.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.