[PATCH] arch/powerpc: Use dma_zalloc_coherent

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE2797d

4 messages, 2 authors, 2018-12-22 · open the first message on its own page

[PATCH] arch/powerpc: Use dma_zalloc_coherent

From: Sabyasachi Gupta <hidden>
Date: 2018-11-05 02:22:57

Replaced dma_alloc_coherent + memset with dma_zalloc_coherent

Signed-off-by: Sabyasachi Gupta <redacted>
---
 arch/powerpc/sysdev/fsl_rmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_rmu.c b/arch/powerpc/sysdev/fsl_rmu.c
index 88b35a3d..8b0ebf3 100644
--- a/arch/powerpc/sysdev/fsl_rmu.c
+++ b/arch/powerpc/sysdev/fsl_rmu.c
@@ -756,15 +756,13 @@ fsl_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
 	}
 
 	/* Initialize outbound message descriptor ring */
-	rmu->msg_tx_ring.virt = dma_alloc_coherent(priv->dev,
+	rmu->msg_tx_ring.virt = dma_zalloc_coherent(priv->dev,
 				rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
 				&rmu->msg_tx_ring.phys, GFP_KERNEL);
 	if (!rmu->msg_tx_ring.virt) {
 		rc = -ENOMEM;
 		goto out_dma;
 	}
-	memset(rmu->msg_tx_ring.virt, 0,
-			rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE);
 	rmu->msg_tx_ring.tx_slot = 0;
 
 	/* Point dequeue/enqueue pointers at first entry in ring */
-- 
2.7.4

Re: [PATCH] arch/powerpc: Use dma_zalloc_coherent

From: Sabyasachi Gupta <hidden>
Date: 2018-11-15 17:56:17

On Mon, Nov 5, 2018 at 7:52 AM Sabyasachi Gupta
[off-list ref] wrote:
Replaced dma_alloc_coherent + memset with dma_zalloc_coherent

Signed-off-by: Sabyasachi Gupta <redacted>
Any comment on this patch?
quoted hunk
---
 arch/powerpc/sysdev/fsl_rmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_rmu.c b/arch/powerpc/sysdev/fsl_rmu.c
index 88b35a3d..8b0ebf3 100644
--- a/arch/powerpc/sysdev/fsl_rmu.c
+++ b/arch/powerpc/sysdev/fsl_rmu.c
@@ -756,15 +756,13 @@ fsl_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
        }

        /* Initialize outbound message descriptor ring */
-       rmu->msg_tx_ring.virt = dma_alloc_coherent(priv->dev,
+       rmu->msg_tx_ring.virt = dma_zalloc_coherent(priv->dev,
                                rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
                                &rmu->msg_tx_ring.phys, GFP_KERNEL);
        if (!rmu->msg_tx_ring.virt) {
                rc = -ENOMEM;
                goto out_dma;
        }
-       memset(rmu->msg_tx_ring.virt, 0,
-                       rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE);
        rmu->msg_tx_ring.tx_slot = 0;

        /* Point dequeue/enqueue pointers at first entry in ring */
--
2.7.4

Re: [PATCH] arch/powerpc: Use dma_zalloc_coherent

From: Sabyasachi Gupta <hidden>
Date: 2018-12-05 04:42:10

On Mon, Nov 5, 2018 at 7:52 AM Sabyasachi Gupta
[off-list ref] wrote:
Replaced dma_alloc_coherent + memset with dma_zalloc_coherent

Signed-off-by: Sabyasachi Gupta <redacted>
Any comment on this patch?
quoted hunk
---
 arch/powerpc/sysdev/fsl_rmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_rmu.c b/arch/powerpc/sysdev/fsl_rmu.c
index 88b35a3d..8b0ebf3 100644
--- a/arch/powerpc/sysdev/fsl_rmu.c
+++ b/arch/powerpc/sysdev/fsl_rmu.c
@@ -756,15 +756,13 @@ fsl_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
        }

        /* Initialize outbound message descriptor ring */
-       rmu->msg_tx_ring.virt = dma_alloc_coherent(priv->dev,
+       rmu->msg_tx_ring.virt = dma_zalloc_coherent(priv->dev,
                                rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
                                &rmu->msg_tx_ring.phys, GFP_KERNEL);
        if (!rmu->msg_tx_ring.virt) {
                rc = -ENOMEM;
                goto out_dma;
        }
-       memset(rmu->msg_tx_ring.virt, 0,
-                       rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE);
        rmu->msg_tx_ring.tx_slot = 0;

        /* Point dequeue/enqueue pointers at first entry in ring */
--
2.7.4

Re: [PATCH] arch/powerpc: Use dma_zalloc_coherent

From: Scott Wood <oss@buserror.net>
Date: 2018-12-22 02:00:58

On Thu, 2018-11-15 at 23:26 +0530, Sabyasachi Gupta wrote:
On Mon, Nov 5, 2018 at 7:52 AM Sabyasachi Gupta
[off-list ref] wrote:
quoted
Replaced dma_alloc_coherent + memset with dma_zalloc_coherent

Signed-off-by: Sabyasachi Gupta <redacted>
Any comment on this patch?
Just that FSL patches should be CCed to me, and the subject line is too broad
(and duplicates another patch posted around the same time).

I'm applying with the subject changed to
"arch/powerpc/fsl_rmu: Use dma_zalloc_coherent".

-Scott

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help