All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] OMAP3 : Fix I2C lockup during timeout/error cases
@ 2009-12-10 13:19 Manjunatha GK
  2009-12-10 14:28 ` Varadarajan, Charu Latha
  0 siblings, 1 reply; 5+ messages in thread
From: Manjunatha GK @ 2009-12-10 13:19 UTC (permalink / raw)
  To: linux-omap
  Cc: Manjunatha GK, Nishanth Menon, Sonasath, Moiz, Krishnamoorthy,
	Balaji T, Varadarajan, Charu Latha, George, Harith

Current OMAP3 I2C driver code does not follow the correct sequence for soft
reset. Due to this, lock up issues are reported during timeout/error cases.

This patch fixes above issue by disabling I2C controller as per OMAP3430 TRM
for soft reset. As per TRM, I2C controller needs to be disabled as a first
step during soft reset.

Here is correct soft reset sequence:
a. Ensure that the module is disabled
(clear the I2Ci.I2C_CON[15] I2C_EN bit to 0).
b. Set the I2Ci.I2C_SYSC[1] SRST bit to 1.
c. Enable the module by setting I2Ci.I2C_CON[15] I2C_EN bit to 1.
d. Check the I2Ci.I2C_SYSS[0] RDONE bit until it is set to 1 to
indicate the software reset is complete.

v1 : Initital version
v2 : Removed delay since time taken for disabling I2C controller is zero
     jiffies

Tested on Zoom2 and Zoom3 

Signed-off-by: Manjunatha GK <manjugk@ti.com>
Signed-off-by: George, Harith<harith@ti.com>
---
 drivers/i2c/busses/i2c-omap.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 827da08..74620c0 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -265,6 +265,11 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
 	unsigned long internal_clk = 0;
 
 	if (dev->rev >= OMAP_I2C_REV_2) {
+		/* Disable I2C controller before soft reset */
+		omap_i2c_write_reg(dev, OMAP_I2C_CON_REG,
+			omap_i2c_read_reg(dev, OMAP_I2C_CON_REG) &
+				~(OMAP_I2C_CON_EN));
+
 		omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG, SYSC_SOFTRESET_MASK);
 		/* For some reason we need to set the EN bit before the
 		 * reset done bit gets set. */
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH v2] OMAP3 : Fix I2C lockup during timeout/error cases
  2009-12-10 13:19 [PATCH v2] OMAP3 : Fix I2C lockup during timeout/error cases Manjunatha GK
@ 2009-12-10 14:28 ` Varadarajan, Charu Latha
  2009-12-10 22:49   ` Tony Lindgren
  0 siblings, 1 reply; 5+ messages in thread
From: Varadarajan, Charu Latha @ 2009-12-10 14:28 UTC (permalink / raw)
  To: G, Manjunath Kondaiah, linux-omap
  Cc: Menon, Nishanth, Sonasath, Moiz, Krishnamoorthy, Balaji T,
	George, Harith

 

>-----Original Message-----
>From: G, Manjunath Kondaiah 
>Sent: Thursday, December 10, 2009 6:49 PM
>To: linux-omap@vger.kernel.org
>Cc: G, Manjunath Kondaiah; Menon, Nishanth; Sonasath, Moiz; 
>Krishnamoorthy, Balaji T; Varadarajan, Charu Latha; George, Harith
>Subject: [PATCH v2] OMAP3 : Fix I2C lockup during timeout/error cases
>
>Current OMAP3 I2C driver code does not follow the correct 
>sequence for soft
>reset. Due to this, lock up issues are reported during 
>timeout/error cases.
>
>This patch fixes above issue by disabling I2C controller as 
>per OMAP3430 TRM
>for soft reset. As per TRM, I2C controller needs to be 
>disabled as a first
>step during soft reset.
>
>Here is correct soft reset sequence:
>a. Ensure that the module is disabled
>(clear the I2Ci.I2C_CON[15] I2C_EN bit to 0).
>b. Set the I2Ci.I2C_SYSC[1] SRST bit to 1.
>c. Enable the module by setting I2Ci.I2C_CON[15] I2C_EN bit to 1.
>d. Check the I2Ci.I2C_SYSS[0] RDONE bit until it is set to 1 to
>indicate the software reset is complete.
>
>v1 : Initital version
>v2 : Removed delay since time taken for disabling I2C 
>controller is zero
>     jiffies
>
>Tested on Zoom2 and Zoom3 
>
>Signed-off-by: Manjunatha GK <manjugk@ti.com>
>Signed-off-by: George, Harith<harith@ti.com>

Tested on 3430SDP too.
Acked-by: Charulatha V <charu@ti.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] OMAP3 : Fix I2C lockup during timeout/error cases
  2009-12-10 14:28 ` Varadarajan, Charu Latha
