From: Kalle Valo <kvalo@kernel.org>
To: Benjamin Berg <benjamin@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, benjamin.berg@intel.com,
miriam.rachel.korenblit@intel.com, regressions@lists.linux.dev,
johannes@sipsolutions.net,
Chris Bainbridge <chris.bainbridge@gmail.com>,
Ben Greear <greearb@candelatech.com>
Subject: Re: [PATCH] wifi: iwlwifi: correctly lookup DMA address in SG table
Date: Thu, 08 Aug 2024 21:39:13 +0300 [thread overview]
Message-ID: <87jzgq3lm6.fsf@kernel.org> (raw)
In-Reply-To: <20240808172948.303258-1-benjamin@sipsolutions.net> (Benjamin Berg's message of "Thu, 8 Aug 2024 19:29:48 +0200")
Benjamin Berg <benjamin@sipsolutions.net> writes:
> From: Benjamin Berg <benjamin.berg@intel.com>
>
> The code to lookup the scatter gather table entry assumed that it was
> possible to use sg_virt() in order to lookup the DMA address in a mapped
> scatter gather table. However, this assumption is incorrect as the DMA
> mapping code may merge multiple entries into one. In that case, the DMA
> address space may have e.g. two consecutive pages which is correctly
> represented by the scatter gather list entry, however the virtual
> addresses for these two pages may differ and the relationship cannot be
> resolved anymore.
>
> Avoid this problem entirely by working with the offset into the mapped
> area instead of using virtual addresses. With that we only use the DMA
> length and DMA address from the scatter gather list entries. The
> underlying DMA/IOMMU code is therefore free to merge two entries into
> one even if the virtual addresses space for the area is not continuous.
>
> Fixes: 90db50755228 ("wifi: iwlwifi: use already mapped data when TXing an AMSDU")
> Reported-by: Chris Bainbridge <chris.bainbridge@gmail.com>
> Closes: https://lore.kernel.org/r/ZrNRoEbdkxkKFMBi@debian.local
> Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reminder to myself: if this passes the tests it should go to wireless
tree. Assigned the patch to me on patchwork.
Miri, if you agree please give an Acked-by.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2024-08-08 18:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 17:29 [PATCH] wifi: iwlwifi: correctly lookup DMA address in SG table Benjamin Berg
2024-08-08 17:36 ` Ben Greear
2024-08-09 18:03 ` Rory Little
2024-08-08 18:39 ` Kalle Valo [this message]
2024-08-08 20:33 ` Chris Bainbridge
2024-08-12 11:30 ` Kalle Valo
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=87jzgq3lm6.fsf@kernel.org \
--to=kvalo@kernel.org \
--cc=benjamin.berg@intel.com \
--cc=benjamin@sipsolutions.net \
--cc=chris.bainbridge@gmail.com \
--cc=greearb@candelatech.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=miriam.rachel.korenblit@intel.com \
--cc=regressions@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.