Re: [PATCH] pata_of_platform: fix no irq handling

2008-10-13 Thread Benjamin Herrenschmidt
On Mon, 2008-10-13 at 15:56 +0900, Tejun Heo wrote: > Anton Vorontsov wrote: > > When no irq specified the pata_of_platform fills the irq_res with -1, > > which is wrong to do for two reasons: > > > > 1. By definition, 'no irq' should be IRQ 0, not some negative integer; > > 2. pata_platform check

Re: [PATCH] pata_of_platform: fix no irq handling

2008-10-12 Thread Tejun Heo
Anton Vorontsov wrote: > When no irq specified the pata_of_platform fills the irq_res with -1, > which is wrong to do for two reasons: > > 1. By definition, 'no irq' should be IRQ 0, not some negative integer; > 2. pata_platform checks for irq_res.start > 0, but since irq_res.start >is unsigne

Re: [PATCH] pata_of_platform: fix no irq handling

2008-10-10 Thread Tejun Heo
Anton Vorontsov wrote: > On Mon, Oct 06, 2008 at 03:41:19PM -0500, Matt Sealey wrote: >> There is a simple problem with the patch which is that an "IRQ 0" can and >> does >> actually exist on a bunch of platforms, at least to the best of my knowledge. >> >> Checking for -1 (which means for definit

Re: [PATCH] pata_of_platform: fix no irq handling

2008-10-10 Thread Paul Mundt
On Wed, Oct 08, 2008 at 11:59:59AM +0200, Geert Uytterhoeven wrote: > On Wed, 8 Oct 2008, Alan Cox wrote: > > On Wed, 08 Oct 2008 09:40:54 +0100 > > David Woodhouse <[EMAIL PROTECTED]> wrote: > > > > > On Tue, 2008-10-07 at 10:37 +0100, Alan Cox wrote: > > > > Zero means no IRQ. Any platform with

Re: [PATCH] pata_of_platform: fix no irq handling

2008-10-08 Thread Alan Cox
> > I'll leave you to argue with Linus about that, but since that was the > > decision back in 2005 (for good C reasons) we can safely rely on it. > > `git grep NO_IRQ include arch/*/include' is still quite enlightening... Good guide to platform code we should delete really __

Re: [PATCH] pata_of_platform: fix no irq handling

2008-10-08 Thread Geert Uytterhoeven
On Wed, 8 Oct 2008, Alan Cox wrote: > On Wed, 08 Oct 2008 09:40:54 +0100 > David Woodhouse <[EMAIL PROTECTED]> wrote: > > > On Tue, 2008-10-07 at 10:37 +0100, Alan Cox wrote: > > > Zero means no IRQ. Any platform with bits of code left over exposing IRQ > > > 0 is already not supported by lots of

Re: [PATCH] pata_of_platform: fix no irq handling

2008-10-08 Thread Alan Cox
On Wed, 08 Oct 2008 09:40:54 +0100 David Woodhouse <[EMAIL PROTECTED]> wrote: > On Tue, 2008-10-07 at 10:37 +0100, Alan Cox wrote: > > Zero means no IRQ. Any platform with bits of code left over exposing IRQ > > 0 is already not supported by lots of driver code including libata. > > ...and must i

Re: [PATCH] pata_of_platform: fix no irq handling

2008-10-08 Thread David Woodhouse
On Tue, 2008-10-07 at 10:37 +0100, Alan Cox wrote: > Zero means no IRQ. Any platform with bits of code left over exposing IRQ > 0 is already not supported by lots of driver code including libata. ...and must implement some kind of interrupt remapping crap just to work around this bogus design deci

Re: [PATCH] pata_of_platform: fix no irq handling

2008-10-07 Thread Alan Cox
> > This was discussed years ago. > > > > http://lkml.org/lkml/2005/11/22/159 > > http://lkml.org/lkml/2005/11/22/227 > > > > Would this break any existing platforms? If so, can those be fixed > together or does it become a much bigger problem that way? Zero means no IRQ. Any platform with bit

Re: [PATCH] pata_of_platform: fix no irq handling

2008-10-07 Thread Benjamin Herrenschmidt
On Tue, 2008-10-07 at 13:26 +0400, Anton Vorontsov wrote: > On Tue, Oct 07, 2008 at 10:30:59AM +0900, Tejun Heo wrote: > > Anton Vorontsov wrote: > > > On Mon, Oct 06, 2008 at 03:41:19PM -0500, Matt Sealey wrote: > > >> There is a simple problem with the patch which is that an "IRQ 0" can > > >> a

Re: [PATCH] pata_of_platform: fix no irq handling

2008-10-07 Thread Anton Vorontsov
On Tue, Oct 07, 2008 at 10:30:59AM +0900, Tejun Heo wrote: > Anton Vorontsov wrote: > > On Mon, Oct 06, 2008 at 03:41:19PM -0500, Matt Sealey wrote: > >> There is a simple problem with the patch which is that an "IRQ 0" can and > >> does > >> actually exist on a bunch of platforms, at least to the

Re: [PATCH] pata_of_platform: fix no irq handling

2008-10-07 Thread Wang Jian
Tejun Heo wrote: Anton Vorontsov wrote: On Mon, Oct 06, 2008 at 03:41:19PM -0500, Matt Sealey wrote: There is a simple problem with the patch which is that an "IRQ 0" can and does actually exist on a bunch of platforms, at least to the best of my knowledge. Checking for -1 (which means for def

Re: [PATCH] pata_of_platform: fix no irq handling

2008-10-06 Thread Anton Vorontsov
On Mon, Oct 06, 2008 at 03:41:19PM -0500, Matt Sealey wrote: > There is a simple problem with the patch which is that an "IRQ 0" can and does > actually exist on a bunch of platforms, at least to the best of my knowledge. > > Checking for -1 (which means for definite, no irq at all, because it is

Re: [PATCH] pata_of_platform: fix no irq handling

2008-10-06 Thread Matt Sealey
There is a simple problem with the patch which is that an "IRQ 0" can and does actually exist on a bunch of platforms, at least to the best of my knowledge. Checking for -1 (which means for definite, no irq at all, because it is totally unambiguous, as a -1 IRQ numbering is "impossible") is more

[PATCH] pata_of_platform: fix no irq handling

2008-10-06 Thread Anton Vorontsov
When no irq specified the pata_of_platform fills the irq_res with -1, which is wrong to do for two reasons: 1. By definition, 'no irq' should be IRQ 0, not some negative integer; 2. pata_platform checks for irq_res.start > 0, but since irq_res.start is unsigned type, the check will be true for

[PATCH] pata_of_platform: fix no irq handling

2008-09-29 Thread Anton Vorontsov
When no irq specified the pata_of_platform fills the irq_res with -1, which is wrong to do for two reasons: 1. By definition, 'no irq' should be IRQ 0, not some negative integer; 2. pata_platform checks for irq_res.start > 0, but since irq_res.start is unsigned type, the check will be true for

Re: [PATCH] pata_of_platform: fix no irq handling

2008-08-13 Thread Steven A. Falco
Anton Vorontsov wrote: > On Tue, Aug 12, 2008 at 06:18:42PM +0400, Sergei Shtylyov wrote: > >> Anton Vorontsov wrote: >> >> >> 1. IDE status read does not work. (But am I understand correctly >> that IDE works well if IRQ is unspecified? Then this is hardly >> an issue.) >>>

Re: [PATCH] pata_of_platform: fix no irq handling

2008-08-12 Thread Anton Vorontsov
On Tue, Aug 12, 2008 at 06:18:42PM +0400, Sergei Shtylyov wrote: > Anton Vorontsov wrote: > > 1. IDE status read does not work. (But am I understand correctly > that IDE works well if IRQ is unspecified? Then this is hardly > an issue.) > 2. IDE interrupt comes when it should no

Re: [PATCH] pata_of_platform: fix no irq handling

2008-08-12 Thread Sergei Shtylyov
Anton Vorontsov wrote: 1. IDE status read does not work. (But am I understand correctly that IDE works well if IRQ is unspecified? Then this is hardly an issue.) 2. IDE interrupt comes when it should not. I'd recommend to use oscilloscope to find out what is happening there, that is, if

Re: [PATCH] pata_of_platform: fix no irq handling

2008-08-12 Thread Stefan Roese
On Tuesday 12 August 2008, Anton Vorontsov wrote: > > > Another possibility is that you got the wrong interrupt number > > > in the device-tree... > > > > > > Ben. > > > > The platform is the AMCC Sequoia board. We've built a little adapter to > > connect a compact flash card to the processor bus.

Re: [PATCH] pata_of_platform: fix no irq handling

2008-08-12 Thread Anton Vorontsov
On Tue, Aug 12, 2008 at 10:00:40AM -0400, Steven A. Falco wrote: > Benjamin Herrenschmidt wrote: > > > >> 1. IDE status read does not work. (But am I understand correctly > >>that IDE works well if IRQ is unspecified? Then this is hardly > >>an issue.) > >> 2. IDE interrupt comes when it

Re: [PATCH] pata_of_platform: fix no irq handling

2008-08-12 Thread Steven A. Falco
Benjamin Herrenschmidt wrote: > >> 1. IDE status read does not work. (But am I understand correctly >>that IDE works well if IRQ is unspecified? Then this is hardly >>an issue.) >> 2. IDE interrupt comes when it should not. I'd recommend to use >>oscilloscope to find out what is happ

Re: [PATCH] pata_of_platform: fix no irq handling

2008-08-11 Thread Benjamin Herrenschmidt
On Mon, 2008-08-11 at 17:36 +0100, Ben Dooks wrote: > On Mon, Aug 11, 2008 at 07:19:13PM +0400, Anton Vorontsov wrote: > > When no irq specified, pata_of_platform fills irq_res with -1, > > which is wrong to do for two reasons: > > > > 1. By definition, 'no irq' should be IRQ 0, not some negative

Re: [PATCH] pata_of_platform: fix no irq handling

2008-08-11 Thread Benjamin Herrenschmidt
> 1. IDE status read does not work. (But am I understand correctly >that IDE works well if IRQ is unspecified? Then this is hardly >an issue.) > 2. IDE interrupt comes when it should not. I'd recommend to use >oscilloscope to find out what is happening there, that is, if >the drive

Re: [PATCH] pata_of_platform: fix no irq handling

2008-08-11 Thread Anton Vorontsov
On Mon, Aug 11, 2008 at 12:23:10PM -0400, Steven A. Falco wrote: > Anton Vorontsov wrote: > > When no irq specified, pata_of_platform fills irq_res with -1, > > which is wrong to do for two reasons: > > > > 1. By definition, 'no irq' should be IRQ 0, not some negative integer; > > 2. pata_platform

Re: [PATCH] pata_of_platform: fix no irq handling

2008-08-11 Thread Alan Cox
On Mon, 11 Aug 2008 19:19:13 +0400 Anton Vorontsov <[EMAIL PROTECTED]> wrote: > When no irq specified, pata_of_platform fills irq_res with -1, > which is wrong to do for two reasons: > > 1. By definition, 'no irq' should be IRQ 0, not some negative integer; > 2. pata_platform checks for irq_res.s

Re: [PATCH] pata_of_platform: fix no irq handling

2008-08-11 Thread Alan Cox
On Mon, 11 Aug 2008 17:36:48 +0100 Ben Dooks <[EMAIL PROTECTED]> wrote: > > On Mon, Aug 11, 2008 at 07:19:13PM +0400, Anton Vorontsov wrote: > > When no irq specified, pata_of_platform fills irq_res with -1, > > which is wrong to do for two reasons: > > > > 1. By definition, 'no irq' should be I

Re: [PATCH] pata_of_platform: fix no irq handling

2008-08-11 Thread Steven A. Falco
Ben Dooks wrote: > On Mon, Aug 11, 2008 at 07:19:13PM +0400, Anton Vorontsov wrote: > >> When no irq specified, pata_of_platform fills irq_res with -1, >> which is wrong to do for two reasons: >> >> 1. By definition, 'no irq' should be IRQ 0, not some negative integer; >> > > interesting, I

Re: [PATCH] pata_of_platform: fix no irq handling

2008-08-11 Thread Ben Dooks
On Mon, Aug 11, 2008 at 07:19:13PM +0400, Anton Vorontsov wrote: > When no irq specified, pata_of_platform fills irq_res with -1, > which is wrong to do for two reasons: > > 1. By definition, 'no irq' should be IRQ 0, not some negative integer; interesting, IRQ 0 is actually valid on some ARM sy

Re: [PATCH] pata_of_platform: fix no irq handling

2008-08-11 Thread Steven A. Falco
Anton Vorontsov wrote: > When no irq specified, pata_of_platform fills irq_res with -1, > which is wrong to do for two reasons: > > 1. By definition, 'no irq' should be IRQ 0, not some negative integer; > 2. pata_platform checks for irq_res.start > 0, but since irq_res.start >is unsigned type,

[PATCH] pata_of_platform: fix no irq handling

2008-08-11 Thread Anton Vorontsov
When no irq specified, pata_of_platform fills irq_res with -1, which is wrong to do for two reasons: 1. By definition, 'no irq' should be IRQ 0, not some negative integer; 2. pata_platform checks for irq_res.start > 0, but since irq_res.start is unsigned type, the check will be true for `-1'.