RE: mainline 4.14-rc4: renesas_sdhi_internal_dmac ee100000.sd: swiotlb buffer is full?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Linus-san,

> From: Linus Walleij, Sent: Monday, October 16, 2017 9:22 PM
> 
> On Mon, Oct 16, 2017 at 2:07 PM, Geert Uytterhoeven
> <geert@xxxxxxxxxxxxxx> wrote:
> > On Mon, Oct 16, 2017 at 1:41 PM, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
> >> On Mon, Oct 16, 2017 at 11:02 AM, Geert Uytterhoeven
> >> <geert@xxxxxxxxxxxxxx> wrote:
> >>>> IIUC,
> >>>> - Since the MMC_BOUNCE disappeared in v4.14-rc1, the MMC core will request a command with 64kbyte+ size.
> >>>>  - So, swiotlb will got request 64kbyte+ size. This is different with previous version.
> >>
> >> Other people reported problems with that. Sorry about this...
> >>
> >> This problem should be solved by upstream
> >> commit de3ee99b097dd51938276e3af388cd4ad0f2750a
> >> "mmc: Delete bounce buffer handling"
> >>
> >> I just killed off the bounce buffers so they can't hurt anyone anymore.
> >>
> >> Can you check that you have this patch in your tree?
> >
> > Given Dirk saw the issue with v4.14-rc4, I'm afraid that patch is already
> > included :-(
> 
> So the first issue is definately gone.
> 
> Then it seems the driver is specifying to high ->max_seg_size
> since the buffer cannot be mapped?
> 
> Unless you're using ADMA drivers/mmc/host/sdhci.c sets it as:
> mmc->max_seg_size = mmc->max_req_size;

Thank you for the comment!
On R-Car Gen3, it's using drivers/mmc/host/renesas_sdhi_internal_dmac.c,
and sets the max_seg_size to very big size (0xffffffff * 512) now...

So, I modified the value to 262144 and rebase the kernel to v4.14-rc5
(-rc4 seems have other issue in block driver.), the "swiotlb buffer is full" issue disappeared.

> And:
> mmc->max_req_size = 524288;
> 
> >> renesas_sdhi_internal_dmac ee100000.sd: swiotlb_tbl_map_single: test:
> >> size modified to 524288 bytes
> >> renesas_sdhi_internal_dmac ee100000.sd: swiotlb buffer is full (sz:
> >> 524288 bytes)
> 
> So if your driver cannot handle 524288 bytes, why is it saying it can
> handle 524288 bytes?

I think the "swiotlb buffer is full" came from lib/swiotlb.c.
I'm not sure the detail of swiotlb.c, but IIUC, it has a memory size limitation.

- In lib/swiotlb.c, it calculates nslots.
 - The size of one slot is 2048 bytes because IO_TLB_SHIFT in include/linux/swiotlb.h is set to 11.
- IO_TLB_SEGSIZE is set to 128 in include/linux/swiotlb.h.
 - This value is number of maximum slots.
  - So, maximum size for a single map of swiotlb is 256kbytes (2048 * 128).

So, I will submit a patch to set the max_req_size to 256kbytes today.

Best regards,
Yoshihiro Shimoda





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux