提交 80e65cb9 编写于 作者: Z zhangguijiang 提交者: Yang Yingliang

EMMC: fix ascend hisi emmc probe failed problem according to mmc_host struct

ascend inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4GVSG
CVE: NA

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

Struct mmc_host using variable private[0] to point the end of struct
mmc_host, at deaf01a6 we modified struct mmc_host but ignored the
role of private[0] and not put it to the end of struct mmc_host.

It will make mmc card probe failed, so we fix this problem, and now
ascend hisi mmc card is able to probe success.
Signed-off-by: Nzhangguijiang <zhangguijiang@huawei.com>
Reviewed-by: NDing Tianhong <dingtianhong@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 d49a78a0
......@@ -1163,9 +1163,9 @@ static int _mmc_sd_suspend(struct mmc_host *host)
err = mmc_deselect_cards(host);
if (!err) {
if (!(mmc_is_ascend_customized(host->parent)))
if (!mmc_is_ascend_customized(host->parent))
mmc_power_off(host);
else if (mmc_card_keep_power(host))
else if (!mmc_card_keep_power(host))
mmc_power_off(host);
mmc_card_set_suspended(host->card);
}
......@@ -1269,42 +1269,10 @@ static int mmc_sd_runtime_resume(struct mmc_host *host)
return 0;
}
#ifdef CONFIG_ASCEND_HISI_MMC
/*********************sd ops begin**********************/
static int mmc_do_sd_reset(struct mmc_host *host)
{
struct mmc_card *card = host->card;
if (!host->bus_ops->power_restore)
return -EOPNOTSUPP;
if (!card)
return -EINVAL;
/* hw_reset for ip reset */
if (host->ops->hw_reset)
host->ops->hw_reset(host);
/* Only for K930/920 SD slow down clk*/
if (host->ops->slowdown_clk)
host->ops->slowdown_clk(host, host->ios.timing);
mmc_power_off(host);
mmc_set_clock(host, host->f_init);
/* Wait at least 200 ms */
mmc_delay(200);
mmc_power_up(host, host->card->ocr);
(void)mmc_select_voltage(host, host->card->ocr);
return host->bus_ops->power_restore(host);
}
#endif
static int mmc_sd_hw_reset(struct mmc_host *host)
{
#ifdef CONFIG_ASCEND_HISI_MMC
if (mmc_is_ascend_customized(host->parent))
return mmc_do_sd_reset(host);
#endif
return mmc_sd_reset(host);
mmc_power_cycle(host, host->card->ocr);
return mmc_sd_init_card(host, host->card->ocr, host->card);
}
......
......@@ -8,7 +8,7 @@
#include "dw_mmc.h"
#ifdef CONFIG_MMC_DW_HI3XXX_MODULE
#if defined(CONFIG_MMC_DW_HI3XXX) || defined(CONFIG_MMC_DW_HI3XXX_MODULE)
extern void dw_mci_reg_dump(struct dw_mci *host);
extern void dw_mci_set_timeout(struct dw_mci *host);
extern bool dw_mci_stop_abort_cmd(struct mmc_command *cmd);
......
......@@ -542,13 +542,13 @@ struct mmc_host {
bool cqe_enabled;
bool cqe_on;
unsigned long private[0] ____cacheline_aligned;
#ifdef CONFIG_ASCEND_HISI_MMC
const struct mmc_cmdq_host_ops *cmdq_ops;
int sdio_present;
unsigned int cmdq_slots;
struct mmc_cmdq_context_info cmdq_ctx;
#endif
unsigned long private[0] ____cacheline_aligned;
};
struct device_node;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册