From: Michael Zoran <mzoran@crowfest.net>
To: Robin Murphy <robin.murphy@arm.com>, Arnd Bergmann <arnd@arndb.de>
Cc: Will Deacon <will.deacon@arm.com>,
catalin.marinas@arm.com, Jisheng Zhang <jszhang@marvell.com>,
konrad.wilk@oracle.com, aaro.koskinen@iki.fi,
stable@vger.kernel.org, linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: dma-mapping: Fix dma_mapping_error() when bypassing SWIOTLB
Date: Wed, 25 Jan 2017 05:35:17 -0800 [thread overview]
Message-ID: <1485351317.2306.7.camel@crowfest.net> (raw)
In-Reply-To: <81482ad2-331a-df33-66a2-f5fedc0bd7bb@arm.com>
On Wed, 2017-01-25 at 12:54 +0000, Robin Murphy wrote:
> On 25/01/17 12:51, Arnd Bergmann wrote:
> > On Wed, Jan 25, 2017 at 1:37 PM, Michael Zoran <mzoran@crowfest.net
> > > wrote:
> > > On Wed, 2017-01-25 at 12:03 +0000, Robin Murphy wrote:
> > > > hen bypassing SWIOTLB on small-memory systems, we need to avoid
> > > > calling
> > > > into swiotlb_dma_mapping_error() in exactly the same way as we
> > > > avoid
> > > > swiotlb_dma_supported(), because the former also relies on
> > > > SWIOTLB
> > > > state
> > > > being initialised.
> > >
> > > I didn't submit the initial ARM64 port of the RPI 3, so I don't
> > > know
> > > much about this. But from a third personal point of view, this
> > > seems
> > > to side step the main issue here.
> >
> > I think Robin's approach is fixing exactly the right part of the
> > code.
> >
> > > From an ARM64 subsystem point of view, what exactly is the
> > > correct/recommended method for ensuring the mm subsystem is
> > > initialized
> > > correctly?
> >
> > It is initialized correctly, the bug was calling the wrong helper
> > when swiotlb
> > is not used because we determined that we don't need it.
> >
> > One concern from inspection:
> >
> > > +static int __swiotlb_dma_mapping_error(struct device *hwdev,
> > > dma_addr_t addr)
> > > +{
> > > + if (swiotlb)
> > > + return swiotlb_dma_mapping_error(hwdev, addr);
> > > + return 1;
> > > +}
> >
> > Shouldn't that be
> >
> > return addr == DMA_ERROR_CODE;
> >
> > in the last line? Otherwise any addr is interpreted as an error,
> > which
> > seems wrong. Maybe I'm missing something obvious here.
>
> Aw crap, copy/paste/brain error - thanks.
>
> I'll have a nice strong cup of tea, actually engage thinking mode,
> and
> respin...
>
> Robin.
>
> >
> > Arnd
> >
I have an RPI 3 that I run in ARM64 mode all the time for personal use.
If/when you have a patch ready, I'm more then willing to try it out
locally.
Just tell me the path of the git tree and branch that it's based on.
Thanks.
next prev parent reply other threads:[~2017-01-25 13:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170124225200.a7qioswpxzh6agvd@raspberrypi-2.musicnaut.iki.fi>
2017-01-25 12:03 ` [PATCH] arm64: dma-mapping: Fix dma_mapping_error() when bypassing SWIOTLB Robin Murphy
2017-01-25 12:37 ` Michael Zoran
2017-01-25 12:46 ` Robin Murphy
2017-01-25 12:51 ` Arnd Bergmann
2017-01-25 12:54 ` Robin Murphy
2017-01-25 13:35 ` Michael Zoran [this message]
2017-01-25 18:31 ` [PATCH v2] " Robin Murphy
2017-01-25 19:14 ` Robin Murphy
2017-01-25 19:31 ` Michael Zoran
2017-01-25 21:49 ` Aaro Koskinen
2017-01-26 12:52 ` Will Deacon
2017-01-26 13:04 ` Michael Zoran
2017-01-26 15:20 ` Robin Murphy
2017-01-26 20:35 ` Aaro Koskinen
2017-01-27 9:53 ` Will Deacon
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=1485351317.2306.7.camel@crowfest.net \
--to=mzoran@crowfest.net \
--cc=aaro.koskinen@iki.fi \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=jszhang@marvell.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=robin.murphy@arm.com \
--cc=stable@vger.kernel.org \
--cc=will.deacon@arm.com \
/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).