From: Martin Townsend <martin.townsend@xsilon.com>
To: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Cc: Martin Townsend <mtownsend1973@gmail.com>,
linux-zigbee-devel@lists.sourceforge.net,
linux-bluetooth@vger.kernel.org, linux-wpan@vger.kernel.org,
marcel@holtmann.org, alex.aring@gmail.com
Subject: Re: [PATCH v4 bluetooth] Fix lowpan_rcv
Date: Thu, 02 Oct 2014 20:44:11 +0100 [thread overview]
Message-ID: <542DAB0B.2080107@xsilon.com> (raw)
In-Reply-To: <1412258111.13121.35.camel@jrissane-mobl.ger.corp.intel.com>
Hi Jukka,
Very bizarre that the patch causes a locking issue in the Tx path. Is
it a side effect from not cloning the skb before calling process_data.
I couldn't see why a clone was being made so maybe I'm missing something
here.
- Martin.
On 02/10/14 14:55, Jukka Rissanen wrote:
> Hi Martin,
>
> On to, 2014-10-02 at 13:16 +0100, Martin Townsend wrote:
>> Hi Jukka,
>>
>> Thanks for investigating this.
>>
>> If you set the dev in your receive function does the oops go away, BTW this is where the pkt_type is set to PACKET_HOST, for us this was causing problems, I don't know if this is the same for you guys.
>>
>> Here's the code:
>>
>> local_skb->protocol = htons(ETH_P_IPV6);
>>>>> local_skb->dev = dev;
>> local_skb->pkt_type = PACKET_HOST;
>>
>> if (give_skb_to_upper(local_skb, dev)
>> != NET_RX_SUCCESS) {
>> kfree_skb(local_skb);
>>
>> - Martin.
> So I applied this patch
>
> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> index e4f5ce5..aa64f91 100644
> --- a/net/bluetooth/6lowpan.c
> +++ b/net/bluetooth/6lowpan.c
> @@ -323,6 +323,7 @@ static int recv_pkt(struct sk_buff *skb, struct
> net_device *dev,
>
> local_skb->protocol = htons(ETH_P_IPV6);
> local_skb->pkt_type = PACKET_HOST;
> + local_skb->dev = dev;
>
> if (give_skb_to_upper(local_skb, dev) != NET_RX_SUCCESS)
> {
> goto drop_local_skb;
> @@ -362,6 +363,7 @@ static int recv_pkt(struct sk_buff *skb, struct
> net_device *dev,
>
> local_skb->protocol = htons(ETH_P_IPV6);
> local_skb->pkt_type = PACKET_HOST;
> + local_skb->dev = dev;
>
> if (give_skb_to_upper(local_skb, dev)
> !=
> NET_RX_SUCCESS) {
>
>
> and I do not see the earlier null pointer oops any more.
>
>
> Unfortunately a new error is seen:
>
> [ 340.676353] inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
> [ 340.676353] kworker/u3:1/370 [HC0[0]:SC0[0]:HE1:SE1] takes:
> [ 340.676353] (&(&list->lock)->rlock#6){+.?...}, at: [<f8319d4c>]
> hci_send_acl+0xac/0x290 [bluetooth]
> [ 340.676353] {IN-SOFTIRQ-W} state was registered at:
> [ 340.676353] [<c10915a3>] __lock_acquire+0x6d3/0x1d20
> [ 340.676353] [<c109325d>] lock_acquire+0x9d/0x140
> [ 340.676353] [<c1889c25>] _raw_spin_lock+0x45/0x80
> [ 340.676353] [<f8319d4c>] hci_send_acl+0xac/0x290 [bluetooth]
> [ 340.676353] [<f833abf0>] l2cap_do_send+0x60/0x100 [bluetooth]
> [ 340.676353] [<f833e7c0>] l2cap_chan_send+0x7f0/0x10e0 [bluetooth]
> [ 340.676353] [<f850691e>] send_pkt+0x4e/0xa0 [bluetooth_6lowpan]
> [ 340.676353] [<f8506d20>] bt_xmit+0x3b0/0x770 [bluetooth_6lowpan]
> [ 340.676353] [<c17742f4>] dev_hard_start_xmit+0x344/0x670
> [ 340.676353] [<c17749ad>] __dev_queue_xmit+0x38d/0x680
> [ 340.676353] [<c1774caf>] dev_queue_xmit+0xf/0x20
> [ 340.676353] [<c177b8b0>] neigh_connected_output+0x130/0x1a0
> [ 340.676353] [<c1812a63>] ip6_finish_output2+0x173/0x8c0
> [ 340.676353] [<c18182db>] ip6_finish_output+0x7b/0x1b0
> [ 340.676353] [<c18184a7>] ip6_output+0x97/0x2a0
> ...
>
> I have to investigate this more what your new code is doing as I did not
> see this error earlier before your patch.
>
> So I have very latest bluetooth-next (commit b57d4471fd18) + your v4
> patch + above patch that sets the dev pointer, and this combination
> triggers the above inconsistent softirq usage error.
>
>
> Cheers,
> Jukka
>
>
next prev parent reply other threads:[~2014-10-02 19:44 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-01 12:10 [PATCH v4 bluetooth] Fix lowpan_rcv Martin Townsend
2014-10-01 12:10 ` [PATCH v4 bluetooth] 6lowpan: fix incorrect return values in lowpan_rcv Martin Townsend
2014-10-01 12:42 ` Alexander Aring
2014-10-02 12:43 ` Alexander Aring
2014-10-05 17:50 ` Alexander Aring
2014-10-05 17:58 ` Alexander Aring
2014-10-05 18:03 ` Alexander Aring
2014-10-05 21:00 ` Martin Townsend
2014-10-06 7:12 ` Alexander Aring
2014-10-06 8:27 ` Martin Townsend
2014-10-06 8:50 ` Marcel Holtmann
2014-10-06 8:35 ` Martin Townsend
2014-10-01 14:47 ` [PATCH v4 bluetooth] Fix lowpan_rcv Jukka Rissanen
2014-10-01 15:24 ` Martin Townsend
2014-10-02 11:28 ` Jukka Rissanen
2014-10-02 12:16 ` Martin Townsend
2014-10-02 13:55 ` Jukka Rissanen
2014-10-02 19:44 ` Martin Townsend [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-09-16 11:01 Martin Townsend
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=542DAB0B.2080107@xsilon.com \
--to=martin.townsend@xsilon.com \
--cc=alex.aring@gmail.com \
--cc=jukka.rissanen@linux.intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=linux-zigbee-devel@lists.sourceforge.net \
--cc=marcel@holtmann.org \
--cc=mtownsend1973@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).