From: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Shubhrajyoti D <shubhrajyoti-l0cyMroinI0@public.gmane.org>
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org,
tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org,
Kevin Hilman <khilman-l0cyMroinI0@public.gmane.org>,
Rajendra Nayak <rnayak-l0cyMroinI0@public.gmane.org>
Subject: Re: [PATCHv9 06/10] I2C: OMAP: Fix the crash in i2c remove
Date: Sat, 12 May 2012 20:10:19 +0200 [thread overview]
Message-ID: <20120512181019.GA28973@pengutronix.de> (raw)
In-Reply-To: <1335969135-20858-7-git-send-email-shubhrajyoti-l0cyMroinI0@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 3989 bytes --]
On Wed, May 02, 2012 at 08:02:11PM +0530, Shubhrajyoti D wrote:
> In omap_i2c_remove we are accessing the I2C_CON register without
> enabling the clocks. Fix the same by enabling the clocks and disabling
> it.
> This fixes the following crash.
> [ 154.723022] ------------[ cut here ]------------
> [ 154.725677] WARNING: at arch/arm/mach-omap2/omap_l3_noc.c:112 l3_interrupt_handler+0x1b4/0x1c4()
> [ 154.725677] L3 custom error: MASTER:MPU TARGET:L4 PER2
> [ 154.742614] Modules linked in: i2c_omap(-)
> [ 154.746948] Backtrace:
> [ 154.746948] [<c0013078>] (dump_backtrace+0x0/0x110) from [<c026c158>] (dump_stack+0x18/0x1c)
> [ 154.752716] r6:00000070 r5:c002c43c r4:df9b9e98 r3:df9b8000
> [ 154.764465] [<c026c140>] (dump_stack+0x0/0x1c) from [<c0041a2c>] (warn_slowpath_common+0x5c/0x6c)
> [ 154.768341] [<c00419d0>] (warn_slowpath_common+0x0/0x6c) from [<c0041ae0>] (warn_slowpath_fmt+0x38/0x40)
> [ 154.776153] r8:00000180 r7:c0361594 r6:c0379b48 r5:00080003 r4:e0838b00
> [ 154.790771] r3:00000009
> [ 154.791778] [<c0041aa8>] (warn_slowpath_fmt+0x0/0x40) from [<c002c43c>] (l3_interrupt_handler+0x1b4/0x1c4)
> [ 154.803710] r3:c0361598 r2:c02ef74c
> [ 154.807403] [<c002c288>] (l3_interrupt_handler+0x0/0x1c4) from [<c0085f44>] (handle_irq_event_percpu+0x58/0
> [ 154.818237] r8:0000002a r7:00000000 r6:00000000 r5:df808054 r4:df8893c0
> [ 154.825378] [<c0085eec>] (handle_irq_event_percpu+0x0/0x188) from [<c00860b8>] (handle_irq_event+0x44/0x64)
> [ 154.835662] [<c0086074>] (handle_irq_event+0x0/0x64) from [<c0088ec0>] (handle_fasteoi_irq+0xa4/0x10c)
> [ 154.845458] r6:0000002a r5:df808054 r4:df808000 r3:c034a150
> [ 154.846466] [<c0088e1c>] (handle_fasteoi_irq+0x0/0x10c) from [<c0085ed0>] (generic_handle_irq+0x30/0x38)
> [ 154.854278] r5:c034aa48 r4:0000002a
> [ 154.862091] [<c0085ea0>] (generic_handle_irq+0x0/0x38) from [<c000fd38>] (handle_IRQ+0x60/0xc0)
> [ 154.874450] r4:c034ea70 r3:000001f8
> [ 154.878234] [<c000fcd8>] (handle_IRQ+0x0/0xc0) from [<c0008478>] (gic_handle_irq+0x20/0x5c)
> [ 154.887023] r7:ffffff40 r6:df9b9fb0 r5:c034e2b4 r4:0000001a
> [ 154.887054] [<c0008458>] (gic_handle_irq+0x0/0x5c) from [<c000ea80>] (__irq_usr+0x40/0x60)
> [ 154.901153] Exception stack(0xdf9b9fb0 to 0xdf9b9ff8)
> [ 154.907104] 9fa0: beaf1f04 4006be00 0000000f 0000000c
> [ 154.915710] 9fc0: 4006c000 00000000 00008034 ffffff40 00000007 00000000 00000000 0007b8d7
> [ 154.916778] 9fe0: 00000000 beaf1b68 0000d23c 4005baf0 80000010 ffffffff
> [ 154.931335] r6:ffffffff r5:80000010 r4:4005baf0 r3:beaf1f04
> [ 154.937316] ---[ end trace 1b75b31a2719ed21 ]--
>
> Cc: Kevin Hilman <khilman-l0cyMroinI0@public.gmane.org>
> Cc: Rajendra Nayak <rnayak-l0cyMroinI0@public.gmane.org>
> Signed-off-by: Shubhrajyoti D <shubhrajyoti-l0cyMroinI0@public.gmane.org>
I'd really like a comment from the PM experts if each and every driver
has to ensure that the clocks are enabled on remove like this?
> ---
> drivers/i2c/busses/i2c-omap.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index fec8d5c..44e8cfa 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -1108,7 +1108,9 @@ omap_i2c_remove(struct platform_device *pdev)
>
> free_irq(dev->irq, dev);
> i2c_del_adapter(&dev->adapter);
> + pm_runtime_get_sync(&pdev->dev);
> omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
> + pm_runtime_put(&pdev->dev);
> pm_runtime_disable(&pdev->dev);
> iounmap(dev->base);
> kfree(dev);
> --
> 1.7.5.4
>
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: w.sang@pengutronix.de (Wolfram Sang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv9 06/10] I2C: OMAP: Fix the crash in i2c remove
Date: Sat, 12 May 2012 20:10:19 +0200 [thread overview]
Message-ID: <20120512181019.GA28973@pengutronix.de> (raw)
In-Reply-To: <1335969135-20858-7-git-send-email-shubhrajyoti@ti.com>
On Wed, May 02, 2012 at 08:02:11PM +0530, Shubhrajyoti D wrote:
> In omap_i2c_remove we are accessing the I2C_CON register without
> enabling the clocks. Fix the same by enabling the clocks and disabling
> it.
> This fixes the following crash.
> [ 154.723022] ------------[ cut here ]------------
> [ 154.725677] WARNING: at arch/arm/mach-omap2/omap_l3_noc.c:112 l3_interrupt_handler+0x1b4/0x1c4()
> [ 154.725677] L3 custom error: MASTER:MPU TARGET:L4 PER2
> [ 154.742614] Modules linked in: i2c_omap(-)
> [ 154.746948] Backtrace:
> [ 154.746948] [<c0013078>] (dump_backtrace+0x0/0x110) from [<c026c158>] (dump_stack+0x18/0x1c)
> [ 154.752716] r6:00000070 r5:c002c43c r4:df9b9e98 r3:df9b8000
> [ 154.764465] [<c026c140>] (dump_stack+0x0/0x1c) from [<c0041a2c>] (warn_slowpath_common+0x5c/0x6c)
> [ 154.768341] [<c00419d0>] (warn_slowpath_common+0x0/0x6c) from [<c0041ae0>] (warn_slowpath_fmt+0x38/0x40)
> [ 154.776153] r8:00000180 r7:c0361594 r6:c0379b48 r5:00080003 r4:e0838b00
> [ 154.790771] r3:00000009
> [ 154.791778] [<c0041aa8>] (warn_slowpath_fmt+0x0/0x40) from [<c002c43c>] (l3_interrupt_handler+0x1b4/0x1c4)
> [ 154.803710] r3:c0361598 r2:c02ef74c
> [ 154.807403] [<c002c288>] (l3_interrupt_handler+0x0/0x1c4) from [<c0085f44>] (handle_irq_event_percpu+0x58/0
> [ 154.818237] r8:0000002a r7:00000000 r6:00000000 r5:df808054 r4:df8893c0
> [ 154.825378] [<c0085eec>] (handle_irq_event_percpu+0x0/0x188) from [<c00860b8>] (handle_irq_event+0x44/0x64)
> [ 154.835662] [<c0086074>] (handle_irq_event+0x0/0x64) from [<c0088ec0>] (handle_fasteoi_irq+0xa4/0x10c)
> [ 154.845458] r6:0000002a r5:df808054 r4:df808000 r3:c034a150
> [ 154.846466] [<c0088e1c>] (handle_fasteoi_irq+0x0/0x10c) from [<c0085ed0>] (generic_handle_irq+0x30/0x38)
> [ 154.854278] r5:c034aa48 r4:0000002a
> [ 154.862091] [<c0085ea0>] (generic_handle_irq+0x0/0x38) from [<c000fd38>] (handle_IRQ+0x60/0xc0)
> [ 154.874450] r4:c034ea70 r3:000001f8
> [ 154.878234] [<c000fcd8>] (handle_IRQ+0x0/0xc0) from [<c0008478>] (gic_handle_irq+0x20/0x5c)
> [ 154.887023] r7:ffffff40 r6:df9b9fb0 r5:c034e2b4 r4:0000001a
> [ 154.887054] [<c0008458>] (gic_handle_irq+0x0/0x5c) from [<c000ea80>] (__irq_usr+0x40/0x60)
> [ 154.901153] Exception stack(0xdf9b9fb0 to 0xdf9b9ff8)
> [ 154.907104] 9fa0: beaf1f04 4006be00 0000000f 0000000c
> [ 154.915710] 9fc0: 4006c000 00000000 00008034 ffffff40 00000007 00000000 00000000 0007b8d7
> [ 154.916778] 9fe0: 00000000 beaf1b68 0000d23c 4005baf0 80000010 ffffffff
> [ 154.931335] r6:ffffffff r5:80000010 r4:4005baf0 r3:beaf1f04
> [ 154.937316] ---[ end trace 1b75b31a2719ed21 ]--
>
> Cc: Kevin Hilman <khilman@ti.com>
> Cc: Rajendra Nayak <rnayak@ti.com>
> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
I'd really like a comment from the PM experts if each and every driver
has to ensure that the clocks are enabled on remove like this?
> ---
> drivers/i2c/busses/i2c-omap.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index fec8d5c..44e8cfa 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -1108,7 +1108,9 @@ omap_i2c_remove(struct platform_device *pdev)
>
> free_irq(dev->irq, dev);
> i2c_del_adapter(&dev->adapter);
> + pm_runtime_get_sync(&pdev->dev);
> omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
> + pm_runtime_put(&pdev->dev);
> pm_runtime_disable(&pdev->dev);
> iounmap(dev->base);
> kfree(dev);
> --
> 1.7.5.4
>
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120512/8e44dbae/attachment.sig>
next prev parent reply other threads:[~2012-05-12 18:10 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-02 14:32 [PATCHv9 00/10] I2C fixes Shubhrajyoti D
2012-05-02 14:32 ` Shubhrajyoti D
2012-05-02 14:32 ` [PATCHv9 01/10] I2C: OMAP: make omap_i2c_unidle/idle functions depend on CONFIG_PM_RUNTIME Shubhrajyoti D
2012-05-02 14:32 ` Shubhrajyoti D
2012-05-02 14:32 ` [PATCHv9 03/10] I2C: OMAP: Fix the interrupt clearing in OMAP4 Shubhrajyoti D
2012-05-02 14:32 ` Shubhrajyoti D
2012-05-02 14:32 ` [PATCHv9 04/10] I2C: OMAP: Prevent the register access after pm_runtime_put in probe Shubhrajyoti D
2012-05-02 14:32 ` Shubhrajyoti D
2012-05-02 14:32 ` [PATCHv9 07/10] I2C: OMAP: Handle error check for pm runtime Shubhrajyoti D
2012-05-02 14:32 ` Shubhrajyoti D
[not found] ` <1335969135-20858-8-git-send-email-shubhrajyoti-l0cyMroinI0@public.gmane.org>
2012-05-25 22:06 ` Kevin Hilman
2012-05-25 22:06 ` Kevin Hilman
[not found] ` <87likfkjar.fsf-l0cyMroinI0@public.gmane.org>
2012-05-28 11:22 ` Shubhrajyoti
2012-05-28 11:22 ` Shubhrajyoti
2012-05-02 14:32 ` [PATCHv9 08/10] I2C: OMAP: prevent the overwrite of the errata flags Shubhrajyoti D
2012-05-02 14:32 ` Shubhrajyoti D
2012-05-12 18:10 ` [PATCHv9 00/10] I2C fixes Wolfram Sang
2012-05-12 18:10 ` Wolfram Sang
[not found] ` <1335969135-20858-1-git-send-email-shubhrajyoti-l0cyMroinI0@public.gmane.org>
2012-05-02 14:32 ` [PATCHv9 02/10] I2C: OMAP: Fix the mismatch of pm_runtime enable and disable Shubhrajyoti D
2012-05-02 14:32 ` Shubhrajyoti D
2012-05-25 21:57 ` Kevin Hilman
2012-05-25 21:57 ` Kevin Hilman
[not found] ` <87wr3zkjp7.fsf-l0cyMroinI0@public.gmane.org>
2012-05-28 9:59 ` Shubhrajyoti
2012-05-28 9:59 ` Shubhrajyoti
2012-05-02 14:32 ` [PATCHv9 05/10] I2C: OMAP: Don't check if wait_for_completion_timeout() returns less than zero Shubhrajyoti D
2012-05-02 14:32 ` Shubhrajyoti D
2012-05-02 14:32 ` [PATCHv9 06/10] I2C: OMAP: Fix the crash in i2c remove Shubhrajyoti D
2012-05-02 14:32 ` Shubhrajyoti D
[not found] ` <1335969135-20858-7-git-send-email-shubhrajyoti-l0cyMroinI0@public.gmane.org>
2012-05-12 18:10 ` Wolfram Sang [this message]
2012-05-12 18:10 ` Wolfram Sang
2012-05-14 11:26 ` Shubhrajyoti
2012-05-14 11:26 ` Shubhrajyoti
[not found] ` <20120512181019.GA28973-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-05-25 21:51 ` Kevin Hilman
2012-05-25 21:51 ` Kevin Hilman
2012-05-02 14:32 ` [PATCHv9 09/10] I2C: OMAP: Do not set the XUDF(Transmit underflow) if the underflow is not reached Shubhrajyoti D
2012-05-02 14:32 ` Shubhrajyoti D
2012-05-25 22:09 ` Kevin Hilman
2012-05-25 22:09 ` Kevin Hilman
2012-05-02 14:32 ` [PATCHv9 10/10] I2C: OMAP: Rename the 1p153 to the erratum id i462 Shubhrajyoti D
2012-05-02 14:32 ` Shubhrajyoti D
2012-05-25 22:13 ` [PATCHv9 00/10] I2C fixes Kevin Hilman
2012-05-25 22:13 ` Kevin Hilman
2012-05-28 9:52 ` Shubhrajyoti
2012-05-28 9:52 ` Shubhrajyoti
2012-05-25 23:40 ` Kevin Hilman
2012-05-25 23:40 ` Kevin Hilman
[not found] ` <87obpbhls0.fsf-l0cyMroinI0@public.gmane.org>
2012-05-28 9:54 ` Shubhrajyoti
2012-05-28 9:54 ` Shubhrajyoti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120512181019.GA28973@pengutronix.de \
--to=w.sang-bicnvbalz9megne8c9+irq@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=khilman-l0cyMroinI0@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rnayak-l0cyMroinI0@public.gmane.org \
--cc=shubhrajyoti-l0cyMroinI0@public.gmane.org \
--cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.