stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mmc patches for v5.4.y, v5.5.y
@ 2020-02-18 17:18 Guenter Roeck
  2020-02-18 18:18 ` Sasha Levin
  2020-02-18 18:23 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 3+ messages in thread
From: Guenter Roeck @ 2020-02-18 17:18 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman
  Cc: Linus Walleij, Robert Jarzmik, Ulf Hansson,
	Michał Mirosław

Hi Greg,

please apply the following two patches to v5.4.y and v5.5.y to fix a
problem when trying to boot various pxa machines from MMC.

d3a5bcb4a17f gpio: add gpiod_toggle_active_low()
9073d10b0989 mmc: core: Rework wp-gpio handling

The second patch fixes the problem, the first patch is necessary for the
second patch to compile.

Background: Commit 9073d10b0989 claims "No functional changes intended".
However, it does include the following functional code change.

--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -740,16 +740,16 @@ static int pxamci_probe(struct platform_device *pdev)
                        goto out;
                }

+               if (!host->pdata->gpio_card_ro_invert)
+                       mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
+
                ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0, NULL);
                if (ret && ret != -ENOENT) {
                        dev_err(dev, "Failed requesting gpio_ro\n");
                        goto out;
                }
-               if (!ret) {
+               if (!ret)
                        host->use_ro_gpio = true;
-                       mmc->caps2 |= host->pdata->gpio_card_ro_invert ?
-                               0 : MMC_CAP2_RO_ACTIVE_HIGH;
-               }

This _is_ a functional change: Previously, if there was no "ro" gpio
pin, caps2 was never updated to active-high. This can have the practical
effect of making the the card read-only, thus preventing the system
from booting if it was mounted (and expected to be mounted) read-write.
This is seen when trying to boot "spitz" and similar qemu machines from
mmc.

I bisected the problem to commit c914a27c92f91 ("mmc: pxamci: Support
getting GPIO descs for RO and WP), affecting v5.0 and later kernels.

Thanks,
Guenter

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

* Re: mmc patches for v5.4.y, v5.5.y
  2020-02-18 17:18 mmc patches for v5.4.y, v5.5.y Guenter Roeck
@ 2020-02-18 18:18 ` Sasha Levin
  2020-02-18 18:23 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2020-02-18 18:18 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: stable, Greg Kroah-Hartman, Linus Walleij, Robert Jarzmik,
	Ulf Hansson, Michał Mirosław

On Tue, Feb 18, 2020 at 09:18:57AM -0800, Guenter Roeck wrote:
>Hi Greg,
>
>please apply the following two patches to v5.4.y and v5.5.y to fix a
>problem when trying to boot various pxa machines from MMC.
>
>d3a5bcb4a17f gpio: add gpiod_toggle_active_low()
>9073d10b0989 mmc: core: Rework wp-gpio handling
>
>The second patch fixes the problem, the first patch is necessary for the
>second patch to compile.
>
>Background: Commit 9073d10b0989 claims "No functional changes intended".
>However, it does include the following functional code change.
>
>--- a/drivers/mmc/host/pxamci.c
>+++ b/drivers/mmc/host/pxamci.c
>@@ -740,16 +740,16 @@ static int pxamci_probe(struct platform_device *pdev)
>                        goto out;
>                }
>
>+               if (!host->pdata->gpio_card_ro_invert)
>+                       mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
>+
>                ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0, NULL);
>                if (ret && ret != -ENOENT) {
>                        dev_err(dev, "Failed requesting gpio_ro\n");
>                        goto out;
>                }
>-               if (!ret) {
>+               if (!ret)
>                        host->use_ro_gpio = true;
>-                       mmc->caps2 |= host->pdata->gpio_card_ro_invert ?
>-                               0 : MMC_CAP2_RO_ACTIVE_HIGH;
>-               }
>
>This _is_ a functional change: Previously, if there was no "ro" gpio
>pin, caps2 was never updated to active-high. This can have the practical
>effect of making the the card read-only, thus preventing the system
>from booting if it was mounted (and expected to be mounted) read-write.
>This is seen when trying to boot "spitz" and similar qemu machines from
>mmc.
>
>I bisected the problem to commit c914a27c92f91 ("mmc: pxamci: Support
>getting GPIO descs for RO and WP), affecting v5.0 and later kernels.

I've queued both for 5.4 and 5.5, thank you.

-- 
Thanks,
Sasha

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

* Re: mmc patches for v5.4.y, v5.5.y
  2020-02-18 17:18 mmc patches for v5.4.y, v5.5.y Guenter Roeck
  2020-02-18 18:18 ` Sasha Levin
@ 2020-02-18 18:23 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2020-02-18 18:23 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: stable, Linus Walleij, Robert Jarzmik, Ulf Hansson,
	Michał Mirosław

On Tue, Feb 18, 2020 at 09:18:57AM -0800, Guenter Roeck wrote:
> Hi Greg,
> 
> please apply the following two patches to v5.4.y and v5.5.y to fix a
> problem when trying to boot various pxa machines from MMC.
> 
> d3a5bcb4a17f gpio: add gpiod_toggle_active_low()
> 9073d10b0989 mmc: core: Rework wp-gpio handling
> 
> The second patch fixes the problem, the first patch is necessary for the
> second patch to compile.
> 
> Background: Commit 9073d10b0989 claims "No functional changes intended".
> However, it does include the following functional code change.
> 
> --- a/drivers/mmc/host/pxamci.c
> +++ b/drivers/mmc/host/pxamci.c
> @@ -740,16 +740,16 @@ static int pxamci_probe(struct platform_device *pdev)
>                         goto out;
>                 }
> 
> +               if (!host->pdata->gpio_card_ro_invert)
> +                       mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
> +
>                 ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0, NULL);
>                 if (ret && ret != -ENOENT) {
>                         dev_err(dev, "Failed requesting gpio_ro\n");
>                         goto out;
>                 }
> -               if (!ret) {
> +               if (!ret)
>                         host->use_ro_gpio = true;
> -                       mmc->caps2 |= host->pdata->gpio_card_ro_invert ?
> -                               0 : MMC_CAP2_RO_ACTIVE_HIGH;
> -               }
> 
> This _is_ a functional change: Previously, if there was no "ro" gpio
> pin, caps2 was never updated to active-high. This can have the practical
> effect of making the the card read-only, thus preventing the system
> from booting if it was mounted (and expected to be mounted) read-write.
> This is seen when trying to boot "spitz" and similar qemu machines from
> mmc.
> 
> I bisected the problem to commit c914a27c92f91 ("mmc: pxamci: Support
> getting GPIO descs for RO and WP), affecting v5.0 and later kernels.

Looks like Sasha just beat me to this, thanks for letting us know about
this.

greg k-h

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

end of thread, other threads:[~2020-02-18 18:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-18 17:18 mmc patches for v5.4.y, v5.5.y Guenter Roeck
2020-02-18 18:18 ` Sasha Levin
2020-02-18 18:23 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).