1. 26 Jul, 2024 10 commits
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_event: Fix setting DISCOVERY_FINDING for passive scanning · df3d6a3e
      Luiz Augusto von Dentz authored
      DISCOVERY_FINDING shall only be set for active scanning as passive
      scanning is not meant to generate MGMT Device Found events causing
      discovering state to go out of sync since userspace would believe it
      is discovering when in fact it is just passive scanning.
      
      Cc: stable@vger.kernel.org
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=219088
      Fixes: 2e2515c1 ("Bluetooth: hci_event: Set DISCOVERY_FINDING on SCAN_ENABLED")
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      df3d6a3e
    • Arnd Bergmann's avatar
      Bluetooth: btmtk: remove #ifdef around declarations · 7a8c6fb2
      Arnd Bergmann authored
      The caller of these functions in btusb.c is guarded with an
      if(IS_ENABLED()) style check, so dead code is left out, but the
      declarations are still needed at compile time:
      
      drivers/bluetooth/btusb.c: In function 'btusb_mtk_reset':
      drivers/bluetooth/btusb.c:2705:15: error: implicit declaration of function 'btmtk_usb_subsys_reset' [-Wimplicit-function-declaration]
       2705 |         err = btmtk_usb_subsys_reset(hdev, btmtk_data->dev_id);
            |               ^~~~~~~~~~~~~~~~~~~~~~
      drivers/bluetooth/btusb.c: In function 'btusb_send_frame_mtk':
      drivers/bluetooth/btusb.c:2720:23: error: implicit declaration of function 'alloc_mtk_intr_urb' [-Wimplicit-function-declaration]
       2720 |                 urb = alloc_mtk_intr_urb(hdev, skb, btusb_tx_complete);
            |                       ^~~~~~~~~~~~~~~~~~
      drivers/bluetooth/btusb.c:2720:21: error: assignment to 'struct urb *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
       2720 |                 urb = alloc_mtk_intr_urb(hdev, skb, btusb_tx_complete);
            |                     ^
      
      Fixes: f0c83a23 ("Bluetooth: btmtk: Fix btmtk.c undefined reference build error")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      7a8c6fb2
    • Arnd Bergmann's avatar
      Bluetooth: btmtk: Fix btmtk.c undefined reference build error harder · 61f7a8f9
      Arnd Bergmann authored
      The previous fix was incomplete as the link failure still persists
      with CONFIG_USB=m when the sdio or serial wrappers for btmtk.c
      are build-in:
      
      btmtk.c:(.text+0x468): undefined reference to `usb_alloc_urb'
      btmtk.c:(.text+0x488): undefined reference to `usb_free_urb'
      btmtk.c:(.text+0x500): undefined reference to `usb_anchor_urb'
      btmtk.c:(.text+0x50a): undefined reference to `usb_submit_urb'
      btmtk.c:(.text+0x92c): undefined reference to `usb_control_msg'
      btmtk.c:(.text+0xa92): undefined reference to `usb_unanchor_urb'
      btmtk.c:(.text+0x11e4): undefined reference to `usb_set_interface'
      btmtk.c:(.text+0x120a): undefined reference to `usb_kill_anchored_urbs'
      
      Disallow this configuration.
      
      Fixes: f0c83a23 ("Bluetooth: btmtk: Fix btmtk.c undefined reference build error")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      61f7a8f9
    • Chris Lu's avatar
      Bluetooth: btmtk: Fix btmtk.c undefined reference build error · f0c83a23
      Chris Lu authored
      MediaTek moved some usb interface related function to btmtk.c which
      may cause build failed if BT USB Kconfig wasn't enabled.
      Fix undefined reference by adding config check.
      
      btmtk.c:(.text+0x89c): undefined reference to `usb_alloc_urb'
      btmtk.c:(.text+0x8e3): undefined reference to `usb_free_urb'
      btmtk.c:(.text+0x956): undefined reference to `usb_free_urb'
      btmtk.c:(.text+0xa0e): undefined reference to `usb_anchor_urb'
      btmtk.c:(.text+0xb43): undefined reference to `usb_autopm_get_interface'
      btmtk.c:(.text+0xb7e): undefined reference to `usb_autopm_put_interface'
      btmtk.c:(.text+0xf70): undefined reference to `usb_disable_autosuspend'
      btmtk.c:(.text+0x133a): undefined reference to `usb_control_msg'
      
      Fixes: d019930b ("Bluetooth: btmtk: move btusb_mtk_hci_wmt_sync to btmtk.c")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: https://lore.kernel.org/oe-kbuild-all/202407091928.AH0aGZnx-lkp@intel.com/Signed-off-by: default avatarChris Lu <chris.lu@mediatek.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      f0c83a23
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_sync: Fix suspending with wrong filter policy · 96b82af3
      Luiz Augusto von Dentz authored
      When suspending the scan filter policy cannot be 0x00 (no acceptlist)
      since that means the host has to process every advertisement report
      waking up the system, so this attempts to check if hdev is marked as
      suspended and if the resulting filter policy would be 0x00 (no
      acceptlist) then skip passive scanning if thre no devices in the
      acceptlist otherwise reset the filter policy to 0x01 so the acceptlist
      is used since the devices programmed there can still wakeup be system.
      
      Fixes: 182ee45d ("Bluetooth: hci_sync: Rework hci_suspend_notifier")
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      96b82af3
    • Chris Lu's avatar
      Bluetooth: btmtk: Fix kernel crash when entering btmtk_usb_suspend · d09009bc
      Chris Lu authored
      If MediaTek's Bluetooth setup is unsuccessful, a NULL pointer issue
      occur when the system is suspended and the anchored kill function
      is called. To avoid this, add protection to prevent executing the
      anchored kill function if the setup is unsuccessful.
      
      [    6.922106] Hardware name: Acer Tomato (rev2) board (DT)
      [    6.922114] Workqueue: pm pm_runtime_work
      [    6.922132] pstate: 804000c9
      (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      [    6.922147] pc : usb_kill_anchored_urbs+0x6c/0x1e0
      [    6.922164] lr : usb_kill_anchored_urbs+0x48/0x1e0
      [    6.922181] sp : ffff800080903b60
      [    6.922187] x29: ffff800080903b60
      x28: ffff2c7b85c32b80 x27: ffff2c7bbb370930
      [    6.922211] x26: 00000000000f4240
      x25: 00000000ffffffff x24: ffffd49ece2dcb48
      [    6.922255] x20: ffffffffffffffd8
      x19: 0000000000000000 x18: 0000000000000006
      [    6.922276] x17: 6531656337386238
      x16: 3632373862333863 x15: ffff800080903480
      [    6.922297] x14: 0000000000000000
      x13: 303278302f303178 x12: ffffd49ecf090e30
      [    6.922318] x11: 0000000000000001
      x10: 0000000000000001 x9 : ffffd49ecd2c5bb4
      [    6.922339] x8 : c0000000ffffdfff
      x7 : ffffd49ecefe0db8 x6 : 00000000000affa8
      [    6.922360] x5 : ffff2c7bbb35dd48
      x4 : 0000000000000000 x3 : 0000000000000000
      [    6.922379] x2 : 0000000000000000
      x1 : 0000000000000003 x0 : ffffffffffffffd8
      [    6.922400] Call trace:
      [    6.922405]  usb_kill_anchored_urbs+0x6c/0x1e0
      [    6.922422]  btmtk_usb_suspend+0x20/0x38
      [btmtk 5f200a97badbdfda4266773fee49acfc8e0224d5]
      [    6.922444]  btusb_suspend+0xd0/0x210
      [btusb 0bfbf19a87ff406c83b87268b87ce1e80e9a829b]
      [    6.922469]  usb_suspend_both+0x90/0x288
      [    6.922487]  usb_runtime_suspend+0x3c/0xa8
      [    6.922507]  __rpm_callback+0x50/0x1f0
      [    6.922523]  rpm_callback+0x70/0x88
      [    6.922538]  rpm_suspend+0xe4/0x5a0
      [    6.922553]  pm_runtime_work+0xd4/0xe0
      [    6.922569]  process_one_work+0x18c/0x440
      [    6.922588]  worker_thread+0x314/0x428
      [    6.922606]  kthread+0x128/0x138
      [    6.922621]  ret_from_fork+0x10/0x20
      [    6.922644] Code: f100a274 54000520 d503201f d100a260 (b8370000)
      [    6.922654] ---[ end trace 0000000000000000 ]---
      
      Fixes: ceac1cb0 ("Bluetooth: btusb: mediatek: add ISO data transmission functions")
      Signed-off-by: default avatarChris Lu <chris.lu@mediatek.com>
      Reported-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> #KernelCI
      Tested-by: default avatarNícolas F. R. A. Prado <nfraprado@collabora.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      d09009bc
    • Kiran K's avatar
      Bluetooth: btintel: Fail setup on error · e22a3a9d
      Kiran K authored
      Do not attempt to send any hci command to controller if *setup* function
      fails.
      
      Fixes: af395330 ("Bluetooth: btintel: Add Intel devcoredump support")
      Signed-off-by: default avatarKiran K <kiran.k@intel.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      e22a3a9d
    • Mark Mentovai's avatar
      net: phy: realtek: add support for RTL8366S Gigabit PHY · 225990c4
      Mark Mentovai authored
      The PHY built in to the Realtek RTL8366S switch controller was
      previously supported by genphy_driver. This PHY does not implement MMD
      operations. Since commit 9b01c885 ("net: phy: c22: migrate to
      genphy_c45_write_eee_adv()"), MMD register reads have been made during
      phy_probe to determine EEE support. For genphy_driver, these reads are
      transformed into 802.3 annex 22D clause 45-over-clause 22
      mmd_phy_indirect operations that perform MII register writes to
      MII_MMD_CTRL and MII_MMD_DATA. This overwrites those two MII registers,
      which on this PHY are reserved and have another function, rendering the
      PHY unusable while so configured.
      
      Proper support for this PHY is restored by providing a phy_driver that
      declares MMD operations as unsupported by using the helper functions
      provided for that purpose, while remaining otherwise identical to
      genphy_driver.
      
      Fixes: 9b01c885 ("net: phy: c22: migrate to genphy_c45_write_eee_adv()")
      Reported-by: default avatarRussell Senior <russell@personaltelco.net>
      Closes: https://github.com/openwrt/openwrt/issues/15981
      Link: https://github.com/openwrt/openwrt/issues/15739Signed-off-by: default avatarMark Mentovai <mark@mentovai.com>
      Reviewed-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      225990c4
    • Eric Dumazet's avatar
      sched: act_ct: take care of padding in struct zones_ht_key · 2191a54f
      Eric Dumazet authored
      Blamed commit increased lookup key size from 2 bytes to 16 bytes,
      because zones_ht_key got a struct net pointer.
      
      Make sure rhashtable_lookup() is not using the padding bytes
      which are not initialized.
      
       BUG: KMSAN: uninit-value in rht_ptr_rcu include/linux/rhashtable.h:376 [inline]
       BUG: KMSAN: uninit-value in __rhashtable_lookup include/linux/rhashtable.h:607 [inline]
       BUG: KMSAN: uninit-value in rhashtable_lookup include/linux/rhashtable.h:646 [inline]
       BUG: KMSAN: uninit-value in rhashtable_lookup_fast include/linux/rhashtable.h:672 [inline]
       BUG: KMSAN: uninit-value in tcf_ct_flow_table_get+0x611/0x2260 net/sched/act_ct.c:329
        rht_ptr_rcu include/linux/rhashtable.h:376 [inline]
        __rhashtable_lookup include/linux/rhashtable.h:607 [inline]
        rhashtable_lookup include/linux/rhashtable.h:646 [inline]
        rhashtable_lookup_fast include/linux/rhashtable.h:672 [inline]
        tcf_ct_flow_table_get+0x611/0x2260 net/sched/act_ct.c:329
        tcf_ct_init+0xa67/0x2890 net/sched/act_ct.c:1408
        tcf_action_init_1+0x6cc/0xb30 net/sched/act_api.c:1425
        tcf_action_init+0x458/0xf00 net/sched/act_api.c:1488
        tcf_action_add net/sched/act_api.c:2061 [inline]
        tc_ctl_action+0x4be/0x19d0 net/sched/act_api.c:2118
        rtnetlink_rcv_msg+0x12fc/0x1410 net/core/rtnetlink.c:6647
        netlink_rcv_skb+0x375/0x650 net/netlink/af_netlink.c:2550
        rtnetlink_rcv+0x34/0x40 net/core/rtnetlink.c:6665
        netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline]
        netlink_unicast+0xf52/0x1260 net/netlink/af_netlink.c:1357
        netlink_sendmsg+0x10da/0x11e0 net/netlink/af_netlink.c:1901
        sock_sendmsg_nosec net/socket.c:730 [inline]
        __sock_sendmsg+0x30f/0x380 net/socket.c:745
        ____sys_sendmsg+0x877/0xb60 net/socket.c:2597
        ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2651
        __sys_sendmsg net/socket.c:2680 [inline]
        __do_sys_sendmsg net/socket.c:2689 [inline]
        __se_sys_sendmsg net/socket.c:2687 [inline]
        __x64_sys_sendmsg+0x307/0x4a0 net/socket.c:2687
        x64_sys_call+0x2dd6/0x3c10 arch/x86/include/generated/asm/syscalls_64.h:47
        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
        do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f
      
      Local variable key created at:
        tcf_ct_flow_table_get+0x4a/0x2260 net/sched/act_ct.c:324
        tcf_ct_init+0xa67/0x2890 net/sched/act_ct.c:1408
      
      Fixes: 88c67aeb ("sched: act_ct: add netns into the key of tcf_ct_flow_table")
      Reported-by: syzbot+1b5e4e187cc586d05ea0@syzkaller.appspotmail.com
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Xin Long <lucien.xin@gmail.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Reviewed-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2191a54f
    • Ma Ke's avatar
      net: usb: sr9700: fix uninitialized variable use in sr_mdio_read · 08f3a5c3
      Ma Ke authored
      It could lead to error happen because the variable res is not updated if
      the call to sr_share_read_word returns an error. In this particular case
      error code was returned and res stayed uninitialized. Same issue also
      applies to sr_read_reg.
      
      This can be avoided by checking the return value of sr_share_read_word
      and sr_read_reg, and propagating the error if the read operation failed.
      
      Found by code review.
      
      Cc: stable@vger.kernel.org
      Fixes: c9b37458 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
      Signed-off-by: default avatarMa Ke <make24@iscas.ac.cn>
      Reviewed-by: default avatarShigeru Yoshida <syoshida@redhat.com>
      Reviewed-by: default avatarHariprasad Kelam <hkelam@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      08f3a5c3
  2. 25 Jul, 2024 29 commits
  3. 24 Jul, 2024 1 commit
    • Linus Torvalds's avatar
      Merge tag 'phy-for-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy · c33ffdb7
      Linus Torvalds authored
      Pull phy updates from Vinod Koul:
       "New Support
         - Samsung Exynos gs101 drd combo phy
         - Qualcomm SC8180x USB uniphy, IPQ9574 QMP PCIe phy
         - Airoha EN7581 PCIe phy
         - Freescale i.MX8Q HSIO SerDes phy
         - Starfive jh7110 dphy tx
      
        Updates:
         - Resume support for j721e-wiz driver
         - Updates to Exynos usbdrd driver
         - Support for optional power domains in g12a usb2-phy driver
         - Debugfs support and updates to zynqmp driver"
      
      * tag 'phy-for-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (56 commits)
        phy: airoha: Add dtime and Rx AEQ IO registers
        dt-bindings: phy: airoha: Add dtime and Rx AEQ IO registers
        dt-bindings: phy: rockchip-emmc-phy: Convert to dtschema
        dt-bindings: phy: qcom,qmp-usb: fix spelling error
        phy: exynos5-usbdrd: support Exynos USBDRD 3.1 combo phy (HS & SS)
        phy: exynos5-usbdrd: convert Vbus supplies to regulator_bulk
        phy: exynos5-usbdrd: convert (phy) register access clock to clk_bulk
        phy: exynos5-usbdrd: convert core clocks to clk_bulk
        phy: exynos5-usbdrd: support isolating HS and SS ports independently
        dt-bindings: phy: samsung,usb3-drd-phy: add gs101 compatible
        phy: core: Fix documentation of of_phy_get
        phy: starfive: Correct the dphy configure process
        phy: zynqmp: Add debugfs support
        phy: zynqmp: Take the phy mutex in xlate
        phy: zynqmp: Only wait for PLL lock "primary" instances
        phy: zynqmp: Store instance instead of type
        phy: zynqmp: Enable reference clock correctly
        phy: cadence-torrent: Check return value on register read
        phy: Fix the cacography in phy-exynos5250-usb2.c
        phy: phy-rockchip-samsung-hdptx: Select CONFIG_MFD_SYSCON
        ...
      c33ffdb7