From: Peter Geis <pgwipeout@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Shawn Lin <shawn.lin@rock-chips.com>,
Simon Xue <xxm@rock-chips.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
linux-pci@vger.kernel.org,
"open list:ARM/Rockchip SoC..."
<linux-rockchip@lists.infradead.org>,
devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
Johan Jonker <jbx6244@gmail.com>,
Heiko Stuebner <heiko@sntech.de>
Subject: Re: [PATCH v7] PCI: rockchip: Add Rockchip RK356X host controller driver
Date: Thu, 29 Apr 2021 08:16:48 -0400 [thread overview]
Message-ID: <CAMdYzYobyyROToMXng25NQEgSC7OpYLmo=iM9eDuPbSfkKuKgA@mail.gmail.com> (raw)
In-Reply-To: <20210429115451.GA2287423@infradead.org>
On Thu, Apr 29, 2021 at 7:55 AM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Thu, Apr 29, 2021 at 07:26:40AM -0400, Peter Geis wrote:
> > Good Morning! I'm trying to implement the MSI workaround in as sane a
> > method as possible.
> > Do you have a better way to have the kernel only allocate memory in
> > the lower regions?
> > (Without disabling everything above 4G altogether)
> > This chip only supports a maximum of 8G.
> > (I know, why they did it while maintaining a 32bit bus is beyond me).
>
>
> Please use dma_alloc_coherent to allocate the memory, the dma_addr_t
> return value is the address to be fed to the hardware. Before doing
> that set the desired mask. DMA_BIT_MASK(33) would get your 8GB.
Thanks!
Unfortunately this isn't actually DMA allocation, they were using
GFP_DMA32 as a hack to allocate regular kernel memory in the 32 bit
range.
It's in drivers/irqchip/irq-gic-v3-its.c for reference.
The functions are simply kcalloc(), kzalloc(), kzalloc_node(),
alloc_pages_node(), and alloc_pages().
I'd prefer not to have to rewrite this driver's entire memory
allocation system for one errata.
I'm following the code path for dma_alloc_coherent to see if anything
sticks out to me though.
next prev parent reply other threads:[~2021-04-29 12:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-14 7:03 [PATCH v7] PCI: rockchip: Add Rockchip RK356X host controller driver Simon Xue
2021-04-28 16:20 ` Peter Geis
[not found] ` <5af0f6f8-bc29-f50e-ca14-94049b7d17ed@rock-chips.com>
2021-04-29 1:42 ` Peter Geis
2021-04-29 6:41 ` Christoph Hellwig
[not found] ` <CAMdYzYrbfD-jFC3uPVPkhjXWZGeaUw5X=0w1Q=m-6OuhEGOKkQ@mail.gmail.com>
[not found] ` <20210429115451.GA2287423@infradead.org>
2021-04-29 12:16 ` Peter Geis [this message]
[not found] ` <3bf6f7ba-d5cb-4857-5fa8-bc4fa0b7e5f6@rock-chips.com>
2021-04-29 11:21 ` Peter Geis
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='CAMdYzYobyyROToMXng25NQEgSC7OpYLmo=iM9eDuPbSfkKuKgA@mail.gmail.com' \
--to=pgwipeout@gmail.com \
--cc=bhelgaas@google.com \
--cc=devicetree@vger.kernel.org \
--cc=hch@infradead.org \
--cc=heiko@sntech.de \
--cc=jbx6244@gmail.com \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=robh+dt@kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=xxm@rock-chips.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).