Received: by 10.192.165.156 with SMTP id m28csp1879019imm; Thu, 12 Apr 2018 05:13:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx49KykM/DBRBqr9BCkJg6D5vah3yhKJgoYsjqdJdw+E7EZ7iZOIGsIfo9RZta8jGD1vFvk5n X-Received: by 2002:a17:902:4483:: with SMTP id l3-v6mr282470pld.282.1523535203514; Thu, 12 Apr 2018 05:13:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523535203; cv=none; d=google.com; s=arc-20160816; b=FxBOrecp0h5A9TsAJX+OnAeIT4kIEoP98GxLa3FVhBE/7RxprzeAk2BX379bcBYh1i 1Y8OKL65AOTutlAEAI5U7L5AETGd7hoqlgCvdO1CAv+t8paXNCKD/2bq4u5GngknvB0x n8XvqpBcOa4NjZGMAfgRh9YMi6jIpuvwtGcdOeJZLpEMF1YDz7Ys2DI2c1nKZDYgBK8h gi/zR9YVm445u9vQw7AdqWHrdnYnQcC/zm9XRJhQmMuWGfqyHX4NNyjaw9pybn03zICu ZpOIxcHiDoyHWUwSXWO55O4fxoDijDfUcN/qhCsqhxcC1jLDoER+e8Wc6bKfuZw761pP +kKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=A2QBzEIRENQ+aPQDbbUrT3oJIDvcD9jtuaUaX3RuiPE=; b=yrVay86KHuh9z1iiolIwyJypE6uPFkkg8IdjdoPqc912jQUTkS5Y4qd1x3a/+crR/n Qadk6IWCelIbh4gI2vdGASJwTIoueCpPbsS5thkbGcb1k6j/EzVb2x5lvjEVzOYMSaUL d1HafMxlMY1n8WJuuiDMifFQ1VwrJdIi/7UqJ2GtwL0snkfNZducEneMncYkDgLAHexZ 9lXwSuKg136JeQucdg1/OR3gTvi80A/8dnLL0iqzYKUFERhs6pS5wUgM+NI3WdEPFsex fMMO6e210BeXG0fMs+xPEdSMPp2VJp1IgppC0YbFcyTKkN69TViNHjBKgt4gfvSy2p6q md6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a100-v6si3305933pli.20.2018.04.12.05.12.46; Thu, 12 Apr 2018 05:13:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752721AbeDLMJA (ORCPT + 99 others); Thu, 12 Apr 2018 08:09:00 -0400 Received: from osg.samsung.com ([64.30.133.232]:41612 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752483AbeDLMI6 (ORCPT ); Thu, 12 Apr 2018 08:08:58 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 26C3D1C1E2; Thu, 12 Apr 2018 05:08:58 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4wpNMzBwqwnG; Thu, 12 Apr 2018 05:08:56 -0700 (PDT) Received: from [192.168.2.108] (p4FE71924.dip0.t-ipconnect.de [79.231.25.36]) by osg.samsung.com (Postfix) with ESMTPSA id 0DC821C1D9; Thu, 12 Apr 2018 05:08:54 -0700 (PDT) Subject: Re: [PATCH] net: ieee802154: atusb: Replace GFP_ATOMIC with GFP_KERNEL in atusb_probe To: Jia-Ju Bai , alex.aring@gmail.com Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1523412850-2260-1-git-send-email-baijiaju1990@gmail.com> From: Stefan Schmidt Message-ID: <46cf6980-ff83-7d68-9a5e-67d874c1900a@osg.samsung.com> Date: Thu, 12 Apr 2018 14:08:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1523412850-2260-1-git-send-email-baijiaju1990@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello. On 04/11/2018 04:14 AM, Jia-Ju Bai wrote: > atusb_probe() is never called in atomic context. > This function is only set as ".probe" in struct usb_driver. > > Despite never getting called from atomic context, > atusb_probe() calls usb_alloc_urb() with GFP_ATOMIC, > which does not sleep for allocation. > GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, > which can sleep and improve the possibility of sucessful allocation. > > This is found by a static analysis tool named DCNS written by myself. > And I also manually check it. > > Signed-off-by: Jia-Ju Bai > --- > drivers/net/ieee802154/atusb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c > index ef68851..ab6a505 100644 > --- a/drivers/net/ieee802154/atusb.c > +++ b/drivers/net/ieee802154/atusb.c > @@ -789,7 +789,7 @@ static int atusb_probe(struct usb_interface *interface, > atusb->tx_dr.bRequest = ATUSB_TX; > atusb->tx_dr.wValue = cpu_to_le16(0); > > - atusb->tx_urb = usb_alloc_urb(0, GFP_ATOMIC); > + atusb->tx_urb = usb_alloc_urb(0, GFP_KERNEL); > if (!atusb->tx_urb) > goto fail; > This patch has been applied to the wpan tree and will be part of the next pull request to net. Thanks! regards Stefan Schmidt