mmc: dw_mmc: avoid write to CDTHRCTL on older versions
authorJames Hogan <james.hogan@imgtec.com>
Mon, 17 Nov 2014 17:49:05 +0000 (17:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2015 18:00:48 +0000 (10:00 -0800)
commitadd16a40f74173109c5469e7e22c9c5eafb08d94
tree702784ccdeffef9c3de8e411137c04b503995fea
parent6ed0f56de1104debd9f8fc50969225869a2c807a
mmc: dw_mmc: avoid write to CDTHRCTL on older versions

commit 66dfd10173159cafa9cb0d39936b8daeaab8e3e0 upstream.

Commit f1d2736c8156 (mmc: dw_mmc: control card read threshold) added
dw_mci_ctrl_rd_thld() with an unconditional write to the CDTHRCTL
register at offset 0x100. However before version 240a, the FIFO region
started at 0x100, so the write messes with the FIFO and completely
breaks the driver.

If the version id < 240A, return early from dw_mci_ctl_rd_thld() so as
not to hit this problem.

Fixes: f1d2736c8156 (mmc: dw_mmc: control card read threshold)
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/host/dw_mmc.c