Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1693495 > unrolled thread

bluetooth in v4.13-rc1: lock init missing somewhere?

Started byPavel Machek <pavel@ucw.cz>
First post2017-07-21 11:00 +0200
Last post2017-07-23 20:50 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  bluetooth in v4.13-rc1: lock init missing somewhere? Pavel Machek <pavel@ucw.cz> - 2017-07-21 11:00 +0200
    Re: bluetooth in v4.13-rc1: lock init missing somewhere? Marcel Holtmann <marcel@holtmann.org> - 2017-07-21 12:00 +0200
      Re: bluetooth in v4.13-rc1: lock init missing somewhere? Pavel Machek <pavel@ucw.cz> - 2017-07-23 10:30 +0200
        Re: bluetooth in v4.13-rc1: lock init missing somewhere? Marcel Holtmann <marcel@holtmann.org> - 2017-07-23 20:50 +0200

#1693495 — bluetooth in v4.13-rc1: lock init missing somewhere?

FromPavel Machek <pavel@ucw.cz>
Date2017-07-21 11:00 +0200
Subjectbluetooth in v4.13-rc1: lock init missing somewhere?
Message-ID<u5BWX-2C2-43@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hi!

Is bluetooth expected to work on n900?

It looks like lock init is missing somewhere:

[  402.901031] of_get_named_gpiod_flags: parsed
'bluetooth-wakeup-gpios' property of node
'/ocp@68000000/serial@4806c000/bluetooth[0]' - status (0)
[  403.042022] BUG: rwlock bad magic on CPU#0, kworker/u3:0/3898,
c34b8848
[  403.042053] CPU: 0 PID: 3898 Comm: kworker/u3:0 Tainted: G        W
4.13.0-rc1-12941-g013595c-dirty #92
[  403.042083] Hardware name: Nokia RX-51 board
[  403.042114] Workqueue: hci0 hci_power_on
[  403.042205] [<c010d5dc>] (unwind_backtrace) from [<c010ae18>]
(show_stack+0x10/0x14)
[  403.042327] [<c010ae18>] (show_stack) from [<c0154d74>]
(do_raw_read_lock+0x20/0x2c)
[  403.042358] [<c0154d74>] (do_raw_read_lock) from [<c04ea070>]
(hci_uart_tx_wakeup+0x14/0x84)
[  403.042419] [<c04ea070>] (hci_uart_tx_wakeup) from [<bf00089c>]
(nokia_setup+0x210/0x640 [hci_nokia])
[  403.042449] [<bf00089c>] (nokia_setup [hci_nokia]) from
[<c04ea6fc>] (hci_uart_setup+0x7c/0x15c)
[  403.042480] [<c04ea6fc>] (hci_uart_setup) from [<c063c1a0>]
(hci_dev_do_open+0x420/0x5a0)
[  403.042510] [<c063c1a0>] (hci_dev_do_open) from [<c063db40>]
(hci_power_on+0x30/0x228)
[  403.042541] [<c063db40>] (hci_power_on) from [<c013ad5c>]
(process_one_work+0x10c/0x330)
[  403.042572] [<c013ad5c>] (process_one_work) from [<c013b120>]
(worker_thread+0x168/0x498)
[  403.042602] [<c013b120>] (worker_thread) from [<c014035c>]
(kthread+0x10c/0x148)
[  403.042633] [<c014035c>] (kthread) from [<c01076b8>]
(ret_from_fork+0x14/0x3c)
root@n900:/my/modules#

If I put the driver built-in, firmware loading failed. But I can't get
it to "hciconfig up" phase even with driver being modular. .. that
worked at one point IIRC.

Best regards,
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[toc] | [next] | [standalone]


#1693547

FromMarcel Holtmann <marcel@holtmann.org>
Date2017-07-21 12:00 +0200
Message-ID<u5CT0-3b5-5@gated-at.bofh.it>
In reply to#1693495
Hi Pavel,

> Is bluetooth expected to work on n900?
> 
> It looks like lock init is missing somewhere:
> 
> [  402.901031] of_get_named_gpiod_flags: parsed
> 'bluetooth-wakeup-gpios' property of node
> '/ocp@68000000/serial@4806c000/bluetooth[0]' - status (0)
> [  403.042022] BUG: rwlock bad magic on CPU#0, kworker/u3:0/3898,
> c34b8848
> [  403.042053] CPU: 0 PID: 3898 Comm: kworker/u3:0 Tainted: G        W
> 4.13.0-rc1-12941-g013595c-dirty #92
> [  403.042083] Hardware name: Nokia RX-51 board
> [  403.042114] Workqueue: hci0 hci_power_on
> [  403.042205] [<c010d5dc>] (unwind_backtrace) from [<c010ae18>]
> (show_stack+0x10/0x14)
> [  403.042327] [<c010ae18>] (show_stack) from [<c0154d74>]
> (do_raw_read_lock+0x20/0x2c)
> [  403.042358] [<c0154d74>] (do_raw_read_lock) from [<c04ea070>]
> (hci_uart_tx_wakeup+0x14/0x84)
> [  403.042419] [<c04ea070>] (hci_uart_tx_wakeup) from [<bf00089c>]
> (nokia_setup+0x210/0x640 [hci_nokia])
> [  403.042449] [<bf00089c>] (nokia_setup [hci_nokia]) from
> [<c04ea6fc>] (hci_uart_setup+0x7c/0x15c)
> [  403.042480] [<c04ea6fc>] (hci_uart_setup) from [<c063c1a0>]
> (hci_dev_do_open+0x420/0x5a0)
> [  403.042510] [<c063c1a0>] (hci_dev_do_open) from [<c063db40>]
> (hci_power_on+0x30/0x228)
> [  403.042541] [<c063db40>] (hci_power_on) from [<c013ad5c>]
> (process_one_work+0x10c/0x330)
> [  403.042572] [<c013ad5c>] (process_one_work) from [<c013b120>]
> (worker_thread+0x168/0x498)
> [  403.042602] [<c013b120>] (worker_thread) from [<c014035c>]
> (kthread+0x10c/0x148)
> [  403.042633] [<c014035c>] (kthread) from [<c01076b8>]
> (ret_from_fork+0x14/0x3c)
> root@n900:/my/modules#
> 
> If I put the driver built-in, firmware loading failed. But I can't get
> it to "hciconfig up" phase even with driver being modular. .. that
> worked at one point IIRC.

any chance you can test this with "btmgmt power on" and have "btmon" run in the background. I wonder how far it gets with the init sequence.

Regards

Marcel

[toc] | [prev] | [next] | [standalone]


#1694264

FromPavel Machek <pavel@ucw.cz>
Date2017-07-23 10:30 +0200
Message-ID<u6kr0-5de-13@gated-at.bofh.it>
In reply to#1693547

[Multipart message — attachments visible in raw view] — view raw

Hi!

> > I guess output just after boot will be more interesting?
> > 
> > root@n900:/my/modules# insmod hci_nokia.ko
> > root@n900:/my/modules#
> > Message from syslogd@localhost at Jul 19 12:24:00 ...
> > kernel:[  174.363037] BUG: rwlock bad magic on CPU#0,
> > kworker/u3:0/3027, c2665a48
> > 
> > root@n900:/my/modules# ../bluez-5.26/tools/btmgmt public-addr
> > 01:02:03:04:05:06
> > Set Public Address for hci0 failed with status 0x0b (Rejected)
> > root@n900:/my/modules# ../bluez-5.26/tools/btmgmt power on
> > Set Powered for hci0 failed with status 0x11 (Invalid Index)
> > root@n900:/my/modules#
> 
> if you manage to get a recent btmon then it will also decode all the
 > the unknown packets. That would be interesting since it tells you
 > exactly what mgmt sends and what also legacy tools do at any given
 > time.

Let me try:

pavel@n900:/my/bluez$ autoconf
configure.ac:4: error: possibly undefined macro: AM_INIT_AUTOMAKE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:11: error: possibly undefined macro: AM_MAINTAINER_MODE
configure.ac:24: error: possibly undefined macro: AM_PROG_CC_C_O
configure.ac:25: error: possibly undefined macro: AC_PROG_CC_PIE
configure.ac:32: error: possibly undefined macro: AC_DISABLE_STATIC
configure.ac:33: error: possibly undefined macro: AC_PROG_LIBTOOL
configure.ac:41: error: possibly undefined macro: AM_CONDITIONAL
pavel@n900:/my/bluez$ ./configure 
./configure: line 2189: syntax error near unexpected token `foreign'
./configure: line 2189: `AM_INIT_AUTOMAKE(foreign subdir-objects color-tests silent-rules'
pavel@n900:/my/bluez$ 

automake; autoconf results in less warnings out of autoconf.

In the end I just deleted the offending line.

But then it ends here:

./configure: line 4043: AM_PROG_CC_C_O: command not found
./configure: line 4044: AC_PROG_CC_PIE: command not found
configure: error: cannot find install-sh, install.sh, or shtool in "."
"./.." "./../.."
pavel@n900:/my/bluez$


> > While btmon says:
> > 
> > ...begining of buffer lost :-(
> 
> I really need to find my patches for the monitor ring-buffer and
 > replay support so that you can keep these in kernel memory and
 > configure this with a kernel cmdline option. In theory however
 > starting btmon before insmod should be plenty to get the full
 > trace.

That was my fault, not kernel fault. I just relied on scrollback
buffer, and it was not big enough.

> 
> Actually I just realize that this is special anyway. Since this is Nokia manufacture ID, but Broadcom vendor decoding. I think that we need to add some special handling for this to make sure user space is able to decode this properly.
> 

Aha. Ok, I guess I can test out the patches... if I manage to compile
it. Adding a hint how to compile from git (-> configure not present)
would be nice.

> While we do this the btbcm_set_bdaddr might be actually empty.
> 
> config BT_HCIUART_NOKIA                                                          
>         tristate "UART Nokia H4+ protocol support"                               
>         depends on BT_HCIUART                                                    
>         depends on BT_HCIUART_SERDEV                                             
>         depends on PM                                                            
>         select BT_HCIUART_H4                                                     
> 
> This is missing the select BT_BCM like what we have for the hci_bcm.c support.
> 
> config BT_HCIUART_BCM                                                            
>         bool "Broadcom protocol support"                                         
>         depends on BT_HCIUART                                                    
>         select BT_HCIUART_H4                                                     
>         select BT_BCM
> 
> Can you try to enable btbcm.ko module and load that first.

Actually, I guess I can just make it build-in. But I'm not sure how it
is supposed to help: I'd expect undefined symbols on broken
dependency, not silent failure.

Thanks,
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[toc] | [prev] | [next] | [standalone]


#1694348

FromMarcel Holtmann <marcel@holtmann.org>
Date2017-07-23 20:50 +0200
Message-ID<u6u70-2Gz-11@gated-at.bofh.it>
In reply to#1694264
Hi Pavel,

>>> I guess output just after boot will be more interesting?
>>> 
>>> root@n900:/my/modules# insmod hci_nokia.ko
>>> root@n900:/my/modules#
>>> Message from syslogd@localhost at Jul 19 12:24:00 ...
>>> kernel:[  174.363037] BUG: rwlock bad magic on CPU#0,
>>> kworker/u3:0/3027, c2665a48
>>> 
>>> root@n900:/my/modules# ../bluez-5.26/tools/btmgmt public-addr
>>> 01:02:03:04:05:06
>>> Set Public Address for hci0 failed with status 0x0b (Rejected)
>>> root@n900:/my/modules# ../bluez-5.26/tools/btmgmt power on
>>> Set Powered for hci0 failed with status 0x11 (Invalid Index)
>>> root@n900:/my/modules#
>> 
>> if you manage to get a recent btmon then it will also decode all the
>> the unknown packets. That would be interesting since it tells you
>> exactly what mgmt sends and what also legacy tools do at any given
>> time.
> 
> Let me try:
> 
> pavel@n900:/my/bluez$ autoconf
> configure.ac:4: error: possibly undefined macro: AM_INIT_AUTOMAKE
>      If this token and others are legitimate, please use m4_pattern_allow.
>      See the Autoconf documentation.
> configure.ac:11: error: possibly undefined macro: AM_MAINTAINER_MODE
> configure.ac:24: error: possibly undefined macro: AM_PROG_CC_C_O
> configure.ac:25: error: possibly undefined macro: AC_PROG_CC_PIE
> configure.ac:32: error: possibly undefined macro: AC_DISABLE_STATIC
> configure.ac:33: error: possibly undefined macro: AC_PROG_LIBTOOL
> configure.ac:41: error: possibly undefined macro: AM_CONDITIONAL
> pavel@n900:/my/bluez$ ./configure 
> ./configure: line 2189: syntax error near unexpected token `foreign'
> ./configure: line 2189: `AM_INIT_AUTOMAKE(foreign subdir-objects color-tests silent-rules'
> pavel@n900:/my/bluez$ 
> 
> automake; autoconf results in less warnings out of autoconf.
> 
> In the end I just deleted the offending line.
> 
> But then it ends here:
> 
> ./configure: line 4043: AM_PROG_CC_C_O: command not found
> ./configure: line 4044: AC_PROG_CC_PIE: command not found
> configure: error: cannot find install-sh, install.sh, or shtool in "."
> "./.." "./../.."
> pavel@n900:/my/bluez$

you have you tried ./bootstrap or ./bootstrap-configure?

>>> While btmon says:
>>> 
>>> ...begining of buffer lost :-(
>> 
>> I really need to find my patches for the monitor ring-buffer and
>> replay support so that you can keep these in kernel memory and
>> configure this with a kernel cmdline option. In theory however
>> starting btmon before insmod should be plenty to get the full
>> trace.
> 
> That was my fault, not kernel fault. I just relied on scrollback
> buffer, and it was not big enough.
> 
>> 
>> Actually I just realize that this is special anyway. Since this is Nokia manufacture ID, but Broadcom vendor decoding. I think that we need to add some special handling for this to make sure user space is able to decode this properly.
>> 
> 
> Aha. Ok, I guess I can test out the patches... if I manage to compile
> it. Adding a hint how to compile from git (-> configure not present)
> would be nice.

you can hack btmon to treat Nokia ID 2 as Broadcom ID 15 and then you would see the decoding.

>> While we do this the btbcm_set_bdaddr might be actually empty.
>> 
>> config BT_HCIUART_NOKIA                                                          
>>        tristate "UART Nokia H4+ protocol support"                               
>>        depends on BT_HCIUART                                                    
>>        depends on BT_HCIUART_SERDEV                                             
>>        depends on PM                                                            
>>        select BT_HCIUART_H4                                                     
>> 
>> This is missing the select BT_BCM like what we have for the hci_bcm.c support.
>> 
>> config BT_HCIUART_BCM                                                            
>>        bool "Broadcom protocol support"                                         
>>        depends on BT_HCIUART                                                    
>>        select BT_HCIUART_H4                                                     
>>        select BT_BCM
>> 
>> Can you try to enable btbcm.ko module and load that first.
> 
> Actually, I guess I can just make it build-in. But I'm not sure how it
> is supposed to help: I'd expect undefined symbols on broken
> dependency, not silent failure.

The helper modules are designed to be selected. So they fail gracefully if not. So this is just a bug. Make sure to have btbcm built-in or btbcm.ko available.

Regards

Marcel

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web