diff mbox

sh: multiple vectors per irq - sh7760

Message ID 20090511090108.32745.14458.sendpatchset@rx1.opensource.se (mailing list archive)
State Accepted
Headers show

Commit Message

Magnus Damm May 11, 2009, 9:01 a.m. UTC
From: Magnus Damm <damm@igel.co.jp>

Update intc tables and platform data to use one linux irq
per maskable interrupt source instead of keeping the one-to-one
mapping between vectors and linux irqs.

This fixes potential irq masking issues for sh7760 hardware
blocks such as DMAC/TMU2/REF.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
---

 arch/sh/kernel/cpu/sh4/setup-sh7760.c |   31 +++++++++++--------------------
 1 file changed, 11 insertions(+), 20 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Manuel Lauss May 11, 2009, 9:44 a.m. UTC | #1
On Mon, May 11, 2009 at 06:01:08PM +0900, Magnus Damm wrote:
> From: Magnus Damm <damm@igel.co.jp>
> 
> Update intc tables and platform data to use one linux irq
> per maskable interrupt source instead of keeping the one-to-one
> mapping between vectors and linux irqs.
> 
> This fixes potential irq masking issues for sh7760 hardware
> blocks such as DMAC/TMU2/REF.

With this patch applied, my 7760 system no longer boots.  I'll
try to figure out why as soon as I get my JTAG probe back.

Manuel Lauss
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paul Mundt May 11, 2009, 9:56 a.m. UTC | #2
On Mon, May 11, 2009 at 06:59:37PM +0900, Magnus Damm wrote:
> On Mon, May 11, 2009 at 6:44 PM, Manuel Lauss
> <mano@roarinelk.homelinux.net> wrote:
> > On Mon, May 11, 2009 at 06:01:08PM +0900, Magnus Damm wrote:
> >> From: Magnus Damm <damm@igel.co.jp>
> >>
> >> Update intc tables and platform data to use one linux irq
> >> per maskable interrupt source instead of keeping the one-to-one
> >> mapping between vectors and linux irqs.
> >>
> >> This fixes potential irq masking issues for sh7760 hardware
> >> blocks such as DMAC/TMU2/REF.
> >
> > With this patch applied, my 7760 system no longer boots. ?I'll
> > try to figure out why as soon as I get my JTAG probe back.
> 
> Oops, that's no good. I'm converting sh7760 to make use of the new
> timer driver, and while at it I wanted to fix the vectors because they
> looked like they will generate warnings...
> 
> Without this patch, do you see intc warning printouts like "intc:
> missing unique irq mask for..."?
> 
Yeah, I noticed these earlier in Manuel's boot log:

intc: missing unique irq mask for irq 34 (vect 0x0640)
intc: missing unique irq mask for irq 35 (vect 0x0660)
intc: missing unique irq mask for irq 36 (vect 0x0680)
intc: missing unique irq mask for irq 37 (vect 0x06a0)
intc: missing unique irq mask for irq 44 (vect 0x0780)
intc: missing unique irq mask for irq 45 (vect 0x07a0)
intc: missing unique irq mask for irq 46 (vect 0x07c0)
intc: missing unique irq mask for irq 47 (vect 0x07e0)
intc: missing unique irq mask for irq 38 (vect 0x06c0)
intc: missing unique irq mask for irq 18 (vect 0x0440)
intc: missing unique irq mask for irq 19 (vect 0x0460)
intc: missing unique irq mask for irq 28 (vect 0x0580)
intc: missing unique irq mask for irq 29 (vect 0x05a0)

http://marc.info/?l=linux-sh&m=124144524704881&w=2
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Magnus Damm May 11, 2009, 9:59 a.m. UTC | #3
On Mon, May 11, 2009 at 6:44 PM, Manuel Lauss
<mano@roarinelk.homelinux.net> wrote:
> On Mon, May 11, 2009 at 06:01:08PM +0900, Magnus Damm wrote:
>> From: Magnus Damm <damm@igel.co.jp>
>>
>> Update intc tables and platform data to use one linux irq
>> per maskable interrupt source instead of keeping the one-to-one
>> mapping between vectors and linux irqs.
>>
>> This fixes potential irq masking issues for sh7760 hardware
>> blocks such as DMAC/TMU2/REF.
>
> With this patch applied, my 7760 system no longer boots.  I'll
> try to figure out why as soon as I get my JTAG probe back.

Oops, that's no good. I'm converting sh7760 to make use of the new
timer driver, and while at it I wanted to fix the vectors because they
looked like they will generate warnings...

Without this patch, do you see intc warning printouts like "intc:
missing unique irq mask for..."?

Are you using DMAC, TMU2 or REF on your system?

Thanks for your help!

/ magnus
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Manuel Lauss May 11, 2009, 10:15 a.m. UTC | #4
On Mon, May 11, 2009 at 06:59:37PM +0900, Magnus Damm wrote:
> On Mon, May 11, 2009 at 6:44 PM, Manuel Lauss
> <mano@roarinelk.homelinux.net> wrote:
> > On Mon, May 11, 2009 at 06:01:08PM +0900, Magnus Damm wrote:
> >> From: Magnus Damm <damm@igel.co.jp>
> >>
> >> Update intc tables and platform data to use one linux irq
> >> per maskable interrupt source instead of keeping the one-to-one
> >> mapping between vectors and linux irqs.
> >>
> >> This fixes potential irq masking issues for sh7760 hardware
> >> blocks such as DMAC/TMU2/REF.
> >
> > With this patch applied, my 7760 system no longer boots. ?I'll
> > try to figure out why as soon as I get my JTAG probe back.
> 
> Oops, that's no good. I'm converting sh7760 to make use of the new
> timer driver, and while at it I wanted to fix the vectors because they
> looked like they will generate warnings...
> 
> Without this patch, do you see intc warning printouts like "intc:
> missing unique irq mask for..."?

In this particular instance, I see no outputs at all.  There are a
few of those strings, but all for devices which I don't use.

 
> Are you using DMAC, TMU2 or REF on your system?

DMAC is built-in, but no users other than DMABRG, which requests DMAC0
on init.
 
> Thanks for your help!

My pleasure!


Manuel Lauss

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Magnus Damm May 11, 2009, 10:32 a.m. UTC | #5
On Mon, May 11, 2009 at 7:15 PM, Manuel Lauss
<mano@roarinelk.homelinux.net> wrote:
> On Mon, May 11, 2009 at 06:59:37PM +0900, Magnus Damm wrote:
>> On Mon, May 11, 2009 at 6:44 PM, Manuel Lauss
>> <mano@roarinelk.homelinux.net> wrote:
>> > On Mon, May 11, 2009 at 06:01:08PM +0900, Magnus Damm wrote:
>> >> From: Magnus Damm <damm@igel.co.jp>
>> >>
>> >> Update intc tables and platform data to use one linux irq
>> >> per maskable interrupt source instead of keeping the one-to-one
>> >> mapping between vectors and linux irqs.
>> >>
>> >> This fixes potential irq masking issues for sh7760 hardware
>> >> blocks such as DMAC/TMU2/REF.
>> >
>> > With this patch applied, my 7760 system no longer boots. ?I'll
>> > try to figure out why as soon as I get my JTAG probe back.
>>
>> Oops, that's no good. I'm converting sh7760 to make use of the new
>> timer driver, and while at it I wanted to fix the vectors because they
>> looked like they will generate warnings...
>>
>> Without this patch, do you see intc warning printouts like "intc:
>> missing unique irq mask for..."?
>
> In this particular instance, I see no outputs at all.  There are a
> few of those strings, but all for devices which I don't use.

Hm, that's strange. I guess something is wrong with my tables..

>> Are you using DMAC, TMU2 or REF on your system?
>
> DMAC is built-in, but no users other than DMABRG, which requests DMAC0
> on init.

So with this patch all DMA channels must use a single linux interrupt.
Requesting interrupt 34 should be ok in this case (the first DMAC
vector with value 0x640) but all other interrupt sources are disabled.
Interrupt 34 becomes a shared interrupt. We did similar changes for a
bunch of other processor models earlier this year, but we somehow
missed sh7760 then. Or ignored may be a better word, this since
there's no sh7760 hardware on my desk. =)

If you have a little time to spend on this, then feel free to test by
#ifdefing out various INTC_VECT() to check which vector that makes the
boot fail. A good start may be to disable all DMA users and see if
that helps.

Cheers,

/ magnus
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Magnus Damm May 11, 2009, 10:34 a.m. UTC | #6
On Mon, May 11, 2009 at 7:32 PM, Magnus Damm <magnus.damm@gmail.com> wrote:
> So with this patch all DMA channels must use a single linux interrupt.
> Requesting interrupt 34 should be ok in this case (the first DMAC
> vector with value 0x640) but all other interrupt sources are disabled.

Err, the other interrupt sources are not disabled. But they are muxed
into linux interrupt 34 in this case. So the DMA driver needs to be
aware of this and request one interrupt instead of one per channel.

/ magnus
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Manuel Lauss May 11, 2009, 10:51 a.m. UTC | #7
On Mon, May 11, 2009 at 07:32:03PM +0900, Magnus Damm wrote:
> On Mon, May 11, 2009 at 7:15 PM, Manuel Lauss
> <mano@roarinelk.homelinux.net> wrote:
> > On Mon, May 11, 2009 at 06:59:37PM +0900, Magnus Damm wrote:
> >> On Mon, May 11, 2009 at 6:44 PM, Manuel Lauss
> >> <mano@roarinelk.homelinux.net> wrote:
> >> > On Mon, May 11, 2009 at 06:01:08PM +0900, Magnus Damm wrote:
> >> >> From: Magnus Damm <damm@igel.co.jp>
> >> >>
> >> >> Update intc tables and platform data to use one linux irq
> >> >> per maskable interrupt source instead of keeping the one-to-one
> >> >> mapping between vectors and linux irqs.
> >> >>
> >> >> This fixes potential irq masking issues for sh7760 hardware
> >> >> blocks such as DMAC/TMU2/REF.
> >> >
> >> > With this patch applied, my 7760 system no longer boots. ?I'll
> >> > try to figure out why as soon as I get my JTAG probe back.
> >>
> >> Oops, that's no good. I'm converting sh7760 to make use of the new
> >> timer driver, and while at it I wanted to fix the vectors because they
> >> looked like they will generate warnings...
> >>
> >> Without this patch, do you see intc warning printouts like "intc:
> >> missing unique irq mask for..."?
> >
> > In this particular instance, I see no outputs at all. ?There are a
> > few of those strings, but all for devices which I don't use.
> 
> Hm, that's strange. I guess something is wrong with my tables..
> 
> >> Are you using DMAC, TMU2 or REF on your system?
> >
> > DMAC is built-in, but no users other than DMABRG, which requests DMAC0
> > on init.
> 
> So with this patch all DMA channels must use a single linux interrupt.
> Requesting interrupt 34 should be ok in this case (the first DMAC
> vector with value 0x640) but all other interrupt sources are disabled.
> Interrupt 34 becomes a shared interrupt. We did similar changes for a
> bunch of other processor models earlier this year, but we somehow
> missed sh7760 then. Or ignored may be a better word, this since
> there's no sh7760 hardware on my desk. =)

Disabling DMAC solves this.  The TMU patch also seems to work fine.
 
 
> If you have a little time to spend on this, then feel free to test by
> #ifdefing out various INTC_VECT() to check which vector that makes the
> boot fail. A good start may be to disable all DMA users and see if
> that helps.

I'll try to figure it out if I can find some more free time.

Thanks!
	Manuel Lauss
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Magnus Damm May 11, 2009, 10:55 a.m. UTC | #8
On Mon, May 11, 2009 at 7:51 PM, Manuel Lauss
<mano@roarinelk.homelinux.net> wrote:
> On Mon, May 11, 2009 at 07:32:03PM +0900, Magnus Damm wrote:
>> On Mon, May 11, 2009 at 7:15 PM, Manuel Lauss
>> <mano@roarinelk.homelinux.net> wrote:
>> > On Mon, May 11, 2009 at 06:59:37PM +0900, Magnus Damm wrote:
>> >> On Mon, May 11, 2009 at 6:44 PM, Manuel Lauss
>> >> <mano@roarinelk.homelinux.net> wrote:
>> >> > On Mon, May 11, 2009 at 06:01:08PM +0900, Magnus Damm wrote:
>> >> >> From: Magnus Damm <damm@igel.co.jp>
>> >> >>
>> >> >> Update intc tables and platform data to use one linux irq
>> >> >> per maskable interrupt source instead of keeping the one-to-one
>> >> >> mapping between vectors and linux irqs.
>> >> >>
>> >> >> This fixes potential irq masking issues for sh7760 hardware
>> >> >> blocks such as DMAC/TMU2/REF.
>> >> >
>> >> > With this patch applied, my 7760 system no longer boots. ?I'll
>> >> > try to figure out why as soon as I get my JTAG probe back.
>> >>
> Disabling DMAC solves this.  The TMU patch also seems to work fine.

Good, thanks for testing!

>> If you have a little time to spend on this, then feel free to test by
>> #ifdefing out various INTC_VECT() to check which vector that makes the
>> boot fail. A good start may be to disable all DMA users and see if
>> that helps.
>
> I'll try to figure it out if I can find some more free time.

I guess this means that the problem lies withing the DMA driver then. =)

Thanks for your help!

/ magnus
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 0001/arch/sh/kernel/cpu/sh4/setup-sh7760.c
+++ work/arch/sh/kernel/cpu/sh4/setup-sh7760.c	2009-05-11 16:36:18.000000000 +0900
@@ -18,10 +18,7 @@  enum {
 
 	/* interrupt sources */
 	IRL0, IRL1, IRL2, IRL3,
-	HUDI, GPIOI,
-	DMAC_DMTE0, DMAC_DMTE1, DMAC_DMTE2, DMAC_DMTE3,
-	DMAC_DMTE4, DMAC_DMTE5, DMAC_DMTE6, DMAC_DMTE7,
-	DMAC_DMAE,
+	HUDI, GPIOI, DMAC,
 	IRQ4, IRQ5, IRQ6, IRQ7,
 	HCAN20, HCAN21,
 	SSI0, SSI1,
@@ -36,21 +33,20 @@  enum {
 	HSPI,
 	MMCIF0, MMCIF1, MMCIF2, MMCIF3,
 	MFI, ADC, CMT,
-	TMU0, TMU1, TMU2_TUNI, TMU2_TICPI,
-	WDT,
-	REF_RCMI, REF_ROVI,
+	TMU0, TMU1, TMU2,
+	WDT, REF,
 
 	/* interrupt groups */
-	DMAC, DMABRG, SCIF0, SCIF1, SCIF2, SIM, MMCIF, TMU2, REF,
+	DMABRG, SCIF0, SCIF1, SCIF2, SIM, MMCIF,
 };
 
 static struct intc_vect vectors[] __initdata = {
 	INTC_VECT(HUDI, 0x600), INTC_VECT(GPIOI, 0x620),
-	INTC_VECT(DMAC_DMTE0, 0x640), INTC_VECT(DMAC_DMTE1, 0x660),
-	INTC_VECT(DMAC_DMTE2, 0x680), INTC_VECT(DMAC_DMTE3, 0x6a0),
-	INTC_VECT(DMAC_DMTE4, 0x780), INTC_VECT(DMAC_DMTE5, 0x7a0),
-	INTC_VECT(DMAC_DMTE6, 0x7c0), INTC_VECT(DMAC_DMTE7, 0x7e0),
-	INTC_VECT(DMAC_DMAE, 0x6c0),
+	INTC_VECT(DMAC, 0x640), INTC_VECT(DMAC, 0x660),
+	INTC_VECT(DMAC, 0x680), INTC_VECT(DMAC, 0x6a0),
+	INTC_VECT(DMAC, 0x780), INTC_VECT(DMAC, 0x7a0),
+	INTC_VECT(DMAC, 0x7c0), INTC_VECT(DMAC, 0x7e0),
+	INTC_VECT(DMAC, 0x6c0),
 	INTC_VECT(IRQ4, 0x800), INTC_VECT(IRQ5, 0x820),
 	INTC_VECT(IRQ6, 0x840), INTC_VECT(IRQ6, 0x860),
 	INTC_VECT(HCAN20, 0x900), INTC_VECT(HCAN21, 0x920),
@@ -74,23 +70,18 @@  static struct intc_vect vectors[] __init
 	INTC_VECT(MFI, 0xe80), /* 0xf80 according to data sheet */
 	INTC_VECT(ADC, 0xf80), INTC_VECT(CMT, 0xfa0),
 	INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420),
-	INTC_VECT(TMU2_TUNI, 0x440), INTC_VECT(TMU2_TICPI, 0x460),
+	INTC_VECT(TMU2, 0x440), INTC_VECT(TMU2, 0x460),
 	INTC_VECT(WDT, 0x560),
-	INTC_VECT(REF_RCMI, 0x580), INTC_VECT(REF_ROVI, 0x5a0),
+	INTC_VECT(REF, 0x580), INTC_VECT(REF, 0x5a0),
 };
 
 static struct intc_group groups[] __initdata = {
-	INTC_GROUP(DMAC, DMAC_DMTE0, DMAC_DMTE1, DMAC_DMTE2,
-		   DMAC_DMTE3, DMAC_DMTE4, DMAC_DMTE5,
-		   DMAC_DMTE6, DMAC_DMTE7, DMAC_DMAE),
 	INTC_GROUP(DMABRG, DMABRG0, DMABRG1, DMABRG2),
 	INTC_GROUP(SCIF0, SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI),
 	INTC_GROUP(SCIF1, SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI),
 	INTC_GROUP(SCIF2, SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI),
 	INTC_GROUP(SIM, SIM_ERI, SIM_RXI, SIM_TXI, SIM_TEI),
 	INTC_GROUP(MMCIF, MMCIF0, MMCIF1, MMCIF2, MMCIF3),
-	INTC_GROUP(TMU2, TMU2_TUNI, TMU2_TICPI),
-	INTC_GROUP(REF, REF_RCMI, REF_ROVI),
 };
 
 static struct intc_mask_reg mask_registers[] __initdata = {