1. 04 8月, 2021 1 次提交
  2. 02 8月, 2021 1 次提交
  3. 30 7月, 2021 3 次提交
  4. 29 7月, 2021 5 次提交
    • I
      Bluetooth: btusb: Load Broadcom firmware for Dell device 413c:8197 · 340cd23d
      Ian Mackinnon 提交于
      Remove the btusb_table entry for 413c:8197 so the device is handled
      by the later Dell vendor entry, which specifies patchram loading.
      
      T:  Bus=01 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#=  4 Spd=12   MxCh= 0
      D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=413c ProdID=8197 Rev= 1.12
      S:  Manufacturer=Dell Computer Corp
      S:  Product=DW380 Bluetooth Module
      S:  SerialNumber=74E54354F609
      C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=  0mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=btusb
      E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
      Signed-off-by: NIan Mackinnon <imackinnon@gmail.com>
      Tested-By: NAathif Naseer <aathif394@gmail.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      340cd23d
    • L
      Bluetooth: btmrvl_sdio: Remove all strcpy() uses · 785077fa
      Len Baker 提交于
      strcpy() performs no bounds checking on the destination buffer. This
      could result in linear overflows beyond the end of the buffer, leading
      to all kinds of misbehaviors. The safe replacement is strscpy() but in
      this case it is better to use the scnprintf to simplify the arithmetic.
      
      This is a previous step in the path to remove the strcpy() function
      entirely from the kernel.
      Signed-off-by: NLen Baker <len.baker@gmx.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      785077fa
    • D
      Bluetooth: skip invalid hci_sync_conn_complete_evt · 92fe24a7
      Desmond Cheong Zhi Xi 提交于
      Syzbot reported a corrupted list in kobject_add_internal [1]. This
      happens when multiple HCI_EV_SYNC_CONN_COMPLETE event packets with
      status 0 are sent for the same HCI connection. This causes us to
      register the device more than once which corrupts the kset list.
      
      As this is forbidden behavior, we add a check for whether we're
      trying to process the same HCI_EV_SYNC_CONN_COMPLETE event multiple
      times for one connection. If that's the case, the event is invalid, so
      we report an error that the device is misbehaving, and ignore the
      packet.
      
      Link: https://syzkaller.appspot.com/bug?extid=66264bf2fd0476be7e6c [1]
      Reported-by: syzbot+66264bf2fd0476be7e6c@syzkaller.appspotmail.com
      Tested-by: syzbot+66264bf2fd0476be7e6c@syzkaller.appspotmail.com
      Signed-off-by: NDesmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      92fe24a7
    • T
      Bluetooth: mgmt: Fix wrong opcode in the response for add_adv cmd · a25fca4d
      Tedd Ho-Jeong An 提交于
      This patch fixes the MGMT add_advertising command repsones with the
      wrong opcode when it is trying to return the not supported error.
      
      Fixes: cbbdfa6f ("Bluetooth: Enable controller RPA resolution using Experimental feature")
      Signed-off-by: NTedd Ho-Jeong An <tedd.an@intel.com>
      Signed-off-by: NLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      a25fca4d
    • T
      Bluetooth: defer cleanup of resources in hci_unregister_dev() · 58ce6d5b
      Tetsuo Handa 提交于
      syzbot is hitting might_sleep() warning at hci_sock_dev_event()
      due to calling lock_sock() with rw spinlock held [1].
      
      It seems that history of this locking problem is a trial and error.
      
      Commit b40df574 ("[PATCH] bluetooth: fix socket locking in
      hci_sock_dev_event()") in 2.6.21-rc4 changed bh_lock_sock() to lock_sock()
      as an attempt to fix lockdep warning.
      
      Then, commit 4ce61d1c ("[BLUETOOTH]: Fix locking in
      hci_sock_dev_event().") in 2.6.22-rc2 changed lock_sock() to
      local_bh_disable() + bh_lock_sock_nested() as an attempt to fix
      sleep in atomic context warning.
      
      Then, commit 4b5dd696 ("Bluetooth: Remove local_bh_disable() from
      hci_sock.c") in 3.3-rc1 removed local_bh_disable().
      
      Then, commit e305509e ("Bluetooth: use correct lock to prevent UAF
      of hdev object") in 5.13-rc5 again changed bh_lock_sock_nested() to
      lock_sock() as an attempt to fix CVE-2021-3573.
      
      This difficulty comes from current implementation that
      hci_sock_dev_event(HCI_DEV_UNREG) is responsible for dropping all
      references from sockets because hci_unregister_dev() immediately reclaims
      resources as soon as returning from hci_sock_dev_event(HCI_DEV_UNREG).
      But the history suggests that hci_sock_dev_event(HCI_DEV_UNREG) was not
      doing what it should do.
      
      Therefore, instead of trying to detach sockets from device, let's accept
      not detaching sockets from device at hci_sock_dev_event(HCI_DEV_UNREG),
      by moving actual cleanup of resources from hci_unregister_dev() to
      hci_release_dev() which is called by bt_host_release when all references
      to this unregistered device (which is a kobject) are gone.
      
      Link: https://syzkaller.appspot.com/bug?extid=a5df189917e79d5e59c9 [1]
      Reported-by: Nsyzbot <syzbot+a5df189917e79d5e59c9@syzkaller.appspotmail.com>
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Tested-by: Nsyzbot <syzbot+a5df189917e79d5e59c9@syzkaller.appspotmail.com>
      Fixes: e305509e ("Bluetooth: use correct lock to prevent UAF of hdev object")
      Signed-off-by: NLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      58ce6d5b
  5. 24 7月, 2021 1 次提交
  6. 23 7月, 2021 4 次提交
    • A
      Bluetooth: hci_h5: Add runtime suspend · d9dd833c
      Archie Pusaka 提交于
      This patch allows the controller to suspend after a short period of
      inactivity.
      Signed-off-by: NArchie Pusaka <apusaka@chromium.org>
      Reviewed-by: NAbhishek Pandit-Subedi <abhishekpandit@chromium.org>
      Reviewed-by: NHilda Wu <hildawu@realtek.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      d9dd833c
    • A
      Bluetooth: hci_h5: btrtl: Maintain flow control if wakeup is enabled · 30f11dda
      Archie Pusaka 提交于
      For chips that doesn't reset on suspend, we need to provide the correct
      value of flow_control when it resumes. Therefore, store the flow
      control value when reading from the config file to be reused upon
      suspend.
      Signed-off-by: NArchie Pusaka <apusaka@chromium.org>
      Reviewed-by: NAbhishek Pandit-Subedi <abhishekpandit@chromium.org>
      Reviewed-by: NHilda Wu <hildawu@realtek.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      30f11dda
    • A
      Bluetooth: hci_h5: add WAKEUP_DISABLE flag · 66f077dd
      Archie Pusaka 提交于
      Some RTL chips resets the FW on suspend, so wakeup is disabled on
      those chips. This patch introduces this WAKEUP_DISABLE flag so that
      chips that doesn't reset FW on suspend can leave the flag unset and
      is allowed to wake the host.
      
      This patch also left RTL8822 WAKEUP_DISABLE flag unset, therefore
      allowing it to wake the host, and preventing reprobing on resume.
      Signed-off-by: NArchie Pusaka <apusaka@chromium.org>
      Reviewed-by: NAbhishek Pandit-Subedi <abhishekpandit@chromium.org>
      Reviewed-by: NHilda Wu <hildawu@realtek.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      66f077dd
    • A
      Bluetooth: btusb: Add support for Foxconn Mediatek Chip · 64832df2
      Aaron Ma 提交于
      Add support for another Foxconn / Hon Hai device with MT7921 chip.
      
      T:  Bus=05 Lev=01 Prnt=01 Port=03 Cnt=02 Dev#=  3 Spd=480  MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0489 ProdID=e0cd Rev= 1.00
      S:  Manufacturer=MediaTek Inc.
      S:  Product=Wireless_Device
      S:  SerialNumber=000000000
      C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA
      A:  FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=125us
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      I:  If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  63 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  63 Ivl=1ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
      E:  Ad=8a(I) Atr=03(Int.) MxPS=  64 Ivl=125us
      E:  Ad=0a(O) Atr=03(Int.) MxPS=  64 Ivl=125us
      I:  If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
      E:  Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us
      E:  Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us
      Signed-off-by: NAaron Ma <aaron.ma@canonical.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      64832df2
  7. 22 7月, 2021 25 次提交
    • R
      Bluetooth: btrsi: use non-kernel-doc comment for copyright · ee3f96ad
      Randy Dunlap 提交于
      kernel-doc complains about a non-kernel-doc comment that uses "/**"
      to begin the comment, so change it to just "/*".
      
      drivers/bluetooth/btrsi.c:2: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
          * Copyright (c) 2017 Redpine Signals Inc.
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Reported-by: Nkernel test robot <lkp@intel.com>
      Cc: Aditya Srivastava <yashsri421@gmail.com>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
      Cc: linux-bluetooth@vger.kernel.org
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: netdev@vger.kernel.org
      Cc: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
      Cc: Sanjay Kumar Konduri <sanjay.konduri@redpinesignals.com>
      Cc: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      ee3f96ad
    • A
      Bluetooth: btrtl: Set MSFT opcode for RTL8852 · 7f6a750a
      Archie Pusaka 提交于
      RTL8852 support MSFT HCI extension, therefore set the proper MSFT
      opcode.
      Signed-off-by: NArchie Pusaka <apusaka@chromium.org>
      Reviewed-by: NMiao-chen Chou <mcchou@chromium.org>
      Reviewed-by: NHilda Wu <hildawu@realtek.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      7f6a750a
    • C
      6lowpan: iphc: Fix an off-by-one check of array index · 9af41761
      Colin Ian King 提交于
      The bounds check of id is off-by-one and the comparison should
      be >= rather >. Currently the WARN_ON_ONCE check does not stop
      the out of range indexing of &ldev->ctx.table[id] so also add
      a return path if the bounds are out of range.
      
      Addresses-Coverity: ("Illegal address computation").
      Fixes: 5609c185 ("6lowpan: iphc: add support for stateful compression")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      9af41761
    • F
      Bluetooth: btusb: Add support for LG LGSBWAC92/TWCM-K505D · 37356827
      Forest Crossman 提交于
      The LG LGSBWAC92/TWCM-K505D/EAT64454801/EAT64454802 (it goes by many
      names) is a combo WiFi/Bluetooth module that's used in several models of
      LG TVs. It uses the MediaTek MT7668AUN, which is already supported in
      btusb, but this device has a non-MediaTek VID:PID pair so to get it to
      work we just need to add it to the list of devices to probe.
      
      Device from /sys/kernel/debug/usb/devices:
      
      T:  Bus=09 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  6 Spd=480  MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=043e ProdID=3109 Rev= 1.00
      S:  Manufacturer=MediaTek Inc.
      S:  Product=Wireless_Device
      S:  SerialNumber=000000000
      C:* #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=100mA
      A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=125us
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      I:  If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  63 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  63 Ivl=1ms
      I:* If#= 2 Alt= 0 #EPs= 8 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=08(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=09(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      Signed-off-by: NForest Crossman <cyrozap@gmail.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      37356827
    • J
      Bluetooth: btusb: Fix a unspported condition to set available debug features · 20a831f0
      Jun Miao 提交于
      When reading the support debug features failed, there are not available
      features init. Continue to set the debug features is illogical, we should
      skip btintel_set_debug_features(), even if check it by "if (!features)".
      
      Fixes: c453b10c ("Bluetooth: btusb: Configure Intel debug feature based on available support")
      Signed-off-by: NJun Miao <jun.miao@windriver.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      20a831f0
    • D
      Bluetooth: sco: prevent information leak in sco_conn_defer_accept() · 59da0b38
      Dan Carpenter 提交于
      Smatch complains that some of these struct members are not initialized
      leading to a stack information disclosure:
      
          net/bluetooth/sco.c:778 sco_conn_defer_accept() warn:
          check that 'cp.retrans_effort' doesn't leak information
      
      This seems like a valid warning.  I've added a default case to fix
      this issue.
      
      Fixes: 2f69a82a ("Bluetooth: Use voice setting in deferred SCO connection request")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      59da0b38
    • W
      Bluetooth: btusb: Add support for IMC Networks Mediatek Chip · 2cdff8ca
      Wai Paulo Valerio Wang 提交于
      This add supports for IMC Networks Wireless_Device Media Chip
      which contains the MT7921 chipset.
      
      $ lsusb
      
      Bus 001 Device 004: ID 13d3:3563 IMC Networks Wireless_Device
      
      $ cat /sys/kernel/debug/usb/devices
      
      T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=03 Dev#=  4 Spd=480  MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=13d3 ProdID=3563 Rev= 1.00
      S:  Manufacturer=MediaTek Inc.
      S:  Product=Wireless_Device
      S:  SerialNumber=000000000
      C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA
      A:  FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=125us
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      I:  If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  63 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  63 Ivl=1ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
      E:  Ad=8a(I) Atr=03(Int.) MxPS=  64 Ivl=125us
      E:  Ad=0a(O) Atr=03(Int.) MxPS=  64 Ivl=125us
      I:  If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
      E:  Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us
      E:  Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us
      Signed-off-by: NWai Paulo Valerio Wang <waicool20@gmail.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      2cdff8ca
    • H
      Bluetooth: hci_h5: Disable the hci_suspend_notifier for btrtl devices · b4a46996
      Hans de Goede 提交于
      The hci_suspend_notifier which was introduced last year, is causing
      problems for uart attached btrtl devices. These devices may loose their
      firmware and their baudrate setting over a suspend/resume.
      
      Since we don't even know the baudrate after a suspend/resume recovering
      from this is tricky. The driver solves this by treating these devices
      the same as USB BT HCIs which drop of the bus during suspend.
      
      Specifically the driver:
      1. Simply unconditionally turns the device fully off during
         system-suspend to save maximum power.
      2. Calls device_reprobe() from a workqueue to fully re-init the device
         from scratch on system-resume (unregistering the old HCI and
         registering a new HCI).
      
      This means that these devices do not benefit from the suspend / resume
      handling work done by the hci_suspend_notifier. At best this unnecessarily
      adds some time to the suspend/resume time.
      
      But in practice this is actually causing problems:
      
      1. These btrtl devices seem to not like the HCI_OP_WRITE_SCAN_ENABLE(
      SCAN_DISABLED) request being send to them when entering the
      BT_SUSPEND_CONFIGURE_WAKE state. The same request send on
      BT_SUSPEND_DISCONNECT works fine, but the second one send (unnecessarily?)
      from the BT_SUSPEND_CONFIGURE_WAKE transition causes the device to hang:
      
      [  573.497754] PM: suspend entry (s2idle)
      [  573.554615] Filesystems sync: 0.056 seconds
      [  575.837753] Bluetooth: hci0: Timed out waiting for suspend events
      [  575.837801] Bluetooth: hci0: Suspend timeout bit: 4
      [  575.837925] Bluetooth: hci0: Suspend notifier action (3) failed: -110
      
      2. The PM_POST_SUSPEND / BT_RUNNING transition races with the
      driver-unbinding done by the device_reprobe() work.
      If the hci_suspend_notifier wins the race it is talking to a dead
      device leading to the following errors being logged:
      
      [  598.686060] Bluetooth: hci0: Timed out waiting for suspend events
      [  598.686124] Bluetooth: hci0: Suspend timeout bit: 5
      [  598.686237] Bluetooth: hci0: Suspend notifier action (4) failed: -110
      
      In both cases things still work, but the suspend-notifier is causing
      these ugly errors getting logged and ut increase both the suspend- and
      the resume-time by 2 seconds.
      
      This commit avoids these problems by disabling the hci_suspend_notifier.
      
      Cc: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
      Cc: Vasily Khoruzhick <anarsoul@gmail.com>
      Cc: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      b4a46996
    • N
      nfp: fix return statement in nfp_net_parse_meta() · 4431531c
      Niklas Söderlund 提交于
      The return type of the function is bool and while NULL do evaluate to
      false it's not very nice, fix this by explicitly returning false. There
      is no functional change.
      Signed-off-by: NNiklas Söderlund <niklas.soderlund@corigine.com>
      Signed-off-by: NLouis Peens <louis.peens@corigine.com>
      Signed-off-by: NSimon Horman <simon.horman@corigine.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4431531c
    • M
      ipv6: fix "'ioam6_if_id_max' defined but not used" warn · 176f716c
      Matthieu Baerts 提交于
      When compiling without CONFIG_SYSCTL, this warning appears:
      
        net/ipv6/addrconf.c:99:12: error: 'ioam6_if_id_max' defined but not used [-Werror=unused-variable]
           99 | static u32 ioam6_if_id_max = U16_MAX;
              |            ^~~~~~~~~~~~~~~
        cc1: all warnings being treated as errors
      
      Simply moving the declaration of this variable under ...
      
        #ifdef CONFIG_SYSCTL
      
      ... with other similar variables fixes the issue.
      
      Fixes: 9ee11f0f ("ipv6: ioam: Data plane support for Pre-allocated Trace")
      Signed-off-by: NMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      176f716c
    • D
      Merge branch 'nfp-flower-ct-offload' · 552a2a3f
      David S. Miller 提交于
      Simon Horman says:
      
      ====================
      nfp: flower: conntrack offload
      
      Louis Peens says:
      
      This series takes the preparation from previous two series
      and finally creates the structures and control messages
      to offload the conntrack flows to the card. First we
      do a bit of refactoring in the existing functions
      to make them re-usable for the conntrack implementation,
      after which the control messages are compiled and
      transmitted to the card. Lastly we add stats handling
      for the conntrack flows.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      552a2a3f
    • L
      nfp: flower-tc: add flow stats updates for ct · 40c10bd9
      Louis Peens 提交于
      Add in the logic to update flow stats. The flow stats from the nfp
      is saved in the flow_pay struct, which is associated with the final
      merged flow. This saves deltas however, so once read it needs to
      be cleared. However the flow stats requests from the kernel is
      from the other side of the chain, and a single tc flow from
      the kernel can be merged into multiple other tc flows to form
      multiple offloaded flows. This means that all linked flows
      needs to be updated for each stats request.
      Signed-off-by: NLouis Peens <louis.peens@corigine.com>
      Signed-off-by: NYinjun Zhang <yinjun.zhang@corigine.com>
      Signed-off-by: NSimon Horman <simon.horman@corigine.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      40c10bd9
    • L
      nfp: flower-ct: add offload calls to the nfp · 400a5e5f
      Louis Peens 提交于
      Add the offload parts (ADD_FLOW/DEL_FLOW) calls to add and delete
      the flows from the nfp.
      Signed-off-by: NLouis Peens <louis.peens@corigine.com>
      Signed-off-by: NYinjun Zhang <yinjun.zhang@corigine.com>
      Signed-off-by: NSimon Horman <simon.horman@corigine.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      400a5e5f
    • L
      nfp: flower-ct: add flow_pay to the offload table · 453cdc30
      Louis Peens 提交于
      Compile the offload flow metadata and add flow_pay to the offload
      table. Also add in the delete paths. This does not include actual
      offloading to the card yet, this will follow soon.
      Signed-off-by: NLouis Peens <louis.peens@corigine.com>
      Signed-off-by: NYinjun Zhang <yinjun.zhang@corigine.com>
      Signed-off-by: NSimon Horman <simon.horman@corigine.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      453cdc30
    • L
      nfp: flower-ct: add actions into flow_pay for offload · d94a63b4
      Louis Peens 提交于
      Combine the actions from the three different rules into one and
      convert into the payload format expected by the nfp.
      Signed-off-by: NLouis Peens <louis.peens@corigine.com>
      Signed-off-by: NYinjun Zhang <yinjun.zhang@corigine.com>
      Signed-off-by: NSimon Horman <simon.horman@corigine.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d94a63b4
    • L
      nfp: flower-ct: compile match sections of flow_payload · 5a2b9304
      Louis Peens 提交于
      Add in the code to compile match part of the payload that will be
      sent to the firmware. This works similar to match.c does it, but
      since three flows needs to be merged it iterates through all three
      rules in a loop and combine the match fields to get the most strict
      match as result.
      Signed-off-by: NLouis Peens <louis.peens@corigine.com>
      Signed-off-by: NYinjun Zhang <yinjun.zhang@corigine.com>
      Signed-off-by: NSimon Horman <simon.horman@corigine.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a2b9304
    • L
      nfp: flower-ct: calculate required key_layers · 71e88cfb
      Louis Peens 提交于
      This calculates the correct combined keylayers and key_layer_size
      for the to-be-offloaded flow.
      Signed-off-by: NLouis Peens <louis.peens@corigine.com>
      Signed-off-by: NYinjun Zhang <yinjun.zhang@corigine.com>
      Signed-off-by: NSimon Horman <simon.horman@corigine.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      71e88cfb
    • L
      nfp: flower: refactor action offload code slightly · e75dc265
      Louis Peens 提交于
      Change the action related offload functions to take in flow_rule *
      as input instead of flow_cls_offload * as input. The flow_rule
      parts of flow_cls_offload is the only part that is used in any
      case, and this is required for more conntrack offload patches
      which will follow later.
      Signed-off-by: NLouis Peens <louis.peens@corigine.com>
      Signed-off-by: NYinjun Zhang <yinjun.zhang@corigine.com>
      Signed-off-by: NSimon Horman <simon.horman@corigine.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e75dc265
    • L
      nfp: flower: refactor match functions to take flow_rule as input · 4b15fb18
      Louis Peens 提交于
      This is a small cleanup to pass in flow->rule to some of the compile
      functions instead of extracting it every time. This is will also be
      useful for conntrack patches later.
      Signed-off-by: NLouis Peens <louis.peens@corigine.com>
      Signed-off-by: NYinjun Zhang <yinjun.zhang@corigine.com>
      Signed-off-by: NSimon Horman <simon.horman@corigine.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4b15fb18
    • Y
      nfp: flower: make the match compilation functions reusable · 16416d37
      Yinjun Zhang 提交于
      Expose and refactor the match compilation functions so that they
      can be invoked externally. Also update the functions so they can
      be called multiple times with the results OR'd together. This is
      applicable for the flows-merging scenario, in which there could be
      overlapped and non-conflicting match fields. This will be used
      in upcoming conntrack patches. This is safe to do in the in the
      single call case as well since both unmasked_data and mask_data
      gets initialised to 0.
      Signed-off-by: NYinjun Zhang <yinjun.zhang@corigine.com>
      Signed-off-by: NLouis Peens <louis.peens@corigine.com>
      Signed-off-by: NSimon Horman <simon.horman@corigine.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      16416d37
    • O
      net: selftests: add MTU test · 802a76af
      Oleksij Rempel 提交于
      Test if we actually can send/receive packets with MTU size. This kind of
      issue was detected on ASIX HW with bogus EEPROM.
      Signed-off-by: NOleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      802a76af
    • O
      net: usb: asix: ax88772: add missing stop · 9c267095
      Oleksij Rempel 提交于
      Add missing stop and let phylib framework suspend attached PHY.
      
      Fixes: e532a096 ("net: usb: asix: ax88772: add phylib support")
      Signed-off-by: NOleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9c267095
    • O
      net: usb: asix: ax88772: do not poll for PHY before registering it · fdc362bf
      Oleksij Rempel 提交于
      asix_get_phyid() is used for two reasons here. To print debug message
      with the PHY ID and to wait until the PHY is powered up.
      
      After migrating to the phylib, we can read PHYID from sysfs. If polling
      for the PHY is really needed, then we will need to handle it in the
      phylib as well.
      
      This change was tested with:
      - ax88772a + internal PHY
      - ax88772b + external PHY
      Signed-off-by: NOleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fdc362bf
    • V
      net: switchdev: fix FDB entries towards foreign ports not getting propagated to us · 2b0a5688
      Vladimir Oltean 提交于
      The newly introduced switchdev_handle_fdb_{add,del}_to_device helpers
      solved a problem but introduced another one. They have a severe design
      bug: they do not propagate FDB events on foreign interfaces to us, i.e.
      this use case:
      
               br0
              /   \
             /     \
            /       \
           /         \
         swp0       eno0
      (switchdev)  (foreign)
      
      when an address is learned on eno0, what is supposed to happen is that
      this event should also be propagated towards swp0. Somehow I managed to
      convince myself that this did work correctly, but obviously it does not.
      
      The trouble with foreign interfaces is that we must reach a switchdev
      net_device pointer through a foreign net_device that has no direct
      upper/lower relationship with it. So we need to do exploratory searching
      through the lower interfaces of the foreign net_device's bridge upper
      (to reach swp0 from eno0, we must check its upper, br0, for lower
      interfaces that pass the check_cb and foreign_dev_check_cb). This is
      something that the previous code did not do, it just assumed that "dev"
      will become a switchdev interface at some point, somehow, probably by
      magic.
      
      With this patch, assisted address learning on the CPU port works again
      in DSA:
      
      ip link add br0 type bridge
      ip link set swp0 master br0
      ip link set eno0 master br0
      ip link set br0 up
      
      [   46.708929] mscc_felix 0000:00:00.5 swp0: Adding FDB entry towards eno0, addr 00:04:9f:05:f4:ab vid 0 as host address
      
      Fixes: 8ca07176 ("net: switchdev: introduce a fanout helper for SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE")
      Reported-by: NEric Woudstra <ericwouds@gmail.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2b0a5688
    • D
      Merge branch 'bridge-port-offload' · f796fcd6
      David S. Miller 提交于
      Vladimir Oltean says:
      
      ====================
      Let switchdev drivers offload and unoffload bridge ports at their own convenience
      
      This series introduces an explicit API through which switchdev drivers
      mark a bridge port as offloaded or not:
      - switchdev_bridge_port_offload()
      - switchdev_bridge_port_unoffload()
      
      Currently, the bridge assumes that a port is offloaded if
      dev_get_port_parent_id(dev, &ppid, recurse=true) returns something, but
      that is just an assumption that breaks some use cases (like a
      non-offloaded LAG interface on top of a switchdev port, bridged with
      other switchdev ports).
      
      Along with some consolidation of the bridge logic to assign a "switchdev
      offloading mark" to a port (now better called a "hardware domain"), this
      series allows the bridge driver side to no longer impose restrictions on
      that configuration.
      
      Right now, all switchdev drivers must be modified to use the explicit
      API, but more and more logic can then be placed centrally in the bridge
      and therefore ease the job of a switchdev driver writer in the future.
      
      For example, the first thing we can hook into the explicit switchdev
      offloading API calls are the switchdev object and FDB replay helpers.
      So far, these have only been used by DSA in "pull" mode (where the
      driver must ask for them). Adding the replay helpers to other drivers
      involves a lot of repetition. But by moving the helpers inside the
      bridge port offload/unoffload hook points, we can move the entire replay
      process to "push" mode (where the bridge provides them automatically).
      
      The explicit switchdev offloading API will see further extensions in the
      future.
      
      The patches were split from a larger series for easier review:
      https://patchwork.kernel.org/project/netdevbpf/cover/20210718214434.3938850-1-vladimir.oltean@nxp.com/
      
      Changes in v6:
      - Make the switchdev replay helpers opt-in
      - Opt out of the replay helpers for mlxsw, rocker, prestera, sparx5,
        cpsw, am65-cpsw
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f796fcd6