Commit 6cb63ea6 authored by Alex Elder's avatar Alex Elder Committed by David S. Miller
Browse files

net: ipa: introduce ipa_cmd_tag_process()



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: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 41af5436
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -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)
{
+8 −0
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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]);
}