Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: David S. Miller <davem@davemloft.net>

+32 -10
+7 -9
drivers/net/ipa/gsi.c
··· 500 500 int ret; 501 501 502 502 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 + 503 510 if (state != GSI_CHANNEL_STATE_STARTED && 504 511 state != GSI_CHANNEL_STATE_STOP_IN_PROC) 505 512 return -EINVAL; ··· 796 789 int gsi_channel_stop(struct gsi *gsi, u32 channel_id) 797 790 { 798 791 struct gsi_channel *channel = &gsi->channel[channel_id]; 799 - enum gsi_channel_state state; 800 792 u32 retries; 801 793 int ret; 802 794 803 795 gsi_channel_freeze(channel); 804 - 805 - /* Channel could have entered STOPPED state since last call if the 806 - * STOP command timed out. We won't stop a channel if stopping it 807 - * was successful previously (so we still want the freeze above). 808 - */ 809 - state = gsi_channel_state(channel); 810 - if (state == GSI_CHANNEL_STATE_STOPPED) 811 - return 0; 812 796 813 797 /* RX channels might require a little time to enter STOPPED state */ 814 798 retries = channel->toward_ipa ? 0 : GSI_CHANNEL_STOP_RX_RETRIES;
+15
drivers/net/ipa/ipa_cmd.c
··· 586 586 return 4; 587 587 } 588 588 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 + 589 604 static struct ipa_cmd_info * 590 605 ipa_cmd_info_alloc(struct ipa_endpoint *endpoint, u32 tre_count) 591 606 {
+8
drivers/net/ipa/ipa_cmd.h
··· 172 172 u32 ipa_cmd_tag_process_count(void); 173 173 174 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 + 182 + /** 175 183 * ipa_cmd_trans_alloc() - Allocate a transaction for the command TX endpoint 176 184 * @ipa: IPA pointer 177 185 * @tre_count: Number of elements in the transaction
-1
drivers/net/ipa/ipa_data-sdm845.c
··· 44 44 .endpoint = { 45 45 .seq_type = IPA_SEQ_INVALID, 46 46 .config = { 47 - .checksum = true, 48 47 .aggregation = true, 49 48 .status_enable = true, 50 49 .rx = {
+2
drivers/net/ipa/ipa_endpoint.c
··· 1450 1450 if (ipa->modem_netdev) 1451 1451 ipa_modem_suspend(ipa->modem_netdev); 1452 1452 1453 + ipa_cmd_tag_process(ipa); 1454 + 1453 1455 ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]); 1454 1456 ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]); 1455 1457 }