From: Konrad Rzeszutek Wilk <konrad-Gq0aWv8utHQdnm+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
Subject: Re: [PATCH 1/2] mmc: renesas_sdhi: fix swiotlb buffer is full
Date: Wed, 18 Oct 2017 20:24:14 -0400 [thread overview]
Message-ID: <20171019002412.GA14493@localhost.localdomain> (raw)
In-Reply-To: <CAMuHMdXyY-gvQGn2UxhUDsdhdWUMmTA80z73PF14otvcKuTMaw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Tue, Oct 17, 2017 at 10:02:50AM +0200, Geert Uytterhoeven wrote:
> Hi Shimoda-san,
>
> CC iommu
>
> On Tue, Oct 17, 2017 at 9:30 AM, Yoshihiro Shimoda
> <yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> wrote:
> > Since the commit de3ee99b097d ("mmc: Delete bounce buffer handling")
> > deletes the bounce buffer handling, a request data size will be referred
> > to max_{req,seg}_size instead of MMC_QUEUE_BOUNCESZ (64k bytes).
> >
> > In other hand, renesas_sdhi_internal_dmac.c will set very big value of
> > max_{req,seg}_size because the max_blk_count is set to 0xffffffff.
> > And then, "swiotlb buffer is full" happens because swiotlb can handle
> > a memory size up to 256k bytes only (IO_TLB_SEGSIZE = 128 and
> > IO_TLB_SHIFT = 11).
> >
> > So, this patch fixes the issue to set max_blk_count to 512. Then,
> > the max_{req,seg}_size will be set to 256k bytes.
> >
> > Reported-by: Dirk Behme <dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
>
> Thanks for your patch!
>
> > ---
> > drivers/mmc/host/renesas_sdhi_internal_dmac.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> > index f905f23..6c9b4b2 100644
> > --- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> > +++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> > @@ -80,8 +80,9 @@
> > .scc_offset = 0x1000,
> > .taps = rcar_gen3_scc_taps,
> > .taps_num = ARRAY_SIZE(rcar_gen3_scc_taps),
> > - /* Gen3 SDHI DMAC can handle 0xffffffff blk count, but seg = 1 */
> > - .max_blk_count = 0xffffffff,
> > + /* The swiotlb can handle memory size up to 256 kbytes for now. */
> > + .max_blk_count = 512,
>
> Fixing this in the individual drivers feels like the wrong solution to me.
>
> iommu: Is there a better (generic) way to handle this?
Yes. See 7453c549f5f6485c0d79cad7844870dcc7d1b34d, aka swiotlb_max_segment
WARNING: multiple messages have this Message-ID (diff)
From: Konrad Rzeszutek Wilk <konrad@darnok.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Linux MMC List <linux-mmc@vger.kernel.org>,
iommu@lists.linux-foundation.org
Subject: Re: [PATCH 1/2] mmc: renesas_sdhi: fix swiotlb buffer is full
Date: Wed, 18 Oct 2017 20:24:14 -0400 [thread overview]
Message-ID: <20171019002412.GA14493@localhost.localdomain> (raw)
In-Reply-To: <CAMuHMdXyY-gvQGn2UxhUDsdhdWUMmTA80z73PF14otvcKuTMaw@mail.gmail.com>
On Tue, Oct 17, 2017 at 10:02:50AM +0200, Geert Uytterhoeven wrote:
> Hi Shimoda-san,
>
> CC iommu
>
> On Tue, Oct 17, 2017 at 9:30 AM, Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@renesas.com> wrote:
> > Since the commit de3ee99b097d ("mmc: Delete bounce buffer handling")
> > deletes the bounce buffer handling, a request data size will be referred
> > to max_{req,seg}_size instead of MMC_QUEUE_BOUNCESZ (64k bytes).
> >
> > In other hand, renesas_sdhi_internal_dmac.c will set very big value of
> > max_{req,seg}_size because the max_blk_count is set to 0xffffffff.
> > And then, "swiotlb buffer is full" happens because swiotlb can handle
> > a memory size up to 256k bytes only (IO_TLB_SEGSIZE = 128 and
> > IO_TLB_SHIFT = 11).
> >
> > So, this patch fixes the issue to set max_blk_count to 512. Then,
> > the max_{req,seg}_size will be set to 256k bytes.
> >
> > Reported-by: Dirk Behme <dirk.behme@de.bosch.com>
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
>
> Thanks for your patch!
>
> > ---
> > drivers/mmc/host/renesas_sdhi_internal_dmac.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> > index f905f23..6c9b4b2 100644
> > --- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> > +++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> > @@ -80,8 +80,9 @@
> > .scc_offset = 0x1000,
> > .taps = rcar_gen3_scc_taps,
> > .taps_num = ARRAY_SIZE(rcar_gen3_scc_taps),
> > - /* Gen3 SDHI DMAC can handle 0xffffffff blk count, but seg = 1 */
> > - .max_blk_count = 0xffffffff,
> > + /* The swiotlb can handle memory size up to 256 kbytes for now. */
> > + .max_blk_count = 512,
>
> Fixing this in the individual drivers feels like the wrong solution to me.
>
> iommu: Is there a better (generic) way to handle this?
Yes. See 7453c549f5f6485c0d79cad7844870dcc7d1b34d, aka swiotlb_max_segment
next prev parent reply other threads:[~2017-10-19 0:24 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-17 7:30 [PATCH 0/2] mmc: renesas_sdhi: bugfixes for v4.14 Yoshihiro Shimoda
2017-10-17 7:30 ` [PATCH 1/2] mmc: renesas_sdhi: fix swiotlb buffer is full Yoshihiro Shimoda
[not found] ` <1508225421-25405-2-git-send-email-yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2017-10-17 8:02 ` Geert Uytterhoeven
2017-10-17 8:02 ` Geert Uytterhoeven
[not found] ` <CAMuHMdXyY-gvQGn2UxhUDsdhdWUMmTA80z73PF14otvcKuTMaw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-19 0:24 ` Konrad Rzeszutek Wilk [this message]
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 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-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
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
2017-11-03 14:17 ` Konrad Rzeszutek Wilk
2017-10-17 7:30 ` [PATCH 2/2] mmc: renesas_sdhi: fix kernel panic in _internal_dmac.c Yoshihiro Shimoda
2017-10-17 8:11 ` Geert Uytterhoeven
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=20171019002412.GA14493@localhost.localdomain \
--to=konrad-gq0awv8uthqdnm+yrofe0a@public.gmane.org \
--cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.