Re: [PATCH v2 1/3] PCI: Data corruption happening due to race condition

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

 



Hi Hari,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on pci/next]
[also build test ERROR on v4.18-rc2 next-20180629]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Hari-Vyas/PCI-Data-corruption-happening-due-to-race-condition/20180629-203647
base:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: x86_64-randconfig-x005-201825 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: the linux-review/Hari-Vyas/PCI-Data-corruption-happening-due-to-race-condition/20180629-203647 HEAD 75ee48282af54fe77cb0ac092623577327440033 builds fine.
      It only hurts bisectibility.

All errors (new ones prefixed by >>):

   drivers/pci/hotplug/acpiphp_glue.c: In function 'enable_slot':
>> drivers/pci/hotplug/acpiphp_glue.c:512:13: error: 'struct pci_dev' has no member named 'is_added'; did you mean 'is_managed'?
      if (!dev->is_added)
                ^~~~~~~~
                is_managed

vim +512 drivers/pci/hotplug/acpiphp_glue.c

84c8b58ed3 Mika Westerberg   2018-05-29  456  
^1da177e4c Linus Torvalds    2005-04-16  457  /**
a1d0abcea8 Rafael J. Wysocki 2013-07-13  458   * enable_slot - enable, configure a slot
^1da177e4c Linus Torvalds    2005-04-16  459   * @slot: slot to be enabled
^1da177e4c Linus Torvalds    2005-04-16  460   *
^1da177e4c Linus Torvalds    2005-04-16  461   * This function should be called per *physical slot*,
^1da177e4c Linus Torvalds    2005-04-16  462   * not per each slot object in ACPI namespace.
^1da177e4c Linus Torvalds    2005-04-16  463   */
10874f5a00 Bjorn Helgaas     2014-04-14  464  static void enable_slot(struct acpiphp_slot *slot)
^1da177e4c Linus Torvalds    2005-04-16  465  {
^1da177e4c Linus Torvalds    2005-04-16  466  	struct pci_dev *dev;
bda46dbb66 Rafael J. Wysocki 2013-07-13  467  	struct pci_bus *bus = slot->bus;
^1da177e4c Linus Torvalds    2005-04-16  468  	struct acpiphp_func *func;
84c8b58ed3 Mika Westerberg   2018-05-29  469  
84c8b58ed3 Mika Westerberg   2018-05-29  470  	if (bus->self && hotplug_is_native(bus->self)) {
84c8b58ed3 Mika Westerberg   2018-05-29  471  		/*
84c8b58ed3 Mika Westerberg   2018-05-29  472  		 * If native hotplug is used, it will take care of hotplug
84c8b58ed3 Mika Westerberg   2018-05-29  473  		 * slot management and resource allocation for hotplug
84c8b58ed3 Mika Westerberg   2018-05-29  474  		 * bridges. However, ACPI hotplug may still be used for
84c8b58ed3 Mika Westerberg   2018-05-29  475  		 * non-hotplug bridges to bring in additional devices such
84c8b58ed3 Mika Westerberg   2018-05-29  476  		 * as a Thunderbolt host controller.
84c8b58ed3 Mika Westerberg   2018-05-29  477  		 */
84c8b58ed3 Mika Westerberg   2018-05-29  478  		for_each_pci_bridge(dev, bus) {
84c8b58ed3 Mika Westerberg   2018-05-29  479  			if (PCI_SLOT(dev->devfn) == slot->device)
84c8b58ed3 Mika Westerberg   2018-05-29  480  				acpiphp_native_scan_bridge(dev);
84c8b58ed3 Mika Westerberg   2018-05-29  481  		}
84c8b58ed3 Mika Westerberg   2018-05-29  482  		pci_assign_unassigned_bridge_resources(bus->self);
84c8b58ed3 Mika Westerberg   2018-05-29  483  	} else {
d66ecb7220 Jiang Liu         2013-06-23  484  		LIST_HEAD(add_list);
84c8b58ed3 Mika Westerberg   2018-05-29  485  		int max, pass;
^1da177e4c Linus Torvalds    2005-04-16  486  
ab1225901d Mika Westerberg   2013-10-30  487  		acpiphp_rescan_slot(slot);
15a1ae7487 Kristen Accardi   2006-02-23  488  		max = acpiphp_max_busnr(bus);
42f49a6ae5 Rajesh Shah       2005-04-28  489  		for (pass = 0; pass < 2; pass++) {
24a0c654d7 Andy Shevchenko   2017-10-20  490  			for_each_pci_bridge(dev, bus) {
42f49a6ae5 Rajesh Shah       2005-04-28  491  				if (PCI_SLOT(dev->devfn) != slot->device)
42f49a6ae5 Rajesh Shah       2005-04-28  492  					continue;
a1d0abcea8 Rafael J. Wysocki 2013-07-13  493  
42f49a6ae5 Rajesh Shah       2005-04-28  494  				max = pci_scan_bridge(bus, dev, max, pass);
1f96a965e3 Yinghai Lu        2013-01-21  495  				if (pass && dev->subordinate) {
1f96a965e3 Yinghai Lu        2013-01-21  496  					check_hotplug_bridge(slot, dev);
d66ecb7220 Jiang Liu         2013-06-23  497  					pcibios_resource_survey_bus(dev->subordinate);
84c8b58ed3 Mika Westerberg   2018-05-29  498  					__pci_bus_size_bridges(dev->subordinate,
84c8b58ed3 Mika Westerberg   2018-05-29  499  							       &add_list);
c64b5eead9 Kristen Accardi   2005-12-14  500  				}
42f49a6ae5 Rajesh Shah       2005-04-28  501  			}
1f96a965e3 Yinghai Lu        2013-01-21  502  		}
d66ecb7220 Jiang Liu         2013-06-23  503  		__pci_bus_assign_resources(bus, &add_list, NULL);
84c8b58ed3 Mika Westerberg   2018-05-29  504  	}
2dc41281b1 Rafael J. Wysocki 2013-09-06  505  
8e5dce3522 Kristen Accardi   2005-10-18  506  	acpiphp_sanitize_bus(bus);
81ee57326c Bjorn Helgaas     2014-08-28  507  	pcie_bus_configure_settings(bus);
d060705091 Shaohua Li        2010-02-25  508  	acpiphp_set_acpi_region(slot);
69643e4829 Ian Campbell      2011-05-11  509  
69643e4829 Ian Campbell      2011-05-11  510  	list_for_each_entry(dev, &bus->devices, bus_list) {
69643e4829 Ian Campbell      2011-05-11  511  		/* Assume that newly added devices are powered on already. */
69643e4829 Ian Campbell      2011-05-11 @512  		if (!dev->is_added)
69643e4829 Ian Campbell      2011-05-11  513  			dev->current_state = PCI_D0;
69643e4829 Ian Campbell      2011-05-11  514  	}
69643e4829 Ian Campbell      2011-05-11  515  
42f49a6ae5 Rajesh Shah       2005-04-28  516  	pci_bus_add_devices(bus);
42f49a6ae5 Rajesh Shah       2005-04-28  517  
f382a086f3 Amos Kong         2011-11-25  518  	slot->flags |= SLOT_ENABLED;
58c08628c4 Alex Chiang       2009-10-26  519  	list_for_each_entry(func, &slot->funcs, sibling) {
9d911d7903 Alex Chiang       2009-05-21  520  		dev = pci_get_slot(bus, PCI_DEVFN(slot->device,
^1da177e4c Linus Torvalds    2005-04-16  521  						  func->function));
f382a086f3 Amos Kong         2011-11-25  522  		if (!dev) {
f382a086f3 Amos Kong         2011-11-25  523  			/* Do not set SLOT_ENABLED flag if some funcs
f382a086f3 Amos Kong         2011-11-25  524  			   are not added. */
9337a49362 Mika Westerberg   2018-05-24  525  			slot->flags &= ~SLOT_ENABLED;
551bcb75b3 MUNEDA Takahiro   2006-03-22  526  			continue;
f382a086f3 Amos Kong         2011-11-25  527  		}
^1da177e4c Linus Torvalds    2005-04-16  528  	}
^1da177e4c Linus Torvalds    2005-04-16  529  }
^1da177e4c Linus Torvalds    2005-04-16  530  

:::::: The code at line 512 was first introduced by commit
:::::: 69643e4829c5cd13bafe44a6b9f3eb2086e0f618 PCI hotplug: acpiphp: assume device is in state D0 after powering on a slot.

:::::: TO: Ian Campbell <ian.campbell@xxxxxxxxxx>
:::::: CC: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux