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 branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
"I2C has quite some regression fixes this time.

One is also related to watchdogs, we have proper acks from Guenter for
them"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: acpi: put device when verifying client fails
misc: eeprom: at24: fix regulator underflow
i2c: gpio: suppress error on probe defer
macintosh: windfarm: fix MODINFO regression
i2c: designware-pci: Fix BUG_ON during device removal
i2c: i801: Do not add ICH_RES_IO_SMI for the iTCO_wdt device
watchdog: iTCO_wdt: Make ICH_RES_IO_SMI optional
watchdog: iTCO_wdt: Export vendorsupport

+102 -56
+1
drivers/i2c/busses/i2c-designware-pcidrv.c
··· 313 313 pm_runtime_get_noresume(&pdev->dev); 314 314 315 315 i2c_del_adapter(&dev->adapter); 316 + devm_free_irq(&pdev->dev, dev->irq, dev); 316 317 pci_free_irq_vectors(pdev); 317 318 } 318 319
+1 -1
drivers/i2c/busses/i2c-gpio.c
··· 348 348 if (ret == -ENOENT) 349 349 retdesc = ERR_PTR(-EPROBE_DEFER); 350 350 351 - if (ret != -EPROBE_DEFER) 351 + if (PTR_ERR(retdesc) != -EPROBE_DEFER) 352 352 dev_err(dev, "error trying to get descriptor: %d\n", ret); 353 353 354 354 return retdesc;
+12 -33
drivers/i2c/busses/i2c-i801.c
··· 132 132 #define TCOBASE 0x050 133 133 #define TCOCTL 0x054 134 134 135 - #define ACPIBASE 0x040 136 - #define ACPIBASE_SMI_OFF 0x030 137 - #define ACPICTRL 0x044 138 - #define ACPICTRL_EN 0x080 139 - 140 135 #define SBREG_BAR 0x10 141 136 #define SBREG_SMBCTRL 0xc6000c 142 137 #define SBREG_SMBCTRL_DNV 0xcf000c ··· 1548 1553 pci_bus_write_config_byte(pci_dev->bus, devfn, 0xe1, hidden); 1549 1554 spin_unlock(&p2sb_spinlock); 1550 1555 1551 - res = &tco_res[ICH_RES_MEM_OFF]; 1556 + res = &tco_res[1]; 1552 1557 if (pci_dev->device == PCI_DEVICE_ID_INTEL_DNV_SMBUS) 1553 1558 res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL_DNV; 1554 1559 else ··· 1558 1563 res->flags = IORESOURCE_MEM; 1559 1564 1560 1565 return platform_device_register_resndata(&pci_dev->dev, "iTCO_wdt", -1, 1561 - tco_res, 3, &spt_tco_platform_data, 1566 + tco_res, 2, &spt_tco_platform_data, 1562 1567 sizeof(spt_tco_platform_data)); 1563 1568 } 1564 1569 ··· 1571 1576 i801_add_tco_cnl(struct i801_priv *priv, struct pci_dev *pci_dev, 1572 1577 struct resource *tco_res) 1573 1578 { 1574 - return platform_device_register_resndata(&pci_dev->dev, "iTCO_wdt", -1, 1575 - tco_res, 2, &cnl_tco_platform_data, 1576 - sizeof(cnl_tco_platform_data)); 1579 + return platform_device_register_resndata(&pci_dev->dev, 1580 + "iTCO_wdt", -1, tco_res, 1, &cnl_tco_platform_data, 1581 + sizeof(cnl_tco_platform_data)); 1577 1582 } 1578 1583 1579 1584 static void i801_add_tco(struct i801_priv *priv) 1580 1585 { 1581 - u32 base_addr, tco_base, tco_ctl, ctrl_val; 1582 1586 struct pci_dev *pci_dev = priv->pci_dev; 1583 - struct resource tco_res[3], *res; 1584 - unsigned int devfn; 1587 + struct resource tco_res[2], *res; 1588 + u32 tco_base, tco_ctl; 1585 1589 1586 1590 /* If we have ACPI based watchdog use that instead */ 1587 1591 if (acpi_has_watchdog()) ··· 1595 1601 return; 1596 1602 1597 1603 memset(tco_res, 0, sizeof(tco_res)); 1598 - 1599 - res = &tco_res[ICH_RES_IO_TCO]; 1604 + /* 1605 + * Always populate the main iTCO IO resource here. The second entry 1606 + * for NO_REBOOT MMIO is filled by the SPT specific function. 1607 + */ 1608 + res = &tco_res[0]; 1600 1609 res->start = tco_base & ~1; 1601 1610 res->end = res->start + 32 - 1; 1602 1611 res->flags = IORESOURCE_IO; 1603 - 1604 - /* 1605 - * Power Management registers. 1606 - */ 1607 - devfn = PCI_DEVFN(PCI_SLOT(pci_dev->devfn), 2); 1608 - pci_bus_read_config_dword(pci_dev->bus, devfn, ACPIBASE, &base_addr); 1609 - 1610 - res = &tco_res[ICH_RES_IO_SMI]; 1611 - res->start = (base_addr & ~1) + ACPIBASE_SMI_OFF; 1612 - res->end = res->start + 3; 1613 - res->flags = IORESOURCE_IO; 1614 - 1615 - /* 1616 - * Enable the ACPI I/O space. 1617 - */ 1618 - pci_bus_read_config_dword(pci_dev->bus, devfn, ACPICTRL, &ctrl_val); 1619 - ctrl_val |= ACPICTRL_EN; 1620 - pci_bus_write_config_dword(pci_dev->bus, devfn, ACPICTRL, ctrl_val); 1621 1612 1622 1613 if (priv->features & FEATURE_TCO_CNL) 1623 1614 priv->tco_pdev = i801_add_tco_cnl(priv, pci_dev, tco_res);
+9 -1
drivers/i2c/i2c-core-acpi.c
··· 394 394 static struct i2c_client *i2c_acpi_find_client_by_adev(struct acpi_device *adev) 395 395 { 396 396 struct device *dev; 397 + struct i2c_client *client; 397 398 398 399 dev = bus_find_device_by_acpi_dev(&i2c_bus_type, adev); 399 - return dev ? i2c_verify_client(dev) : NULL; 400 + if (!dev) 401 + return NULL; 402 + 403 + client = i2c_verify_client(dev); 404 + if (!client) 405 + put_device(dev); 406 + 407 + return client; 400 408 } 401 409 402 410 static int i2c_acpi_notify(struct notifier_block *nb, unsigned long value,
+7
drivers/macintosh/windfarm_ad7417_sensor.c
··· 312 312 }; 313 313 MODULE_DEVICE_TABLE(i2c, wf_ad7417_id); 314 314 315 + static const struct of_device_id wf_ad7417_of_id[] = { 316 + { .compatible = "ad7417", }, 317 + { } 318 + }; 319 + MODULE_DEVICE_TABLE(of, wf_ad7417_of_id); 320 + 315 321 static struct i2c_driver wf_ad7417_driver = { 316 322 .driver = { 317 323 .name = "wf_ad7417", 324 + .of_match_table = wf_ad7417_of_id, 318 325 }, 319 326 .probe = wf_ad7417_probe, 320 327 .remove = wf_ad7417_remove,
+7
drivers/macintosh/windfarm_fcu_controls.c
··· 580 580 }; 581 581 MODULE_DEVICE_TABLE(i2c, wf_fcu_id); 582 582 583 + static const struct of_device_id wf_fcu_of_id[] = { 584 + { .compatible = "fcu", }, 585 + { } 586 + }; 587 + MODULE_DEVICE_TABLE(of, wf_fcu_of_id); 588 + 583 589 static struct i2c_driver wf_fcu_driver = { 584 590 .driver = { 585 591 .name = "wf_fcu", 592 + .of_match_table = wf_fcu_of_id, 586 593 }, 587 594 .probe = wf_fcu_probe, 588 595 .remove = wf_fcu_remove,
+15 -1
drivers/macintosh/windfarm_lm75_sensor.c
··· 14 14 #include <linux/init.h> 15 15 #include <linux/wait.h> 16 16 #include <linux/i2c.h> 17 + #include <linux/of_device.h> 17 18 #include <asm/prom.h> 18 19 #include <asm/machdep.h> 19 20 #include <asm/io.h> ··· 92 91 const struct i2c_device_id *id) 93 92 { 94 93 struct wf_lm75_sensor *lm; 95 - int rc, ds1775 = id->driver_data; 94 + int rc, ds1775; 96 95 const char *name, *loc; 96 + 97 + if (id) 98 + ds1775 = id->driver_data; 99 + else 100 + ds1775 = !!of_device_get_match_data(&client->dev); 97 101 98 102 DBG("wf_lm75: creating %s device at address 0x%02x\n", 99 103 ds1775 ? "ds1775" : "lm75", client->addr); ··· 170 164 }; 171 165 MODULE_DEVICE_TABLE(i2c, wf_lm75_id); 172 166 167 + static const struct of_device_id wf_lm75_of_id[] = { 168 + { .compatible = "lm75", .data = (void *)0}, 169 + { .compatible = "ds1775", .data = (void *)1 }, 170 + { } 171 + }; 172 + MODULE_DEVICE_TABLE(of, wf_lm75_of_id); 173 + 173 174 static struct i2c_driver wf_lm75_driver = { 174 175 .driver = { 175 176 .name = "wf_lm75", 177 + .of_match_table = wf_lm75_of_id, 176 178 }, 177 179 .probe = wf_lm75_probe, 178 180 .remove = wf_lm75_remove,
+7
drivers/macintosh/windfarm_lm87_sensor.c
··· 166 166 }; 167 167 MODULE_DEVICE_TABLE(i2c, wf_lm87_id); 168 168 169 + static const struct of_device_id wf_lm87_of_id[] = { 170 + { .compatible = "lm87cimt", }, 171 + { } 172 + }; 173 + MODULE_DEVICE_TABLE(of, wf_lm87_of_id); 174 + 169 175 static struct i2c_driver wf_lm87_driver = { 170 176 .driver = { 171 177 .name = "wf_lm87", 178 + .of_match_table = wf_lm87_of_id, 172 179 }, 173 180 .probe = wf_lm87_probe, 174 181 .remove = wf_lm87_remove,
+7
drivers/macintosh/windfarm_max6690_sensor.c
··· 120 120 }; 121 121 MODULE_DEVICE_TABLE(i2c, wf_max6690_id); 122 122 123 + static const struct of_device_id wf_max6690_of_id[] = { 124 + { .compatible = "max6690", }, 125 + { } 126 + }; 127 + MODULE_DEVICE_TABLE(of, wf_max6690_of_id); 128 + 123 129 static struct i2c_driver wf_max6690_driver = { 124 130 .driver = { 125 131 .name = "wf_max6690", 132 + .of_match_table = wf_max6690_of_id, 126 133 }, 127 134 .probe = wf_max6690_probe, 128 135 .remove = wf_max6690_remove,
+7
drivers/macintosh/windfarm_smu_sat.c
··· 341 341 }; 342 342 MODULE_DEVICE_TABLE(i2c, wf_sat_id); 343 343 344 + static const struct of_device_id wf_sat_of_id[] = { 345 + { .compatible = "smu-sat", }, 346 + { } 347 + }; 348 + MODULE_DEVICE_TABLE(of, wf_sat_of_id); 349 + 344 350 static struct i2c_driver wf_sat_driver = { 345 351 .driver = { 346 352 .name = "wf_smu_sat", 353 + .of_match_table = wf_sat_of_id, 347 354 }, 348 355 .probe = wf_sat_probe, 349 356 .remove = wf_sat_remove,
+2 -1
drivers/misc/eeprom/at24.c
··· 712 712 * chip is functional. 713 713 */ 714 714 err = at24_read(at24, 0, &test_byte, 1); 715 - pm_runtime_idle(dev); 716 715 if (err) { 717 716 pm_runtime_disable(dev); 718 717 regulator_disable(at24->vcc_reg); 719 718 return -ENODEV; 720 719 } 720 + 721 + pm_runtime_idle(dev); 721 722 722 723 if (writable) 723 724 dev_info(dev, "%u byte %s EEPROM, writable, %u bytes/write\n",
+2
drivers/watchdog/iTCO_vendor.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 /* iTCO Vendor Specific Support hooks */ 3 3 #ifdef CONFIG_ITCO_VENDOR_SUPPORT 4 + extern int iTCO_vendorsupport; 4 5 extern void iTCO_vendor_pre_start(struct resource *, unsigned int); 5 6 extern void iTCO_vendor_pre_stop(struct resource *); 6 7 extern int iTCO_vendor_check_noreboot_on(void); 7 8 #else 9 + #define iTCO_vendorsupport 0 8 10 #define iTCO_vendor_pre_start(acpibase, heartbeat) {} 9 11 #define iTCO_vendor_pre_stop(acpibase) {} 10 12 #define iTCO_vendor_check_noreboot_on() 1
+9 -7
drivers/watchdog/iTCO_vendor_support.c
··· 39 39 /* Broken BIOS */ 40 40 #define BROKEN_BIOS 911 41 41 42 - static int vendorsupport; 43 - module_param(vendorsupport, int, 0); 42 + int iTCO_vendorsupport; 43 + EXPORT_SYMBOL(iTCO_vendorsupport); 44 + 45 + module_param_named(vendorsupport, iTCO_vendorsupport, int, 0); 44 46 MODULE_PARM_DESC(vendorsupport, "iTCO vendor specific support mode, default=" 45 47 "0 (none), 1=SuperMicro Pent3, 911=Broken SMI BIOS"); 46 48 ··· 154 152 void iTCO_vendor_pre_start(struct resource *smires, 155 153 unsigned int heartbeat) 156 154 { 157 - switch (vendorsupport) { 155 + switch (iTCO_vendorsupport) { 158 156 case SUPERMICRO_OLD_BOARD: 159 157 supermicro_old_pre_start(smires); 160 158 break; ··· 167 165 168 166 void iTCO_vendor_pre_stop(struct resource *smires) 169 167 { 170 - switch (vendorsupport) { 168 + switch (iTCO_vendorsupport) { 171 169 case SUPERMICRO_OLD_BOARD: 172 170 supermicro_old_pre_stop(smires); 173 171 break; ··· 180 178 181 179 int iTCO_vendor_check_noreboot_on(void) 182 180 { 183 - switch (vendorsupport) { 181 + switch (iTCO_vendorsupport) { 184 182 case SUPERMICRO_OLD_BOARD: 185 183 return 0; 186 184 default: ··· 191 189 192 190 static int __init iTCO_vendor_init_module(void) 193 191 { 194 - if (vendorsupport == SUPERMICRO_NEW_BOARD) { 192 + if (iTCO_vendorsupport == SUPERMICRO_NEW_BOARD) { 195 193 pr_warn("Option vendorsupport=%d is no longer supported, " 196 194 "please use the w83627hf_wdt driver instead\n", 197 195 SUPERMICRO_NEW_BOARD); 198 196 return -EINVAL; 199 197 } 200 - pr_info("vendor-support=%d\n", vendorsupport); 198 + pr_info("vendor-support=%d\n", iTCO_vendorsupport); 201 199 return 0; 202 200 } 203 201
+16 -12
drivers/watchdog/iTCO_wdt.c
··· 459 459 if (!p->tco_res) 460 460 return -ENODEV; 461 461 462 - p->smi_res = platform_get_resource(pdev, IORESOURCE_IO, ICH_RES_IO_SMI); 463 - if (!p->smi_res) 464 - return -ENODEV; 465 - 466 462 p->iTCO_version = pdata->version; 467 463 p->pci_dev = to_pci_dev(dev->parent); 464 + 465 + p->smi_res = platform_get_resource(pdev, IORESOURCE_IO, ICH_RES_IO_SMI); 466 + if (p->smi_res) { 467 + /* The TCO logic uses the TCO_EN bit in the SMI_EN register */ 468 + if (!devm_request_region(dev, p->smi_res->start, 469 + resource_size(p->smi_res), 470 + pdev->name)) { 471 + pr_err("I/O address 0x%04llx already in use, device disabled\n", 472 + (u64)SMI_EN(p)); 473 + return -EBUSY; 474 + } 475 + } else if (iTCO_vendorsupport || 476 + turn_SMI_watchdog_clear_off >= p->iTCO_version) { 477 + pr_err("SMI I/O resource is missing\n"); 478 + return -ENODEV; 479 + } 468 480 469 481 iTCO_wdt_no_reboot_bit_setup(p, pdata); 470 482 ··· 504 492 /* Set the NO_REBOOT bit to prevent later reboots, just for sure */ 505 493 p->update_no_reboot_bit(p->no_reboot_priv, true); 506 494 507 - /* The TCO logic uses the TCO_EN bit in the SMI_EN register */ 508 - if (!devm_request_region(dev, p->smi_res->start, 509 - resource_size(p->smi_res), 510 - pdev->name)) { 511 - pr_err("I/O address 0x%04llx already in use, device disabled\n", 512 - (u64)SMI_EN(p)); 513 - return -EBUSY; 514 - } 515 495 if (turn_SMI_watchdog_clear_off >= p->iTCO_version) { 516 496 /* 517 497 * Bit 13: TCO_EN -> 0