Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'acpi-4.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fix from Rafael Wysocki:
"This fixes the ACPI-based enumeration of some I2C and SPI devices
broken in 4.11.

Specifics:

- I2C and SPI devices are expected to be enumerated by the I2C and
SPI subsystems, respectively, but due to a change made during the
4.11 cycle, in some cases the ACPI core marks them as already
enumerated which causes the I2C and SPI subsystems to overlook
them, so fix that (Jarkko Nikula)"

* tag 'acpi-4.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / scan: Fix enumeration for special SPI and I2C devices

+39 -31
+37 -30
drivers/acpi/scan.c
··· 1428 1428 adev->flags.coherent_dma = cca; 1429 1429 } 1430 1430 1431 + static int acpi_check_spi_i2c_slave(struct acpi_resource *ares, void *data) 1432 + { 1433 + bool *is_spi_i2c_slave_p = data; 1434 + 1435 + if (ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS) 1436 + return 1; 1437 + 1438 + /* 1439 + * devices that are connected to UART still need to be enumerated to 1440 + * platform bus 1441 + */ 1442 + if (ares->data.common_serial_bus.type != ACPI_RESOURCE_SERIAL_TYPE_UART) 1443 + *is_spi_i2c_slave_p = true; 1444 + 1445 + /* no need to do more checking */ 1446 + return -1; 1447 + } 1448 + 1449 + static bool acpi_is_spi_i2c_slave(struct acpi_device *device) 1450 + { 1451 + struct list_head resource_list; 1452 + bool is_spi_i2c_slave = false; 1453 + 1454 + INIT_LIST_HEAD(&resource_list); 1455 + acpi_dev_get_resources(device, &resource_list, acpi_check_spi_i2c_slave, 1456 + &is_spi_i2c_slave); 1457 + acpi_dev_free_resource_list(&resource_list); 1458 + 1459 + return is_spi_i2c_slave; 1460 + } 1461 + 1431 1462 void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, 1432 1463 int type, unsigned long long sta) 1433 1464 { ··· 1474 1443 acpi_bus_get_flags(device); 1475 1444 device->flags.match_driver = false; 1476 1445 device->flags.initialized = true; 1446 + device->flags.spi_i2c_slave = acpi_is_spi_i2c_slave(device); 1477 1447 acpi_device_clear_enumerated(device); 1478 1448 device_initialize(&device->dev); 1479 1449 dev_set_uevent_suppress(&device->dev, true); ··· 1759 1727 return AE_OK; 1760 1728 } 1761 1729 1762 - static int acpi_check_spi_i2c_slave(struct acpi_resource *ares, void *data) 1763 - { 1764 - bool *is_spi_i2c_slave_p = data; 1765 - 1766 - if (ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS) 1767 - return 1; 1768 - 1769 - /* 1770 - * devices that are connected to UART still need to be enumerated to 1771 - * platform bus 1772 - */ 1773 - if (ares->data.common_serial_bus.type != ACPI_RESOURCE_SERIAL_TYPE_UART) 1774 - *is_spi_i2c_slave_p = true; 1775 - 1776 - /* no need to do more checking */ 1777 - return -1; 1778 - } 1779 - 1780 1730 static void acpi_default_enumeration(struct acpi_device *device) 1781 1731 { 1782 - struct list_head resource_list; 1783 - bool is_spi_i2c_slave = false; 1784 - 1785 1732 /* 1786 1733 * Do not enumerate SPI/I2C slaves as they will be enumerated by their 1787 1734 * respective parents. 1788 1735 */ 1789 - INIT_LIST_HEAD(&resource_list); 1790 - acpi_dev_get_resources(device, &resource_list, acpi_check_spi_i2c_slave, 1791 - &is_spi_i2c_slave); 1792 - acpi_dev_free_resource_list(&resource_list); 1793 - if (!is_spi_i2c_slave) { 1736 + if (!device->flags.spi_i2c_slave) { 1794 1737 acpi_create_platform_device(device, NULL); 1795 1738 acpi_device_set_enumerated(device); 1796 1739 } else { ··· 1861 1854 return; 1862 1855 1863 1856 device->flags.match_driver = true; 1864 - if (ret > 0) { 1857 + if (ret > 0 && !device->flags.spi_i2c_slave) { 1865 1858 acpi_device_set_enumerated(device); 1866 1859 goto ok; 1867 1860 } ··· 1870 1863 if (ret < 0) 1871 1864 return; 1872 1865 1873 - if (device->pnp.type.platform_id) 1874 - acpi_default_enumeration(device); 1875 - else 1866 + if (!device->pnp.type.platform_id && !device->flags.spi_i2c_slave) 1876 1867 acpi_device_set_enumerated(device); 1868 + else 1869 + acpi_default_enumeration(device); 1877 1870 1878 1871 ok: 1879 1872 list_for_each_entry(child, &device->children, node)
+2 -1
include/acpi/acpi_bus.h
··· 210 210 u32 of_compatible_ok:1; 211 211 u32 coherent_dma:1; 212 212 u32 cca_seen:1; 213 - u32 reserved:20; 213 + u32 spi_i2c_slave:1; 214 + u32 reserved:19; 214 215 }; 215 216 216 217 /* File System */