From: Sean Wang <sean.wang@mediatek.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: <mark.rutland@arm.com>, <devicetree@vger.kernel.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
<linux-kernel@vger.kernel.org>, <linux-bluetooth@vger.kernel.org>,
<robh+dt@kernel.org>, <linux-mediatek@lists.infradead.org>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v5 4/7] Bluetooth: Add new quirk for non-persistent setup settings
Date: Tue, 17 Jul 2018 00:05:14 +0800 [thread overview]
Message-ID: <1531757114.8953.12.camel@mtkswgap22> (raw)
In-Reply-To: <6571C864-B2EC-4806-BC5D-F531792737F6@holtmann.org>
On Mon, 2018-07-16 at 14:56 +0200, Marcel Holtmann wrote:
> Hi Sean,
>
> >>> Add a new quirk HCI_QUIRK_NON_PERSISTENT_SETUP allowing that a quirk that
> >>> runs setup() after every open() and not just after the first open().
> >>>
> >>> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> >>> ---
> >>> include/net/bluetooth/hci.h | 9 +++++++++
> >>> net/bluetooth/hci_core.c | 3 ++-
> >>> 2 files changed, 11 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
> >>> index 73e48be..d3ec5b2a8 100644
> >>> --- a/include/net/bluetooth/hci.h
> >>> +++ b/include/net/bluetooth/hci.h
> >>> @@ -183,6 +183,15 @@ enum {
> >>> * during the hdev->setup vendor callback.
> >>> */
> >>> HCI_QUIRK_NON_PERSISTENT_DIAG,
> >>> +
> >>> + /* When this quirk is set, setup() would be run after every
> >>> + * open() and not just after the first open().
> >>> + *
> >>> + * This quirk can be set before hci_register_dev is called or
> >>> + * during the hdev->setup vendor callback.
> >>> + *
> >>> + */
> >>> + HCI_QUIRK_NON_PERSISTENT_SETUP,
> >>> };
> >>>
> >>> /* HCI device flags */
> >>> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> >>> index f5c21004..0111280 100644
> >>> --- a/net/bluetooth/hci_core.c
> >>> +++ b/net/bluetooth/hci_core.c
> >>> @@ -1396,7 +1396,8 @@ static int hci_dev_do_open(struct hci_dev *hdev)
> >>> atomic_set(&hdev->cmd_cnt, 1);
> >>> set_bit(HCI_INIT, &hdev->flags);
> >>>
> >>> - if (hci_dev_test_flag(hdev, HCI_SETUP)) {
> >>> + if (hci_dev_test_flag(hdev, HCI_SETUP) ||
> >>> + test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) {
> >>> hci_sock_dev_event(hdev, HCI_DEV_SETUP);
> >>
> >> can you include the extract of btmon on how the HCI_DEV_SETUP event shows up in the traces? I remember that I asked about something like that.
> >>
> >> Regards
> >>
> >> Marcel
> >>
> >
> > No, I cannot see any event about HCI_DEV_SETUP in btmon trace, the trace I posted as below is doing some rounds of power off and then on
>
> it will result in this:
>
> case HCI_DEV_SETUP:
> if (hdev->manufacturer == 0xffff)
> return NULL;
>
> case HCI_DEV_UP:
> skb = bt_skb_alloc(HCI_MON_INDEX_INFO_SIZE, GFP_ATOMIC);
>
> So we will see extra index info events, but I assume that is just fine this we also see them on DEV_UP. They also do not hurt as long as not magically the manufacturer information changes.
>
> I do wonder though if this quirk is set, then hdev->manufacturer needs to be reset and allow hdev->setup() to reset it. This goes with a log of other information as well. Maybe just a look if there are no races here.
>
> Regards
>
> Marcel
>
I didn't set a value to hdev->manufacture.
Should I set it in hdev->setup() ? MediaTek is 0x46 according to [1].
[1]
https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
>
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek
next prev parent reply other threads:[~2018-07-16 16:05 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-09 15:56 [PATCH v5 0/7] add support for Bluetooth on MT7622 SoC sean.wang
2018-07-09 15:56 ` [PATCH v5 1/7] dt-bindings: net: bluetooth: Add mediatek-bluetooth sean.wang
2018-07-14 16:26 ` Marcel Holtmann
2018-07-15 5:10 ` Sean Wang
2018-07-09 15:56 ` [PATCH v5 2/7] serdev: add dev_pm_domain_attach|detach() sean.wang
2018-07-14 16:27 ` Marcel Holtmann
2018-07-15 8:56 ` Johan Hovold
2018-07-16 9:50 ` Greg Kroah-Hartman
2018-07-09 15:56 ` [PATCH v5 3/7] Bluetooth: Add new serdev based driver for UART attached controllers sean.wang
2018-07-09 15:57 ` [PATCH v5 4/7] Bluetooth: Add new quirk for non-persistent setup settings sean.wang
2018-07-14 16:34 ` Marcel Holtmann
2018-07-15 7:02 ` Sean Wang
2018-07-16 12:56 ` Marcel Holtmann
2018-07-16 16:05 ` Sean Wang [this message]
2018-07-18 12:14 ` Marcel Holtmann
2018-07-18 13:33 ` Sean Wang
2018-07-09 15:57 ` [PATCH v5 5/7] Bluetooth: Extend btuart driver for join more vendor devices sean.wang
2018-07-14 16:44 ` Marcel Holtmann
2018-07-15 7:52 ` Sean Wang
2018-07-16 12:59 ` Marcel Holtmann
2018-07-16 15:29 ` Sean Wang
2018-07-18 12:23 ` Marcel Holtmann
2018-07-18 14:26 ` Sean Wang
2018-07-09 15:57 ` [PATCH v5 6/7] Bluetooth: mediatek: Add protocol support for MediaTek serial devices sean.wang
2018-07-14 16:32 ` Marcel Holtmann
2018-07-15 5:53 ` Sean Wang
2018-07-09 15:57 ` [PATCH v5 7/7] MAINTAINERS: add an entry for MediaTek Bluetooth driver sean.wang
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=1531757114.8953.12.camel@mtkswgap22 \
--to=sean.wang@mediatek.com \
--cc=devicetree@vger.kernel.org \
--cc=johan.hedberg@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=marcel@holtmann.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@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).