* [PATCH] ath6kl: Fix random rx data corruption
@ 2012-09-21 7:15 Vasanthakumar Thiagarajan
2012-10-12 11:38 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Vasanthakumar Thiagarajan @ 2012-09-21 7:15 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, ath6kl-devel, Jin Navy
The skb->tail pointer of rx buffers is not adjusted
after skb->data pointer is aligned to 4-byte, this
causes random rx data corruption.
Signed-off-by: Jin Navy <nhjin@qca.qualcomm.com>
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/txrx.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index efee590..f070876 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -888,8 +888,11 @@ void ath6kl_rx_refill(struct htc_target *target, enum htc_endpoint_id endpoint)
break;
packet = (struct htc_packet *) skb->head;
- if (!IS_ALIGNED((unsigned long) skb->data, 4))
+ if (!IS_ALIGNED((unsigned long) skb->data, 4)) {
+ size_t len = skb_headlen(skb);
skb->data = PTR_ALIGN(skb->data - 4, 4);
+ skb_set_tail_pointer(skb, len);
+ }
set_htc_rxpkt_info(packet, skb, skb->data,
ATH6KL_BUFFER_SIZE, endpoint);
packet->skb = skb;
@@ -911,8 +914,11 @@ void ath6kl_refill_amsdu_rxbufs(struct ath6kl *ar, int count)
return;
packet = (struct htc_packet *) skb->head;
- if (!IS_ALIGNED((unsigned long) skb->data, 4))
+ if (!IS_ALIGNED((unsigned long) skb->data, 4)) {
+ size_t len = skb_headlen(skb);
skb->data = PTR_ALIGN(skb->data - 4, 4);
+ skb_set_tail_pointer(skb, len);
+ }
set_htc_rxpkt_info(packet, skb, skb->data,
ATH6KL_AMSDU_BUFFER_SIZE, 0);
packet->skb = skb;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ath6kl: Fix random rx data corruption
2012-09-21 7:15 [PATCH] ath6kl: Fix random rx data corruption Vasanthakumar Thiagarajan
@ 2012-10-12 11:38 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2012-10-12 11:38 UTC (permalink / raw)
To: Vasanthakumar Thiagarajan; +Cc: linux-wireless, ath6kl-devel, Jin Navy
On 09/21/2012 10:15 AM, Vasanthakumar Thiagarajan wrote:
> The skb->tail pointer of rx buffers is not adjusted
> after skb->data pointer is aligned to 4-byte, this
> causes random rx data corruption.
>
> Signed-off-by: Jin Navy <nhjin@qca.qualcomm.com>
> Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Thanks, I have applied this.
This alignment issue has created nothing but grief in ath6kl, at some
point we should really fix this properly. For example, the problem
should only happen in TX path, not in RX path.
Kalle
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-12 11:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-21 7:15 [PATCH] ath6kl: Fix random rx data corruption Vasanthakumar Thiagarajan
2012-10-12 11:38 ` Kalle Valo
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).