Browse Source

mmc: core: Reset HPI enabled state during re-init and in case of errors

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>
Ulf Hansson 7 năm trước cách đây
mục cha
commit
f465300aab
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      drivers/mmc/core/mmc.c

+ 3 - 1
drivers/mmc/core/mmc.c

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