Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-mmc@vger.kernel.org
Subject: cd-gpio and SDHCI presence
Date: Mon, 17 Sep 2012 02:29:04 -0400	[thread overview]
Message-ID: <m3y5k9yxfz.fsf@pullcord.laptop.org> (raw)

Hi Guennadi,

I'm having trouble using a cd-gpio.  After I request it, I get the
IRQ and mmc_rescan() triggers successfully, but mmc_attach_sd()
fails because every command returns -123 (ENOMEDIUM), due to:

sdhci.c:
	/* If polling, assume that the card is always present. */
	if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
		present = true;
	else
		present = sdhci_readl(host, SDHCI_PRESENT_STATE) &
				SDHCI_CARD_PRESENT;

	if (!present || host->flags & SDHCI_DEVICE_DEAD) {
		host->mrq->cmd->error = -ENOMEDIUM;
		tasklet_schedule(&host->finish_tasklet);
	} else { 
		...

"present" is false because SDHCI_PRESENT_STATE doesn't have the presence
bit sent (if it did, we wouldn't need a cd-gpio, right?) and the command
fails.

And we can't just set SDHCI_QUIRK_BROKEN_CARD_DETECTION, because that
would turn on polling, which we don't want.  How's this supposed to work?

Maybe your system was differently broken, and we need some new way to
communicate that neither the PRESENT bit nor polling should be used?

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

             reply	other threads:[~2012-09-17  6:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-17  6:29 Chris Ball [this message]
2012-09-17  7:28 ` cd-gpio and SDHCI presence Guennadi Liakhovetski
2012-09-17  8:45   ` Chris Ball
2012-09-17  8:55   ` [PATCH] mmc: sdhci: Test cd-gpio instead of SDHCI presence when probing Chris Ball
2012-09-17  9:09     ` Guennadi Liakhovetski
2012-09-17 10:08       ` Chris Ball

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=m3y5k9yxfz.fsf@pullcord.laptop.org \
    --to=cjb@laptop.org \
    --cc=g.liakhovetski@gmx.de \
    --cc=linux-mmc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox