From: Simon Horman <horms@verge.net.au>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org,
Chris Ball <cjb@laptop.org>, Paul Mundt <lethal@linux-sh.org>,
Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Subject: Re: [PATCH 2/4] mmc: tmio: Provide separate interrupt handlers
Date: Fri, 19 Aug 2011 13:59:06 +0900 [thread overview]
Message-ID: <20110819045858.GA17548@verge.net.au> (raw)
In-Reply-To: <CANqRtoQDFpr_YTnSObyidMKpTyQXE=W6JDoBXrJ-MpLM1r_wCA@mail.gmail.com>
On Fri, Aug 19, 2011 at 01:27:41PM +0900, Magnus Damm wrote:
> On Fri, Aug 19, 2011 at 12:30 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Fri, Aug 19, 2011 at 12:09:50PM +0900, Magnus Damm wrote:
> >> On Fri, Aug 19, 2011 at 10:10 AM, Simon Horman <horms@verge.net.au> wrote:
> >> > Provide separate interrupt handlers which may be used by platforms where
> >> > SDHI has three interrupt sources.
> >> >
> >> > This patch also removes the commented-out handling of CRC and other errors.
> >> >
> >> > Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> >> > Cc: Magnus Damm <magnus.damm@gmail.com>
> >> > Signed-off-by: Simon Horman <horms@verge.net.au>
> >> >
> >> > ---
> >>
> >> > +irqreturn_t tmio_mmc_irq(int irq, void *devid)
> >> > +{
> >> > + struct tmio_mmc_host *host = devid;
> >> > + unsigned int ireg, status;
> >> > +
> >> > + pr_debug("MMC IRQ begin\n");
> >> > +
> >> > + tmio_mmc_card_irq_status(host, &ireg, &status);
> >> > + if (__tmio_mmc_card_detect_irq(host, ireg, status))
> >> > + return IRQ_HANDLED;
> >> > + if (__tmio_mmc_sdcard_irq(host, ireg, status))
> >> > + return IRQ_HANDLED;
> >> > +
> >> > + tmio_mmc_sdio_irq(irq, devid);
> >> >
> >> > -out:
> >> > return IRQ_HANDLED;
> >> > }
> >> > EXPORT_SYMBOL(tmio_mmc_irq);
> >>
> >> Is there any particular reason for returning early in this interrupt
> >> handler? By returning early I mean the "if ... return IRQ_HANDLED"
> >> cases above.
> >>
> >> I realize the old ISR code in the driver does just this, so if the
> >> goal is to stay compatible then I guess we should keep this behavior.
> >> >From my point of view it usually makes more sense to try to handle all
> >> events that may be associated with the IRQ.
> >
> > My original post had the behaviour that you suggest but Guennadi
> > indicted that he would be much more comfortable with keeping the original
> > behaviour as it is know to work on a wide range of hardware.
>
> I see, thanks for your patience...
>
> So I may remember this wrong, but for the 3 different interrupt
> sources I believe that the SDIO IRQ code was added by Arnd for one of
> the Renesas SDHI platforms. Back then Ian disliked supporting more
> than a single interrupt source, so for that reason the SDIO IRQ code
> was added on top of the common interrupt handler. We had no
> documentation either, so it was added in a rather random way. I recall
> the SDIO IRQ being handled before the other interrupt types in the
> common handler not last, but that's not very important. Anyway, with
> the fact that SDIO IRQ support was added for SDHI platforms in mind
> then we can assume that other platforms won't need it. Not sure if
> this fact will improve our situation or not.
>
> As for the two remaining interrupts, I believe they share hardware
> registers somehow. I guess I'm OK keeping the original behavior
> somehow, but I still believe it's incorrect. It may not matter very
> much though since it's rather unlikely that hotplug insertion or eject
> coincides with the data IRQs.
Hi Magnus,
to be honest I'm unsure if the current behaviour is correct or not.
But it does appear to work on a wide range of hardware. And as
tmio_mmc_irq() is an implementation of the single-source ISR intended
for legacy purposes it does seem reasonable to maintain the existing
behaviour.
If there is a need to change the behaviour of tmio_mmc_irq() in some way
then I think that is best dealt with in a separate patch (series)
subsequent to the current series that is intended to introduce broken-out
handlers.
WARNING: multiple messages have this Message-ID (diff)
From: Simon Horman <horms@verge.net.au>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org,
Chris Ball <cjb@laptop.org>, Paul Mundt <lethal@linux-sh.org>,
Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Subject: Re: [PATCH 2/4] mmc: tmio: Provide separate interrupt handlers
Date: Fri, 19 Aug 2011 04:59:06 +0000 [thread overview]
Message-ID: <20110819045858.GA17548@verge.net.au> (raw)
In-Reply-To: <CANqRtoQDFpr_YTnSObyidMKpTyQXE=W6JDoBXrJ-MpLM1r_wCA@mail.gmail.com>
On Fri, Aug 19, 2011 at 01:27:41PM +0900, Magnus Damm wrote:
> On Fri, Aug 19, 2011 at 12:30 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Fri, Aug 19, 2011 at 12:09:50PM +0900, Magnus Damm wrote:
> >> On Fri, Aug 19, 2011 at 10:10 AM, Simon Horman <horms@verge.net.au> wrote:
> >> > Provide separate interrupt handlers which may be used by platforms where
> >> > SDHI has three interrupt sources.
> >> >
> >> > This patch also removes the commented-out handling of CRC and other errors.
> >> >
> >> > Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> >> > Cc: Magnus Damm <magnus.damm@gmail.com>
> >> > Signed-off-by: Simon Horman <horms@verge.net.au>
> >> >
> >> > ---
> >>
> >> > +irqreturn_t tmio_mmc_irq(int irq, void *devid)
> >> > +{
> >> > + struct tmio_mmc_host *host = devid;
> >> > + unsigned int ireg, status;
> >> > +
> >> > + pr_debug("MMC IRQ begin\n");
> >> > +
> >> > + tmio_mmc_card_irq_status(host, &ireg, &status);
> >> > + if (__tmio_mmc_card_detect_irq(host, ireg, status))
> >> > + return IRQ_HANDLED;
> >> > + if (__tmio_mmc_sdcard_irq(host, ireg, status))
> >> > + return IRQ_HANDLED;
> >> > +
> >> > + tmio_mmc_sdio_irq(irq, devid);
> >> >
> >> > -out:
> >> > return IRQ_HANDLED;
> >> > }
> >> > EXPORT_SYMBOL(tmio_mmc_irq);
> >>
> >> Is there any particular reason for returning early in this interrupt
> >> handler? By returning early I mean the "if ... return IRQ_HANDLED"
> >> cases above.
> >>
> >> I realize the old ISR code in the driver does just this, so if the
> >> goal is to stay compatible then I guess we should keep this behavior.
> >> >From my point of view it usually makes more sense to try to handle all
> >> events that may be associated with the IRQ.
> >
> > My original post had the behaviour that you suggest but Guennadi
> > indicted that he would be much more comfortable with keeping the original
> > behaviour as it is know to work on a wide range of hardware.
>
> I see, thanks for your patience...
>
> So I may remember this wrong, but for the 3 different interrupt
> sources I believe that the SDIO IRQ code was added by Arnd for one of
> the Renesas SDHI platforms. Back then Ian disliked supporting more
> than a single interrupt source, so for that reason the SDIO IRQ code
> was added on top of the common interrupt handler. We had no
> documentation either, so it was added in a rather random way. I recall
> the SDIO IRQ being handled before the other interrupt types in the
> common handler not last, but that's not very important. Anyway, with
> the fact that SDIO IRQ support was added for SDHI platforms in mind
> then we can assume that other platforms won't need it. Not sure if
> this fact will improve our situation or not.
>
> As for the two remaining interrupts, I believe they share hardware
> registers somehow. I guess I'm OK keeping the original behavior
> somehow, but I still believe it's incorrect. It may not matter very
> much though since it's rather unlikely that hotplug insertion or eject
> coincides with the data IRQs.
Hi Magnus,
to be honest I'm unsure if the current behaviour is correct or not.
But it does appear to work on a wide range of hardware. And as
tmio_mmc_irq() is an implementation of the single-source ISR intended
for legacy purposes it does seem reasonable to maintain the existing
behaviour.
If there is a need to change the behaviour of tmio_mmc_irq() in some way
then I think that is best dealt with in a separate patch (series)
subsequent to the current series that is intended to introduce broken-out
handlers.
next prev parent reply other threads:[~2011-08-19 4:59 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-19 1:10 [PATCH 0/4 v6] mmc: tmio, sdhi: provide multiple irq handlers Simon Horman
2011-08-19 1:10 ` Simon Horman
2011-08-19 1:10 ` [PATCH 1/4] mmc: tmio: Cache interrupt masks Simon Horman
2011-08-19 1:10 ` Simon Horman
2011-08-19 4:32 ` Magnus Damm
2011-08-19 4:32 ` Magnus Damm
2011-08-19 1:10 ` [PATCH 2/4] mmc: tmio: Provide separate interrupt handlers Simon Horman
2011-08-19 1:10 ` Simon Horman
2011-08-19 3:09 ` Magnus Damm
2011-08-19 3:09 ` Magnus Damm
2011-08-19 3:30 ` Simon Horman
2011-08-19 3:30 ` Simon Horman
2011-08-19 4:27 ` Magnus Damm
2011-08-19 4:27 ` Magnus Damm
2011-08-19 4:59 ` Simon Horman [this message]
2011-08-19 4:59 ` Simon Horman
2011-08-19 5:41 ` Magnus Damm
2011-08-19 5:41 ` Magnus Damm
2011-08-19 1:10 ` [PATCH 3/4] mmc: sdhi: Make use of per-source irq handlers Simon Horman
2011-08-19 1:10 ` Simon Horman
2011-08-19 1:10 ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index enum Simon Horman
2011-08-19 1:10 ` Simon Horman
2011-08-19 4:16 ` Magnus Damm
2011-08-19 4:16 ` Magnus Damm
2011-08-19 5:20 ` Simon Horman
2011-08-19 5:20 ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index Simon Horman
2011-08-19 6:39 ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index enum Simon Horman
2011-08-19 6:39 ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index Simon Horman
2011-08-19 6:51 ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index enum Magnus Damm
2011-08-19 6:51 ` Magnus Damm
2011-08-19 7:17 ` Simon Horman
2011-08-19 7:17 ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index Simon Horman
2011-08-19 7:52 ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index enum Guennadi Liakhovetski
2011-08-19 7:52 ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index Guennadi Liakhovetski
2011-08-21 0:03 ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index enum Simon Horman
2011-08-21 0:03 ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index Simon Horman
2011-08-19 7:45 ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index enum Guennadi Liakhovetski
2011-08-19 7:45 ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index Guennadi Liakhovetski
2011-08-19 6:44 ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index enum Magnus Damm
2011-08-19 6:44 ` Magnus Damm
-- strict thread matches above, loose matches on Subject: below --
2011-08-19 7:57 [PATCH 0/4 v7] mmc: tmio, sdhi: provide multiple irq handlers Simon Horman
2011-08-19 7:57 ` [PATCH 2/4] mmc: tmio: Provide separate interrupt handlers Simon Horman
2011-08-19 7:57 ` Simon Horman
2011-08-17 10:59 [PATCH 0/4 v5] mmc: tmio, sdhi: provide multiple irq handlers Simon Horman
2011-08-17 10:59 ` [PATCH 2/4] mmc: tmio: Provide separate interrupt handlers Simon Horman
2011-08-17 10:59 ` Simon Horman
2011-08-17 0:50 [PATCH 0/4 v4] mmc: tmio, sdhi: provide multiple irq handlers Simon Horman
2011-08-17 0:50 ` [PATCH 2/4] mmc: tmio: Provide separate interrupt handlers Simon Horman
2011-08-17 0:50 ` Simon Horman
2011-08-16 10:11 [PATCH 0/4 v3] mmc: tmio, sdhi: provide multiple irq handlers Simon Horman
2011-08-16 10:11 ` [PATCH 2/4] mmc: tmio: Provide separate interrupt handlers Simon Horman
2011-08-16 10:11 ` Simon Horman
2011-08-16 11:14 ` Guennadi Liakhovetski
2011-08-16 11:14 ` Guennadi Liakhovetski
2011-08-16 11:35 ` Simon Horman
2011-08-16 11:35 ` Simon Horman
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=20110819045858.GA17548@verge.net.au \
--to=horms@verge.net.au \
--cc=cjb@laptop.org \
--cc=g.liakhovetski@gmx.de \
--cc=lethal@linux-sh.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
/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.