All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
To: Jon Smirl <jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org,
	i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 19 3/5] Clean up error returns
Date: Tue, 22 Jan 2008 10:06:41 +1100	[thread overview]
Message-ID: <1200956801.6807.16.camel@pasglop> (raw)
In-Reply-To: <9e4733910801200718q7304bc29q38e67580613189e4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>


On Sun, 2008-01-20 at 10:18 -0500, Jon Smirl wrote:
> > So it seems to me like the polling mode code is never actually used?
> > Unless some platforms include an "empty" IRQ in their device
> > definition. Which indeed seems to be the case... but then they set
> the
> > IRQ to 0, NOT to NO_IRQ, so I'm wondering if the change you propose
> is
> > really correct.
> 
> All of this is very confusing to me, There are physical IRQs and
> virtual IRQs. Apparently zero is a legal physical IRQ but it is not a
> legal virtual IRQ. We only get virtual IRQs in this code. We need to
> get BenH to give us the right answer on these two cases.

Testing against NO_IRQ for a linux IRQ number should always be correct.

Physical IRQ numbers are remapped and shouldn't be visible to drivers,
NO_IRQ is a value that never exist for a valid logical interrupt number,
that is 0 for arch/powerpc and -1 for arch/ppc.

Ben.



_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: Jean Delvare <khali@linux-fr.org>,
	linuxppc-dev@ozlabs.org, i2c@lm-sensors.org,
	linux-kernel@vger.kernel.org
Subject: Re: [i2c] [PATCH 19 3/5] Clean up error returns
Date: Tue, 22 Jan 2008 10:06:41 +1100	[thread overview]
Message-ID: <1200956801.6807.16.camel@pasglop> (raw)
In-Reply-To: <9e4733910801200718q7304bc29q38e67580613189e4@mail.gmail.com>


On Sun, 2008-01-20 at 10:18 -0500, Jon Smirl wrote:
> > So it seems to me like the polling mode code is never actually used?
> > Unless some platforms include an "empty" IRQ in their device
> > definition. Which indeed seems to be the case... but then they set
> the
> > IRQ to 0, NOT to NO_IRQ, so I'm wondering if the change you propose
> is
> > really correct.
> 
> All of this is very confusing to me, There are physical IRQs and
> virtual IRQs. Apparently zero is a legal physical IRQ but it is not a
> legal virtual IRQ. We only get virtual IRQs in this code. We need to
> get BenH to give us the right answer on these two cases.

Testing against NO_IRQ for a linux IRQ number should always be correct.

Physical IRQ numbers are remapped and shouldn't be visible to drivers,
NO_IRQ is a value that never exist for a valid logical interrupt number,
that is 0 for arch/powerpc and -1 for arch/ppc.

Ben.

WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: Jean Delvare <khali@linux-fr.org>,
	i2c@lm-sensors.org, linuxppc-dev@ozlabs.org,
	linux-kernel@vger.kernel.org
Subject: Re: [i2c] [PATCH 19 3/5] Clean up error returns
Date: Tue, 22 Jan 2008 10:06:41 +1100	[thread overview]
Message-ID: <1200956801.6807.16.camel@pasglop> (raw)
In-Reply-To: <9e4733910801200718q7304bc29q38e67580613189e4@mail.gmail.com>


On Sun, 2008-01-20 at 10:18 -0500, Jon Smirl wrote:
> > So it seems to me like the polling mode code is never actually used?
> > Unless some platforms include an "empty" IRQ in their device
> > definition. Which indeed seems to be the case... but then they set
> the
> > IRQ to 0, NOT to NO_IRQ, so I'm wondering if the change you propose
> is
> > really correct.
> 
> All of this is very confusing to me, There are physical IRQs and
> virtual IRQs. Apparently zero is a legal physical IRQ but it is not a
> legal virtual IRQ. We only get virtual IRQs in this code. We need to
> get BenH to give us the right answer on these two cases.

Testing against NO_IRQ for a linux IRQ number should always be correct.

Physical IRQ numbers are remapped and shouldn't be visible to drivers,
NO_IRQ is a value that never exist for a valid logical interrupt number,
that is 0 for arch/powerpc and -1 for arch/ppc.

Ben.



  parent reply	other threads:[~2008-01-21 23:06 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-12  2:47 [PATCH 19 0/5] Version 18, series to add device tree naming to i2c Jon Smirl
2008-01-12  2:47 ` Jon Smirl
     [not found] ` <20080112024737.7023.61680.stgit-+J+k29bDNxlBDLzU/O5InQ@public.gmane.org>
2008-01-12  2:47   ` [PATCH 19 1/5] Implement module aliasing for i2c to translate from device tree names Jon Smirl
2008-01-12  2:47     ` Jon Smirl
2008-01-12  3:00     ` [i2c] " Jon Smirl
2008-01-12  3:47       ` Stephen Rothwell
2008-01-12  3:47         ` Stephen Rothwell
2008-01-12  2:47   ` [PATCH 19 5/5] Convert pfc8563 i2c driver from old style to new style Jon Smirl
2008-01-12  2:47     ` Jon Smirl
2008-04-10  9:14     ` Laurent Pinchart
2008-04-10  9:14       ` Laurent Pinchart
2008-01-12  2:47 ` [PATCH 19 2/5] Modify several rtc drivers to use the alias names list property of i2c Jon Smirl
2008-01-12  2:47 ` [PATCH 19 3/5] Clean up error returns Jon Smirl
2008-01-20 11:07   ` [i2c] " Jean Delvare
2008-01-20 11:07     ` Jean Delvare
2008-01-20 15:18     ` Jon Smirl
2008-01-20 15:18       ` Jon Smirl
2008-01-20 15:39       ` Jon Smirl
2008-01-20 15:39         ` Jon Smirl
2008-01-21 16:10         ` Jean Delvare
2008-01-21 16:10           ` Jean Delvare
2008-01-21 23:04           ` Benjamin Herrenschmidt
2008-01-21 23:04             ` Benjamin Herrenschmidt
     [not found]       ` <9e4733910801200718q7304bc29q38e67580613189e4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-01-21 23:06         ` Benjamin Herrenschmidt [this message]
2008-01-21 23:06           ` Benjamin Herrenschmidt
2008-01-21 23:06           ` Benjamin Herrenschmidt
2008-01-12  2:47 ` [PATCH 19 4/5] Convert PowerPC MPC i2c to of_platform_driver from platform_driver Jon Smirl
2008-01-12  4:07   ` Stephen Rothwell
2008-01-12  4:07     ` Stephen Rothwell

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=1200956801.6807.16.camel@pasglop \
    --to=benh-xvmvhmargas8u2djnn8i7kb+6bgklq7r@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
    --cc=jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@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.