linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] net: ipa: fix cleanup after modem crash
@ 2020-05-07 19:14 Alex Elder
  2020-05-07 19:14 ` [PATCH net 1/2] net: ipa: set DMA length in gsi_trans_cmd_add() Alex Elder
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alex Elder @ 2020-05-07 19:14 UTC (permalink / raw)
  To: davem; +Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel

The first patch in this series fixes a bug where the size of a data
transfer request was never set, meaning it was 0.  The consequence
of this was that such a transfer request would never complete if
attempted, and led to a hung task timeout.

This data transfer is required for cleaning up IPA hardware state
when recovering from a modem crash.  The code to implement this
cleanup is already present, but its use was commented out because
it hit the bug described above.  So the second patch in this series
enables the use of that "tag process" cleanup code.

					-Alex

Alex Elder (2):
  net: ipa: set DMA length in gsi_trans_cmd_add()
  net: ipa: use tag process on modem crash

 drivers/net/ipa/gsi_trans.c |  5 +++--
 drivers/net/ipa/ipa_cmd.c   | 14 +++-----------
 2 files changed, 6 insertions(+), 13 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net 1/2] net: ipa: set DMA length in gsi_trans_cmd_add()
  2020-05-07 19:14 [PATCH net 0/2] net: ipa: fix cleanup after modem crash Alex Elder
@ 2020-05-07 19:14 ` Alex Elder
  2020-05-07 19:14 ` [PATCH net 2/2] net: ipa: use tag process on modem crash Alex Elder
  2020-05-08  1:42 ` [PATCH net 0/2] net: ipa: fix cleanup after " David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Elder @ 2020-05-07 19:14 UTC (permalink / raw)
  To: davem; +Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel

When a command gets added to a transaction for the AP->command
channel we set the DMA address of its scatterlist entry, but not
its DMA length.  Fix this bug.

Signed-off-by: Alex Elder <elder@linaro.org>
---
 drivers/net/ipa/gsi_trans.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ipa/gsi_trans.c b/drivers/net/ipa/gsi_trans.c
index 2fd21d75367d..bdbfeed359db 100644
--- a/drivers/net/ipa/gsi_trans.c
+++ b/drivers/net/ipa/gsi_trans.c
@@ -399,13 +399,14 @@ void gsi_trans_cmd_add(struct gsi_trans *trans, void *buf, u32 size,
 	/* assert(which < trans->tre_count); */
 
 	/* Set the page information for the buffer.  We also need to fill in
-	 * the DMA address for the buffer (something dma_map_sg() normally
-	 * does).
+	 * the DMA address and length for the buffer (something dma_map_sg()
+	 * normally does).
 	 */
 	sg = &trans->sgl[which];
 
 	sg_set_buf(sg, buf, size);
 	sg_dma_address(sg) = addr;
+	sg_dma_len(sg) = sg->length;
 
 	info = &trans->info[which];
 	info->opcode = opcode;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net 2/2] net: ipa: use tag process on modem crash
  2020-05-07 19:14 [PATCH net 0/2] net: ipa: fix cleanup after modem crash Alex Elder
  2020-05-07 19:14 ` [PATCH net 1/2] net: ipa: set DMA length in gsi_trans_cmd_add() Alex Elder
@ 2020-05-07 19:14 ` Alex Elder
  2020-05-08  1:42 ` [PATCH net 0/2] net: ipa: fix cleanup after " David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Elder @ 2020-05-07 19:14 UTC (permalink / raw)
  To: davem; +Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel

One part of recovering from a modem crash is performing a "tag
sequence" of several IPA immediate commands, to clear the hardware
pipeline.  The sequence ends with a data transfer request on the
command endpoint (which is not otherwise done).  Unfortunately,
attempting to do the data transfer led to a hang, so that request
plus two other commands were commented out.

The previous commit fixes the bug that was causing that hang.  And
with that bug fixed we can properly issue the tag sequence when the
modem crashes, to return the hardware to a known state.

Signed-off-by: Alex Elder <elder@linaro.org>
---
 drivers/net/ipa/ipa_cmd.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ipa/ipa_cmd.c b/drivers/net/ipa/ipa_cmd.c
index d226b858742d..cee417181f98 100644
--- a/drivers/net/ipa/ipa_cmd.c
+++ b/drivers/net/ipa/ipa_cmd.c
@@ -628,23 +628,15 @@ static void ipa_cmd_transfer_add(struct gsi_trans *trans, u16 size)
 
 void ipa_cmd_tag_process_add(struct gsi_trans *trans)
 {
-	ipa_cmd_register_write_add(trans, 0, 0, 0, true);
-#if 1
-	/* Reference these functions to avoid a compile error */
-	(void)ipa_cmd_ip_packet_init_add;
-	(void)ipa_cmd_ip_tag_status_add;
-	(void) ipa_cmd_transfer_add;
-#else
 	struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi);
-	struct gsi_endpoint *endpoint;
+	struct ipa_endpoint *endpoint;
 
 	endpoint = ipa->name_map[IPA_ENDPOINT_AP_LAN_RX];
+
+	ipa_cmd_register_write_add(trans, 0, 0, 0, true);
 	ipa_cmd_ip_packet_init_add(trans, endpoint->endpoint_id);
-
 	ipa_cmd_ip_tag_status_add(trans, 0xcba987654321);
-
 	ipa_cmd_transfer_add(trans, 4);
-#endif
 }
 
 /* Returns the number of commands required for the tag process */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net 0/2] net: ipa: fix cleanup after modem crash
  2020-05-07 19:14 [PATCH net 0/2] net: ipa: fix cleanup after modem crash Alex Elder
  2020-05-07 19:14 ` [PATCH net 1/2] net: ipa: set DMA length in gsi_trans_cmd_add() Alex Elder
  2020-05-07 19:14 ` [PATCH net 2/2] net: ipa: use tag process on modem crash Alex Elder
@ 2020-05-08  1:42 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-05-08  1:42 UTC (permalink / raw)
  To: elder; +Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel

From: Alex Elder <elder@linaro.org>
Date: Thu,  7 May 2020 14:14:02 -0500

> The first patch in this series fixes a bug where the size of a data
> transfer request was never set, meaning it was 0.  The consequence
> of this was that such a transfer request would never complete if
> attempted, and led to a hung task timeout.
> 
> This data transfer is required for cleaning up IPA hardware state
> when recovering from a modem crash.  The code to implement this
> cleanup is already present, but its use was commented out because
> it hit the bug described above.  So the second patch in this series
> enables the use of that "tag process" cleanup code.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-08  1:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 19:14 [PATCH net 0/2] net: ipa: fix cleanup after modem crash Alex Elder
2020-05-07 19:14 ` [PATCH net 1/2] net: ipa: set DMA length in gsi_trans_cmd_add() Alex Elder
2020-05-07 19:14 ` [PATCH net 2/2] net: ipa: use tag process on modem crash Alex Elder
2020-05-08  1:42 ` [PATCH net 0/2] net: ipa: fix cleanup after " David Miller

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).