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

Merge tag 'i2c-for-7.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fix from Wolfram Sang:
"A revert for the i801 driver restoring old locking behaviour"

* tag 'i2c-for-7.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: i801: Revert "i2c: i801: replace acpi_lock with I2C bus lock"

+10 -4
+10 -4
drivers/i2c/busses/i2c-i801.c
··· 310 311 /* 312 * If set to true the host controller registers are reserved for 313 - * ACPI AML use. 314 */ 315 bool acpi_reserved; 316 }; 317 318 #define FEATURE_SMBUS_PEC BIT(0) ··· 895 int hwpec, ret; 896 struct i801_priv *priv = i2c_get_adapdata(adap); 897 898 - if (priv->acpi_reserved) 899 return -EBUSY; 900 901 pm_runtime_get_sync(&priv->pci_dev->dev); 902 ··· 939 iowrite8(SMBHSTSTS_INUSE_STS | STATUS_FLAGS, SMBHSTSTS(priv)); 940 941 pm_runtime_put_autosuspend(&priv->pci_dev->dev); 942 return ret; 943 } 944 ··· 1470 * further access from the driver itself. This device is now owned 1471 * by the system firmware. 1472 */ 1473 - i2c_lock_bus(&priv->adapter, I2C_LOCK_SEGMENT); 1474 1475 if (!priv->acpi_reserved && i801_acpi_is_smbus_ioport(priv, address)) { 1476 priv->acpi_reserved = true; ··· 1490 else 1491 status = acpi_os_write_port(address, (u32)*value, bits); 1492 1493 - i2c_unlock_bus(&priv->adapter, I2C_LOCK_SEGMENT); 1494 1495 return status; 1496 } ··· 1550 priv->adapter.dev.parent = &dev->dev; 1551 acpi_use_parent_companion(&priv->adapter.dev); 1552 priv->adapter.retries = 3; 1553 1554 priv->pci_dev = dev; 1555 priv->features = id->driver_data;
··· 310 311 /* 312 * If set to true the host controller registers are reserved for 313 + * ACPI AML use. Needs extra protection by acpi_lock. 314 */ 315 bool acpi_reserved; 316 + struct mutex acpi_lock; 317 }; 318 319 #define FEATURE_SMBUS_PEC BIT(0) ··· 894 int hwpec, ret; 895 struct i801_priv *priv = i2c_get_adapdata(adap); 896 897 + mutex_lock(&priv->acpi_lock); 898 + if (priv->acpi_reserved) { 899 + mutex_unlock(&priv->acpi_lock); 900 return -EBUSY; 901 + } 902 903 pm_runtime_get_sync(&priv->pci_dev->dev); 904 ··· 935 iowrite8(SMBHSTSTS_INUSE_STS | STATUS_FLAGS, SMBHSTSTS(priv)); 936 937 pm_runtime_put_autosuspend(&priv->pci_dev->dev); 938 + mutex_unlock(&priv->acpi_lock); 939 return ret; 940 } 941 ··· 1465 * further access from the driver itself. This device is now owned 1466 * by the system firmware. 1467 */ 1468 + mutex_lock(&priv->acpi_lock); 1469 1470 if (!priv->acpi_reserved && i801_acpi_is_smbus_ioport(priv, address)) { 1471 priv->acpi_reserved = true; ··· 1485 else 1486 status = acpi_os_write_port(address, (u32)*value, bits); 1487 1488 + mutex_unlock(&priv->acpi_lock); 1489 1490 return status; 1491 } ··· 1545 priv->adapter.dev.parent = &dev->dev; 1546 acpi_use_parent_companion(&priv->adapter.dev); 1547 priv->adapter.retries = 3; 1548 + mutex_init(&priv->acpi_lock); 1549 1550 priv->pci_dev = dev; 1551 priv->features = id->driver_data;