* [PATCH] Bugfixes for i2c-cpm.c
@ 2008-06-20 8:41 Wolfram Sang
[not found] ` <20080620084155.GA17701-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
0 siblings, 1 reply; 15+ messages in thread
From: Wolfram Sang @ 2008-06-20 8:41 UTC (permalink / raw)
To: jochen-NIgtFMG+Po8; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA
[-- Attachment #1.1: Type: text/plain, Size: 2164 bytes --]
Bugfixes to the i2c-cpm driver
- enable correct interrupts (I2CER_TXE instead of I2CER_BUSY)
- replace forgotten iic with i2c
- fix typo (devided)
- prefix debug-output on init with 0x and add frequency
Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
Sorry for the resend; the CC to Jochen was dropped, haven't figured out
why, yet.
drivers/i2c/busses/i2c-cpm.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: drivers/i2c/busses/i2c-cpm.c
===================================================================
--- drivers/i2c/busses/i2c-cpm.c.orig
+++ drivers/i2c/busses/i2c-cpm.c
@@ -241,7 +241,7 @@
eieio();
setbits16(&tbdf->cbd_sc, BD_SC_READY);
} else {
- dev_dbg(&adap->dev, "cpm_iic_write(abyte=0x%x)\n", addr);
+ dev_dbg(&adap->dev, "cpm_i2c_write(abyte=0x%x)\n", addr);
memcpy(tb+1, pmsg->buf, pmsg->len);
@@ -350,7 +350,7 @@
}
/* Start transfer now */
/* Enable RX/TX/Error interupts */
- out_8(&i2c_reg->i2cmr, I2CER_BUSY | I2CER_TXB | I2CER_RXB);
+ out_8(&i2c_reg->i2cmr, I2CER_TXE | I2CER_TXB | I2CER_RXB);
out_8(&i2c_reg->i2cer, 0xff); /* Clear interrupt status */
/* Chip bug, set enable here */
setbits8(&i2c_reg->i2mod, I2MOD_EN); /* Enable */
@@ -553,8 +553,8 @@
cpm_reset_i2c_params(cpm);
- dev_dbg(&cpm->ofdev->dev, "i2c_ram %p, i2c_addr 0x%04x\n",
- cpm->i2c_ram, cpm->i2c_addr);
+ dev_dbg(&cpm->ofdev->dev, "i2c_ram 0x%p, i2c_addr 0x%04x, freq %d\n",
+ cpm->i2c_ram, cpm->i2c_addr, cpm->freq);
dev_dbg(&cpm->ofdev->dev, "tbase 0x%04x, rbase 0x%04x\n",
(u8 __iomem *)cpm->tbase - DPRAM_BASE,
(u8 __iomem *)cpm->rbase - DPRAM_BASE);
@@ -568,7 +568,7 @@
/*
* PDIV is set to 00 in i2mod, so brgclk/32 is used as input to the
- * i2c baud rate generator. This is devided by 2 x (DIV + 3) to get
+ * i2c baud rate generator. This is divided by 2 x (DIV + 3) to get
* the actual i2c bus frequency.
*/
brg = get_brgfreq() / (32 * 2 * cpm->freq) - 3;
--
Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 157 bytes --]
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 15+ messages in thread[parent not found: <20080620084155.GA17701-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>]
* Re: [PATCH] Bugfixes for i2c-cpm.c [not found] ` <20080620084155.GA17701-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> @ 2008-06-23 12:44 ` Wolfram Sang [not found] ` <20080623124425.GE3926-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> 2008-06-24 14:15 ` Laurent Pinchart 1 sibling, 1 reply; 15+ messages in thread From: Wolfram Sang @ 2008-06-23 12:44 UTC (permalink / raw) To: jochen-NIgtFMG+Po8; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA [-- Attachment #1.1: Type: text/plain, Size: 2844 bytes --] On Fri, Jun 20, 2008 at 10:41:55AM +0200, Wolfram Sang wrote: Any new on this one? I think at least the interrupt fix should make it into 2.6.26. The mistakenly activated interrupt caused a regression here, which made at24 fail on writes. Wolfram > > Bugfixes to the i2c-cpm driver > > - enable correct interrupts (I2CER_TXE instead of I2CER_BUSY) > - replace forgotten iic with i2c > - fix typo (devided) > - prefix debug-output on init with 0x and add frequency > > Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> > --- > Sorry for the resend; the CC to Jochen was dropped, haven't figured out > why, yet. > > drivers/i2c/busses/i2c-cpm.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > Index: drivers/i2c/busses/i2c-cpm.c > =================================================================== > --- drivers/i2c/busses/i2c-cpm.c.orig > +++ drivers/i2c/busses/i2c-cpm.c > @@ -241,7 +241,7 @@ > eieio(); > setbits16(&tbdf->cbd_sc, BD_SC_READY); > } else { > - dev_dbg(&adap->dev, "cpm_iic_write(abyte=0x%x)\n", addr); > + dev_dbg(&adap->dev, "cpm_i2c_write(abyte=0x%x)\n", addr); > > memcpy(tb+1, pmsg->buf, pmsg->len); > > @@ -350,7 +350,7 @@ > } > /* Start transfer now */ > /* Enable RX/TX/Error interupts */ > - out_8(&i2c_reg->i2cmr, I2CER_BUSY | I2CER_TXB | I2CER_RXB); > + out_8(&i2c_reg->i2cmr, I2CER_TXE | I2CER_TXB | I2CER_RXB); > out_8(&i2c_reg->i2cer, 0xff); /* Clear interrupt status */ > /* Chip bug, set enable here */ > setbits8(&i2c_reg->i2mod, I2MOD_EN); /* Enable */ > @@ -553,8 +553,8 @@ > > cpm_reset_i2c_params(cpm); > > - dev_dbg(&cpm->ofdev->dev, "i2c_ram %p, i2c_addr 0x%04x\n", > - cpm->i2c_ram, cpm->i2c_addr); > + dev_dbg(&cpm->ofdev->dev, "i2c_ram 0x%p, i2c_addr 0x%04x, freq %d\n", > + cpm->i2c_ram, cpm->i2c_addr, cpm->freq); > dev_dbg(&cpm->ofdev->dev, "tbase 0x%04x, rbase 0x%04x\n", > (u8 __iomem *)cpm->tbase - DPRAM_BASE, > (u8 __iomem *)cpm->rbase - DPRAM_BASE); > @@ -568,7 +568,7 @@ > > /* > * PDIV is set to 00 in i2mod, so brgclk/32 is used as input to the > - * i2c baud rate generator. This is devided by 2 x (DIV + 3) to get > + * i2c baud rate generator. This is divided by 2 x (DIV + 3) to get > * the actual i2c bus frequency. > */ > brg = get_brgfreq() / (32 * 2 * cpm->freq) - 3; > > -- > Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de > Pengutronix - Linux Solutions for Science and Industry > _______________________________________________ > i2c mailing list > i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org > http://lists.lm-sensors.org/mailman/listinfo/i2c -- Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de Pengutronix - Linux Solutions for Science and Industry [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 189 bytes --] [-- Attachment #2: Type: text/plain, Size: 157 bytes --] _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <20080623124425.GE3926-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>]
* Re: [PATCH] Bugfixes for i2c-cpm.c [not found] ` <20080623124425.GE3926-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> @ 2008-06-23 13:59 ` Jean Delvare [not found] ` <20080623155909.525f5095-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org> 0 siblings, 1 reply; 15+ messages in thread From: Jean Delvare @ 2008-06-23 13:59 UTC (permalink / raw) To: Wolfram Sang; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA Hi Wolfram, On Mon, 23 Jun 2008 14:44:25 +0200, Wolfram Sang wrote: > On Fri, Jun 20, 2008 at 10:41:55AM +0200, Wolfram Sang wrote: > > Any new on this one? I think at least the interrupt fix should make it > into 2.6.26. The mistakenly activated interrupt caused a regression > here, which made at24 fail on writes. I was away for the week-end and am now processing the stacked e-mail and other real-life tasks (takes time.) I fail to see how there would be a regression here given that the i2c-cpm driver is new and is not in kernel 2.6.26. It will only be merged in 2.6.27-rc1. Not to mean that we don't want to fix the bugs quickly, but it feels less urgent than if it was in 2.6.26. As far as the review is concerned, ideally Jochen would do it as the driver author and someone who presumably has hardware to test the driver (I don't.) If Jochen acks the patch then I can add it to my i2c tree quickly. Thanks, -- Jean Delvare _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <20080623155909.525f5095-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>]
* Re: [PATCH] Bugfixes for i2c-cpm.c [not found] ` <20080623155909.525f5095-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org> @ 2008-06-23 15:07 ` Wolfram Sang 2008-06-27 8:15 ` Jochen Friedrich 1 sibling, 0 replies; 15+ messages in thread From: Wolfram Sang @ 2008-06-23 15:07 UTC (permalink / raw) To: Jean Delvare; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA [-- Attachment #1.1: Type: text/plain, Size: 669 bytes --] On Mon, Jun 23, 2008 at 03:59:09PM +0200, Jean Delvare wrote: > I was away for the week-end and am now processing the stacked e-mail > and other real-life tasks (takes time.) This was more addressed to Jochen; should have pointed out, that I was waiting for his ACK. > I fail to see how there would be a regression here given that the > i2c-cpm driver is new and is not in kernel 2.6.26. Ups, sigh, I remembered you added it to your tree and mistook it that you also already pushed it. Point taken, not that urgent. Sorry! Wolfram -- Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de Pengutronix - Linux Solutions for Science and Industry [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 189 bytes --] [-- Attachment #2: Type: text/plain, Size: 157 bytes --] _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] Bugfixes for i2c-cpm.c [not found] ` <20080623155909.525f5095-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org> 2008-06-23 15:07 ` Wolfram Sang @ 2008-06-27 8:15 ` Jochen Friedrich 1 sibling, 0 replies; 15+ messages in thread From: Jochen Friedrich @ 2008-06-27 8:15 UTC (permalink / raw) To: Jean Delvare; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA Hi Jean, >> Any new on this one? I think at least the interrupt fix should make it >> into 2.6.26. The mistakenly activated interrupt caused a regression >> here, which made at24 fail on writes. > > I was away for the week-end and am now processing the stacked e-mail > and other real-life tasks (takes time.) I was away the last 2 weeks, as well and just finished my stacked e-mail. > As far as the review is concerned, ideally Jochen would do it as the > driver author and someone who presumably has hardware to test the > driver (I don't.) If Jochen acks the patch then I can add it to my i2c > tree quickly. I'll do this ASAP now. Thanks, Jochen _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] Bugfixes for i2c-cpm.c [not found] ` <20080620084155.GA17701-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> 2008-06-23 12:44 ` Wolfram Sang @ 2008-06-24 14:15 ` Laurent Pinchart [not found] ` <200806241615.08826.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org> 1 sibling, 1 reply; 15+ messages in thread From: Laurent Pinchart @ 2008-06-24 14:15 UTC (permalink / raw) To: i2c-GZX6beZjE8VD60Wz+7aTrA [-- Attachment #1.1: Type: text/plain, Size: 2505 bytes --] On Friday 20 June 2008 10:41, Wolfram Sang wrote: > > Bugfixes to the i2c-cpm driver > > - enable correct interrupts (I2CER_TXE instead of I2CER_BUSY) > - replace forgotten iic with i2c > - fix typo (devided) > - prefix debug-output on init with 0x and add frequency > > Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> Tested on a MPC8247 board. I have experienced I2C issues since migration from ppc to powerpc. This patch seems to solve the problem. > --- > Sorry for the resend; the CC to Jochen was dropped, haven't figured out > why, yet. > > drivers/i2c/busses/i2c-cpm.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > Index: drivers/i2c/busses/i2c-cpm.c > =================================================================== > --- drivers/i2c/busses/i2c-cpm.c.orig > +++ drivers/i2c/busses/i2c-cpm.c > @@ -241,7 +241,7 @@ > eieio(); > setbits16(&tbdf->cbd_sc, BD_SC_READY); > } else { > - dev_dbg(&adap->dev, "cpm_iic_write(abyte=0x%x)\n", addr); > + dev_dbg(&adap->dev, "cpm_i2c_write(abyte=0x%x)\n", addr); > > memcpy(tb+1, pmsg->buf, pmsg->len); > > @@ -350,7 +350,7 @@ > } > /* Start transfer now */ > /* Enable RX/TX/Error interupts */ > - out_8(&i2c_reg->i2cmr, I2CER_BUSY | I2CER_TXB | I2CER_RXB); > + out_8(&i2c_reg->i2cmr, I2CER_TXE | I2CER_TXB | I2CER_RXB); > out_8(&i2c_reg->i2cer, 0xff); /* Clear interrupt status */ > /* Chip bug, set enable here */ > setbits8(&i2c_reg->i2mod, I2MOD_EN); /* Enable */ > @@ -553,8 +553,8 @@ > > cpm_reset_i2c_params(cpm); > > - dev_dbg(&cpm->ofdev->dev, "i2c_ram %p, i2c_addr 0x%04x\n", > - cpm->i2c_ram, cpm->i2c_addr); > + dev_dbg(&cpm->ofdev->dev, "i2c_ram 0x%p, i2c_addr 0x%04x, freq %d\n", > + cpm->i2c_ram, cpm->i2c_addr, cpm->freq); > dev_dbg(&cpm->ofdev->dev, "tbase 0x%04x, rbase 0x%04x\n", > (u8 __iomem *)cpm->tbase - DPRAM_BASE, > (u8 __iomem *)cpm->rbase - DPRAM_BASE); > @@ -568,7 +568,7 @@ > > /* > * PDIV is set to 00 in i2mod, so brgclk/32 is used as input to the > - * i2c baud rate generator. This is devided by 2 x (DIV + 3) to get > + * i2c baud rate generator. This is divided by 2 x (DIV + 3) to get > * the actual i2c bus frequency. > */ > brg = get_brgfreq() / (32 * 2 * cpm->freq) - 3; > -- Laurent Pinchart CSE Semaphore Belgium Chaussee de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75 [-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --] [-- Attachment #2: Type: text/plain, Size: 157 bytes --] _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <200806241615.08826.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org>]
* Re: [PATCH] Bugfixes for i2c-cpm.c [not found] ` <200806241615.08826.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org> @ 2008-06-27 8:22 ` Jochen Friedrich [not found] ` <4864A342.4020900-NIgtFMG+Po8@public.gmane.org> 0 siblings, 1 reply; 15+ messages in thread From: Jochen Friedrich @ 2008-06-27 8:22 UTC (permalink / raw) To: Laurent Pinchart; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA Hi Laurent, >> Bugfixes to the i2c-cpm driver >> >> - enable correct interrupts (I2CER_TXE instead of I2CER_BUSY) >> - replace forgotten iic with i2c >> - fix typo (devided) >> - prefix debug-output on init with 0x and add frequency >> >> Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> > > Tested on a MPC8247 board. I have experienced I2C issues since migration from > ppc to powerpc. This patch seems to solve the problem. What kind of problems have this been? In normal operation there shouldn't be any I2CER_TXE interrupts being generated. Thanks, Jochen _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <4864A342.4020900-NIgtFMG+Po8@public.gmane.org>]
* Re: [PATCH] Bugfixes for i2c-cpm.c [not found] ` <4864A342.4020900-NIgtFMG+Po8@public.gmane.org> @ 2008-06-27 8:40 ` Wolfram Sang 2008-07-01 13:26 ` Laurent Pinchart 1 sibling, 0 replies; 15+ messages in thread From: Wolfram Sang @ 2008-06-27 8:40 UTC (permalink / raw) To: Jochen Friedrich; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA [-- Attachment #1.1: Type: text/plain, Size: 666 bytes --] Hi Jochen, On Fri, Jun 27, 2008 at 10:22:26AM +0200, Jochen Friedrich wrote: > What kind of problems have this been? In normal operation there shouldn't be > any I2CER_TXE interrupts being generated. I had problems when writing to an EEPROM, reading worked, though. I didn't really investigate why this happened. I just saw that the old version used a hardcoded 0x13 to set interrupts and the replacement using defined constants resulted in 0x7. Changing constants to achieve 0x13 solved my problems. All the best, Wolfram -- Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de Pengutronix - Linux Solutions for Science and Industry [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 189 bytes --] [-- Attachment #2: Type: text/plain, Size: 157 bytes --] _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] Bugfixes for i2c-cpm.c [not found] ` <4864A342.4020900-NIgtFMG+Po8@public.gmane.org> 2008-06-27 8:40 ` Wolfram Sang @ 2008-07-01 13:26 ` Laurent Pinchart [not found] ` <200807011526.14514.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org> 1 sibling, 1 reply; 15+ messages in thread From: Laurent Pinchart @ 2008-07-01 13:26 UTC (permalink / raw) To: Jochen Friedrich; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA [-- Attachment #1.1: Type: text/plain, Size: 1186 bytes --] On Friday 27 June 2008, Jochen Friedrich wrote: > Hi Laurent, > > >> Bugfixes to the i2c-cpm driver > >> > >> - enable correct interrupts (I2CER_TXE instead of I2CER_BUSY) > >> - replace forgotten iic with i2c > >> - fix typo (devided) > >> - prefix debug-output on init with 0x and add frequency > >> > >> Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> > > > > Tested on a MPC8247 board. I have experienced I2C issues since migration > > from ppc to powerpc. This patch seems to solve the problem. > > What kind of problems have this been? In normal operation there shouldn't be > any I2CER_TXE interrupts being generated. I2C devices would frequently (about once every 10 cold boots) be undetected by the kernel. I tried to investigate the issue by hooking up a scope to the I2C signals, but haven't been able to reproduce the problem once the probes were connected. This might of course be a case of Murphy's law in action, but the problem disappeared after applying the patch. -- Laurent Pinchart CSE Semaphore Belgium Chaussee de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75 [-- Attachment #1.2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 197 bytes --] [-- Attachment #2: Type: text/plain, Size: 157 bytes --] _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <200807011526.14514.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org>]
* Re: [PATCH] Bugfixes for i2c-cpm.c [not found] ` <200807011526.14514.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org> @ 2008-07-02 11:40 ` Laurent Pinchart 0 siblings, 0 replies; 15+ messages in thread From: Laurent Pinchart @ 2008-07-02 11:40 UTC (permalink / raw) To: i2c-GZX6beZjE8VD60Wz+7aTrA [-- Attachment #1.1: Type: text/plain, Size: 2102 bytes --] On Tuesday 01 July 2008, Laurent Pinchart wrote: > On Friday 27 June 2008, Jochen Friedrich wrote: > > Hi Laurent, > > > > >> Bugfixes to the i2c-cpm driver > > >> > > >> - enable correct interrupts (I2CER_TXE instead of I2CER_BUSY) > > >> - replace forgotten iic with i2c > > >> - fix typo (devided) > > >> - prefix debug-output on init with 0x and add frequency > > >> > > >> Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> > > > > > > Tested on a MPC8247 board. I have experienced I2C issues since migration > > > from ppc to powerpc. This patch seems to solve the problem. > > > > What kind of problems have this been? In normal operation there shouldn't > > be any I2CER_TXE interrupts being generated. > > I2C devices would frequently (about once every 10 cold boots) be undetected > by the kernel. I tried to investigate the issue by hooking up a scope to the > I2C signals, but haven't been able to reproduce the problem once the probes > were connected. > > This might of course be a case of Murphy's law in action, but the problem > disappeared after applying the patch. Seems Murphy's law was involved :-( I've run into the same issue just now. [ 0.555664] i2c /dev entries driver [ 0.564539] rtc-pcf8563 0-0051: chip found, driver version 0.4.3 [ 0.570038] rtc-pcf8563 0-0051: rtc core: registered rtc-pcf8563 as rtc0 [ 1.576209] i2c-adapter i2c-0: I2C transfer: timeout [ 1.579642] lm75: probe of 0-0048 failed with error -1 [snip] [ 2.766230] i2c-adapter i2c-0: I2C transfer: timeout [ 2.769602] rtc-pcf8563 0-0051: pcf8563_get_datetime: read error [ 2.775345] rtc-pcf8563 0-0051: hctosys: unable to read the hardware clock The lm75 is there and works after a reboot. In this particular run the pcf8563 was detected, but it would sometimes time out during probe as well. -- Laurent Pinchart CSE Semaphore Belgium Chaussee de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75 [-- Attachment #1.2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 197 bytes --] [-- Attachment #2: Type: text/plain, Size: 157 bytes --] _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] Bugfixes for i2c-cpm.c
@ 2008-06-19 13:09 Wolfram Sang
[not found] ` <20080619130922.GF3860-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
0 siblings, 1 reply; 15+ messages in thread
From: Wolfram Sang @ 2008-06-19 13:09 UTC (permalink / raw)
To: i2c-GZX6beZjE8VD60Wz+7aTrA
[-- Attachment #1.1: Type: text/plain, Size: 2078 bytes --]
Bugfixes to the i2c-cpm driver
- enable correct interrupts (I2CER_TXE instead of I2CER_BUSY)
- replace forgotten iic with i2c
- fix typo (devided)
- prefix debug-output on init with 0x and add frequency
Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
drivers/i2c/busses/i2c-cpm.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: drivers/i2c/busses/i2c-cpm.c
===================================================================
--- drivers/i2c/busses/i2c-cpm.c.orig
+++ drivers/i2c/busses/i2c-cpm.c
@@ -241,7 +241,7 @@
eieio();
setbits16(&tbdf->cbd_sc, BD_SC_READY);
} else {
- dev_dbg(&adap->dev, "cpm_iic_write(abyte=0x%x)\n", addr);
+ dev_dbg(&adap->dev, "cpm_i2c_write(abyte=0x%x)\n", addr);
memcpy(tb+1, pmsg->buf, pmsg->len);
@@ -350,7 +350,7 @@
}
/* Start transfer now */
/* Enable RX/TX/Error interupts */
- out_8(&i2c_reg->i2cmr, I2CER_BUSY | I2CER_TXB | I2CER_RXB);
+ out_8(&i2c_reg->i2cmr, I2CER_TXE | I2CER_TXB | I2CER_RXB);
out_8(&i2c_reg->i2cer, 0xff); /* Clear interrupt status */
/* Chip bug, set enable here */
setbits8(&i2c_reg->i2mod, I2MOD_EN); /* Enable */
@@ -553,8 +553,8 @@
cpm_reset_i2c_params(cpm);
- dev_dbg(&cpm->ofdev->dev, "i2c_ram %p, i2c_addr 0x%04x\n",
- cpm->i2c_ram, cpm->i2c_addr);
+ dev_dbg(&cpm->ofdev->dev, "i2c_ram 0x%p, i2c_addr 0x%04x, freq %d\n",
+ cpm->i2c_ram, cpm->i2c_addr, cpm->freq);
dev_dbg(&cpm->ofdev->dev, "tbase 0x%04x, rbase 0x%04x\n",
(u8 __iomem *)cpm->tbase - DPRAM_BASE,
(u8 __iomem *)cpm->rbase - DPRAM_BASE);
@@ -568,7 +568,7 @@
/*
* PDIV is set to 00 in i2mod, so brgclk/32 is used as input to the
- * i2c baud rate generator. This is devided by 2 x (DIV + 3) to get
+ * i2c baud rate generator. This is divided by 2 x (DIV + 3) to get
* the actual i2c bus frequency.
*/
brg = get_brgfreq() / (32 * 2 * cpm->freq) - 3;
--
Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 157 bytes --]
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 15+ messages in thread[parent not found: <20080619130922.GF3860-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>]
* Re: [PATCH] Bugfixes for i2c-cpm.c [not found] ` <20080619130922.GF3860-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> @ 2008-06-27 16:22 ` Jochen Friedrich [not found] ` <486513C5.7040105-NIgtFMG+Po8@public.gmane.org> 0 siblings, 1 reply; 15+ messages in thread From: Jochen Friedrich @ 2008-06-27 16:22 UTC (permalink / raw) To: Wolfram Sang; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA Hi Wolfram, > Bugfixes to the i2c-cpm driver > > - enable correct interrupts (I2CER_TXE instead of I2CER_BUSY) > - replace forgotten iic with i2c > - fix typo (devided) > - prefix debug-output on init with 0x and add frequency > > Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> Could you rebase this to the i2c quilt series (http://khali.linux-fr.org/devel/linux-2.6/)? The typo (devided) already has been fixed by Jean, so this part doesn't apply. Otherwise ACK. Thanks, Jochen _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <486513C5.7040105-NIgtFMG+Po8@public.gmane.org>]
* Re: [PATCH] Bugfixes for i2c-cpm.c [not found] ` <486513C5.7040105-NIgtFMG+Po8@public.gmane.org> @ 2008-06-27 16:58 ` Wolfram Sang [not found] ` <20080627165808.GE3931-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> 0 siblings, 1 reply; 15+ messages in thread From: Wolfram Sang @ 2008-06-27 16:58 UTC (permalink / raw) To: Jochen Friedrich; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA [-- Attachment #1.1: Type: text/plain, Size: 2020 bytes --] Hi Jochen, On Fri, Jun 27, 2008 at 06:22:29PM +0200, Jochen Friedrich wrote: > Could you rebase this to the i2c quilt series (http://khali.linux-fr.org/devel/linux-2.6/)? Here you go! Have a nice weekend, Wolfram ------------------------------------------------------------------- Bugfixes to the i2c-cpm driver - enable correct interrupts (I2CER_TXE instead of I2CER_BUSY) - replace forgotten iic with i2c - prefix debug-output on init with 0x and add frequency Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> --- drivers/i2c/busses/i2c-cpm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) Index: drivers/i2c/busses/i2c-cpm.c =================================================================== --- drivers/i2c/busses/i2c-cpm.c.orig +++ drivers/i2c/busses/i2c-cpm.c @@ -241,7 +241,7 @@ eieio(); setbits16(&tbdf->cbd_sc, BD_SC_READY); } else { - dev_dbg(&adap->dev, "cpm_iic_write(abyte=0x%x)\n", addr); + dev_dbg(&adap->dev, "cpm_i2c_write(abyte=0x%x)\n", addr); memcpy(tb+1, pmsg->buf, pmsg->len); @@ -350,7 +350,7 @@ } /* Start transfer now */ /* Enable RX/TX/Error interupts */ - out_8(&i2c_reg->i2cmr, I2CER_BUSY | I2CER_TXB | I2CER_RXB); + out_8(&i2c_reg->i2cmr, I2CER_TXE | I2CER_TXB | I2CER_RXB); out_8(&i2c_reg->i2cer, 0xff); /* Clear interrupt status */ /* Chip bug, set enable here */ setbits8(&i2c_reg->i2mod, I2MOD_EN); /* Enable */ @@ -553,8 +553,8 @@ cpm_reset_i2c_params(cpm); - dev_dbg(&cpm->ofdev->dev, "i2c_ram %p, i2c_addr 0x%04x\n", - cpm->i2c_ram, cpm->i2c_addr); + dev_dbg(&cpm->ofdev->dev, "i2c_ram 0x%p, i2c_addr 0x%04x, freq %d\n", + cpm->i2c_ram, cpm->i2c_addr, cpm->freq); dev_dbg(&cpm->ofdev->dev, "tbase 0x%04x, rbase 0x%04x\n", (u8 __iomem *)cpm->tbase - DPRAM_BASE, (u8 __iomem *)cpm->rbase - DPRAM_BASE); -- Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de Pengutronix - Linux Solutions for Science and Industry [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 189 bytes --] [-- Attachment #2: Type: text/plain, Size: 157 bytes --] _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <20080627165808.GE3931-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>]
* Re: [PATCH] Bugfixes for i2c-cpm.c [not found] ` <20080627165808.GE3931-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> @ 2008-06-27 17:06 ` Jochen Friedrich [not found] ` <48651E1E.7060002-NIgtFMG+Po8@public.gmane.org> 0 siblings, 1 reply; 15+ messages in thread From: Jochen Friedrich @ 2008-06-27 17:06 UTC (permalink / raw) To: Wolfram Sang; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA Wolfram Sang schrieb: > > Bugfixes to the i2c-cpm driver > > - enable correct interrupts (I2CER_TXE instead of I2CER_BUSY) > - replace forgotten iic with i2c > - prefix debug-output on init with 0x and add frequency > > Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> Acked-by: Jochen Friedrich <jochen-NIgtFMG+Po8@public.gmane.org> _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <48651E1E.7060002-NIgtFMG+Po8@public.gmane.org>]
* Re: [PATCH] Bugfixes for i2c-cpm.c [not found] ` <48651E1E.7060002-NIgtFMG+Po8@public.gmane.org> @ 2008-06-28 7:03 ` Jean Delvare 0 siblings, 0 replies; 15+ messages in thread From: Jean Delvare @ 2008-06-28 7:03 UTC (permalink / raw) To: Jochen Friedrich; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA On Fri, 27 Jun 2008 19:06:38 +0200, Jochen Friedrich wrote: > Wolfram Sang schrieb: > > > > Bugfixes to the i2c-cpm driver > > > > - enable correct interrupts (I2CER_TXE instead of I2CER_BUSY) > > - replace forgotten iic with i2c > > - prefix debug-output on init with 0x and add frequency > > > > Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> > Acked-by: Jochen Friedrich <jochen-NIgtFMG+Po8@public.gmane.org> Applied, thanks. -- Jean Delvare _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2008-07-02 11:40 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-20 8:41 [PATCH] Bugfixes for i2c-cpm.c Wolfram Sang
[not found] ` <20080620084155.GA17701-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2008-06-23 12:44 ` Wolfram Sang
[not found] ` <20080623124425.GE3926-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2008-06-23 13:59 ` Jean Delvare
[not found] ` <20080623155909.525f5095-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-06-23 15:07 ` Wolfram Sang
2008-06-27 8:15 ` Jochen Friedrich
2008-06-24 14:15 ` Laurent Pinchart
[not found] ` <200806241615.08826.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org>
2008-06-27 8:22 ` Jochen Friedrich
[not found] ` <4864A342.4020900-NIgtFMG+Po8@public.gmane.org>
2008-06-27 8:40 ` Wolfram Sang
2008-07-01 13:26 ` Laurent Pinchart
[not found] ` <200807011526.14514.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org>
2008-07-02 11:40 ` Laurent Pinchart
-- strict thread matches above, loose matches on Subject: below --
2008-06-19 13:09 Wolfram Sang
[not found] ` <20080619130922.GF3860-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2008-06-27 16:22 ` Jochen Friedrich
[not found] ` <486513C5.7040105-NIgtFMG+Po8@public.gmane.org>
2008-06-27 16:58 ` Wolfram Sang
[not found] ` <20080627165808.GE3931-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2008-06-27 17:06 ` Jochen Friedrich
[not found] ` <48651E1E.7060002-NIgtFMG+Po8@public.gmane.org>
2008-06-28 7:03 ` Jean Delvare
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox