Commit 1abfb181 authored by David S. Miller's avatar David S. Miller

Merge branch 'net-ipa-fix-cleanup-after-modem-crash'

Alex Elder says:

====================
net: ipa: fix cleanup after modem crash

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.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents e8a1b0ef 2c4bb809
...@@ -399,13 +399,14 @@ void gsi_trans_cmd_add(struct gsi_trans *trans, void *buf, u32 size, ...@@ -399,13 +399,14 @@ void gsi_trans_cmd_add(struct gsi_trans *trans, void *buf, u32 size,
/* assert(which < trans->tre_count); */ /* assert(which < trans->tre_count); */
/* Set the page information for the buffer. We also need to fill in /* Set the page information for the buffer. We also need to fill in
* the DMA address for the buffer (something dma_map_sg() normally * the DMA address and length for the buffer (something dma_map_sg()
* does). * normally does).
*/ */
sg = &trans->sgl[which]; sg = &trans->sgl[which];
sg_set_buf(sg, buf, size); sg_set_buf(sg, buf, size);
sg_dma_address(sg) = addr; sg_dma_address(sg) = addr;
sg_dma_len(sg) = sg->length;
info = &trans->info[which]; info = &trans->info[which];
info->opcode = opcode; info->opcode = opcode;
......
...@@ -628,23 +628,15 @@ static void ipa_cmd_transfer_add(struct gsi_trans *trans, u16 size) ...@@ -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) 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 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]; endpoint = ipa->name_map[IPA_ENDPOINT_AP_LAN_RX];
ipa_cmd_ip_packet_init_add(trans, endpoint->endpoint_id);
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_ip_tag_status_add(trans, 0xcba987654321);
ipa_cmd_transfer_add(trans, 4); ipa_cmd_transfer_add(trans, 4);
#endif
} }
/* Returns the number of commands required for the tag process */ /* Returns the number of commands required for the tag process */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment