Jean Delvare | 1 Nov 2009 13:25
Gravatar

[PATCH] i2c-i801: Retry on lost arbitration

The Intel 82801 is sometimes used on systems with a BMC connected. The
BMC can access the SMBus, resulting in lost arbitration for the 82801.
We should let i2c-core retry transactions for us in this case.

Signed-off-by: Jean Delvare <khali@...>
---
 drivers/i2c/busses/i2c-i801.c |    3 +++
 1 file changed, 3 insertions(+)

--- linux-2.6.32-rc5.orig/drivers/i2c/busses/i2c-i801.c	2009-10-05 10:45:49.000000000 +0200
+++ linux-2.6.32-rc5/drivers/i2c/busses/i2c-i801.c	2009-11-01 11:33:29.000000000 +0100
 <at>  <at>  -767,6 +767,9  <at>  <at>  static int __devinit i801_probe(struct p
 	/* set up the sysfs linkage to our parent device */
 	i801_adapter.dev.parent = &dev->dev;

+	/* Retry up to 3 times on arbitration loss */
+	i801_adapter.retries = 3;
+
 	snprintf(i801_adapter.name, sizeof(i801_adapter.name),
 		"SMBus I801 adapter at %04lx", i801_smba);
 	err = i2c_add_adapter(&i801_adapter);

--

-- 
Jean Delvare
Uwe Kleine-König | 3 Nov 2009 20:03
Picon
Favicon
Gravatar

[PATCH 1/2] [ARM] i2c/pxa: remove unused macro

Commit

	beea494 ([ARM] Remove EEPROM slave emulation from i2c-pxa driver.)

removed all uses of eedbg, so the definition can go, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...>
Cc: Jean Delvare <khali@...>
Cc: Ben Dooks <ben-linux@...>
Cc: Russell King <rmk+kernel@...>
Cc: Eric Miao <eric.miao@...>
Cc: Roel Kluin <roel.kluin@...>
Cc: Pavel Machek <pavel@...>
---
 drivers/i2c/busses/i2c-pxa.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 0495557..40052c0 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
 <at>  <at>  -216,8 +216,6  <at>  <at>  static void i2c_pxa_show_state(struct pxa_i2c *i2c, int lno, const char *fname)
 #define decode_ICR(val) do { } while (0)
 #endif

-#define eedbg(lvl, x...) do { if ((lvl) < 1) { printk(KERN_DEBUG "" x); } } while(0)
-
 static void i2c_pxa_master_complete(struct pxa_i2c *i2c, int ret);
 static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id);

(Continue reading)

Uwe Kleine-König | 3 Nov 2009 20:03
Picon
Favicon
Gravatar

[PATCH 2/2] [ARM] i2c/pxa: only define 'blue_murder'-function if DEBUG is #defined

From: Wolfram Sang <w.sang@...>

This talkative function is also called on timeouts. As timeouts can
happen on regular writes to EEPROMs (no error case), this creates false
positives.  Giving lots of details is interesting only for developers
anyhow, so just use the function if DEBUG is #defined.

Signed-off-by: Wolfram Sang <w.sang@...>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...>
Cc: Jean Delvare <khali@...>
Cc: Ben Dooks <ben-linux@...>
Cc: Russell King <rmk+kernel@...>
Cc: Eric Miao <eric.miao@...>
Cc: Roel Kluin <roel.kluin@...>
Cc: Pavel Machek <pavel@...>
---
 drivers/i2c/busses/i2c-pxa.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 40052c0..009e52e 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
 <at>  <at>  -208,16 +208,6  <at>  <at>  static void i2c_pxa_show_state(struct pxa_i2c *i2c, int lno, const char *fname)
 }

 #define show_state(i2c) i2c_pxa_show_state(i2c, __LINE__, __func__)
-#else
-#define i2c_debug	0
-
(Continue reading)

Pavel Machek | 3 Nov 2009 20:06
Picon

Re: [PATCH 1/2] [ARM] i2c/pxa: remove unused macro

On Tue 2009-11-03 20:03:19, Uwe Kleine-König wrote:
> Commit
> 
> 	beea494 ([ARM] Remove EEPROM slave emulation from i2c-pxa driver.)
> 
> removed all uses of eedbg, so the definition can go, too.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...>
> Cc: Jean Delvare <khali@...>
> Cc: Ben Dooks <ben-linux@...>
> Cc: Russell King <rmk+kernel@...>
> Cc: Eric Miao <eric.miao@...>
> Cc: Roel Kluin <roel.kluin@...>

Acked-by: Pavel Machek <pavel@...>

--

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Uwe Kleine-König | 3 Nov 2009 21:00
Picon
Favicon
Gravatar

Re: [PATCH 1/2] [ARM] i2c/pxa: remove unused macro

Hello,

> Cc: Eric Miao <eric.miao@...>
postmaster@... claims the address
ymiao3@... isn't
valid.  So I think Eric got a new one.

