Re: [PATCH] mmc: dw_mmc: handle data blocks > than 4kB if IDMAC is used
From: Alexey Brodkin
Date: Wed Jul 01 2015 - 06:02:31 EST
Hi Jaehoon, Seungwon, Ulf,
On Thu, 2015-06-25 at 11:25 +-0300, Alexey Brodkin wrote:
+AD4- As per DW MobileStorage databook +ACI-each descriptor can transfer up to
+AD4- 4kB
+AD4- of data in chained mode+ACI-, moreover buffer size that is put in +ACI-des1+ACI-
+AD4- is
+AD4- limited to 13 bits, i.e. for example on attempt to
+AD4- IDMAC+AF8-SET+AF8-BUFFER1+AF8-SIZE(desc, 8192) size value that's effectively
+AD4- written
+AD4- will be 0.
+AD4-
+AD4- On the platform with 8kB PAGE+AF8-SIZE I see dw+AF8-mmc gets data blocks in
+AD4- SG-list of 8kB size and that leads to unpredictable behavior of the
+AD4- SD/MMC controller.
+AD4-
+AD4- In particular on write to FAT partition of SD-card the controller
+AD4- will
+AD4- stuck in the middle of DMA transaction.
+AD4-
+AD4- Solution to the problem is simple - we need to pass large (+AD4- 4kB)
+AD4- data
+AD4- buffers to the controller via multiple descriptors. And that's what
+AD4- that change does.
+AD4-
+AD4- What's interesting I did try original driver on same platform but
+AD4- configured with 4kB PAGE+AF8-SIZE and may confirm that data blocks passed
+AD4- in SG-list to dw+AF8-mmc never exeed 4kB limit - that explains why nobody
+AD4- ever faced a problem I did.
+AD4-
+AD4- Signed-off-by: Alexey Brodkin +ADw-abrodkin+AEA-synopsys.com+AD4-
+AD4- Cc: Seungwon Jeon +ADw-tgih.jun+AEA-samsung.com+AD4-
+AD4- Cc: Jaehoon Chung +ADw-jh80.chung+AEA-samsung.com+AD4-
+AD4- Cc: Ulf Hansson +ADw-ulf.hansson+AEA-linaro.org+AD4-
+AD4- Cc: arc-linux-dev+AEA-synopsys.com
+AD4- Cc: linux-kernel+AEA-vger.kernel.org
+AD4- ---
+AD4- drivers/mmc/host/dw+AF8-mmc.c +AHw- 109 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-------
+AD4- ----------
I'm wondering if there're any comments on that patch or if it could be
applied?
It fixes a real problem on systems on 4K PAGE+AF8-SIZE so would be good to
have it in upstream. In particular this is the case with ARC AXS board
which made its way in upstream kernel recently.
Regards,
Alexey--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/