linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Race condition between DIS and HoG profiles
@ 2016-08-19  6:29 Leigh Fiddes
  2016-08-19 10:36 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 3+ messages in thread
From: Leigh Fiddes @ 2016-08-19  6:29 UTC (permalink / raw)
  To: Linux Bluetooth

Hi,

In November 2012 an issue was identified in which the uhid device was
being created before the DIS information had been retrieved. This cause
the input device to not have the correct vendor and product identifiers.
See the message http://www.spinics.net/lists/linux-bluetooth/msg31931.html

The patch proposed was not included and I have not seen any discussion as to why.

I am seeing this exact problem with Bluez 5.41 on Linux 4.1 with a
Nordic nRF51 development board as the peripheral. Some snippets from the
/var/log/messages show the result.


Jan  1 00:02:54 bluetoothd[714]: src/device.c:device_probe_profiles() Probing profiles for device C0:58:9E:9D:A6:FF
Jan  1 00:02:54 bluetoothd[714]: profiles/input/hog.c:hog_probe() path /org/bluez/hci0/dev_C0_58_9E_9D_A6_FF
Jan  1 00:02:54 bluetoothd[714]: profiles/input/hog.c:hog_device_new() name=Nordic_Mouse vendor=0x0, product=0x0, version=0x0

Jan  1 00:02:55 bluetoothd[714]: profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Vendor 1915 Product EEEE Version 0001

Jan  1 00:02:57 kernel: [  179.706068] input: Nordic_Mouse as /devices/virtual/misc/uhid/0005:0000:0000.0001/input/input2
Jan  1 00:02:57 kernel: [  179.706681] hid-generic 0005:0000:0000.0001:input: BLUETOOTH HID v0.00 Mouse [Nordic_Mouse] on 00:1A:7D:DA:71:13
Jan  1 00:02:57 bluetoothd[714]: profiles/input/hog-lib.c:report_map_read_cb() HoG created uHID device

interestingly, if I stop and restart bluetoothd without changing
anything else the correct input is created, since the vendor, product
and version are now valid

Jan  1 00:04:14 kernel: [  256.476283] input: Nordic_Mouse as /devices/virtual/misc/uhid/0005:1915:EEEE.0002/input/input3
Jan  1 00:04:14 bluetoothd[773]: profiles/input/hog-lib.c:report_map_read_cb() HoG created uHID device
Jan  1 00:04:14 bluetoothd[773]: attrib/gattrib.c:g_attrib_unref() 0xad4e78: g_attrib_unref=2
Jan  1 00:04:14 kernel: [  256.477313] hid-generic 0005:1915:EEEE.0002:input: BLUETOOTH HID v0.01 Mouse [Nordic_Mouse] on 00:1A:7D:DA:71:13

Is this a problem for anyone else?

Leigh



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Race condition between DIS and HoG profiles
  2016-08-19  6:29 Race condition between DIS and HoG profiles Leigh Fiddes
@ 2016-08-19 10:36 ` Luiz Augusto von Dentz
  2016-08-22  3:45   ` Leigh Fiddes
  0 siblings, 1 reply; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2016-08-19 10:36 UTC (permalink / raw)
  To: Leigh Fiddes; +Cc: Linux Bluetooth

Hi Leigh,

On Fri, Aug 19, 2016 at 9:29 AM, Leigh Fiddes <leigh.fiddes@atomos.com> wrote:
> Hi,
>
> In November 2012 an issue was identified in which the uhid device was
> being created before the DIS information had been retrieved. This cause
> the input device to not have the correct vendor and product identifiers.
> See the message http://www.spinics.net/lists/linux-bluetooth/msg31931.html
>
> The patch proposed was not included and I have not seen any discussion as to why.
>
> I am seeing this exact problem with Bluez 5.41 on Linux 4.1 with a
> Nordic nRF51 development board as the peripheral. Some snippets from the
> /var/log/messages show the result.
>
>
> Jan  1 00:02:54 bluetoothd[714]: src/device.c:device_probe_profiles() Probing profiles for device C0:58:9E:9D:A6:FF
> Jan  1 00:02:54 bluetoothd[714]: profiles/input/hog.c:hog_probe() path /org/bluez/hci0/dev_C0_58_9E_9D_A6_FF
> Jan  1 00:02:54 bluetoothd[714]: profiles/input/hog.c:hog_device_new() name=Nordic_Mouse vendor=0x0, product=0x0, version=0x0
>
> Jan  1 00:02:55 bluetoothd[714]: profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Vendor 1915 Product EEEE Version 0001
>
> Jan  1 00:02:57 kernel: [  179.706068] input: Nordic_Mouse as /devices/virtual/misc/uhid/0005:0000:0000.0001/input/input2
> Jan  1 00:02:57 kernel: [  179.706681] hid-generic 0005:0000:0000.0001:input: BLUETOOTH HID v0.00 Mouse [Nordic_Mouse] on 00:1A:7D:DA:71:13
> Jan  1 00:02:57 bluetoothd[714]: profiles/input/hog-lib.c:report_map_read_cb() HoG created uHID device
>
> interestingly, if I stop and restart bluetoothd without changing
> anything else the correct input is created, since the vendor, product
> and version are now valid
>
> Jan  1 00:04:14 kernel: [  256.476283] input: Nordic_Mouse as /devices/virtual/misc/uhid/0005:1915:EEEE.0002/input/input3
> Jan  1 00:04:14 bluetoothd[773]: profiles/input/hog-lib.c:report_map_read_cb() HoG created uHID device
> Jan  1 00:04:14 bluetoothd[773]: attrib/gattrib.c:g_attrib_unref() 0xad4e78: g_attrib_unref=2
> Jan  1 00:04:14 kernel: [  256.477313] hid-generic 0005:1915:EEEE.0002:input: BLUETOOTH HID v0.01 Mouse [Nordic_Mouse] on 00:1A:7D:DA:71:13
>
> Is this a problem for anyone else?

I guess this would be a problem only if the device requires a specific
driver, or are you saying it doesn't work the first time either? We
should be able to fix the this problem by checking the profile
priority and have DIS before HoG in case the generic HID driver
doesn't work.

-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Race condition between DIS and HoG profiles
  2016-08-19 10:36 ` Luiz Augusto von Dentz
@ 2016-08-22  3:45   ` Leigh Fiddes
  0 siblings, 0 replies; 3+ messages in thread
From: Leigh Fiddes @ 2016-08-22  3:45 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: Linux Bluetooth

Hi Luiz,


On 19/08/16 20:36, Luiz Augusto von Dentz wrote:
> Hi Leigh,
>
> On Fri, Aug 19, 2016 at 9:29 AM, Leigh Fiddes <leigh.fiddes@atomos.com> wrote:
>> Hi,
>>
>> In November 2012 an issue was identified in which the uhid device was
>> being created before the DIS information had been retrieved. This cause
>> the input device to not have the correct vendor and product identifiers.
>> See the message http://www.spinics.net/lists/linux-bluetooth/msg31931.html
>>
>> The patch proposed was not included and I have not seen any discussion as to why.
>>
>> I am seeing this exact problem with Bluez 5.41 on Linux 4.1 with a
>> Nordic nRF51 development board as the peripheral. Some snippets from the
>> /var/log/messages show the result.
>>
>>
>> Jan  1 00:02:54 bluetoothd[714]: src/device.c:device_probe_profiles() Probing profiles for device C0:58:9E:9D:A6:FF
>> Jan  1 00:02:54 bluetoothd[714]: profiles/input/hog.c:hog_probe() path /org/bluez/hci0/dev_C0_58_9E_9D_A6_FF
>> Jan  1 00:02:54 bluetoothd[714]: profiles/input/hog.c:hog_device_new() name=Nordic_Mouse vendor=0x0, product=0x0, version=0x0
>>
>> Jan  1 00:02:55 bluetoothd[714]: profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Vendor 1915 Product EEEE Version 0001
>>
>> Jan  1 00:02:57 kernel: [  179.706068] input: Nordic_Mouse as /devices/virtual/misc/uhid/0005:0000:0000.0001/input/input2
>> Jan  1 00:02:57 kernel: [  179.706681] hid-generic 0005:0000:0000.0001:input: BLUETOOTH HID v0.00 Mouse [Nordic_Mouse] on 00:1A:7D:DA:71:13
>> Jan  1 00:02:57 bluetoothd[714]: profiles/input/hog-lib.c:report_map_read_cb() HoG created uHID device
>>
>> interestingly, if I stop and restart bluetoothd without changing
>> anything else the correct input is created, since the vendor, product
>> and version are now valid
>>
>> Jan  1 00:04:14 kernel: [  256.476283] input: Nordic_Mouse as /devices/virtual/misc/uhid/0005:1915:EEEE.0002/input/input3
>> Jan  1 00:04:14 bluetoothd[773]: profiles/input/hog-lib.c:report_map_read_cb() HoG created uHID device
>> Jan  1 00:04:14 bluetoothd[773]: attrib/gattrib.c:g_attrib_unref() 0xad4e78: g_attrib_unref=2
>> Jan  1 00:04:14 kernel: [  256.477313] hid-generic 0005:1915:EEEE.0002:input: BLUETOOTH HID v0.01 Mouse [Nordic_Mouse] on 00:1A:7D:DA:71:13
>>
>> Is this a problem for anyone else?
> I guess this would be a problem only if the device requires a specific
> driver, or are you saying it doesn't work the first time either? We
> should be able to fix the this problem by checking the profile
> priority and have DIS before HoG in case the generic HID driver
> doesn't work.
>
It doesn't appear to cause me any issues as far as I can see. In my
case, /dev/input/event2 is created
correctly both the first and subsequent times, and events are sent
correctly.
It just didn't look right and I was interested in why it had not been
addressed. For me the issue is not urgent.
Leigh



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-22  3:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-19  6:29 Race condition between DIS and HoG profiles Leigh Fiddes
2016-08-19 10:36 ` Luiz Augusto von Dentz
2016-08-22  3:45   ` Leigh Fiddes

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).