xen/pciback: support driver_override
Juergen Gross
maintainerPATCH 1/1 xen/pciback: support driver_override
Support the driver_override scheme introduced with commit 782a985d7af2 ("PCI: Introduce new device binding path using pci_dev.driver_override")
As pcistub_probe() is called for all devices (it has to check for a match based on the slot address rather than device type) it has to check for driver_override set to "pciback" itself.
--- drivers/xen/xen-pciback/pci_stub.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/xen/xen-pciback/pci_stub.c +10 -6
@@ -25,6 +25,8 @@#include "conf_space.h" #include "conf_space_quirks.h" +#define PCISTUB_DRIVER_NAME "pciback" +static char *pci_devs_to_hide;wait_queue_head_t xen_pcibk_aer_wait_queue;/*Add sem for sync AER handling and xen_pcibk remove/reconfigue ops,
@@ -529,15 +531,17 @@ static int pcistub_probe(struct pci_dev *dev, const struct pci_device_id *id)"don't have a normal (0) or bridge (1) " "header type!\n"); err = -ENODEV ; - goto out; } + }else if (!dev->driver_override || +strcmp (dev->driver_override,PCISTUB_DRIVER_NAME )) +/* Didn't find the device */ + err = -ENODEV ; + +if (!err) {dev_info (&dev->dev,"seizing device\n" ); err =pcistub_seize (dev); - }else -/* Didn't find the device */ - err = -ENODEV ; - + } out:return err; }
@@ -945,7 +949,7 @@ static const struct pci_error_handlers xen_pcibk_error_handler = {static struct pci_driver xen_pcibk_pci_driver = {/* The name should be xen_pciback, but until the tools are updated * we will keep it as pciback. */ - .name ="pciback" , + .name =PCISTUB_DRIVER_NAME , .id_table = pcistub_ids, .probe = pcistub_probe, .remove = pcistub_remove,
Signature · 1 line
2.6.6
kbuild test robot
build botreproduce:
Hi Juergen,
[auto build test WARNING on xen-tip/linux-next]
[also build test WARNING on v4.8-rc4 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/Juergen-Gross/xen-pciback-support-driver_override/20160902-195956 base: https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git linux-next config: x86_64-randconfig-x001-201635 (attached as .config) compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705 reproduce: # save the attached .config to linux build tree make ARCH=x86_64
All warnings (new ones prefixed by >>):
drivers/xen/xen-pciback/pci_stub.c: In function 'pcistub_probe':
>> drivers/xen/xen-pciback/pci_stub.c:545:1: warning: label 'out' defined but not used [-Wunused-label]
out:
^~~vim +/out +545 drivers/xen/xen-pciback/pci_stub.c
30edc14b Konrad Rzeszutek Wilk 2009-10-13 529 && dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
30edc14b Konrad Rzeszutek Wilk 2009-10-13 530 dev_err(&dev->dev, "can't export pci devices that "
30edc14b Konrad Rzeszutek Wilk 2009-10-13 531 "don't have a normal (0) or bridge (1) "
30edc14b Konrad Rzeszutek Wilk 2009-10-13 532 "header type!\n");
30edc14b Konrad Rzeszutek Wilk 2009-10-13 533 err = -ENODEV;
30edc14b Konrad Rzeszutek Wilk 2009-10-13 534 }
30edc14b Konrad Rzeszutek Wilk 2009-10-13 535
c77427ce Juergen Gross 2016-09-02 536 } else if (!dev->driver_override ||
c77427ce Juergen Gross 2016-09-02 537 strcmp(dev->driver_override, PCISTUB_DRIVER_NAME))
30edc14b Konrad Rzeszutek Wilk 2009-10-13 538 /* Didn't find the device */
30edc14b Konrad Rzeszutek Wilk 2009-10-13 539 err = -ENODEV;
30edc14b Konrad Rzeszutek Wilk 2009-10-13 540
c77427ce Juergen Gross 2016-09-02 541 if (!err) {
c77427ce Juergen Gross 2016-09-02 542 dev_info(&dev->dev, "seizing device\n");
c77427ce Juergen Gross 2016-09-02 543 err = pcistub_seize(dev);
c77427ce Juergen Gross 2016-09-02 544 }
30edc14b Konrad Rzeszutek Wilk 2009-10-13 @545 out:
30edc14b Konrad Rzeszutek Wilk 2009-10-13 546 return err;
30edc14b Konrad Rzeszutek Wilk 2009-10-13 547 }
30edc14b Konrad Rzeszutek Wilk 2009-10-13 548
24d8bf1b Konrad Rzeszutek Wilk 2014-04-21 549 /* Called when 'unbind'. This means we must _NOT_ call pci_reset_function or
24d8bf1b Konrad Rzeszutek Wilk 2014-04-21 550 * other functions that take the sysfs lock. */
30edc14b Konrad Rzeszutek Wilk 2009-10-13 551 static void pcistub_remove(struct pci_dev *dev)
30edc14b Konrad Rzeszutek Wilk 2009-10-13 552 {
30edc14b Konrad Rzeszutek Wilk 2009-10-13 553 struct pcistub_device *psdev, *found_psdev = NULL;:::::: The code at line 545 was first introduced by commit
:::::: 30edc14bf39afde24ef7db2de66c91805db80828 xen/pciback: xen pci backend driver.
:::::: TO: Konrad Rzeszutek Wilk <[email protected]> :::::: CC: Konrad Rzeszutek Wilk <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
kbuild test robot
build botreproduce:
Hi Juergen,
[auto build test WARNING on xen-tip/linux-next]
[also build test WARNING on v4.8-rc4 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/Juergen-Gross/xen-pciback-support-driver_override/20160902-195956 base: https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git linux-next config: x86_64-randconfig-x001-201635 (attached as .config) compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705 reproduce: # save the attached .config to linux build tree make ARCH=x86_64
All warnings (new ones prefixed by >>):
drivers/xen/xen-pciback/pci_stub.c: In function 'pcistub_probe':
>> drivers/xen/xen-pciback/pci_stub.c:545:1: warning: label 'out' defined but not used [-Wunused-label]
out:
^~~vim +/out +545 drivers/xen/xen-pciback/pci_stub.c
30edc14b Konrad Rzeszutek Wilk 2009-10-13 529 && dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
30edc14b Konrad Rzeszutek Wilk 2009-10-13 530 dev_err(&dev->dev, "can't export pci devices that "
30edc14b Konrad Rzeszutek Wilk 2009-10-13 531 "don't have a normal (0) or bridge (1) "
30edc14b Konrad Rzeszutek Wilk 2009-10-13 532 "header type!\n");
30edc14b Konrad Rzeszutek Wilk 2009-10-13 533 err = -ENODEV;
30edc14b Konrad Rzeszutek Wilk 2009-10-13 534 }
30edc14b Konrad Rzeszutek Wilk 2009-10-13 535
c77427ce Juergen Gross 2016-09-02 536 } else if (!dev->driver_override ||
c77427ce Juergen Gross 2016-09-02 537 strcmp(dev->driver_override, PCISTUB_DRIVER_NAME))
30edc14b Konrad Rzeszutek Wilk 2009-10-13 538 /* Didn't find the device */
30edc14b Konrad Rzeszutek Wilk 2009-10-13 539 err = -ENODEV;
30edc14b Konrad Rzeszutek Wilk 2009-10-13 540
c77427ce Juergen Gross 2016-09-02 541 if (!err) {
c77427ce Juergen Gross 2016-09-02 542 dev_info(&dev->dev, "seizing device\n");
c77427ce Juergen Gross 2016-09-02 543 err = pcistub_seize(dev);
c77427ce Juergen Gross 2016-09-02 544 }
30edc14b Konrad Rzeszutek Wilk 2009-10-13 @545 out:
30edc14b Konrad Rzeszutek Wilk 2009-10-13 546 return err;
30edc14b Konrad Rzeszutek Wilk 2009-10-13 547 }
30edc14b Konrad Rzeszutek Wilk 2009-10-13 548
24d8bf1b Konrad Rzeszutek Wilk 2014-04-21 549 /* Called when 'unbind'. This means we must _NOT_ call pci_reset_function or
24d8bf1b Konrad Rzeszutek Wilk 2014-04-21 550 * other functions that take the sysfs lock. */
30edc14b Konrad Rzeszutek Wilk 2009-10-13 551 static void pcistub_remove(struct pci_dev *dev)
30edc14b Konrad Rzeszutek Wilk 2009-10-13 552 {
30edc14b Konrad Rzeszutek Wilk 2009-10-13 553 struct pcistub_device *psdev, *found_psdev = NULL;:::::: The code at line 545 was first introduced by commit
:::::: 30edc14bf39afde24ef7db2de66c91805db80828 xen/pciback: xen pci backend driver.
:::::: TO: Konrad Rzeszutek Wilk <[email protected]> :::::: CC: Konrad Rzeszutek Wilk <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel