Bluetooth: mt7921s: support bluetooth reset mechanism
Subsystems (2)
PATCH 1/2 Bluetooth: mt7921s: support bluetooth reset mechanism
From: Chih-Ying Chiang <[email protected]>
Implement .cmd_timeout to reset the MT7921s device via a dedicated GPIO pin when the firmware hang or the command has no response.
--- drivers/bluetooth/btmtk.h | 6 ++ drivers/bluetooth/btmtksdio.c | 113 +++++++++++++++++++++++++++++++++- 2 files changed, 118 insertions(+), 1 deletion(-)
drivers/bluetooth/btmtk.h +6 -0
@@ -10,9 +10,15 @@#define BTMTK_WMT_REG_WRITE 0x1#define BTMTK_WMT_REG_READ 0x2 +#define MT7921_BTSYS_RST 0x70002610 +#define MT7921_BTSYS_RST_WITH_GPIO BIT(7) +#define MT7921_PINMUX_0 0x70005050#define MT7921_PINMUX_1 0x70005054 +#define MT7921_DLSTATUS 0x7c053c10 +#define BT_DL_STATE BIT(1) +enum {BTMTK_WMT_PATCH_DWNLD =0x1 ,BTMTK_WMT_TEST =0x2 ,
drivers/bluetooth/btmtksdio.c +112 -1
189 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH 2/2 Bluetooth: mediatek: fix the conflict between mtk and msft vendor event
From: Sean Wang <[email protected]>
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.
--- drivers/bluetooth/btmtk.h | 1 + drivers/bluetooth/btmtksdio.c | 9 +-------- drivers/bluetooth/btusb.c | 5 ----- 3 files changed, 2 insertions(+), 13 deletions(-)
drivers/bluetooth/btmtk.h +1 -0
@@ -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
drivers/bluetooth/btmtksdio.c +1 -8
@@ -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 */
drivers/bluetooth/btusb.c +0 -5
@@ -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.
Signature · 1 line
2.25.1
kernel test robot
build botRe: [PATCH 2/2] Bluetooth: mediatek: fix the conflict between mtk and msft vendor event
I love your patch! Perhaps something to improve:
Hi,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on next-20220128]
[cannot apply to bluetooth/master v5.17-rc1]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/sean-wang-mediatek-com/Bluetooth-mt7921s-support-bluetooth-reset-mechanism/20220129-140313 base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20220129/202201291727.neufc3xR-lkp(a)intel.com/config) compiler: mips-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/33092fd43b74594bae07555a6fdf15133cc8ec54
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review sean-wang-mediatek-com/Bluetooth-mt7921s-support-bluetooth-reset-mechanism/20220129-140313 git checkout 33092fd43b74594bae07555a6fdf15133cc8ec54
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash drivers/
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
drivers/bluetooth/btusb.c: In function 'btusb_mtk_wmt_recv':
>> drivers/bluetooth/btusb.c:2253:31: warning: variable 'hdr' set but not used [-Wunused-but-set-variable]
2253 | struct hci_event_hdr *hdr;
| ^~~vim +/hdr +2253 drivers/bluetooth/btusb.c
5a87679ffd4436 mark-yw.chen 2021-09-01 2248
a1c49c434e1505 Sean Wang 2019-06-02 2249 static void btusb_mtk_wmt_recv(struct urb *urb)
a1c49c434e1505 Sean Wang 2019-06-02 2250 {
a1c49c434e1505 Sean Wang 2019-06-02 2251 struct hci_dev *hdev = urb->context;
a1c49c434e1505 Sean Wang 2019-06-02 2252 struct btusb_data *data = hci_get_drvdata(hdev);
a1c49c434e1505 Sean Wang 2019-06-02 @2253 struct hci_event_hdr *hdr;
a1c49c434e1505 Sean Wang 2019-06-02 2254 struct sk_buff *skb;
a1c49c434e1505 Sean Wang 2019-06-02 2255 int err;
a1c49c434e1505 Sean Wang 2019-06-02 2256
a1c49c434e1505 Sean Wang 2019-06-02 2257 if (urb->status == 0 && urb->actual_length > 0) {
a1c49c434e1505 Sean Wang 2019-06-02 2258 hdev->stat.byte_rx += urb->actual_length;
a1c49c434e1505 Sean Wang 2019-06-02 2259
a1c49c434e1505 Sean Wang 2019-06-02 2260 /* WMT event shouldn't be fragmented and the size should be
a1c49c434e1505 Sean Wang 2019-06-02 2261 * less than HCI_WMT_MAX_EVENT_SIZE.
a1c49c434e1505 Sean Wang 2019-06-02 2262 */
a1c49c434e1505 Sean Wang 2019-06-02 2263 skb = bt_skb_alloc(HCI_WMT_MAX_EVENT_SIZE, GFP_ATOMIC);
a1c49c434e1505 Sean Wang 2019-06-02 2264 if (!skb) {
a1c49c434e1505 Sean Wang 2019-06-02 2265 hdev->stat.err_rx++;
60c6a63a3d3080 Mark-YW.Chen 2021-10-14 2266 kfree(urb->setup_packet);
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2267 return;
a1c49c434e1505 Sean Wang 2019-06-02 2268 }
a1c49c434e1505 Sean Wang 2019-06-02 2269
a1c49c434e1505 Sean Wang 2019-06-02 2270 hci_skb_pkt_type(skb) = HCI_EVENT_PKT;
a1c49c434e1505 Sean Wang 2019-06-02 2271 skb_put_data(skb, urb->transfer_buffer, urb->actual_length);
a1c49c434e1505 Sean Wang 2019-06-02 2272
a1c49c434e1505 Sean Wang 2019-06-02 2273 hdr = (void *)skb->data;
a1c49c434e1505 Sean Wang 2019-06-02 2274
a1c49c434e1505 Sean Wang 2019-06-02 2275 /* When someone waits for the WMT event, the skb is being cloned
a1c49c434e1505 Sean Wang 2019-06-02 2276 * and being processed the events from there then.
a1c49c434e1505 Sean Wang 2019-06-02 2277 */
a1c49c434e1505 Sean Wang 2019-06-02 2278 if (test_bit(BTUSB_TX_WAIT_VND_EVT, &data->flags)) {
22cc6b7a1dbb58 Johan Hovold 2019-11-28 2279 data->evt_skb = skb_clone(skb, GFP_ATOMIC);
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2280 if (!data->evt_skb) {
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2281 kfree_skb(skb);
60c6a63a3d3080 Mark-YW.Chen 2021-10-14 2282 kfree(urb->setup_packet);
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2283 return;
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2284 }
a1c49c434e1505 Sean Wang 2019-06-02 2285 }
a1c49c434e1505 Sean Wang 2019-06-02 2286
a1c49c434e1505 Sean Wang 2019-06-02 2287 err = hci_recv_frame(hdev, skb);
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2288 if (err < 0) {
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2289 kfree_skb(data->evt_skb);
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2290 data->evt_skb = NULL;
60c6a63a3d3080 Mark-YW.Chen 2021-10-14 2291 kfree(urb->setup_packet);
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2292 return;
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2293 }
a1c49c434e1505 Sean Wang 2019-06-02 2294
a1c49c434e1505 Sean Wang 2019-06-02 2295 if (test_and_clear_bit(BTUSB_TX_WAIT_VND_EVT,
a1c49c434e1505 Sean Wang 2019-06-02 2296 &data->flags)) {
a1c49c434e1505 Sean Wang 2019-06-02 2297 /* Barrier to sync with other CPUs */
a1c49c434e1505 Sean Wang 2019-06-02 2298 smp_mb__after_atomic();
a1c49c434e1505 Sean Wang 2019-06-02 2299 wake_up_bit(&data->flags,
a1c49c434e1505 Sean Wang 2019-06-02 2300 BTUSB_TX_WAIT_VND_EVT);
a1c49c434e1505 Sean Wang 2019-06-02 2301 }
60c6a63a3d3080 Mark-YW.Chen 2021-10-14 2302 kfree(urb->setup_packet);
a1c49c434e1505 Sean Wang 2019-06-02 2303 return;
a1c49c434e1505 Sean Wang 2019-06-02 2304 } else if (urb->status == -ENOENT) {
a1c49c434e1505 Sean Wang 2019-06-02 2305 /* Avoid suspend failed when usb_kill_urb */
a1c49c434e1505 Sean Wang 2019-06-02 2306 return;
a1c49c434e1505 Sean Wang 2019-06-02 2307 }
a1c49c434e1505 Sean Wang 2019-06-02 2308
a1c49c434e1505 Sean Wang 2019-06-02 2309 usb_mark_last_busy(data->udev);
a1c49c434e1505 Sean Wang 2019-06-02 2310
a1c49c434e1505 Sean Wang 2019-06-02 2311 /* The URB complete handler is still called with urb->actual_length = 0
a1c49c434e1505 Sean Wang 2019-06-02 2312 * when the event is not available, so we should keep re-submitting
a1c49c434e1505 Sean Wang 2019-06-02 2313 * URB until WMT event returns, Also, It's necessary to wait some time
a1c49c434e1505 Sean Wang 2019-06-02 2314 * between the two consecutive control URBs to relax the target device
a1c49c434e1505 Sean Wang 2019-06-02 2315 * to generate the event. Otherwise, the WMT event cannot return from
a1c49c434e1505 Sean Wang 2019-06-02 2316 * the device successfully.
a1c49c434e1505 Sean Wang 2019-06-02 2317 */
48c13301e6baba Mark Chen 2021-02-02 2318 udelay(500);
a1c49c434e1505 Sean Wang 2019-06-02 2319
a1c49c434e1505 Sean Wang 2019-06-02 2320 usb_anchor_urb(urb, &data->ctrl_anchor);
a1c49c434e1505 Sean Wang 2019-06-02 2321 err = usb_submit_urb(urb, GFP_ATOMIC);
a1c49c434e1505 Sean Wang 2019-06-02 2322 if (err < 0) {
60c6a63a3d3080 Mark-YW.Chen 2021-10-14 2323 kfree(urb->setup_packet);
a1c49c434e1505 Sean Wang 2019-06-02 2324 /* -EPERM: urb is being killed;
a1c49c434e1505 Sean Wang 2019-06-02 2325 * -ENODEV: device got disconnected
a1c49c434e1505 Sean Wang 2019-06-02 2326 */
a1c49c434e1505 Sean Wang 2019-06-02 2327 if (err != -EPERM && err != -ENODEV)
a1c49c434e1505 Sean Wang 2019-06-02 2328 bt_dev_err(hdev, "urb %p failed to resubmit (%d)",
a1c49c434e1505 Sean Wang 2019-06-02 2329 urb, -err);
a1c49c434e1505 Sean Wang 2019-06-02 2330 usb_unanchor_urb(urb);
a1c49c434e1505 Sean Wang 2019-06-02 2331 }
a1c49c434e1505 Sean Wang 2019-06-02 2332 }
a1c49c434e1505 Sean Wang 2019-06-02 2333 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botRe: [PATCH 2/2] Bluetooth: mediatek: fix the conflict between mtk and msft vendor event
In reply to [email protected]I love your patch! Perhaps something to improve:
Hi,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on next-20220128]
[cannot apply to v5.17-rc1]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/sean-wang-mediatek-com/Bluetooth-mt7921s-support-bluetooth-reset-mechanism/20220129-140313 base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master config: x86_64-randconfig-a012-20220124 (https://download.01.org/0day-ci/archive/20220129/202201291757.gh2GX6y1-lkp(a)intel.com/config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 33b45ee44b1f32ffdbc995e6fec806271b4b3ba4)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/33092fd43b74594bae07555a6fdf15133cc8ec54
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review sean-wang-mediatek-com/Bluetooth-mt7921s-support-bluetooth-reset-mechanism/20220129-140313 git checkout 33092fd43b74594bae07555a6fdf15133cc8ec54
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
>> drivers/bluetooth/btusb.c:2253:24: warning: variable 'hdr' set but not used [-Wunused-but-set-variable]
struct hci_event_hdr *hdr;
^1 warning generated.
vim +/hdr +2253 drivers/bluetooth/btusb.c
5a87679ffd4436 mark-yw.chen 2021-09-01 2248
a1c49c434e1505 Sean Wang 2019-06-02 2249 static void btusb_mtk_wmt_recv(struct urb *urb)
a1c49c434e1505 Sean Wang 2019-06-02 2250 {
a1c49c434e1505 Sean Wang 2019-06-02 2251 struct hci_dev *hdev = urb->context;
a1c49c434e1505 Sean Wang 2019-06-02 2252 struct btusb_data *data = hci_get_drvdata(hdev);
a1c49c434e1505 Sean Wang 2019-06-02 @2253 struct hci_event_hdr *hdr;
a1c49c434e1505 Sean Wang 2019-06-02 2254 struct sk_buff *skb;
a1c49c434e1505 Sean Wang 2019-06-02 2255 int err;
a1c49c434e1505 Sean Wang 2019-06-02 2256
a1c49c434e1505 Sean Wang 2019-06-02 2257 if (urb->status == 0 && urb->actual_length > 0) {
a1c49c434e1505 Sean Wang 2019-06-02 2258 hdev->stat.byte_rx += urb->actual_length;
a1c49c434e1505 Sean Wang 2019-06-02 2259
a1c49c434e1505 Sean Wang 2019-06-02 2260 /* WMT event shouldn't be fragmented and the size should be
a1c49c434e1505 Sean Wang 2019-06-02 2261 * less than HCI_WMT_MAX_EVENT_SIZE.
a1c49c434e1505 Sean Wang 2019-06-02 2262 */
a1c49c434e1505 Sean Wang 2019-06-02 2263 skb = bt_skb_alloc(HCI_WMT_MAX_EVENT_SIZE, GFP_ATOMIC);
a1c49c434e1505 Sean Wang 2019-06-02 2264 if (!skb) {
a1c49c434e1505 Sean Wang 2019-06-02 2265 hdev->stat.err_rx++;
60c6a63a3d3080 Mark-YW.Chen 2021-10-14 2266 kfree(urb->setup_packet);
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2267 return;
a1c49c434e1505 Sean Wang 2019-06-02 2268 }
a1c49c434e1505 Sean Wang 2019-06-02 2269
a1c49c434e1505 Sean Wang 2019-06-02 2270 hci_skb_pkt_type(skb) = HCI_EVENT_PKT;
a1c49c434e1505 Sean Wang 2019-06-02 2271 skb_put_data(skb, urb->transfer_buffer, urb->actual_length);
a1c49c434e1505 Sean Wang 2019-06-02 2272
a1c49c434e1505 Sean Wang 2019-06-02 2273 hdr = (void *)skb->data;
a1c49c434e1505 Sean Wang 2019-06-02 2274
a1c49c434e1505 Sean Wang 2019-06-02 2275 /* When someone waits for the WMT event, the skb is being cloned
a1c49c434e1505 Sean Wang 2019-06-02 2276 * and being processed the events from there then.
a1c49c434e1505 Sean Wang 2019-06-02 2277 */
a1c49c434e1505 Sean Wang 2019-06-02 2278 if (test_bit(BTUSB_TX_WAIT_VND_EVT, &data->flags)) {
22cc6b7a1dbb58 Johan Hovold 2019-11-28 2279 data->evt_skb = skb_clone(skb, GFP_ATOMIC);
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2280 if (!data->evt_skb) {
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2281 kfree_skb(skb);
60c6a63a3d3080 Mark-YW.Chen 2021-10-14 2282 kfree(urb->setup_packet);
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2283 return;
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2284 }
a1c49c434e1505 Sean Wang 2019-06-02 2285 }
a1c49c434e1505 Sean Wang 2019-06-02 2286
a1c49c434e1505 Sean Wang 2019-06-02 2287 err = hci_recv_frame(hdev, skb);
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2288 if (err < 0) {
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2289 kfree_skb(data->evt_skb);
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2290 data->evt_skb = NULL;
60c6a63a3d3080 Mark-YW.Chen 2021-10-14 2291 kfree(urb->setup_packet);
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2292 return;
de71a6cb4bf24d Jupeng Zhong 2021-02-02 2293 }
a1c49c434e1505 Sean Wang 2019-06-02 2294
a1c49c434e1505 Sean Wang 2019-06-02 2295 if (test_and_clear_bit(BTUSB_TX_WAIT_VND_EVT,
a1c49c434e1505 Sean Wang 2019-06-02 2296 &data->flags)) {
a1c49c434e1505 Sean Wang 2019-06-02 2297 /* Barrier to sync with other CPUs */
a1c49c434e1505 Sean Wang 2019-06-02 2298 smp_mb__after_atomic();
a1c49c434e1505 Sean Wang 2019-06-02 2299 wake_up_bit(&data->flags,
a1c49c434e1505 Sean Wang 2019-06-02 2300 BTUSB_TX_WAIT_VND_EVT);
a1c49c434e1505 Sean Wang 2019-06-02 2301 }
60c6a63a3d3080 Mark-YW.Chen 2021-10-14 2302 kfree(urb->setup_packet);
a1c49c434e1505 Sean Wang 2019-06-02 2303 return;
a1c49c434e1505 Sean Wang 2019-06-02 2304 } else if (urb->status == -ENOENT) {
a1c49c434e1505 Sean Wang 2019-06-02 2305 /* Avoid suspend failed when usb_kill_urb */
a1c49c434e1505 Sean Wang 2019-06-02 2306 return;
a1c49c434e1505 Sean Wang 2019-06-02 2307 }
a1c49c434e1505 Sean Wang 2019-06-02 2308
a1c49c434e1505 Sean Wang 2019-06-02 2309 usb_mark_last_busy(data->udev);
a1c49c434e1505 Sean Wang 2019-06-02 2310
a1c49c434e1505 Sean Wang 2019-06-02 2311 /* The URB complete handler is still called with urb->actual_length = 0
a1c49c434e1505 Sean Wang 2019-06-02 2312 * when the event is not available, so we should keep re-submitting
a1c49c434e1505 Sean Wang 2019-06-02 2313 * URB until WMT event returns, Also, It's necessary to wait some time
a1c49c434e1505 Sean Wang 2019-06-02 2314 * between the two consecutive control URBs to relax the target device
a1c49c434e1505 Sean Wang 2019-06-02 2315 * to generate the event. Otherwise, the WMT event cannot return from
a1c49c434e1505 Sean Wang 2019-06-02 2316 * the device successfully.
a1c49c434e1505 Sean Wang 2019-06-02 2317 */
48c13301e6baba Mark Chen 2021-02-02 2318 udelay(500);
a1c49c434e1505 Sean Wang 2019-06-02 2319
a1c49c434e1505 Sean Wang 2019-06-02 2320 usb_anchor_urb(urb, &data->ctrl_anchor);
a1c49c434e1505 Sean Wang 2019-06-02 2321 err = usb_submit_urb(urb, GFP_ATOMIC);
a1c49c434e1505 Sean Wang 2019-06-02 2322 if (err < 0) {
60c6a63a3d3080 Mark-YW.Chen 2021-10-14 2323 kfree(urb->setup_packet);
a1c49c434e1505 Sean Wang 2019-06-02 2324 /* -EPERM: urb is being killed;
a1c49c434e1505 Sean Wang 2019-06-02 2325 * -ENODEV: device got disconnected
a1c49c434e1505 Sean Wang 2019-06-02 2326 */
a1c49c434e1505 Sean Wang 2019-06-02 2327 if (err != -EPERM && err != -ENODEV)
a1c49c434e1505 Sean Wang 2019-06-02 2328 bt_dev_err(hdev, "urb %p failed to resubmit (%d)",
a1c49c434e1505 Sean Wang 2019-06-02 2329 urb, -err);
a1c49c434e1505 Sean Wang 2019-06-02 2330 usb_unanchor_urb(urb);
a1c49c434e1505 Sean Wang 2019-06-02 2331 }
a1c49c434e1505 Sean Wang 2019-06-02 2332 }
a1c49c434e1505 Sean Wang 2019-06-02 2333 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Marcel Holtmann
maintainerRe: [PATCH 2/2] Bluetooth: mediatek: fix the conflict between mtk and msft vendor event
In reply to [email protected]Hi Sean,
Quoted 64 lines
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 <[email protected]>---
drivers/bluetooth/btmtk.h | 1 + drivers/bluetooth/btmtksdio.c | 9 +-------- drivers/bluetooth/btusb.c | 5 ----- 3 files changed, 2 insertions(+), 13 deletions(-)drivers/bluetooth/btmtk.h +1
-0@@ -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 0x1drivers/bluetooth/btmtksdio.c +1
-8@@ -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 */ drivers/bluetooth/btusb.c +0
-0@@ -2271,11 +2271,6 @@ static void btusb_mtk_wmt_recv(struct urb *urb)skb_put_data (skb, urb->transfer_buffer, urb->actual_length);
drivers/bluetooth/btusb.c static void btusb_mtk_wmt_recv(struct urb *urb) · line 2276
Quoted 10 lines
drivers/bluetooth/btusb.c +0
-5hdr = (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
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=609706
---Test result---
Test Summary:
CheckPatch PASS 3.77 seconds GitLint PASS 2.08 seconds SubjectPrefix PASS 1.71 seconds BuildKernel PASS 30.47 seconds BuildKernel32 PASS 26.94 seconds Incremental Build with patchesPASS 42.88 seconds TestRunner: Setup PASS 472.91 seconds TestRunner: l2cap-tester PASS 13.67 seconds TestRunner: bnep-tester PASS 6.19 seconds TestRunner: mgmt-tester PASS 105.33 seconds TestRunner: rfcomm-tester PASS 7.59 seconds TestRunner: sco-tester PASS 7.75 seconds TestRunner: smp-tester PASS 7.58 seconds TestRunner: userchan-tester PASS 6.45 seconds
---
Regards,
Linux Bluetooth