From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Furquan Shaikh <furquan@google.com>
Cc: linux-kernel@vger.kernel.org,
Prashant Malani <pmalani@chromium.org>,
Arthur Heymans <arthur@aheymans.xyz>,
Patrick Rudolph <patrick.rudolph@9elements.com>,
Ard Biesheuvel <ardb@kernel.org>,
dlaurie@google.com
Subject: Re: [PATCH] firmware: gsmi: Drop the use of dma_pool_* API functions
Date: Wed, 21 Oct 2020 07:19:31 +0200 [thread overview]
Message-ID: <20201021051931.GA967331@kroah.com> (raw)
In-Reply-To: <20201021050141.377787-1-furquan@google.com>
On Tue, Oct 20, 2020 at 10:01:41PM -0700, Furquan Shaikh wrote:
> GSMI driver uses dma_pool_* API functions for buffer allocation
> because it requires that the SMI buffers are allocated within 32-bit
> physical address space. However, this does not work well with IOMMU
> since there is no real device and hence no domain associated with the
> device.
>
> Since this is not a real device, it does not require any device
> address(IOVA) for the buffer allocations. The only requirement is to
> ensure that the physical address allocated to the buffer is within
> 32-bit physical address space. This change allocates a page using
> `get_zeroed_page()` and passes in GFP_DMA32 flag to ensure that the
> page allocation is done in the DMA32 zone. All the buffer allocation
> requests for gsmi_buf are then satisfed using this pre-allocated page
> for the device.
Are you sure that "GFP_DMA32" really does what you think it does? A
"normal" call with GFP_KERNEL" will give you memory that is properly
dma-able.
We should not be adding new GFP_DMA* users in the kernel in these days,
just call dma_alloc*() and you should be fine.
thanks,
greg k-h
next prev parent reply other threads:[~2020-10-21 5:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-21 5:01 [PATCH] firmware: gsmi: Drop the use of dma_pool_* API functions Furquan Shaikh
2020-10-21 5:19 ` Greg Kroah-Hartman [this message]
2020-10-21 6:37 ` Ard Biesheuvel
2020-10-21 7:37 ` Furquan Shaikh
2020-10-21 8:52 ` Greg Kroah-Hartman
2020-10-21 9:36 ` Ard Biesheuvel
2020-10-21 21:46 ` Furquan Shaikh
2020-10-22 4:38 ` [PATCH v2] " Furquan Shaikh
2020-10-22 7:02 ` Ard Biesheuvel
2020-10-22 7:15 ` [PATCH v3] " Furquan Shaikh
2020-10-21 7:52 ` [PATCH] " kernel test robot
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=20201021051931.GA967331@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=ardb@kernel.org \
--cc=arthur@aheymans.xyz \
--cc=dlaurie@google.com \
--cc=furquan@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patrick.rudolph@9elements.com \
--cc=pmalani@chromium.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