Skip to contentSkip to conversation

Better timer and RTC handling for 8641HPCN.

PATCH NAK Jon Loeliger 7 participants 25 messages Mar 7, 2007 – Mar 12, 2007 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Better timer and RTC handling for 8641HPCN.

From: Zhang Wei <[email protected]>

Give more IRQ numbers for MPIC IPIs and TIMERs use. Added generic RTC support for MPC8641HPCN.

---
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +8 -2
index f42f801..5ef6d61 100644
@@ -28,7 +28,7 @@
 #include <mm/mmu_decl.h>
 #include <asm/udbg.h>
 #include <asm/i8259.h>
-
+#include <asm-generic/rtc.h>
 #include <asm/mpic.h>
 
 #include <sysdev/fsl_soc.h>
@@ -81,7 +81,7 @@ mpc86xx_hpcn_init_irq(void)
 	/* Alloc mpic structure and per isu has 16 INT entries. */
 	mpic1 = mpic_alloc(np, res.start,
 			MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
-			16, NR_IRQS - 4,
+			16, NR_IRQS - 10,
 			" MPIC     ");
 	BUG_ON(mpic1 == NULL);
 
@@ -452,4 +452,10 @@ define_machine(mpc86xx_hpcn) {
 	.time_init		= mpc86xx_time_init,
 	.calibrate_decr		= generic_calibrate_decr,
 	.progress		= udbg_progress,
+
+#ifdef CONFIG_GEN_RTC
+	/* RTC interface, using functions in include/asm-generic/rtc.h */
+	.get_rtc_time		= get_rtc_time,
+	.set_rtc_time		= set_rtc_time,
+#endif
 };
Signature · 1 line
1.5.0.1.213.g509b
#1 lore raw
Quoted 7 lines · Jon Loeliger

From: Zhang Wei <[email protected]>

Give more IRQ numbers for MPIC IPIs and TIMERs use. Added generic RTC support for MPC8641HPCN.

Nack.

You can't call the generic set_rtc_time from the ppc_md.set_rtc_time. Take a look at:

http://ozlabs.org/pipermail/linuxppc-dev/2007-January/030440.html

- k

Quoted 18 lines
---
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +1 -1
index f42f801..5ef6d61 100644
@@ -28,7 +28,7 @@
 #include <mm/mmu_decl.h>
 #include <asm/udbg.h>
 #include <asm/i8259.h>
-
+#include <asm-generic/rtc.h>
 #include <asm/mpic.h>
 
 #include <sysdev/fsl_soc.h>

arch/powerpc/platforms/86xx/mpc86xx_hpcn.c mpc86xx_hpcn_init_irq(void) · line 85

Quoted 6 lines
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +1 -1
@@ -81,7 +81,7 @@ mpc86xx_hpcn_init_irq(void)
 	/* Alloc mpic structure and per isu has 16 INT entries. */
 	mpic1 = mpic_alloc(np, res.start,
 			MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
-			16, NR_IRQS - 4,
+			16, NR_IRQS - 10,
 			" MPIC     ");

Why is the number of interrupts reduced by 10?

Quoted 22 lines
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +6 -0
 	BUG_ON(mpic1 == NULL);
 
@@ -452,4 +452,10 @@ define_machine(mpc86xx_hpcn) {
 	.time_init		= mpc86xx_time_init,
 	.calibrate_decr		= generic_calibrate_decr,
 	.progress		= udbg_progress,
+
+#ifdef CONFIG_GEN_RTC
+	/* RTC interface, using functions in include/asm-generic/rtc.h */
+	.get_rtc_time		= get_rtc_time,
+	.set_rtc_time		= set_rtc_time,
+#endif
 };
Signature · 8 lines
1.5.0.1.213.g509b



_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
#2 lore raw
Quoted 9 lines · Kumar Gala
Quoted 7 lines · Jon Loeliger

From: Zhang Wei <[email protected]>

Give more IRQ numbers for MPIC IPIs and TIMERs use. Added generic RTC support for MPC8641HPCN.

Quoted 6 lines

Nack.

You can't call the generic set_rtc_time from the
ppc_md.set_rtc_time. Take a look at:

http://ozlabs.org/pipermail/linuxppc-dev/2007-January/030440.html

set_rtc_time != rtc_set_time. The latter is the one that goes through the drivers/rtc stuff and needs a workqueue; the former (which this patch uses) is in asm-generic/rtc.h, and appears to be interrupt-safe.

-Scott

#3 lore raw
Quoted 12 lines · Scott Wood
Quoted 11 lines · Kumar Gala
Quoted 7 lines · Jon Loeliger

From: Zhang Wei <[email protected]>

Give more IRQ numbers for MPIC IPIs and TIMERs use. Added generic RTC support for MPC8641HPCN.

Nack.

Quoted 8 lines
Quoted 4 lines

You can't call the generic set_rtc_time from the
ppc_md.set_rtc_time. Take a look at:

http://ozlabs.org/pipermail/linuxppc-dev/2007-January/030440.html

set_rtc_time != rtc_set_time. The latter is the one that goes through the drivers/rtc stuff and needs a workqueue; the former (which this patch uses) is in asm-generic/rtc.h, and appears to be interrupt-safe.

I ah, didn't notice.. Well I don't think set_rtc_time/get_rtc_time do anything useful for most ppc's, since it seems they use CMOS_READ/CMOS_WRITE which is only defined in asm/mc146818rtc.h

- k

#4 lore raw

Hi, Kumar and Scott,
=20
Thanks for your review. :-)

The MPC8641HPCN's RTC is a module of ULI1575, which is a legacy RTC device with operate by I/O ports 0x70 and 0x71. So I use functions defined in asm-generic/rtc.h to set and get rtc time.

Best Regards,
Zhang Wei

Quoted 41 lines

-----Original Message-----
From: Kumar Gala [mailto:[email protected]]=20
Sent: Thursday, March 08, 2007 3:49 AM
To: Wood Scott-B07421
Cc: Loeliger Jon-LOELIGER; Zhang Wei-r63237; [email protected]
Subject: Re: [PATCH] Better timer and RTC handling for 8641HPCN. =20
=20
On Mar 7, 2007, at 1:34 PM, Scott Wood wrote:
=20

Quoted 10 lines · Kumar Gala
Quoted 9 lines · Jon Loeliger
Quoted 7 lines

From: Zhang Wei <[email protected]>

Give more IRQ numbers for MPIC IPIs and TIMERs use. Added generic RTC support for MPC8641HPCN.

Quoted 8 lines
Quoted 6 lines

Nack.

You can't call the generic set_rtc_time from the
ppc_md.set_rtc_time. Take a look at:

http://ozlabs.org/pipermail/linuxppc-dev/2007-January/030440.html

set_rtc_time !=3D rtc_set_time. The latter is the one that=20

goes through

Quoted 1 line

the drivers/rtc stuff and needs a workqueue; the former=20

(which this =20

Quoted 2 lines

patch
uses) is in asm-generic/rtc.h, and appears to be interrupt-safe.

=20
I ah, didn't notice.. Well I don't think=20 set_rtc_time/get_rtc_time do =20
anything useful for most ppc's, since it seems they use CMOS_READ/=20 CMOS_WRITE which is only defined in asm/mc146818rtc.h
=20
- k
=20

#21 lore raw
In reply to Kumar Gala

Hi, Kumar,

Quoted 9 lines

Review

Quoted 3 lines
(quoted diff) +0 -0
 	/* Alloc mpic structure and per isu has 16 INT entries. */
 	mpic1 =3D mpic_alloc(np, res.start,
 			MPIC_PRIMARY | MPIC_WANTS_RESET |=20

MPIC_BIG_ENDIAN,

arch/powerpc/platforms/86xx/mpc86xx_hpcn.c mpc86xx_hpcn_init_irq(void) · line 85

Quoted 3 lines
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +1 -1
-			16, NR_IRQS - 4,
+			16, NR_IRQS - 10,
 			" MPIC     ");

