From: Chuanxiao Dong Date: Fri, 4 May 2012 05:59:32 +0000 (+0800) Subject: mmc: panic_ops: fix emmc write when in kernel panic mode X-Git-Tag: 2.1b_release~827 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=22680b90854f6f6c775df9a32d14cd09c39fc269;p=kernel%2Fkernel-mfld-blackbay.git mmc: panic_ops: fix emmc write when in kernel panic mode BZ: 33786 CLV cannot save kernel panic log and logcat log after kernel happened. It because eMMC card has switched to DDR mode but host is still in DDR mode after kenel panic happens. So change eMMC card to SDR mode only after kernel panic happened. Change-Id: I40768128598fc2a4afdeb341837da360997d50f7 Signed-off-by: Chuanxiao Dong Reviewed-on: http://android.intel.com:8080/47372 Reviewed-by: Tang, Richard Tested-by: Sun, Jianhua Reviewed-by: buildbot Tested-by: buildbot --- diff --git a/drivers/mmc/core/mmc_panic_ops.c b/drivers/mmc/core/mmc_panic_ops.c index 3ec85b6..d220a08 100644 --- a/drivers/mmc/core/mmc_panic_ops.c +++ b/drivers/mmc/core/mmc_panic_ops.c @@ -540,35 +540,18 @@ static int mmc_emergency_reinit_card(void) host->panic_ops->set_ios(host); /* - * Indicate DDR mode (if supported). - */ - if (mmc_card_highspeed(card)) { - if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V) - && (host->caps & (MMC_CAP_1_8V_DDR))) - ddr = MMC_1_8V_DDR_MODE; - else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V) - && (host->caps & (MMC_CAP_1_2V_DDR))) - ddr = MMC_1_2V_DDR_MODE; - } - - /* - * Activate wide bus and DDR (if supported). + * Activate wide bus. + * By default use SDR mode for panic write */ if ((card->csd.mmca_vsn >= CSD_SPEC_VER_4) && (host->caps & (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA))) { unsigned ext_csd_bit, bus_width; if (host->caps & MMC_CAP_8_BIT_DATA) { - if (ddr) - ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_8; - else - ext_csd_bit = EXT_CSD_BUS_WIDTH_8; + ext_csd_bit = EXT_CSD_BUS_WIDTH_8; bus_width = MMC_BUS_WIDTH_8; } else { - if (ddr) - ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_4; - else - ext_csd_bit = EXT_CSD_BUS_WIDTH_4; + ext_csd_bit = EXT_CSD_BUS_WIDTH_4; bus_width = MMC_BUS_WIDTH_4; } @@ -579,15 +562,11 @@ static int mmc_emergency_reinit_card(void) goto err; if (err) { - printk(KERN_WARNING "%s: switch to bus width %d ddr %d " - "failed\n", __func__, 1 << bus_width, ddr); + printk(KERN_WARNING "%s: switch to bus width %d " + "failed\n", __func__, 1 << bus_width); err = 0; } else { - if (ddr) - mmc_card_set_ddr_mode(card); - else - ddr = MMC_SDR_MODE; - + ddr = MMC_SDR_MODE; host->ios.bus_width = bus_width; host->ios.ddr = ddr; host->panic_ops->set_ios(host);