From patchwork Sat Feb 19 00:52:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1C81C433EF for ; Sat, 19 Feb 2022 00:52:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 48A876B0075; Fri, 18 Feb 2022 19:52:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 43A0B6B0078; Fri, 18 Feb 2022 19:52:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2DAFD6B007B; Fri, 18 Feb 2022 19:52:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0048.hostedemail.com [216.40.44.48]) by kanga.kvack.org (Postfix) with ESMTP id 205086B0075 for ; Fri, 18 Feb 2022 19:52:56 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id CD260181C49A7 for ; Sat, 19 Feb 2022 00:52:55 +0000 (UTC) X-FDA: 79157704710.06.17644DF Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf04.hostedemail.com (Postfix) with ESMTP id 78AFB40002 for ; Sat, 19 Feb 2022 00:52:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645231975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=bfdSe7lRaptVEMlnEPCAWLVs5ZfvUfB2TPSykKyb3y4=; b=ivMbaMzeXZob72z6frAt68oOJqwK7BFd5AWGM+oa1IOG79JYgBUU8dCtaUrZqg+KAMtcPk LMz/wUxSCkWoQV52L2fRUm3PO/77lqDL0Nv4hRiIsj5shwJcA60hI3b3rv1ubawaHx3NcK 7FCxY1AKbSZUSuX3NfQcSG1BIXjot5k= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-665-PS1k_-o0MFKRgOLXBFCeEw-1; Fri, 18 Feb 2022 19:52:51 -0500 X-MC-Unique: PS1k_-o0MFKRgOLXBFCeEw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65B031800D50; Sat, 19 Feb 2022 00:52:48 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71C1B62D4E; Sat, 19 Feb 2022 00:52:39 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 01/22] parisc: pci-dma: remove stale code and comment Date: Sat, 19 Feb 2022 08:52:00 +0800 Message-Id: <20220219005221.634-2-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 78AFB40002 X-Stat-Signature: rrsyhitbh4kwrdp6f8ncowjqmm39rmyy Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ivMbaMze; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf04.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com X-HE-Tag: 1645231975-578590 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The gfp assignment has been commented out in ancient times, combined with the code comment, obviously it's not needed since then. Let's remove the whole ifdeffery block so that GFP_DMA searching won't point to this. Signed-off-by: Baoquan He Reviewed-by: Christoph Hellwig --- arch/parisc/kernel/pci-dma.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c index 36a57aa38e87..6c7c6314ef33 100644 --- a/arch/parisc/kernel/pci-dma.c +++ b/arch/parisc/kernel/pci-dma.c @@ -417,14 +417,6 @@ void *arch_dma_alloc(struct device *dev, size_t size, map_uncached_pages(vaddr, size, paddr); *dma_handle = (dma_addr_t) paddr; -#if 0 -/* This probably isn't needed to support EISA cards. -** ISA cards will certainly only support 24-bit DMA addressing. -** Not clear if we can, want, or need to support ISA. -*/ - if (!dev || *dev->coherent_dma_mask < 0xffffffff) - gfp |= GFP_DMA; -#endif return (void *)vaddr; } From patchwork Sat Feb 19 00:52:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752062 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AC60C433EF for ; Sat, 19 Feb 2022 00:53:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 80C316B0078; Fri, 18 Feb 2022 19:53:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7BC766B007B; Fri, 18 Feb 2022 19:53:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 684876B007D; Fri, 18 Feb 2022 19:53:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 59F2E6B0078 for ; Fri, 18 Feb 2022 19:53:11 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0E6A18248D52 for ; Sat, 19 Feb 2022 00:53:11 +0000 (UTC) X-FDA: 79157705382.25.55ACACA Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 986DD80003 for ; Sat, 19 Feb 2022 00:53:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645231990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=4eBpIp3xNf3Z3MhpRo9fDF4+jM3Uhq696cCINmzzUGw=; b=Vww50PAyKq6JJxC1Udi+esMHDAEYENIOGOgt+hUPkJ8F4wKVL9mcpdlj0zvZyKyfWSV/Kc 9LpCXUdGzw0tZ20hp6mJxhGpxctw5qn/JgsWfYf60Z8TneCbphJxig0wxWvOIEljACqluo Y/ChG6jhINFJRiBBZYJeQQu6LHHmmVU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-553-SBz-l_hRPqC3JCneYaqqow-1; Fri, 18 Feb 2022 19:53:05 -0500 X-MC-Unique: SBz-l_hRPqC3JCneYaqqow-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 093B31091DA0; Sat, 19 Feb 2022 00:53:02 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0852B62D4E; Sat, 19 Feb 2022 00:52:48 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 02/22] net: moxa: Don't use GFP_DMA when calling dma_alloc_coherent() Date: Sat, 19 Feb 2022 08:52:01 +0800 Message-Id: <20220219005221.634-3-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Stat-Signature: z9837qcx5fhjncfdquqwbgg356ugngu7 X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Vww50PAy; spf=none (imf02.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 986DD80003 X-HE-Tag: 1645231990-940586 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Hyeonggon Yoo <42.hyeyoo@gmail.com> dma_alloc_coherent() allocates dma buffer with device's addressing limitation in mind. It's redundent to specify GFP_DMA when calling dma_alloc_coherent(). Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Baoquan He Reviewed-by: Christoph Hellwig --- drivers/net/ethernet/moxa/moxart_ether.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c index 15179b9529e1..8fc2c2e71c2d 100644 --- a/drivers/net/ethernet/moxa/moxart_ether.c +++ b/drivers/net/ethernet/moxa/moxart_ether.c @@ -495,7 +495,7 @@ static int moxart_mac_probe(struct platform_device *pdev) priv->tx_desc_base = dma_alloc_coherent(&pdev->dev, TX_REG_DESC_SIZE * TX_DESC_NUM, &priv->tx_base, - GFP_DMA | GFP_KERNEL); + GFP_KERNEL); if (!priv->tx_desc_base) { ret = -ENOMEM; goto init_fail; @@ -503,7 +503,7 @@ static int moxart_mac_probe(struct platform_device *pdev) priv->rx_desc_base = dma_alloc_coherent(&pdev->dev, RX_REG_DESC_SIZE * RX_DESC_NUM, &priv->rx_base, - GFP_DMA | GFP_KERNEL); + GFP_KERNEL); if (!priv->rx_desc_base) { ret = -ENOMEM; goto init_fail; From patchwork Sat Feb 19 00:52:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF4B8C433EF for ; Sat, 19 Feb 2022 00:53:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 43EC86B007B; Fri, 18 Feb 2022 19:53:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3EED96B007D; Fri, 18 Feb 2022 19:53:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 275416B007E; Fri, 18 Feb 2022 19:53:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0133.hostedemail.com [216.40.44.133]) by kanga.kvack.org (Postfix) with ESMTP id 19ECB6B007B for ; Fri, 18 Feb 2022 19:53:20 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C29EA181C441B for ; Sat, 19 Feb 2022 00:53:19 +0000 (UTC) X-FDA: 79157705718.15.9E9501F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf27.hostedemail.com (Postfix) with ESMTP id 3F51440004 for ; Sat, 19 Feb 2022 00:53:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645231998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=1aAgMpwStNlcYKTvxIIYOe7gqT8/S9pjkqPo7BOpV0E=; b=ENEq86ExkwvCZNwMVfWHPxg1i1ouPvkpFRv8BENuGeBtU7m94VBWNyb8pqGPH00RbUW04C VMjKcjWlItfH7XNVoyAQUTLt163kuhBiNxDpND5PMm7ZAD6unOQMwM0BmsJ/uktvJOlSfq 0rrgj/PVqyFQ/Cxibjr0ys8FMz7a/PY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-76-F1pOwS_JM2ejnP-s-8PL5g-1; Fri, 18 Feb 2022 19:53:15 -0500 X-MC-Unique: F1pOwS_JM2ejnP-s-8PL5g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6E9F0801ADA; Sat, 19 Feb 2022 00:53:12 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9AD4762D5B; Sat, 19 Feb 2022 00:53:02 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 03/22] gpu: ipu-v3: Don't use GFP_DMA when calling dma_alloc_coherent() Date: Sat, 19 Feb 2022 08:52:02 +0800 Message-Id: <20220219005221.634-4-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ENEq86Ex; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf27.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 3F51440004 X-Stat-Signature: wubba5w4k3sew3hycxifxygk5gwherh6 X-HE-Tag: 1645231999-931670 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_alloc_coherent() allocates dma buffer with device's addressing limitation in mind. It's redundent to specify GFP_DMA when calling dma_alloc_coherent(). [ 42.hyeyoo@gmail.com: Update changelog ] Signed-off-by: Baoquan He Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Christoph Hellwig --- drivers/gpu/ipu-v3/ipu-image-convert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c index aa1d4b6d278f..1bd3eff2cf47 100644 --- a/drivers/gpu/ipu-v3/ipu-image-convert.c +++ b/drivers/gpu/ipu-v3/ipu-image-convert.c @@ -382,7 +382,7 @@ static int alloc_dma_buf(struct ipu_image_convert_priv *priv, { buf->len = PAGE_ALIGN(size); buf->virt = dma_alloc_coherent(priv->ipu->dev, buf->len, &buf->phys, - GFP_DMA | GFP_KERNEL); + GFP_KERNEL); if (!buf->virt) { dev_err(priv->ipu->dev, "failed to alloc dma buffer\n"); return -ENOMEM; From patchwork Sat Feb 19 00:52:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752064 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9402AC433EF for ; Sat, 19 Feb 2022 00:53:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2195C6B007D; Fri, 18 Feb 2022 19:53:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C91A6B007E; Fri, 18 Feb 2022 19:53:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 069B26B0080; Fri, 18 Feb 2022 19:53:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id ECD806B007D for ; Fri, 18 Feb 2022 19:53:38 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B7D8022D3E for ; Sat, 19 Feb 2022 00:53:38 +0000 (UTC) X-FDA: 79157706516.01.B464ECB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf06.hostedemail.com (Postfix) with ESMTP id 31829180002 for ; Sat, 19 Feb 2022 00:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=WM5OzNcGdWEyk24mjUtD4gIgYAk78EXJWAr4Hqf+1I4=; b=LXgVIKJRoknc6FknDtFns5Sg6O8vfqIJt3chFsSfPn4UEvGdDpMFXjxewvld/4kRSryjUP Sx+TDh8FDp+Hn3XqWYEHKg6SVji4ZfKqRxJ7LAMOZ5dZPo1gpr+DN+r5lbRCcsgi/ttKAe Z+oZAs7ScZUFNoID6/T2w/7WYdYxtHg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-367-KKq__IXGMgKb-GYMZNuMew-1; Fri, 18 Feb 2022 19:53:34 -0500 X-MC-Unique: KKq__IXGMgKb-GYMZNuMew-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E8F41091DA0; Sat, 19 Feb 2022 00:53:31 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C7E362D57; Sat, 19 Feb 2022 00:53:12 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 04/22] drm/sti: Don't use GFP_DMA when calling dma_alloc_wc() Date: Sat, 19 Feb 2022 08:52:03 +0800 Message-Id: <20220219005221.634-5-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Queue-Id: 31829180002 X-Stat-Signature: 79rfp5sqbdyxs9we1mhsdsh65m8moa7c Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LXgVIKJR; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf06.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1645232018-173668 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_alloc_wc() allocates dma buffer with device's addressing limitation in mind. It's redundent to specify GFP_DMA when calling dma_alloc_wc(). [ 42.hyeyoo@gmail.com: Update changelog ] Signed-off-by: Baoquan He Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Christoph Hellwig --- drivers/gpu/drm/sti/sti_cursor.c | 4 ++-- drivers/gpu/drm/sti/sti_hqvdp.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c index 1d6051b4f6fe..d1123dc09d25 100644 --- a/drivers/gpu/drm/sti/sti_cursor.c +++ b/drivers/gpu/drm/sti/sti_cursor.c @@ -235,7 +235,7 @@ static int sti_cursor_atomic_check(struct drm_plane *drm_plane, cursor->pixmap.base = dma_alloc_wc(cursor->dev, cursor->pixmap.size, &cursor->pixmap.paddr, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (!cursor->pixmap.base) { DRM_ERROR("Failed to allocate memory for pixmap\n"); return -EINVAL; @@ -375,7 +375,7 @@ struct drm_plane *sti_cursor_create(struct drm_device *drm_dev, /* Allocate clut buffer */ size = 0x100 * sizeof(unsigned short); cursor->clut = dma_alloc_wc(dev, size, &cursor->clut_paddr, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (!cursor->clut) { DRM_ERROR("Failed to allocate memory for cursor clut\n"); diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index 3c61ba8b43e0..324e9dc238e4 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -857,7 +857,7 @@ static void sti_hqvdp_init(struct sti_hqvdp *hqvdp) size = NB_VDP_CMD * sizeof(struct sti_hqvdp_cmd); hqvdp->hqvdp_cmd = dma_alloc_wc(hqvdp->dev, size, &dma_addr, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (!hqvdp->hqvdp_cmd) { DRM_ERROR("Failed to allocate memory for VDP cmd\n"); return; From patchwork Sat Feb 19 00:52:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752065 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80859C433F5 for ; Sat, 19 Feb 2022 00:53:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1553C6B0074; Fri, 18 Feb 2022 19:53:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1061E6B007E; Fri, 18 Feb 2022 19:53:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F0F1B6B0080; Fri, 18 Feb 2022 19:53:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0222.hostedemail.com [216.40.44.222]) by kanga.kvack.org (Postfix) with ESMTP id E30466B0074 for ; Fri, 18 Feb 2022 19:53:47 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 95B0D1808E6A4 for ; Sat, 19 Feb 2022 00:53:47 +0000 (UTC) X-FDA: 79157706894.17.C47A9B2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 2F0D1C0004 for ; Sat, 19 Feb 2022 00:53:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=NdP5fx3CoXtYlNypwjqTuwAkIp3TjKk+As58kSmQ3g0=; b=X3POWlRAjZHg2YRvDW4Lj3x1ZKAhJ6Gha8EK2I+j3MKIfLt6C/xMu/hgbjZcytJJObNqlK nyboNZ13/aUEXMgb7qQlBp9iDkvpS5l4z89WAKn/cDqq64LAsMVB38O1wPw2+WqJmhEhO+ +kD5blOd6egoK/w21wXeETul7RUHzh0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-410-Zbbpt2eENYW047xo0ojcvA-1; Fri, 18 Feb 2022 19:53:43 -0500 X-MC-Unique: Zbbpt2eENYW047xo0ojcvA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A0B871006AA0; Sat, 19 Feb 2022 00:53:40 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id E641B62D4E; Sat, 19 Feb 2022 00:53:31 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 05/22] sound: n64: Don't use GFP_DMA when calling dma_alloc_coherent() Date: Sat, 19 Feb 2022 08:52:04 +0800 Message-Id: <20220219005221.634-6-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Stat-Signature: gk7j3xq9t8kpx9ejd8ytkts6h8puna6c X-Rspam-User: Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=X3POWlRA; spf=none (imf28.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 2F0D1C0004 X-HE-Tag: 1645232027-265291 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_alloc_coherent() allocates dma buffer with device's addressing limitation in mind. It's redundent to specify GFP_DMA when calling dma_alloc_coherent(). [ 42.hyeyoo@gmail.com: Update changelog ] Signed-off-by: Baoquan He Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Christoph Hellwig --- sound/mips/snd-n64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/mips/snd-n64.c b/sound/mips/snd-n64.c index 463a6fe589eb..20386a855191 100644 --- a/sound/mips/snd-n64.c +++ b/sound/mips/snd-n64.c @@ -305,7 +305,7 @@ static int __init n64audio_probe(struct platform_device *pdev) priv->card = card; priv->ring_base = dma_alloc_coherent(card->dev, 32 * 1024, &priv->ring_base_dma, - GFP_DMA|GFP_KERNEL); + GFP_KERNEL); if (!priv->ring_base) { err = -ENOMEM; goto fail_card; From patchwork Sat Feb 19 00:52:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752100 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30AC7C433FE for ; Sat, 19 Feb 2022 00:54:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 993276B0075; Fri, 18 Feb 2022 19:54:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 943846B007E; Fri, 18 Feb 2022 19:54:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 80A116B0080; Fri, 18 Feb 2022 19:54:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id 74E9C6B0075 for ; Fri, 18 Feb 2022 19:54:03 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 30E63180927B2 for ; Sat, 19 Feb 2022 00:54:03 +0000 (UTC) X-FDA: 79157707566.21.8351DFD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf16.hostedemail.com (Postfix) with ESMTP id 9861C180003 for ; Sat, 19 Feb 2022 00:54:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=RkSjfuvJfWNrND4mcgOb3gB+u7Aue34BmFxi/52mQX0=; b=MP4JKew+k1GPal47km2wlxUDhyZwFZ8agmYje8BtAgQU5zkQ69RBOZyhW7r38VDzBp5h0H mvzlMTmHhL6aQAWc54C/0LbJWcnIQRoOg8cDBiHchOoufOIsEGo0Di479CAvJQYnER9PZR q32uUxzLW9EIwUbARuAm17BFIVBnK70= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-21-mMnjkI6ePV2txamd9eaBHg-1; Fri, 18 Feb 2022 19:53:56 -0500 X-MC-Unique: mMnjkI6ePV2txamd9eaBHg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E45C61006AA3; Sat, 19 Feb 2022 00:53:53 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 406B362D4E; Sat, 19 Feb 2022 00:53:41 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 06/22] fbdev: da8xx: Don't use GFP_DMA when calling dma_alloc_coherent() Date: Sat, 19 Feb 2022 08:52:05 +0800 Message-Id: <20220219005221.634-7-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9861C180003 X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MP4JKew+; spf=none (imf16.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: p6zxbtou8oq6wg916nfonyp11obcfpf5 X-HE-Tag: 1645232042-79732 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_alloc_coherent() allocates dma buffer with device's addressing limitation in mind. It's redundent to specify GFP_DMA when calling dma_alloc_coherent(). [ 42.hyeyoo@gmail.com: Update changelog ] Signed-off-by: Baoquan He Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Christoph Hellwig --- drivers/video/fbdev/da8xx-fb.c | 4 ++-- drivers/video/fbdev/fsl-diu-fb.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c index 005ac3c17aa1..7cb7e63117c9 100644 --- a/drivers/video/fbdev/da8xx-fb.c +++ b/drivers/video/fbdev/da8xx-fb.c @@ -1426,7 +1426,7 @@ static int fb_probe(struct platform_device *device) par->vram_virt = dmam_alloc_coherent(par->dev, par->vram_size, &par->vram_phys, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (!par->vram_virt) { dev_err(&device->dev, "GLCD: kmalloc for frame buffer failed\n"); @@ -1446,7 +1446,7 @@ static int fb_probe(struct platform_device *device) /* allocate palette buffer */ par->v_palette_base = dmam_alloc_coherent(par->dev, PALETTE_SIZE, &par->p_palette_base, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (!par->v_palette_base) { dev_err(&device->dev, "GLCD: kmalloc for palette buffer failed\n"); diff --git a/drivers/video/fbdev/fsl-diu-fb.c b/drivers/video/fbdev/fsl-diu-fb.c index e332017c6af6..a79fa162a5d1 100644 --- a/drivers/video/fbdev/fsl-diu-fb.c +++ b/drivers/video/fbdev/fsl-diu-fb.c @@ -1692,7 +1692,7 @@ static int fsl_diu_probe(struct platform_device *pdev) int ret; data = dmam_alloc_coherent(&pdev->dev, sizeof(struct fsl_diu_data), - &dma_addr, GFP_DMA | __GFP_ZERO); + &dma_addr, __GFP_ZERO); if (!data) return -ENOMEM; data->dma_addr = dma_addr; From patchwork Sat Feb 19 00:52:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752101 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BE78C433EF for ; Sat, 19 Feb 2022 00:54:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DB1456B007E; Fri, 18 Feb 2022 19:54:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D60B36B0080; Fri, 18 Feb 2022 19:54:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C290A6B0081; Fri, 18 Feb 2022 19:54:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0192.hostedemail.com [216.40.44.192]) by kanga.kvack.org (Postfix) with ESMTP id B4AE46B007E for ; Fri, 18 Feb 2022 19:54:12 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6A1E8180927B2 for ; Sat, 19 Feb 2022 00:54:12 +0000 (UTC) X-FDA: 79157707944.14.F4A877D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf30.hostedemail.com (Postfix) with ESMTP id F2D9C80005 for ; Sat, 19 Feb 2022 00:54:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=dwAXIJjvyzyC68EvehXD0rSk/MDUU+JZL7WQ4Cml0BM=; b=CvZS4ALBMj+Wz71dE11JkMcgEOrX9Gr2S4iDYjNaXLYqbX9L5j8sotcw+VFuuZBdr5Ynf8 cjArdrjLSa/s6EFcJv+Ey+5/uXpHwvQBcCOsiy6fPAhroGrWbtx1VlhbfvIZWExnC5nIl7 yfLMkebvxJiwqUG1RsaxDHBlhdRndi0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-612-g-toJ0TtPDO6mczC3xLlzA-1; Fri, 18 Feb 2022 19:54:05 -0500 X-MC-Unique: g-toJ0TtPDO6mczC3xLlzA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 14A4A1091DA2; Sat, 19 Feb 2022 00:54:03 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 98F9262D4E; Sat, 19 Feb 2022 00:53:54 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 07/22] fbdev: mx3fb: Don't use GFP_DMA when calling dma_alloc_wc() Date: Sat, 19 Feb 2022 08:52:06 +0800 Message-Id: <20220219005221.634-8-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Queue-Id: F2D9C80005 X-Stat-Signature: o9xsqbtje95hhgi1ok1u794rpj7kxxaa X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CvZS4ALB; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf30.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com X-Rspamd-Server: rspam03 X-HE-Tag: 1645232051-826971 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_alloc_coherent() allocates dma buffer with device's addressing limitation in mind. It's redundent to specify GFP_DMA when calling dma_alloc_coherent(). [ 42.hyeyoo@gmail.com: Update changelog ] Signed-off-by: Baoquan He Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Christoph Hellwig --- drivers/video/fbdev/mx3fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c index fabb271337ed..dc0b13d9e8b7 100644 --- a/drivers/video/fbdev/mx3fb.c +++ b/drivers/video/fbdev/mx3fb.c @@ -1335,7 +1335,7 @@ static int mx3fb_map_video_memory(struct fb_info *fbi, unsigned int mem_len, dma_addr_t addr; fbi->screen_base = dma_alloc_wc(fbi->device, mem_len, &addr, - GFP_DMA | GFP_KERNEL); + GFP_KERNEL); if (!fbi->screen_base) { dev_err(fbi->device, "Cannot allocate %u bytes framebuffer memory\n", From patchwork Sat Feb 19 00:52:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752102 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59A00C433FE for ; Sat, 19 Feb 2022 00:54:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DFF0D6B0078; Fri, 18 Feb 2022 19:54:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DAED36B007B; Fri, 18 Feb 2022 19:54:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C76676B0080; Fri, 18 Feb 2022 19:54:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id BB1826B0078 for ; Fri, 18 Feb 2022 19:54:22 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A012520952 for ; Sat, 19 Feb 2022 00:54:22 +0000 (UTC) X-FDA: 79157708364.01.4621085 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf19.hostedemail.com (Postfix) with ESMTP id 1C1C31A0006 for ; Sat, 19 Feb 2022 00:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=UNFG6GyLdYiwjJ96/FmXYdVjAwfYA/QhNifECGTD8UQ=; b=VvMURlJc7S9fHqPq0Fyzhllz3PD0XUV1QvsC2W5Xi6+WC/ydg2YRWODBK9u3pSLgmKZiAp 4A1TbFFwFrG9OV8gP56DhemiGRo2pBXvPCG9GddmL4AvA2A2jX+/iTRcitWtO8gvLIClge jvosa00JLbXqrE8FnNK8iNFX1B6Ue8U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-607-oo9sKuNbMJ-2ckIEIYU71A-1; Fri, 18 Feb 2022 19:54:18 -0500 X-MC-Unique: oo9sKuNbMJ-2ckIEIYU71A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 689C71091DA1; Sat, 19 Feb 2022 00:54:15 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA4F562D4E; Sat, 19 Feb 2022 00:54:03 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 08/22] usb: gadget: lpc32xx_udc: Don't use GFP_DMA when calling dma_alloc_coherent() Date: Sat, 19 Feb 2022 08:52:07 +0800 Message-Id: <20220219005221.634-9-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=VvMURlJc; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf19.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 1C1C31A0006 X-Stat-Signature: uhx1fz5bhemy6hgszuis8y88i13ua387 X-HE-Tag: 1645232061-296333 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_alloc_coherent() allocates dma buffer with device's addressing limitation in mind. It's redundent to specify GFP_DMA when calling dma_alloc_coherent(). [ 42.hyeyoo@gmail.com: Update changelog ] Signed-off-by: Baoquan He Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Christoph Hellwig --- drivers/usb/gadget/udc/lpc32xx_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c index a25d01c89564..bcba5f9bc5a3 100644 --- a/drivers/usb/gadget/udc/lpc32xx_udc.c +++ b/drivers/usb/gadget/udc/lpc32xx_udc.c @@ -3080,7 +3080,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev) /* Allocate memory for the UDCA */ udc->udca_v_base = dma_alloc_coherent(&pdev->dev, UDCA_BUFF_SIZE, &dma_handle, - (GFP_KERNEL | GFP_DMA)); + GFP_KERNEL); if (!udc->udca_v_base) { dev_err(udc->dev, "error getting UDCA region\n"); retval = -ENOMEM; From patchwork Sat Feb 19 00:52:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B466C433EF for ; Sat, 19 Feb 2022 00:54:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 043916B007B; Fri, 18 Feb 2022 19:54:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F34F46B0080; Fri, 18 Feb 2022 19:54:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DFD856B0081; Fri, 18 Feb 2022 19:54:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0128.hostedemail.com [216.40.44.128]) by kanga.kvack.org (Postfix) with ESMTP id D392E6B007B for ; Fri, 18 Feb 2022 19:54:32 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9ECDE181A0DAE for ; Sat, 19 Feb 2022 00:54:32 +0000 (UTC) X-FDA: 79157708784.10.B4B8D0B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 253BB1C0006 for ; Sat, 19 Feb 2022 00:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=V8JpX32qMDcHw+sG2r5d1Aclzssu5Nunlxd6Q2UdrcU=; b=DJ52TcmS06/0nsV8vTkwbG+udS5vsEs73Nq/OADa++fpq2JjWAjdNTq64LJekwbAizGD79 C3LACAP1LNAIdS0DDttt3fHolooRVSfNlw38+nb5/kuRYd3rABJYi4Q0HvZCxq3+bq0vYf p0jQ6m3bhU7rn6NZU22x4Non7bMqZiE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-124-83stk923PIuc_lur_mT1GA-1; Fri, 18 Feb 2022 19:54:28 -0500 X-MC-Unique: 83stk923PIuc_lur_mT1GA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7D3811006AA0; Sat, 19 Feb 2022 00:54:25 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC9FA62D4E; Sat, 19 Feb 2022 00:54:15 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 09/22] usb: cdns3: Don't use GFP_DMA when calling dma_alloc_coherent() Date: Sat, 19 Feb 2022 08:52:08 +0800 Message-Id: <20220219005221.634-10-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Stat-Signature: urg5otoficrezdcmxzw14k7ab99tob4d X-Rspam-User: Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DJ52TcmS; spf=none (imf20.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 253BB1C0006 X-HE-Tag: 1645232071-95930 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_alloc_coherent() allocates dma buffer with device's addressing limitation in mind. It's redundent to specify GFP_DMA when calling dma_alloc_coherent(). replace it with GFP_KERNEL. [ 42.hyeyoo@gmail.com: Update changelog ] Signed-off-by: Baoquan He Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> --- drivers/usb/cdns3/cdns3-gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c index f9af7ebe003d..c0937d3d663f 100644 --- a/drivers/usb/cdns3/cdns3-gadget.c +++ b/drivers/usb/cdns3/cdns3-gadget.c @@ -3203,7 +3203,7 @@ static int cdns3_gadget_start(struct cdns *cdns) /* allocate memory for setup packet buffer */ priv_dev->setup_buf = dma_alloc_coherent(priv_dev->sysdev, 8, - &priv_dev->setup_dma, GFP_DMA); + &priv_dev->setup_dma, GFP_KERNEL); if (!priv_dev->setup_buf) { ret = -ENOMEM; goto err2; From patchwork Sat Feb 19 00:52:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752104 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63F13C433FE for ; Sat, 19 Feb 2022 00:54:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F10A16B007D; Fri, 18 Feb 2022 19:54:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E98DD6B0080; Fri, 18 Feb 2022 19:54:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D5FEA6B0081; Fri, 18 Feb 2022 19:54:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0101.hostedemail.com [216.40.44.101]) by kanga.kvack.org (Postfix) with ESMTP id C8EFA6B007D for ; Fri, 18 Feb 2022 19:54:49 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 61821A0A30 for ; Sat, 19 Feb 2022 00:54:49 +0000 (UTC) X-FDA: 79157709498.30.286437A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 05A7EC0007 for ; Sat, 19 Feb 2022 00:54:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=2pwL3ayF0vFpdCvZEuEQM3AYO/LKt3t8PTd2FjbKSGQ=; b=G4DCpdW3CFsLVSjtm16QGdEMjjtiHjyv2QHuKQRSBqAfNicoq4z731jwZy+aTjaNSWujrw jVSTXZ1ycjN0AvO0EThhAAlIMHk8lFYVpxadkTvvoljDXH/kp0mkSHYU1fulFA+qG8AQx9 wrlBdE9oHn04BW7ryJn47DbqCEy0DT4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-553-j7gk3TXHOaWbkr2GCBxMXw-1; Fri, 18 Feb 2022 19:54:43 -0500 X-MC-Unique: j7gk3TXHOaWbkr2GCBxMXw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4BE01814245; Sat, 19 Feb 2022 00:54:40 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2659C62D4E; Sat, 19 Feb 2022 00:54:25 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 10/22] uio: pruss: Don't use GFP_DMA when calling dma_alloc_coherent() Date: Sat, 19 Feb 2022 08:52:09 +0800 Message-Id: <20220219005221.634-11-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Queue-Id: 05A7EC0007 X-Stat-Signature: 5wdz6wkro6seiq51i1q1apigpxge4yua X-Rspam-User: Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=G4DCpdW3; spf=none (imf10.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam05 X-HE-Tag: 1645232088-927648 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_alloc_coherent() allocates dma buffer with device's addressing limitation in mind. It's redundent to specify GFP_DMA when calling dma_alloc_coherent(). [ 42.hyeyoo@gmail.com: Update changelog ] Signed-off-by: Baoquan He Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Christoph Hellwig --- drivers/uio/uio_pruss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c index e9096f53b4cc..1de39875d436 100644 --- a/drivers/uio/uio_pruss.c +++ b/drivers/uio/uio_pruss.c @@ -168,7 +168,7 @@ static int pruss_probe(struct platform_device *pdev) } gdev->ddr_vaddr = dma_alloc_coherent(dev, extram_pool_sz, - &(gdev->ddr_paddr), GFP_KERNEL | GFP_DMA); + &(gdev->ddr_paddr), GFP_KERNEL); if (!gdev->ddr_vaddr) { dev_err(dev, "Could not allocate external memory\n"); ret = -ENOMEM; From patchwork Sat Feb 19 00:52:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752105 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D5C2C433F5 for ; Sat, 19 Feb 2022 00:54:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 23D296B0074; Fri, 18 Feb 2022 19:54:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1EDBE6B0080; Fri, 18 Feb 2022 19:54:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0B6286B0081; Fri, 18 Feb 2022 19:54:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0098.hostedemail.com [216.40.44.98]) by kanga.kvack.org (Postfix) with ESMTP id F2EF26B0074 for ; Fri, 18 Feb 2022 19:54:56 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B9EAA181C49AB for ; Sat, 19 Feb 2022 00:54:56 +0000 (UTC) X-FDA: 79157709792.16.AD8DFC2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf23.hostedemail.com (Postfix) with ESMTP id 1A2DE140005 for ; Sat, 19 Feb 2022 00:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=v/k2K83RAFQXWw+FW9AtTE6sGHTDhK7lYEKZol/q3C8=; b=E0FCwhdd65bWyomZcmjpOzRnKaspIwIvaje4pltLCX3QjdR83Ce5bQStR01tqFxCB39hsz rfoLUSRMd7LspDEkGYbgUTBlcJSbxVuF6GzzDNDQ8xG9r4EXcRKHU7k4EcAnr0znwe0jeu A9xmbJqTK0/xsoDpKWooQ3hcXCLwwwQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-562-PSG0sG8zMOqRzb1iuQMW6w-1; Fri, 18 Feb 2022 19:54:52 -0500 X-MC-Unique: PSG0sG8zMOqRzb1iuQMW6w-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 730272F4F; Sat, 19 Feb 2022 00:54:49 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4E0962D4E; Sat, 19 Feb 2022 00:54:40 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 11/22] staging: emxx_udc: Don't use GFP_DMA when calling dma_alloc_coherent() Date: Sat, 19 Feb 2022 08:52:10 +0800 Message-Id: <20220219005221.634-12-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Queue-Id: 1A2DE140005 X-Stat-Signature: efj867ktpqrn1icw5wh174n9twagwtfw X-Rspam-User: Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=E0FCwhdd; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf23.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com X-Rspamd-Server: rspam03 X-HE-Tag: 1645232095-80851 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_alloc_coherent() allocates dma buffer with device's addressing limitation in mind. It's redundent to specify GFP_DMA when calling dma_alloc_coherent(). [ 42.hyeyoo@gmail.com: Update changelog ] Signed-off-by: Baoquan He Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Christoph Hellwig --- drivers/staging/media/imx/imx-media-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c index 94bc866ca28c..043281ec2e9d 100644 --- a/drivers/staging/media/imx/imx-media-utils.c +++ b/drivers/staging/media/imx/imx-media-utils.c @@ -588,7 +588,7 @@ int imx_media_alloc_dma_buf(struct device *dev, buf->len = PAGE_ALIGN(size); buf->virt = dma_alloc_coherent(dev, buf->len, &buf->phys, - GFP_DMA | GFP_KERNEL); + GFP_KERNEL); if (!buf->virt) { dev_err(dev, "%s: failed\n", __func__); return -ENOMEM; From patchwork Sat Feb 19 00:52:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752106 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 171ECC433EF for ; Sat, 19 Feb 2022 00:55:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DED06B0075; Fri, 18 Feb 2022 19:55:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 98ED06B007E; Fri, 18 Feb 2022 19:55:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 856E96B0080; Fri, 18 Feb 2022 19:55:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0197.hostedemail.com [216.40.44.197]) by kanga.kvack.org (Postfix) with ESMTP id 784E56B0075 for ; Fri, 18 Feb 2022 19:55:16 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3E98A181C49AB for ; Sat, 19 Feb 2022 00:55:16 +0000 (UTC) X-FDA: 79157710632.14.DFC6710 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf07.hostedemail.com (Postfix) with ESMTP id 9574040004 for ; Sat, 19 Feb 2022 00:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=ClO/R9JRyaaM8bjM+2BOla/lLPUNMsID41a68FPN8DI=; b=Dh+ABQw5VZ518G1+PsU35IwJo8n1nqIggUvQSuW9p1yo0s/x98gyKzsj1FL29IyeSSIGeW aue6SldB/jmalK9hycsIGXULwjF40ThRjwiPdMyL6MqqWRwYKvxt61T3Ew/UypwGaAM2J7 gJM/dAtdDiSrNQ53n+InWYdtnJ/Sle8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-86-a-TIrPYBP8-42XIzhwQwjA-1; Fri, 18 Feb 2022 19:55:12 -0500 X-MC-Unique: a-TIrPYBP8-42XIzhwQwjA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D73291091DA1; Sat, 19 Feb 2022 00:55:08 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 190B262D4E; Sat, 19 Feb 2022 00:54:49 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 12/22] staging: emxx_udc: Don't use GFP_DMA when calling dma_alloc_coherent() Date: Sat, 19 Feb 2022 08:52:11 +0800 Message-Id: <20220219005221.634-13-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Stat-Signature: 8feccrzau8tf5u1jhiotmtgu591owudz X-Rspam-User: Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Dh+ABQw5; spf=none (imf07.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 9574040004 X-HE-Tag: 1645232115-827278 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_alloc_coherent() allocates dma buffer with device's addressing limitation in mind. It's redundent to specify GFP_DMA when calling dma_alloc_coherent(). [ 42.hyeyoo@gmail.com: Update changelog ] Signed-off-by: Baoquan He Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Christoph Hellwig --- drivers/staging/emxx_udc/emxx_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index b6abd3770e81..673f8de50213 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -2593,7 +2593,7 @@ static int nbu2ss_ep_queue(struct usb_ep *_ep, if (!ep->virt_buf) ep->virt_buf = dma_alloc_coherent(udc->dev, PAGE_SIZE, &ep->phys_buf, - GFP_ATOMIC | GFP_DMA); + GFP_ATOMIC); if (ep->epnum > 0) { if (ep->direct == USB_DIR_IN) memcpy(ep->virt_buf, req->req.buf, From patchwork Sat Feb 19 00:52:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752107 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A719C433FE for ; Sat, 19 Feb 2022 00:55:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AA3726B0078; Fri, 18 Feb 2022 19:55:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A541A6B007E; Fri, 18 Feb 2022 19:55:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F3DD6B0080; Fri, 18 Feb 2022 19:55:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id 81AF46B0078 for ; Fri, 18 Feb 2022 19:55:27 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 46963181C49AB for ; Sat, 19 Feb 2022 00:55:27 +0000 (UTC) X-FDA: 79157711094.11.BDE75F1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf19.hostedemail.com (Postfix) with ESMTP id DB6D01A000C for ; Sat, 19 Feb 2022 00:55:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=DZGh4bIHBOmHOiALkgVaQHB6FPGaLxO56EvLhQh60X4=; b=EoKbME37I5Xcn7388CswoYBZY67ceyIW2LarS8PRkk8uzWm42FmDJA82HMNAP7doizVqrL s/YtCVpNLHf4qQoNt8lu6X0pHLe/zOZp8a67if13NrSU7CL/itFYNl01WMjS30R1Fxl4Qw zEkzGoHHtTtgc0lipS+Lzm3Ah1ZSxUs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-670-b_nDA3aCMyKcIv_TXZ3MAg-1; Fri, 18 Feb 2022 19:55:21 -0500 X-MC-Unique: b_nDA3aCMyKcIv_TXZ3MAg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7B4341006AA0; Sat, 19 Feb 2022 00:55:18 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7366162D56; Sat, 19 Feb 2022 00:55:09 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 13/22] spi: atmel: Don't use GFP_DMA when calling dma_alloc_coherent() Date: Sat, 19 Feb 2022 08:52:12 +0800 Message-Id: <20220219005221.634-14-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Queue-Id: DB6D01A000C X-Stat-Signature: pj7s565nboiimqcnoytxhz5iecca7o3g X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=EoKbME37; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf19.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com X-Rspamd-Server: rspam03 X-HE-Tag: 1645232126-504830 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_alloc_coherent() allocates dma buffer with device's addressing limitation in mind. It's redundent to specify GFP_DMA when calling dma_alloc_coherent(). [ 42.hyeyoo@gmail.com: Update changelog ] Signed-off-by: Baoquan He Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Christoph Hellwig --- drivers/spi/spi-atmel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index 9e300a932699..271dacf3b7d2 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1516,14 +1516,14 @@ static int atmel_spi_probe(struct platform_device *pdev) as->addr_rx_bbuf = dma_alloc_coherent(&pdev->dev, SPI_MAX_DMA_XFER, &as->dma_addr_rx_bbuf, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (!as->addr_rx_bbuf) { as->use_dma = false; } else { as->addr_tx_bbuf = dma_alloc_coherent(&pdev->dev, SPI_MAX_DMA_XFER, &as->dma_addr_tx_bbuf, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (!as->addr_tx_bbuf) { as->use_dma = false; dma_free_coherent(&pdev->dev, SPI_MAX_DMA_XFER, From patchwork Sat Feb 19 00:52:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752108 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCEE2C43217 for ; Sat, 19 Feb 2022 00:55:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65EF96B007B; Fri, 18 Feb 2022 19:55:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E46F6B007D; Fri, 18 Feb 2022 19:55:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4380B6B007E; Fri, 18 Feb 2022 19:55:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0204.hostedemail.com [216.40.44.204]) by kanga.kvack.org (Postfix) with ESMTP id 316676B007B for ; Fri, 18 Feb 2022 19:55:59 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E93DEA0A37 for ; Sat, 19 Feb 2022 00:55:58 +0000 (UTC) X-FDA: 79157712396.21.4A3579C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 6BDA5140005 for ; Sat, 19 Feb 2022 00:55:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=26cyHpnSpm698G+iZsPMivgAiB0L3AbE+uqfVDX3Hc4=; b=J0NJIfUK6WnxtWb7wn90vnCo31otidNhobUGs5qi6Q97YcgL8lea3cnBVtYr/+X1C6MbiL iInUyq2Eg56De/RBMM3HiN1nXi6LaJss7GJ7S1ZZTahBz6x4iW+3FHBtqafoyPJOXOHrGs sBWgtXWdORR144kc6bpD9M6XqAq9p2Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-664-8McBCT1aN72Ggigosg1PgQ-1; Fri, 18 Feb 2022 19:55:54 -0500 X-MC-Unique: 8McBCT1aN72Ggigosg1PgQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E13D9801AA6; Sat, 19 Feb 2022 00:55:51 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1725462D58; Sat, 19 Feb 2022 00:55:18 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 14/22] spi: spi-ti-qspi: Don't use GFP_DMA when calling dma_alloc_coherent() Date: Sat, 19 Feb 2022 08:52:13 +0800 Message-Id: <20220219005221.634-15-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 6BDA5140005 X-Stat-Signature: hxfyn6gq95zhujux1qf41id9spf8zu1z Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=J0NJIfUK; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf26.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com X-HE-Tag: 1645232158-682065 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_alloc_coherent() allocates dma buffer with device's addressing limitation in mind. It's redundent to specify GFP_DMA when calling dma_alloc_coherent(). [ 42.hyeyoo@gmail.com: Update changelog ] Signed-off-by: Baoquan He Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Christoph Hellwig --- drivers/spi/spi-ti-qspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c index e06aafe169e0..6c4a76a7a4b3 100644 --- a/drivers/spi/spi-ti-qspi.c +++ b/drivers/spi/spi-ti-qspi.c @@ -867,7 +867,7 @@ static int ti_qspi_probe(struct platform_device *pdev) qspi->rx_bb_addr = dma_alloc_coherent(qspi->dev, QSPI_DMA_BUFFER_SIZE, &qspi->rx_bb_dma_addr, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (!qspi->rx_bb_addr) { dev_err(qspi->dev, "dma_alloc_coherent failed, using PIO mode\n"); From patchwork Sat Feb 19 00:52:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752109 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44D8BC433FE for ; Sat, 19 Feb 2022 00:56:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D11966B0074; Fri, 18 Feb 2022 19:56:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C9BA16B007D; Fri, 18 Feb 2022 19:56:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AEEB66B007E; Fri, 18 Feb 2022 19:56:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id 9E44A6B0074 for ; Fri, 18 Feb 2022 19:56:13 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5E9578248D52 for ; Sat, 19 Feb 2022 00:56:13 +0000 (UTC) X-FDA: 79157712984.10.86B51B7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf16.hostedemail.com (Postfix) with ESMTP id D3693180003 for ; Sat, 19 Feb 2022 00:56:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=zPMhp9x1c0LUaXTNjQzx3Ki328/reRSQPGCipmskGY4=; b=heVLZ1xVOwsSIw+atf2kEZ/YISIX63CA9Ed6YIsHqfk3ONgVH1jAWP0ATkRLaxhCZ3y4p4 26/vaSjOsk6XwpEDTgA+um7JLfSJBMvdEpK8driVt/V/s2akH5JL21TJokf1lTrdoQeMfF DpAoAJxbVI/uvuWxYGtVUXvRvfTe76Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-392-yQBzCFbFOsyrrFCvPcd0NQ-1; Fri, 18 Feb 2022 19:56:07 -0500 X-MC-Unique: yQBzCFbFOsyrrFCvPcd0NQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4506E801AA6; Sat, 19 Feb 2022 00:56:04 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id A731F62D57; Sat, 19 Feb 2022 00:55:52 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 15/22] usb: cdns3: Don't use GFP_DMA32 when calling dma_pool_alloc() Date: Sat, 19 Feb 2022 08:52:14 +0800 Message-Id: <20220219005221.634-16-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=heVLZ1xV; spf=none (imf16.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: D3693180003 X-Stat-Signature: hkn7iwtjc8d4km68s3uajt3srxe99mm3 X-HE-Tag: 1645232172-290989 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_pool_alloc() uses dma_alloc_coherent() to pre-allocate DMA buffer, so it's redundent to specify GFP_DMA32 when calling. Signed-off-by: Baoquan He Reviewed-by: Christoph Hellwig --- drivers/usb/cdns3/cdns3-gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c index c0937d3d663f..6afac25ff2c7 100644 --- a/drivers/usb/cdns3/cdns3-gadget.c +++ b/drivers/usb/cdns3/cdns3-gadget.c @@ -220,7 +220,7 @@ int cdns3_allocate_trb_pool(struct cdns3_endpoint *priv_ep) if (!priv_ep->trb_pool) { priv_ep->trb_pool = dma_pool_alloc(priv_dev->eps_dma_pool, - GFP_DMA32 | GFP_ATOMIC, + GFP_ATOMIC, &priv_ep->trb_pool_dma); if (!priv_ep->trb_pool) From patchwork Sat Feb 19 00:52:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752110 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02907C433EF for ; Sat, 19 Feb 2022 00:56:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7BDE96B0075; Fri, 18 Feb 2022 19:56:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7435C6B007D; Fri, 18 Feb 2022 19:56:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5BDBE6B007E; Fri, 18 Feb 2022 19:56:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0245.hostedemail.com [216.40.44.245]) by kanga.kvack.org (Postfix) with ESMTP id 4C7DB6B0075 for ; Fri, 18 Feb 2022 19:56:24 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 00FE8181AEF23 for ; Sat, 19 Feb 2022 00:56:24 +0000 (UTC) X-FDA: 79157713488.16.9631158 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 9135FC0003 for ; Sat, 19 Feb 2022 00:56:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=yAdt8c3Kx+H+/O3yRynb0JPTBtvJf6iuj3i77jiRv/E=; b=WJ+uEzLyQ6WN6zH23ufzU+ZK7xLjiK1ReDleCXCIX4tU2GtI+44iCDprERigXVgQ7zx42a u9mYqYU6GMKyRqakmbFtpxb5OK4SunoFi0RFUDxV7Q8YluxLgw5z0J/fLf8CtcE7ilP9mn NJvC9nvyqQUkbsYuJWZdKvx1KpnOMgg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-475-VXpIlbqxMZCUfEdjOGjxyg-1; Fri, 18 Feb 2022 19:56:19 -0500 X-MC-Unique: VXpIlbqxMZCUfEdjOGjxyg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 64C331091DA1; Sat, 19 Feb 2022 00:56:16 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id D760D62D4E; Sat, 19 Feb 2022 00:56:04 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 16/22] usb: udc: lpc32xx: Don't use GFP_DMA when calling dma_pool_alloc() Date: Sat, 19 Feb 2022 08:52:15 +0800 Message-Id: <20220219005221.634-17-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 9135FC0003 X-Stat-Signature: k49fhaxjb61jkte1q9rfchh3ks15o9uu Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WJ+uEzLy; spf=none (imf28.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-HE-Tag: 1645232183-633157 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_pool_alloc() uses dma_alloc_coherent() to pre-allocate DMA buffer, so it's redundent to specify GFP_DMA when calling. Signed-off-by: Baoquan He Reviewed-by: Christoph Hellwig --- drivers/usb/gadget/udc/lpc32xx_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c index bcba5f9bc5a3..d234de1c62b3 100644 --- a/drivers/usb/gadget/udc/lpc32xx_udc.c +++ b/drivers/usb/gadget/udc/lpc32xx_udc.c @@ -922,7 +922,7 @@ static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc) dma_addr_t dma; struct lpc32xx_usbd_dd_gad *dd; - dd = dma_pool_alloc(udc->dd_cache, GFP_ATOMIC | GFP_DMA, &dma); + dd = dma_pool_alloc(udc->dd_cache, GFP_ATOMIC, &dma); if (dd) dd->this_dma = dma; From patchwork Sat Feb 19 00:52:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752111 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56458C433F5 for ; Sat, 19 Feb 2022 00:56:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DD7CA6B0078; Fri, 18 Feb 2022 19:56:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D5DD16B007B; Fri, 18 Feb 2022 19:56:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD89B6B007E; Fri, 18 Feb 2022 19:56:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id AABC66B0078 for ; Fri, 18 Feb 2022 19:56:35 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 65F4E8249980 for ; Sat, 19 Feb 2022 00:56:35 +0000 (UTC) X-FDA: 79157713950.22.102B949 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf03.hostedemail.com (Postfix) with ESMTP id 0209520002 for ; Sat, 19 Feb 2022 00:56:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=FO0qQ5sZB2PmWKfJvF7iXis0tLeqxwcvnj2fdvRQ2t8=; b=blorrR9vsj/GG4JlSih3XtxAf0XMB7YnwOsqtftuNlnj227AM6/6huKkFO5DvPMcYY11dV 8Rgc2qAuNoxU6uz84VaUHSmSIb1geKuWQpcQ8L1cPGtszfOOEkK4jMVe5eHrwRNO6DCVxU f3Qa/mMY0lC0aCo3wr5WBx0cd7bFK1o= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-583-HEfMI6qUOHavu7krOgDO2w-1; Fri, 18 Feb 2022 19:56:31 -0500 X-MC-Unique: HEfMI6qUOHavu7krOgDO2w-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 53BD01091DA1; Sat, 19 Feb 2022 00:56:28 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id E14D062D4E; Sat, 19 Feb 2022 00:56:16 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 17/22] net: marvell: prestera: Don't use GFP_DMA when calling dma_pool_alloc() Date: Sat, 19 Feb 2022 08:52:16 +0800 Message-Id: <20220219005221.634-18-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 0209520002 X-Stat-Signature: qeqkuejybq6waont7si7jkhamd8q59j9 Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=blorrR9v; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf03.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com X-HE-Tag: 1645232194-819801 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dma_pool_alloc() uses dma_alloc_coherent() to pre-allocate DMA buffer, so it's redundent to specify GFP_DMA when calling. Signed-off-by: Baoquan He Reviewed-by: Christoph Hellwig --- drivers/net/ethernet/marvell/prestera/prestera_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c b/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c index e452cdeaf703..9f32dcabefb9 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c @@ -116,7 +116,7 @@ static int prestera_sdma_buf_init(struct prestera_sdma *sdma, struct prestera_sdma_desc *desc; dma_addr_t dma; - desc = dma_pool_alloc(sdma->desc_pool, GFP_DMA | GFP_KERNEL, &dma); + desc = dma_pool_alloc(sdma->desc_pool, GFP_KERNEL, &dma); if (!desc) return -ENOMEM; From patchwork Sat Feb 19 00:52:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752112 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E969EC433F5 for ; Sat, 19 Feb 2022 00:56:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 794E16B007B; Fri, 18 Feb 2022 19:56:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 71C976B007D; Fri, 18 Feb 2022 19:56:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5BD4E6B007E; Fri, 18 Feb 2022 19:56:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0254.hostedemail.com [216.40.44.254]) by kanga.kvack.org (Postfix) with ESMTP id 4DCE46B007B for ; Fri, 18 Feb 2022 19:56:52 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1BD34944D8 for ; Sat, 19 Feb 2022 00:56:52 +0000 (UTC) X-FDA: 79157714664.13.148E58C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 951E780005 for ; Sat, 19 Feb 2022 00:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=/y0XKs0dIaXiTJCDs4pP0SCRY3JMgE3839iRkTVhm8s=; b=LdaLxuoQbHjPmQjeanJY71VbkQWlOTERyxmCFW/d60z2+Rt0WFvb7QVIEef8cB7eRmd9uk MsL5OdW4sw0h72K7ypfixEUqnJS6r1Maw19/Zpu8+TuTUOPvOt1R5rNoD6JffHwEyyodZd YG1yKYz4llsahmjHnAlNW+dcYyBFhjc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-187-d1x5YKnqPheP2aWNdoPuLg-1; Fri, 18 Feb 2022 19:56:40 -0500 X-MC-Unique: d1x5YKnqPheP2aWNdoPuLg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7E74E1006AA3; Sat, 19 Feb 2022 00:56:37 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id E55B062D4E; Sat, 19 Feb 2022 00:56:28 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 18/22] net: ethernet: mtk-star-emac: Don't use GFP_DMA when calling dmam_alloc_coherent() Date: Sat, 19 Feb 2022 08:52:17 +0800 Message-Id: <20220219005221.634-19-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Stat-Signature: eyzxwurhw3qz6emckmippb814b5m5qyh X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LdaLxuoQ; spf=none (imf02.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 951E780005 X-HE-Tag: 1645232206-167678 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: dmam_alloc_coherent() uses struct dma_devres to manage data, and call dma_alloc_attrs() to allocate cohenrent DMA memory, so it's redundent to specify GFP_DMA when calling. Signed-off-by: Baoquan He Reviewed-by: Christoph Hellwig --- drivers/net/ethernet/mediatek/mtk_star_emac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_star_emac.c b/drivers/net/ethernet/mediatek/mtk_star_emac.c index 89ca7960b225..55b95f51ac75 100644 --- a/drivers/net/ethernet/mediatek/mtk_star_emac.c +++ b/drivers/net/ethernet/mediatek/mtk_star_emac.c @@ -1533,7 +1533,7 @@ static int mtk_star_probe(struct platform_device *pdev) priv->ring_base = dmam_alloc_coherent(dev, MTK_STAR_DMA_SIZE, &priv->dma_addr, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (!priv->ring_base) return -ENOMEM; From patchwork Sat Feb 19 00:52:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752113 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F04B0C433EF for ; Sat, 19 Feb 2022 00:57:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E4346B007D; Fri, 18 Feb 2022 19:57:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 76A866B007E; Fri, 18 Feb 2022 19:57:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 595CF6B0080; Fri, 18 Feb 2022 19:57:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0067.hostedemail.com [216.40.44.67]) by kanga.kvack.org (Postfix) with ESMTP id 4930C6B007D for ; Fri, 18 Feb 2022 19:57:01 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0370E9A290 for ; Sat, 19 Feb 2022 00:57:01 +0000 (UTC) X-FDA: 79157715042.17.D902A04 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf12.hostedemail.com (Postfix) with ESMTP id 9686540006 for ; Sat, 19 Feb 2022 00:57:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=EELMh9yLzKq2YhWaWmX86e66jZD5FrMdWsd0v+UKIFQ=; b=CQNy0BbjnegTIZx5DI65K/QBBSZJidk3vwK5XPYNTRQuHtyNUJyDWR+sWthzQUi+p4NeC5 IVRwwkenq/Fdq3cAzMFN8yRXBqtHlSJwsingUB/iHDf8+NmzhGAiJ8BSkvE67vq30F/OGy s7tF+7F3VAgBscfnh/l1KQv6W7xdBWw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-594-407jO7cuM6-rsOc9SkRHhg-1; Fri, 18 Feb 2022 19:56:55 -0500 X-MC-Unique: 407jO7cuM6-rsOc9SkRHhg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3DA1B1091DA1; Sat, 19 Feb 2022 00:56:52 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C6CE62D60; Sat, 19 Feb 2022 00:56:37 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 19/22] ethernet: rocker: Use dma_alloc_noncoherent() for dma buffer Date: Sat, 19 Feb 2022 08:52:18 +0800 Message-Id: <20220219005221.634-20-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CQNy0Bbj; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf12.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 9686540006 X-Stat-Signature: h8fiqdes8nzczdhdxhafnsis8zgkwnak X-HE-Tag: 1645232220-911764 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Use dma_alloc_noncoherent() instead to get the DMA buffer. [ 42.hyeyoo@gmail.com: Use dma_alloc_noncoherent() instead of __get_free_pages. Fix memory leak. ] Signed-off-by: Baoquan He Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Jiri Pirko Cc: davem@davemloft.net Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Reviewed-by: Christoph Hellwig --- drivers/net/ethernet/rocker/rocker_main.c | 59 +++++++++-------------- 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c index 3fcea211716c..b23dd9b70d8d 100644 --- a/drivers/net/ethernet/rocker/rocker_main.c +++ b/drivers/net/ethernet/rocker/rocker_main.c @@ -193,20 +193,17 @@ static int rocker_dma_test_offset(const struct rocker *rocker, int i; int err; - alloc = kzalloc(ROCKER_TEST_DMA_BUF_SIZE * 2 + offset, - GFP_KERNEL | GFP_DMA); + alloc = dma_alloc_noncoherent(&pdev->dev, + ROCKER_TEST_DMA_BUF_SIZE * 2 + offset, + &dma_handle, + DMA_BIDIRECTIONAL, + GFP_KERNEL); if (!alloc) return -ENOMEM; + buf = alloc + offset; expect = buf + ROCKER_TEST_DMA_BUF_SIZE; - dma_handle = dma_map_single(&pdev->dev, buf, ROCKER_TEST_DMA_BUF_SIZE, - DMA_BIDIRECTIONAL); - if (dma_mapping_error(&pdev->dev, dma_handle)) { - err = -EIO; - goto free_alloc; - } - rocker_write64(rocker, TEST_DMA_ADDR, dma_handle); rocker_write32(rocker, TEST_DMA_SIZE, ROCKER_TEST_DMA_BUF_SIZE); @@ -215,14 +212,14 @@ static int rocker_dma_test_offset(const struct rocker *rocker, dma_handle, buf, expect, ROCKER_TEST_DMA_BUF_SIZE); if (err) - goto unmap; + goto free; memset(expect, 0, ROCKER_TEST_DMA_BUF_SIZE); err = rocker_dma_test_one(rocker, wait, ROCKER_TEST_DMA_CTRL_CLEAR, dma_handle, buf, expect, ROCKER_TEST_DMA_BUF_SIZE); if (err) - goto unmap; + goto free; prandom_bytes(buf, ROCKER_TEST_DMA_BUF_SIZE); for (i = 0; i < ROCKER_TEST_DMA_BUF_SIZE; i++) @@ -231,14 +228,11 @@ static int rocker_dma_test_offset(const struct rocker *rocker, dma_handle, buf, expect, ROCKER_TEST_DMA_BUF_SIZE); if (err) - goto unmap; - -unmap: - dma_unmap_single(&pdev->dev, dma_handle, ROCKER_TEST_DMA_BUF_SIZE, - DMA_BIDIRECTIONAL); -free_alloc: - kfree(alloc); + goto free; +free: + dma_free_noncoherent(&pdev->dev, ROCKER_TEST_DMA_BUF_SIZE * 2 + offset, + alloc, dma_handle, DMA_BIDIRECTIONAL); return err; } @@ -500,20 +494,13 @@ static int rocker_dma_ring_bufs_alloc(const struct rocker *rocker, dma_addr_t dma_handle; char *buf; - buf = kzalloc(buf_size, GFP_KERNEL | GFP_DMA); + buf = dma_alloc_noncoherent(&pdev->dev, buf_size, + &dma_handle, direction, GFP_KERNEL); if (!buf) { err = -ENOMEM; goto rollback; } - dma_handle = dma_map_single(&pdev->dev, buf, buf_size, - direction); - if (dma_mapping_error(&pdev->dev, dma_handle)) { - kfree(buf); - err = -EIO; - goto rollback; - } - desc_info->data = buf; desc_info->data_size = buf_size; dma_unmap_addr_set(desc_info, mapaddr, dma_handle); @@ -526,11 +513,10 @@ static int rocker_dma_ring_bufs_alloc(const struct rocker *rocker, rollback: for (i--; i >= 0; i--) { const struct rocker_desc_info *desc_info = &info->desc_info[i]; - - dma_unmap_single(&pdev->dev, - dma_unmap_addr(desc_info, mapaddr), - desc_info->data_size, direction); - kfree(desc_info->data); + dma_free_noncoherent(&pdev->dev, desc_info->data_size, + desc_info->data, + dma_unmap_addr(desc_info, mapaddr), + direction); } return err; } @@ -548,10 +534,11 @@ static void rocker_dma_ring_bufs_free(const struct rocker *rocker, desc->buf_addr = 0; desc->buf_size = 0; - dma_unmap_single(&pdev->dev, - dma_unmap_addr(desc_info, mapaddr), - desc_info->data_size, direction); - kfree(desc_info->data); + dma_free_noncoherent(&pdev->dev, + desc_info->data_size, + desc_info->data, + dma_unmap_addr(desc_info, mapaddr), + direction); } } From patchwork Sat Feb 19 00:52:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752114 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F34FC43217 for ; Sat, 19 Feb 2022 00:57:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B15F06B007E; Fri, 18 Feb 2022 19:57:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A9E576B0080; Fri, 18 Feb 2022 19:57:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F31B6B0081; Fri, 18 Feb 2022 19:57:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7F0F76B007E for ; Fri, 18 Feb 2022 19:57:11 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 44B1E9BBDB for ; Sat, 19 Feb 2022 00:57:11 +0000 (UTC) X-FDA: 79157715420.10.92DE298 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf30.hostedemail.com (Postfix) with ESMTP id AA82F80002 for ; Sat, 19 Feb 2022 00:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=Gw/NJK8fpoJAAgLoy5A/sOEoEXpxXVtHErMcNbgZLPI=; b=UAuzkxcJoeLT69J+P2p5K5wXDb086xACuLhSX10UIQ05Pln8g1eBB7OL7e90z+yU1GRYr+ w/yhpg2ZI3AQK72bDCFCILbKWl2ikbuuzdjFuIcygfadyGOeVw7gOx46nhwcdslQ5isvB0 E7jVr85oc5CyysUgs6VHf06AOuhEjwo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-195-xetRNHCfO521Ql8W4vgBdQ-1; Fri, 18 Feb 2022 19:57:07 -0500 X-MC-Unique: xetRNHCfO521Ql8W4vgBdQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 096CD1091DA0; Sat, 19 Feb 2022 00:57:04 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA67A62D4E; Sat, 19 Feb 2022 00:56:52 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 20/22] HID: intel-ish-hid: Use dma_alloc_noncoherent() for dma buffer Date: Sat, 19 Feb 2022 08:52:19 +0800 Message-Id: <20220219005221.634-21-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Queue-Id: AA82F80002 X-Stat-Signature: bcm85ujzeks1a86bd7ykj1ioofeafbkd X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UAuzkxcJ; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf30.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com X-Rspamd-Server: rspam03 X-HE-Tag: 1645232230-399182 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: GFP_DMA32 is an illegal flag to pass when calling kmalloc(), please see GFP_SLAB_BUG_MASK definition. Allocating dma buffer using kmalloc() is not recommended. Use dma_alloc_noncoherent() instead. DMA API will assume the device has 32 bit addressing limitation when allocating buffer. [ 42.hyeyoo@gmail.com: Use dma_alloc_noncoherent() instead of __get_free_pages ] Signed-off-by: Baoquan He Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Srinivas Pandruvada Cc: Jiri Kosina Cc: Benjamin Tissoires Cc: Sumit Semwal Cc: christian.koenig@amd.com Cc: linux-input@vger.kernel.org Reviewed-by: Christoph Hellwig --- drivers/hid/intel-ish-hid/ishtp-fw-loader.c | 23 +++++++-------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c index e24988586710..3be1e3329962 100644 --- a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c +++ b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c @@ -661,21 +661,15 @@ static int ish_fw_xfer_direct_dma(struct ishtp_cl_data *client_data, */ payload_max_size &= ~(L1_CACHE_BYTES - 1); - dma_buf = kmalloc(payload_max_size, GFP_KERNEL | GFP_DMA32); + dma_buf = dma_alloc_noncoherent(devc, get_order(payload_max_size), + &dma_buf_phy, DMA_TO_DEVICE, + GFP_KERNEL); if (!dma_buf) { + dev_err(cl_data_to_dev(client_data), "DMA alloc failed\n"); client_data->flag_retry = true; return -ENOMEM; } - dma_buf_phy = dma_map_single(devc, dma_buf, payload_max_size, - DMA_TO_DEVICE); - if (dma_mapping_error(devc, dma_buf_phy)) { - dev_err(cl_data_to_dev(client_data), "DMA map failed\n"); - client_data->flag_retry = true; - rv = -ENOMEM; - goto end_err_dma_buf_release; - } - ldr_xfer_dma_frag.fragment.hdr.command = LOADER_CMD_XFER_FRAGMENT; ldr_xfer_dma_frag.fragment.xfer_mode = LOADER_XFER_MODE_DIRECT_DMA; ldr_xfer_dma_frag.ddr_phys_addr = (u64)dma_buf_phy; @@ -725,15 +719,14 @@ static int ish_fw_xfer_direct_dma(struct ishtp_cl_data *client_data, fragment_offset += fragment_size; } - dma_unmap_single(devc, dma_buf_phy, payload_max_size, DMA_TO_DEVICE); - kfree(dma_buf); + dma_free_noncoherent(devc, get_order(payload_max_size), dma_buf, + dma_buf_phy, DMA_TO_DEVICE); return 0; end_err_resp_buf_release: /* Free ISH buffer if not done already, in error case */ - dma_unmap_single(devc, dma_buf_phy, payload_max_size, DMA_TO_DEVICE); -end_err_dma_buf_release: - kfree(dma_buf); + dma_free_noncoherent(devc, get_order(payload_max_size), dma_buf, + dma_buf_phy, DMA_TO_DEVICE); return rv; } From patchwork Sat Feb 19 00:52:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752115 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 935BEC4332F for ; Sat, 19 Feb 2022 00:57:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2B26B6B0074; Fri, 18 Feb 2022 19:57:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2612A6B0080; Fri, 18 Feb 2022 19:57:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DBCE6B0081; Fri, 18 Feb 2022 19:57:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id F273C6B0074 for ; Fri, 18 Feb 2022 19:57:25 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B92BB8249980 for ; Sat, 19 Feb 2022 00:57:25 +0000 (UTC) X-FDA: 79157716050.08.1F67C04 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 48B6B1C0004 for ; Sat, 19 Feb 2022 00:57:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=/uPDi55pRUcHbTO6mcPLVkug8AZozuHSmFt5BW/lQT4=; b=U09ZCGEb0xDqBmaKKAVlFjYas7jzY/EyDQQ65vNchEZxmsFt3AZ6z1y7SSsDYN9p/3Ik1S x098dbRFNlfKFYYgNvXvz4Svs60VCIB4lHGosOOT1MdGTY38n0IBJhLvcCjUdLlLdgH8A6 wPlJJK8HrsWmJ3n4itzWtORoqbqpbCs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-460-9PQUe-MNMqyEq0z_Q9Xzhw-1; Fri, 18 Feb 2022 19:57:21 -0500 X-MC-Unique: 9PQUe-MNMqyEq0z_Q9Xzhw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5848A801AA6; Sat, 19 Feb 2022 00:57:18 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 90B3562D57; Sat, 19 Feb 2022 00:57:04 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 21/22] mmc: wbsd: Use dma_alloc_noncoherent() for dma buffer Date: Sat, 19 Feb 2022 08:52:20 +0800 Message-Id: <20220219005221.634-22-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Queue-Id: 48B6B1C0004 X-Stat-Signature: 6ax5nt86giw9at511b4ix9547955kbqu X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=U09ZCGEb; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf18.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com X-Rspamd-Server: rspam03 X-HE-Tag: 1645232245-67025 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Use dma_alloc_noncoherent() instead to get the DMA buffer. [ 42.hyeyoo@gmail.com: Only keep label free. Remove unnecessary alignment checks. it's guaranteed by DMA API. Just use GFP_KERNEL as it's called in sleepable context. Specify its dma capability using dma_set_mask_and_coherent() ] Signed-off-by: Baoquan He Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Pierre Ossman Cc: Ulf Hansson Cc: linux-mmc@vger.kernel.org --- drivers/mmc/host/wbsd.c | 45 +++++++++-------------------------------- 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/drivers/mmc/host/wbsd.c b/drivers/mmc/host/wbsd.c index 67ecd342fe5f..50b0197583c7 100644 --- a/drivers/mmc/host/wbsd.c +++ b/drivers/mmc/host/wbsd.c @@ -1366,55 +1366,28 @@ static void wbsd_request_dma(struct wbsd_host *host, int dma) if (request_dma(dma, DRIVER_NAME)) goto err; + dma_set_mask_and_coherent(mmc_dev(host->mmc), DMA_BIT_MASK(24)); + /* * We need to allocate a special buffer in * order for ISA to be able to DMA to it. */ - host->dma_buffer = kmalloc(WBSD_DMA_SIZE, - GFP_NOIO | GFP_DMA | __GFP_RETRY_MAYFAIL | __GFP_NOWARN); + host->dma_buffer = dma_alloc_noncoherent(mmc_dev(host->mmc), + WBSD_DMA_SIZE, &host->dma_addr, + DMA_BIDIRECTIONAL, + GFP_KERNEL); if (!host->dma_buffer) goto free; - /* - * Translate the address to a physical address. - */ - host->dma_addr = dma_map_single(mmc_dev(host->mmc), host->dma_buffer, - WBSD_DMA_SIZE, DMA_BIDIRECTIONAL); - if (dma_mapping_error(mmc_dev(host->mmc), host->dma_addr)) - goto kfree; - - /* - * ISA DMA must be aligned on a 64k basis. - */ - if ((host->dma_addr & 0xffff) != 0) - goto unmap; - /* - * ISA cannot access memory above 16 MB. - */ - else if (host->dma_addr >= 0x1000000) - goto unmap; - host->dma = dma; return; -unmap: - /* - * If we've gotten here then there is some kind of alignment bug - */ - BUG_ON(1); - - dma_unmap_single(mmc_dev(host->mmc), host->dma_addr, - WBSD_DMA_SIZE, DMA_BIDIRECTIONAL); - host->dma_addr = 0; - -kfree: - kfree(host->dma_buffer); - host->dma_buffer = NULL; - free: + dma_free_noncoherent(mmc_dev(host->mmc), WBSD_DMA_SIZE, host->dma_buffer, + host->dma_addr, DMA_BIDIRECTIONAL); + host->dma_buffer = NULL; free_dma(dma); - err: pr_warn(DRIVER_NAME ": Unable to allocate DMA %d - falling back on FIFO\n", dma); From patchwork Sat Feb 19 00:52:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12752116 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D899DC433EF for ; Sat, 19 Feb 2022 00:57:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6845A6B0075; Fri, 18 Feb 2022 19:57:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 60A206B0080; Fri, 18 Feb 2022 19:57:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45C956B0081; Fri, 18 Feb 2022 19:57:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 339A96B0075 for ; Fri, 18 Feb 2022 19:57:36 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 01E1879E for ; Sat, 19 Feb 2022 00:57:35 +0000 (UTC) X-FDA: 79157716512.02.6EEE795 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf27.hostedemail.com (Postfix) with ESMTP id 8BFD740002 for ; Sat, 19 Feb 2022 00:57:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=VzXzJB2PJKullCIvRUJRQ/3FG4DX8V+bJRm6qvn5FmA=; b=QQaLSNbH1SsuKasjrtZqJCNqN+Di0U3z2a672H27kUdCe7qDR7AwLLrp+dT+89m6mzgImM 0fxroyzlA0JXcDz4RKo0ZFHvM+/ngmB/ZHkOw3pB0U8W6OZ5j6ANCUtZNl3XS2VP6GjdOE qauSPI/9qadgtlX87IsKNHhDZK+A4dA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-218-DtD3djaMMzmALzLGQE-47g-1; Fri, 18 Feb 2022 19:57:31 -0500 X-MC-Unique: DtD3djaMMzmALzLGQE-47g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 943B21006AA0; Sat, 19 Feb 2022 00:57:28 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id E930262D4E; Sat, 19 Feb 2022 00:57:18 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: [PATCH 22/22] mtd: rawnand: Use dma_alloc_noncoherent() for dma buffer Date: Sat, 19 Feb 2022 08:52:21 +0800 Message-Id: <20220219005221.634-23-bhe@redhat.com> In-Reply-To: <20220219005221.634-1-bhe@redhat.com> References: <20220219005221.634-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 8BFD740002 X-Stat-Signature: ffk4f3p79fq6m1ekuahxdbabwcarjdgu Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QQaLSNbH; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf27.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com X-HE-Tag: 1645232255-38683 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Use dma_alloc_noncoherent() instead of directly allocating buffer from kmalloc with GFP_DMA. DMA API will try to allocate buffer depending on devices addressing limitation. [ 42.hyeyoo@gmail.com: Use dma_alloc_noncoherent() instead of __get_free_page() and update changelog. As it does not allocate high order buffers, allocate buffer when needed and free after DMA. ] Signed-off-by: Baoquan He Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: Sumit Semwal Cc: christian.koenig@amd.com Cc: linux-mtd@lists.infradead.org --- drivers/mtd/nand/raw/marvell_nand.c | 55 ++++++++++++++++++----------- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c index 2455a581fd70..c0b64a7e50af 100644 --- a/drivers/mtd/nand/raw/marvell_nand.c +++ b/drivers/mtd/nand/raw/marvell_nand.c @@ -860,26 +860,45 @@ static int marvell_nfc_xfer_data_dma(struct marvell_nfc *nfc, struct dma_async_tx_descriptor *tx; struct scatterlist sg; dma_cookie_t cookie; - int ret; + dma_addr_t dma_handle; + int ret = 0; marvell_nfc_enable_dma(nfc); + + /* + * DMA must act on length multiple of 32 and this length may be + * bigger than the destination buffer. Use this buffer instead + * for DMA transfers and then copy the desired amount of data to + * the provided buffer. + */ + nfc->dma_buf = dma_alloc_noncoherent(nfc->dev, MAX_CHUNK_SIZE, + &dma_handle, + direction, + GFP_ATOMIC); + if (!nfc->dma_buf) { + ret = -ENOMEM; + goto out; + } + + /* Prepare the DMA transfer */ - sg_init_one(&sg, nfc->dma_buf, dma_len); - dma_map_sg(nfc->dma_chan->device->dev, &sg, 1, direction); - tx = dmaengine_prep_slave_sg(nfc->dma_chan, &sg, 1, + tx = dmaengine_prep_slave_single(nfc->dma_chan, dma_handle, dma_len, direction == DMA_FROM_DEVICE ? DMA_DEV_TO_MEM : DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT); if (!tx) { dev_err(nfc->dev, "Could not prepare DMA S/G list\n"); - return -ENXIO; + ret = -ENXIO; + goto free; } /* Do the task and wait for it to finish */ cookie = dmaengine_submit(tx); ret = dma_submit_error(cookie); - if (ret) - return -EIO; + if (ret) { + ret = -EIO; + goto free; + } dma_async_issue_pending(nfc->dma_chan); ret = marvell_nfc_wait_cmdd(nfc->selected_chip); @@ -889,10 +908,16 @@ static int marvell_nfc_xfer_data_dma(struct marvell_nfc *nfc, dev_err(nfc->dev, "Timeout waiting for DMA (status: %d)\n", dmaengine_tx_status(nfc->dma_chan, cookie, NULL)); dmaengine_terminate_all(nfc->dma_chan); - return -ETIMEDOUT; + ret = -ETIMEDOUT; + goto free; } - return 0; +free: + dma_free_noncoherent(nfc->dev, MAX_CHUNK_SIZE, nfc->dma_buf, + dma_handle, direction); + +out: + return ret; } static int marvell_nfc_xfer_data_in_pio(struct marvell_nfc *nfc, u8 *in, @@ -2814,18 +2839,6 @@ static int marvell_nfc_init_dma(struct marvell_nfc *nfc) goto release_channel; } - /* - * DMA must act on length multiple of 32 and this length may be - * bigger than the destination buffer. Use this buffer instead - * for DMA transfers and then copy the desired amount of data to - * the provided buffer. - */ - nfc->dma_buf = kmalloc(MAX_CHUNK_SIZE, GFP_KERNEL | GFP_DMA); - if (!nfc->dma_buf) { - ret = -ENOMEM; - goto release_channel; - } - nfc->use_dma = true; return 0;