All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ath10k: remove multiple defines of DIAG_TRANSFER_LIMIT
@ 2017-01-23 15:04 ` Srinivas Kandagatla
  0 siblings, 0 replies; 19+ messages in thread
From: Srinivas Kandagatla @ 2017-01-23 15:04 UTC (permalink / raw)
  To: Kalle Valo
  Cc: ath10k, linux-wireless, netdev, linux-kernel, Srinivas Kandagatla

DIAG_TRANSFER_LIMIT is redefined with same value and comments
just below this entry, remove this duplicate entry.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/net/wireless/ath/ath10k/pci.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index 9854ad5..c76789d 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -25,11 +25,6 @@
 #include "ahb.h"
 
 /*
- * maximum number of bytes that can be handled atomically by DiagRead/DiagWrite
- */
-#define DIAG_TRANSFER_LIMIT 2048
-
-/*
  * maximum number of bytes that can be
  * handled atomically by DiagRead/DiagWrite
  */
-- 
2.10.1

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

* [PATCH 1/3] ath10k: remove multiple defines of DIAG_TRANSFER_LIMIT
@ 2017-01-23 15:04 ` Srinivas Kandagatla
  0 siblings, 0 replies; 19+ messages in thread
From: Srinivas Kandagatla @ 2017-01-23 15:04 UTC (permalink / raw)
  To: Kalle Valo
  Cc: netdev, Srinivas Kandagatla, linux-wireless, linux-kernel, ath10k

DIAG_TRANSFER_LIMIT is redefined with same value and comments
just below this entry, remove this duplicate entry.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/net/wireless/ath/ath10k/pci.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index 9854ad5..c76789d 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -25,11 +25,6 @@
 #include "ahb.h"
 
 /*
- * maximum number of bytes that can be handled atomically by DiagRead/DiagWrite
- */
-#define DIAG_TRANSFER_LIMIT 2048
-
-/*
  * maximum number of bytes that can be
  * handled atomically by DiagRead/DiagWrite
  */
-- 
2.10.1


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* [PATCH 2/3] ath10k: use dma_zalloc_coherent()
  2017-01-23 15:04 ` Srinivas Kandagatla
@ 2017-01-23 15:04   ` Srinivas Kandagatla
  -1 siblings, 0 replies; 19+ messages in thread
From: Srinivas Kandagatla @ 2017-01-23 15:04 UTC (permalink / raw)
  To: Kalle Valo
  Cc: ath10k, linux-wireless, netdev, linux-kernel, Srinivas Kandagatla

use dma_zalloc_coherent() instead of dma_alloc_coherent and memset().

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/net/wireless/ath/ath10k/ce.c  | 9 +--------
 drivers/net/wireless/ath/ath10k/pci.c | 3 +--
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
index 0b4d796..c2b388f 100644
--- a/drivers/net/wireless/ath/ath10k/ce.c
+++ b/drivers/net/wireless/ath/ath10k/ce.c
@@ -958,7 +958,7 @@ ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id,
 	 * coherent DMA are unsupported
 	 */
 	dest_ring->base_addr_owner_space_unaligned =
-		dma_alloc_coherent(ar->dev,
+		dma_zalloc_coherent(ar->dev,
 				   (nentries * sizeof(struct ce_desc) +
 				    CE_DESC_RING_ALIGN),
 				   &base_addr, GFP_KERNEL);
@@ -969,13 +969,6 @@ ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id,
 
 	dest_ring->base_addr_ce_space_unaligned = base_addr;
 
-	/*
-	 * Correctly initialize memory to 0 to prevent garbage
-	 * data crashing system when download firmware
-	 */
-	memset(dest_ring->base_addr_owner_space_unaligned, 0,
-	       nentries * sizeof(struct ce_desc) + CE_DESC_RING_ALIGN);
-
 	dest_ring->base_addr_owner_space = PTR_ALIGN(
 			dest_ring->base_addr_owner_space_unaligned,
 			CE_DESC_RING_ALIGN);
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index b541a1c..855e3de 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
 	 */
 	alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT);
 
-	data_buf = (unsigned char *)dma_alloc_coherent(ar->dev,
+	data_buf = (unsigned char *)dma_zalloc_coherent(ar->dev,
 						       alloc_nbytes,
 						       &ce_data_base,
 						       GFP_ATOMIC);
@@ -905,7 +905,6 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
 		ret = -ENOMEM;
 		goto done;
 	}
-	memset(data_buf, 0, alloc_nbytes);
 
 	remaining_bytes = nbytes;
 	ce_data = ce_data_base;
-- 
2.10.1

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

* [PATCH 2/3] ath10k: use dma_zalloc_coherent()
@ 2017-01-23 15:04   ` Srinivas Kandagatla
  0 siblings, 0 replies; 19+ messages in thread
From: Srinivas Kandagatla @ 2017-01-23 15:04 UTC (permalink / raw)
  To: Kalle Valo
  Cc: netdev, Srinivas Kandagatla, linux-wireless, linux-kernel, ath10k

use dma_zalloc_coherent() instead of dma_alloc_coherent and memset().

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/net/wireless/ath/ath10k/ce.c  | 9 +--------
 drivers/net/wireless/ath/ath10k/pci.c | 3 +--
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
index 0b4d796..c2b388f 100644
--- a/drivers/net/wireless/ath/ath10k/ce.c
+++ b/drivers/net/wireless/ath/ath10k/ce.c
@@ -958,7 +958,7 @@ ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id,
 	 * coherent DMA are unsupported
 	 */
 	dest_ring->base_addr_owner_space_unaligned =
-		dma_alloc_coherent(ar->dev,
+		dma_zalloc_coherent(ar->dev,
 				   (nentries * sizeof(struct ce_desc) +
 				    CE_DESC_RING_ALIGN),
 				   &base_addr, GFP_KERNEL);
@@ -969,13 +969,6 @@ ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id,
 
 	dest_ring->base_addr_ce_space_unaligned = base_addr;
 
-	/*
-	 * Correctly initialize memory to 0 to prevent garbage
-	 * data crashing system when download firmware
-	 */
-	memset(dest_ring->base_addr_owner_space_unaligned, 0,
-	       nentries * sizeof(struct ce_desc) + CE_DESC_RING_ALIGN);
-
 	dest_ring->base_addr_owner_space = PTR_ALIGN(
 			dest_ring->base_addr_owner_space_unaligned,
 			CE_DESC_RING_ALIGN);
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index b541a1c..855e3de 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
 	 */
 	alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT);
 
-	data_buf = (unsigned char *)dma_alloc_coherent(ar->dev,
+	data_buf = (unsigned char *)dma_zalloc_coherent(ar->dev,
 						       alloc_nbytes,
 						       &ce_data_base,
 						       GFP_ATOMIC);
@@ -905,7 +905,6 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
 		ret = -ENOMEM;
 		goto done;
 	}
-	memset(data_buf, 0, alloc_nbytes);
 
 	remaining_bytes = nbytes;
 	ce_data = ce_data_base;
-- 
2.10.1


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* [PATCH 3/3] ath10k: fix typo in addr calculation
  2017-01-23 15:04 ` Srinivas Kandagatla
@ 2017-01-23 15:04   ` Srinivas Kandagatla
  -1 siblings, 0 replies; 19+ messages in thread
From: Srinivas Kandagatla @ 2017-01-23 15:04 UTC (permalink / raw)
  To: Kalle Valo
  Cc: ath10k, linux-wireless, netdev, linux-kernel, Srinivas Kandagatla

CORE_CTRL_ADDRESS is offset in register address space, it does not
make sense to OR it to derive the final address. It looks like its
a typo, so fix it.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/net/wireless/ath/ath10k/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 855e3de..023ab10 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -1936,7 +1936,7 @@ static int ath10k_pci_wake_target_cpu(struct ath10k *ar)
 {
 	u32 addr, val;
 
-	addr = SOC_CORE_BASE_ADDRESS | CORE_CTRL_ADDRESS;
+	addr = SOC_CORE_BASE_ADDRESS + CORE_CTRL_ADDRESS;
 	val = ath10k_pci_read32(ar, addr);
 	val |= CORE_CTRL_CPU_INTR_MASK;
 	ath10k_pci_write32(ar, addr, val);
-- 
2.10.1

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

* [PATCH 3/3] ath10k: fix typo in addr calculation
@ 2017-01-23 15:04   ` Srinivas Kandagatla
  0 siblings, 0 replies; 19+ messages in thread
From: Srinivas Kandagatla @ 2017-01-23 15:04 UTC (permalink / raw)
  To: Kalle Valo
  Cc: netdev, Srinivas Kandagatla, linux-wireless, linux-kernel, ath10k

CORE_CTRL_ADDRESS is offset in register address space, it does not
make sense to OR it to derive the final address. It looks like its
a typo, so fix it.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/net/wireless/ath/ath10k/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 855e3de..023ab10 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -1936,7 +1936,7 @@ static int ath10k_pci_wake_target_cpu(struct ath10k *ar)
 {
 	u32 addr, val;
 
-	addr = SOC_CORE_BASE_ADDRESS | CORE_CTRL_ADDRESS;
+	addr = SOC_CORE_BASE_ADDRESS + CORE_CTRL_ADDRESS;
 	val = ath10k_pci_read32(ar, addr);
 	val |= CORE_CTRL_CPU_INTR_MASK;
 	ath10k_pci_write32(ar, addr, val);
-- 
2.10.1


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()
  2017-01-23 15:04   ` Srinivas Kandagatla
@ 2017-01-23 23:19     ` Joe Perches
  -1 siblings, 0 replies; 19+ messages in thread
From: Joe Perches @ 2017-01-23 23:19 UTC (permalink / raw)
  To: Srinivas Kandagatla, Kalle Valo
  Cc: ath10k, linux-wireless, netdev, linux-kernel

On Mon, 2017-01-23 at 15:04 +0000, Srinivas Kandagatla wrote:
> use dma_zalloc_coherent() instead of dma_alloc_coherent and memset().
[]
> diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
[]
> @@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
>  	 */
>  	alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT);
>  
> -	data_buf = (unsigned char *)dma_alloc_coherent(ar->dev,
> +	data_buf = (unsigned char *)dma_zalloc_coherent(ar->dev,
>  						       alloc_nbytes,
>  						       &ce_data_base,
>  						       GFP_ATOMIC);

trivia:

Nicer to realign arguments and remove the unnecessary cast.

Perhaps:

	data_buf = dma_zalloc_coherent(ar->dev, alloc_nbytes, &ce_data_base,
				       GFP_ATOMIC);

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

* Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()
@ 2017-01-23 23:19     ` Joe Perches
  0 siblings, 0 replies; 19+ messages in thread
From: Joe Perches @ 2017-01-23 23:19 UTC (permalink / raw)
  To: Srinivas Kandagatla, Kalle Valo
  Cc: netdev, linux-wireless, linux-kernel, ath10k

On Mon, 2017-01-23 at 15:04 +0000, Srinivas Kandagatla wrote:
> use dma_zalloc_coherent() instead of dma_alloc_coherent and memset().
[]
> diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
[]
> @@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
>  	 */
>  	alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT);
>  
> -	data_buf = (unsigned char *)dma_alloc_coherent(ar->dev,
> +	data_buf = (unsigned char *)dma_zalloc_coherent(ar->dev,
>  						       alloc_nbytes,
>  						       &ce_data_base,
>  						       GFP_ATOMIC);

trivia:

Nicer to realign arguments and remove the unnecessary cast.

Perhaps:

	data_buf = dma_zalloc_coherent(ar->dev, alloc_nbytes, &ce_data_base,
				       GFP_ATOMIC);



_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()
  2017-01-23 23:19     ` Joe Perches
  (?)
@ 2017-01-24  5:18       ` Valo, Kalle
  -1 siblings, 0 replies; 19+ messages in thread
From: Valo, Kalle @ 2017-01-24  5:18 UTC (permalink / raw)
  To: Joe Perches
  Cc: Srinivas Kandagatla, ath10k, linux-wireless, netdev, linux-kernel

Sm9lIFBlcmNoZXMgPGpvZUBwZXJjaGVzLmNvbT4gd3JpdGVzOg0KDQo+IE9uIE1vbiwgMjAxNy0w
MS0yMyBhdCAxNTowNCArMDAwMCwgU3Jpbml2YXMgS2FuZGFnYXRsYSB3cm90ZToNCj4+IHVzZSBk
bWFfemFsbG9jX2NvaGVyZW50KCkgaW5zdGVhZCBvZiBkbWFfYWxsb2NfY29oZXJlbnQgYW5kIG1l
bXNldCgpLg0KPiBbXQ0KPj4gZGlmZiAtLWdpdCBhL2RyaXZlcnMvbmV0L3dpcmVsZXNzL2F0aC9h
dGgxMGsvcGNpLmMgYi9kcml2ZXJzL25ldC93aXJlbGVzcy9hdGgvYXRoMTBrL3BjaS5jDQo+IFtd
DQo+PiBAQCAtODk2LDcgKzg5Niw3IEBAIHN0YXRpYyBpbnQgYXRoMTBrX3BjaV9kaWFnX3JlYWRf
bWVtKHN0cnVjdCBhdGgxMGsgKmFyLCB1MzIgYWRkcmVzcywgdm9pZCAqZGF0YSwNCj4+ICAJICov
DQo+PiAgCWFsbG9jX25ieXRlcyA9IG1pbl90KHVuc2lnbmVkIGludCwgbmJ5dGVzLCBESUFHX1RS
QU5TRkVSX0xJTUlUKTsNCj4+ICANCj4+IC0JZGF0YV9idWYgPSAodW5zaWduZWQgY2hhciAqKWRt
YV9hbGxvY19jb2hlcmVudChhci0+ZGV2LA0KPj4gKwlkYXRhX2J1ZiA9ICh1bnNpZ25lZCBjaGFy
ICopZG1hX3phbGxvY19jb2hlcmVudChhci0+ZGV2LA0KPj4gIAkJCQkJCSAgICAgICBhbGxvY19u
Ynl0ZXMsDQo+PiAgCQkJCQkJICAgICAgICZjZV9kYXRhX2Jhc2UsDQo+PiAgCQkJCQkJICAgICAg
IEdGUF9BVE9NSUMpOw0KPg0KPiB0cml2aWE6DQo+DQo+IE5pY2VyIHRvIHJlYWxpZ24gYXJndW1l
bnRzIGFuZCByZW1vdmUgdGhlIHVubmVjZXNzYXJ5IGNhc3QuDQo+DQo+IFBlcmhhcHM6DQo+DQo+
IAlkYXRhX2J1ZiA9IGRtYV96YWxsb2NfY29oZXJlbnQoYXItPmRldizCoGFsbG9jX25ieXRlcywg
JmNlX2RhdGFfYmFzZSwNCj4gCQkJCSAgICAgIMKgR0ZQX0FUT01JQyk7DQoNClN1cmUsIGJ1dCB0
aGF0IHNob3VsZCBiZSBpbiBhIHNlcGFyYXRlIHBhdGNoLg0KDQotLSANCkthbGxlIFZhbG8=

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

* Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()
@ 2017-01-24  5:18       ` Valo, Kalle
  0 siblings, 0 replies; 19+ messages in thread
From: Valo, Kalle @ 2017-01-24  5:18 UTC (permalink / raw)
  To: Joe Perches
  Cc: Srinivas Kandagatla, ath10k, linux-wireless, netdev, linux-kernel

Joe Perches <joe@perches.com> writes:

> On Mon, 2017-01-23 at 15:04 +0000, Srinivas Kandagatla wrote:
>> use dma_zalloc_coherent() instead of dma_alloc_coherent and memset().
> []
>> diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
> []
>> @@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
>>  	 */
>>  	alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT);
>>  
>> -	data_buf = (unsigned char *)dma_alloc_coherent(ar->dev,
>> +	data_buf = (unsigned char *)dma_zalloc_coherent(ar->dev,
>>  						       alloc_nbytes,
>>  						       &ce_data_base,
>>  						       GFP_ATOMIC);
>
> trivia:
>
> Nicer to realign arguments and remove the unnecessary cast.
>
> Perhaps:
>
> 	data_buf = dma_zalloc_coherent(ar->dev, alloc_nbytes, &ce_data_base,
> 				       GFP_ATOMIC);

Sure, but that should be in a separate patch.

-- 
Kalle Valo

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

* Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()
@ 2017-01-24  5:18       ` Valo, Kalle
  0 siblings, 0 replies; 19+ messages in thread
From: Valo, Kalle @ 2017-01-24  5:18 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-wireless, Srinivas Kandagatla, linux-kernel, ath10k, netdev

Joe Perches <joe@perches.com> writes:

> On Mon, 2017-01-23 at 15:04 +0000, Srinivas Kandagatla wrote:
>> use dma_zalloc_coherent() instead of dma_alloc_coherent and memset().
> []
>> diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
> []
>> @@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
>>  	 */
>>  	alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT);
>>  
>> -	data_buf = (unsigned char *)dma_alloc_coherent(ar->dev,
>> +	data_buf = (unsigned char *)dma_zalloc_coherent(ar->dev,
>>  						       alloc_nbytes,
>>  						       &ce_data_base,
>>  						       GFP_ATOMIC);
>
> trivia:
>
> Nicer to realign arguments and remove the unnecessary cast.
>
> Perhaps:
>
> 	data_buf = dma_zalloc_coherent(ar->dev, alloc_nbytes, &ce_data_base,
> 				       GFP_ATOMIC);

Sure, but that should be in a separate patch.

-- 
Kalle Valo
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()
  2017-01-24  5:18       ` Valo, Kalle
@ 2017-01-24  5:25         ` Joe Perches
  -1 siblings, 0 replies; 19+ messages in thread
From: Joe Perches @ 2017-01-24  5:25 UTC (permalink / raw)
  To: Valo, Kalle
  Cc: Srinivas Kandagatla, ath10k, linux-wireless, netdev, linux-kernel

On Tue, 2017-01-24 at 05:18 +0000, Valo, Kalle wrote:
> Joe Perches <joe@perches.com> writes:
> 
> > On Mon, 2017-01-23 at 15:04 +0000, Srinivas Kandagatla wrote:
> > > use dma_zalloc_coherent() instead of dma_alloc_coherent and memset().
> > 
> > []
> > > diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
> > 
> > []
> > > @@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
> > >  	 */
> > >  	alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT);
> > >  
> > > -	data_buf = (unsigned char *)dma_alloc_coherent(ar->dev,
> > > +	data_buf = (unsigned char *)dma_zalloc_coherent(ar->dev,
> > >  						       alloc_nbytes,
> > >  						       &ce_data_base,
> > >  						       GFP_ATOMIC);
> > 
> > trivia:
> > 
> > Nicer to realign arguments and remove the unnecessary cast.
> > 
> > Perhaps:
> > 
> > 	data_buf = dma_zalloc_coherent(ar->dev, alloc_nbytes, &ce_data_base,
> > 				       GFP_ATOMIC);
> 
> Sure, but that should be in a separate patch.

I don't think so, trivial patches can be combined.

It's also nicer to realign all modified multiline
arguments when performing these changes.

Coccinelle generally does it automatically.

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

* Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()
@ 2017-01-24  5:25         ` Joe Perches
  0 siblings, 0 replies; 19+ messages in thread
From: Joe Perches @ 2017-01-24  5:25 UTC (permalink / raw)
  To: Valo, Kalle
  Cc: linux-wireless, Srinivas Kandagatla, linux-kernel, ath10k, netdev

On Tue, 2017-01-24 at 05:18 +0000, Valo, Kalle wrote:
> Joe Perches <joe@perches.com> writes:
> 
> > On Mon, 2017-01-23 at 15:04 +0000, Srinivas Kandagatla wrote:
> > > use dma_zalloc_coherent() instead of dma_alloc_coherent and memset().
> > 
> > []
> > > diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
> > 
> > []
> > > @@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
> > >  	 */
> > >  	alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT);
> > >  
> > > -	data_buf = (unsigned char *)dma_alloc_coherent(ar->dev,
> > > +	data_buf = (unsigned char *)dma_zalloc_coherent(ar->dev,
> > >  						       alloc_nbytes,
> > >  						       &ce_data_base,
> > >  						       GFP_ATOMIC);
> > 
> > trivia:
> > 
> > Nicer to realign arguments and remove the unnecessary cast.
> > 
> > Perhaps:
> > 
> > 	data_buf = dma_zalloc_coherent(ar->dev, alloc_nbytes, &ce_data_base,
> > 				       GFP_ATOMIC);
> 
> Sure, but that should be in a separate patch.

I don't think so, trivial patches can be combined.

It's also nicer to realign all modified multiline
arguments when performing these changes.

Coccinelle generally does it automatically.

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()
  2017-01-24  5:25         ` Joe Perches
  (?)
@ 2017-01-24 12:13           ` Valo, Kalle
  -1 siblings, 0 replies; 19+ messages in thread
From: Valo, Kalle @ 2017-01-24 12:13 UTC (permalink / raw)
  To: Joe Perches
  Cc: Srinivas Kandagatla, ath10k, linux-wireless, netdev, linux-kernel

Sm9lIFBlcmNoZXMgPGpvZUBwZXJjaGVzLmNvbT4gd3JpdGVzOg0KDQo+IE9uIFR1ZSwgMjAxNy0w
MS0yNCBhdCAwNToxOCArMDAwMCwgVmFsbywgS2FsbGUgd3JvdGU6DQo+PiBKb2UgUGVyY2hlcyA8
am9lQHBlcmNoZXMuY29tPiB3cml0ZXM6DQo+PiANCj4+ID4gT24gTW9uLCAyMDE3LTAxLTIzIGF0
IDE1OjA0ICswMDAwLCBTcmluaXZhcyBLYW5kYWdhdGxhIHdyb3RlOg0KPj4gPiA+IHVzZSBkbWFf
emFsbG9jX2NvaGVyZW50KCkgaW5zdGVhZCBvZiBkbWFfYWxsb2NfY29oZXJlbnQgYW5kIG1lbXNl
dCgpLg0KPj4gPiANCj4+ID4gW10NCj4+ID4gPiBkaWZmIC0tZ2l0IGEvZHJpdmVycy9uZXQvd2ly
ZWxlc3MvYXRoL2F0aDEway9wY2kuYw0KPj4gPiA+IGIvZHJpdmVycy9uZXQvd2lyZWxlc3MvYXRo
L2F0aDEway9wY2kuYw0KPj4gPiANCj4+ID4gW10NCj4+ID4gPiBAQCAtODk2LDcgKzg5Niw3IEBA
IHN0YXRpYyBpbnQgYXRoMTBrX3BjaV9kaWFnX3JlYWRfbWVtKHN0cnVjdCBhdGgxMGsgKmFyLCB1
MzIgYWRkcmVzcywgdm9pZCAqZGF0YSwNCj4+ID4gPiAgCSAqLw0KPj4gPiA+ICAJYWxsb2NfbmJ5
dGVzID0gbWluX3QodW5zaWduZWQgaW50LCBuYnl0ZXMsIERJQUdfVFJBTlNGRVJfTElNSVQpOw0K
Pj4gPiA+ICANCj4+ID4gPiAtCWRhdGFfYnVmID0gKHVuc2lnbmVkIGNoYXIgKilkbWFfYWxsb2Nf
Y29oZXJlbnQoYXItPmRldiwNCj4+ID4gPiArCWRhdGFfYnVmID0gKHVuc2lnbmVkIGNoYXIgKilk
bWFfemFsbG9jX2NvaGVyZW50KGFyLT5kZXYsDQo+PiA+ID4gIAkJCQkJCSAgICAgICBhbGxvY19u
Ynl0ZXMsDQo+PiA+ID4gIAkJCQkJCSAgICAgICAmY2VfZGF0YV9iYXNlLA0KPj4gPiA+ICAJCQkJ
CQkgICAgICAgR0ZQX0FUT01JQyk7DQo+PiA+IA0KPj4gPiB0cml2aWE6DQo+PiA+IA0KPj4gPiBO
aWNlciB0byByZWFsaWduIGFyZ3VtZW50cyBhbmQgcmVtb3ZlIHRoZSB1bm5lY2Vzc2FyeSBjYXN0
Lg0KPj4gPiANCj4+ID4gUGVyaGFwczoNCj4+ID4gDQo+PiA+IAlkYXRhX2J1ZiA9IGRtYV96YWxs
b2NfY29oZXJlbnQoYXItPmRldizCoGFsbG9jX25ieXRlcywgJmNlX2RhdGFfYmFzZSwNCj4+ID4g
CQkJCSAgICAgIMKgR0ZQX0FUT01JQyk7DQo+PiANCj4+IFN1cmUsIGJ1dCB0aGF0IHNob3VsZCBi
ZSBpbiBhIHNlcGFyYXRlIHBhdGNoLg0KPg0KPiBJIGRvbid0IHRoaW5rIHNvLCB0cml2aWFsIHBh
dGNoZXMgY2FuIGJlIGNvbWJpbmVkLg0KPg0KPiBJdCdzIGFsc28gbmljZXIgdG8gcmVhbGlnbiBh
bGwgbW9kaWZpZWQgbXVsdGlsaW5lDQo+IGFyZ3VtZW50cyB3aGVuIHBlcmZvcm1pbmcgdGhlc2Ug
Y2hhbmdlcy4NCj4NCj4gQ29jY2luZWxsZSBnZW5lcmFsbHkgZG9lcyBpdCBhdXRvbWF0aWNhbGx5
Lg0KDQpBIG1hdHRlciBvZiBwcmVmZXJlbmNlIHJlYWxseS4gSSBwcmVmZXIga2VlcGluZyBzdHls
ZSBhbmQgZnVuY3Rpb25hbA0KY2hhbmdlcyBpbiBzZXBhcmF0ZSBwYXRjaGVzLCBrZWVwcyB0aGUg
cmV2aWV3IHNpbXBsZS4gQW5kIHN0eWxlIGNoYW5nZXMNCmNhbiBoaWRlIGJ1Z3MuDQoNCi0tIA0K
S2FsbGUgVmFsbw==

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

* Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()
@ 2017-01-24 12:13           ` Valo, Kalle
  0 siblings, 0 replies; 19+ messages in thread
From: Valo, Kalle @ 2017-01-24 12:13 UTC (permalink / raw)
  To: Joe Perches
  Cc: Srinivas Kandagatla, ath10k, linux-wireless, netdev, linux-kernel

Joe Perches <joe@perches.com> writes:

> On Tue, 2017-01-24 at 05:18 +0000, Valo, Kalle wrote:
>> Joe Perches <joe@perches.com> writes:
>> 
>> > On Mon, 2017-01-23 at 15:04 +0000, Srinivas Kandagatla wrote:
>> > > use dma_zalloc_coherent() instead of dma_alloc_coherent and memset().
>> > 
>> > []
>> > > diff --git a/drivers/net/wireless/ath/ath10k/pci.c
>> > > b/drivers/net/wireless/ath/ath10k/pci.c
>> > 
>> > []
>> > > @@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
>> > >  	 */
>> > >  	alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT);
>> > >  
>> > > -	data_buf = (unsigned char *)dma_alloc_coherent(ar->dev,
>> > > +	data_buf = (unsigned char *)dma_zalloc_coherent(ar->dev,
>> > >  						       alloc_nbytes,
>> > >  						       &ce_data_base,
>> > >  						       GFP_ATOMIC);
>> > 
>> > trivia:
>> > 
>> > Nicer to realign arguments and remove the unnecessary cast.
>> > 
>> > Perhaps:
>> > 
>> > 	data_buf = dma_zalloc_coherent(ar->dev, alloc_nbytes, &ce_data_base,
>> > 				       GFP_ATOMIC);
>> 
>> Sure, but that should be in a separate patch.
>
> I don't think so, trivial patches can be combined.
>
> It's also nicer to realign all modified multiline
> arguments when performing these changes.
>
> Coccinelle generally does it automatically.

A matter of preference really. I prefer keeping style and functional
changes in separate patches, keeps the review simple. And style changes
can hide bugs.

-- 
Kalle Valo

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

* Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()
@ 2017-01-24 12:13           ` Valo, Kalle
  0 siblings, 0 replies; 19+ messages in thread
From: Valo, Kalle @ 2017-01-24 12:13 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-wireless, Srinivas Kandagatla, linux-kernel, ath10k, netdev

Joe Perches <joe@perches.com> writes:

> On Tue, 2017-01-24 at 05:18 +0000, Valo, Kalle wrote:
>> Joe Perches <joe@perches.com> writes:
>> 
>> > On Mon, 2017-01-23 at 15:04 +0000, Srinivas Kandagatla wrote:
>> > > use dma_zalloc_coherent() instead of dma_alloc_coherent and memset().
>> > 
>> > []
>> > > diff --git a/drivers/net/wireless/ath/ath10k/pci.c
>> > > b/drivers/net/wireless/ath/ath10k/pci.c
>> > 
>> > []
>> > > @@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
>> > >  	 */
>> > >  	alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT);
>> > >  
>> > > -	data_buf = (unsigned char *)dma_alloc_coherent(ar->dev,
>> > > +	data_buf = (unsigned char *)dma_zalloc_coherent(ar->dev,
>> > >  						       alloc_nbytes,
>> > >  						       &ce_data_base,
>> > >  						       GFP_ATOMIC);
>> > 
>> > trivia:
>> > 
>> > Nicer to realign arguments and remove the unnecessary cast.
>> > 
>> > Perhaps:
>> > 
>> > 	data_buf = dma_zalloc_coherent(ar->dev, alloc_nbytes, &ce_data_base,
>> > 				       GFP_ATOMIC);
>> 
>> Sure, but that should be in a separate patch.
>
> I don't think so, trivial patches can be combined.
>
> It's also nicer to realign all modified multiline
> arguments when performing these changes.
>
> Coccinelle generally does it automatically.

A matter of preference really. I prefer keeping style and functional
changes in separate patches, keeps the review simple. And style changes
can hide bugs.

-- 
Kalle Valo
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [1/3] ath10k: remove multiple defines of DIAG_TRANSFER_LIMIT
  2017-01-23 15:04 ` Srinivas Kandagatla
  (?)
@ 2017-01-27 18:04   ` Kalle Valo
  -1 siblings, 0 replies; 19+ messages in thread
From: Kalle Valo @ 2017-01-27 18:04 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: netdev, Srinivas Kandagatla, linux-wireless, linux-kernel, ath10k

Srinivas Kandagatla <srinivas.kandagatla@linaro.org> wrote:
> DIAG_TRANSFER_LIMIT is redefined with same value and comments
> just below this entry, remove this duplicate entry.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

3 patches applied to ath-next branch of ath.git, thanks.

dd51fa3d8a1d ath10k: remove multiple defines of DIAG_TRANSFER_LIMIT
0de4df5ba2ad ath10k: use dma_zalloc_coherent()
1ad38fd719da ath10k: fix typo in addr calculation

-- 
https://patchwork.kernel.org/patch/9532691/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

* Re: [1/3] ath10k: remove multiple defines of DIAG_TRANSFER_LIMIT
@ 2017-01-27 18:04   ` Kalle Valo
  0 siblings, 0 replies; 19+ messages in thread
From: Kalle Valo @ 2017-01-27 18:04 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: linux-wireless, netdev, Srinivas Kandagatla, linux-kernel, ath10k

Srinivas Kandagatla <srinivas.kandagatla@linaro.org> wrote:
> DIAG_TRANSFER_LIMIT is redefined with same value and comments
> just below this entry, remove this duplicate entry.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

3 patches applied to ath-next branch of ath.git, thanks.

dd51fa3d8a1d ath10k: remove multiple defines of DIAG_TRANSFER_LIMIT
0de4df5ba2ad ath10k: use dma_zalloc_coherent()
1ad38fd719da ath10k: fix typo in addr calculation

-- 
https://patchwork.kernel.org/patch/9532691/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

* Re: [1/3] ath10k: remove multiple defines of DIAG_TRANSFER_LIMIT
@ 2017-01-27 18:04   ` Kalle Valo
  0 siblings, 0 replies; 19+ messages in thread
From: Kalle Valo @ 2017-01-27 18:04 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: linux-wireless, netdev, linux-kernel, ath10k

Srinivas Kandagatla <srinivas.kandagatla@linaro.org> wrote:
> DIAG_TRANSFER_LIMIT is redefined with same value and comments
> just below this entry, remove this duplicate entry.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

3 patches applied to ath-next branch of ath.git, thanks.

dd51fa3d8a1d ath10k: remove multiple defines of DIAG_TRANSFER_LIMIT
0de4df5ba2ad ath10k: use dma_zalloc_coherent()
1ad38fd719da ath10k: fix typo in addr calculation

-- 
https://patchwork.kernel.org/patch/9532691/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

end of thread, other threads:[~2017-01-27 18:08 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-23 15:04 [PATCH 1/3] ath10k: remove multiple defines of DIAG_TRANSFER_LIMIT Srinivas Kandagatla
2017-01-23 15:04 ` Srinivas Kandagatla
2017-01-23 15:04 ` [PATCH 2/3] ath10k: use dma_zalloc_coherent() Srinivas Kandagatla
2017-01-23 15:04   ` Srinivas Kandagatla
2017-01-23 23:19   ` Joe Perches
2017-01-23 23:19     ` Joe Perches
2017-01-24  5:18     ` Valo, Kalle
2017-01-24  5:18       ` Valo, Kalle
2017-01-24  5:18       ` Valo, Kalle
2017-01-24  5:25       ` Joe Perches
2017-01-24  5:25         ` Joe Perches
2017-01-24 12:13         ` Valo, Kalle
2017-01-24 12:13           ` Valo, Kalle
2017-01-24 12:13           ` Valo, Kalle
2017-01-23 15:04 ` [PATCH 3/3] ath10k: fix typo in addr calculation Srinivas Kandagatla
2017-01-23 15:04   ` Srinivas Kandagatla
2017-01-27 18:04 ` [1/3] ath10k: remove multiple defines of DIAG_TRANSFER_LIMIT Kalle Valo
2017-01-27 18:04   ` Kalle Valo
2017-01-27 18:04   ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.