From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc <linux-mmc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Petr Cvek <petr.cvek@tul.cz>
Subject: Re: [PATCH] mmc: pxamci: fix card detect threaded interrupt
Date: Wed, 16 Sep 2015 11:22:58 +0200 [thread overview]
Message-ID: <87io7asop9.fsf@belgarion.home> (raw)
In-Reply-To: <CAPDyKFr6-hjiUUrcbZzmkykasMFDSXUPvpPvyM=UfaOX48cdwA@mail.gmail.com> (Ulf Hansson's message of "Wed, 16 Sep 2015 09:24:19 +0200")
Ulf Hansson <ulf.hansson@linaro.org> writes:
> On 12 September 2015 at 11:03, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>> Change the interrupt flavor of the card detection, from a hard interrupt
>> to a threaded interrupt. There is no strong requirement for a hard
>> interrupt.
>>
>> It fixes the case where the card detection is on a gpio expander, on I2C
>> for example on zylonite board. In this case, the card detect netsted
>> interrupt is called from a threaded interrupt. The request_irq() fails,
>> because a hard irq cannot be a nested interrupt from a threaded
>> interrupt (set __setup_irq()).
>>
>> This was tested on zylonite and mioa701 boards.
>
> This may indeed fix that separate issue, but looking into pxamci
> driver I realize that the card detect configuration suffers from other
> issues as well.
>
> 1. The irq shouldn't be requested until after the host has been added.
> Else an IRQ will call mmc_detect_change() with a non-added mmc host,
> which is really a bad idea. :-)
> 2. The host_ops->get_cd() callback isn't assigned. Thus not allowing
> the mmc core to find out whether the card is inserted or not.
>
> So instead of this quick-fix, I suggest that pxamci convert to use the
> mmc slot-gpio API, which means calling mmc_gpio[d]_request_cd() from
> ->probe() and assign the ->get_cd() callback, which use
> mmc_gpio_get_cd().
>
> What do you think?
I think you're right on both points, and that you convinced me. I'll revamp the
patch to use the slot-gpio API, which I wasn't aware of until now, which as a
side effect will pull a bit of maintainance out of pxamci into slot-gpio, which
is good for my health.
Cheers.
--
Robert
prev parent reply other threads:[~2015-09-16 9:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-12 9:03 [PATCH] mmc: pxamci: fix card detect threaded interrupt Robert Jarzmik
2015-09-16 7:24 ` Ulf Hansson
2015-09-16 9:22 ` Robert Jarzmik [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=87io7asop9.fsf@belgarion.home \
--to=robert.jarzmik@free.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=petr.cvek@tul.cz \
--cc=ulf.hansson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox