linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* is_real_interrupt in 8250.c
@ 2006-11-29 17:44 Dan Nicolaescu
  2006-11-29 18:11 ` Theodore Tso
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Nicolaescu @ 2006-11-29 17:44 UTC (permalink / raw)
  To: linux-serial


Hi,

In 8250.c is_real_interrupt is defined like this: 

/*
 * We default to IRQ0 for the "no irq" hack.   Some
 * machine types want others as well - they're free
 * to redefine this in their header file.
 */
#define is_real_interrupt(irq)  ((irq) != 0)

on my platform the UART IRQ is 0, so is_real_interrupt returns
false.

In order to allow machines to override is_real_interrupt, and for the
code to match the comment shouldn't this patch be applied? 


--- 8250.c.orig 2006-11-29 09:33:47.000000000 -0800
+++ 8250.c      2006-11-29 09:42:51.000000000 -0800
@@ -75,7 +75,9 @@
  * machine types want others as well - they're free
  * to redefine this in their header file.
  */
+#ifndef is_real_interrupt
 #define is_real_interrupt(irq) ((irq) != 0)
+#endif
 
 /*
  * This converts from our new CONFIG_ symbols to the symbols

Thanks
        --dan

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

* Re: is_real_interrupt in 8250.c
  2006-11-29 17:44 is_real_interrupt in 8250.c Dan Nicolaescu
@ 2006-11-29 18:11 ` Theodore Tso
  2006-11-30  9:32   ` David H. Lynch Jr.
  0 siblings, 1 reply; 3+ messages in thread
From: Theodore Tso @ 2006-11-29 18:11 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: linux-serial

On Wed, Nov 29, 2006 at 09:44:59AM -0800, Dan Nicolaescu wrote:
> 
> Hi,
> 
> In 8250.c is_real_interrupt is defined like this: 
> 
> /*
>  * We default to IRQ0 for the "no irq" hack.   Some
>  * machine types want others as well - they're free
>  * to redefine this in their header file.
>  */
> #define is_real_interrupt(irq)  ((irq) != 0)
> 
> on my platform the UART IRQ is 0, so is_real_interrupt returns
> false.
> 
> In order to allow machines to override is_real_interrupt, and for the
> code to match the comment shouldn't this patch be applied? 

No, IRQ 0 for linux is always "no IRQ".  We should probably add this
to the LKML FAQ, since it keeps coming up.  Per Linus, if there are
any architectures that has a valid IRQ #0, then the
architecture-specific kernel code should remap IRQ numbers.  See:

	http://comments.gmane.org/gmane.linux.kernel/468449

						- Ted

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

* Re: is_real_interrupt in 8250.c
  2006-11-29 18:11 ` Theodore Tso
@ 2006-11-30  9:32   ` David H. Lynch Jr.
  0 siblings, 0 replies; 3+ messages in thread
From: David H. Lynch Jr. @ 2006-11-30  9:32 UTC (permalink / raw)
  To: linux-serial

Theodore Tso wrote:
> On Wed, Nov 29, 2006 at 09:44:59AM -0800, Dan Nicolaescu wrote:
>   
>> Hi,
>>
>> In 8250.c is_real_interrupt is defined like this: 
>>
>> /*
>>  * We default to IRQ0 for the "no irq" hack.   Some
>>  * machine types want others as well - they're free
>>  * to redefine this in their header file.
>>  */
>> #define is_real_interrupt(irq)  ((irq) != 0)
>>
>> on my platform the UART IRQ is 0, so is_real_interrupt returns
>> false.
>>
>> In order to allow machines to override is_real_interrupt, and for the
>> code to match the comment shouldn't this patch be applied? 
>>     
>
> No, IRQ 0 for linux is always "no IRQ".  We should probably add this
> to the LKML FAQ, since it keeps coming up.  Per Linus, if there are
> any architectures that has a valid IRQ #0, then the
> architecture-specific kernel code should remap IRQ numbers.  See:
>
> 	http://comments.gmane.org/gmane.linux.kernel/468449
>
> 						- Ted
>   
My reading of the messages you linked to is that  is_real_interrupt 
should eb defined as

#define is_real_interrupt(irq) ((irq) != NO_IRQ)

where NO_IRQ may be defined differently for platforms where IRQ #0 is 
valid,
not that IRQ 0 is always "no IRQ"

I have not done any low level x86 linux work, but even on an x86 IRQ 0 
is valid.





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


-- 
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       dhlii@dlasys.net 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein


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

end of thread, other threads:[~2006-11-30  9:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-29 17:44 is_real_interrupt in 8250.c Dan Nicolaescu
2006-11-29 18:11 ` Theodore Tso
2006-11-30  9:32   ` David H. Lynch Jr.

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).