Skip to contentSkip to conversation

i2c: i2c-ibm_iic message can be confusing

PATCH In review Sean MacLennan 4 participants 6 messages Feb 2, 2009 – Apr 24, 2009 I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: i2c-ibm_iic message can be confusing

This is a trivial patch that does not need to be in 2.6.29. While tracking down an EEPROM problem, I found the messages confusing... it looked like the EEPROM was being started before the I2C driver!

Here is an example:

at24 0-0052: 512 byte 24c04 EEPROM (writable) ibm-iic ef600700.i2c: using standard (100 kHz) mode ad7414 0-004a: chip found

It looks like the at24 starts first, then the i2c driver, then the ad7414. By moving the message to after the of scan, we always get the driver, then the devices.

Cheers,
Sean

Print the i2c driver message before scanning for devices so that the logs show the driver, then the devices. Currently you can get device(s), driver, device(s).

---

drivers/i2c/busses/i2c-ibm_iic.c +3 -3
index 88f0db7..7fc0729 100644
@@ -756,12 +756,12 @@ static int __devinit iic_probe(struct of_device *ofdev,
 		goto error_cleanup;
 	}
 
-	/* Now register all the child nodes */
-	of_register_i2c_devices(adap, np);
-
 	dev_info(&ofdev->dev, "using %s mode\n",
 		 dev->fast_mode ? "fast (400 kHz)" : "standard (100 kHz)");
 
+	/* Now register all the child nodes */
+	of_register_i2c_devices(adap, np);
+
 	return 0;
 
 error_cleanup:
Acked-by on v1 1/1
#1 lore raw
Quoted 33 lines · Sean MacLennan

This is a trivial patch that does not need to be in 2.6.29. While tracking down an EEPROM problem, I found the messages confusing... it looked like the EEPROM was being started before the I2C driver!

Here is an example:

at24 0-0052: 512 byte 24c04 EEPROM (writable) ibm-iic ef600700.i2c: using standard (100 kHz) mode ad7414 0-004a: chip found

It looks like the at24 starts first, then the i2c driver, then the ad7414. By moving the message to after the of scan, we always get the driver, then the devices.

Cheers,
Sean

Print the i2c driver message before scanning for devices so that the logs show the driver, then the devices. Currently you can get device(s), driver, device(s).

---

drivers/i2c/busses/i2c-ibm_iic.c +0 -2
index 88f0db7..7fc0729 100644
@@ -756,12 +756,12 @@ static int __devinit iic_probe(struct of_device *ofdev,
 		goto error_cleanup;
 	}
 
-	/* Now register all the child nodes */
-	of_register_i2c_devices(adap, np);

drivers/i2c/busses/i2c-ibm_iic.c static int __devinit iic_probe(struct of_device *ofdev, · line 767

Quoted 10 lines
drivers/i2c/busses/i2c-ibm_iic.c +3 -1
-
 	dev_info(&ofdev->dev, "using %s mode\n",
 		 dev->fast_mode ? "fast (400 kHz)" : "standard (100 kHz)");
 
+	/* Now register all the child nodes */
+	of_register_i2c_devices(adap, np);
+
 	return 0;
 
 error_cleanup:

Indeed.

Signature · 1 line
Jean Delvare
#3 lore raw

Hi Ben,

Quoted 4 lines · Benjamin Herrenschmidt
Quoted 2 lines

Jean, you'll take that in your tree or should I take it in mine ?

No, I'm not taking it, i2c-ibm_iic is under Ben Dooks' jurisdiction. So it's up to either him or you.

Signature · 1 line
Jean Delvare
#4 lore raw
In reply to Sean MacLennan

Any update on the status of this patch? This patch was acked by Jean.

The patchwork entry is http://patchwork.ozlabs.org/patch/21576/ and the original patch message is below.

Cheers,
Sean

Quoted 44 lines · On Mon, 2 Feb 2009 12:01:59 -0500 Sean MacLennan <[email protected]>…

This is a trivial patch that does not need to be in 2.6.29. While tracking down an EEPROM problem, I found the messages confusing... it looked like the EEPROM was being started before the I2C driver!

Here is an example:

at24 0-0052: 512 byte 24c04 EEPROM (writable) ibm-iic ef600700.i2c: using standard (100 kHz) mode ad7414 0-004a: chip found

It looks like the at24 starts first, then the i2c driver, then the ad7414. By moving the message to after the of scan, we always get the driver, then the devices.

Cheers,
Sean

Print the i2c driver message before scanning for devices so that the logs show the driver, then the devices. Currently you can get device(s), driver, device(s).

---

(quoted diff) +0 -0

b/drivers/i2c/busses/i2c-ibm_iic.c index 88f0db7..7fc0729 100644

drivers/i2c/busses/i2c-ibm_iic.c +3 -3
@@ -756,12 +756,12 @@ static int __devinit iic_probe(struct of_device
 *ofdev, goto error_cleanup;
 	}
 
-	/* Now register all the child nodes */
-	of_register_i2c_devices(adap, np);
-
 	dev_info(&ofdev->dev, "using %s mode\n",
 		 dev->fast_mode ? "fast (400 kHz)" : "standard (100
 kHz)"); 
+	/* Now register all the child nodes */
+	of_register_i2c_devices(adap, np);
+
 	return 0;
 
 error_cleanup:
#5 lore raw
Quoted 4 lines · Sean MacLennan

Any update on the status of this patch? This patch was acked by Jean.

The patchwork entry is http://patchwork.ozlabs.org/patch/21576/ and the original patch message is below.

Yeah, that's a bit annoying. A case of too many trees again.

Ben,

Do you want to take this through your tree or should I take it through the powerpc tree? I'll be up-front and say silence will translate to 'powerpc tree'

josh

Quoted 55 lines

Cheers,
Sean

Quoted 34 lines · On Mon, 2 Feb 2009 12:01:59 -0500 Sean MacLennan <[email protected]>…

This is a trivial patch that does not need to be in 2.6.29. While tracking down an EEPROM problem, I found the messages confusing... it looked like the EEPROM was being started before the I2C driver!

Here is an example:

at24 0-0052: 512 byte 24c04 EEPROM (writable) ibm-iic ef600700.i2c: using standard (100 kHz) mode ad7414 0-004a: chip found

It looks like the at24 starts first, then the i2c driver, then the ad7414. By moving the message to after the of scan, we always get the driver, then the devices.

Cheers,
Sean

Print the i2c driver message before scanning for devices so that the logs show the driver, then the devices. Currently you can get device(s), driver, device(s).

---

(quoted diff) +0 -0

b/drivers/i2c/busses/i2c-ibm_iic.c index 88f0db7..7fc0729 100644

drivers/i2c/busses/i2c-ibm_iic.c +0 -2
@@ -756,12 +756,12 @@ static int __devinit iic_probe(struct of_device
 *ofdev, goto error_cleanup;
 	}
 
-	/* Now register all the child nodes */
-	of_register_i2c_devices(adap, np);

drivers/i2c/busses/i2c-ibm_iic.c static int __devinit iic_probe(struct of_device · line 767

Quoted 10 lines
drivers/i2c/busses/i2c-ibm_iic.c +3 -1
-
 	dev_info(&ofdev->dev, "using %s mode\n",
 		 dev->fast_mode ? "fast (400 kHz)" : "standard (100
 kHz)"); 
+	/* Now register all the child nodes */
+	of_register_i2c_devices(adap, np);
+
 	return 0;
 
 error_cleanup:

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev