Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1258437imm; Sun, 2 Sep 2018 16:08:22 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaPXVCpW/aaDw9QIYcgyvJMxU8QYCpfpK2MgNgrWGBnWaYfVwfV+X+moyHLFmBvAZFGV0R6 X-Received: by 2002:a63:dd09:: with SMTP id t9-v6mr22769411pgg.370.1535929701934; Sun, 02 Sep 2018 16:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535929701; cv=none; d=google.com; s=arc-20160816; b=YitayvLfdXMf2BLWtHslFh6Ni1pJoGZFEbF7ueELdmWVML5f60/tV5FnZ6/bzXkxFO Us6UI56P61DnHh6INxaZHKR55lis1/2EU56zGxZz6tgQGoAM2dXoORPiO+fT3CAqJDZR SVL1kxwClMRTX1zG3O6azhqZW4QSCY2f3L0lfG1e0OdJWBxeXFnxm2zvNcwscpZWVe3T BXAh4DBOa96dbfSKIKHbi/nh0ganY/XDM77ysjgRa1VcWj5246XnbtC4ZuKpGQD5S2gw Zta5/9I1wmNxxFQrMx63xfUJdBHQTCekRB+GlS8IV8VhsSs//dKm7oPc/YcRGciCHHjl W3cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=EYkU316ApeDeedTUzItquvK76gRdZwClPlA8ymqxRYI=; b=V/vNtCKFqAHYVFqLYQ5Pn4h0jcNbcozvtQ2OkUHBpfjVDEg556zRuSpMaNK8dG4ZnA KnTOsZ61ot8EqCH+OinmJOPxoYulqJy+mQZeskkNzKmh9AQfcEa33/RHhFXT0VOCXFPq 5e4U9HUEBfiSDQmvUhg5SCHiuwXYMFrmNUVRfh7rLFSPy7Fy8xVtcwmf9LnSEja+jTx6 A8mIHAb06G1F7HavhgsVl4cnEd2U5k4aV4HPuB9nhxK/clYkRC9ISPd3UMDP1DvuNIjr P2KsHWZog81yErLZzinQmsaVjNudat12iZNAueozIhj4nVAwRssi8Q4Zo6e6nsc75DFz xjOA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t64-v6si15078188pgd.176.2018.09.02.16.07.35; Sun, 02 Sep 2018 16:08:21 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727267AbeICDXC (ORCPT + 99 others); Sun, 2 Sep 2018 23:23:02 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:35734 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726763AbeICDXC (ORCPT ); Sun, 2 Sep 2018 23:23:02 -0400 Received: from localhost (168-64-212-66.spl.org [66.212.64.168]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 9909E109018CF; Sun, 2 Sep 2018 16:05:38 -0700 (PDT) Date: Sun, 02 Sep 2018 16:05:38 -0700 (PDT) Message-Id: <20180902.160538.1996490624543458172.davem@davemloft.net> To: baijiaju1990@gmail.com Cc: nicolas.ferre@microchip.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: cadence: Fix a sleep-in-atomic-context bug in macb_halt_tx() From: David Miller In-Reply-To: <20180901121105.436-1-baijiaju1990@gmail.com> References: <20180901121105.436-1-baijiaju1990@gmail.com> X-Mailer: Mew version 6.7 on Emacs 26 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 02 Sep 2018 16:05:38 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jia-Ju Bai Date: Sat, 1 Sep 2018 20:11:05 +0800 > The kernel module may sleep with holding a spinlock. > > The function call paths (from bottom to top) in Linux-4.16 are: > > [FUNC] usleep_range > drivers/net/ethernet/cadence/macb_main.c, 648: > usleep_range in macb_halt_tx > drivers/net/ethernet/cadence/macb_main.c, 730: > macb_halt_tx in macb_tx_error_task > drivers/net/ethernet/cadence/macb_main.c, 721: > _raw_spin_lock_irqsave in macb_tx_error_task > > To fix this bug, usleep_range() is replaced with udelay(). > > This bug is found by my static analysis tool DSAC. > > Signed-off-by: Jia-Ju Bai Applied, thanks.