Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp899382rwb; Wed, 7 Dec 2022 06:24:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf4uxY+NmyhFFyfIGmAeQnt62HzRZ33Ozj55KooOM/9PTuXEeM9moLnDPCpmh1OoqEtmrgNx X-Received: by 2002:a05:6402:370e:b0:464:fa1:9dc3 with SMTP id ek14-20020a056402370e00b004640fa19dc3mr25891917edb.343.1670423054237; Wed, 07 Dec 2022 06:24:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670423054; cv=none; d=google.com; s=arc-20160816; b=O9MY4kxGeFuzUn+jB8TPNCzhQmBVcn2CM0GLLAGFibSxJQcAHL+nbWdrR6bVqGigje Shv7klhe4YFO4Rsipo5ZLBdeOX7JDcmMWd3v7/ksBT9WoUwIxPK4BT+ZKrOHoERSR3BG mkPTntw8MDfrHWIRD85vluQcZxP4Su7pf3UJvaQZzUwtYVpRniS2XSzSEnUIMo/YQ1TG awUVzFJSv4lWC2EcBmAZS6sgpBVme+i/mHAsIT5m9OwxDZ3ooIAKL1Kq8dr5ndxLe2oE 649ceMw6QNNvhY1UWOvsAkfnBZ585GD/f2gEXnpCGrWQ7oozL7GF92SH4go/+CBaFMlr gHNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=oog6rKlCxTQlMPFSguhRXq9RH+Pw1yMrk0m5HvVVZ04=; b=XCfmX+9Hj7hyO1Oj+u6LfN+7NavIVU5GtuezYgZTWq2tS54UO1F/B1l2J4btbaFwFt VjQV3XlUBlpHQrgdwMqMHKkIeaaLMHybUIrrCaetCDeyQCHXWdSTOmhRs4jyocs1Sgi4 N19NoG7veDEGoW0nyphw/XkoqPmBhUjcKZ01QasmzHV9Wxqw8WQCIdxC7hRbxeacvp9X AnSokN4PpySLhxQ8RmGWnWxWLfTPBLzejzOA9XMMfE0q5APuTCDLbyOxHmwiVyxoycwJ xVvOd5nw1I1YHAF6TaQ9K/7u3cZ0qJTRvyFT9BAUqHp7OKJLTkd4yJ/8wLYxGLtx0tq2 /7sw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g20-20020a1709065d1400b007c11b897491si2186159ejt.833.2022.12.07.06.23.57; Wed, 07 Dec 2022 06:24:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230089AbiLGOQn (ORCPT + 66 others); Wed, 7 Dec 2022 09:16:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230117AbiLGOQl (ORCPT ); Wed, 7 Dec 2022 09:16:41 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A22A1554CD for ; Wed, 7 Dec 2022 06:16:38 -0800 (PST) Received: from dggpemm500007.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NRzpW3Ffbz15N7B; Wed, 7 Dec 2022 22:15:47 +0800 (CST) Received: from huawei.com (10.175.103.91) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 7 Dec 2022 22:16:36 +0800 From: Yang Yingliang To: , CC: , Subject: [PATCH v3 2/3] wifi: rtlwifi: rtl8188ee: don't call kfree_skb() under spin_lock_irqsave() Date: Wed, 7 Dec 2022 22:14:10 +0800 Message-ID: <20221207141411.46098-3-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221207141411.46098-1-yangyingliang@huawei.com> References: <20221207141411.46098-1-yangyingliang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org It is not allowed to call kfree_skb() from hardware interrupt context or with interrupts being disabled. All the SKBs have been dequeued from the old queue, so it's safe to enqueue these SKBs to a free queue, then free them after spin_unlock_irqrestore() at once. Compile tested only. Fixes: 7fe3b3abb5da ("rtlwifi: rtl8188ee: rtl8821ae: Fix a queue locking problem") Signed-off-by: Yang Yingliang Acked-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c index 58c2ab3d44be..de61c9c0ddec 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c @@ -68,8 +68,10 @@ static void _rtl88ee_return_beacon_queue_skb(struct ieee80211_hw *hw) struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[BEACON_QUEUE]; + struct sk_buff_head free_list; unsigned long flags; + skb_queue_head_init(&free_list); spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags); while (skb_queue_len(&ring->queue)) { struct rtl_tx_desc *entry = &ring->desc[ring->idx]; @@ -79,10 +81,12 @@ static void _rtl88ee_return_beacon_queue_skb(struct ieee80211_hw *hw) rtlpriv->cfg->ops->get_desc(hw, (u8 *)entry, true, HW_DESC_TXBUFF_ADDR), skb->len, DMA_TO_DEVICE); - kfree_skb(skb); + __skb_queue_tail(&free_list, skb); ring->idx = (ring->idx + 1) % ring->entries; } spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags); + + __skb_queue_purge(&free_list); } static void _rtl88ee_disable_bcn_sub_func(struct ieee80211_hw *hw) -- 2.25.1