i2c-for-6.16-rc4

- imx: fix SMBus protocol compliance during block read
 - omap: fix error handling path in probe
 - robotfuzz, tiny-usb: prevent zero-length reads
 - x86, designware, amdisp: fix build error when modules are
   disabled (agreed to go in via i2c)
 - scx200_acb: fix build error because of missing HAS_IOPORT
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmhgO5sACgkQFA3kzBSg
 Kbb/zA/9FeV35eBjQI58FzJ+aCnYKKIIXFJpPMFsRZofSB5AJ8m8DUljQOrLZEYl
 1fKwIbvnHMlgKvly+laRFoli0eSzpM+v85/ZG9CAssRUh6oUGs7jMb/dO1q2k5+e
 bw7Bjy8lHtZbDvw+F7HVO4xIau9X1MUVmMlJAB8HnvKSLQDzPKKiNmZdTp2ONurC
 W0HMrLzswmxDHi2G2DBooufXP/OCF745G5FaRjDrQE7un0CD1cADFQxlJLy3I1br
 as/tht++N3UN4trL0G0GkKhFOUnKFKA3UYBI9zfXKtOxBtJywHRWgbUBQwVmu6yH
 nDLbOx7eVVgO7f5AIxXDAYXOE8uLDp9OWtuXsg0H2APG4cCKwK+f7Qn2xYF+f4yS
 tymDMMvzxmW0Ojkb66EVlexsTcgQKiMpQRnuflPEl3hUOdiJ8fWLE2/Mss6nZwYE
 Vpobk+kmggrRUA97OLCb+xMEeCWSpu4jyiKMeByAwHDf4Ji1jH7wwwhJ4rPWQZvZ
 tfHqimYbNg1vFQGMgHAHWiZNoublm/BqdPi5O16JZjADuNx/cob5xIirMH8Eea5Y
 bhjw7O+lw4gEnbe6g8NLU1pkz9w1tEiQUOiLNarxwJgmumyWpFJDkd32LsIPgWTx
 mOGBcJZwbWDzuQL+SP3iVcjYbWcfdltDyzOGWVaox8Btf6/JYd4=
 =WgQ5
 -----END PGP SIGNATURE-----

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

Pull i2c fixes from Wolfram Sang:

 - imx: fix SMBus protocol compliance during block read

 - omap: fix error handling path in probe

 - robotfuzz, tiny-usb: prevent zero-length reads

 - x86, designware, amdisp: fix build error when modules are disabled
   (agreed to go in via i2c)

 - scx200_acb: fix build error because of missing HAS_IOPORT

* tag 'i2c-for-6.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: scx200_acb: depends on HAS_IOPORT
  i2c: omap: Fix an error handling path in omap_i2c_probe()
  platform/x86: Use i2c adapter name to fix build errors
  i2c: amd-isp: Initialize unique adapter name
  i2c: designware: Initialize adapter name only when not set
  i2c: tiny-usb: disable zero-length read messages
  i2c: robotfuzz-osif: disable zero-length read messages
  i2c: imx: fix emulated smbus block read
This commit is contained in:
Linus Torvalds 2025-06-28 15:23:17 -07:00
commit dfba48a70c
10 changed files with 40 additions and 7 deletions

View File

@ -24099,6 +24099,7 @@ M: Bin Du <bin.du@amd.com>
L: linux-i2c@vger.kernel.org L: linux-i2c@vger.kernel.org
S: Maintained S: Maintained
F: drivers/i2c/busses/i2c-designware-amdisp.c F: drivers/i2c/busses/i2c-designware-amdisp.c
F: include/linux/soc/amd/isp4_misc.h
SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER
M: Jaehoon Chung <jh80.chung@samsung.com> M: Jaehoon Chung <jh80.chung@samsung.com>

View File

@ -1530,7 +1530,7 @@ config I2C_XGENE_SLIMPRO
config SCx200_ACB config SCx200_ACB
tristate "Geode ACCESS.bus support" tristate "Geode ACCESS.bus support"
depends on X86_32 && PCI depends on X86_32 && PCI && HAS_IOPORT
help help
Enable the use of the ACCESS.bus controllers on the Geode SCx200 and Enable the use of the ACCESS.bus controllers on the Geode SCx200 and
SC1100 processors and the CS5535 and CS5536 Geode companion devices. SC1100 processors and the CS5535 and CS5536 Geode companion devices.

View File

@ -8,6 +8,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/soc/amd/isp4_misc.h>
#include "i2c-designware-core.h" #include "i2c-designware-core.h"
@ -62,6 +63,7 @@ static int amd_isp_dw_i2c_plat_probe(struct platform_device *pdev)
adap = &isp_i2c_dev->adapter; adap = &isp_i2c_dev->adapter;
adap->owner = THIS_MODULE; adap->owner = THIS_MODULE;
scnprintf(adap->name, sizeof(adap->name), AMDISP_I2C_ADAP_NAME);
ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev)); ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev));
adap->dev.of_node = pdev->dev.of_node; adap->dev.of_node = pdev->dev.of_node;
/* use dynamically allocated adapter id */ /* use dynamically allocated adapter id */

View File

@ -1042,8 +1042,9 @@ int i2c_dw_probe_master(struct dw_i2c_dev *dev)
if (ret) if (ret)
return ret; return ret;
snprintf(adap->name, sizeof(adap->name), if (!adap->name[0])
"Synopsys DesignWare I2C adapter"); scnprintf(adap->name, sizeof(adap->name),
"Synopsys DesignWare I2C adapter");
adap->retries = 3; adap->retries = 3;
adap->algo = &i2c_dw_algo; adap->algo = &i2c_dw_algo;
adap->quirks = &i2c_dw_quirks; adap->quirks = &i2c_dw_quirks;

View File

@ -1008,7 +1008,7 @@ static inline int i2c_imx_isr_read(struct imx_i2c_struct *i2c_imx)
/* setup bus to read data */ /* setup bus to read data */
temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR); temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
temp &= ~I2CR_MTX; temp &= ~I2CR_MTX;
if (i2c_imx->msg->len - 1) if ((i2c_imx->msg->len - 1) || (i2c_imx->msg->flags & I2C_M_RECV_LEN))
temp &= ~I2CR_TXAK; temp &= ~I2CR_TXAK;
imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR); imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
@ -1063,6 +1063,7 @@ static inline void i2c_imx_isr_read_block_data_len(struct imx_i2c_struct *i2c_im
wake_up(&i2c_imx->queue); wake_up(&i2c_imx->queue);
} }
i2c_imx->msg->len += len; i2c_imx->msg->len += len;
i2c_imx->msg->buf[i2c_imx->msg_buf_idx++] = len;
} }
static irqreturn_t i2c_imx_master_isr(struct imx_i2c_struct *i2c_imx, unsigned int status) static irqreturn_t i2c_imx_master_isr(struct imx_i2c_struct *i2c_imx, unsigned int status)

View File

@ -1461,13 +1461,13 @@ omap_i2c_probe(struct platform_device *pdev)
if (IS_ERR(mux_state)) { if (IS_ERR(mux_state)) {
r = PTR_ERR(mux_state); r = PTR_ERR(mux_state);
dev_dbg(&pdev->dev, "failed to get I2C mux: %d\n", r); dev_dbg(&pdev->dev, "failed to get I2C mux: %d\n", r);
goto err_disable_pm; goto err_put_pm;
} }
omap->mux_state = mux_state; omap->mux_state = mux_state;
r = mux_state_select(omap->mux_state); r = mux_state_select(omap->mux_state);
if (r) { if (r) {
dev_err(&pdev->dev, "failed to select I2C mux: %d\n", r); dev_err(&pdev->dev, "failed to select I2C mux: %d\n", r);
goto err_disable_pm; goto err_put_pm;
} }
} }
@ -1515,6 +1515,9 @@ omap_i2c_probe(struct platform_device *pdev)
err_unuse_clocks: err_unuse_clocks:
omap_i2c_write_reg(omap, OMAP_I2C_CON_REG, 0); omap_i2c_write_reg(omap, OMAP_I2C_CON_REG, 0);
if (omap->mux_state)
mux_state_deselect(omap->mux_state);
err_put_pm:
pm_runtime_dont_use_autosuspend(omap->dev); pm_runtime_dont_use_autosuspend(omap->dev);
pm_runtime_put_sync(omap->dev); pm_runtime_put_sync(omap->dev);
err_disable_pm: err_disable_pm:

View File

@ -111,6 +111,11 @@ static u32 osif_func(struct i2c_adapter *adapter)
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
} }
/* prevent invalid 0-length usb_control_msg */
static const struct i2c_adapter_quirks osif_quirks = {
.flags = I2C_AQ_NO_ZERO_LEN_READ,
};
static const struct i2c_algorithm osif_algorithm = { static const struct i2c_algorithm osif_algorithm = {
.xfer = osif_xfer, .xfer = osif_xfer,
.functionality = osif_func, .functionality = osif_func,
@ -143,6 +148,7 @@ static int osif_probe(struct usb_interface *interface,
priv->adapter.owner = THIS_MODULE; priv->adapter.owner = THIS_MODULE;
priv->adapter.class = I2C_CLASS_HWMON; priv->adapter.class = I2C_CLASS_HWMON;
priv->adapter.quirks = &osif_quirks;
priv->adapter.algo = &osif_algorithm; priv->adapter.algo = &osif_algorithm;
priv->adapter.algo_data = priv; priv->adapter.algo_data = priv;
snprintf(priv->adapter.name, sizeof(priv->adapter.name), snprintf(priv->adapter.name, sizeof(priv->adapter.name),

View File

@ -139,6 +139,11 @@ out:
return ret; return ret;
} }
/* prevent invalid 0-length usb_control_msg */
static const struct i2c_adapter_quirks usb_quirks = {
.flags = I2C_AQ_NO_ZERO_LEN_READ,
};
/* This is the actual algorithm we define */ /* This is the actual algorithm we define */
static const struct i2c_algorithm usb_algorithm = { static const struct i2c_algorithm usb_algorithm = {
.xfer = usb_xfer, .xfer = usb_xfer,
@ -247,6 +252,7 @@ static int i2c_tiny_usb_probe(struct usb_interface *interface,
/* setup i2c adapter description */ /* setup i2c adapter description */
dev->adapter.owner = THIS_MODULE; dev->adapter.owner = THIS_MODULE;
dev->adapter.class = I2C_CLASS_HWMON; dev->adapter.class = I2C_CLASS_HWMON;
dev->adapter.quirks = &usb_quirks;
dev->adapter.algo = &usb_algorithm; dev->adapter.algo = &usb_algorithm;
dev->adapter.algo_data = dev; dev->adapter.algo_data = dev;
snprintf(dev->adapter.name, sizeof(dev->adapter.name), snprintf(dev->adapter.name, sizeof(dev->adapter.name),

View File

@ -11,6 +11,7 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/property.h> #include <linux/property.h>
#include <linux/soc/amd/isp4_misc.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/units.h> #include <linux/units.h>
@ -151,7 +152,7 @@ MODULE_DEVICE_TABLE(acpi, amdisp_sensor_ids);
static inline bool is_isp_i2c_adapter(struct i2c_adapter *adap) static inline bool is_isp_i2c_adapter(struct i2c_adapter *adap)
{ {
return !strcmp(adap->owner->name, "i2c_designware_amdisp"); return !strcmp(adap->name, AMDISP_I2C_ADAP_NAME);
} }
static void instantiate_isp_i2c_client(struct amdisp_platform *isp4_platform, static void instantiate_isp_i2c_client(struct amdisp_platform *isp4_platform,

View File

@ -0,0 +1,12 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2025 Advanced Micro Devices, Inc.
*/
#ifndef __SOC_ISP4_MISC_H
#define __SOC_ISP4_MISC_H
#define AMDISP_I2C_ADAP_NAME "AMDISP DesignWare I2C adapter"
#endif