[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5480528F.8010106@citrix.com>
Date: Thu, 4 Dec 2014 12:24:47 +0000
From: David Vrabel <david.vrabel@...rix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
David Vrabel <david.vrabel@...rix.com>
CC: <bhelgaas@...gle.com>, <linux-pci@...r.kernel.org>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
<linux-kernel@...r.kernel.org>, <xen-devel@...ts.xenproject.org>
Subject: Re: [Xen-devel] [PATCH v5 9/9] xen/pciback: Implement PCI reset slot
or bus with 'do_flr' SysFS attribute
On 04/12/14 12:06, Konrad Rzeszutek Wilk wrote:
>
> On Dec 4, 2014 6:30 AM, David Vrabel <david.vrabel@...rix.com> wrote:
>>
>> On 03/12/14 21:40, Konrad Rzeszutek Wilk wrote:
>>>
>>> Instead of doing all this complex dance, we depend on the toolstack
>>> doing the right thing. As such implement the 'do_flr' SysFS attribute
>>> which 'xl' uses when a device is detached or attached from/to a guest.
>>> It bypasses the need to worry about the PCI lock.
>>
>> No. Get pciback to add its own "reset" sysfs file (as I have repeatedly
>> proposed).
>>
>
> Which does not work as the kobj will complain (as there is already an 'reset' associated with the PCI device).
It is only needed if the core won't provide one.
+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;
+ int ret;
+
+ /* Already have a per-function reset? */
+ if (pci_probe_reset_function(pci) == 0)
+ return 0;
+
+ ret = device_create_file(dev, &dev_attr_reset);
+ if (ret < 0)
+ return ret;
+ dev_data->created_reset_file = true;
+ return 0;
+}
David
View attachment "0002-xen-pciback-provide-a-reset-sysfs-file-to-try-harder.patch" of type "text/x-diff" (6660 bytes)
Powered by blists - more mailing lists