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: 544332 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB576C433EF for ; Sat, 19 Feb 2022 00:52:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238894AbiBSAxP (ORCPT ); Fri, 18 Feb 2022 19:53:15 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:57960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240558AbiBSAxP (ORCPT ); Fri, 18 Feb 2022 19:53:15 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3FED527AA27 for ; Fri, 18 Feb 2022 16:52:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645231974; 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=FhsCrgcouYfiJvjwiAbMiuw38ONE5XZfU4dLdYK5IG76HYF+jPkJf+uhsLPHLEOmDSIGYt A9R6EcDwuGTmikVq5IVi/MthcCp53wxDT72XTAMAsn1Vb4RWgRIpZHoGgowKalmTfZUaSG YLMK8OyoQ6N3PfVCZ5A02E7+9iE5JRs= 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 --- 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: 544123 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC0D0C433FE for ; Sat, 19 Feb 2022 00:53:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240544AbiBSAx1 (ORCPT ); Fri, 18 Feb 2022 19:53:27 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:58666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240556AbiBSAx0 (ORCPT ); Fri, 18 Feb 2022 19:53:26 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EE74027792B for ; Fri, 18 Feb 2022 16:53:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645231988; 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=La3RalOPFHtyNqX0sC0SXCBamUZfkBoCpdZgyE79GnTOTzr6gWuNPrKg0Q2r6RJsFlwIHF 629CbcepF+IIJZjPzBW4kKJBIYrdIWiRmJSkKxwPMdS2wDqWWlweaB6h6xSN2kW7e7QsUZ 5pFncQZh3/3FB2vZrufIAjPdHYQGDkM= 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 --- 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: 544331 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A36B7C433F5 for ; Sat, 19 Feb 2022 00:53:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240563AbiBSAxj (ORCPT ); Fri, 18 Feb 2022 19:53:39 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240583AbiBSAxj (ORCPT ); Fri, 18 Feb 2022 19:53:39 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9657E279916 for ; Fri, 18 Feb 2022 16:53:19 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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> --- 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: 544122 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FCB4C433EF for ; Sat, 19 Feb 2022 00:53:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240593AbiBSAx7 (ORCPT ); Fri, 18 Feb 2022 19:53:59 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240585AbiBSAx4 (ORCPT ); Fri, 18 Feb 2022 19:53:56 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9AF0F2782AE for ; Fri, 18 Feb 2022 16:53:38 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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> --- 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: 544330 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43BE7C433EF for ; Sat, 19 Feb 2022 00:53:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240589AbiBSAyI (ORCPT ); Fri, 18 Feb 2022 19:54:08 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240594AbiBSAyG (ORCPT ); Fri, 18 Feb 2022 19:54:06 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A1F5A278282 for ; Fri, 18 Feb 2022 16:53:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232028; 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=HfUnhEgU3Spden5OGHfnRIb1H3/SPywXSx36Y4dOB2BokPYuYFoCttK3BnoTKLfZtXmlyt NIM+ptSou+0p1VTnnp9mUlFoiQ/2WtCEnljRRkXPE1PVVfnGnCvWBQXvwLlgedrdHzyiU0 B+ONDhyGnOCbkL+vI8IUowfRmUOZPkI= 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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> --- 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: 544121 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 634D1C433F5 for ; Sat, 19 Feb 2022 00:54:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239068AbiBSAyW (ORCPT ); Fri, 18 Feb 2022 19:54:22 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:35180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240626AbiBSAyV (ORCPT ); Fri, 18 Feb 2022 19:54:21 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 043482782AC for ; Fri, 18 Feb 2022 16:54:02 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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> --- 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: 544329 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6111C433FE for ; Sat, 19 Feb 2022 00:54:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240634AbiBSAyd (ORCPT ); Fri, 18 Feb 2022 19:54:33 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:35986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240592AbiBSAyb (ORCPT ); Fri, 18 Feb 2022 19:54:31 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5674727993A for ; Fri, 18 Feb 2022 16:54:12 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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> --- 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: 544120 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F33C1C43219 for ; Sat, 19 Feb 2022 00:54:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240640AbiBSAyo (ORCPT ); Fri, 18 Feb 2022 19:54:44 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:36224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240661AbiBSAyn (ORCPT ); Fri, 18 Feb 2022 19:54:43 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 67FEE279916 for ; Fri, 18 Feb 2022 16:54:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232063; 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=Ou/8rxn5LKc+GYrCoAx3S5Bk4E+YbZGlkOEXjy/upA5qjZ09WoKhqyR4+nfSNlD6VMEAmr XtY+7rKHZFJAwYrn5LKY3MUQFEEQShb4Qc1/dtAJIi5rpec+arWL/M30ysowKof7+FwfKD Lzg17hFEcjL9y5M1X6cQKWg7WcmbeIk= 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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> --- 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: 544328 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 242F4C433F5 for ; Sat, 19 Feb 2022 00:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240628AbiBSAy4 (ORCPT ); Fri, 18 Feb 2022 19:54:56 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:37516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240667AbiBSAyu (ORCPT ); Fri, 18 Feb 2022 19:54:50 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 81A612782A2 for ; Fri, 18 Feb 2022 16:54:32 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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: 544119 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB436C433EF for ; Sat, 19 Feb 2022 00:54:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240662AbiBSAzF (ORCPT ); Fri, 18 Feb 2022 19:55:05 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236724AbiBSAzF (ORCPT ); Fri, 18 Feb 2022 19:55:05 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7BD19278284 for ; Fri, 18 Feb 2022 16:54:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232086; 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=c0uGLCCP7EQnenm9PCIfd9zhC6uBaZt38pJ2VKC3OQ2cIqqKd8Y90X5x7PNDliYW2aOpt4 JV440FJ2TEuJCTlzcPsRQoo+pfP0hN0Qbj/otFAXb9noQmPpfilTWFVZJFCY9dZr3gwz1D sSYzuaXk+2SIPxUgf5jLMH7CikcYOcQ= 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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> --- 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: 544327 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 184D2C43217 for ; Sat, 19 Feb 2022 00:55:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240706AbiBSAzQ (ORCPT ); Fri, 18 Feb 2022 19:55:16 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240700AbiBSAzP (ORCPT ); Fri, 18 Feb 2022 19:55:15 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 751E42782AE for ; Fri, 18 Feb 2022 16:54:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232097; 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=hDcoty4QHezDE3yEr3Y90GvvplSSYrXdOk8U0Ia1z5vVDA0gXpTxGN2RGVtAPS4yQA4kYB RrNyr+Hny8iMn9/BMJUvJhAJEHpvuelOFI/D6SmnageedvKJqbEMkwwZVtNw7TNRkCK2Ar voxHHeX8nQ9r4bOaPmWB9lFIZiPuzsI= 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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> --- 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: 544118 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7EA6C43217 for ; Sat, 19 Feb 2022 00:55:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240730AbiBSAzo (ORCPT ); Fri, 18 Feb 2022 19:55:44 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240786AbiBSAzl (ORCPT ); Fri, 18 Feb 2022 19:55:41 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3336C27B988 for ; Fri, 18 Feb 2022 16:55:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232117; 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=bo7VjF24UMdbtxaHprk33A1muHj9fywR2QlB7yzGXmWhC5zbtB3W0JAeoba/AZEqKJcXQ+ XJrGg/e2DLr1zaLHGI/kDrIXaZuNAtpGCmhjCrrCjywFvJW378Q4M8CFZJ5eI2wyEq0z5R lvQwOpkiYsGfxMM9clWvUYl+RYyAmew= 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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> --- 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: 544326 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF28BC433F5 for ; Sat, 19 Feb 2022 00:55:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237307AbiBSA4O (ORCPT ); Fri, 18 Feb 2022 19:56:14 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240816AbiBSAzx (ORCPT ); Fri, 18 Feb 2022 19:55:53 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 68F152782AC for ; Fri, 18 Feb 2022 16:55:27 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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> --- 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: 544117 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42E03C433EF for ; Sat, 19 Feb 2022 00:56:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240911AbiBSA5L (ORCPT ); Fri, 18 Feb 2022 19:57:11 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231364AbiBSA4n (ORCPT ); Fri, 18 Feb 2022 19:56:43 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 12347281993 for ; Fri, 18 Feb 2022 16:56:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232160; 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=UyAo3PXqNHnEj/TeFr6NTziMuTj0LFfDwhA1R3fbgZoZb0OJ10rMIdd/9VKX0+BjiuFz80 hcV3Tyg6aGUxhctqB4wL/zBxdbEwjC11YuhoDlBjWEoKsJz8TZIR1W7Dffc4HlEamZfhme 2KtxrESwboG/FP32Wdu9fyQXO7v2wvw= 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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> --- 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: 544325 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED7B0C433F5 for ; Sat, 19 Feb 2022 00:57:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240937AbiBSA50 (ORCPT ); Fri, 18 Feb 2022 19:57:26 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240898AbiBSA5C (ORCPT ); Fri, 18 Feb 2022 19:57:02 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A38F927C217 for ; Fri, 18 Feb 2022 16:56:21 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 --- 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: 544116 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EF7AC433EF for ; Sat, 19 Feb 2022 00:57:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240877AbiBSA5f (ORCPT ); Fri, 18 Feb 2022 19:57:35 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240989AbiBSA5Z (ORCPT ); Fri, 18 Feb 2022 19:57:25 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AD2B227D68F for ; Fri, 18 Feb 2022 16:56:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232182; 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=SSfOksnKoVSq5+XQ4xfT5kkIXPHLmHL6e7jH/o+a2jy6Ci2cExrViRiPGFyGcycpu9zttP beAya5nw3uaBn3khS/P2pjZUo74N9yHPeo48D/H4C3orfvqarclnCsTq9P6YloZTbcdlw+ HA+QCpFMjvO3JvfFQIJfQMqe5h7yzME= 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 --- 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: 544324 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 259A1C433FE for ; Sat, 19 Feb 2022 00:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240990AbiBSA5p (ORCPT ); Fri, 18 Feb 2022 19:57:45 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241033AbiBSA51 (ORCPT ); Fri, 18 Feb 2022 19:57:27 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 73EC327FBA7 for ; Fri, 18 Feb 2022 16:56:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232196; 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=LipaSMGvB7mrfDbzbCDTeCsQ8m34XKiREV1puqDCVCCZTZ4DwHC0D3H2Xj2CFaakgdTL2g C8U2uW6rTjHUHBuuvx3y5adHfpG/LFCfY5T4cajwd1HgFej2A1XEjh7T8k2Ujuh7+Qgp62 YLntf0u848jHB/Ny3miMyyliosEFM5E= 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 --- 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: 544115 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DE29C433F5 for ; Sat, 19 Feb 2022 00:57:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240768AbiBSA5x (ORCPT ); Fri, 18 Feb 2022 19:57:53 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240979AbiBSA53 (ORCPT ); Fri, 18 Feb 2022 19:57:29 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6A44B28883D for ; Fri, 18 Feb 2022 16:56:46 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 --- 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: 544323 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4979C4332F for ; Sat, 19 Feb 2022 00:58:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240995AbiBSA6d (ORCPT ); Fri, 18 Feb 2022 19:58:33 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240986AbiBSA5n (ORCPT ); Fri, 18 Feb 2022 19:57:43 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DF70D28BF5E for ; Fri, 18 Feb 2022 16:56:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645232218; 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=SUMjYzcTLrTPEZDwLtdtcE8hyPi4rD3LI5WECT0lQFZRIWcqUngGXlBRY/jzN39LJye3Ap 414ga08N6O17uAxkIIXslZ2QdhfxGf//Z4hIYCCbDEcIuQmucuoUg2D6WOqyeIJXz0mA3q clq+P0FbvQHvQccv6Xv1DNvDupZj6BY= 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 --- 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: 544114 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDD7BC433F5 for ; Sat, 19 Feb 2022 00:58:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240956AbiBSA6e (ORCPT ); Fri, 18 Feb 2022 19:58:34 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241022AbiBSA5v (ORCPT ); Fri, 18 Feb 2022 19:57:51 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1770627AA05 for ; Fri, 18 Feb 2022 16:57:11 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 --- 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: 544322 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C30E4C433FE for ; Sat, 19 Feb 2022 00:58:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237892AbiBSA6q (ORCPT ); Fri, 18 Feb 2022 19:58:46 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241069AbiBSA6R (ORCPT ); Fri, 18 Feb 2022 19:58:17 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 56B1927B992 for ; Fri, 18 Feb 2022 16:57:25 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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: 544113 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC6B2C433FE for ; Sat, 19 Feb 2022 00:59:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237393AbiBSA7u (ORCPT ); Fri, 18 Feb 2022 19:59:50 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241021AbiBSA6k (ORCPT ); Fri, 18 Feb 2022 19:58:40 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ECE4527FB91 for ; Fri, 18 Feb 2022 16:57:35 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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;