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

Pull i2c fixes from Wolfram Sang:
"A power state fix in the core for ACPI devices, a regression fix
regarding bus recovery for the cadence driver, a DMA handling fix for
the imx driver, and two error path fixes (npcm7xx and qcom-geni)"

* tag 'i2c-for-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: imx: Only DMA messages with I2C_M_DMA_SAFE flag set
i2c: qcom-geni: fix error return code in geni_i2c_gpi_xfer
i2c: cadence: Fix regression with bus recovery
i2c: Restore initial power state if probe fails
i2c: npcm7xx: Fix error handling in npcm_i2c_init()

+27 -11
+8 -3
drivers/i2c/busses/i2c-cadence.c
··· 852 852 CDNS_I2C_POLL_US, CDNS_I2C_TIMEOUT_US); 853 853 if (ret) { 854 854 ret = -EAGAIN; 855 - i2c_recover_bus(adap); 855 + if (id->adap.bus_recovery_info) 856 + i2c_recover_bus(adap); 856 857 goto out; 857 858 } 858 859 ··· 1264 1263 1265 1264 id->rinfo.pinctrl = devm_pinctrl_get(&pdev->dev); 1266 1265 if (IS_ERR(id->rinfo.pinctrl)) { 1266 + int err = PTR_ERR(id->rinfo.pinctrl); 1267 + 1267 1268 dev_info(&pdev->dev, "can't get pinctrl, bus recovery not supported\n"); 1268 - return PTR_ERR(id->rinfo.pinctrl); 1269 + if (err != -ENODEV) 1270 + return err; 1271 + } else { 1272 + id->adap.bus_recovery_info = &id->rinfo; 1269 1273 } 1270 1274 1271 1275 id->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem); ··· 1289 1283 id->adap.retries = 3; /* Default retry value. */ 1290 1284 id->adap.algo_data = id; 1291 1285 id->adap.dev.parent = &pdev->dev; 1292 - id->adap.bus_recovery_info = &id->rinfo; 1293 1286 init_completion(&id->xfer_done); 1294 1287 snprintf(id->adap.name, sizeof(id->adap.name), 1295 1288 "Cadence I2C at %08lx", (unsigned long)r_mem->start);
+4 -2
drivers/i2c/busses/i2c-imx.c
··· 1132 1132 int i, result; 1133 1133 unsigned int temp; 1134 1134 int block_data = msgs->flags & I2C_M_RECV_LEN; 1135 - int use_dma = i2c_imx->dma && msgs->len >= DMA_THRESHOLD && !block_data; 1135 + int use_dma = i2c_imx->dma && msgs->flags & I2C_M_DMA_SAFE && 1136 + msgs->len >= DMA_THRESHOLD && !block_data; 1136 1137 1137 1138 dev_dbg(&i2c_imx->adapter.dev, 1138 1139 "<%s> write slave address: addr=0x%x\n", ··· 1299 1298 result = i2c_imx_read(i2c_imx, &msgs[i], is_lastmsg, atomic); 1300 1299 } else { 1301 1300 if (!atomic && 1302 - i2c_imx->dma && msgs[i].len >= DMA_THRESHOLD) 1301 + i2c_imx->dma && msgs[i].len >= DMA_THRESHOLD && 1302 + msgs[i].flags & I2C_M_DMA_SAFE) 1303 1303 result = i2c_imx_dma_write(i2c_imx, &msgs[i]); 1304 1304 else 1305 1305 result = i2c_imx_write(i2c_imx, &msgs[i], atomic);
+10 -1
drivers/i2c/busses/i2c-npcm7xx.c
··· 2393 2393 2394 2394 static int __init npcm_i2c_init(void) 2395 2395 { 2396 + int ret; 2397 + 2396 2398 npcm_i2c_debugfs_dir = debugfs_create_dir("npcm_i2c", NULL); 2397 - return platform_driver_register(&npcm_i2c_bus_driver); 2399 + 2400 + ret = platform_driver_register(&npcm_i2c_bus_driver); 2401 + if (ret) { 2402 + debugfs_remove_recursive(npcm_i2c_debugfs_dir); 2403 + return ret; 2404 + } 2405 + 2406 + return 0; 2398 2407 } 2399 2408 module_init(npcm_i2c_init); 2400 2409
-1
drivers/i2c/busses/i2c-qcom-geni.c
··· 626 626 dev_err(gi2c->se.dev, "I2C timeout gpi flags:%d addr:0x%x\n", 627 627 gi2c->cur->flags, gi2c->cur->addr); 628 628 gi2c->err = -ETIMEDOUT; 629 - goto err; 630 629 } 631 630 632 631 if (gi2c->err) {
+5 -4
drivers/i2c/i2c-core-base.c
··· 467 467 { 468 468 struct i2c_client *client = i2c_verify_client(dev); 469 469 struct i2c_driver *driver; 470 + bool do_power_on; 470 471 int status; 471 472 472 473 if (!client) ··· 546 545 if (status < 0) 547 546 goto err_clear_wakeup_irq; 548 547 549 - status = dev_pm_domain_attach(&client->dev, 550 - !i2c_acpi_waive_d0_probe(dev)); 548 + do_power_on = !i2c_acpi_waive_d0_probe(dev); 549 + status = dev_pm_domain_attach(&client->dev, do_power_on); 551 550 if (status) 552 551 goto err_clear_wakeup_irq; 553 552 ··· 586 585 err_release_driver_resources: 587 586 devres_release_group(&client->dev, client->devres_group_id); 588 587 err_detach_pm_domain: 589 - dev_pm_domain_detach(&client->dev, !i2c_acpi_waive_d0_probe(dev)); 588 + dev_pm_domain_detach(&client->dev, do_power_on); 590 589 err_clear_wakeup_irq: 591 590 dev_pm_clear_wake_irq(&client->dev); 592 591 device_init_wakeup(&client->dev, false); ··· 611 610 612 611 devres_release_group(&client->dev, client->devres_group_id); 613 612 614 - dev_pm_domain_detach(&client->dev, !i2c_acpi_waive_d0_probe(dev)); 613 + dev_pm_domain_detach(&client->dev, true); 615 614 616 615 dev_pm_clear_wake_irq(&client->dev); 617 616 device_init_wakeup(&client->dev, false);