mbox series

[RFC,0/4] mmc: host: renesas_sdhi_sys_dmac: change dma_buswidth

Message ID 1574403231-18512-1-git-send-email-yoshihiro.shimoda.uh@renesas.com (mailing list archive)
Headers show
Series mmc: host: renesas_sdhi_sys_dmac: change dma_buswidth | expand

Message

Yoshihiro Shimoda Nov. 22, 2019, 6:13 a.m. UTC
This patch can improve performance when a sd card transfer size
is multiples of 32 like a sd memory card. However, this may
disimprove performance when a sd card transfer size is not
multiples of 32 because this patch uses PIO instead of SYS-DMAC.
So, I marked as "RFC" and sent linux-renesas-soc ML only
for the reference.

Yoshihiro Shimoda (4):
  mmc: host: renesas_sdhi_sys_dmac: Use dma_buswidth instead of
    hardcoded value
  mmc: host: renesas_sdhi_sys_dmac: Do not fall back to PIO
  mmc: host: renesas_sdhi_sys_dmac: add DMACR setting
  mmc: host: renesas_sdhi_sys_dmac: Set dma_buswidth value to 32 byte

 drivers/mmc/host/renesas_sdhi_core.c     | 35 +++++++++++++++++++++++
 drivers/mmc/host/renesas_sdhi_sys_dmac.c | 49 +++++++++-----------------------
 2 files changed, 49 insertions(+), 35 deletions(-)

Comments

Ulrich Hecht Nov. 26, 2019, 10:45 a.m. UTC | #1
> On November 22, 2019 at 7:13 AM Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> wrote:
> 
> 
> This patch can improve performance when a sd card transfer size
> is multiples of 32 like a sd memory card. However, this may
> disimprove performance when a sd card transfer size is not
> multiples of 32 because this patch uses PIO instead of SYS-DMAC.

I have logged the DMA transfer sizes of a Marvell SD8897 WiFi/BT chip, and there transfers that are not multiples of 32 are infrequent (every second or so) and small (184 bytes); all large transfers are multiples of 32.

Would it be practical to switch the DMA bus width down if odd sizes are encountered, and back up again otherwise?
 
CU
Uli
Yoshihiro Shimoda Dec. 2, 2019, 8:09 a.m. UTC | #2
Hi Ulrich-san,

Thank you for your comment!

> From: Ulrich Hecht, Sent: Tuesday, November 26, 2019 7:45 PM
> 
> > On November 22, 2019 at 7:13 AM Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> wrote:
> >
> >
> > This patch can improve performance when a sd card transfer size
> > is multiples of 32 like a sd memory card. However, this may
> > disimprove performance when a sd card transfer size is not
> > multiples of 32 because this patch uses PIO instead of SYS-DMAC.
> 
> I have logged the DMA transfer sizes of a Marvell SD8897 WiFi/BT chip, and there transfers that are not multiples of 32
> are infrequent (every second or so) and small (184 bytes); all large transfers are multiples of 32.
> 
> Would it be practical to switch the DMA bus width down if odd sizes are encountered, and back up again otherwise?

I don't know why, but according to drivers/dma/sh/rcar-dmac.c, we should not configure the channel while using it.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/dma/sh/rcar-dmac.c?h=v5.4#n1245

The comment has been described on the first commit. But, since other drivers don't mention such a limitation,
I think we can remove the comments somehow.

Best regards,
Yoshihiro Shimoda

> CU
> Uli