From: Janne Grunau <j@jannau.net>
To: Sughosh Ganu <sughosh.ganu@linaro.org>
Cc: u-boot@lists.denx.de, Mark Kettenis <kettenis@openbsd.org>,
Tom Rini <trini@konsulko.com>
Subject: Re: [RFC PATCH 2/2] apple: dart: use driver specific instance of LMB
Date: Wed, 30 Oct 2024 09:54:56 +0100 [thread overview]
Message-ID: <ZyH0YCUFWdcZV_Hd@robin> (raw)
In-Reply-To: <CADg8p94Kc13KHdZxJ1-rhkSWzOY=QBDfPsSnQdQzmLpcfzy+VA@mail.gmail.com>
On Tue, Oct 29, 2024 at 02:22:53PM +0530, Sughosh Ganu wrote:
> On Tue, 29 Oct 2024 at 14:02, Janne Grunau <j@jannau.net> wrote:
> >
> > On Tue, Oct 29, 2024 at 12:48:46PM +0530, Sughosh Ganu wrote:
> > > The LMB module is typically used for managing the platform's RAM
> > > memory. RAM memory gets added to the module's memory map, and
> > > subsequently allocated through various LMB API's.
> > >
> > > The IOMMU driver for the apple platforms also uses the LMB API's for
> > > allocating device virtual addresses(VA). These addresses are different
> > > from the RAM addresses, and cannot be added to the RAM memory map. Add
> > > a separate instance of LMB memory map for the device VA's, which gets
> > > managed by the IOMMU driver. Use lmb_push() and lmb_pop() functions to
> > > set-up the relevant lmb instance.
> >
> > thanks, this fixes the initial brokenness when setting up dma mappings
> > but I still see SError due to translation fault. I don't have time right
> > now to look into it so it could be unrelated to the iommu.
>
> Good to know. Thanks for testing the changes.
It's SError-ing on `dc zva` of an invalid address which somehow got into
the main lmb. I don't see how but it went away with my minimal io_lmb
implemenmtation exposing lmb_setup, lmb_add, lmb_alloc, lmb_free.
I'm not too happy about this approach since it's a little fragile with
respect to the global struct lmb. to be somewhat safe we would need to
reorder lmb.c to avoid `static struct lmb lmb;` is visible in "shared"
code to avoid using it by surprise in the middle of functions like in
_lmb_alloc_base().
I'll post patches later today.
Janne
prev parent reply other threads:[~2024-10-30 8:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-29 7:18 [RFC PATCH 0/2] apple: dart: Add driver specific instance of LMB Sughosh Ganu
2024-10-29 7:18 ` [RFC PATCH 1/2] lmb: refactor lmb push and pop functions Sughosh Ganu
2024-10-29 7:18 ` [RFC PATCH 2/2] apple: dart: use driver specific instance of LMB Sughosh Ganu
2024-10-29 8:32 ` Janne Grunau
2024-10-29 8:52 ` Sughosh Ganu
2024-10-30 8:54 ` Janne Grunau [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=ZyH0YCUFWdcZV_Hd@robin \
--to=j@jannau.net \
--cc=kettenis@openbsd.org \
--cc=sughosh.ganu@linaro.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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