=20
Why is the number of interrupts reduced by 10?

There's IRQs reserved for mpic using in mpic.c around line 962:

	mpic->timer_vecs[0] =3D intvec_top - 8;
	mpic->timer_vecs[1] =3D intvec_top - 7;
	mpic->timer_vecs[2] =3D intvec_top - 6;
	mpic->timer_vecs[3] =3D intvec_top - 5;
	mpic->ipi_vecs[0]   =3D intvec_top - 4;
	mpic->ipi_vecs[1]   =3D intvec_top - 3;
	mpic->ipi_vecs[2]   =3D intvec_top - 2;
	mpic->ipi_vecs[3]   =3D intvec_top - 1;
	mpic->spurious_vec  =3D intvec_top;

So I reduces it by 10 for IRQs reserved (leave 1 more space for further).

Thanks!

Best Regards,
Zhang Wei

#5 lore raw
In reply to Zhang Wei-r63237
Quoted 7 lines · On Mar 7, 2007, at 7:56 PM, Zhang Wei-r63237 wrote:

Hi, Kumar and Scott,

Thanks for your review. :-)

The MPC8641HPCN's RTC is a module of ULI1575, which is a legacy RTC device with operate by I/O ports 0x70 and 0x71. So I use functions defined in asm-generic/rtc.h to set and get rtc time.

Than you need to include <linux/mc146818rtc.h> in the file to get the CMOS_* defn.

- k

#22 lore raw
In reply to Zhang Wei-r63237
Quoted 24 lines · On Mar 7, 2007, at 8:09 PM, Zhang Wei-r63237 wrote:

Hi, Kumar,

Quoted 9 lines

arch/powerpc/platforms/86xx/mpc86xx_hpcn.c mpc86xx_hpcn_init_irq(void)

Quoted 3 lines
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +0 -0
 	/* Alloc mpic structure and per isu has 16 INT entries. */
 	mpic1 = mpic_alloc(np, res.start,
 			MPIC_PRIMARY | MPIC_WANTS_RESET |

MPIC_BIG_ENDIAN,

arch/powerpc/platforms/86xx/mpc86xx_hpcn.c mpc86xx_hpcn_init_irq(void) · line 85

Quoted 3 lines
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +1 -1
-			16, NR_IRQS - 4,
+			16, NR_IRQS - 10,
 			" MPIC     ");

Why is the number of interrupts reduced by 10?

There's IRQs reserved for mpic using in mpic.c around line 962:

	mpic->timer_vecs[0] = intvec_top - 8;
	mpic->timer_vecs[1] = intvec_top - 7;
	mpic->timer_vecs[2] = intvec_top - 6;
	mpic->timer_vecs[3] = intvec_top - 5;
	mpic->ipi_vecs[0]   = intvec_top - 4;
	mpic->ipi_vecs[1]   = intvec_top - 3;
	mpic->ipi_vecs[2]   = intvec_top - 2;
	mpic->ipi_vecs[3]   = intvec_top - 1;
	mpic->spurious_vec  = intvec_top;
Quoted 2 lines

So I reduces it by 10 for IRQs reserved (leave 1 more space for further).

Why don't we set the number to 64 instead of NR_IRQS - 10. This covers all the internal and external interrupts.

- k

#6 lore raw
In reply to Kumar Gala

In fact, I've included <asm-generic/rtc.h> in mpc86xx_hpcn.c file, and the file linux/mc146818rtc.h was included in asm-generic/rtc.h.

Thanks!
Zhang Wei

Quoted 26 lines

-----Original Message-----
From: Kumar Gala [mailto:[email protected]]=20
Sent: Thursday, March 08, 2007 10:47 AM
To: Zhang Wei-r63237
Cc: Wood Scott-B07421; Loeliger Jon-LOELIGER; [email protected]
Subject: Re: [PATCH] Better timer and RTC handling for 8641HPCN. =20
=20
On Mar 7, 2007, at 7:56 PM, Zhang Wei-r63237 wrote:
=20

