Commit 0433c93d authored by David S. Miller's avatar David S. Miller

Merge branch 'net-ipa-three-bug-fixes'

Alex Elder says:

====================
net: ipa: three bug fixes

This series contains three bug fixes for the Qualcomm IPA driver.
In practice these bugs are unlikke.y to be harmful, but they do
represent incorrect code.

Version 2 adds "Fixes" tags to two of the patches and fixes a typo
in one (found by checkpatch.pl).
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents f2ca673d 6cb63ea6
...@@ -500,6 +500,13 @@ static int gsi_channel_stop_command(struct gsi_channel *channel) ...@@ -500,6 +500,13 @@ static int gsi_channel_stop_command(struct gsi_channel *channel)
int ret; int ret;
state = gsi_channel_state(channel); state = gsi_channel_state(channel);
/* Channel could have entered STOPPED state since last call
* if it timed out. If so, we're done.
*/
if (state == GSI_CHANNEL_STATE_STOPPED)
return 0;
if (state != GSI_CHANNEL_STATE_STARTED && if (state != GSI_CHANNEL_STATE_STARTED &&
state != GSI_CHANNEL_STATE_STOP_IN_PROC) state != GSI_CHANNEL_STATE_STOP_IN_PROC)
return -EINVAL; return -EINVAL;
...@@ -789,20 +796,11 @@ int gsi_channel_start(struct gsi *gsi, u32 channel_id) ...@@ -789,20 +796,11 @@ int gsi_channel_start(struct gsi *gsi, u32 channel_id)
int gsi_channel_stop(struct gsi *gsi, u32 channel_id) int gsi_channel_stop(struct gsi *gsi, u32 channel_id)
{ {
struct gsi_channel *channel = &gsi->channel[channel_id]; struct gsi_channel *channel = &gsi->channel[channel_id];
enum gsi_channel_state state;
u32 retries; u32 retries;
int ret; int ret;
gsi_channel_freeze(channel); gsi_channel_freeze(channel);
/* Channel could have entered STOPPED state since last call if the
* STOP command timed out. We won't stop a channel if stopping it
* was successful previously (so we still want the freeze above).
*/
state = gsi_channel_state(channel);
if (state == GSI_CHANNEL_STATE_STOPPED)
return 0;
/* RX channels might require a little time to enter STOPPED state */ /* RX channels might require a little time to enter STOPPED state */
retries = channel->toward_ipa ? 0 : GSI_CHANNEL_STOP_RX_RETRIES; retries = channel->toward_ipa ? 0 : GSI_CHANNEL_STOP_RX_RETRIES;
......
...@@ -586,6 +586,21 @@ u32 ipa_cmd_tag_process_count(void) ...@@ -586,6 +586,21 @@ u32 ipa_cmd_tag_process_count(void)
return 4; 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 * static struct ipa_cmd_info *
ipa_cmd_info_alloc(struct ipa_endpoint *endpoint, u32 tre_count) ipa_cmd_info_alloc(struct ipa_endpoint *endpoint, u32 tre_count)
{ {
......
...@@ -171,6 +171,14 @@ void ipa_cmd_tag_process_add(struct gsi_trans *trans); ...@@ -171,6 +171,14 @@ void ipa_cmd_tag_process_add(struct gsi_trans *trans);
*/ */
u32 ipa_cmd_tag_process_count(void); 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_cmd_trans_alloc() - Allocate a transaction for the command TX endpoint
* @ipa: IPA pointer * @ipa: IPA pointer
......
...@@ -44,7 +44,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { ...@@ -44,7 +44,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
.endpoint = { .endpoint = {
.seq_type = IPA_SEQ_INVALID, .seq_type = IPA_SEQ_INVALID,
.config = { .config = {
.checksum = true,
.aggregation = true, .aggregation = true,
.status_enable = true, .status_enable = true,
.rx = { .rx = {
......
...@@ -1450,6 +1450,8 @@ void ipa_endpoint_suspend(struct ipa *ipa) ...@@ -1450,6 +1450,8 @@ void ipa_endpoint_suspend(struct ipa *ipa)
if (ipa->modem_netdev) if (ipa->modem_netdev)
ipa_modem_suspend(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_LAN_RX]);
ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]); ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]);
} }
......
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