From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751537AbeAYPbW (ORCPT ); Thu, 25 Jan 2018 10:31:22 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:36915 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751112AbeAYPbT (ORCPT ); Thu, 25 Jan 2018 10:31:19 -0500 X-Google-Smtp-Source: AH8x225+FPThrJ45CNGmSJ3jMf1rLnm1zGfds72dAHeMwW3sMGMlUB3/0B9+ac439KT0hW21HghO1Q== Date: Thu, 25 Jan 2018 07:31:15 -0800 From: Tejun Heo To: Jia-Ju Bai Cc: b.zolnierkie@samsung.com, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ata: pata_it821x: Replace mdelay with usleep_range in it821x_firmware_command Message-ID: <20180125153115.GF17457@devbig577.frc2.facebook.com> References: <1516876379-12834-1-git-send-email-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1516876379-12834-1-git-send-email-baijiaju1990@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 25, 2018 at 06:32:59PM +0800, Jia-Ju Bai wrote: > After checking all possible call chains to it821x_firmware_command here, > my tool finds that it821x_firmware_command > is never called in atomic context, > namely never in an interrupt handler or holding a spinlock. > And it821x_firmware_command calls kmalloc(GFP_KERNEL), > so it proves again that it821x_firmware_command > can call functions which can sleep. > Thus mdelay can be replaced with usleep_range to avoid busy wait. > > This is found by a static analysis tool named DCNS written by myself. > > Signed-off-by: Jia-Ju Bai Applied to libata/for-4.16. Thanks. -- tejun