Quoted 7 lines

Hi, Kumar and Scott,

Thanks for your review. :-)

The MPC8641HPCN's RTC is a module of ULI1575, which is a legacy RTC device with operate by I/O ports 0x70 and 0x71. So I use functions defined in asm-generic/rtc.h to set and get rtc time.

=20
Than you need to include <linux/mc146818rtc.h> in the file to=20 get the =20
CMOS_* defn.
=20
- k
=20
=20
=20

#7 lore raw
Quoted 2 lines · On Mar 7, 2007, at 11:38 PM, Zhang Wei-r63237 wrote:

In fact, I've included <asm-generic/rtc.h> in mpc86xx_hpcn.c file, and the file linux/mc146818rtc.h was included in asm-generic/rtc.h.

Uugh, sorry... was looking at asm/rtc.h not asm-generic/rtc.h (thus my confusion)

I don't think we should add new users of the old rtc code at this point. We really should look at using the rtc class code.

I'm going to start a new thread on figuring out what we need to do for ppc_md.set_rtc_time/ppc_md.get_rtc_time and the rtc subsystem.

- k

Quoted 27 lines
Quoted 27 lines

-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Thursday, March 08, 2007 10:47 AM
To: Zhang Wei-r63237
Cc: Wood Scott-B07421; Loeliger Jon-LOELIGER; [email protected]
Subject: Re: [PATCH] Better timer and RTC handling for 8641HPCN.

Quoted 7 lines · On Mar 7, 2007, at 7:56 PM, Zhang Wei-r63237 wrote:

Hi, Kumar and Scott,

Thanks for your review. :-)

The MPC8641HPCN's RTC is a module of ULI1575, which is a legacy RTC device with operate by I/O ports 0x70 and 0x71. So I use functions defined in asm-generic/rtc.h to set and get rtc time.

Than you need to include <linux/mc146818rtc.h> in the file to get the
CMOS_* defn.

- k

#23 lore raw
In reply to Kumar Gala

Hi, Kumar,=20

Quoted 7 lines
Quoted 3 lines

So I reduces it by 10 for IRQs reserved (leave 1 more space for further).

=20
Why don't we set the number to 64 instead of NR_IRQS - 10. This =20 covers all the internal and external interrupts.
=20

If you want to set the IRQ amount number, it should be 80 instead of 64. But I think setting it to NR_IRQS-10 could give more space for MPIC.

Thanks!
Zhang Wei

#24 lore raw
Quoted 6 lines · On Mar 8, 2007, at 2:17 AM, Zhang Wei-r63237 wrote:

Hi, Kumar,

Quoted 4 lines
Quoted 3 lines

So I reduces it by 10 for IRQs reserved (leave 1 more space for further).

Quoted 6 lines
Quoted 3 lines

Why don't we set the number to 64 instead of NR_IRQS - 10. This covers all the internal and external interrupts.

If you want to set the IRQ amount number, it should be 80 instead of 64. But I think setting it to NR_IRQS-10 could give more space for MPIC.

Sure, but what's the point in allocating more interrupts than you actually will ever have?

I'd say lets make it 64 for now. We don't yet support the messaging or MSI interrupts that exist beyond 64.

- k

#8 lore raw
In reply to Kumar Gala
Quoted 8 lines · Kumar Gala
Quoted 2 lines · On Mar 7, 2007, at 11:38 PM, Zhang Wei-r63237 wrote:

In fact, I've included <asm-generic/rtc.h> in mpc86xx_hpcn.c file, and the file linux/mc146818rtc.h was included in asm-generic/rtc.h.

Uugh, sorry... was looking at asm/rtc.h not asm-generic/rtc.h (thus my confusion)

Quoted 7 lines

I don't think we should add new users of the old rtc code at this point. We really should look at using the rtc class code.

I'm going to start a new thread on figuring out what we need to do for ppc_md.set_rtc_time/ppc_md.get_rtc_time and the rtc subsystem.

- k

So, I kinda lost track of the fate of this change.... Is there a better way to write this? Are we waiting for you to start a discussion about this? Or will it be applied as is for now and fixed up (?) later?

And we're to change the NR_IRQS-10 to a hard 64 as well, right?

Thanks,
jdl

#9 lore raw
Quoted 2 lines

And we're to change the NR_IRQS-10 to a hard 64 as well, right?

If we need change to hard value here, we should use 80 instead 64 because there are 16 interrupt sources for 8259, 48 for internal, 12 for external.

Haiying

#10 lore raw
Quoted 5 lines · Haiying Wang
Quoted 2 lines

And we're to change the NR_IRQS-10 to a hard 64 as well, right?

If we need change to hard value here, we should use 80 instead 64 because there are 16 interrupt sources for 8259, 48 for internal, 12 for external.

but the 16 interrupts for 8259 have nothing to do with how many you allocate for MPIC. 64 is the number of MPIC interrupts (48 int + 12 ext = 60). I say 64 because of how the register addresses.

- k

#20 lore raw
In reply to Kumar Gala
Quoted 12 lines · On Wed, 7 Mar 2007 23:57:36 -0600 Kumar Gala <[email protected]> wrote:
Quoted 2 lines · On Mar 7, 2007, at 11:38 PM, Zhang Wei-r63237 wrote:

In fact, I've included <asm-generic/rtc.h> in mpc86xx_hpcn.c file, and the file linux/mc146818rtc.h was included in asm-generic/rtc.h.

Uugh, sorry... was looking at asm/rtc.h not asm-generic/rtc.h (thus my confusion)

I don't think we should add new users of the old rtc code at this point. We really should look at using the rtc class code.

yes, removing the ppc_md hooks and configuring RTC_DRV_CMOS might be a more appropriate thing to do for this board.

Kim

#11 lore raw
In reply to Kumar Gala

Please use 80.
We reserve the first 16 ints for legacy 8259 interrupts. And we want the virq is the same value to hw-irq.

Thanks!
Zhang Wei

Quoted 23 lines

-----Original Message-----
From: Kumar Gala [mailto:[email protected]]=20
Sent: Friday, March 09, 2007 3:25 AM
To: Wang Haiying-r54964
Cc: Loeliger Jon-LOELIGER; [email protected]; Zhang Wei-r63237
Subject: Re: [PATCH] Better timer and RTC handling for 8641HPCN. =20
=20
On Mar 8, 2007, at 1:19 PM, Haiying Wang wrote:
=20

Quoted 6 lines
Quoted 2 lines

And we're to change the NR_IRQS-10 to a hard 64 as well, right?

If we need change to hard value here, we should use 80 instead 64 because there are 16 interrupt sources for 8259, 48 for internal, =20 12 for
external.

=20
but the 16 interrupts for 8259 have nothing to do with how many you =20 allocate for MPIC. 64 is the number of MPIC interrupts (48 int + 12 =20 ext =3D 60). I say 64 because of how the register addresses. =20
- k
=20

#12 lore raw
Quoted 3 lines · On Mar 8, 2007, at 7:51 PM, Zhang Wei-r63237 wrote:

Please use 80.
We reserve the first 16 ints for legacy 8259 interrupts. And we want the virq is the same value to hw-irq.

Why?

- k

#13 lore raw
Quoted 6 lines
Quoted 4 lines

Please use 80.
We reserve the first 16 ints for legacy 8259 interrupts. And we =20 want the
virq is the same value to hw-irq.

=20
Why?

If the virq equals hw-irq, it's clear and simple to user.

Thanks!
Zhang Wei

#14 lore raw
Quoted 8 lines · On Mar 8, 2007, at 10:23 PM, Zhang Wei-r63237 wrote:
Quoted 6 lines
Quoted 4 lines

Please use 80.
We reserve the first 16 ints for legacy 8259 interrupts. And we want the
virq is the same value to hw-irq.

Why?

If the virq equals hw-irq, it's clear and simple to user.

I don't think that's a good reason to over allocate.

There's a reason we have virtual IRQs now. Its specifically to deal with issues like the 16 interrupts for 8259 and not have to do games to offset IRQs.

If we needed create some debugfs or sysfs info that translates VIRQ to HW irq

- k

#15 lore raw
Quoted 9 lines

=20

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Please use 80.
We reserve the first 16 ints for legacy 8259 interrupts. And we want the
virq is the same value to hw-irq.

Why?

If the virq equals hw-irq, it's clear and simple to user.

Quoted 10 lines

=20
I don't think that's a good reason to over allocate.
=20
There's a reason we have virtual IRQs now. Its specifically to deal =20 with issues like the 16 interrupts for 8259 and not have to do games =20 to offset IRQs.
=20
If we needed create some debugfs or sysfs info that translates VIRQ =20 to HW irq
=20

I know that's the advantage of virtual IRQs. But in this platform, we want to fix up the virq to hwirq and let users know which irq is coming from which devices.

- z

#16 lore raw

IRQ numbering (was: Better timer and RTC handling for 8641HPCN.)

Quoted 15 lines
Quoted 15 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Please use 80.
We reserve the first 16 ints for legacy 8259 interrupts. And we want the
virq is the same value to hw-irq.

Why?

If the virq equals hw-irq, it's clear and simple to user.

I don't think that's a good reason to over allocate.

There's a reason we have virtual IRQs now. Its specifically to deal with issues like the 16 interrupts for 8259 and not have to do games to offset IRQs.

Quoted 7 lines
Quoted 3 lines

If we needed create some debugfs or sysfs info that translates VIRQ to HW irq

I know that's the advantage of virtual IRQs. But in this platform, we want to fix up the virq to hwirq and let users know which irq is coming from which devices.

But how do I know IRQ 42 is really 26 for the MPIC. What are you users doing that they can't handle the virtual irq concept?

It was pointed out, that you are coupling the IRQ # in the .dts with the kernel virtual number which is a bad idea. In theory the device-tree description shouldn't be coupled this tightly to the kernel.

I think the Freescale reference boards should strive to show people how to do things properly since people tend to copy this code and use it as a starting point. I doubt most 86xx designs are really going to have an 8259 controller on them and thus making things focus around it seems silly.

- k

#17 lore raw

RE: IRQ numbering (was: Better timer and RTC handling for 8641HPCN.)

Quoted 26 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Please use 80.
We reserve the first 16 ints for legacy 8259 interrupts. And we want the
virq is the same value to hw-irq.

Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why?

If the virq equals hw-irq, it's clear and simple to user.

I don't think that's a good reason to over allocate.

There's a reason we have virtual IRQs now. Its=20

specifically to deal

Quoted 1 line
Quoted 1 line

with issues like the 16 interrupts for 8259 and not have=20

to do games

Quoted 7 lines
Quoted 5 lines

to offset IRQs.

If we needed create some debugfs or sysfs info that translates VIRQ to HW irq

I know that's the advantage of virtual IRQs. But in this=20

platform, we

Quoted 3 lines

want to fix up the virq to hwirq and let users know which irq is =20 coming
from which devices.

Quoted 15 lines

=20
But how do I know IRQ 42 is really 26 for the MPIC. What are you =20 users doing that they can't handle the virtual irq concept? =20
It was pointed out, that you are coupling the IRQ # in the .dts with =20 the kernel virtual number which is a bad idea. In theory the device-=20 tree description shouldn't be coupled this tightly to the kernel. =20
I think the Freescale reference boards should strive to show people =20 how to do things properly since people tend to copy this code=20 and use =20
it as a starting point. I doubt most 86xx designs are really going =20 to have an 8259 controller on them and thus making things focus =20 around it seems silly.
=20

Hi, Kumar,

I have used the a fake interrupt hole to avoid the hwirq overlapping. Now the virq equals the hwirq.=20

