diff --git a/upstream/modules/sprd_wlan_combo/sc2355/pcie.c b/upstream/modules/sprd_wlan_combo/sc2355/pcie.c index 5e4e2c6b..c6f11ee4 100644 --- a/upstream/modules/sprd_wlan_combo/sc2355/pcie.c +++ b/upstream/modules/sprd_wlan_combo/sc2355/pcie.c @@ -1911,7 +1911,6 @@ int sc2355_pcie_fc_get_send_num(struct sprd_hif *hif, { int free_num = 0; struct tx_mgmt *tx_mgmt = hif->tx_mgmt; - static unsigned long caller_jiffies; /*send all data in buff with PCIe interface*/ unsigned int tx_buf_max = get_max_fw_tx_dscr() > pcie_get_tx_buf_num() ? @@ -1922,12 +1921,6 @@ int sc2355_pcie_fc_get_send_num(struct sprd_hif *hif, return 0; free_num = atomic_read(&tx_mgmt->xmit_msg_list.free_num); - if (printk_timed_ratelimit(&caller_jiffies, 1000)) { - pr_debug("%s, free_num=%d, data_num=%d\n", __func__, - free_num, data_num); - if (list_empty(&tx_mgmt->xmit_msg_list.to_free_list)) - pr_info("%s: to free list empty\n", __func__); - } if ((free_num + data_num) >= tx_buf_max) { pr_debug("%s, free_num=%d, data_num=%d\n", __func__, @@ -1944,7 +1937,6 @@ int sc2355_pcie_fc_test_send_num(struct sprd_hif *hif, { int free_num = 0; struct tx_mgmt *tx_mgmt = hif->tx_mgmt; - static unsigned long caller_jiffies; /*send all data in buff with PCIe interface, TODO*/ unsigned int tx_buf_max = get_max_fw_tx_dscr() > pcie_get_tx_buf_num() ? @@ -1955,12 +1947,6 @@ int sc2355_pcie_fc_test_send_num(struct sprd_hif *hif, return 0; free_num = atomic_read(&tx_mgmt->xmit_msg_list.free_num); - if (printk_timed_ratelimit(&caller_jiffies, 1000)) { - pr_debug("%s,%d free_num=%d, data_num=%d\n", __func__, - __LINE__, free_num, data_num); - if (list_empty(&tx_mgmt->xmit_msg_list.to_free_list)) - pr_info("%s: to free list empty\n", __func__); - } if ((free_num + data_num) >= tx_buf_max) { pr_err("%s,%d free_num=%d, data_num=%d\n", @@ -2034,6 +2020,14 @@ int pcie_post_init(struct sprd_hif *hif) int ret = -EINVAL, chn = 0; sc2355_hif.hif = (void *)hif; + /* + * MU300 (from kanoqwq/mu300-linux): a failed/aborted earlier power cycle clears this pointer in the + * error path below. The vendor driver only restores it in pcie_init(), + * but a later WCN power-on may call post_init directly. Passing + * &NULL[0] to mchn_init then makes Wi-Fi permanently fail until reboot. + * The channel table is static, so make every post-init self-contained. + */ + sc2355_hif.mchn_ops = sc2355_pcie_hif_ops; sc2355_hif.max_num = sizeof(sc2355_pcie_hif_ops) / sizeof(struct mchn_ops_t); @@ -2055,7 +2049,9 @@ int pcie_post_init(struct sprd_hif *hif) err: pr_err("%s: unregister %d ops\n", __func__, sc2355_hif.max_num); - for (; chn > 0; chn--) + /* MU300: undo the channels that were set up, 0 .. chn-1 (the vendor loop took chn, which failed, and + * never 0) */ + while (chn-- > 0) sprdwcn_bus_chn_deinit(&sc2355_hif.mchn_ops[chn]); sc2355_hif.mchn_ops = NULL; sc2355_hif.max_num = 0; diff --git a/upstream/modules/sprd_wlan_combo/sc2355/tx.c b/upstream/modules/sprd_wlan_combo/sc2355/tx.c index 71b4809d..871bbc1a 100644 --- a/upstream/modules/sprd_wlan_combo/sc2355/tx.c +++ b/upstream/modules/sprd_wlan_combo/sc2355/tx.c @@ -1060,6 +1060,17 @@ static int tx_filter_ip_pkt(struct sk_buff *skb, struct net_device *ndev) /*as CP request, send data with CMD */ if (is_data2cmd) { + /* AP DNS is ordinary client traffic. The board NVM can leave + * special_data_flag outside its 0..2 enum (observed: 32); using + * CMD_TX_DATA for every DNS reply can wedge the firmware command + * queue and assert CP2. Keep DHCP and VoWiFi on their paths. + */ + if ((vif->mode == SPRD_MODE_AP || + vif->mode == SPRD_MODE_P2P_GO) && + (is_ipv4_dns || is_ipv6_dns) && + !is_ipv4_dhcp && !is_ipv6_dhcp && !is_vowifi2cmd) + return 1; + if (is_ipv4_dhcp || is_ipv6_dhcp) pr_info("dhcp,check:%x,skb->ip_summed:%d\n", udphdr->check, skb->ip_summed); @@ -2251,6 +2262,12 @@ int sprd_tx_filter_packet(struct sk_buff *skb, struct net_device *ndev) #endif if (ethhdr->h_proto == htons(ETH_P_ARP)) { + /* ARP replies from an AP must use the regular data queue. Sending + * them one by one through CMD_TX_DATA exhausts the command channel + * under an ARP burst and can leave WCN stuck in carddump status. + */ + if (vif->mode == SPRD_MODE_AP || vif->mode == SPRD_MODE_P2P_GO) + return 1; pr_info("incoming ARP packet\n"); spin_lock_bh(&adap_info.adap_lock);