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

Merge branches 'acpi-smbus', 'acpi-ec' and 'acpi-pci'

* acpi-smbus:
Revert "ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook"
ACPI / SMBus: Fix boot stalls / high CPU caused by reentrant code

* acpi-ec:
ACPI-EC: Drop unnecessary check made before calling acpi_ec_delete_query()

* acpi-pci:
PCI: Fix OF logic in pci_dma_configure()

+10 -44
+1 -1
drivers/acpi/ec.c
··· 1103 1103 } 1104 1104 1105 1105 err_exit: 1106 - if (result && q) 1106 + if (result) 1107 1107 acpi_ec_delete_query(q); 1108 1108 if (data) 1109 1109 *data = value;
+7 -41
drivers/acpi/sbshc.c
··· 14 14 #include <linux/delay.h> 15 15 #include <linux/module.h> 16 16 #include <linux/interrupt.h> 17 - #include <linux/dmi.h> 18 17 #include "sbshc.h" 19 18 20 19 #define PREFIX "ACPI: " ··· 29 30 u8 query_bit; 30 31 smbus_alarm_callback callback; 31 32 void *context; 33 + bool done; 32 34 }; 33 35 34 36 static int acpi_smbus_hc_add(struct acpi_device *device); ··· 88 88 ACPI_SMB_ALARM_DATA = 0x26, /* 2 bytes alarm data */ 89 89 }; 90 90 91 - static bool macbook; 92 - 93 91 static inline int smb_hc_read(struct acpi_smb_hc *hc, u8 address, u8 *data) 94 92 { 95 93 return ec_read(hc->offset + address, data); ··· 98 100 return ec_write(hc->offset + address, data); 99 101 } 100 102 101 - static inline int smb_check_done(struct acpi_smb_hc *hc) 102 - { 103 - union acpi_smb_status status = {.raw = 0}; 104 - smb_hc_read(hc, ACPI_SMB_STATUS, &status.raw); 105 - return status.fields.done && (status.fields.status == SMBUS_OK); 106 - } 107 - 108 103 static int wait_transaction_complete(struct acpi_smb_hc *hc, int timeout) 109 104 { 110 - if (wait_event_timeout(hc->wait, smb_check_done(hc), 111 - msecs_to_jiffies(timeout))) 105 + if (wait_event_timeout(hc->wait, hc->done, msecs_to_jiffies(timeout))) 112 106 return 0; 113 - /* 114 - * After the timeout happens, OS will try to check the status of SMbus. 115 - * If the status is what OS expected, it will be regarded as the bogus 116 - * timeout. 117 - */ 118 - if (smb_check_done(hc)) 119 - return 0; 120 - else 121 - return -ETIME; 107 + return -ETIME; 122 108 } 123 109 124 110 static int acpi_smbus_transaction(struct acpi_smb_hc *hc, u8 protocol, ··· 117 135 } 118 136 119 137 mutex_lock(&hc->lock); 120 - if (macbook) 121 - udelay(5); 138 + hc->done = false; 122 139 if (smb_hc_read(hc, ACPI_SMB_PROTOCOL, &temp)) 123 140 goto end; 124 141 if (temp) { ··· 216 235 if (smb_hc_read(hc, ACPI_SMB_STATUS, &status.raw)) 217 236 return 0; 218 237 /* Check if it is only a completion notify */ 219 - if (status.fields.done) 238 + if (status.fields.done && status.fields.status == SMBUS_OK) { 239 + hc->done = true; 220 240 wake_up(&hc->wait); 241 + } 221 242 if (!status.fields.alarm) 222 243 return 0; 223 244 mutex_lock(&hc->lock); ··· 245 262 acpi_handle handle, acpi_ec_query_func func, 246 263 void *data); 247 264 248 - static int macbook_dmi_match(const struct dmi_system_id *d) 249 - { 250 - pr_debug("Detected MacBook, enabling workaround\n"); 251 - macbook = true; 252 - return 0; 253 - } 254 - 255 - static struct dmi_system_id acpi_smbus_dmi_table[] = { 256 - { macbook_dmi_match, "Apple MacBook", { 257 - DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), 258 - DMI_MATCH(DMI_PRODUCT_NAME, "MacBook") }, 259 - }, 260 - { }, 261 - }; 262 - 263 265 static int acpi_smbus_hc_add(struct acpi_device *device) 264 266 { 265 267 int status; 266 268 unsigned long long val; 267 269 struct acpi_smb_hc *hc; 268 - 269 - dmi_check_system(acpi_smbus_dmi_table); 270 270 271 271 if (!device) 272 272 return -EINVAL;
+2 -2
drivers/pci/probe.c
··· 1685 1685 { 1686 1686 struct device *bridge = pci_get_host_bridge_device(dev); 1687 1687 1688 - if (IS_ENABLED(CONFIG_OF) && dev->dev.of_node) { 1689 - if (bridge->parent) 1688 + if (IS_ENABLED(CONFIG_OF) && 1689 + bridge->parent && bridge->parent->of_node) { 1690 1690 of_dma_configure(&dev->dev, bridge->parent->of_node); 1691 1691 } else if (has_acpi_companion(bridge)) { 1692 1692 struct acpi_device *adev = to_acpi_device_node(bridge->fwnode);