I agree with the virq has lots of advantages than irq offset. But we can not give the user a fixup irq list since the virq will be changed by different device driver loading. And the user can not get the hwirq from the user space application.

I think creating some debugfs or sysfs info that translates VIRQ to HW irq is a _good_ idea, or just add some fields (irq host, hwirq) in /proc/interrupts. If we have this, I'll fix all irqs in dts file and remove the fake irq hole.

Before we have a virq-hwirq mapping list, I keep my option about the irq number.

Thanks!
Zhang Wei

#18 lore raw

Re: IRQ numbering (was: Better timer and RTC handling for 8641HPCN.)

Quoted 41 lines · On Mar 11, 2007, at 9:37 PM, Zhang Wei-r63237 wrote:
Quoted 34 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Please use 80.
We reserve the first 16 ints for legacy 8259 interrupts. And we want the
virq is the same value to hw-irq.

Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why?

If the virq equals hw-irq, it's clear and simple to user.

I don't think that's a good reason to over allocate.

There's a reason we have virtual IRQs now. Its

specifically to deal

Quoted 1 line
Quoted 1 line

with issues like the 16 interrupts for 8259 and not have

to do games

Quoted 7 lines
Quoted 5 lines

to offset IRQs.

If we needed create some debugfs or sysfs info that translates VIRQ to HW irq

I know that's the advantage of virtual IRQs. But in this

platform, we

Quoted 3 lines

want to fix up the virq to hwirq and let users know which irq is coming
from which devices.

But how do I know IRQ 42 is really 26 for the MPIC. What are you users doing that they can't handle the virtual irq concept?

It was pointed out, that you are coupling the IRQ # in the .dts with the kernel virtual number which is a bad idea. In theory the device- tree description shouldn't be coupled this tightly to the kernel.

Quoted 7 lines

I think the Freescale reference boards should strive to show people how to do things properly since people tend to copy this code and use
it as a starting point. I doubt most 86xx designs are really going to have an 8259 controller on them and thus making things focus around it seems silly.

Quoted 4 lines

Hi, Kumar,

I have used the a fake interrupt hole to avoid the hwirq overlapping. Now the virq equals the hwirq.

For what's written into the register, sure.. But who cares about that. You still have to know that virq 16 equals internal mpic irq 0. What's written into vector field of the mpic register isn't too terribly useful to the user.

Quoted 4 lines

I agree with the virq has lots of advantages than irq offset. But we can not give the user a fixup irq list since the virq will be changed by different device driver loading. And the user can not get the hwirq from the user space application.

I'm confused, what are users doing that they need to deal with this?

Quoted 7 lines

I think creating some debugfs or sysfs info that translates VIRQ to HW irq is a _good_ idea, or just add some fields (irq host, hwirq) in /proc/interrupts. If we have this, I'll fix all irqs in dts file and remove the fake irq hole.

Before we have a virq-hwirq mapping list, I keep my option about the irq number.

You need to explain what people are doing that they need this information. You are implying there would be some functionality lost by removing the offset. As far as I can tell this is just a debug convenience.

- k

#19 lore raw

RE: IRQ numbering (was: Better timer and RTC handling for 8641HPCN.)

In reply to Zhang Wei-r63237
Quoted 4 lines · Zhang Wei-r63237 writes:

I think creating some debugfs or sysfs info that translates VIRQ to HW irq is a _good_ idea, or just add some fields (irq host, hwirq) in /proc/interrupts. If we have this, I'll fix all irqs in dts file and remove the fake irq hole.

It would have to be a (host, hwirq) pair. A "hwirq" has no meaning by itself, since in general we can have multiple interrupt controllers and they will each have their own space of interrupt numbers.

Quoted 2 lines

Before we have a virq-hwirq mapping list, I keep my option about the irq number.

There is no point trying to fake things up in the .dts so that you get virq numbers that you expect. The numbers in the .dts should be the controller-relative "hwirq" numbers.

Paul.