mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 04:23:35 +02:00
i2c-for-7.1-rc3
- sanitize more input parameters in the core (found by syzkaller) - usual set of driver fixes (proper completion handling, applying quirks, correct workqueue selection...) - ID additions to simplify dependency handling - new email address for Peter Rosin -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmn+zbcACgkQFA3kzBSg Kba3Uw//c4XYA1og7d/Hui+j8cKPB8+Wxerz66d3uKwhkaS2HS3W7TTJD6xffBya o4i/Vr1lG3fKbktiai+wyfQa26CrPduV4fv7vHF6TT9vCdiCoyqL7e82ME0DaSqY ux/scwheG93O3lw2cwDevZzZHlarDG0ZKp89HqwMzKwThT3NGQNmGN/SbWNDcc1B tmvyuUDdQ8pooRCKfuWwNcJe2Sh6vmkFhGMGMzOrZwLZWoqbGN4ywcrhfQr20QR4 /5uzk6CKsuc+zgcl46gyMzExwimaKry3JFiZVUHLz2yursE3oBBzasn3/6BYHI2d sv+20MJX13s8HtumvuKPZp6aBRVAIB2SYkG/ZnBwQmfuR21ndnrQIisaYCp18Rjt 90ouv2wpQTUYCXeDnye2weCgcsROX7FoB391PupLDShXikZOmqf94gmJBGkPW/vb ZfukxvXEMddgW8Zpm6W1xoCXdeZSS5YwlBmhBhz+vYbIW4UwZQi98WxTVQZF6O3O ch2GqZdUBJyxHkGCRlDpbXrqHKr/ZYRHidCxftIWIamt3Nvqsa5elFXOJekgixiu /UNyDjSvI61OqGPfAq5tBrPb/Y7NDJQBiwoOm70rHTjeMLIOq4f1cx4Q2+CghJfw cD4zauFZqfWM87J1j93x9krZBCD+qbVzmL8U8iBXCLrfQUg6SG0= =rlX+ -----END PGP SIGNATURE----- Merge tag 'i2c-for-7.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: - sanitize more input parameters in the core (found by syzkaller) - usual set of driver fixes (proper completion handling, applying quirks, correct workqueue selection...) - ID additions to simplify dependency handling - new email address for Peter Rosin * tag 'i2c-for-7.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: smbus: reject oversized block transfers in the common path MAINTAINERS: Update mail for Peter Rosin i2c: stub: Reject I2C block transfers with invalid length i2c: Compare the return value of gpiod_get_direction against GPIO_LINE_DIRECTION_OUT i2c: dev: prevent integer overflow in I2C_TIMEOUT ioctl i2c: acpi: Add ELAN0678 to i2c_acpi_force_100khz_device_ids dt-bindings: i2c: apple,i2c: Add t8122 compatible i2c: stm32f7: reinit_completion() per transfer not per msg dt-bindings: i2c: amlogic: Add compatible for T7 SOC i2c: testunit: Replace system_long_wq with system_dfl_long_wq
This commit is contained in:
commit
656a95c4a0
1
.mailmap
1
.mailmap
|
|
@ -682,6 +682,7 @@ Peter A Jonsson <pj@ludd.ltu.se>
|
|||
Peter Hilber <peter.hilber@oss.qualcomm.com> <quic_philber@quicinc.com>
|
||||
Peter Oruba <peter.oruba@amd.com>
|
||||
Peter Oruba <peter@oruba.de>
|
||||
Peter Rosin <peda@lysator.liu.se> <peda@axentia.se>
|
||||
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> <pierre-louis.bossart@linux.intel.com>
|
||||
Pratyush Anand <pratyush.anand@gmail.com> <pratyush.anand@st.com>
|
||||
Pratyush Yadav <pratyush@kernel.org> <ptyadav@amazon.de>
|
||||
|
|
|
|||
|
|
@ -16,10 +16,15 @@ allOf:
|
|||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- amlogic,meson6-i2c # Meson6, Meson8 and compatible SoCs
|
||||
- amlogic,meson-gxbb-i2c # GXBB and compatible SoCs
|
||||
- amlogic,meson-axg-i2c # AXG and compatible SoCs
|
||||
oneOf:
|
||||
- items:
|
||||
- enum:
|
||||
- amlogic,t7-i2c
|
||||
- const: amlogic,meson-axg-i2c
|
||||
- enum:
|
||||
- amlogic,meson6-i2c # Meson6, Meson8 and compatible SoCs
|
||||
- amlogic,meson-gxbb-i2c # GXBB and compatible SoCs
|
||||
- amlogic,meson-axg-i2c # AXG and compatible SoCs
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ properties:
|
|||
compatible:
|
||||
oneOf:
|
||||
- items:
|
||||
- const: apple,t6020-i2c
|
||||
- enum:
|
||||
- apple,t6020-i2c
|
||||
- apple,t8122-i2c
|
||||
- const: apple,t8103-i2c
|
||||
- items:
|
||||
- enum:
|
||||
|
|
|
|||
24
MAINTAINERS
24
MAINTAINERS
|
|
@ -4299,18 +4299,16 @@ F: Documentation/devicetree/bindings/leds/backlight/awinic,aw99706.yaml
|
|||
F: drivers/video/backlight/aw99706.c
|
||||
|
||||
AXENTIA ARM DEVICES
|
||||
M: Peter Rosin <peda@axentia.se>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
S: Orphan
|
||||
F: arch/arm/boot/dts/microchip/at91-linea.dtsi
|
||||
F: arch/arm/boot/dts/microchip/at91-natte.dtsi
|
||||
F: arch/arm/boot/dts/microchip/at91-nattis-2-natte-2.dts
|
||||
F: arch/arm/boot/dts/microchip/at91-tse850-3.dts
|
||||
|
||||
AXENTIA ASOC DRIVERS
|
||||
M: Peter Rosin <peda@axentia.se>
|
||||
L: linux-sound@vger.kernel.org
|
||||
S: Maintained
|
||||
S: Orphan
|
||||
F: Documentation/devicetree/bindings/sound/axentia,*
|
||||
F: sound/soc/atmel/tse850-pcm5142.c
|
||||
|
||||
|
|
@ -12050,7 +12048,7 @@ F: Documentation/i2c/busses/i2c-nvidia-gpu.rst
|
|||
F: drivers/i2c/busses/i2c-nvidia-gpu.c
|
||||
|
||||
I2C MUXES
|
||||
M: Peter Rosin <peda@axentia.se>
|
||||
M: Peter Rosin <peda@lysator.liu.se>
|
||||
L: linux-i2c@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/i2c/i2c-arb*
|
||||
|
|
@ -12451,7 +12449,7 @@ F: drivers/iio/industrialio-backend.c
|
|||
F: include/linux/iio/backend.h
|
||||
|
||||
IIO DIGITAL POTENTIOMETER DAC
|
||||
M: Peter Rosin <peda@axentia.se>
|
||||
M: Peter Rosin <peda@lysator.liu.se>
|
||||
L: linux-iio@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/ABI/testing/sysfs-bus-iio-dac-dpot-dac
|
||||
|
|
@ -12459,7 +12457,7 @@ F: Documentation/devicetree/bindings/iio/dac/dpot-dac.yaml
|
|||
F: drivers/iio/dac/dpot-dac.c
|
||||
|
||||
IIO ENVELOPE DETECTOR
|
||||
M: Peter Rosin <peda@axentia.se>
|
||||
M: Peter Rosin <peda@lysator.liu.se>
|
||||
L: linux-iio@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/ABI/testing/sysfs-bus-iio-adc-envelope-detector
|
||||
|
|
@ -12475,7 +12473,7 @@ F: include/linux/iio/iio-gts-helper.h
|
|||
F: drivers/iio/test/iio-test-gts.c
|
||||
|
||||
IIO MULTIPLEXER
|
||||
M: Peter Rosin <peda@axentia.se>
|
||||
M: Peter Rosin <peda@lysator.liu.se>
|
||||
L: linux-iio@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/iio/multiplexer/io-channel-mux.yaml
|
||||
|
|
@ -12506,7 +12504,7 @@ F: include/linux/iio/
|
|||
F: tools/iio/
|
||||
|
||||
IIO UNIT CONVERTER
|
||||
M: Peter Rosin <peda@axentia.se>
|
||||
M: Peter Rosin <peda@lysator.liu.se>
|
||||
L: linux-iio@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.yaml
|
||||
|
|
@ -15722,7 +15720,7 @@ F: Documentation/devicetree/bindings/media/i2c/maxim,max96717.yaml
|
|||
F: drivers/media/i2c/max96717.c
|
||||
|
||||
MAX9860 MONO AUDIO VOICE CODEC DRIVER
|
||||
M: Peter Rosin <peda@axentia.se>
|
||||
M: Peter Rosin <peda@lysator.liu.se>
|
||||
L: linux-sound@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/sound/max9860.txt
|
||||
|
|
@ -15937,7 +15935,7 @@ F: Documentation/devicetree/bindings/net/can/microchip,mcp251xfd.yaml
|
|||
F: drivers/net/can/spi/mcp251xfd/
|
||||
|
||||
MCP4018 AND MCP4531 MICROCHIP DIGITAL POTENTIOMETER DRIVERS
|
||||
M: Peter Rosin <peda@axentia.se>
|
||||
M: Peter Rosin <peda@lysator.liu.se>
|
||||
L: linux-iio@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/ABI/testing/sysfs-bus-iio-potentiometer-mcp4531
|
||||
|
|
@ -18242,7 +18240,7 @@ F: include/linux/mmc/
|
|||
F: include/uapi/linux/mmc/
|
||||
|
||||
MULTIPLEXER SUBSYSTEM
|
||||
M: Peter Rosin <peda@axentia.se>
|
||||
M: Peter Rosin <peda@lysator.liu.se>
|
||||
S: Odd Fixes
|
||||
F: Documentation/ABI/testing/sysfs-class-mux*
|
||||
F: Documentation/devicetree/bindings/mux/
|
||||
|
|
@ -19351,7 +19349,7 @@ F: include/dt-bindings/display/tda998x.h
|
|||
K: "nxp,tda998x"
|
||||
|
||||
NXP TFA9879 DRIVER
|
||||
M: Peter Rosin <peda@axentia.se>
|
||||
M: Peter Rosin <peda@lysator.liu.se>
|
||||
L: linux-sound@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/sound/trivial-codec.yaml
|
||||
|
|
|
|||
|
|
@ -895,8 +895,6 @@ static void stm32f7_i2c_xfer_msg(struct stm32f7_i2c_dev *i2c_dev,
|
|||
f7_msg->result = 0;
|
||||
f7_msg->stop = (i2c_dev->msg_id >= i2c_dev->msg_num - 1);
|
||||
|
||||
reinit_completion(&i2c_dev->complete);
|
||||
|
||||
cr1 = readl_relaxed(base + STM32F7_I2C_CR1);
|
||||
cr2 = readl_relaxed(base + STM32F7_I2C_CR2);
|
||||
|
||||
|
|
@ -1728,6 +1726,8 @@ static int stm32f7_i2c_xfer_core(struct i2c_adapter *i2c_adap,
|
|||
if (ret)
|
||||
goto pm_free;
|
||||
|
||||
reinit_completion(&i2c_dev->complete);
|
||||
|
||||
stm32f7_i2c_xfer_msg(i2c_dev, msgs);
|
||||
|
||||
if (!i2c_dev->atomic)
|
||||
|
|
@ -2253,7 +2253,7 @@ static int stm32f7_i2c_probe(struct platform_device *pdev)
|
|||
snprintf(adap->name, sizeof(adap->name), "STM32F7 I2C(%pa)",
|
||||
&res->start);
|
||||
adap->owner = THIS_MODULE;
|
||||
adap->timeout = 2 * HZ;
|
||||
adap->timeout = 8 * HZ;
|
||||
adap->retries = 3;
|
||||
adap->algo = &stm32f7_i2c_algo;
|
||||
adap->dev.parent = &pdev->dev;
|
||||
|
|
|
|||
|
|
@ -371,6 +371,7 @@ static const struct acpi_device_id i2c_acpi_force_100khz_device_ids[] = {
|
|||
* a 400KHz frequency. The root cause of the issue is not known.
|
||||
*/
|
||||
{ "DLL0945", 0 },
|
||||
{ "ELAN0678", 0 },
|
||||
{ "ELAN06FA", 0 },
|
||||
{}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -445,8 +445,7 @@ static int i2c_init_recovery(struct i2c_adapter *adap)
|
|||
bri->set_scl = set_scl_gpio_value;
|
||||
if (bri->sda_gpiod) {
|
||||
bri->get_sda = get_sda_gpio_value;
|
||||
/* FIXME: add proper flag instead of '0' once available */
|
||||
if (gpiod_get_direction(bri->sda_gpiod) == 0)
|
||||
if (gpiod_get_direction(bri->sda_gpiod) == GPIO_LINE_DIRECTION_OUT)
|
||||
bri->set_sda = set_sda_gpio_value;
|
||||
}
|
||||
} else if (bri->recover_bus == i2c_generic_scl_recovery) {
|
||||
|
|
|
|||
|
|
@ -566,6 +566,18 @@ s32 __i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr,
|
|||
if (res)
|
||||
return res;
|
||||
|
||||
/* Reject invalid caller-supplied block lengths before any
|
||||
* tracepoint or native smbus_xfer callback runs.
|
||||
*/
|
||||
if (data &&
|
||||
(protocol == I2C_SMBUS_I2C_BLOCK_DATA ||
|
||||
protocol == I2C_SMBUS_BLOCK_PROC_CALL ||
|
||||
(protocol == I2C_SMBUS_BLOCK_DATA &&
|
||||
read_write == I2C_SMBUS_WRITE)) &&
|
||||
(data->block[0] == 0 ||
|
||||
data->block[0] > I2C_SMBUS_BLOCK_MAX))
|
||||
return -EINVAL;
|
||||
|
||||
/* If enabled, the following two tracepoints are conditional on
|
||||
* read_write and protocol.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -487,12 +487,13 @@ static long i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|||
client->adapter->retries = arg;
|
||||
break;
|
||||
case I2C_TIMEOUT:
|
||||
if (arg > INT_MAX)
|
||||
/*
|
||||
* For historical reasons, user-space sets the timeout value in
|
||||
* units of 10 ms.
|
||||
*/
|
||||
if (arg > INT_MAX / 10)
|
||||
return -EINVAL;
|
||||
|
||||
/* For historical reasons, user-space sets the timeout
|
||||
* value in units of 10 ms.
|
||||
*/
|
||||
client->adapter->timeout = msecs_to_jiffies(arg * 10);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/workqueue.h> /* FIXME: is system_long_wq the best choice? */
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
#define TU_VERSION_MAX_LENGTH 128
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ static int i2c_slave_testunit_slave_cb(struct i2c_client *client,
|
|||
case I2C_SLAVE_STOP:
|
||||
if (tu->reg_idx == TU_NUM_REGS) {
|
||||
set_bit(TU_FLAG_IN_PROCESS, &tu->flags);
|
||||
queue_delayed_work(system_long_wq, &tu->worker,
|
||||
queue_delayed_work(system_dfl_long_wq, &tu->worker,
|
||||
msecs_to_jiffies(10 * tu->regs[TU_REG_DELAY]));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -214,6 +214,11 @@ static s32 stub_xfer(struct i2c_adapter *adap, u16 addr, unsigned short flags,
|
|||
* We ignore banks here, because banked chips don't use I2C
|
||||
* block transfers
|
||||
*/
|
||||
if (data->block[0] == 0 ||
|
||||
data->block[0] > I2C_SMBUS_BLOCK_MAX) {
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
if (data->block[0] > 256 - command) /* Avoid overrun */
|
||||
data->block[0] = 256 - command;
|
||||
len = data->block[0];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user