Received: by 10.192.165.156 with SMTP id m28csp580412imm; Fri, 13 Apr 2018 04:27:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx48oOz+GeH5q/ge+DuJBqH9UavPDQJl79eXJPWbGJlJLr8Ml5NX0V3YltTNCPm1Sm6v/tHNS X-Received: by 10.101.73.141 with SMTP id r13mr3898565pgs.426.1523618853832; Fri, 13 Apr 2018 04:27:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523618853; cv=none; d=google.com; s=arc-20160816; b=NJxBiL73bCBvdx/aKrPeEpDO3j7jdtS3RcKHwZF0KryFYCXhpnAPfazo8V4D0BTW5N luRiWsMvuZNUCHhqQz5MU4CAZdlD3lwdO6Vuk1pXJkyeKFzpGWcIonx2hZaLivoa/tD0 adpMlhGbgfrgBXiKByr1Yd2/t10J1Prrk0t3ZHn2ovUyp8VxMaTd+os/GQxK3bJ9oWKe BkoF7xlfXPyTMwqO5VV05Dxdq2KW+/icgGpPosHtF1aWI+MgVPQqkbztFLII9bHpzwaM KodMZm6gLCufK4JGy5jJhWS7hQUCCr4kYB0bM5rZVFG9cX6n+SZyJawhZc+8KuXfNKPz ECQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=gUbFoZ6vykP0PBU6V2NmTZNIYmoK1hxnVatcPyXEXF0=; b=REVhOxxfo2fXGntVIX3GvRP7FMKRbkaL9CPZuKOx2TjDMx3pLJ+7oFpSKoCGe4Q6PW 0luVLcGv7Sa+mi7Nd+TnCFHcJtFLcp/EKlNR4GgjB9MwnTnF/Sioq9vVrsaraQw5o9iU aOPvhXZ/Vioxi8y/4Ih098fjJscga/vC0NQ33a42scsM+5QG5vfxfq6POVZaYZo6NB3u OI7gWxChLVEb6rpEVs0Rsa491zzFWzUi9shKeuWDWoTKgpDpFOYsEnEv1vGphmbZFVDM EafEvj2Q+YMDtYRcmS2HVXOJQp8py/GuLTyGldo8L8gaUnugY6RiCqqn0vCnOjkvAmgo f/9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=dG+t3yM1; 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 e63-v6si5476795plb.91.2018.04.13.04.27.19; Fri, 13 Apr 2018 04:27:33 -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; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=dG+t3yM1; 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 S1754710AbeDMLZq (ORCPT + 99 others); Fri, 13 Apr 2018 07:25:46 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:41830 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754568AbeDMLZp (ORCPT ); Fri, 13 Apr 2018 07:25:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=gUbFoZ6vykP0PBU6V2NmTZNIYmoK1hxnVatcPyXEXF0=; b=dG+t3yM1GqRR n5spl5PZVql8xv7r1thqw8EXaM9VJXxycmvV6faAfwTp/9PsvfePqD/1+diVIGsnDSJ+EOyT8YivW nkeF/cMrDXHCG63EMev7ub5Z7Cpyxova4DXWhHB9c1Z4lZwl5b2Mk7GTWT8LNlF4Th5XFdCdf6F9l XkcSg=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1f6wpr-0008ET-Ft; Fri, 13 Apr 2018 11:25:43 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1f6wpr-0000VC-1j; Fri, 13 Apr 2018 12:25:43 +0100 From: Mark Brown To: Jia-Ju Bai Cc: Mark Brown , broonie@kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org Subject: Applied "spi: spi-topcliff-pch: Replace GFP_ATOMIC with GFP_KERNEL in pch_spi_handle_dma" to the spi tree In-Reply-To: <1523351176-29741-1-git-send-email-baijiaju1990@gmail.com> Message-Id: Date: Fri, 13 Apr 2018 12:25:43 +0100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch spi: spi-topcliff-pch: Replace GFP_ATOMIC with GFP_KERNEL in pch_spi_handle_dma has been applied to the spi tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From d16cd3eb8e5c62cd349987f57e3511b59cbe0198 Mon Sep 17 00:00:00 2001 From: Jia-Ju Bai Date: Tue, 10 Apr 2018 17:06:16 +0800 Subject: [PATCH] spi: spi-topcliff-pch: Replace GFP_ATOMIC with GFP_KERNEL in pch_spi_handle_dma pch_spi_handle_dma() is never called in atomic context. This function is only called by pch_spi_process_messages(). pch_spi_process_messages() is only set as a parameter of INIT_WORK() in pch_spi_pd_probe(). Despite never getting called from atomic context, pch_spi_handle_dma() calls kcalloc() 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 Signed-off-by: Mark Brown --- drivers/spi/spi-topcliff-pch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index 97d137591b18..dc93ca9e001c 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c @@ -1007,7 +1007,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw) spin_unlock_irqrestore(&data->lock, flags); /* RX */ - dma->sg_rx_p = kcalloc(num, sizeof(*dma->sg_rx_p), GFP_ATOMIC); + dma->sg_rx_p = kcalloc(num, sizeof(*dma->sg_rx_p), GFP_KERNEL); sg_init_table(dma->sg_rx_p, num); /* Initialize SG table */ /* offset, length setting */ sg = dma->sg_rx_p; @@ -1067,7 +1067,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw) head = 0; } - dma->sg_tx_p = kcalloc(num, sizeof(*dma->sg_tx_p), GFP_ATOMIC); + dma->sg_tx_p = kcalloc(num, sizeof(*dma->sg_tx_p), GFP_KERNEL); sg_init_table(dma->sg_tx_p, num); /* Initialize SG table */ /* offset, length setting */ sg = dma->sg_tx_p; -- 2.17.0