All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: "Uwe Kleine-König"
	<u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	mm-commits-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Greg Kroah-Hartman <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>,
	daniel-rDUAYElUppE@public.gmane.org,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
	David Vrabel <dvrabel-2sJRl1BP9u0AvxtiuMwx3w@public.gmane.org>
Subject: Re: + spi-imx-correct-check-for-platform_get_irq-failing.patch added to -mm tree
Date: Wed, 9 Dec 2009 10:23:48 -0700	[thread overview]
Message-ID: <fa686aa40912090923v3a694fb6l18cb0d97cb1cdf9b@mail.gmail.com> (raw)
In-Reply-To: <20091209153241.GB1389-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

2009/12/9 Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>:
> On Wed, Dec 09, 2009 at 08:08:19AM -0700, Grant Likely wrote:
>> >> This changes the old behaviour.  Is that what you intended?  '<= 0' perhaps?
>> > Yes, the old check was wrong.  What if the irq to use is 0?  I thought
>> > the commit log to be understandable.  platform_get_irq returns -ENXIO on
>> > error and an irq number on success.  So 0 has to be interpreted as valid
>> > irq, not an error.
>>
>> 0 is not a valid IRQ
> Hmm, on my x86 I have:
>
>        $ grep '\<0:' /proc/interrupts
>           0:      24330   IO-APIC-edge      timer
>
> arm/davinci starts at 0, too.  As does arm/ns9xxx.  arm/pxa seems to
> start at 1.  realview starts at 1, too.  So four out of five make are
> wrong?  Seems like a big area for cleanup.

As discussed on IRC, regardless of some of the core & arch use cases.
As far as drivers are concerned, 0 is not a valid IRQ.  Linus'
comments here were referenced: http://lkml.org/lkml/2005/11/21/221

The return of -ENXIO was added in commit 305b3228, and it is
definitely in the workaround category.  Damn.  And a quick grep show a
lot of broken drivers because of it.  (variations on the common 'if
(!irq)' pattern abound as well as a large number of the variant 'if
(irq < 0)').

Well.  Though I don't like it, I will take the patch as testing for <=
0 instead of < 0.  At least that doesn't create new situations of 0
being used as a valid IRQ.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev

  parent reply	other threads:[~2009-12-09 17:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-08 23:30 + spi-imx-correct-check-for-platform_get_irq-failing.patch added to -mm tree akpm
     [not found] ` <fa686aa40912081638m734e97c3r2c3f412898d293b@mail.gmail.com>
     [not found]   ` <20091209074533.GB8136@pengutronix.de>
     [not found]     ` <20091209074533.GB8136-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-12-09 15:08       ` Grant Likely
     [not found]         ` <fa686aa40912090708g45879802l6cea7b401b1434e3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-12-09 15:32           ` Uwe Kleine-König
     [not found]             ` <20091209153241.GB1389-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-12-09 17:23               ` Grant Likely [this message]
2009-12-09 17:55             ` Uwe Kleine-König
2009-12-09 18:00               ` Grant Likely
2009-12-09 18:00                 ` Grant Likely

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=fa686aa40912090923v3a694fb6l18cb0d97cb1cdf9b@mail.gmail.com \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=daniel-rDUAYElUppE@public.gmane.org \
    --cc=dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=dvrabel-2sJRl1BP9u0AvxtiuMwx3w@public.gmane.org \
    --cc=greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org \
    --cc=mm-commits-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.