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: Thu, 10 Jul 2014 14:37:20 +0100	[thread overview]
Message-ID: <53BE9710.8020101@citrix.com> (raw)
In-Reply-To: <20140709161020.GC31601@laptop.dumpdata.com>

On 09/07/14 17:10, Konrad Rzeszutek Wilk wrote:
> 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.

Um. This is probing if a per function reset is available,  if it isn't
it creates the "reset" sysfs file. Which will then try an SBR.

(This snippet is broken though since pci_dev_reset() is not extern, see
latest series for the correct fix.)

David

      reply	other threads:[~2014-07-10 13:37 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
2014-07-10 13:37         ` David Vrabel [this message]

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=53BE9710.8020101@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.