iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Cc: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Linux MMC List
	<linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux-Renesas
	<linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Wolfram Sang
	<wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>,
	"iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	Konrad Rzeszutek Wilk
	<konrad-Gq0aWv8utHQdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH 1/2] mmc: renesas_sdhi: fix swiotlb buffer is full
Date: Fri, 3 Nov 2017 10:17:50 -0400	[thread overview]
Message-ID: <20171103141750.GB19352@x230.dumpdata.com> (raw)
In-Reply-To: <CAMuHMdWxWu-6Hi+4P2GhEyjfu=mhbNUUOoBUC7JrsL=ki35c5w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Fri, Nov 03, 2017 at 03:01:12PM +0100, Geert Uytterhoeven wrote:
> Hi Konrad,
> 
> On Fri, Nov 3, 2017 at 2:23 PM, Konrad Rzeszutek Wilk <konrad-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> > ..snip..
> >> > >
> >> > > Anyway, I made v2 patches by using swiotlb related definitions. Would you check it?
> >> >
> >> > Did I miss that email? As in was I cc-ed?
> >>
> >> This was my fault. When I submitted v2 patches, I didn't include your email and iommu mailing list...
> >
> > No problem.
> >>
> >> > > https://patchwork.kernel.org/patch/10018879/
> >> >
> >> > Why not use IO_TLB_SEGSIZE << IO_TLB_SHIFT or alternatively
> >> > swiotlb_max_segment?  See 5584f1b1d73e9
> >>
> >> I already made such a patch as v2 and it was merged into mmc.git / fixes branch.
> >>
> >> https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git/commit/?h=fixes&id=e90e8da72ad694a16a4ffa6e5adae3610208f73b
> >
> > What happens if the user has swiotlb=4096 on the command line (meaning
> > less than the default value)? Your max value will be incorrect. Could you use
> > swiotlb_max_segment?
> 
> No, as that's the total size of the swiotlb buffer, not the maximum size of
> a single segment.


Aaah, then you are all fine! Thanks for the quote!
> 
> Quoting an earlier part of the thread:
> 
> On Thu, Oct 19, 2017 at 1:39 PM, Yoshihiro Shimoda
> <yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> wrote:
> >> >> iommu: Is there a better (generic) way to handle this?
> >> >
> >> > Yes. See 7453c549f5f6485c0d79cad7844870dcc7d1b34d, aka swiotlb_max_segment
> >>
> >> Thanks for the pointer!
> >>
> >> While I agree this can be used to avoid the swiotlb buffer full issue,
> >> I believe it is a suboptimal solution if the device actually uses an IOMMU.
> >> It limits the mapping size if CONFIG_SWIOTLB=y, which is always the
> >> case for arm/arm64 these days.
> >
> > I'm afraid but I misunderstood this API's spec when I read it at first.
> > After I tried to use it, I found the API cannot be used for a workaround because
> > this API returns total size of swiotlb.
> >
> > For example:
> >  - The swiotlb_max_segment() returns 64M bytes from the API when a default setting.
> >   - In this case, the maximum size per a map is 256k bytes.
> >  - The swiotlb_max_segment() returns 128M bytes from the API when I added swiotlb=65536
> >    into the kernel parameter on arm64.
> >   - In this case, the maximum size per a map is still 256k bytes because
> >     the swiotlb has hardcoded the size by the following code:
> >      https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/swiotlb.c?h=v4.14-rc5#n254
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

      parent reply	other threads:[~2017-11-03 14:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1508225421-25405-1-git-send-email-yoshihiro.shimoda.uh@renesas.com>
     [not found] ` <1508225421-25405-2-git-send-email-yoshihiro.shimoda.uh@renesas.com>
     [not found]   ` <1508225421-25405-2-git-send-email-yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2017-10-17  8:02     ` [PATCH 1/2] mmc: renesas_sdhi: fix swiotlb buffer is full Geert Uytterhoeven
     [not found]       ` <CAMuHMdXyY-gvQGn2UxhUDsdhdWUMmTA80z73PF14otvcKuTMaw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-19  0:24         ` Konrad Rzeszutek Wilk
     [not found]           ` <20171019002412.GA14493-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2017-10-19  8:34             ` Geert Uytterhoeven
2017-10-19 11:39               ` Yoshihiro Shimoda
2017-10-20  3:18                 ` Yoshihiro Shimoda
2017-11-01 13:26                   ` Konrad Rzeszutek Wilk
     [not found]                     ` <20171101132639.GA24821-sHAKZZqAc8NKMcnDSFYBzAC/G2K4zDHf@public.gmane.org>
2017-11-02  4:10                       ` Yoshihiro Shimoda
2017-11-03 13:23                         ` Konrad Rzeszutek Wilk
     [not found]                           ` <20171103132322.GA19352-sHAKZZqAc8NKMcnDSFYBzAC/G2K4zDHf@public.gmane.org>
2017-11-03 14:01                             ` Geert Uytterhoeven
     [not found]                               ` <CAMuHMdWxWu-6Hi+4P2GhEyjfu=mhbNUUOoBUC7JrsL=ki35c5w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-03 14:17                                 ` Konrad Rzeszutek Wilk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171103141750.GB19352@x230.dumpdata.com \
    --to=konrad-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=konrad-Gq0aWv8utHQdnm+yROfE0A@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).