linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: omap: fix OOPS in omap_i2c_unidle() during probe
@ 2010-03-23 10:12 Mika Westerberg
  2010-03-31 10:27 ` Paul Walmsley
  0 siblings, 1 reply; 7+ messages in thread
From: Mika Westerberg @ 2010-03-23 10:12 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, Cory Maccarrone

Commit d84d3ea317ce0db89ce0903b4037f800c5d4c477 added register shift to allow
also 16-bit register access. However, omap_i2c_unidle() is called before these
are set which causes the following OOPS:

    Unhandled fault: alignment exception (0x801) at 0xfa070009
    Internal error: : 801 [#1]
    last sysfs file:
    Modules linked in:
    CPU: 0    Not tainted  (2.6.34-rc2-00052-gae6be51 #3)
    PC is at omap_i2c_unidle+0x44/0x138
    LR is at trace_hardirqs_on_caller+0x158/0x18c
    pc : [<c01cd2c4>]    lr : [<c00743f8>]    psr: 20000013
    sp : cfc2bf10  ip : 00000009  fp : 00000000
    r10: 00000000  r9 : 00000000  r8 : c0378560
    r7 : c0378b88  r6 : c0378558  r5 : cfcadc00  r4 : cfcadc00
    r3 : 00000009  r2 : fa070000  r1 : 00000000  r0 : 00000000
    Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
    Control: 10c5387f  Table: 80004019  DAC: 00000017
    Process swapper (pid: 1, stack limit = 0xcfc2a2e8)
    Stack: (0xcfc2bf10 to 0xcfc2c000)
    bf00:                                     c0372cf8 c027225c 00000000 c0a69678
    bf20: cfc3e508 c0500898 c0378560 c0378560 c0500898 cfcac8c0 c04fc280 c017d4f4
    bf40: c0378560 c017c63c c0378560 c0378594 c0500898 cfcac8c0 c04fc280 c017c754
    bf60: 00000000 c017c6f4 c0500898 c017beac cfc16a5c cfc3fd94 c0023448 c0500898
    bf80: c0500898 c017b7d4 c032dc7f 00000093 cfc28d40 c0023448 00000000 c0500898
    bfa0: 00000000 00000000 00000000 c017ca48 c0023448 00000000 c001d274 00000000
    bfc0: 00000000 c002b344 00000031 00000000 00000000 00000192 00000000 c0023448
    bfe0: 00000000 00000000 00000000 c0008578 00000000 c002c304 ffdfffff ffffffff
    [<c01cd2c4>] (omap_i2c_unidle+0x44/0x138) from [<c027225c>] (omap_i2c_probe+0x1a4/0x398)
    [<c027225c>] (omap_i2c_probe+0x1a4/0x398) from [<c017d4f4>] (platform_drv_probe+0x18/0x1c)
    [<c017d4f4>] (platform_drv_probe+0x18/0x1c) from [<c017c63c>] (driver_probe_device+0xc0/0x178)
    [<c017c63c>] (driver_probe_device+0xc0/0x178) from [<c017c754>] (__driver_attach+0x60/0x84)
    [<c017c754>] (__driver_attach+0x60/0x84) from [<c017beac>] (bus_for_each_dev+0x44/0x74)
    [<c017beac>] (bus_for_each_dev+0x44/0x74) from [<c017b7d4>] (bus_add_driver+0x9c/0x218)
    [<c017b7d4>] (bus_add_driver+0x9c/0x218) from [<c017ca48>] (driver_register+0xa8/0x130)
    [<c017ca48>] (driver_register+0xa8/0x130) from [<c002b344>] (do_one_initcall+0x5c/0x1b8)
    [<c002b344>] (do_one_initcall+0x5c/0x1b8) from [<c0008578>] (kernel_init+0x90/0x144)
    [<c0008578>] (kernel_init+0x90/0x144) from [<c002c304>] (kernel_thread_exit+0x0/0x8)
    Code: e5942004 e3a0c009 e1a0331c e3a01000 (e18210b3)
    ---[ end trace 1b75b31a2719ed1c ]---

This patch moves register shift setting before any register accesses are done.

Signed-off-by: Mika Westerberg <ext-mika.1.westerberg-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
Cc: Cory Maccarrone <darkstar6262-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/i2c/busses/i2c-omap.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index c7c2375..0d5a54a 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -902,6 +902,11 @@ omap_i2c_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, dev);
 
+	if (cpu_is_omap7xx())
+		dev->reg_shift = 1;
+	else
+		dev->reg_shift = 2;
+
 	if ((r = omap_i2c_get_clocks(dev)) != 0)
 		goto err_iounmap;
 
@@ -925,11 +930,6 @@ omap_i2c_probe(struct platform_device *pdev)
 		dev->b_hw = 1; /* Enable hardware fixes */
 	}
 
-	if (cpu_is_omap7xx())
-		dev->reg_shift = 1;
-	else
-		dev->reg_shift = 2;
-
 	/* reset ASAP, clearing any IRQs */
 	omap_i2c_init(dev);
 
-- 
1.5.6.5

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

* Re: [PATCH] i2c: omap: fix OOPS in omap_i2c_unidle() during probe
  2010-03-23 10:12 [PATCH] i2c: omap: fix OOPS in omap_i2c_unidle() during probe Mika Westerberg
@ 2010-03-31 10:27 ` Paul Walmsley
  2010-03-31 12:27   ` Jarkko Nikula
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Walmsley @ 2010-03-31 10:27 UTC (permalink / raw)
  To: Mika Westerberg; +Cc: linux-i2c, linux-omap, Cory Maccarrone

Hi Mika, Ben,

On Tue, 23 Mar 2010, Mika Westerberg wrote:

> Commit d84d3ea317ce0db89ce0903b4037f800c5d4c477 added register shift to allow
> also 16-bit register access. However, omap_i2c_unidle() is called before these
> are set which causes the following OOPS:
> 
>     Unhandled fault: alignment exception (0x801) at 0xfa070009
>     Internal error: : 801 [#1]
>     last sysfs file:
>     Modules linked in:
>     CPU: 0    Not tainted  (2.6.34-rc2-00052-gae6be51 #3)
>     PC is at omap_i2c_unidle+0x44/0x138
>     LR is at trace_hardirqs_on_caller+0x158/0x18c
>     pc : [<c01cd2c4>]    lr : [<c00743f8>]    psr: 20000013
>     sp : cfc2bf10  ip : 00000009  fp : 00000000
>     r10: 00000000  r9 : 00000000  r8 : c0378560
>     r7 : c0378b88  r6 : c0378558  r5 : cfcadc00  r4 : cfcadc00
>     r3 : 00000009  r2 : fa070000  r1 : 00000000  r0 : 00000000
>     Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
>     Control: 10c5387f  Table: 80004019  DAC: 00000017
>     Process swapper (pid: 1, stack limit = 0xcfc2a2e8)
>     Stack: (0xcfc2bf10 to 0xcfc2c000)
>     bf00:                                     c0372cf8 c027225c 00000000 c0a69678
>     bf20: cfc3e508 c0500898 c0378560 c0378560 c0500898 cfcac8c0 c04fc280 c017d4f4
>     bf40: c0378560 c017c63c c0378560 c0378594 c0500898 cfcac8c0 c04fc280 c017c754
>     bf60: 00000000 c017c6f4 c0500898 c017beac cfc16a5c cfc3fd94 c0023448 c0500898
>     bf80: c0500898 c017b7d4 c032dc7f 00000093 cfc28d40 c0023448 00000000 c0500898
>     bfa0: 00000000 00000000 00000000 c017ca48 c0023448 00000000 c001d274 00000000
>     bfc0: 00000000 c002b344 00000031 00000000 00000000 00000192 00000000 c0023448
>     bfe0: 00000000 00000000 00000000 c0008578 00000000 c002c304 ffdfffff ffffffff
>     [<c01cd2c4>] (omap_i2c_unidle+0x44/0x138) from [<c027225c>] (omap_i2c_probe+0x1a4/0x398)
>     [<c027225c>] (omap_i2c_probe+0x1a4/0x398) from [<c017d4f4>] (platform_drv_probe+0x18/0x1c)
>     [<c017d4f4>] (platform_drv_probe+0x18/0x1c) from [<c017c63c>] (driver_probe_device+0xc0/0x178)
>     [<c017c63c>] (driver_probe_device+0xc0/0x178) from [<c017c754>] (__driver_attach+0x60/0x84)
>     [<c017c754>] (__driver_attach+0x60/0x84) from [<c017beac>] (bus_for_each_dev+0x44/0x74)
>     [<c017beac>] (bus_for_each_dev+0x44/0x74) from [<c017b7d4>] (bus_add_driver+0x9c/0x218)
>     [<c017b7d4>] (bus_add_driver+0x9c/0x218) from [<c017ca48>] (driver_register+0xa8/0x130)
>     [<c017ca48>] (driver_register+0xa8/0x130) from [<c002b344>] (do_one_initcall+0x5c/0x1b8)
>     [<c002b344>] (do_one_initcall+0x5c/0x1b8) from [<c0008578>] (kernel_init+0x90/0x144)
>     [<c0008578>] (kernel_init+0x90/0x144) from [<c002c304>] (kernel_thread_exit+0x0/0x8)
>     Code: e5942004 e3a0c009 e1a0331c e3a01000 (e18210b3)
>     ---[ end trace 1b75b31a2719ed1c ]---
> 
> This patch moves register shift setting before any register accesses are done.
> 
> Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
> Cc: Cory Maccarrone <darkstar6262@gmail.com>

Tested-by: Paul Walmsley <paul@pwsan.com>


- Paul

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

* Re: [PATCH] i2c: omap: fix OOPS in omap_i2c_unidle() during probe
  2010-03-31 10:27 ` Paul Walmsley
@ 2010-03-31 12:27   ` Jarkko Nikula
  2010-04-16  9:47     ` Grazvydas Ignotas
  0 siblings, 1 reply; 7+ messages in thread
From: Jarkko Nikula @ 2010-03-31 12:27 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: Mika Westerberg, linux-i2c, linux-omap, Cory Maccarrone

On Wed, 31 Mar 2010 04:27:41 -0600 (MDT)
Paul Walmsley <paul@pwsan.com> wrote:

> > This patch moves register shift setting before any register accesses are done.
> > 
> > Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
> > Cc: Cory Maccarrone <darkstar6262@gmail.com>
> 
> Tested-by: Paul Walmsley <paul@pwsan.com>
> 
BTW, Tony had the same fix buried in an another thread:

http://marc.info/?l=linux-omap&m=126826012627677&w=2

You could add my tested by as well to which one goes in but the fix
should go for 2.6.34 as the mainline doesn't boot otherwise on OMAP.

Tested-by: Jarkko Nikula <jhnikula@gmail.com>

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

* Re: [PATCH] i2c: omap: fix OOPS in omap_i2c_unidle() during probe
  2010-03-31 12:27   ` Jarkko Nikula
@ 2010-04-16  9:47     ` Grazvydas Ignotas
       [not found]       ` <n2m6ed0b2681004160247o7cddd774sd199ea0eb51c9946-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Grazvydas Ignotas @ 2010-04-16  9:47 UTC (permalink / raw)
  To: Ben Dooks (embedded platforms)
  Cc: Paul Walmsley, Mika Westerberg, linux-i2c, linux-omap,
	Cory Maccarrone, Jarkko Nikula, Jean Delvare, Tony Lindgren

On Wed, Mar 31, 2010 at 3:27 PM, Jarkko Nikula <jhnikula@gmail.com> wrote:
> On Wed, 31 Mar 2010 04:27:41 -0600 (MDT)
> Paul Walmsley <paul@pwsan.com> wrote:
>
>> > This patch moves register shift setting before any register accesses are done.
>> >
>> > Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
>> > Cc: Cory Maccarrone <darkstar6262@gmail.com>
>>
>> Tested-by: Paul Walmsley <paul@pwsan.com>
>>
> BTW, Tony had the same fix buried in an another thread:
>
> http://marc.info/?l=linux-omap&m=126826012627677&w=2
>
> You could add my tested by as well to which one goes in but the fix
> should go for 2.6.34 as the mainline doesn't boot otherwise on OMAP.

Uhm why does this patch (or Tony's version) doesn't reach mainline for
so long? It's critical for all OMAPs except the very old ones.

If it helps:
Tested-by: Grazvydas Ignotas <notasas@gmail.com>

>
> Tested-by: Jarkko Nikula <jhnikula@gmail.com>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] i2c: omap: fix OOPS in omap_i2c_unidle() during probe
       [not found]       ` <n2m6ed0b2681004160247o7cddd774sd199ea0eb51c9946-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-05-11  6:54         ` Jarkko Nikula
       [not found]           ` <20100511095407.cb44ef8d.jhnikula-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Jarkko Nikula @ 2010-05-11  6:54 UTC (permalink / raw)
  To: Grazvydas Ignotas
  Cc: Ben Dooks (embedded platforms), Paul Walmsley, Mika Westerberg,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Cory Maccarrone, Jean Delvare,
	Tony Lindgren

On Fri, 16 Apr 2010 12:47:50 +0300
Grazvydas Ignotas <notasas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> >> Tested-by: Paul Walmsley <paul-DWxLp4Yu+b8AvxtiuMwx3w@public.gmane.org>
> Uhm why does this patch (or Tony's version) doesn't reach mainline for
> so long? It's critical for all OMAPs except the very old ones.
> 
> If it helps:
> Tested-by: Grazvydas Ignotas <notasas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> > Tested-by: Jarkko Nikula <jhnikula-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Ping? Mike or Tony, can you resend the patch just in case.

Reminder: 2.6.34 doesn't boot on OMAP without this patch.


-- 
Jarkko

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

* Re: [PATCH] i2c: omap: fix OOPS in omap_i2c_unidle() during probe
       [not found]           ` <20100511095407.cb44ef8d.jhnikula-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2010-05-11  7:01             ` Mika Westerberg
       [not found]               ` <20100511070122.GE11783-etG4378wJBqLa08RA6KHbYwBHEhOmDVPtqGf+n4yE6E@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Mika Westerberg @ 2010-05-11  7:01 UTC (permalink / raw)
  To: ext Jarkko Nikula
  Cc: Grazvydas Ignotas, Ben Dooks (embedded platforms), Paul Walmsley,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Cory Maccarrone, Jean Delvare, Tony Lindgren

On Tue, May 11, 2010 at 08:54:07AM +0200, ext Jarkko Nikula wrote:
> On Fri, 16 Apr 2010 12:47:50 +0300
> Grazvydas Ignotas <notasas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
> > >> Tested-by: Paul Walmsley <paul-DWxLp4Yu+b8AvxtiuMwx3w@public.gmane.org>
> > Uhm why does this patch (or Tony's version) doesn't reach mainline for
> > so long? It's critical for all OMAPs except the very old ones.
> > 
> > If it helps:
> > Tested-by: Grazvydas Ignotas <notasas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > 
> > > Tested-by: Jarkko Nikula <jhnikula-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> Ping? Mike or Tony, can you resend the patch just in case.
> 
> Reminder: 2.6.34 doesn't boot on OMAP without this patch.

I believe this is already in mainline:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7c6bd2010fced38444c9fd658f4c6ce61bd185bf

MW

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

* Re: [PATCH] i2c: omap: fix OOPS in omap_i2c_unidle() during probe
       [not found]               ` <20100511070122.GE11783-etG4378wJBqLa08RA6KHbYwBHEhOmDVPtqGf+n4yE6E@public.gmane.org>
@ 2010-05-11  7:19                 ` Jarkko Nikula
  0 siblings, 0 replies; 7+ messages in thread
From: Jarkko Nikula @ 2010-05-11  7:19 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Grazvydas Ignotas, Ben Dooks (embedded platforms), Paul Walmsley,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Cory Maccarrone, Jean Delvare, Tony Lindgren

On Tue, 11 May 2010 10:01:22 +0300
Mika Westerberg <ext-mika.1.westerberg-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org> wrote:

> I believe this is already in mainline:
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7c6bd2010fced38444c9fd658f4c6ce61bd185bf
> 
Ah, yeah. I was using the sound-2.6.git tree which is not yet updated
any newer than 2.6.34-rc4 and that's why I didn't see it. Sorry about
line noise.


-- 
Jarkko

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

end of thread, other threads:[~2010-05-11  7:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-23 10:12 [PATCH] i2c: omap: fix OOPS in omap_i2c_unidle() during probe Mika Westerberg
2010-03-31 10:27 ` Paul Walmsley
2010-03-31 12:27   ` Jarkko Nikula
2010-04-16  9:47     ` Grazvydas Ignotas
     [not found]       ` <n2m6ed0b2681004160247o7cddd774sd199ea0eb51c9946-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-11  6:54         ` Jarkko Nikula
     [not found]           ` <20100511095407.cb44ef8d.jhnikula-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-05-11  7:01             ` Mika Westerberg
     [not found]               ` <20100511070122.GE11783-etG4378wJBqLa08RA6KHbYwBHEhOmDVPtqGf+n4yE6E@public.gmane.org>
2010-05-11  7:19                 ` Jarkko Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).