diff mbox

[3/3] Bluetooth: L2CAP: Don't return -EAGAIN if out of credits

Message ID 20170403144857.4661-3-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Luiz Augusto von Dentz April 3, 2017, 2:48 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Just keep queueing them into TX queue since the caller might just have
to do the same and there is no impact in adding another packet to the
TX queue even if there aren't any credits to transmit them.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/l2cap_core.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Jukka Rissanen April 5, 2017, 12:24 p.m. UTC | #1
Hi Luiz,

On Mon, 2017-04-03 at 17:48 +0300, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> Just keep queueing them into TX queue since the caller might just
> have
> to do the same and there is no impact in adding another packet to the
> TX queue even if there aren't any credits to transmit them.
> 
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
>  net/bluetooth/l2cap_core.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index fc7f321..3a202b0 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -2458,9 +2458,6 @@ int l2cap_chan_send(struct l2cap_chan *chan,
> struct msghdr *msg, size_t len)
>  		if (len > chan->omtu)
>  			return -EMSGSIZE;
>  
> -		if (!chan->tx_credits)
> -			return -EAGAIN;
> -
>  		__skb_queue_head_init(&seg_queue);
>  
>  		err = l2cap_segment_le_sdu(chan, &seg_queue, msg,
> len);


Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>


Cheers,
Jukka

--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index fc7f321..3a202b0 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -2458,9 +2458,6 @@  int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len)
 		if (len > chan->omtu)
 			return -EMSGSIZE;
 
-		if (!chan->tx_credits)
-			return -EAGAIN;
-
 		__skb_queue_head_init(&seg_queue);
 
 		err = l2cap_segment_le_sdu(chan, &seg_queue, msg, len);