Thread (8 messages) 8 messages, 3 authors, 2012-09-20
STALE5023d REVIEWED: 1 (0M)

[PATCH] mmc: mxs-mmc: implement broken-cd

From: Shawn Guo <hidden>
Date: 2012-09-10 13:50:37
Also in: linux-mmc

On Mon, Sep 10, 2012 at 01:04:00PM +0300, Lauri Hintsala wrote:
quoted
quoted
@@ -187,6 +188,9 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
 {
 	struct mxs_mmc_host *host = mmc_priv(mmc);

+	if (host->broken_cd)
+		return -ENOSYS;
+
The .get_cd caller does not check for error.  This change makes no
sense to me.
In our case we don't want to read card detect bit and we have to
continue MMC probing because card detect pin is routed nowhere.

Could it be better to return zero instead of error? ENOSYS is used
to indicate "unreachable card detect" in other drivers (e.g.
atmel-mci, omap_hsmmc) and I followed them.
I was wrong.  Even the kerneldoc of .get_cd suggests return -ENOSYS
for that case.
quoted
Instead, the driver needs to set MMC_CAP_NEEDS_POLL in
case of "broken-cd".
MMC_CAP_NEEDS_POLL is always set in mxs-mmc.
Oops, I forgot that.  But this is really something that needs to be
fixed.  Per my understanding, flag MMC_CAP_NEEDS_POLL should only
be set when card-detect is not working.

Also the card-detect in gpio support is missing.

But for this patch:

Acked-by: Shawn Guo <redacted>

-- 
Regards,
Shawn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help