All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Wahren <stefan.wahren@i2se.com>
To: "Kristina Martšenko" <kristina.martsenko@gmail.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Chris Ball <chris@printf.net>,
	linux-mmc@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	festevam@gmail.com, linux-arm-kernel@lists.infradead.org,
	linux-gpio@vger.kernel.org
Subject: Re: [Regression Resend] mmc: mx28: sd card detection broken since 3.18-rc1
Date: Mon, 03 Nov 2014 08:15:53 +0100	[thread overview]
Message-ID: <54572BA9.1090305@i2se.com> (raw)
In-Reply-To: <5456B7B3.60401@gmail.com>

Hello Kristina,

Am 03.11.2014 um 00:01 schrieb Kristina Martšenko:
> [...]
> 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.

the patch works for me too. You can also add:

Tested-by: Stefan Wahren <stefan.wahren@i2se.com>

> Thanks,
> Kristina

Thanks a lot
Stefan

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: stefan.wahren@i2se.com (Stefan Wahren)
To: linux-arm-kernel@lists.infradead.org
Subject: [Regression Resend] mmc: mx28: sd card detection broken since 3.18-rc1
Date: Mon, 03 Nov 2014 08:15:53 +0100	[thread overview]
Message-ID: <54572BA9.1090305@i2se.com> (raw)
In-Reply-To: <5456B7B3.60401@gmail.com>

Hello Kristina,

Am 03.11.2014 um 00:01 schrieb Kristina Mart?enko:
> [...]
> 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.

the patch works for me too. You can also add:

Tested-by: Stefan Wahren <stefan.wahren@i2se.com>

> Thanks,
> Kristina

Thanks a lot
Stefan

  parent reply	other threads:[~2014-11-03  7:16 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-01 21:40 [Regression Resend] mmc: mx28: sd card detection broken since 3.18-rc1 Stefan Wahren
2014-11-01 21:40 ` Stefan Wahren
2014-11-02 23:01 ` Kristina Martšenko
2014-11-02 23:01   ` Kristina Martšenko
2014-11-03  2:23   ` Fabio Estevam
2014-11-03  2:23     ` Fabio Estevam
2014-11-03  7:15   ` Stefan Wahren [this message]
2014-11-03  7:15     ` Stefan Wahren
2014-11-03 20:49   ` Michael Heimpold
2014-11-03 20:49     ` Michael Heimpold
2014-11-03 21:50     ` Kristina Martšenko
2014-11-03 21:50       ` Kristina Martšenko
2014-11-03 23:26       ` Michael Heimpold
2014-11-03 23:26         ` Michael Heimpold
2014-11-04 10:30   ` Linus Walleij
2014-11-04 10:30     ` Linus Walleij
2014-11-05  0:22 ` [PATCH] mmc: core: fix card detection regression Kristina Martšenko
2014-11-05  0:22   ` Kristina Martšenko
2014-11-05  0:22   ` Kristina Martšenko
2014-11-05  0:48   ` Fabio Estevam
2014-11-05  0:48     ` Fabio Estevam
2014-11-05  0:48     ` Fabio Estevam
2014-11-05  9:30   ` Ulf Hansson
2014-11-05  9:30     ` Ulf Hansson

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=54572BA9.1090305@i2se.com \
    --to=stefan.wahren@i2se.com \
    --cc=chris@printf.net \
    --cc=festevam@gmail.com \
    --cc=kristina.martsenko@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@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.