From: Simon Horman <horms@verge.net.au>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org,
Chris Ball <cjb@laptop.org>, Magnus Damm <magnus.damm@gmail.com>
Subject: Re: [RFC 0/4] mmc: tmio, sdhi: provide multiple irq handlers
Date: Mon, 15 Aug 2011 18:43:58 +0900 [thread overview]
Message-ID: <20110815094355.GA17762@verge.net.au> (raw)
In-Reply-To: <Pine.LNX.4.64.1108150950330.7851@axis700.grange>
On Mon, Aug 15, 2011 at 10:17:28AM +0200, Guennadi Liakhovetski wrote:
> Hi Simon
>
> On Mon, 15 Aug 2011, Simon Horman wrote:
>
> > The SDHI driver already supports making use of up to three interrupt
> > sources.
> >
> > This series breaks up the existing interrupt handler into three handlers,
> > one for card access, one for card detect interrupts, and one for SDIO
> > interrupts. A cover-all handler, which makes use of these new broken-out
> > handlers is provided for for the case where there is only one interrupt
> > source.
>
> The idea is good, thanks for the patches. Only I'm not sure I find the way
> you split the patches extremely intuitive;-) How about:
>
> [PATCH 1/x] cache IRQ masks
> * in this patch I'd propose to cache SD-card and SDIO IRQ masks in struct
> tmio_mmc_host, instead of reading them every time from the hardware
Sure, that sounds reasonable - though it seems somewhat orthogonal to my series.
I'll check over the code, but it seems that you are implying that
the masks never change.
> [PATCH 2/x] split the ISR
> * in this patch you split the IRQ handler directly into the final form as
> after the first your 3 patches, without intermediate steps, also adding
> them to the header
The current split was intended to make bite-size patches that
are easy to review. I'm happy to combine the patches as you
suggest if that is what you prefer.
> [PATCH 3/x] SDHI: use specialized ISRs when available
> * you know what to do here:-) Also, I'd
> #define SH_MOBILE_SDHI_IRQ_SDCARD 0
> #define SH_MOBILE_SDHI_IRQ_CARD_DETECT 1
> #define SH_MOBILE_SDHI_IRQ_SDIO 2
>
> and use these defines both in platforms
>
> }, [1 + SH_MOBILE_SDHI_IRQ_SDCARD] = {
> ...
I think I see what you are getting at there.
I will try and make it so.
> and in sh_mobile_sdhi.c, instead of going "case 2:" Please, also consider
> unfolding the loop over platform IRQs in probing, it might look better
> flat.
I agree the current loop isn't entirely clean.
I'll unroll it and see how things look.
> "card_access" in function names I would replace with "io" or "data,"
> "card_irq" with "sdcard_irq" because I believe, that "SD card" is a proper
> identification to pure storage card in SD format, as opposed to SDIO
> cards.
Sure, if you would prefer that naming scheme.
> Also, maybe you can double-check, whether you really need all those
> functions with names, beginning with a double underscore, and whether
> better names wouldn't be possible for them.
The motivation behind that aspect of the implementation is
to allow re-use of code while avoiding extra register reads.
I believe the two sdio functions could be collapsed into a single function
while only losing (probably unused) debugging information. I will do that,
though I decided against that option previously for the sake of consistency.
For the card_irq() functions I think it is a bit difficult to collapse things
because the access and detect handlers actually need to read the same
register(s).
prev parent reply other threads:[~2011-08-15 9:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-15 5:51 [RFC 0/4] mmc: tmio, sdhi: provide multiple irq handlers Simon Horman
2011-08-15 5:51 ` [PATCH 1/4] mmc: tmio, sdhi: Split tmio_mmc_irq() based on registers Simon Horman
2011-08-15 5:51 ` [PATCH 2/4] mmc: tmio, sdhi: Split card interrupts based on source Simon Horman
2011-08-15 5:51 ` [PATCH 3/4] mmc: tmio, sdhi: Provide separate interrupt hadnlers Simon Horman
2011-08-15 5:51 ` [PATCH 4/4] mmc: sdhi: Make use of per-source irq handlers Simon Horman
2011-08-15 8:17 ` [RFC 0/4] mmc: tmio, sdhi: provide multiple " Guennadi Liakhovetski
2011-08-15 9:43 ` Simon Horman [this message]
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=20110815094355.GA17762@verge.net.au \
--to=horms@verge.net.au \
--cc=cjb@laptop.org \
--cc=g.liakhovetski@gmx.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox