]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
mmc: core: Reset HPI enabled state during re-init and in case of errors
authorUlf Hansson <ulf.hansson@linaro.org>
Mon, 10 Dec 2018 16:52:36 +0000 (17:52 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1837257
commit a0741ba40a009f97c019ae7541dc61c1fdf41efb upstream.

During a re-initialization of the eMMC card, we may fail to re-enable HPI.
In these cases, that isn't properly reflected in the card->ext_csd.hpi_en
bit, as it keeps being set. This may cause following attempts to use HPI,
even if's not enabled. Let's fix this!

Fixes: eb0d8f135b67 ("mmc: core: support HPI send command")
Cc: <stable@vger.kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/mmc/core/mmc.c

index 208a762b87ef2876914d641b38fc61858429a22e..00207309165d8c03b9d8170ad997870ba094d021 100644 (file)
@@ -1762,9 +1762,11 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
                if (err) {
                        pr_warn("%s: Enabling HPI failed\n",
                                mmc_hostname(card->host));
+                       card->ext_csd.hpi_en = 0;
                        err = 0;
-               } else
+               } else {
                        card->ext_csd.hpi_en = 1;
+               }
        }
 
        /*