OpenCloudOS-Kernel/drivers/net/ipa
Alex Elder df833050cc net: ipa: command payloads already mapped
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: 9dd441e4ed ("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>
Link: https://lore.kernel.org/r/20201022010029.11877-1-elder@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-10-23 18:28:52 -07:00
..
Kconfig remoteproc: clean up notification config 2020-03-16 17:31:51 -07:00
Makefile soc: qcom: ipa: support build of IPA code 2020-03-08 22:07:10 -07:00
gsi.c net: ipa: fix two mild warnings 2020-09-28 18:34:56 -07:00
gsi.h net: ipa: do not enable GSI interrupt for wakeup 2020-09-18 17:47:07 -07:00
gsi_private.h net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
gsi_reg.h net: ipa: share field mask values for GSI general interrupt 2020-09-28 18:34:56 -07:00
gsi_trans.c net: ipa: command payloads already mapped 2020-10-23 18:28:52 -07:00
gsi_trans.h net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
ipa.h net: ipa: repurpose CLOCK_HELD flag 2020-09-18 17:47:07 -07:00
ipa_clock.c net: ipa: manage endpoints separate from clock 2020-09-18 17:47:07 -07:00
ipa_clock.h net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
ipa_cmd.c net: ipa: introduce ipa_cmd_tag_process() 2020-06-30 13:10:57 -07:00
ipa_cmd.h net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
ipa_data-sc7180.c net: ipa: fix modem LAN RX endpoint id 2020-06-11 18:39:08 -07:00
ipa_data-sdm845.c net: ipa: no checksum offload for SDM845 LAN RX 2020-06-30 13:10:57 -07:00
ipa_data.h net: ipa: remove endpoint delay mode feature 2020-05-06 17:37:54 -07:00
ipa_endpoint.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-15 12:43:21 -07:00
ipa_endpoint.h drivers: ipa: remove discription of nonexistent element 2020-05-27 14:58:28 -07:00
ipa_gsi.c net: ipa: include declarations in "ipa_gsi.c" 2020-07-07 12:43:18 -07:00
ipa_gsi.h net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
ipa_interrupt.c net: ipa: enable wakeup on IPA interrupt 2020-09-18 17:47:07 -07:00
ipa_interrupt.h net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
ipa_main.c net: ipa: rename a phandle variable 2020-09-28 18:34:56 -07:00
ipa_mem.c net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
ipa_mem.h net: ipa: redefine struct ipa_mem_data 2020-05-04 11:26:55 -07:00
ipa_modem.c net: ipa: new notification infrastructure 2020-07-28 17:10:47 -07:00
ipa_modem.h soc: qcom: ipa: modem and microcontroller 2020-03-08 22:07:10 -07:00
ipa_qmi.c soc: qcom: ipa: AP/modem communications 2020-03-08 22:07:10 -07:00
ipa_qmi.h soc: qcom: ipa: AP/modem communications 2020-03-08 22:07:10 -07:00
ipa_qmi_msg.c net: ipa: fix QMI structure definition bugs 2020-07-07 12:43:18 -07:00
ipa_qmi_msg.h soc: qcom: ipa: AP/modem communications 2020-03-08 22:07:10 -07:00
ipa_reg.c
ipa_reg.h net: ipa: fix two comments 2020-09-28 18:34:56 -07:00
ipa_smp2p.c drivers: ipa: fix typos for ipa_smp2p structure doc 2020-05-14 13:06:55 -07:00
ipa_smp2p.h net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
ipa_table.c net: ipa: fix u32_replace_bits by u32p_xxx version 2020-09-11 17:28:48 -07:00
ipa_table.h net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
ipa_uc.c net: ipa: fix two comments 2020-09-28 18:34:56 -07:00
ipa_uc.h soc: qcom: ipa: modem and microcontroller 2020-03-08 22:07:10 -07:00
ipa_version.h