stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: stable@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
	"Robert Jarzmik" <robert.jarzmik@free.fr>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Subject: mmc patches for v5.4.y, v5.5.y
Date: Tue, 18 Feb 2020 09:18:57 -0800	[thread overview]
Message-ID: <20200218171857.GA25822@roeck-us.net> (raw)

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

             reply	other threads:[~2020-02-18 17:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18 17:18 Guenter Roeck [this message]
2020-02-18 18:18 ` mmc patches for v5.4.y, v5.5.y Sasha Levin
2020-02-18 18:23 ` Greg Kroah-Hartman

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=20200218171857.GA25822@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=robert.jarzmik@free.fr \
    --cc=stable@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 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).