From: Arnd Bergmann <arnd@kernel.org>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Arnd Bergmann <arnd@arndb.de>,
Linus Walleij <linus.walleij@linaro.org>,
Marc Zyngier <maz@kernel.org>
Subject: Re: [PATCH 5/4] ARM: footbridge: remove custom DMA address handling
Date: Thu, 25 Aug 2022 19:17:22 +0200 [thread overview]
Message-ID: <CAK8P3a3xXQ7SbAsFAe637PkpL8_2NYstjOLj35D+QPyy-GzKGg@mail.gmail.com> (raw)
In-Reply-To: <YwdQjEJBUwGJB/YK@shell.armlinux.org.uk>
On Thu, Aug 25, 2022 at 12:35 PM Russell King (Oracle)
<linux@armlinux.org.uk> wrote:
>
> On Thu, Aug 25, 2022 at 11:17:52AM +0200, Arnd Bergmann wrote:
> > -/*
> > - * The footbridge is programmed to expose the system RAM at 0xe0000000.
> > - * The requirement is that the RAM isn't placed at bus address 0, which
> > - * would clash with VGA cards.
> > - */
> > -#define BUS_OFFSET 0xe0000000
> > -#define __virt_to_bus(x) ((x) + (BUS_OFFSET - PAGE_OFFSET))
> > -#define __bus_to_virt(x) ((x) - (BUS_OFFSET - PAGE_OFFSET))
>
> ... and this tells you why that is with ISA devices.
>
> So, one hell of a big NAK to this patch, sorry.
Thanks for taking a look. Apparently I misread the interface, and I assumed
that the __bus_to_virt() BUS_OFFSET in set_dma_addr() would
just cancel out the dma_map_single() in isa_enable_dma().
It turns out the logic is actually simpler and we just convert between
virtual address and bus address three times. for most drivers.
I found one driver (cs89x0-isa) that uses isa_virt_to_bus()/virt_to_phys()
instead of dma_map_single(), but that is probably never used here.
Once we move the DMA offset into the device, all other ISA devices will
also get the default zero-offset, but I think that will be fine as long as the
"isa_dma_dev" that is used for the final translation has the correct offset.
I'll try to come up with a new version tomorrow.
Arnd
next prev parent reply other threads:[~2022-08-25 17:17 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-18 21:15 [PATCH 0/4] ARM: footbridge: cleanups Arnd Bergmann
2022-08-18 21:15 ` [PATCH 1/4] ARM: footbridge: remove addin mode Arnd Bergmann
2022-08-21 5:53 ` Christoph Hellwig
2022-08-24 10:33 ` Arnd Bergmann
2022-08-25 9:17 ` [PATCH 5/4] ARM: footbridge: remove custom DMA address handling Arnd Bergmann
2022-08-25 10:34 ` Russell King (Oracle)
2022-08-25 10:35 ` Russell King (Oracle)
2022-08-25 17:17 ` Arnd Bergmann [this message]
2022-08-25 20:15 ` [PATCH v2 " Arnd Bergmann
2022-08-30 12:21 ` Robin Murphy
2022-08-18 21:15 ` [PATCH 2/4] ARM: footbridge: remove leftover from personal-server Arnd Bergmann
2022-08-21 5:55 ` Christoph Hellwig
2022-08-24 10:37 ` Arnd Bergmann
2022-08-24 10:47 ` Russell King (Oracle)
2022-08-18 21:15 ` [PATCH 3/4] ARM: footbridge: move isa-dma support into footbridge Arnd Bergmann
2022-08-21 5:56 ` Christoph Hellwig
2022-08-18 21:15 ` [PATCH 4/4] ARM: footbridge: limit CONFIG_ISA to CATS Arnd Bergmann
2022-09-04 11:43 ` [PATCH 0/4] ARM: footbridge: cleanups Marc Zyngier
2022-09-04 12:09 ` Russell King (Oracle)
2022-09-04 16:10 ` Marc Zyngier
2022-09-04 21:47 ` Arnd Bergmann
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=CAK8P3a3xXQ7SbAsFAe637PkpL8_2NYstjOLj35D+QPyy-GzKGg@mail.gmail.com \
--to=arnd@kernel.org \
--cc=arnd@arndb.de \
--cc=hch@lst.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=maz@kernel.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).