Received: by 10.192.165.156 with SMTP id m28csp553084imm; Fri, 13 Apr 2018 04:00:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx49z4ONxmWwME/YaWK58Zsuc6Tg+BKZHVCfSgNh8xmqlDjU3tkPyNX1xDlgGmwxJiCnrGwBt X-Received: by 2002:a17:902:549:: with SMTP id 67-v6mr4875371plf.276.1523617209648; Fri, 13 Apr 2018 04:00:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523617209; cv=none; d=google.com; s=arc-20160816; b=uLlSKKMyz0eFq0k+ZWejMSKH5oHTXJVoXMIfZIi5TS/SwdgZFlbYKOkasJ2GOVYEu0 rYx+sARSD57gvR0myZObeJLhKZEqabst/57kkPRCBcgAXiDYaumG7TPUnHIacClI2Be4 EmL3KAXqYRigng8hyWPfDS50IPXdqlVXvZfOBT4MmzqOA60ANDfQ18qzfOc7m1V8sFAr MLDkGX0HYziF4QIZ03y5k6ko+BRzIxmWByclZa1xhBvxowxB+Fdds5ZKx/t7HY8E6khG +wqWs4QrJf+gu8F7BUdKFdpd4ySil2AL91rgXUrUfIDDUIP+SS1A/kuHuAEIGcoRdMz2 K/tQ== 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=IHwgOOvHkOH2/cHVZvuB0x6z+4Y3gBlH6gbWnLtxlI/t/HY8X2bC1xKWV/xqA3w/mD srRPxvi4SJ2KIb5VTNQOid9e5VRAh+x0C89ILxzYpnuiX0DgjHi035b+e7pLVfBMvPVt TOXNd1zkeWD5QMH8uhF84aIaQbzaGnEN0qSZqcREtzXe56DvW1eEysJ4GiVLrNkgMWU9 6zYj3l31G9Doh8h+6wwD2uwcfP9hj9B1UsWibVIK2ZVnmLqAzciLycY2Dw4fOkFiDyEp m3TG50POvlyhcbEjS4MXLdjWo+FmNymr54+6ln3XWA5fkENHSL5B6kDwSCw6ebAgkMp4 HVkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=w0lgch/V; 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 n186si3952773pgn.189.2018.04.13.03.59.55; Fri, 13 Apr 2018 04:00:09 -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=w0lgch/V; 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 S1754572AbeDMK5s (ORCPT + 99 others); Fri, 13 Apr 2018 06:57:48 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:51062 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753602AbeDMK5q (ORCPT ); Fri, 13 Apr 2018 06:57:46 -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=w0lgch/V0xsr AflKfMJrY9meRz6itAHLABddjn4r8c06CA+lRVq4ngOZA3X7O3cW62tf/QHsWRFbrURDdlNAjiUr2 mnzM47S3I9exu/8rxWnTP5PdXVdVAdEGwXNdQymLzJtB7R0/z8Hbmi20mWOJfrzui0VDKoBiFaC1q 2sxug=; 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 1f6wOm-00088c-G1; Fri, 13 Apr 2018 10:57:44 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1f6wOm-0007OQ-1a; Fri, 13 Apr 2018 11:57:44 +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 11:57:44 +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