Subject: [PATCH] ath6kl: Fix missing gpio pin 9 configuration

GPIO pin 9 also needs to be configured along with other gpio
pins to avoid sdio crc errors. I've not experienced any issue
with missing this particular gpio pin configuration, found dunring
code review. This can potentially improve rx performance.

Signed-off-by: Vasanthakumar Thiagarajan <[email protected]>
---
drivers/net/wireless/ath/ath6kl/init.c | 6 ++++++
drivers/net/wireless/ath/ath6kl/target.h | 1 +
2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 10de132..241febc 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1392,6 +1392,12 @@ static int ath6kl_init_upload(struct ath6kl *ar)
ar->version.target_ver == AR6003_HW_2_1_1_VERSION) {
ath6kl_err("temporary war to avoid sdio crc error\n");

+ param = 0x28;
+ address = GPIO_BASE_ADDRESS + GPIO_PIN9_ADDRESS;
+ status = ath6kl_bmi_reg_write(ar, address, param);
+ if (status)
+ return status;
+
param = 0x20;

address = GPIO_BASE_ADDRESS + GPIO_PIN10_ADDRESS;
diff --git a/drivers/net/wireless/ath/ath6kl/target.h b/drivers/net/wireless/ath/ath6kl/target.h
index 78e0ef4..a98c12b 100644
--- a/drivers/net/wireless/ath/ath6kl/target.h
+++ b/drivers/net/wireless/ath/ath6kl/target.h
@@ -45,6 +45,7 @@
#define LPO_CAL_ENABLE_S 20
#define LPO_CAL_ENABLE 0x00100000

+#define GPIO_PIN9_ADDRESS 0x0000004c
#define GPIO_PIN10_ADDRESS 0x00000050
#define GPIO_PIN11_ADDRESS 0x00000054
#define GPIO_PIN12_ADDRESS 0x00000058
--
1.7.0.4



2012-05-24 07:13:08

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath6kl: Fix missing gpio pin 9 configuration

On 05/22/2012 10:22 AM, Vasanthakumar Thiagarajan wrote:
> GPIO pin 9 also needs to be configured along with other gpio
> pins to avoid sdio crc errors. I've not experienced any issue
> with missing this particular gpio pin configuration, found dunring
> code review. This can potentially improve rx performance.
>
> Signed-off-by: Vasanthakumar Thiagarajan <[email protected]>

Thanks, applied.

Kalle

Subject: [PATCH 1/2] ath6kl: Update netstats for some of the tx failrues in ath6kl_data_tx()

There are few cases where the tx skb is dropped but netstats is
not updated, fix this.

Signed-off-by: Vasanthakumar Thiagarajan <[email protected]>
---
drivers/net/wireless/ath/ath6kl/txrx.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index 82f2f5c..67206ae 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -362,15 +362,11 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
skb, skb->data, skb->len);

/* If target is not associated */
- if (!test_bit(CONNECTED, &vif->flags)) {
- dev_kfree_skb(skb);
- return 0;
- }
+ if (!test_bit(CONNECTED, &vif->flags))
+ goto fail_tx;

- if (WARN_ON_ONCE(ar->state != ATH6KL_STATE_ON)) {
- dev_kfree_skb(skb);
- return 0;
- }
+ if (WARN_ON_ONCE(ar->state != ATH6KL_STATE_ON))
+ goto fail_tx;

if (!test_bit(WMI_READY, &ar->flag))
goto fail_tx;
--
1.7.0.4


Subject: Re: [PATCH] ath6kl: Fix missing gpio pin 9 configuration



On Tuesday 22 May 2012 12:52 PM, Vasanthakumar Thiagarajan wrote:
> GPIO pin 9 also needs to be configured along with other gpio
> pins to avoid sdio crc errors. I've not experienced any issue
> with missing this particular gpio pin configuration, found dunring
> code review. This can potentially improve rx performance.
>
> Signed-off-by: Vasanthakumar Thiagarajan<[email protected]>
> ---
> drivers/net/wireless/ath/ath6kl/init.c | 6 ++++++
> drivers/net/wireless/ath/ath6kl/target.h | 1 +
> 2 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
> index 10de132..241febc 100644
> --- a/drivers/net/wireless/ath/ath6kl/init.c
> +++ b/drivers/net/wireless/ath/ath6kl/init.c
> @@ -1392,6 +1392,12 @@ static int ath6kl_init_upload(struct ath6kl *ar)
> ar->version.target_ver == AR6003_HW_2_1_1_VERSION) {
> ath6kl_err("temporary war to avoid sdio crc error\n");
>
> + param = 0x28;
> + address = GPIO_BASE_ADDRESS + GPIO_PIN9_ADDRESS;
> + status = ath6kl_bmi_reg_write(ar, address, param);
> + if (status)
> + return status;
> +
> param = 0x20;
>
> address = GPIO_BASE_ADDRESS + GPIO_PIN10_ADDRESS;
> diff --git a/drivers/net/wireless/ath/ath6kl/target.h b/drivers/net/wireless/ath/ath6kl/target.h
> index 78e0ef4..a98c12b 100644
> --- a/drivers/net/wireless/ath/ath6kl/target.h
> +++ b/drivers/net/wireless/ath/ath6kl/target.h
> @@ -45,6 +45,7 @@
> #define LPO_CAL_ENABLE_S 20
> #define LPO_CAL_ENABLE 0x00100000
>
> +#define GPIO_PIN9_ADDRESS 0x0000004c
> #define GPIO_PIN10_ADDRESS 0x00000050
> #define GPIO_PIN11_ADDRESS 0x00000054
> #define GPIO_PIN12_ADDRESS 0x00000058

I hope you are not dropping this one along with the other
series of two patches sent mistakenly. This is genuine patch.

Vasanth

2012-05-23 07:18:52

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath6kl: Fix missing gpio pin 9 configuration

On 05/23/2012 10:16 AM, Vasanthakumar Thiagarajan wrote:
> On Tuesday 22 May 2012 12:52 PM, Vasanthakumar Thiagarajan wrote:
>> GPIO pin 9 also needs to be configured along with other gpio
>> pins to avoid sdio crc errors. I've not experienced any issue
>> with missing this particular gpio pin configuration, found dunring
>> code review. This can potentially improve rx performance.
>>
>> Signed-off-by: Vasanthakumar Thiagarajan<[email protected]>
>
> I hope you are not dropping this one along with the other
> series of two patches sent mistakenly. This is genuine patch.

No, I didn't. I was just busy with something else, will review soon.

Kalle

Subject: [PATCH 2/2] ath6kl: Complete failed tx packet in ath6kl_htc_tx_from_queue()

Return status of ath6kl_htc_tx_issue() is ignored in
ath6kl_htc_tx_from_queue(), but failed tx packet is
is not cleaned up. To fix memory leak in this case, call
completion with error. Also, throw an error debug message
when tx fails in ath6kl_sdio_write_async() due to shortage
in bus request buffer.

Signed-off-by: Vasanthakumar Thiagarajan <[email protected]>
---
drivers/net/wireless/ath/ath6kl/htc_mbox.c | 8 +++++++-
drivers/net/wireless/ath/ath6kl/sdio.c | 4 +++-
2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/htc_mbox.c b/drivers/net/wireless/ath/ath6kl/htc_mbox.c
index 65310d5..8729803 100644
--- a/drivers/net/wireless/ath/ath6kl/htc_mbox.c
+++ b/drivers/net/wireless/ath/ath6kl/htc_mbox.c
@@ -850,6 +850,7 @@ static void ath6kl_htc_tx_from_queue(struct htc_target *target,
int bundle_sent;
int n_pkts_bundle;
u8 ac = WMM_NUM_AC;
+ int status;

spin_lock_bh(&target->tx_lock);

@@ -911,7 +912,12 @@ static void ath6kl_htc_tx_from_queue(struct htc_target *target,

ath6kl_htc_tx_prep_pkt(packet, packet->info.tx.flags,
0, packet->info.tx.seqno);
- ath6kl_htc_tx_issue(target, packet);
+ status = ath6kl_htc_tx_issue(target, packet);
+
+ if (status) {
+ packet->status = status;
+ packet->completion(packet->context, packet);
+ }
}

spin_lock_bh(&target->tx_lock);
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index 0384a0f..efe083f 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -552,8 +552,10 @@ static int ath6kl_sdio_write_async(struct ath6kl *ar, u32 address, u8 *buffer,

bus_req = ath6kl_sdio_alloc_busreq(ar_sdio);

- if (!bus_req)
+ if (!bus_req) {
+ ath6kl_err("Ran out of bus request buffer for tx\n");
return -ENOMEM;
+ }

bus_req->address = address;
bus_req->buffer = buffer;
--
1.7.0.4


Subject: Re: [PATCH 2/2] ath6kl: Complete failed tx packet in ath6kl_htc_tx_from_queue()


Oops, please forget this crap, mistakenly sent the older patches.
I'm really sorry.

Vasanth

On Tuesday 22 May 2012 12:52 PM, Vasanthakumar Thiagarajan wrote:
> Return status of ath6kl_htc_tx_issue() is ignored in
> ath6kl_htc_tx_from_queue(), but failed tx packet is
> is not cleaned up. To fix memory leak in this case, call
> completion with error. Also, throw an error debug message
> when tx fails in ath6kl_sdio_write_async() due to shortage
> in bus request buffer.
>
> Signed-off-by: Vasanthakumar Thiagarajan<[email protected]>
> ---
> drivers/net/wireless/ath/ath6kl/htc_mbox.c | 8 +++++++-
> drivers/net/wireless/ath/ath6kl/sdio.c | 4 +++-
> 2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath6kl/htc_mbox.c b/drivers/net/wireless/ath/ath6kl/htc_mbox.c
> index 65310d5..8729803 100644
> --- a/drivers/net/wireless/ath/ath6kl/htc_mbox.c
> +++ b/drivers/net/wireless/ath/ath6kl/htc_mbox.c
> @@ -850,6 +850,7 @@ static void ath6kl_htc_tx_from_queue(struct htc_target *target,
> int bundle_sent;
> int n_pkts_bundle;
> u8 ac = WMM_NUM_AC;
> + int status;
>
> spin_lock_bh(&target->tx_lock);
>
> @@ -911,7 +912,12 @@ static void ath6kl_htc_tx_from_queue(struct htc_target *target,
>
> ath6kl_htc_tx_prep_pkt(packet, packet->info.tx.flags,
> 0, packet->info.tx.seqno);
> - ath6kl_htc_tx_issue(target, packet);
> + status = ath6kl_htc_tx_issue(target, packet);
> +
> + if (status) {
> + packet->status = status;
> + packet->completion(packet->context, packet);
> + }
> }
>
> spin_lock_bh(&target->tx_lock);
> diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
> index 0384a0f..efe083f 100644
> --- a/drivers/net/wireless/ath/ath6kl/sdio.c
> +++ b/drivers/net/wireless/ath/ath6kl/sdio.c
> @@ -552,8 +552,10 @@ static int ath6kl_sdio_write_async(struct ath6kl *ar, u32 address, u8 *buffer,
>
> bus_req = ath6kl_sdio_alloc_busreq(ar_sdio);
>
> - if (!bus_req)
> + if (!bus_req) {
> + ath6kl_err("Ran out of bus request buffer for tx\n");
> return -ENOMEM;
> + }
>
> bus_req->address = address;
> bus_req->buffer = buffer;