From: Jakub Kicinski <kuba@kernel.org>
To: Alex Elder <elder@linaro.org>
Cc: davem@davemloft.net, evgreen@chromium.org,
subashab@codeaurora.org, cpratapa@codeaurora.org,
bjorn.andersson@linaro.org, swboyd@chromium.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: ipa: command payloads already mapped
Date: Fri, 23 Oct 2020 18:30:47 -0700 [thread overview]
Message-ID: <20201023183047.42e315c1@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> (raw)
In-Reply-To: <20201022010029.11877-1-elder@linaro.org>
On Wed, 21 Oct 2020 20:00:29 -0500 Alex Elder wrote:
> IPA transactions describe actions to be performed by the IPA
> hardware. Three cases use IPA transactions: transmitting a socket
> buffer; providing a page to receive packet data; and issuing an IPA
> immediate command. An IPA transaction contains a scatter/gather
> list (SGL) to hold the set of actions to be performed.
>
> We map buffers in the SGL for DMA at the time they are added to the
> transaction. For skb TX transactions, we fill the SGL with a call
> to skb_to_sgvec(). Page RX transactions involve a single page
> pointer, and that is recorded in the SGL with sg_set_page(). In
> both of these cases we then map the SGL for DMA with a call to
> dma_map_sg().
>
> Immediate commands are different. The payload for an immediate
> command comes from a region of coherent DMA memory, which must
> *not* be mapped for DMA. For that reason, gsi_trans_cmd_add()
> sort of hand-crafts each SGL entry added to a command transaction.
>
> This patch fixes a problem with the code that crafts the SGL entry
> for an immediate command. Previously a portion of the SGL entry was
> updated using sg_set_buf(). However this is not valid because it
> includes a call to virt_to_page() on the buffer, but the command
> buffer pointer is not a linear address.
>
> Since we never actually map the SGL for command transactions, there
> are very few fields in the SGL we need to fill. Specifically, we
> only need to record the DMA address and the length, so they can be
> used by __gsi_trans_commit() to fill a TRE. We additionally need to
> preserve the SGL flags so for_each_sg() still works. For that we
> can simply assign a null page pointer for command SGL entries.
>
> Fixes: 9dd441e4ed575 ("soc: qcom: ipa: GSI transactions")
> Reported-by: Stephen Boyd <swboyd@chromium.org>
> Tested-by: Stephen Boyd <swboyd@chromium.org>
> Signed-off-by: Alex Elder <elder@linaro.org>
Applied, thanks!
prev parent reply other threads:[~2020-10-24 1:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-22 1:00 [PATCH net] net: ipa: command payloads already mapped Alex Elder
2020-10-24 1:30 ` Jakub Kicinski [this message]
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=20201023183047.42e315c1@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net \
--to=kuba@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=cpratapa@codeaurora.org \
--cc=davem@davemloft.net \
--cc=elder@linaro.org \
--cc=evgreen@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=subashab@codeaurora.org \
--cc=swboyd@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;
as well as URLs for NNTP newsgroup(s).