[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen-pciback: provide a "reset" sysfs file to try harder at an SBR



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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.