[PATCH 1/2] mmc: core: enable CMD19 tuning for DDR50 mode
Yang, York
weijuny at qti.qualcomm.com
Thu Dec 17 21:52:23 PST 2015
Hi, Carlo
I understand now. So the problem comes out because the sw_caps.sd3_bus_mode marks the capability of a card, while the host->timing is the mode we actually do with.
For your case, you are running DDR50 mode, what if we add more condition for coming into the tuning logic?
struct sdhci_host *host = mmc_priv(card->host);
if (!mmc_host_is_spi(card->host) && card->host->ops->execute_tuning &&
((card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR50) ||
(card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR104))&&
((host->timing & MMC_TIMING_UHS_SDR50) ||
(host->timing & MMC_TIMING_UHS_SDR104))) {
mmc_host_clk_hold(card->host);
err = card->host->ops->execute_tuning(card->host,
MMC_SEND_TUNING_BLOCK);
mmc_host_clk_release(card->host);
}
-----Original Message-----
From: carlo.caione at gmail.com [mailto:carlo.caione at gmail.com] On Behalf Of Carlo Caione
Sent: 2015年12月18日 3:54
To: Yang, York <weijuny at qti.qualcomm.com>
Cc: Ulf Hansson <ulf.hansson at linaro.org>; Barry Song <21cnbao at gmail.com>; linux-mmc <linux-mmc at vger.kernel.org>; DL-SHA-WorkGroupLinux <workgroup.linux at csr.com>; linux-arm-kernel at lists.infradead.org; Song, Barry <baohuas at qti.qualcomm.com>
Subject: Re: [PATCH 1/2] mmc: core: enable CMD19 tuning for DDR50 mode
On gio, dic 17, 2015 at 02:00:17 +0000, Yang, York wrote:
> Hi, Carlo
Hi Yang,
> I don't understand. We can see that 9faac7b95 is all about DDR50. It
> should not affect the behavior of SDR50.
What I'm saying is that this commit is negatively affecting some DDR50 SDIO card as in my case.
Ok, let's try to go through the code with and without 9faac7b95.
Without 9faac7b95:
- mmc_sdio_init_uhs_card() is called
- sw_caps.sd3_bus_mode is 0x14 (SD_MODE_UHS_SDR50 | SD_MODE_UHS_DDR50)
- card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR50 is verified and
mmc_execute_tuning() is called
- sdhci_execute_tuning() is called
- host->timing is MMC_TIMING_UHS_DDR50
- since there is no case for that we end up in 'default', goto out_unlock and CMD19 is never issued
With 9faac7b95:
- mmc_sdio_init_uhs_card() is called
- sw_caps.sd3_bus_mode is 0x14 (SD_MODE_UHS_SDR50 | SD_MODE_UHS_DDR50)
- card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR50 is verified and
mmc_execute_tuning() is called
- sdhci_execute_tuning() is called
- host->timing is MMC_TIMING_UHS_DDR50
- this time we have the the 'case MMC_TIMING_UHS_DDR50' and we break on that
- CMD19 is issued and the card stops working
> Since the commit is very simple, you may remove the change one by one
> by yourself. And see if any difference occurs.
As stated above the problem is in the new 'case MMC_TIMING_UHS_DDR50'
we have in sdhci_execute_tuning()
> Besides, please check
> if the card->sw_caps.sd3_bus_mode changes with or without DDR50 tuning
> enabled.
It doesn't.
--
Carlo Caione
More information about the linux-arm-kernel
mailing list