2008-10-06 09:05:14

by Tomas Winkler

[permalink] [raw]
Subject: [PATCH] btsdio: fix tx error path

This patch fixes accumulating of the header
in case packet was requeued in the error path.

Signed-off-by: Tomas Winkler <[email protected]>
Cc: Marcel Holtmann <[email protected]>
---
drivers/bluetooth/btsdio.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c
index 58630cc..e4724b8 100644
--- a/drivers/bluetooth/btsdio.c
+++ b/drivers/bluetooth/btsdio.c
@@ -91,6 +91,7 @@ static int btsdio_tx_packet(struct btsdio_data *data, struct sk_buff *skb)

err = sdio_writesb(data->func, REG_TDAT, skb->data, skb->len);
if (err < 0) {
+ skb_pop(skb, 4);
sdio_writeb(data->func, 0x01, REG_PC_WRT, NULL);
return err;
}
--
1.5.4.3

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


2008-10-06 11:20:35

by Tomas Winkler

[permalink] [raw]
Subject: RE: [PATCH] btsdio: fix tx error path



>-----Original Message-----
>From: Marcel Holtmann [mailto:[email protected]]
>Sent: Monday, October 06, 2008 12:55 PM
>To: Winkler, Tomas
>Cc: [email protected]; [email protected]
>Subject: Re: [PATCH] btsdio: fix tx error path
>
>Hi Tomas,
>
>> This patch fixes accumulating of the header
>> in case packet was requeued in the error path.
>>
>> Signed-off-by: Tomas Winkler <[email protected]>
>> Cc: Marcel Holtmann <[email protected]>
>> ---
>> drivers/bluetooth/btsdio.c | 1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c
>> index 58630cc..e4724b8 100644
>> --- a/drivers/bluetooth/btsdio.c
>> +++ b/drivers/bluetooth/btsdio.c
>> @@ -91,6 +91,7 @@ static int btsdio_tx_packet(struct btsdio_data
*data,
>struct sk_buff *skb)
>>
>> err =3D sdio_writesb(data->func, REG_TDAT, skb->data, skb->len);
>> if (err < 0) {
>> + skb_pop(skb, 4);
>> sdio_writeb(data->func, 0x01, REG_PC_WRT, NULL);
>> return err;
>> }
>
>please do at least a compile test. It is skb_pull() and not skb_pop().

Sorry, my bad. It was oneliner so I didn't take the patch directly from
the test machine and my server .config was wrong so the file didn't
compile at all :( leading to clean compilation I will resubmit be more
careful next time.=20

Tomas=20

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

2008-10-06 10:54:50

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] btsdio: fix tx error path

Hi Tomas,

> This patch fixes accumulating of the header
> in case packet was requeued in the error path.
>
> Signed-off-by: Tomas Winkler <[email protected]>
> Cc: Marcel Holtmann <[email protected]>
> ---
> drivers/bluetooth/btsdio.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c
> index 58630cc..e4724b8 100644
> --- a/drivers/bluetooth/btsdio.c
> +++ b/drivers/bluetooth/btsdio.c
> @@ -91,6 +91,7 @@ static int btsdio_tx_packet(struct btsdio_data *data, struct sk_buff *skb)
>
> err = sdio_writesb(data->func, REG_TDAT, skb->data, skb->len);
> if (err < 0) {
> + skb_pop(skb, 4);
> sdio_writeb(data->func, 0x01, REG_PC_WRT, NULL);
> return err;
> }

please do at least a compile test. It is skb_pull() and not skb_pop().

Regards

Marcel



2008-10-06 09:22:50

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] btsdio: fix tx error path

Hi Tomas,

> This patch fixes accumulating of the header
> in case packet was requeued in the error path.
>
> Signed-off-by: Tomas Winkler <[email protected]>
> Cc: Marcel Holtmann <[email protected]>
> ---
> drivers/bluetooth/btsdio.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c
> index 58630cc..e4724b8 100644
> --- a/drivers/bluetooth/btsdio.c
> +++ b/drivers/bluetooth/btsdio.c
> @@ -91,6 +91,7 @@ static int btsdio_tx_packet(struct btsdio_data *data, struct sk_buff *skb)
>
> err = sdio_writesb(data->func, REG_TDAT, skb->data, skb->len);
> if (err < 0) {
> + skb_pop(skb, 4);
> sdio_writeb(data->func, 0x01, REG_PC_WRT, NULL);
> return err;
> }

good catch. Applied to my tree. Thanks.

Regards

Marcel