All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian Daudt" <csd@broadcom.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Chris Ball <cjb@laptop.org>, Shawn Guo <shawn.guo@linaro.org>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmc: change mmc_gpio_get_cd to call non-sleep gpio
Date: Thu, 8 Aug 2013 14:10:58 -0700	[thread overview]
Message-ID: <52040962.6040003@broadcom.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1308082258260.29611@axis700.grange>

On 13-08-08 02:06 PM, Guennadi Liakhovetski wrote:
> On Thu, 8 Aug 2013, Christian Daudt wrote:
>
>> Given that mmc_gpio_get_cd can be called in softirq
>> context (by sdhci_tasklet_card -> sdhci_card_event ->
>> sdhci_do_get_cd -> mmc_gpio_get_cd ), it is necessary
>> for it to use gpio_get_value instead of
>> gpio_get_value_cansleep
>> Note that at present sdhci_card_event gets called both
>> from mmc_gpio_cd_irqt and sdhci_tasklet_card, and from
>> both it gets called immediately while the actual cd
>> processing is debounced to 200ms later. I think that
>> the better solution might be to move the sdhci_card_event
>> callback into mmc_rescan and remove it from its 2
>> present locations. That way the cd related callbacks
>> are aligned with the actual cd detection code. I can
>> submit a follow-up patch with these mods if that sounds
>> like a better way to solve this.
>>
>> Signed-off-by: Christian Daudt <csd@broadcom.com>
> I don't think this is a right approach. It will Oops if the card-detect
> GPIO is provided by, e.g. an I2C GPIO controller. Instead the driver
> should be fixed to only call this function from a sleeping context.
I don't think that card-detect would ever be tied to i2c but I might be 
wrong on that one... If there's agreement that moving sdhci_card_event 
into just being called from mmc_rescan is the better way to solve this, 
then I'll drop this patch and replace it with one that does just that.

  Thanks,
    csd



  reply	other threads:[~2013-08-08 21:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08 20:47 [PATCH] mmc: change mmc_gpio_get_cd to call non-sleep gpio Christian Daudt
2013-08-08 21:06 ` Guennadi Liakhovetski
2013-08-08 21:10   ` Christian Daudt [this message]
2013-08-19 23:36     ` Christian Daudt

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=52040962.6040003@broadcom.com \
    --to=csd@broadcom.com \
    --cc=cjb@laptop.org \
    --cc=g.liakhovetski@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=shawn.guo@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 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.