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 one revert because of a regression, two fixes for tiny race
windows (which we were not able to trigger), a MAINTAINERS addition,
and a SPDX fix"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: stm32: Use the correct style for SPDX License Identifier
i2c: emev2: avoid race when unregistering slave client
i2c: rcar: avoid race when unregistering slave client
MAINTAINERS: i2c-imx: take over maintainership
Revert "i2c: imx: improve the error handling in i2c_imx_dma_request()"

+34 -21
+8
MAINTAINERS
··· 6441 6441 F: drivers/perf/fsl_imx8_ddr_perf.c 6442 6442 F: Documentation/devicetree/bindings/perf/fsl-imx-ddr.txt 6443 6443 6444 + FREESCALE IMX I2C DRIVER 6445 + M: Oleksij Rempel <o.rempel@pengutronix.de> 6446 + R: Pengutronix Kernel Team <kernel@pengutronix.de> 6447 + L: linux-i2c@vger.kernel.org 6448 + S: Maintained 6449 + F: drivers/i2c/busses/i2c-imx.c 6450 + F: Documentation/devicetree/bindings/i2c/i2c-imx.txt 6451 + 6444 6452 FREESCALE IMX LPI2C DRIVER 6445 6453 M: Dong Aisheng <aisheng.dong@nxp.com> 6446 6454 L: linux-i2c@vger.kernel.org
+12 -4
drivers/i2c/busses/i2c-emev2.c
··· 69 69 struct completion msg_done; 70 70 struct clk *sclk; 71 71 struct i2c_client *slave; 72 + int irq; 72 73 }; 73 74 74 75 static inline void em_clear_set_bit(struct em_i2c_device *priv, u8 clear, u8 set, u8 reg) ··· 340 339 341 340 writeb(0, priv->base + I2C_OFS_SVA0); 342 341 342 + /* 343 + * Wait for interrupt to finish. New slave irqs cannot happen because we 344 + * cleared the slave address and, thus, only extension codes will be 345 + * detected which do not use the slave ptr. 346 + */ 347 + synchronize_irq(priv->irq); 343 348 priv->slave = NULL; 344 349 345 350 return 0; ··· 362 355 { 363 356 struct em_i2c_device *priv; 364 357 struct resource *r; 365 - int irq, ret; 358 + int ret; 366 359 367 360 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); 368 361 if (!priv) ··· 397 390 398 391 em_i2c_reset(&priv->adap); 399 392 400 - irq = platform_get_irq(pdev, 0); 401 - ret = devm_request_irq(&pdev->dev, irq, em_i2c_irq_handler, 0, 393 + priv->irq = platform_get_irq(pdev, 0); 394 + ret = devm_request_irq(&pdev->dev, priv->irq, em_i2c_irq_handler, 0, 402 395 "em_i2c", priv); 403 396 if (ret) 404 397 goto err_clk; ··· 408 401 if (ret) 409 402 goto err_clk; 410 403 411 - dev_info(&pdev->dev, "Added i2c controller %d, irq %d\n", priv->adap.nr, irq); 404 + dev_info(&pdev->dev, "Added i2c controller %d, irq %d\n", priv->adap.nr, 405 + priv->irq); 412 406 413 407 return 0; 414 408
+6 -12
drivers/i2c/busses/i2c-imx.c
··· 273 273 } 274 274 275 275 /* Functions for DMA support */ 276 - static int i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, 277 - dma_addr_t phy_addr) 276 + static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, 277 + dma_addr_t phy_addr) 278 278 { 279 279 struct imx_i2c_dma *dma; 280 280 struct dma_slave_config dma_sconfig; ··· 283 283 284 284 dma = devm_kzalloc(dev, sizeof(*dma), GFP_KERNEL); 285 285 if (!dma) 286 - return -ENOMEM; 286 + return; 287 287 288 288 dma->chan_tx = dma_request_chan(dev, "tx"); 289 289 if (IS_ERR(dma->chan_tx)) { ··· 328 328 dev_info(dev, "using %s (tx) and %s (rx) for DMA transfers\n", 329 329 dma_chan_name(dma->chan_tx), dma_chan_name(dma->chan_rx)); 330 330 331 - return 0; 331 + return; 332 332 333 333 fail_rx: 334 334 dma_release_channel(dma->chan_rx); ··· 336 336 dma_release_channel(dma->chan_tx); 337 337 fail_al: 338 338 devm_kfree(dev, dma); 339 - /* return successfully if there is no dma support */ 340 - return ret == -ENODEV ? 0 : ret; 341 339 } 342 340 343 341 static void i2c_imx_dma_callback(void *arg) ··· 1163 1165 dev_dbg(&i2c_imx->adapter.dev, "device resources: %pR\n", res); 1164 1166 dev_dbg(&i2c_imx->adapter.dev, "adapter name: \"%s\"\n", 1165 1167 i2c_imx->adapter.name); 1168 + dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n"); 1166 1169 1167 1170 /* Init DMA config if supported */ 1168 - ret = i2c_imx_dma_request(i2c_imx, phy_addr); 1169 - if (ret < 0) 1170 - goto del_adapter; 1171 + i2c_imx_dma_request(i2c_imx, phy_addr); 1171 1172 1172 - dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n"); 1173 1173 return 0; /* Return OK */ 1174 1174 1175 - del_adapter: 1176 - i2c_del_adapter(&i2c_imx->adapter); 1177 1175 clk_notifier_unregister: 1178 1176 clk_notifier_unregister(i2c_imx->clk, &i2c_imx->clk_change_nb); 1179 1177 rpm_disable:
+7 -4
drivers/i2c/busses/i2c-rcar.c
··· 139 139 enum dma_data_direction dma_direction; 140 140 141 141 struct reset_control *rstc; 142 + int irq; 142 143 }; 143 144 144 145 #define rcar_i2c_priv_to_dev(p) ((p)->adap.dev.parent) ··· 862 861 863 862 WARN_ON(!priv->slave); 864 863 864 + /* disable irqs and ensure none is running before clearing ptr */ 865 865 rcar_i2c_write(priv, ICSIER, 0); 866 866 rcar_i2c_write(priv, ICSCR, 0); 867 867 868 + synchronize_irq(priv->irq); 868 869 priv->slave = NULL; 869 870 870 871 pm_runtime_put(rcar_i2c_priv_to_dev(priv)); ··· 921 918 struct i2c_adapter *adap; 922 919 struct device *dev = &pdev->dev; 923 920 struct i2c_timings i2c_t; 924 - int irq, ret; 921 + int ret; 925 922 926 923 /* Otherwise logic will break because some bytes must always use PIO */ 927 924 BUILD_BUG_ON_MSG(RCAR_MIN_DMA_LEN < 3, "Invalid min DMA length"); ··· 987 984 pm_runtime_put(dev); 988 985 989 986 990 - irq = platform_get_irq(pdev, 0); 991 - ret = devm_request_irq(dev, irq, rcar_i2c_irq, 0, dev_name(dev), priv); 987 + priv->irq = platform_get_irq(pdev, 0); 988 + ret = devm_request_irq(dev, priv->irq, rcar_i2c_irq, 0, dev_name(dev), priv); 992 989 if (ret < 0) { 993 - dev_err(dev, "cannot get irq %d\n", irq); 990 + dev_err(dev, "cannot get irq %d\n", priv->irq); 994 991 goto out_pm_disable; 995 992 } 996 993
+1 -1
drivers/i2c/busses/i2c-stm32.h
··· 1 - // SPDX-License-Identifier: GPL-2.0 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 2 /* 3 3 * i2c-stm32.h 4 4 *