If you answer to that thread please take care to use
eric.y.miao@... which hopefully works.

Best regards
Uwe

--

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
Russell King | 3 Nov 2009 22:01
Picon

Re: [PATCH 1/2] [ARM] i2c/pxa: remove unused macro

On Tue, Nov 03, 2009 at 08:03:19PM +0100, Uwe Kleine-König wrote:
> Commit
> 
> 	beea494 ([ARM] Remove EEPROM slave emulation from i2c-pxa driver.)

Oh great.  Some people may remember the LX code that I submitted to
the mailing list a while back.  Removing the slave emulation buggers
that platform up.  I do intend to submit that once the issue of where
the PCON support should be located is resolved - which is still
pending.

Please revert this change, thanks.

--

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
Ben Dooks | 3 Nov 2009 23:12

Re: [PATCH 1/2] [ARM] i2c/pxa: remove unused macro

On Tue, Nov 03, 2009 at 09:01:15PM +0000, Russell King wrote:
> On Tue, Nov 03, 2009 at 08:03:19PM +0100, Uwe Kleine-K?nig wrote:
> > Commit
> > 
> > 	beea494 ([ARM] Remove EEPROM slave emulation from i2c-pxa driver.)
> 
> Oh great.  Some people may remember the LX code that I submitted to
> the mailing list a while back.  Removing the slave emulation buggers
> that platform up.  I do intend to submit that once the issue of where
> the PCON support should be located is resolved - which is still
> pending.
> 
> Please revert this change, thanks.

Would you like it reverted in the next merge window, or when the
LX code is actually added?

I'll NAK any changes to remove the eedbg() for the moment.

--

-- 
Ben (ben@..., http://www.fluff.org/)

  'a smiley only costs 4 bytes'
Ben Dooks | 3 Nov 2009 23:13

Re: [PATCH 1/2] [ARM] i2c/pxa: remove unused macro

On Tue, Nov 03, 2009 at 08:03:19PM +0100, Uwe Kleine-K??nig wrote:
> Commit
> 
> 	beea494 ([ARM] Remove EEPROM slave emulation from i2c-pxa driver.)
> 
> removed all uses of eedbg, so the definition can go, too.

I belive Russell is trying to sort out the code that was using this
so I would like to put this on hold until we sort out what is going
on.

--

-- 
Ben (ben@..., http://www.fluff.org/)

  'a smiley only costs 4 bytes'
Uwe Kleine-König | 4 Nov 2009 10:00
Picon
Favicon
Gravatar

Re: [PATCH 1/2] [ARM] i2c/pxa: remove unused macro

Hello,

On Tue, Nov 03, 2009 at 09:01:15PM +0000, Russell King wrote:
> On Tue, Nov 03, 2009 at 08:03:19PM +0100, Uwe Kleine-König wrote:
> > Commit
> > 
> > 	beea494 ([ARM] Remove EEPROM slave emulation from i2c-pxa driver.)
> 
> Oh great.  Some people may remember the LX code that I submitted to
> the mailing list a while back.  Removing the slave emulation buggers
> that platform up.  I do intend to submit that once the issue of where
> the PCON support should be located is resolved - which is still
> pending.
> 
> Please revert this change, thanks.
"this" means beea494 or my patch?  I'm unsure because you (Russell) are
the author of beea494.

The main reason for this series was the 2nd patch.  While creating it I
noticed that eedbg was unused.

For this second patch (only defining i2c_pxa_scream_blue_murder if DEBUG
is #defined) should I rebase it to beea494^ or should I revert beea494
and put it on top of the reverted beea494?

Thanks
Uwe

--

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
(Continue reading)

Russell King - ARM Linux | 4 Nov 2009 20:06
Picon

Re: [PATCH 1/2] [ARM] i2c/pxa: remove unused macro

On Tue, Nov 03, 2009 at 10:12:49PM +0000, Ben Dooks wrote:
> On Tue, Nov 03, 2009 at 09:01:15PM +0000, Russell King wrote:
> > On Tue, Nov 03, 2009 at 08:03:19PM +0100, Uwe Kleine-K?nig wrote:
> > > Commit
> > > 
> > > 	beea494 ([ARM] Remove EEPROM slave emulation from i2c-pxa driver.)
> > 
> > Oh great.  Some people may remember the LX code that I submitted to
> > the mailing list a while back.  Removing the slave emulation buggers
> > that platform up.  I do intend to submit that once the issue of where
> > the PCON support should be located is resolved - which is still
> > pending.
> > 
> > Please revert this change, thanks.
> 
> Would you like it reverted in the next merge window, or when the
> LX code is actually added?

Actually, the change was correct, and was part of the LX patchset - I just
misremembered where stuff was with it.

> I'll NAK any changes to remove the eedbg() for the moment.

That change is also fine, consider it acked:

Acked-by: Russell King <rmk+kernel@...>

Sorry for the noise.

Gmane