From: Robin Murphy <robin.murphy@arm.com>
To: Frank Wunderlich <frank-w@public-files.de>,
linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
Marek Szyprowski <m.szyprowski@samsung.com>,
Christoph Hellwig <hch@lst.de>
Subject: Re: helping with remapping vmem for dma
Date: Wed, 15 Jun 2022 14:15:33 +0100 [thread overview]
Message-ID: <6e58b50c-cd05-a37b-07e1-10ee24fb972f@arm.com> (raw)
In-Reply-To: <trinity-685a668a-2395-45f2-81e5-53f526863a66-1655295061671@3c-app-gmx-bap28>
On 2022-06-15 13:11, Frank Wunderlich wrote:
> Hi,
>
> i have upported a wifi-driver (mt6625l for armhf) for some time and fall now (at least 5.18) in the
> "rejecting DMA map of vmalloc memory" error [1].
>
> maybe anybody here can guide me on how to nail it down and maybe fix it.
>
> as far as i have debugged it, it uses dma_map_single [2] to get dma memory from a previous
> allocated memory region.
>
> this function "kalDevPortRead" in [2] is used via macro HAL_PORT_RD [3] (used in HAL_READ_RX_PORT
> and HAL_READ_INTR_STATUS in same hal.h file)
>
> HAL_READ_INTR_STATUS is always called with an empty int array as buf which i guess is not the problem.
> I think the issue is using the use with an preallocated prSDIOCtrl struct (have not completely traced
> it back where it is allocated).
Put simply, if you want to call dma_map_single() on a buffer, then that
buffer needs to be allocated with kmalloc() (or technically
alloc_pages(), but then dma_map_page() would make more sense when
dealing with entire pages.
Robin.
> calls of HAL_PORT_RD/HAL_READ_RX_PORT are in nic{,_rx}.c (with sdio-struct) ([4] as example)
>
> maybe there is a simple way to get an address in preallocated memory as replacement for the dma_map_simple call (and the unmap of course).
>
> regards Frank
>
> [1] https://elixir.bootlin.com/linux/latest/source/include/linux/dma-mapping.h#L327
> [2] https://github.com/frank-w/BPI-R2-4.14/blob/5.18-main/drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/hif/ahb/ahb.c#L940
> [3] https://github.com/frank-w/BPI-R2-4.14/blob/5.18-main/drivers/misc/mediatek/connectivity/wlan/gen2/include/nic/hal.h#L176
> [4] https://github.com/frank-w/BPI-R2-4.14/blob/5.18-main/drivers/misc/mediatek/connectivity/wlan/gen2/nic/nic_rx.c#L3604
next prev parent reply other threads:[~2022-06-15 13:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-15 12:11 Frank Wunderlich
2022-06-15 13:15 ` Robin Murphy [this message]
2022-06-15 13:17 ` Christoph Hellwig
2022-06-15 14:46 ` Frank Wunderlich
2022-06-17 16:17 Frank Wunderlich
2022-06-17 17:22 ` Robin Murphy
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=6e58b50c-cd05-a37b-07e1-10ee24fb972f@arm.com \
--to=robin.murphy@arm.com \
--cc=frank-w@public-files.de \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.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
all inboxes | Powered by JetHome®