From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 04/15] ARM: mxs: Add interrupt support
Date: Wed, 8 Dec 2010 13:09:35 +0100 [thread overview]
Message-ID: <20101208120935.GP18244@pengutronix.de> (raw)
In-Reply-To: <AANLkTik3ZDG05Lhu2txjUbk1TovbD-QE591Tco04Xz-P@mail.gmail.com>
On Wed, Dec 08, 2010 at 06:46:49PM +0800, Shawn Guo wrote:
> Hi Uwe,
>
> 2010/12/8 Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>:
> > Hello Shawn,
> >
> > On Wed, Dec 08, 2010 at 04:27:56PM +0800, Shawn Guo wrote:
> >> 2010/12/8 Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>:
> >> > On Wed, Dec 08, 2010 at 12:31:54AM +0800, Shawn Guo wrote:
> >> [...]
> >> >> +
> >> >> +static void icoll_ack_irq(unsigned int irq)
> >> >> +{
> >> >> + ? ? __raw_writel(0, icoll_base + HW_ICOLL_VECTOR);
> >> > You need to write this before handling the irq, no? ?Note this question
> >> > is a repetition. ?You answered "No need, indeed. ?Will remove it."
> >> > According to MCIMX28RM a write to HW_ICOLL_VECTOR "indicates the
> >> > in-service state". ?Are you sure this is not needed? ?If no (i.e. it's
> >> > needed) the write should go into entry-macro.S. ?As I don't have
> >> > hardware yet I cannot test that. ?Maybe it's only needed when the
> >> > priority levels are used?!
> >> >
> >> Sorry. I made a mistake. ?I thought I had tested the removal of line
> >> and gave the comment, but actually not. The line is needed, and image
> >> will stop working without the line.
> >>
> >> Regarding to moving the writing to register VECTOR into entry-macro.S,
> >> can you please help me understand the reason behind the suggestion?
> > Section 5.2.1 of MCIMX28RM writes:
> >
> > ? ? ? ?After the CPU enters the interrupt service routine, it must
> > ? ? ? ?notify the interrupt collector as soon as possible. Software
> > ? ? ? ?indicates the in-service state by writing to the HW_ICOLL_VECTOR
> > ? ? ? ?register.
> >
> In case you will ask why, I would give the fact here. I'm not sure
> what is your first thought. Mine is to add it into get_irqnr_preamble
> as below.
>
> .macro get_irqnr_preamble, base, tmp
> ldr \base, =ICOLL_ADDR
> mov \tmp, #0
> str \tmp, [\base]
> .endm
It's wrong to do that in get_irqnr_preamble.
> But I got the following error.
>
> [...]
> VFS: Mounted root (nfs filesystem) on device 0:11.
> Freeing init memory: 92K
> irq 101: nobody cared (try booting with the "irqpoll" option)
> [<c0025084>] (unwind_backtrace+0x0/0xe4) from [<c0063d54>] (__report_bad_irq+0x3
> 4/0x8c)
> [<c0063d54>] (__report_bad_irq+0x34/0x8c) from [<c0063ef8>] (note_interrupt+0x14
> c/0x1d8)
> [<c0063ef8>] (note_interrupt+0x14c/0x1d8) from [<c0064d5c>] (handle_level_irq+0x
> 108/0x198)
> [<c0064d5c>] (handle_level_irq+0x108/0x198) from [<c001f070>] (asm_do_IRQ+0x70/0
> x94)
> [<c001f070>] (asm_do_IRQ+0x70/0x94) from [<c0237050>] (__irq_svc+0x50/0x8c)
> Exception stack(0xc02e7d38 to 0xc02e7d80)
> 7d20: c02e7db0 00000000
> 7d40: ffffffd0 00000000 c7990800 00000000 c79a3820 000005a8 c02e7df8 c0217380
> 7d60: c7997a28 000005a8 00000000 c02e7d80 c02173a8 c02173c0 40000013 ffffffff
> [<c0237050>] (__irq_svc+0x50/0x8c) from [<c02173c0>] (xs_tcp_data_recv+0x40/0x62
> c)
> [<c02173c0>] (xs_tcp_data_recv+0x40/0x62c) from [<c01d6160>] (tcp_read_sock+0x70
> /0x1e8)
> [<c01d6160>] (tcp_read_sock+0x70/0x1e8) from [<c021734c>] (xs_tcp_data_ready+0x7
> c/0xb0)
> [<c021734c>] (xs_tcp_data_ready+0x7c/0xb0) from [<c01dee3c>] (tcp_rcv_establishe
> d+0x484/0x610)
> [<c01dee3c>] (tcp_rcv_established+0x484/0x610) from [<c01e5fd4>] (tcp_v4_do_rcv+
> 0x28/0x1c8)
> [<c01e5fd4>] (tcp_v4_do_rcv+0x28/0x1c8) from [<c01e65fc>] (tcp_v4_rcv+0x488/0x83
> c)
> [<c01e65fc>] (tcp_v4_rcv+0x488/0x83c) from [<c01ca038>] (ip_local_deliver+0x100/
> 0x1fc)
> [<c01ca038>] (ip_local_deliver+0x100/0x1fc) from [<c01c9efc>] (ip_rcv+0x540/0x57
> c)
> [<c01c9efc>] (ip_rcv+0x540/0x57c) from [<c01ad490>] (__netif_receive_skb+0x32c/0
> x388)
> [<c01ad490>] (__netif_receive_skb+0x32c/0x388) from [<c01ad56c>] (process_backlo
> g+0x80/0x140)
> [<c01ad56c>] (process_backlog+0x80/0x140) from [<c01ad8a4>] (net_rx_action+0x58/
> 0x180)
> [<c01ad8a4>] (net_rx_action+0x58/0x180) from [<c0037c50>] (__do_softirq+0x78/0x1
> 10)
> [<c0037c50>] (__do_softirq+0x78/0x110) from [<c0037d2c>] (irq_exit+0x44/0xa8)
> [<c0037d2c>] (irq_exit+0x44/0xa8) from [<c001f074>] (asm_do_IRQ+0x74/0x94)
> [<c001f074>] (asm_do_IRQ+0x74/0x94) from [<c0237050>] (__irq_svc+0x50/0x8c)
> Exception stack(0xc02e7f80 to 0xc02e7fc8)
> 7f80: 00000000 0005317f 0005217f 60000013 c02e6000 c001baf4 c001baf0 c02e9b60
> 7fa0: 4001a848 41069265 4001a7e0 00000000 600000d3 c02e7fc8 c0020bc4 c0020bd0
> 7fc0: 60000013 ffffffff
> [<c0237050>] (__irq_svc+0x50/0x8c) from [<c0020bd0>] (default_idle+0x2c/0x30)
> [<c0020bd0>] (default_idle+0x2c/0x30) from [<c002110c>] (cpu_idle+0x60/0xc0)
> [<c002110c>] (cpu_idle+0x60/0xc0) from [<c00088f0>] (start_kernel+0x238/0x27c)
> [<c00088f0>] (start_kernel+0x238/0x27c) from [<40008034>] (0x40008034)
> handlers:
> [<c01872e4>] (fec_enet_interrupt+0x0/0x3ec)
> Disabling IRQ #101
>
> However, when I add it into get_irqnr_and_base as below.
>
> .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
> mov \tmp, #0
> str \tmp, [\base]
> ldr \irqnr, [\base, #0x70]
> cmp \irqnr, #0x7F
> moveqs \irqnr, #0
> .endm
>
> Everything seems fine.
I think you need to do the following:
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp
ldr \irqnr, [\base, #0x70]
cmp \irqnr, #0x7F
strne \irqnr, [\base]
moveq \irqnr, #0
.endm
(i.e. only write to VECTOR if there is an irq pending).
As before this is completely untested.
Another thing I just noticed is that you don't really want to hardcode
the 0x70, take a look into
arch/arm/mach-ns9xxx/include/mach/entry-macro.S for an example to avoid
it.
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2010-12-08 12:09 UTC|newest]
Thread overview: 146+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-26 6:48 [PATCH 00/15] ARM: mxs: Add initial support for MX23 and MX28 Shawn Guo
2010-11-26 6:49 ` [PATCH 01/15] ARM: mxs: Add core definitions Shawn Guo
2010-11-26 11:30 ` Uwe Kleine-König
2010-11-29 7:21 ` Shawn Guo
2010-11-26 6:49 ` [PATCH 02/15] ARM: mxs: Add helper definition and function Shawn Guo
2010-11-26 6:49 ` [PATCH 03/15] ARM: mxs: Add reset routines Shawn Guo
2010-11-26 9:31 ` Lothar Waßmann
2010-11-26 9:57 ` Uwe Kleine-König
2010-11-26 10:38 ` Lothar Waßmann
2010-11-26 11:32 ` Uwe Kleine-König
2010-11-26 12:53 ` Lothar Waßmann
2010-11-29 9:25 ` [PATCH] prevent 'BUG: sleeping function called from invalid context' in arch_reset() Lothar Waßmann
2010-11-29 9:58 ` Uwe Kleine-König
2010-12-06 16:13 ` Uwe Kleine-König
2010-11-26 14:16 ` [PATCH 03/15] ARM: mxs: Add reset routines Xinyu Chen
2010-11-26 14:38 ` Lothar Waßmann
2010-11-26 6:49 ` [PATCH 04/15] ARM: mxs: Add interrupt support Shawn Guo
2010-11-30 13:56 ` Uwe Kleine-König
2010-11-30 17:02 ` Russell King - ARM Linux
2010-12-01 11:23 ` Shawn Guo
2010-11-26 6:49 ` [PATCH 05/15] ARM: mxs: Add low-level debug UART support Shawn Guo
2010-11-30 15:48 ` Uwe Kleine-König
2010-11-26 6:49 ` [PATCH 06/15] ARM: mxs: Add timer support Shawn Guo
2010-11-30 16:13 ` Uwe Kleine-König
2010-12-02 14:44 ` Shawn Guo
2010-12-02 15:20 ` Thomas Gleixner
2010-12-02 16:48 ` Uwe Kleine-König
2010-11-26 6:49 ` [PATCH 07/15] ARM: mxs: Add gpio support Shawn Guo
2010-11-30 16:21 ` Uwe Kleine-König
2010-11-26 6:49 ` [PATCH 08/15] ARM: mxs: Add iomux support Shawn Guo
2010-11-30 16:32 ` Uwe Kleine-König
2010-11-26 6:49 ` [PATCH 09/15] ARM: mxs: Add clock support Shawn Guo
2010-11-30 16:39 ` Uwe Kleine-König
2010-12-07 13:09 ` Shawn Guo
2010-12-07 13:33 ` Uwe Kleine-König
2010-12-07 13:53 ` Shawn Guo
2010-12-02 15:07 ` Uwe Kleine-König
2010-12-03 5:07 ` Shawn Guo
2010-11-26 6:49 ` [PATCH 10/15] ARM: mxs: Add static memory mapping Shawn Guo
2010-11-26 6:49 ` [PATCH 11/15] ARM: mxs: Dynamically allocate duart devices Shawn Guo
2010-11-26 6:49 ` [PATCH 12/15] ARM: mxs: Dynamically allocate fec devices Shawn Guo
2010-11-30 20:01 ` Uwe Kleine-König
2010-11-26 6:49 ` [PATCH 13/15] ARM: mxs: Add initial mx23evk support Shawn Guo
2010-11-30 20:02 ` Uwe Kleine-König
2010-11-26 6:49 ` [PATCH 14/15] ARM: mxs: Add initial mx28evk support Shawn Guo
2010-11-30 20:06 ` Uwe Kleine-König
2010-11-26 6:49 ` [PATCH 15/15] ARM: mxs: Add build configuration for mxs Shawn Guo
2010-11-30 20:08 ` Uwe Kleine-König
2010-11-29 11:59 ` [PATCH v2 01/15] ARM: mxs: Add core definitions Shawn Guo
2010-11-30 9:21 ` Uwe Kleine-König
2010-11-29 11:59 ` [PATCH v2 02/15] ARM: mxs: Add helper definition and function Shawn Guo
2010-11-29 11:59 ` [PATCH v2 03/15] ARM: mxs: Add reset routines Shawn Guo
2010-11-30 10:25 ` Uwe Kleine-König
2010-12-01 10:45 ` Shawn Guo
2010-12-01 10:59 ` Uwe Kleine-König
2010-12-01 11:34 ` Shawn Guo
2010-12-02 6:02 ` Shawn Guo
2010-12-02 7:27 ` Uwe Kleine-König
2010-12-02 9:40 ` Uwe Kleine-König
2010-12-02 10:16 ` Shawn Guo
2010-11-29 11:59 ` [PATCH v2 06/15] ARM: mxs: Add timer support Shawn Guo
2010-11-29 11:59 ` [PATCH v2 10/15] ARM: mxs: Add static memory mapping Shawn Guo
2010-11-29 11:59 ` [PATCH v2 15/15] ARM: mxs: Add build configuration for mxs Shawn Guo
2010-12-07 16:31 ` [PATCH v3 01/15] ARM: mxs: Add core definitions Shawn Guo
2010-12-07 20:18 ` Uwe Kleine-König
2010-12-08 4:50 ` Shawn Guo
2010-12-08 9:17 ` Uwe Kleine-König
2010-12-07 16:31 ` [PATCH v3 03/15] ARM: mxs: Add reset routines Shawn Guo
2010-12-07 20:27 ` Uwe Kleine-König
2010-12-08 7:33 ` Lothar Waßmann
2010-12-08 20:31 ` Uwe Kleine-König
2010-12-09 8:51 ` Shawn Guo
2010-12-09 8:55 ` Uwe Kleine-König
2010-12-07 16:31 ` [PATCH v2 04/15] ARM: mxs: Add interrupt support Shawn Guo
2010-12-07 21:03 ` Uwe Kleine-König
2010-12-08 8:27 ` Shawn Guo
2010-12-08 9:39 ` Uwe Kleine-König
2010-12-08 10:46 ` Shawn Guo
2010-12-08 12:09 ` Uwe Kleine-König [this message]
2010-12-08 12:31 ` Shawn Guo
2010-12-08 8:56 ` Shawn Guo
2010-12-08 9:14 ` Uwe Kleine-König
2010-12-08 8:24 ` Lothar Waßmann
2010-12-07 16:31 ` [PATCH v2 05/15] ARM: mxs: Add low-level debug UART support Shawn Guo
2010-12-08 20:27 ` Uwe Kleine-König
2010-12-09 2:02 ` Shawn Guo
2010-12-09 8:42 ` Uwe Kleine-König
2010-12-07 16:31 ` [PATCH v3 06/15] ARM: mxs: Add timer support Shawn Guo
2010-12-07 21:18 ` Uwe Kleine-König
2010-12-08 5:58 ` Shawn Guo
2010-12-08 9:25 ` Uwe Kleine-König
2010-12-08 8:30 ` Lothar Waßmann
2010-12-08 9:31 ` Uwe Kleine-König
2010-12-07 16:31 ` [PATCH v2 07/15] ARM: mxs: Add gpio support Shawn Guo
2010-12-08 7:21 ` Lothar Waßmann
2010-12-07 16:31 ` [PATCH v2 08/15] ARM: mxs: Add iomux support Shawn Guo
2010-12-08 7:25 ` Lothar Waßmann
2010-12-08 10:52 ` Shawn Guo
2010-12-08 10:56 ` Uwe Kleine-König
2010-12-08 11:29 ` Shawn Guo
2010-12-08 11:32 ` Lothar Waßmann
2010-12-09 6:15 ` Shawn Guo
2010-12-09 8:43 ` Uwe Kleine-König
2010-12-07 16:31 ` [PATCH v2 09/15] ARM: mxs: Add clock support Shawn Guo
2010-12-08 20:57 ` Uwe Kleine-König
2010-12-09 1:44 ` Shawn Guo
2010-12-09 8:41 ` Uwe Kleine-König
2010-12-09 10:04 ` Shawn Guo
2010-12-09 10:30 ` Shawn Guo
2010-12-07 16:32 ` [PATCH v2 12/15] ARM: mxs: Dynamically allocate fec devices Shawn Guo
2010-12-07 16:32 ` [PATCH v2 13/15] ARM: mxs: Add initial mx23evk support Shawn Guo
2010-12-07 16:32 ` [PATCH v2 14/15] ARM: mxs: Add initial mx28evk support Shawn Guo
2010-12-08 20:28 ` Uwe Kleine-König
2010-12-09 7:04 ` Shawn Guo
2010-12-09 8:32 ` Uwe Kleine-König
2010-12-09 9:03 ` Shawn Guo
2010-12-09 9:37 ` Uwe Kleine-König
2010-12-09 10:17 ` Shawn Guo
2010-12-09 12:27 ` Lothar Waßmann
2010-12-09 13:38 ` Shawn Guo
2010-12-09 13:54 ` Shawn Guo
2010-12-07 16:32 ` [PATCH v3 15/15] ARM: mxs: Add build configuration for mxs Shawn Guo
2010-12-10 14:51 ` Uwe Kleine-König
2010-12-10 15:05 ` Shawn Guo
2010-12-09 15:12 ` [PATCH v4 01/15] ARM: mxs: Add core definitions Shawn Guo
2010-12-09 17:37 ` Russell King - ARM Linux
2010-12-09 15:12 ` [PATCH v3 02/15] ARM: mxs: Add helper definition and function Shawn Guo
2010-12-09 15:12 ` [PATCH v4 03/15] ARM: mxs: Add reset routines Shawn Guo
2010-12-09 15:12 ` [PATCH v3 04/15] ARM: mxs: Add interrupt support Shawn Guo
2010-12-09 15:12 ` [PATCH v3 05/15] ARM: mxs: Add low-level debug UART support Shawn Guo
2010-12-09 15:12 ` [PATCH v4 06/15] ARM: mxs: Add timer support Shawn Guo
2010-12-09 15:12 ` [PATCH v3 07/15] ARM: mxs: Add gpio support Shawn Guo
2010-12-09 16:47 ` Lothar Waßmann
2010-12-10 7:06 ` Shawn Guo
2010-12-10 7:23 ` Shawn Guo
2010-12-10 8:11 ` Uwe Kleine-König
2010-12-10 15:32 ` Shawn Guo
2010-12-09 15:12 ` [PATCH v3 08/15] ARM: mxs: Add iomux support Shawn Guo
2010-12-09 16:12 ` Lothar Waßmann
2010-12-09 15:12 ` [PATCH v3 09/15] ARM: mxs: Add clock support Shawn Guo
2010-12-09 21:11 ` Uwe Kleine-König
2010-12-09 15:12 ` [PATCH v2 10/15] ARM: mxs: Add static memory mapping Shawn Guo
2010-12-09 15:12 ` [PATCH v2 11/15] ARM: mxs: Dynamically allocate duart devices Shawn Guo
2010-12-09 15:12 ` [PATCH v3 12/15] ARM: mxs: Dynamically allocate fec devices Shawn Guo
2010-12-09 15:12 ` [PATCH v3 13/15] ARM: mxs: Add initial mx23evk support Shawn Guo
2010-12-09 15:12 ` [PATCH v3 14/15] ARM: mxs: Add initial mx28evk support Shawn Guo
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=20101208120935.GP18244@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.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 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).