All of lore.kernel.org
 help / color / mirror / Atom feed
* cd-gpio and SDHCI presence
@ 2012-09-17  6:29 Chris Ball
  2012-09-17  7:28 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Ball @ 2012-09-17  6:29 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: linux-mmc

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-09-17 10:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-17  6:29 cd-gpio and SDHCI presence Chris Ball
2012-09-17  7:28 ` 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

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.