netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 00/26] treewide: Use dma_zalloc_coherent
@ 2014-06-15 20:37 Joe Perches
  2014-06-15 20:37 ` [PATCH -next 10/26] broadcom: " Joe Perches
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Joe Perches @ 2014-06-15 20:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: linuxppc-dev, linux-sh, linux-ide, linux-nvme, linux-crypto,
	dmaengine, dri-devel, linux-rdma, linux-arm-msm, linux-mmc,
	netdev, e1000-devel, ath10k, linux-wireless, wcn36xx, users,
	linux-scsi, linux-usb, linux-fbdev, alsa-devel

Use the zeroing function instead of dma_alloc_coherent & memset(,0,)

Joe Perches (26):
  powerpc: Use dma_zalloc_coherent
  sh: Use dma_zalloc_coherent
  ata: Use dma_zalloc_coherent
  block: Use dma_zalloc_coherent
  crypto: Use dma_zalloc_coherent
  dma: Use dma_zalloc_coherent
  gpu: Use dma_zalloc_coherent
  infiniband: Use dma_zalloc_coherent
  mmc: Use dma_zalloc_coherent
  broadcom: Use dma_zalloc_coherent
  hisilicon: Use dma_zalloc_coherent
  intel: Use dma_zalloc_coherent
  ath: Use dma_zalloc_coherent
  rt2x00: Use dma_zalloc_coherent
  bfa: Use dma_zalloc_coherent
  bnx2fc: Use dma_zalloc_coherent
  bnx2i: Use dma_zalloc_coherent
  dpt_i2o: Use dma_zalloc_coherent
  lpfc: Use dma_zalloc_coherent
  megaraid: Use dma_zalloc_coherent
  mvsas: Use dma_zalloc_coherent
  qla2xxx: Use dma_zalloc_coherent
  qla4xxx: Use dma_zalloc_coherent
  usb: Use dma_zalloc_coherent
  fbdev: Use dma_zalloc_coherent
  sound: Use dma_zalloc_coherent

 arch/powerpc/platforms/pasemi/dma_lib.c       |  8 ++--
 arch/powerpc/sysdev/fsl_rmu.c                 |  9 ++--
 arch/sh/mm/consistent.c                       |  4 +-
 drivers/ata/sata_fsl.c                        |  5 +--
 drivers/block/nvme-core.c                     |  5 +--
 drivers/crypto/amcc/crypto4xx_core.c          |  8 ++--
 drivers/crypto/ixp4xx_crypto.c                |  8 ++--
 drivers/dma/imx-sdma.c                        |  5 +--
 drivers/dma/mxs-dma.c                         |  8 ++--
 drivers/gpu/drm/drm_pci.c                     |  6 +--
 drivers/infiniband/hw/cxgb3/cxio_hal.c        |  7 ++--
 drivers/infiniband/hw/mthca/mthca_memfree.c   |  5 +--
 drivers/infiniband/hw/ocrdma/ocrdma_hw.c      | 20 ++++-----
 drivers/infiniband/hw/ocrdma/ocrdma_stats.c   |  6 +--
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c   |  8 ++--
 drivers/mmc/host/msm_sdcc.c                   |  8 ++--
 drivers/net/ethernet/broadcom/bcm63xx_enet.c  |  6 +--
 drivers/net/ethernet/hisilicon/hix5hd2_gmac.c |  5 +--
 drivers/net/ethernet/intel/ixgb/ixgb_main.c   |  6 +--
 drivers/net/wireless/ath/ath10k/pci.c         |  8 +---
 drivers/net/wireless/ath/ath10k/wmi.c         |  8 +---
 drivers/net/wireless/ath/wcn36xx/dxe.c        |  6 +--
 drivers/net/wireless/rt2x00/rt2x00mmio.c      |  8 ++--
 drivers/scsi/bfa/bfad_bsg.c                   |  6 +--
 drivers/scsi/bnx2fc/bnx2fc_hwi.c              | 59 ++++++++++++---------------
 drivers/scsi/bnx2fc/bnx2fc_tgt.c              | 51 ++++++++++-------------
 drivers/scsi/bnx2i/bnx2i_hwi.c                | 14 +++----
 drivers/scsi/dpt_i2o.c                        | 19 ++++-----
 drivers/scsi/lpfc/lpfc_bsg.c                  |  5 +--
 drivers/scsi/lpfc/lpfc_init.c                 | 22 ++++------
 drivers/scsi/lpfc/lpfc_mbox.c                 |  6 +--
 drivers/scsi/lpfc/lpfc_sli.c                  | 14 +++----
 drivers/scsi/megaraid/megaraid_sas_fusion.c   |  9 ++--
 drivers/scsi/mvsas/mv_init.c                  | 26 +++++-------
 drivers/scsi/qla2xxx/qla_init.c               | 10 ++---
 drivers/scsi/qla4xxx/ql4_init.c               |  5 +--
 drivers/scsi/qla4xxx/ql4_mbx.c                | 21 ++++------
 drivers/scsi/qla4xxx/ql4_nx.c                 |  5 +--
 drivers/scsi/qla4xxx/ql4_os.c                 | 12 +++---
 drivers/usb/dwc2/hcd_ddma.c                   | 20 ++++-----
 drivers/usb/host/uhci-hcd.c                   |  7 ++--
 drivers/video/fbdev/da8xx-fb.c                |  9 ++--
 sound/aoa/soundbus/i2sbus/core.c              | 12 ++----
 sound/sparc/dbri.c                            |  6 +--
 44 files changed, 197 insertions(+), 308 deletions(-)

-- 
1.8.1.2.459.gbcd45b4.dirty

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH -next 10/26] broadcom: Use dma_zalloc_coherent
  2014-06-15 20:37 [PATCH -next 00/26] treewide: Use dma_zalloc_coherent Joe Perches
@ 2014-06-15 20:37 ` Joe Perches
  2014-06-15 20:37 ` [PATCH -next 11/26] hisilicon: " Joe Perches
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Joe Perches @ 2014-06-15 20:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev

Use the zeroing function instead of dma_alloc_coherent & memset(,0,)

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 3e8d1a8..8c61c81 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -2165,27 +2165,25 @@ static int bcm_enetsw_open(struct net_device *dev)
 
 	/* allocate rx dma ring */
 	size = priv->rx_ring_size * sizeof(struct bcm_enet_desc);
-	p = dma_alloc_coherent(kdev, size, &priv->rx_desc_dma, GFP_KERNEL);
+	p = dma_zalloc_coherent(kdev, size, &priv->rx_desc_dma, GFP_KERNEL);
 	if (!p) {
 		dev_err(kdev, "cannot allocate rx ring %u\n", size);
 		ret = -ENOMEM;
 		goto out_freeirq_tx;
 	}
 
-	memset(p, 0, size);
 	priv->rx_desc_alloc_size = size;
 	priv->rx_desc_cpu = p;
 
 	/* allocate tx dma ring */
 	size = priv->tx_ring_size * sizeof(struct bcm_enet_desc);
-	p = dma_alloc_coherent(kdev, size, &priv->tx_desc_dma, GFP_KERNEL);
+	p = dma_zalloc_coherent(kdev, size, &priv->tx_desc_dma, GFP_KERNEL);
 	if (!p) {
 		dev_err(kdev, "cannot allocate tx ring\n");
 		ret = -ENOMEM;
 		goto out_free_rx_ring;
 	}
 
-	memset(p, 0, size);
 	priv->tx_desc_alloc_size = size;
 	priv->tx_desc_cpu = p;
 
-- 
1.8.1.2.459.gbcd45b4.dirty

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH -next 11/26] hisilicon: Use dma_zalloc_coherent
  2014-06-15 20:37 [PATCH -next 00/26] treewide: Use dma_zalloc_coherent Joe Perches
  2014-06-15 20:37 ` [PATCH -next 10/26] broadcom: " Joe Perches
@ 2014-06-15 20:37 ` Joe Perches
  2014-06-15 20:37 ` [PATCH -next 12/26] intel: " Joe Perches
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Joe Perches @ 2014-06-15 20:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev

Use the zeroing function instead of dma_alloc_coherent & memset(,0,)

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
index 0ffdcd3..175b25c 100644
--- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
+++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
@@ -867,12 +867,11 @@ static int hix5hd2_init_hw_desc_queue(struct hix5hd2_priv *priv)
 
 	for (i = 0; i < QUEUE_NUMS; i++) {
 		size = priv->pool[i].count * sizeof(struct hix5hd2_desc);
-		virt_addr = dma_alloc_coherent(dev, size, &phys_addr,
-					       GFP_KERNEL);
+		virt_addr = dma_zalloc_coherent(dev, size, &phys_addr,
+						GFP_KERNEL);
 		if (virt_addr == NULL)
 			goto error_free_pool;
 
-		memset(virt_addr, 0, size);
 		priv->pool[i].size = size;
 		priv->pool[i].desc = virt_addr;
 		priv->pool[i].phys_addr = phys_addr;
-- 
1.8.1.2.459.gbcd45b4.dirty

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH -next 12/26] intel: Use dma_zalloc_coherent
  2014-06-15 20:37 [PATCH -next 00/26] treewide: Use dma_zalloc_coherent Joe Perches
  2014-06-15 20:37 ` [PATCH -next 10/26] broadcom: " Joe Perches
  2014-06-15 20:37 ` [PATCH -next 11/26] hisilicon: " Joe Perches
@ 2014-06-15 20:37 ` Joe Perches
  2014-06-16 21:15   ` Jeff Kirsher
  2014-06-15 20:37 ` [PATCH -next 13/26] ath: " Joe Perches
       [not found] ` <cover.1402863904.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
  4 siblings, 1 reply; 8+ messages in thread
From: Joe Perches @ 2014-06-15 20:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: Linux NICS, e1000-devel, Bruce Allan, Jesse Brandeburg,
	John Ronciak, netdev

Use the zeroing function instead of dma_alloc_coherent & memset(,0,)

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/ethernet/intel/ixgb/ixgb_main.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index 6080127..b02cc72 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -795,14 +795,12 @@ ixgb_setup_rx_resources(struct ixgb_adapter *adapter)
 	rxdr->size = rxdr->count * sizeof(struct ixgb_rx_desc);
 	rxdr->size = ALIGN(rxdr->size, 4096);
 
-	rxdr->desc = dma_alloc_coherent(&pdev->dev, rxdr->size, &rxdr->dma,
-					GFP_KERNEL);
-
+	rxdr->desc = dma_zalloc_coherent(&pdev->dev, rxdr->size, &rxdr->dma,
+					 GFP_KERNEL);
 	if (!rxdr->desc) {
 		vfree(rxdr->buffer_info);
 		return -ENOMEM;
 	}
-	memset(rxdr->desc, 0, rxdr->size);
 
 	rxdr->next_to_clean = 0;
 	rxdr->next_to_use = 0;
-- 
1.8.1.2.459.gbcd45b4.dirty


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH -next 13/26] ath: Use dma_zalloc_coherent
  2014-06-15 20:37 [PATCH -next 00/26] treewide: Use dma_zalloc_coherent Joe Perches
                   ` (2 preceding siblings ...)
  2014-06-15 20:37 ` [PATCH -next 12/26] intel: " Joe Perches
@ 2014-06-15 20:37 ` Joe Perches
  2014-06-16  9:24   ` Kalle Valo
       [not found] ` <cover.1402863904.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
  4 siblings, 1 reply; 8+ messages in thread
From: Joe Perches @ 2014-06-15 20:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: Kalle Valo, John W. Linville, Eugene Krasnikov, ath10k,
	linux-wireless, netdev, wcn36xx

Use the zeroing function instead of dma_alloc_coherent & memset(,0,)

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/ath/ath10k/pci.c  | 8 ++------
 drivers/net/wireless/ath/ath10k/wmi.c  | 8 ++------
 drivers/net/wireless/ath/wcn36xx/dxe.c | 6 ++----
 3 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index d0004d5..35045a4 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -359,16 +359,12 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
 	 *   2) Buffer in DMA-able space
 	 */
 	orig_nbytes = nbytes;
-	data_buf = (unsigned char *)dma_alloc_coherent(ar->dev,
-						       orig_nbytes,
-						       &ce_data_base,
-						       GFP_ATOMIC);
-
+	data_buf = dma_zalloc_coherent(ar->dev, orig_nbytes, &ce_data_base,
+				       GFP_ATOMIC);
 	if (!data_buf) {
 		ret = -ENOMEM;
 		goto done;
 	}
-	memset(data_buf, 0, orig_nbytes);
 
 	remaining_bytes = orig_nbytes;
 	ce_data = ce_data_base;
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 4b7782a..0093269 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1889,17 +1889,13 @@ static int ath10k_wmi_alloc_host_mem(struct ath10k *ar, u32 req_id,
 	if (!pool_size)
 		return -EINVAL;
 
-	ar->wmi.mem_chunks[idx].vaddr = dma_alloc_coherent(ar->dev,
-							   pool_size,
-							   &paddr,
-							   GFP_ATOMIC);
+	ar->wmi.mem_chunks[idx].vaddr = dma_zalloc_coherent(ar->dev, pool_size,
+							    &paddr, GFP_ATOMIC);
 	if (!ar->wmi.mem_chunks[idx].vaddr) {
 		ath10k_warn("failed to allocate memory chunk\n");
 		return -ENOMEM;
 	}
 
-	memset(ar->wmi.mem_chunks[idx].vaddr, 0, pool_size);
-
 	ar->wmi.mem_chunks[idx].paddr = paddr;
 	ar->wmi.mem_chunks[idx].len = pool_size;
 	ar->wmi.mem_chunks[idx].req_id = req_id;
diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c
index 73f12f1..1975a1a 100644
--- a/drivers/net/wireless/ath/wcn36xx/dxe.c
+++ b/drivers/net/wireless/ath/wcn36xx/dxe.c
@@ -177,13 +177,11 @@ static int wcn36xx_dxe_init_descs(struct wcn36xx_dxe_ch *wcn_ch)
 	int i;
 
 	size = wcn_ch->desc_num * sizeof(struct wcn36xx_dxe_desc);
-	wcn_ch->cpu_addr = dma_alloc_coherent(NULL, size, &wcn_ch->dma_addr,
-					      GFP_KERNEL);
+	wcn_ch->cpu_addr = dma_zalloc_coherent(NULL, size, &wcn_ch->dma_addr,
+					       GFP_KERNEL);
 	if (!wcn_ch->cpu_addr)
 		return -ENOMEM;
 
-	memset(wcn_ch->cpu_addr, 0, size);
-
 	cur_dxe = (struct wcn36xx_dxe_desc *)wcn_ch->cpu_addr;
 	cur_ctl = wcn_ch->head_blk_ctl;
 
-- 
1.8.1.2.459.gbcd45b4.dirty

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH -next 14/26] rt2x00: Use dma_zalloc_coherent
       [not found] ` <cover.1402863904.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
@ 2014-06-15 20:37   ` Joe Perches
  0 siblings, 0 replies; 8+ messages in thread
From: Joe Perches @ 2014-06-15 20:37 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	users-poMEt7QlJxcwIE2E9O76wjtx2kNaKg5H

Use the zeroing function instead of dma_alloc_coherent & memset(,0,)

Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
 drivers/net/wireless/rt2x00/rt2x00mmio.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00mmio.c b/drivers/net/wireless/rt2x00/rt2x00mmio.c
index 6f236ea..f0178fd 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mmio.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mmio.c
@@ -119,14 +119,12 @@ static int rt2x00mmio_alloc_queue_dma(struct rt2x00_dev *rt2x00dev,
 	/*
 	 * Allocate DMA memory for descriptor and buffer.
 	 */
-	addr = dma_alloc_coherent(rt2x00dev->dev,
-				  queue->limit * queue->desc_size,
-				  &dma, GFP_KERNEL);
+	addr = dma_zalloc_coherent(rt2x00dev->dev,
+				   queue->limit * queue->desc_size, &dma,
+				   GFP_KERNEL);
 	if (!addr)
 		return -ENOMEM;
 
-	memset(addr, 0, queue->limit * queue->desc_size);
-
 	/*
 	 * Initialize all queue entries to contain valid addresses.
 	 */
-- 
1.8.1.2.459.gbcd45b4.dirty

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH -next 13/26] ath: Use dma_zalloc_coherent
  2014-06-15 20:37 ` [PATCH -next 13/26] ath: " Joe Perches
@ 2014-06-16  9:24   ` Kalle Valo
  0 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2014-06-16  9:24 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel, John W. Linville, Eugene Krasnikov, ath10k,
	linux-wireless, netdev, wcn36xx

Joe Perches <joe@perches.com> writes:

> Use the zeroing function instead of dma_alloc_coherent & memset(,0,)
>
> Signed-off-by: Joe Perches <joe@perches.com>

For ath10k:

Acked-by: Kalle Valo <kvalo@qca.qualcomm.com>

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next 12/26] intel: Use dma_zalloc_coherent
  2014-06-15 20:37 ` [PATCH -next 12/26] intel: " Joe Perches
@ 2014-06-16 21:15   ` Jeff Kirsher
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Kirsher @ 2014-06-16 21:15 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
	Don Skidmore, Greg Rose, Alex Duyck, John Ronciak,
	Mitch Williams, Linux NICS, e1000-devel, netdev

[-- Attachment #1: Type: text/plain, Size: 359 bytes --]

On Sun, 2014-06-15 at 13:37 -0700, Joe Perches wrote:
> Use the zeroing function instead of dma_alloc_coherent & memset(,0,)
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

> ---
>  drivers/net/ethernet/intel/ixgb/ixgb_main.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-06-16 21:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-15 20:37 [PATCH -next 00/26] treewide: Use dma_zalloc_coherent Joe Perches
2014-06-15 20:37 ` [PATCH -next 10/26] broadcom: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 11/26] hisilicon: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 12/26] intel: " Joe Perches
2014-06-16 21:15   ` Jeff Kirsher
2014-06-15 20:37 ` [PATCH -next 13/26] ath: " Joe Perches
2014-06-16  9:24   ` Kalle Valo
     [not found] ` <cover.1402863904.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2014-06-15 20:37   ` [PATCH -next 14/26] rt2x00: " Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).