From: Marcel Holtmann <marcel@holtmann.org>
To: Sean Wang <sean.wang@mediatek.com>
Cc: "Johan Hedberg" <johan.hedberg@gmail.com>,
"\"Mark-YW Chen (陳揚文)\"" <Mark-YW.Chen@mediatek.com>,
Soul.Huang@mediatek.com, YN.Chen@mediatek.com,
Leon.Yen@mediatek.com, Eric-SY.Chang@mediatek.com,
Deren.Wu@mediatek.com, km.lin@mediatek.com,
robin.chiu@mediatek.com, Eddie.Chen@mediatek.com,
ch.yeh@mediatek.com, posh.sun@mediatek.com,
ted.huang@mediatek.com, Eric.Liang@mediatek.com,
Stella.Chang@mediatek.com, Tom.Chou@mediatek.com,
steve.lee@mediatek.com, jsiuda@google.com, frankgor@google.com,
jemele@google.com, abhishekpandit@google.com,
michaelfsun@google.com, mcchou@chromium.org, shawnku@google.com,
linux-bluetooth@vger.kernel.org,
linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] Bluetooth: mediatek: fix the conflict between mtk and msft vendor event
Date: Mon, 7 Feb 2022 16:48:09 +0100 [thread overview]
Message-ID: <1CE2BE2F-A47D-4EEF-809A-035775125D83@holtmann.org> (raw)
In-Reply-To: <2eed797ac2605bd068a025486fc0c09c2687e50c.1643435854.git.objelf@gmail.com>
Hi Sean,
> There is a conflict between MediaTek wmt event and msft vendor extension
> logic in the core layer since 145373cb1b1f ("Bluetooth: Add framework for
> Microsoft vendor extension") was introduced because we changed the type of
> mediatek wmt event to the type of msft vendor event in the driver.
>
> But the purpose we reported mediatek event to the core layer is for the
> diagnostic purpose with that we are able to see the full packet trace via
> monitoring socket with btmon. Thus, it is harmless we keep the original
> type of mediatek vendor event here to avoid breaking the msft extension
> function especially they can be supported by Mediatek chipset like MT7921
> , MT7922 devices and future devices.
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
> drivers/bluetooth/btmtk.h | 1 +
> drivers/bluetooth/btmtksdio.c | 9 +--------
> drivers/bluetooth/btusb.c | 5 -----
> 3 files changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/bluetooth/btmtk.h b/drivers/bluetooth/btmtk.h
> index 8960a5f89d48..013850fd2055 100644
> --- a/drivers/bluetooth/btmtk.h
> +++ b/drivers/bluetooth/btmtk.h
> @@ -5,6 +5,7 @@
> #define FIRMWARE_MT7668 "mediatek/mt7668pr2h.bin"
> #define FIRMWARE_MT7961 "mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin"
>
> +#define HCI_EV_WMT 0xe4
> #define HCI_WMT_MAX_EVENT_SIZE 64
>
> #define BTMTK_WMT_REG_WRITE 0x1
> diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
> index 8e200e80d2f6..cbb09e1b823d 100644
> --- a/drivers/bluetooth/btmtksdio.c
> +++ b/drivers/bluetooth/btmtksdio.c
> @@ -381,13 +381,6 @@ static int btmtksdio_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
> struct hci_event_hdr *hdr = (void *)skb->data;
> int err;
>
> - /* Fix up the vendor event id with 0xff for vendor specific instead
> - * of 0xe4 so that event send via monitoring socket can be parsed
> - * properly.
> - */
> - if (hdr->evt == 0xe4)
> - hdr->evt = HCI_EV_VENDOR;
> -
> /* When someone waits for the WMT event, the skb is being cloned
> * and being processed the events from there then.
> */
> @@ -403,7 +396,7 @@ static int btmtksdio_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
> if (err < 0)
> goto err_free_skb;
>
> - if (hdr->evt == HCI_EV_VENDOR) {
> + if (hdr->evt == HCI_EV_WMT) {
> if (test_and_clear_bit(BTMTKSDIO_TX_WAIT_VND_EVT,
> &bdev->tx_state)) {
> /* Barrier to sync with other CPUs */
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index aefa0ee293f3..55ebab019d29 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -2271,11 +2271,6 @@ static void btusb_mtk_wmt_recv(struct urb *urb)
> skb_put_data(skb, urb->transfer_buffer, urb->actual_length);
>
> hdr = (void *)skb->data;
> - /* Fix up the vendor event id with 0xff for vendor specific
> - * instead of 0xe4 so that event send via monitoring socket can
> - * be parsed properly.
> - */
> - hdr->evt = 0xff;
>
> /* When someone waits for the WMT event, the skb is being cloned
> * and being processed the events from there then.
please fix the reported issue by kernel test robot.
Regards
Marcel
next prev parent reply other threads:[~2022-02-07 15:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-29 6:02 [PATCH 1/2] Bluetooth: mt7921s: support bluetooth reset mechanism sean.wang
2022-01-29 6:02 ` [PATCH 2/2] Bluetooth: mediatek: fix the conflict between mtk and msft vendor event sean.wang
2022-02-07 15:48 ` Marcel Holtmann [this message]
[not found] <202202130806.UHxKw5N3-lkp@intel.com>
2022-02-14 8:52 ` kernel test robot
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=1CE2BE2F-A47D-4EEF-809A-035775125D83@holtmann.org \
--to=marcel@holtmann.org \
--cc=Deren.Wu@mediatek.com \
--cc=Eddie.Chen@mediatek.com \
--cc=Eric-SY.Chang@mediatek.com \
--cc=Eric.Liang@mediatek.com \
--cc=Leon.Yen@mediatek.com \
--cc=Mark-YW.Chen@mediatek.com \
--cc=Soul.Huang@mediatek.com \
--cc=Stella.Chang@mediatek.com \
--cc=Tom.Chou@mediatek.com \
--cc=YN.Chen@mediatek.com \
--cc=abhishekpandit@google.com \
--cc=ch.yeh@mediatek.com \
--cc=frankgor@google.com \
--cc=jemele@google.com \
--cc=johan.hedberg@gmail.com \
--cc=jsiuda@google.com \
--cc=km.lin@mediatek.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=mcchou@chromium.org \
--cc=michaelfsun@google.com \
--cc=posh.sun@mediatek.com \
--cc=robin.chiu@mediatek.com \
--cc=sean.wang@mediatek.com \
--cc=shawnku@google.com \
--cc=steve.lee@mediatek.com \
--cc=ted.huang@mediatek.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
all inboxes | Powered by JetHome®