From nobody Sun Sep 22 02:04:40 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFDF3C433EF for ; Thu, 19 May 2022 03:10:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231570AbiESDKK (ORCPT ); Wed, 18 May 2022 23:10:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232897AbiESDJ7 (ORCPT ); Wed, 18 May 2022 23:09:59 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4131D9E94; Wed, 18 May 2022 20:09:56 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4L3ZX40zRNzQkKB; Thu, 19 May 2022 11:07:00 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 19 May 2022 11:09:52 +0800 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.24; Thu, 19 May 2022 11:09:52 +0800 From: Yang Yingliang To: , , , CC: , , , , , Subject: [PATCH -next v2] net: wwan: t7xx: use GFP_ATOMIC under spin lock in t7xx_cldma_gpd_set_next_ptr() Date: Thu, 19 May 2022 11:21:08 +0800 Message-ID: <20220519032108.2996400-1-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Sometimes t7xx_cldma_gpd_set_next_ptr() is called under spin lock, so add 'gfp_mask' parameter in t7xx_cldma_gpd_set_next_ptr() to pass the flag. Fixes: 39d439047f1d ("net: wwan: t7xx: Add control DMA interface") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Loic Poulain --- v2: change the parameter to gfp flag. --- drivers/net/wwan/t7xx/t7xx_hif_cldma.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wwan/t7xx/t7xx_hif_cldma.c b/drivers/net/wwan/t7xx= /t7xx_hif_cldma.c index 0c52801ed0de..6ff30cb8eb16 100644 --- a/drivers/net/wwan/t7xx/t7xx_hif_cldma.c +++ b/drivers/net/wwan/t7xx/t7xx_hif_cldma.c @@ -91,9 +91,9 @@ static void t7xx_cldma_gpd_set_next_ptr(struct cldma_gpd = *gpd, dma_addr_t next_p } =20 static int t7xx_cldma_alloc_and_map_skb(struct cldma_ctrl *md_ctrl, struct= cldma_request *req, - size_t size) + size_t size, gfp_t gfp_mask) { - req->skb =3D __dev_alloc_skb(size, GFP_KERNEL); + req->skb =3D __dev_alloc_skb(size, gfp_mask); if (!req->skb) return -ENOMEM; =20 @@ -174,7 +174,7 @@ static int t7xx_cldma_gpd_rx_from_q(struct cldma_queue = *queue, int budget, bool spin_unlock_irqrestore(&queue->ring_lock, flags); req =3D queue->rx_refill; =20 - ret =3D t7xx_cldma_alloc_and_map_skb(md_ctrl, req, queue->tr_ring->pkt_s= ize); + ret =3D t7xx_cldma_alloc_and_map_skb(md_ctrl, req, queue->tr_ring->pkt_s= ize, GFP_KERNEL); if (ret) return ret; =20 @@ -402,7 +402,7 @@ static struct cldma_request *t7xx_alloc_rx_request(stru= ct cldma_ctrl *md_ctrl, s if (!req->gpd) goto err_free_req; =20 - val =3D t7xx_cldma_alloc_and_map_skb(md_ctrl, req, pkt_size); + val =3D t7xx_cldma_alloc_and_map_skb(md_ctrl, req, pkt_size, GFP_KERNEL); if (val) goto err_free_pool; =20 @@ -801,7 +801,7 @@ static int t7xx_cldma_clear_rxq(struct cldma_ctrl *md_c= trl, int qnum) if (req->skb) continue; =20 - ret =3D t7xx_cldma_alloc_and_map_skb(md_ctrl, req, rxq->tr_ring->pkt_siz= e); + ret =3D t7xx_cldma_alloc_and_map_skb(md_ctrl, req, rxq->tr_ring->pkt_siz= e, GFP_ATOMIC); if (ret) break; =20 --=20 2.25.1