History

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

David S. Miller committed 6 years ago

Commit 0433c932 parents f2ca673 6cb63ea5 files · +32 −10Browse files

Unified · Split

5 files
  1. drivers/net/ipa/gsi.c +7 −9
  2. drivers/net/ipa/ipa_cmd.c +15 −0
  3. drivers/net/ipa/ipa_cmd.h +8 −0
  4. drivers/net/ipa/ipa_data-sdm845.c +0 −1
  5. drivers/net/ipa/ipa_endpoint.c +2 −0
drivers/net/ipa/gsi.c+7−9
@@ -500,6 +500,13 @@ static int gsi_channel_stop_command(struct gsi_channel *channel) · 499 unmodified lines
500500 int ret;
501501
502502 state = gsi_channel_state(channel);
503+
504+ /* Channel could have entered STOPPED state since last call
505+ * if it timed out. If so, we're done.
506+ */
507+ if (state == GSI_CHANNEL_STATE_STOPPED)
508+ return 0;
509+
503510 if (state != GSI_CHANNEL_STATE_STARTED &&
504511 state != GSI_CHANNEL_STATE_STOP_IN_PROC)
505512 return -EINVAL;
@@ -789,20 +796,11 @@ int gsi_channel_start(struct gsi *gsi, u32 channel_id) · 283 unmodified lines
789796 int gsi_channel_stop(struct gsi *gsi, u32 channel_id)
790797 {
791798 struct gsi_channel *channel = &gsi->channel[channel_id];
792− enum gsi_channel_state state;
793799 u32 retries;
794800 int ret;
795801
796802 gsi_channel_freeze(channel);
797803
798− /* Channel could have entered STOPPED state since last call if the
799− * STOP command timed out. We won't stop a channel if stopping it
800− * was successful previously (so we still want the freeze above).
801− */
802− state = gsi_channel_state(channel);
803− if (state == GSI_CHANNEL_STATE_STOPPED)
804− return 0;
805−
806804 /* RX channels might require a little time to enter STOPPED state */
807805 retries = channel->toward_ipa ? 0 : GSI_CHANNEL_STOP_RX_RETRIES;
808806
drivers/net/ipa/ipa_cmd.c+15−0
@@ -586,6 +586,21 @@ u32 ipa_cmd_tag_process_count(void) · 585 unmodified lines
586586 return 4;
587587 }
588588
589+void ipa_cmd_tag_process(struct ipa *ipa)
590+{
591+ u32 count = ipa_cmd_tag_process_count();
592+ struct gsi_trans *trans;
593+
594+ trans = ipa_cmd_trans_alloc(ipa, count);
595+ if (trans) {
596+ ipa_cmd_tag_process_add(trans);
597+ gsi_trans_commit_wait(trans);
598+ } else {
599+ dev_err(&ipa->pdev->dev,
600+ "error allocating %u entry tag transaction\n", count);
601+ }
602+}
603+
589604 static struct ipa_cmd_info *
590605 ipa_cmd_info_alloc(struct ipa_endpoint *endpoint, u32 tre_count)
591606 {
drivers/net/ipa/ipa_cmd.h+8−0
@@ -171,6 +171,14 @@ void ipa_cmd_tag_process_add(struct gsi_trans *trans); · 170 unmodified lines
171171 */
172172 u32 ipa_cmd_tag_process_count(void);
173173
174+/**
175+ * ipa_cmd_tag_process() - Perform a tag process
176+ *
177+ * @Return: The number of elements to allocate in a transaction
178+ * to hold tag process commands
179+ */
180+void ipa_cmd_tag_process(struct ipa *ipa);
181+
174182 /**
175183 * ipa_cmd_trans_alloc() - Allocate a transaction for the command TX endpoint
176184 * @ipa: IPA pointer
drivers/net/ipa/ipa_data-sdm845.c+0−1
@@ -44,7 +44,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { · 43 unmodified lines
4444 .endpoint = {
4545 .seq_type = IPA_SEQ_INVALID,
4646 .config = {
47− .checksum = true,
4847 .aggregation = true,
4948 .status_enable = true,
5049 .rx = {
drivers/net/ipa/ipa_endpoint.c+2−0
@@ -1450,6 +1450,8 @@ void ipa_endpoint_suspend(struct ipa *ipa) · 1449 unmodified lines
14501450 if (ipa->modem_netdev)
14511451 ipa_modem_suspend(ipa->modem_netdev);
14521452
1453+ ipa_cmd_tag_process(ipa);
1454+
14531455 ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]);
14541456 ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]);
14551457 }