]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mmc: tmio: fix access width of Block Count Register
authorTakeshi Saito <takeshi.saito.xv@renesas.com>
Thu, 21 Feb 2019 19:38:05 +0000 (20:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Mar 2019 16:58:02 +0000 (17:58 +0100)
commit3094b3f769089729ffbd80356bab1b2d25bd405e
tree55af606ce6bdf0fa442189ec7d8e73cf85af4090
parentf4a2a74704d557228d215b0e9065de0baa2a8dc8
mmc: tmio: fix access width of Block Count Register

commit 5603731a15ef9ca317c122cc8c959f1dee1798b4 upstream.

In R-Car Gen2 or later, the maximum number of transfer blocks are
changed from 0xFFFF to 0xFFFFFFFF. Therefore, Block Count Register
should use iowrite32().

If another system (U-boot, Hypervisor OS, etc) uses bit[31:16], this
value will not be cleared. So, SD/MMC card initialization fails.

So, check for the bigger register and use apropriate write. Also, mark
the register as extended on Gen2.

Signed-off-by: Takeshi Saito <takeshi.saito.xv@renesas.com>
[wsa: use max_blk_count in if(), add Gen2, update commit message]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: stable@kernel.org
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
[Ulf: Fixed build error]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/host/renesas_sdhi_sys_dmac.c
drivers/mmc/host/tmio_mmc.h
drivers/mmc/host/tmio_mmc_core.c