Thread (11 messages) 11 messages, 6 authors, 2014-11-05

[Regression Resend] mmc: mx28: sd card detection broken since 3.18-rc1

From: Linus Walleij <hidden>
Date: 2014-11-04 10:30:59
Also in: linux-gpio, linux-mmc

On Mon, Nov 3, 2014 at 12:01 AM, Kristina Mart?enko
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
I ran into this issue as well. Seems that a card-detect flag
(MMC_CAP2_CD_ACTIVE_HIGH) can currently be set based on an
uninitialized variable, which can lead to the card being reported as
not present. This patch fixes it for me:
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 03c53b72a2d6..f0e187682d3b 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -311,7 +311,7 @@ int mmc_of_parse(struct mmc_host *host)
        struct device_node *np;
        u32 bus_width;
        int len, ret;
-       bool cap_invert, gpio_invert;
+       bool cap_invert, gpio_invert = false;

        if (!host->parent || !host->parent->of_node)
                return 0;
@@ -401,6 +401,7 @@ int mmc_of_parse(struct mmc_host *host)
        else
                cap_invert = false;

+       gpio_invert = false;
        ret = mmc_gpiod_request_ro(host, "wp", 0, false, 0, &gpio_invert);
        if (ret) {
                if (ret == -EPROBE_DEFER)
Let me know if this also fixes it for you, and I'll send in a proper
patch.
Argh how could I make this stupid mistake :(

Reviewed-by: Linus Walleij <redacted>

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help