提交 9f347ba2 编写于 作者: U Ulf Hansson 提交者: Zheng Zengkai

mmc: core: Fixup storing of OCR for MMC_QUIRK_NONSTD_SDIO

stable inclusion
from stable-v5.10.94
commit 5d54ed155031a4b13cd92b3deb404673d82d7504
bugzilla: https://gitee.com/openeuler/kernel/issues/I531X9

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5d54ed155031a4b13cd92b3deb404673d82d7504

--------------------------------

[ Upstream commit 8c3e5b74 ]

The mmc core takes a specific path to support initializing of a
non-standard SDIO card. This is triggered by looking for the card-quirk,
MMC_QUIRK_NONSTD_SDIO.

In mmc_sdio_init_card() this gets rather messy, as it causes the code to
bail out earlier, compared to the usual path. This leads to that the OCR
doesn't get saved properly in card->ocr. Fortunately, only omap_hsmmc has
been using the MMC_QUIRK_NONSTD_SDIO and is dealing with the issue, by
assigning a hardcoded value (0x80) to card->ocr from an ->init_card() ops.

To make the behaviour consistent, let's instead rely on the core to save
the OCR in card->ocr during initialization.
Reported-by: NH. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: NH. Nikolaus Schaller <hns@goldelico.com>
Link: https://lore.kernel.org/r/e7936cff7fc24d187ef2680d3b4edb0ade58f293.1636564631.git.hns@goldelico.comSigned-off-by: NUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 61ca5c64
...@@ -708,6 +708,8 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, ...@@ -708,6 +708,8 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
if (host->ops->init_card) if (host->ops->init_card)
host->ops->init_card(host, card); host->ops->init_card(host, card);
card->ocr = ocr_card;
/* /*
* If the host and card support UHS-I mode request the card * If the host and card support UHS-I mode request the card
* to switch to 1.8V signaling level. No 1.8v signalling if * to switch to 1.8V signaling level. No 1.8v signalling if
...@@ -820,7 +822,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, ...@@ -820,7 +822,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
goto mismatch; goto mismatch;
} }
} }
card->ocr = ocr_card;
mmc_fixup_device(card, sdio_fixup_methods); mmc_fixup_device(card, sdio_fixup_methods);
if (card->type == MMC_TYPE_SD_COMBO) { if (card->type == MMC_TYPE_SD_COMBO) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册