Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3696102imu; Mon, 14 Jan 2019 07:31:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN7LE0opJDthVng1/dxgihHugul7i7Lgp2bn7ZvOZOb92TcxTbVDPNPyitj1OtSKoqAlHU+B X-Received: by 2002:a63:fd0a:: with SMTP id d10mr23554709pgh.164.1547479896967; Mon, 14 Jan 2019 07:31:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547479896; cv=none; d=google.com; s=arc-20160816; b=sRGmxcQj7ppGiNx6CZry8s71RrC7RVpJAnWNpj3wXh23pkMehNlg8+aJlU0N4buJGZ l0n7EfB/OjoKENNUUBp/G+J2boPbUSPyXwiECGRkosJumyUDzhXmMwnxBVdu5Qxi/0uQ IcVGxdg+IPRx1rAV4cwwsC2eoGP2TJkMHxXEW2DFrSLbV3myq8fAhAtpnK6/WM7V3IYN LegFozk/Eom9JtDaSBXzR0gZgpWUD+m/tZzsYnQMkyi+c2keLblL40vMA0qMNjTSzh/N D01Pxl74YG83KmUY/ii4dPiXnOI0MXteUsQlMWaxv/sfF0abS/V6wIXKImyPwveL0z5F 5ZNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8bJ5x4QhH1lSLXEmkoF26Xy+Uw4AGp/rjF1C8MY36Ww=; b=tNzNYJAZlFZROjzLfBu5UKqjddUyTeinRLKEgNaNclzFG7/SuBp4+uTkDRXcjzsRaW 33o1VHOe71zUAciM4/cVrImHFWgGa1Sx3HT1U0TXLsEZ7HJufrWh6ZBW/YSA45pYzLfC pbu5AlZLuXIUtPH7v/5Kmy+i7hN5niN5+oKXaEofq4pGtpKlfv6HZ4elYFCm3CU0Szjh Q7hYsLdOO4TLfhBMwN08Cz4Y94WxPSrxjUaWRGrzRrFaU8hC4f2k750sEiHS/lusc/9j tbbBaIZxXudnz12REfCrEfseVbvKXZ7KrIyGipKrI0Ai0m32PJqEnuj0zZMMyYNS77i0 LK3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KmyuuGrp; 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 e11si599430pgf.450.2019.01.14.07.31.21; Mon, 14 Jan 2019 07:31:36 -0800 (PST) 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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KmyuuGrp; 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 S1726763AbfANP3q (ORCPT + 99 others); Mon, 14 Jan 2019 10:29:46 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:54884 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726595AbfANP3q (ORCPT ); Mon, 14 Jan 2019 10:29:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8bJ5x4QhH1lSLXEmkoF26Xy+Uw4AGp/rjF1C8MY36Ww=; b=KmyuuGrp3yqk0dpcSMP0v1gWP jO31ViLRfjOrB4J7BRgnYbqEVz+KvOemC4Asa3o9ZpA3mpNunLVRH3xUG4AtZ/hett1HECe1Ug6Xz cV687EAkmQfPFWLvHdG/UomkDwxWOLeK1WI86OF3rQ9BOGK/Rpw99c6WbSFaj/9HWQt5Re1Yo3kfz ewh+BqJpqGzq0YzjP/pECYKJ2bKLkw95SaQDldu59kApCuDa2wqBkpLPYr3+6oKgaeqF5XbzqAQ5u Mwl2e1AOPVpgOPDFymHozwnDjvnIUbN7NQm74i2j45w96pqTo4OU6RSQix9K8CsjTwCXhZMf6WEab TdYL8CeZQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj4BL-0003Wr-Mo; Mon, 14 Jan 2019 15:29:43 +0000 Date: Mon, 14 Jan 2019 07:29:43 -0800 From: Christoph Hellwig To: wangbo Cc: linux-kernel@vger.kernel.org, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, wang.bo116@zte.com.cn, Ondrej Zary Subject: Re: [PATCH] scsi: wd719x Replace GFP_KERNEL with GFP_ATOMIC in wd719x_chip_init Message-ID: <20190114152943.GA10454@infradead.org> References: <1547479489-11560-1-git-send-email-wdjjwb@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1547479489-11560-1-git-send-email-wdjjwb@163.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 14, 2019 at 11:24:49PM +0800, wangbo wrote: > wd719x_host_reset get spinlock first then call wd719x_chip_init, > so replace GFP_KERNEL with GFP_ATOMIC in wd719x_chip_init. Please move the allocation outside the lock instead. GFP_ATOMIC DMA allocations are generally a bad idea and should be avoided where we can. More importantly we should never actually trigger the allocation under the lock as far as fw_virt will always be set already in that case. So I think you can safely move the request firmware + allocation + memcpy from wd719x_chip_init to wd719x_board_found, but I'd rather have Ondrej review that plan.