Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7396750rwb; Tue, 6 Dec 2022 05:22:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf6i0fTJLc4jx4+926xQMmoEdnJ6oxCtFJuDkfTNALeaVMb0svReWrn0jskX7JeV/6dCy66W X-Received: by 2002:a63:ec45:0:b0:470:4320:ef39 with SMTP id r5-20020a63ec45000000b004704320ef39mr60132135pgj.381.1670332952859; Tue, 06 Dec 2022 05:22:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670332952; cv=none; d=google.com; s=arc-20160816; b=ewbI7Fdf1fZ5MRbJEk5BFCacsss0GN5w9dA3qfGzDc69XO63YG1FgU+t7X1R/4DlEJ eObVK8DDhMYpdceBoyVYF4OufQp998b2vvcP+iNXAUo3/rGqJ49OOipNj5kyM0l/vOda ccVWDmOABzPETLHH6q3VVFxfynaSo06UMZlstfC1AMjYkFmru80T9v3S/f8P0KhGzsCx oLDc1UBQlmvGIjgUhwHZ9afx2gaFe79n3vBFBLdYrY2B+Rw7QJpUj07SGxcphu0DmeYT AjSv8Vqud+NRqUtJaTjVg23kND6z3vAzWHL4xuyoRBRQ3xmKGX89MOvA2+SO/lVQ0NlC PR5w== 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=xEOAghGXWbrCtc5hsfuuloqo415FbwPFRMRAxgREhz8=; b=KmJ7qTkyc7SUlpULh+iSBwnMoXrTPwkPtBwK+XYRsZhHpfHlC6jaCf/qiujGLwDL7T sRAdFIFCN5ueZRbLgEWF8sHvl4KdXKnWiXrBgWR0pZSFQ+DEDeJSLtPfWsNxs+JOwJ7n 2KsXPDrFeUmxBsG6UdjL5LyKDiBejkc7xWT65FBxJ3L8FWfUs6UC1xqm276m8eL1q0L/ wyR3QkqrQcHepjTcAHCdKDFVy/aOk2xGXraipiYlDRCLzuz/lHvYtSAMDmXGOYcHuujI ua8CDkjROqrpjD8CaLAD+dqj0mFn36/rsENOxILN+72bbsYWsBKfnz1Q9sZkwlJ/k/kM DVYQ== 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 t203-20020a635fd4000000b00478e7f00deesi821596pgb.127.2022.12.06.05.22.24; Tue, 06 Dec 2022 05:22:32 -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 S229782AbiLFNQZ (ORCPT + 66 others); Tue, 6 Dec 2022 08:16:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234409AbiLFNP7 (ORCPT ); Tue, 6 Dec 2022 08:15:59 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F1C82B245 for ; Tue, 6 Dec 2022 05:15:07 -0800 (PST) Received: from dggpemm500007.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NRLQ36thNzqSsW; Tue, 6 Dec 2022 21:10:51 +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:00 +0800 From: Yang Yingliang To: , CC: , Subject: [PATCH resend 1/3] rtlwifi: rtl8821ae: don't call kfree_skb() under spin_lock_irqsave() Date: Tue, 6 Dec 2022 21:12:47 +0800 Message-ID: <20221206131249.2181693-2-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/rtl8821ae/hw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c index 7e0f62d59fe1..a7e3250957dc 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c @@ -26,8 +26,10 @@ static void _rtl8821ae_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]; @@ -37,10 +39,12 @@ static void _rtl8821ae_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 _rtl8821ae_set_bcn_ctrl_reg(struct ieee80211_hw *hw, -- 2.25.1