All of lore.kernel.org
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: Simon Horman <horms@verge.net.au>
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:27:41 +0000	[thread overview]
Message-ID: <CANqRtoQDFpr_YTnSObyidMKpTyQXE=W6JDoBXrJ-MpLM1r_wCA@mail.gmail.com> (raw)
In-Reply-To: <20110819033043.GB12106@verge.net.au>

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.

Thanks for your help!

/ magnus

WARNING: multiple messages have this Message-ID (diff)
From: Magnus Damm <magnus.damm@gmail.com>
To: Simon Horman <horms@verge.net.au>
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:27:41 +0900	[thread overview]
Message-ID: <CANqRtoQDFpr_YTnSObyidMKpTyQXE=W6JDoBXrJ-MpLM1r_wCA@mail.gmail.com> (raw)
In-Reply-To: <20110819033043.GB12106@verge.net.au>

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.

Thanks for your help!

/ magnus

  reply	other threads:[~2011-08-19  4:27 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 [this message]
2011-08-19  4:27         ` Magnus Damm
2011-08-19  4:59         ` Simon Horman
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     ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index Simon Horman
2011-08-19  5:20       ` [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:39         ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index enum Simon Horman
2011-08-19  6:51         ` Magnus Damm
2011-08-19  6:51           ` Magnus Damm
2011-08-19  7:17           ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index Simon Horman
2011-08-19  7:17             ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index enum Simon Horman
2011-08-19  7:52             ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index Guennadi Liakhovetski
2011-08-19  7:52               ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index enum Guennadi Liakhovetski
2011-08-21  0:03               ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index Simon Horman
2011-08-21  0:03                 ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index enum Simon Horman
2011-08-19  7:45           ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index Guennadi Liakhovetski
2011-08-19  7:45             ` [PATCH 4/4] ARM: shmobile: ag5evm, ap4: Make use of irq index enum Guennadi Liakhovetski
2011-08-19  6:44       ` 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='CANqRtoQDFpr_YTnSObyidMKpTyQXE=W6JDoBXrJ-MpLM1r_wCA@mail.gmail.com' \
    --to=magnus.damm@gmail.com \
    --cc=cjb@laptop.org \
    --cc=g.liakhovetski@gmx.de \
    --cc=horms@verge.net.au \
    --cc=lethal@linux-sh.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.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.