@ 2009-12-10 22:49   ` Tony Lindgren
  0 siblings, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2009-12-10 22:49 UTC (permalink / raw)
  To: Varadarajan, Charu Latha
  Cc: G, Manjunath Kondaiah, linux-omap, Menon, Nishanth, Sonasath,
	Moiz, Krishnamoorthy, Balaji T, George, Harith

* Varadarajan, Charu Latha <charu@ti.com> [091210 06:27]:
>  
> 
> >-----Original Message-----
> >From: G, Manjunath Kondaiah 
> >Sent: Thursday, December 10, 2009 6:49 PM
> >To: linux-omap@vger.kernel.org
> >Cc: G, Manjunath Kondaiah; Menon, Nishanth; Sonasath, Moiz; 
> >Krishnamoorthy, Balaji T; Varadarajan, Charu Latha; George, Harith
> >Subject: [PATCH v2] OMAP3 : Fix I2C lockup during timeout/error cases
> >
> >Current OMAP3 I2C driver code does not follow the correct 
> >sequence for soft
> >reset. Due to this, lock up issues are reported during 
> >timeout/error cases.
> >
> >This patch fixes above issue by disabling I2C controller as 
> >per OMAP3430 TRM
> >for soft reset. As per TRM, I2C controller needs to be 
> >disabled as a first
> >step during soft reset.
> >
> >Here is correct soft reset sequence:
> >a. Ensure that the module is disabled
> >(clear the I2Ci.I2C_CON[15] I2C_EN bit to 0).
> >b. Set the I2Ci.I2C_SYSC[1] SRST bit to 1.
> >c. Enable the module by setting I2Ci.I2C_CON[15] I2C_EN bit to 1.
> >d. Check the I2Ci.I2C_SYSS[0] RDONE bit until it is set to 1 to
> >indicate the software reset is complete.
> >
> >v1 : Initital version
> >v2 : Removed delay since time taken for disabling I2C 
> >controller is zero
> >     jiffies
> >
> >Tested on Zoom2 and Zoom3 
> >
> >Signed-off-by: Manjunatha GK <manjugk@ti.com>
> >Signed-off-by: George, Harith<harith@ti.com>
> 
> Tested on 3430SDP too.
> Acked-by: Charulatha V <charu@ti.com>

This should be sent via the i2c list and to Ben Books.

Regards,

Tony

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v2] OMAP3 : Fix I2C lockup during timeout/error cases
       [not found] ` <1260509948-12774-1-git-send-email-manjugk-l0cyMroinI0@public.gmane.org>
