Re: [PATCH v6 bluetooth-next] 6lowpan: Use skb_cow in IPHC decompression.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jukka,

Does this patch help?

---
 net/bluetooth/l2cap_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index b6f9777..fb7b2ff 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -5494,6 +5494,7 @@ static inline int l2cap_le_credits(struct l2cap_conn *conn,
 	if (credits > max_credits) {
 		BT_ERR("LE credits overflow");
 		l2cap_send_disconn_req(chan, ECONNRESET);
+		l2cap_chan_unlock(chan);
 
 		/* Return 0 so that we don't trigger an unnecessary
 		 * command reject packet.
-- 
1.9.1


-Martin.

On 13/10/14 15:44, Jukka Rissanen wrote:
> Hi Martin,
>
> and thanks for your analysis.
>
> On ma, 2014-10-13 at 14:10 +0100, Martin Townsend wrote:
>> Hi Jukka,
>>
>> I think there's a lock checking option in the kernel hacking configuration menu.  Might be worth trying this to get more info.
>> I had a quick look through the code and there maybe a potential locking problem in l2cap_le_credits
>> it calls l2cap_get_chan_by_dcid which locks the channel lock (chan->lock) which is one of the locks in the deadlock below.  If credits > max_credits in l2cap_le_credits it returns 0 but no unlock.  Now l2cap_send_disconn_req may do this, I tried searching through but it called a state_change op so I gave up.
>> http://lxr.free-electrons.com/source/net/bluetooth/l2cap_core.c#L5539
>>
>> You could try sticking a  l2cap_chan_unlock(chan); in to see if the problem goes away.
>>
> I managed to trigger the locking issue (by running ssh over bt 6lowpan)
> even without your patch. So I am acking the v6 of this patch. I try to
> dig the root cause to that deadlock issue I am seeing.
>
> Signed-off-by: Jukka Rissanen <jukka.rissanen@xxxxxxxxxxxxxxx>
>
>
> Cheers,
> Jukka
>
>

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




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux