linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Leigh Fiddes <leigh.fiddes@atomos.com>
Cc: Linux Bluetooth <linux-bluetooth@vger.kernel.org>
Subject: Re: Race condition between DIS and HoG profiles
Date: Fri, 19 Aug 2016 13:36:25 +0300	[thread overview]
Message-ID: <CABBYNZL1oW9DdEXD3teMfudzwp540pWZnZ1zun0Az6D6qn2tcw@mail.gmail.com> (raw)
In-Reply-To: <96447190-1a92-5864-f4f6-cfe9898da242@atomos.com>

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

  reply	other threads:[~2016-08-19 10:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-19  6:29 Race condition between DIS and HoG profiles Leigh Fiddes
2016-08-19 10:36 ` Luiz Augusto von Dentz [this message]
2016-08-22  3:45   ` Leigh Fiddes

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=CABBYNZL1oW9DdEXD3teMfudzwp540pWZnZ1zun0Az6D6qn2tcw@mail.gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=leigh.fiddes@atomos.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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).