@ 2009-12-16 15:23   ` G, Manjunath Kondaiah
  0 siblings, 0 replies; 5+ messages in thread
From: G, Manjunath Kondaiah @ 2009-12-16 15:23 UTC (permalink / raw)
  To: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	ben-linux-elnMNo+KYs3YtjvyW6yDsg
  Cc: Menon, Nishanth, Sonasath, Moiz, Krishnamoorthy, Balaji T,
	Varadarajan, Charu Latha, George, Harith


If there are no comments for this patch, can you please consider this patch
for upstream?

-Manjunath
 

> -----Original Message-----
> From: G, Manjunath Kondaiah 
> Sent: Friday, December 11, 2009 11:09 AM
> To: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; 
> ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org
> Cc: G, Manjunath Kondaiah; Menon, Nishanth; Sonasath, Moiz; 
> Krishnamoorthy, Balaji T; Varadarajan, Charu Latha; George, Harith
> Subject: [PATCH v2] OMAP3 : Fix I2C lockup during timeout/error cases
> 
> Current OMAP3 I2C driver code does not follow the correct 
> sequence for soft
> reset. Due to this, lock up issues are reported during 
> timeout/error cases.
> 
> This patch fixes above issue by disabling I2C controller as 
> per OMAP3430 TRM
> for soft reset. As per TRM, I2C controller needs to be 
> disabled as a first
> step during soft reset.
> 
> Here is correct soft reset sequence:
> a. Ensure that the module is disabled
> (clear the I2Ci.I2C_CON[15] I2C_EN bit to 0).
> b. Set the I2Ci.I2C_SYSC[1] SRST bit to 1.
> c. Enable the module by setting I2Ci.I2C_CON[15] I2C_EN bit to 1.
> d. Check the I2Ci.I2C_SYSS[0] RDONE bit until it is set to 1 to
> indicate the software reset is complete.
> 
> 
> Tested on Zoom2, Zoom3, 3430SDP and 3630SDP
> 
> Signed-off-by: Manjunatha GK <manjugk-l0cyMroinI0@public.gmane.org>
> Signed-off-by: George, Harith<harith-l0cyMroinI0@public.gmane.org>
> Acked-by: Varadarajan, Charu Latha<charu-l0cyMroinI0@public.gmane.org>
> ---
> v1 : Initital version
> v2 : Removed delay since time taken for disabling I2C 
> controller is zero
>      jiffies
> 
>  drivers/i2c/busses/i2c-omap.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-omap.c 
> b/drivers/i2c/busses/i2c-omap.c
> index 827da08..74620c0 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -265,6 +265,11 @@ static int omap_i2c_init(struct 
> omap_i2c_dev *dev)
>  	unsigned long internal_clk = 0;
>  
>  	if (dev->rev >= OMAP_I2C_REV_2) {
> +		/* Disable I2C controller before soft reset */
> +		omap_i2c_write_reg(dev, OMAP_I2C_CON_REG,
> +			omap_i2c_read_reg(dev, OMAP_I2C_CON_REG) &
> +				~(OMAP_I2C_CON_EN));
> +
>  		omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG, 
> SYSC_SOFTRESET_MASK);
>  		/* For some reason we need to set the EN bit before the
>  		 * reset done bit gets set. */
> -- 
> 1.6.0.4
> 
> --
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] OMAP3 : Fix I2C lockup during timeout/error cases
@ 2009-12-11  5:39 Manjunatha GK
       [not found] ` <1260509948-12774-1-git-send-email-manjugk-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Manjunatha GK @ 2009-12-11  5:39 UTC (permalink / raw)
  To: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	ben-linux-elnMNo+KYs3YtjvyW6yDsg
  Cc: Manjunatha GK, Nishanth Menon, Sonasath, Moiz, Krishnamoorthy,
	Balaji T, Varadarajan, Charu Latha, George, Harith

Current OMAP3 I2C driver code does not follow the correct sequence for soft
reset. Due to this, lock up issues are reported during timeout/error cases.

This patch fixes above issue by disabling I2C controller as per OMAP3430 TRM
for soft reset. As per TRM, I2C controller needs to be disabled as a first
step during soft reset.

Here is correct soft reset sequence:
a. Ensure that the module is disabled
(clear the I2Ci.I2C_CON[15] I2C_EN bit to 0).
b. Set the I2Ci.I2C_SYSC[1] SRST bit to 1.
c. Enable the module by setting I2Ci.I2C_CON[15] I2C_EN bit to 1.
d. Check the I2Ci.I2C_SYSS[0] RDONE bit until it is set to 1 to
indicate the software reset is complete.


Tested on Zoom2, Zoom3, 3430SDP and 3630SDP

Signed-off-by: Manjunatha GK <manjugk-l0cyMroinI0@public.gmane.org>
Signed-off-by: George, Harith<harith-l0cyMroinI0@public.gmane.org>
Acked-by: Varadarajan, Charu Latha<charu-l0cyMroinI0@public.gmane.org>
---
v1 : Initital version
v2 : Removed delay since time taken for disabling I2C controller is zero
     jiffies

 drivers/i2c/busses/i2c-omap.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 827da08..74620c0 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -265,6 +265,11 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
 	unsigned long internal_clk = 0;
 
 	if (dev->rev >= OMAP_I2C_REV_2) {
+		/* Disable I2C controller before soft reset */
+		omap_i2c_write_reg(dev, OMAP_I2C_CON_REG,
+			omap_i2c_read_reg(dev, OMAP_I2C_CON_REG) &
+				~(OMAP_I2C_CON_EN));
+
 		omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG, SYSC_SOFTRESET_MASK);
 		/* For some reason we need to set the EN bit before the
 		 * reset done bit gets set. */
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-12-16 15:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-10 13:19 [PATCH v2] OMAP3 : Fix I2C lockup during timeout/error cases Manjunatha GK
2009-12-10 14:28 ` Varadarajan, Charu Latha
2009-12-10 22:49   ` Tony Lindgren
2009-12-11  5:39 Manjunatha GK
     [not found] ` <1260509948-12774-1-git-send-email-manjugk-l0cyMroinI0@public.gmane.org>
2009-12-16 15:23   ` G, Manjunath Kondaiah

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.