Skip to content

Commit

Permalink
net: ipa: introduce ipa_cmd_tag_process()
Browse files Browse the repository at this point in the history
Create a new function ipa_cmd_tag_process() that simply allocates a
transaction, adds a tag process command to it to clear the hardware
pipeline, and commits the transaction.

Call it in from ipa_endpoint_suspend(), after suspending the modem
endpoints but before suspending the AP command TX and AP LAN RX
endpoints (which are used by the tag sequence).

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alex Elder authored and David S. Miller committed Jun 30, 2020
1 parent 41af543 commit 6cb63ea
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
15 changes: 15 additions & 0 deletions drivers/net/ipa/ipa_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,21 @@ u32 ipa_cmd_tag_process_count(void)
return 4;
}

void ipa_cmd_tag_process(struct ipa *ipa)
{
u32 count = ipa_cmd_tag_process_count();
struct gsi_trans *trans;

trans = ipa_cmd_trans_alloc(ipa, count);
if (trans) {
ipa_cmd_tag_process_add(trans);
gsi_trans_commit_wait(trans);
} else {
dev_err(&ipa->pdev->dev,
"error allocating %u entry tag transaction\n", count);
}
}

static struct ipa_cmd_info *
ipa_cmd_info_alloc(struct ipa_endpoint *endpoint, u32 tre_count)
{
Expand Down
8 changes: 8 additions & 0 deletions drivers/net/ipa/ipa_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ void ipa_cmd_tag_process_add(struct gsi_trans *trans);
*/
u32 ipa_cmd_tag_process_count(void);

/**
* ipa_cmd_tag_process() - Perform a tag process
*
* @Return: The number of elements to allocate in a transaction
* to hold tag process commands
*/
void ipa_cmd_tag_process(struct ipa *ipa);

/**
* ipa_cmd_trans_alloc() - Allocate a transaction for the command TX endpoint
* @ipa: IPA pointer
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ipa/ipa_endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,8 @@ void ipa_endpoint_suspend(struct ipa *ipa)
if (ipa->modem_netdev)
ipa_modem_suspend(ipa->modem_netdev);

ipa_cmd_tag_process(ipa);

ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]);
ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]);
}
Expand Down

0 comments on commit 6cb63ea

Please sign in to comment.