Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7396747rwb; Tue, 6 Dec 2022 05:22:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf7m+hR2PV1Ow8OB1x7B5zZEVVBv6qLaL8YW2oRsGSbyNWySsb28jJpMkmTvQ7nGHr9lNVro X-Received: by 2002:a17:903:2487:b0:189:bdd4:1d67 with SMTP id p7-20020a170903248700b00189bdd41d67mr19032188plw.12.1670332952745; 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=eWhU8Cq+/GNgMBbs9jPs5zbqFp5JBfFAa3jjQd8W503MmXg22Sap7wjppSsTM2jcUm 8Svv/aXBSEbU7/yFC8qlzXzXjjrvikj154x4uyJAIUsKBKgt0NugVEMmcvTQNp6RYc7U kgE3KfLfd2jC9aIBBpf1s/UXrg6Pa6z9UwnA0vDtBZhrbMke/OyxLIeUTUvO9mCWBgDo m5/LJStVvpkbOClzbvjcnh0pQPfSq05RGKMmde/32fTVv0Ye07ItqDH36skLbrwi9MSB S97UAslnQeeLu6dnBIxqNn/Kj7m7dFg/HZqtLJpA0z4JP9feDgQ28QbR9DMzGHkvbm4y pa/g== 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=g6h5VAKa0YrgUxqA51k+6WkSyowO+wr1F/xOhn3YVpo=; b=EH7G8JJLiHdgq8KDNB7a9AYndd+Lop5jgyazQsTGS4T+7U7XQTGmveQdfIkyjoTTx9 ZXzMh7rJ072x+erUaDiN9uwYY1kDbs+43iK9ntug4SxMKesA3sHfjLI32C/hojBCxTjo lw+mYUiAerOfQuoFtwtSWS4Cb+fW3RE96BYhrH5cCaH2eVaxbYEWjCIf6JxTVNi8/Rlo sDZk0vg8Xn977VPn28B3l2Fg2YsAxIM+cOAvttldfGXiXXnL3jGJxTs8CnP/e9CMdi9v BUjqQ4VfAMjDxyVGmu54YxcPVZn1qe3U8M/7aO4xjB+8OS1GuMQL5GQqch7eFgXhJdP+ q05g== 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 65-20020a630044000000b004787e17f7ebsi12947010pga.520.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 S231183AbiLFNQY (ORCPT + 66 others); Tue, 6 Dec 2022 08:16:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234896AbiLFNPz (ORCPT ); Tue, 6 Dec 2022 08:15:55 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D5BB2CE37 for ; Tue, 6 Dec 2022 05:15:08 -0800 (PST) Received: from dggpemm500007.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NRLTw0FlnzRpgY; Tue, 6 Dec 2022 21:14:12 +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 2/3] rtlwifi: rtl8188ee: don't call kfree_skb() under spin_lock_irqsave() Date: Tue, 6 Dec 2022 21:12:48 +0800 Message-ID: <20221206131249.2181693-3-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: 7fe3b3abb5da ("rtlwifi: rtl8188ee: rtl8821ae: Fix a queue locking problem") Signed-off-by: Yang Yingliang --- 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