Commit 5d12ed4b authored by Linus Torvalds's avatar Linus Torvalds

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

Pull i2c fixes from Wolfram Sang:
 "Fix a race condition in the at24 eeprom handler, a NULL pointer
  exception in the I2C core for controllers only using target modes,
  drop a MAINTAINERS entry, and fix an incorrect DT binding for at24"

* tag 'i2c-for-6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: smbus: fix NULL function pointer dereference
  MAINTAINERS: Drop entry for PCA9541 bus master selector
  eeprom: at24: fix memory corruption race condition
  dt-bindings: eeprom: at24: Fix ST M24C64-D compatible schema
parents 2e5449f4 91811a31
...@@ -68,14 +68,10 @@ properties: ...@@ -68,14 +68,10 @@ properties:
pattern: cs16$ pattern: cs16$
- items: - items:
pattern: c32$ pattern: c32$
- items:
pattern: c32d-wl$
- items: - items:
pattern: cs32$ pattern: cs32$
- items: - items:
pattern: c64$ pattern: c64$
- items:
pattern: c64d-wl$
- items: - items:
pattern: cs64$ pattern: cs64$
- items: - items:
...@@ -136,6 +132,7 @@ properties: ...@@ -136,6 +132,7 @@ properties:
- renesas,r1ex24128 - renesas,r1ex24128
- samsung,s524ad0xd1 - samsung,s524ad0xd1
- const: atmel,24c128 - const: atmel,24c128
- pattern: '^atmel,24c(32|64)d-wl$' # Actual vendor is st
label: label:
description: Descriptive name of the EEPROM. description: Descriptive name of the EEPROM.
......
...@@ -16798,12 +16798,6 @@ S: Maintained ...@@ -16798,12 +16798,6 @@ S: Maintained
F: drivers/leds/leds-pca9532.c F: drivers/leds/leds-pca9532.c
F: include/linux/leds-pca9532.h F: include/linux/leds-pca9532.h
PCA9541 I2C BUS MASTER SELECTOR DRIVER
M: Guenter Roeck <linux@roeck-us.net>
L: linux-i2c@vger.kernel.org
S: Maintained
F: drivers/i2c/muxes/i2c-mux-pca9541.c
PCI DRIVER FOR AARDVARK (Marvell Armada 3700) PCI DRIVER FOR AARDVARK (Marvell Armada 3700)
M: Thomas Petazzoni <thomas.petazzoni@bootlin.com> M: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
M: Pali Rohár <pali@kernel.org> M: Pali Rohár <pali@kernel.org>
......
...@@ -2200,13 +2200,18 @@ static int i2c_check_for_quirks(struct i2c_adapter *adap, struct i2c_msg *msgs, ...@@ -2200,13 +2200,18 @@ static int i2c_check_for_quirks(struct i2c_adapter *adap, struct i2c_msg *msgs,
* Returns negative errno, else the number of messages executed. * Returns negative errno, else the number of messages executed.
* *
* Adapter lock must be held when calling this function. No debug logging * Adapter lock must be held when calling this function. No debug logging
* takes place. adap->algo->master_xfer existence isn't checked. * takes place.
*/ */
int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{ {
unsigned long orig_jiffies; unsigned long orig_jiffies;
int ret, try; int ret, try;
if (!adap->algo->master_xfer) {
dev_dbg(&adap->dev, "I2C level transfers not supported\n");
return -EOPNOTSUPP;
}
if (WARN_ON(!msgs || num < 1)) if (WARN_ON(!msgs || num < 1))
return -EINVAL; return -EINVAL;
...@@ -2273,11 +2278,6 @@ int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) ...@@ -2273,11 +2278,6 @@ int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{ {
int ret; int ret;
if (!adap->algo->master_xfer) {
dev_dbg(&adap->dev, "I2C level transfers not supported\n");
return -EOPNOTSUPP;
}
/* REVISIT the fault reporting model here is weak: /* REVISIT the fault reporting model here is weak:
* *
* - When we get an error after receiving N bytes from a slave, * - When we get an error after receiving N bytes from a slave,
......
...@@ -758,15 +758,6 @@ static int at24_probe(struct i2c_client *client) ...@@ -758,15 +758,6 @@ static int at24_probe(struct i2c_client *client)
} }
pm_runtime_enable(dev); pm_runtime_enable(dev);
at24->nvmem = devm_nvmem_register(dev, &nvmem_config);
if (IS_ERR(at24->nvmem)) {
pm_runtime_disable(dev);
if (!pm_runtime_status_suspended(dev))
regulator_disable(at24->vcc_reg);
return dev_err_probe(dev, PTR_ERR(at24->nvmem),
"failed to register nvmem\n");
}
/* /*
* Perform a one-byte test read to verify that the chip is functional, * Perform a one-byte test read to verify that the chip is functional,
* unless powering on the device is to be avoided during probe (i.e. * unless powering on the device is to be avoided during probe (i.e.
...@@ -782,6 +773,15 @@ static int at24_probe(struct i2c_client *client) ...@@ -782,6 +773,15 @@ static int at24_probe(struct i2c_client *client)
} }
} }
at24->nvmem = devm_nvmem_register(dev, &nvmem_config);
if (IS_ERR(at24->nvmem)) {
pm_runtime_disable(dev);
if (!pm_runtime_status_suspended(dev))
regulator_disable(at24->vcc_reg);
return dev_err_probe(dev, PTR_ERR(at24->nvmem),
"failed to register nvmem\n");
}
/* If this a SPD EEPROM, probe for DDR3 thermal sensor */ /* If this a SPD EEPROM, probe for DDR3 thermal sensor */
if (cdata == &at24_data_spd) if (cdata == &at24_data_spd)
at24_probe_temp_sensor(client); at24_probe_temp_sensor(client);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment