Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7396550rwb; Tue, 6 Dec 2022 05:22:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf42aLIryk9QYrxcMXyE8PoFjA04yIVmPQepp5FPa5mvpbLM8d8AbZQVVWfbGYsO7Cc9YM0C X-Received: by 2002:a17:902:8604:b0:186:fe2d:f3cb with SMTP id f4-20020a170902860400b00186fe2df3cbmr73027103plo.132.1670332943214; Tue, 06 Dec 2022 05:22:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670332943; cv=none; d=google.com; s=arc-20160816; b=KkXW9An5RX1JiCYs1fUznFiSNvtV10cAXj50qlHnWrTqTz/hQxES68ujvizJpYSLem rsiPqPyEepdywR7aOd5kHOcPMUlSX5SokiJenfvKFVHXxE8DuvfXJJCGG8R04VmJUSMn oa5jV9juJ2wcO5eQsFSHAqPw57OInclwo8NM0aAnTnxxDLPhAzMprgE3bS179XZnk2E7 KiKAUFUueYPxZuI2XPp/8x8lxvvMq797UHPw21JEfUKFCGd9dN+h0/ZqOLZUzAoVOggq jiGITYTloHsYEV03IinwtVUA0/6RrvcLBZIXDA4cYjAAzDSGdbtyhLFOpwP2+2JPsoGq DIKg== 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=52B4AI1j5aGMDH2NO5VcOexp/kWb3bmmDWimOUNtL+o=; b=V3ej5kJzazwHafeIJDDxXWYcmfhrK2l+BrlV7gluUgeU4EeZlRTYPBdFPaNUO3gyi0 pemOPaCku7kmWj38BYv9RDVxx2zVsZAKianXqjEBCc9kp3QQt08oRLrRfvfSksrAXEJ/ FrcjbOAE0F7NYlkx66OGqDA9nWIkDEaqIf6KbIoinbOfZkQIvdAjcoZX/DEF1D/JrKNo 2/JD32YleJ3wwFKZexh6CfPZGQ0XNDV2hrFZ3tXPPxbAP5inb0Xp45Ftv2M0am6KqURM dmgMSAc4pXt7jrczzC4rx/3mMrvA9JNbgHrEB5Xi/+fLhplKzRLCOCfRNEZNGhSMS7Hq 7wBg== 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 n26-20020a63591a000000b004573e877892si17294460pgb.769.2022.12.06.05.22.14; Tue, 06 Dec 2022 05:22:23 -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 S234227AbiLFNQW (ORCPT + 66 others); Tue, 6 Dec 2022 08:16:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234673AbiLFNPy (ORCPT ); Tue, 6 Dec 2022 08:15:54 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D38C2AE2 for ; Tue, 6 Dec 2022 05:15:06 -0800 (PST) Received: from dggpemm500007.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NRLQq6DmQzJp6s; Tue, 6 Dec 2022 21:11:31 +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; Tue, 6 Dec 2022 21:15:01 +0800 From: Yang Yingliang To: , CC: , Subject: [PATCH resend 3/3] rtlwifi: rtl8723be: don't call kfree_skb() under spin_lock_irqsave() Date: Tue, 6 Dec 2022 21:12:49 +0800 Message-ID: <20221206131249.2181693-4-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221206131249.2181693-1-yangyingliang@huawei.com> References: <20221206131249.2181693-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: dggems701-chm.china.huawei.com (10.3.19.178) 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. So add all skb to a free list, then free them after spin_unlock_irqrestore() at once. Fixes: 5c99f04fec93 ("rtlwifi: rtl8723be: Update driver to match Realtek release of 06/28/14") Signed-off-by: Yang Yingliang --- drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c index 189cc6437600..0ba3bbed6ed3 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c @@ -30,8 +30,10 @@ static void _rtl8723be_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]; @@ -41,10 +43,12 @@ static void _rtl8723be_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 _rtl8723be_set_bcn_ctrl_reg(struct ieee80211_hw *hw, -- 2.25.1