1. 18 Jan, 2023 7 commits
    • Benjamin Tissoires's avatar
      HID: bpf: rework how programs are attached and stored in the kernel · 4b9a3f49
      Benjamin Tissoires authored
      Previously, HID-BPF was relying on a bpf tracing program to be notified
      when a program was released from userspace. This is error prone, as
      LLVM sometimes inline the function and sometimes not.
      
      So instead of messing up with the bpf prog ref count, we can use the
      bpf_link concept which actually matches exactly what we want:
      - a bpf_link represents the fact that a given program is attached to a
        given HID device
      - as long as the bpf_link has fd opened (either by the userspace program
        still being around or by pinning the bpf object in the bpffs), the
        program stays attached to the HID device
      - once every user has closed the fd, we get called by
        hid_bpf_link_release() that we no longer have any users, and we can
        disconnect the program to the device in 2 passes: first atomically clear
        the bit saying that the link is active, and then calling release_work in
        a scheduled work item.
      
      This solves entirely the problems of BPF tracing not showing up and is
      definitely cleaner.
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      4b9a3f49
    • Benjamin Tissoires's avatar
      selftests: hid: prepare tests for HID_BPF API change · 2574917a
      Benjamin Tissoires authored
      We plan on changing the return value of hid_bpf_attach_prog().
      Instead of returning an error code, it will return an fd to a bpf_link.
      This bpf_link is responsible for the binding between the bpf program and
      the hid device.
      
      Add a fallback mechanism to not break bisections by pinning the program
      when we run this test against the non changed kernel.
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      2574917a
    • Benjamin Tissoires's avatar
      selftests: hid: ensure the program is correctly pinned · d9db1bb5
      Benjamin Tissoires authored
      Turns out that if bpffs was not mounted, the test was silently passing.
      
      So ensure it passes by checking the mount command result.
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      d9db1bb5
    • Benjamin Tissoires's avatar
      selftests: hid: attach/detach 2 bpf programs, not just one · cea6c4d9
      Benjamin Tissoires authored
      Add a second BPF program to attach to the device, as the development of
      this feature showed that we also need to ensure we can detach multiple
      programs to a device (hid_bpf_link->hid_table_index was actually not set
      initially, and this lead to any BPF program not being released except for
      the first one).
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      cea6c4d9
    • Benjamin Tissoires's avatar
      selftests: hid: allow to compile hid_bpf with LLVM · 633ba3be
      Benjamin Tissoires authored
      clang doesn't like to compile a source to the final binary directly:
      
      clang-14: error: cannot specify -o when generating multiple output files
      
      So split the final rule in 2, and ensure we compile all dependencies
      before.
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      633ba3be
    • Benjamin Tissoires's avatar
      selftests: hid: add vmtest.sh · 507806e9
      Benjamin Tissoires authored
      Similar-ish in many points from the script in selftests/bpf, with a few
      differences:
      - relies on boot2container instead of a plain qemu image (meaning that
        we can take any container in a registry as a base)
      - runs in the hid selftest dir, and such uses the test program from there
      - the working directory to store the config is in
        tools/selftests/hid/results
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      507806e9
    • Arnd Bergmann's avatar
      HID: stop drivers from selecting CONFIG_HID · bf7660da
      Arnd Bergmann authored
      There is a mix of drivers using either 'depends on HID' or 'select HID',
      which causes both circular dependencies and missed dependencies for
      a 'select':
      
      WARNING: unment direct dependencies for HID
        Depends on [m]: HID_SUPPORT [=y] && INPUT [=m]
        Selected by [y]:
        - AMD_SFH_HID [=y] && HID_SUPPORT [=y] && (X86_64 || COMPILE_TEST [=y]) && PCI [=y]
        Selected by [m]:
        - I2C_HID_CORE [=m] && HID_SUPPORT [=y]
      
      WARNING: unmet direct dependencies detected for INPUT_FF_MEMLESS
        Depends on [m]: INPUT [=m]
        Selected by [y]:
        - DRAGONRISE_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_DRAGONRISE [=y]
        - HID_MICROSOFT [=y] && HID_SUPPORT [=y] && HID [=y]
        - GREENASIA_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_GREENASIA [=y]
        Selected by [m]:
        - INPUT_ARIZONA_HAPTICS [=m] && INPUT [=m] && INPUT_MISC [=y] && MFD_ARIZONA [=y] && SND_SOC [=m]
        - INPUT_PM8XXX_VIBRATOR [=m] && INPUT [=m] && INPUT_MISC [=y] && (MFD_PM8XXX [=m] || MFD_SPMI_PMIC [=n])
        - INPUT_MAX8997_HAPTIC [=m] && INPUT [=m] && INPUT_MISC [=y] && PWM [=y] && MFD_MAX8997 [=y]
        - INPUT_GPIO_VIBRA [=m] && INPUT [=m] && INPUT_MISC [=y] && (GPIOLIB [=y] || COMPILE_TEST [=y])
        - INPUT_REGULATOR_HAPTIC [=m] && INPUT [=m] && INPUT_MISC [=y] && REGULATOR [=y]
        - INPUT_TWL6040_VIBRA [=m] && INPUT [=m] && INPUT_MISC [=y] && TWL6040_CORE [=y]
        - INPUT_PWM_VIBRA [=m] && INPUT [=m] && INPUT_MISC [=y] && PWM [=y]
        - INPUT_DRV260X_HAPTICS [=m] && INPUT_MISC [=y] && INPUT [=m] && I2C [=y] && (GPIOLIB [=y] || COMPILE_TEST [=y])
        - INPUT_DRV2665_HAPTICS [=m] && INPUT_MISC [=y] && INPUT [=m] && I2C [=y]
        - INPUT_DRV2667_HAPTICS [=m] && INPUT_MISC [=y] && INPUT [=m] && I2C [=y]
        - INPUT_SC27XX_VIBRA [=m] && INPUT [=m] && INPUT_MISC [=y] && (MFD_SC27XX_PMIC [=y] || COMPILE_TEST [=y])
        - HID_MAYFLASH [=m] && HID_SUPPORT [=y] && HID [=y]
      
      Avoid this by changing all HID client drivers to use 'depends on HID'.
      For I2C_HID, this requires a larger rework of the Kconfig description,
      but it hopefully becomes easier to understand without the complex
      I2C_HID_CORE definition.
      
      Fixes: 25621bcc ("HID: Kconfig: split HID support and hid-core compilation")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      bf7660da
  2. 10 Dec, 2022 3 commits
  3. 07 Dec, 2022 3 commits
  4. 21 Nov, 2022 3 commits
  5. 16 Nov, 2022 1 commit
  6. 15 Nov, 2022 14 commits
  7. 11 Nov, 2022 8 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus-2022111101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · 9c730fe1
      Linus Torvalds authored
      Pull HID fixes from Jiri Kosina:
      
       - fix for memory leak (on error path) in Hyper-V driver (Yang
         Yingliang)
      
       - regression fix for handling 3rd barrel switch emulation in Wacom
         driver (Jason Gerecke)
      
      * tag 'for-linus-2022111101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
        HID: wacom: Fix logic used for 3rd barrel switch emulation
        HID: hyperv: fix possible memory leak in mousevsc_probe()
        HID: asus: Remove unused variable in asus_report_tool_width()
      9c730fe1
    • Linus Torvalds's avatar
      Merge tag 'sound-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 64b4aef1
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "Things look calming down, as this contains only a few small fixes:
      
         - Fix for a corner-case bug with SG-buffer page allocation helper
      
         - A regression fix for Roland USB-audio device probe
      
         - A potential memory leak fix at the error path
      
         - Handful quirks and device-specific fixes for HD- and USB-audio"
      
      * tag 'sound-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda: fix potential memleak in 'add_widget_node'
        ALSA: memalloc: Don't fall back for SG-buffer with IOMMU
        ALSA: usb-audio: add quirk to fix Hamedal C20 disconnect issue
        ALSA: hda/realtek: Add Positivo C6300 model quirk
        ALSA: usb-audio: Add DSD support for Accuphase DAC-60
        ALSA: usb-audio: Add quirk entry for M-Audio Micro
        ALSA: hda/hdmi - enable runtime pm for more AMD display audio
        ALSA: usb-audio: Remove redundant workaround for Roland quirk
        ALSA: usb-audio: Yet more regression for for the delayed card registration
        ALSA: hda/ca0132: add quirk for EVGA Z390 DARK
        ALSA: hda: clarify comments on SCF changes
        ALSA: arm: pxa: pxa2xx-ac97-lib: fix return value check of platform_get_irq()
        ALSA: hda/realtek: Add quirk for ASUS Zenbook using CS35L41
      64b4aef1
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2022-11-11' of git://anongit.freedesktop.org/drm/drm · fd979ca6
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Weekly pull request for graphics, mostly amdgpu and i915, with a
        couple of fixes for vc4 and panfrost, panel quirks and a kconfig
        change for rcar-du. Nothing seems to be too strange at this stage.
      
        amdgpu:
         - Fix s/r in amdgpu_vram_mgr_new
         - SMU 13.0.4 update
         - GPUVM TLB race fix
         - DCN 3.1.4 fixes
         - DCN 3.2.x fixes
         - Vega10 fan fix
         - BACO fix for Beige Goby board
         - PSR fix
         - GPU VM PT locking fixes
      
        amdkfd:
         - CRIU fixes
      
        vc4:
         - HDMI fixes to vc4.
      
        panfrost:
         - Make panfrost's uapi header compile with C++.
         - Handle 1 gb boundary correctly in panfrost mmu code.
      
        panel:
         - Add rotation quirks for 2 panels.
      
        rcar-du:
         - DSI Kconfig fix
      
        i915:
         - Fix sg_table handling in map_dma_buf
         - Send PSR update also on invalidate
         - Do not set cache_dirty for DGFX
         - Restore userptr probe_range behaviour"
      
      * tag 'drm-fixes-2022-11-11' of git://anongit.freedesktop.org/drm/drm: (29 commits)
        drm/amd/display: only fill dirty rectangles when PSR is enabled
        drm/amdgpu: disable BACO on special BEIGE_GOBY card
        drm/amdgpu: Drop eviction lock when allocating PT BO
        drm/amdgpu: Unlock bo_list_mutex after error handling
        Revert "drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 properly""
        drm/amd/display: Enforce minimum prefetch time for low memclk on DCN32
        drm/amd/display: Fix gpio port mapping issue
        drm/amd/display: Fix reg timeout in enc314_enable_fifo
        drm/amd/display: Fix FCLK deviation and tool compile issues
        drm/amd/display: Zeromem mypipe heap struct before using it
        drm/amd/display: Update SR watermarks for DCN314
        drm/amdgpu: workaround for TLB seq race
        drm/amdkfd: Fix error handling in criu_checkpoint
        drm/amdkfd: Fix error handling in kfd_criu_restore_events
        drm/amd/pm: update SMU IP v13.0.4 msg interface header
        drm: rcar-du: Fix Kconfig dependency between RCAR_DU and RCAR_MIPI_DSI
        drm/panfrost: Split io-pgtable requests properly
        drm/amdgpu: Fix the lpfn checking condition in drm buddy
        drm: panel-orientation-quirks: Add quirk for Acer Switch V 10 (SW5-017)
        drm: panel-orientation-quirks: Add quirk for Nanote UMPC-01
        ...
      fd979ca6
    • Linus Torvalds's avatar
      Merge tag 'net-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 4bbf3422
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from netfilter, wifi, can and bpf.
      
        Current release - new code bugs:
      
         - can: af_can: can_exit(): add missing dev_remove_pack() of
           canxl_packet
      
        Previous releases - regressions:
      
         - bpf, sockmap: fix the sk->sk_forward_alloc warning
      
         - wifi: mac80211: fix general-protection-fault in
           ieee80211_subif_start_xmit()
      
         - can: af_can: fix NULL pointer dereference in can_rx_register()
      
         - can: dev: fix skb drop check, avoid o-o-b access
      
         - nfnetlink: fix potential dead lock in nfnetlink_rcv_msg()
      
        Previous releases - always broken:
      
         - bpf: fix wrong reg type conversion in release_reference()
      
         - gso: fix panic on frag_list with mixed head alloc types
      
         - wifi: brcmfmac: fix buffer overflow in brcmf_fweh_event_worker()
      
         - wifi: mac80211: set TWT Information Frame Disabled bit as 1
      
         - eth: macsec offload related fixes, make sure to clear the keys from
           memory
      
         - tun: fix memory leaks in the use of napi_get_frags
      
         - tun: call napi_schedule_prep() to ensure we own a napi
      
         - tcp: prohibit TCP_REPAIR_OPTIONS if data was already sent
      
         - ipv6: addrlabel: fix infoleak when sending struct ifaddrlblmsg to
           network
      
         - tipc: fix a msg->req tlv length check
      
         - sctp: clear out_curr if all frag chunks of current msg are pruned,
           avoid list corruption
      
         - mctp: fix an error handling path in mctp_init(), avoid leaks"
      
      * tag 'net-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (101 commits)
        eth: sp7021: drop free_netdev() from spl2sw_init_netdev()
        MAINTAINERS: Move Vivien to CREDITS
        net: macvlan: fix memory leaks of macvlan_common_newlink
        ethernet: tundra: free irq when alloc ring failed in tsi108_open()
        net: mv643xx_eth: disable napi when init rxq or txq failed in mv643xx_eth_open()
        ethernet: s2io: disable napi when start nic failed in s2io_card_up()
        net: atlantic: macsec: clear encryption keys from the stack
        net: phy: mscc: macsec: clear encryption keys when freeing a flow
        stmmac: dwmac-loongson: fix missing of_node_put() while module exiting
        stmmac: dwmac-loongson: fix missing pci_disable_device() in loongson_dwmac_probe()
        stmmac: dwmac-loongson: fix missing pci_disable_msi() while module exiting
        cxgb4vf: shut down the adapter when t4vf_update_port_info() failed in cxgb4vf_open()
        mctp: Fix an error handling path in mctp_init()
        stmmac: intel: Update PCH PTP clock rate from 200MHz to 204.8MHz
        net: cxgb3_main: disable napi when bind qsets failed in cxgb_up()
        net: cpsw: disable napi in cpsw_ndo_open()
        iavf: Fix VF driver counting VLAN 0 filters
        ice: Fix spurious interrupt during removal of trusted VF
        net/mlx5e: TC, Fix slab-out-of-bounds in parse_tc_actions
        net/mlx5e: E-Switch, Fix comparing termination table instance
        ...
      4bbf3422
    • Jakub Kicinski's avatar
      Merge tag 'mlx5-fixes-2022-11-09' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · abd5ac18
      Jakub Kicinski authored
      Saeed Mahameed says:
      
      ====================
      mlx5 fixes 2022-11-02
      
      This series provides bug fixes to mlx5 driver.
      
      * tag 'mlx5-fixes-2022-11-09' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux:
        net/mlx5e: TC, Fix slab-out-of-bounds in parse_tc_actions
        net/mlx5e: E-Switch, Fix comparing termination table instance
        net/mlx5e: TC, Fix wrong rejection of packet-per-second policing
        net/mlx5e: Fix tc acts array not to be dependent on enum order
        net/mlx5e: Fix usage of DMA sync API
        net/mlx5e: Add missing sanity checks for max TX WQE size
        net/mlx5: fw_reset: Don't try to load device in case PCI isn't working
        net/mlx5: E-switch, Set to legacy mode if failed to change switchdev mode
        net/mlx5: Allow async trigger completion execution on single CPU systems
        net/mlx5: Bridge, verify LAG state when adding bond to bridge
      ====================
      
      Link: https://lore.kernel.org/r/20221109184050.108379-1-saeed@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      abd5ac18
    • Jakub Kicinski's avatar
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue · b3bbeba0
      Jakub Kicinski authored
      Tony Nguyen says:
      
      ====================
      Intel Wired LAN Driver Updates 2022-11-09 (ice, iavf)
      
      This series contains updates to ice and iavf drivers.
      
      Norbert stops disabling VF queues that are not enabled for ice driver.
      
      Michal stops accounting of VLAN 0 filter to match expectations of PF
      driver for iavf.
      
      * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue:
        iavf: Fix VF driver counting VLAN 0 filters
        ice: Fix spurious interrupt during removal of trusted VF
      ====================
      
      Link: https://lore.kernel.org/r/20221110003744.201414-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b3bbeba0
    • Wei Yongjun's avatar
      eth: sp7021: drop free_netdev() from spl2sw_init_netdev() · de91b319
      Wei Yongjun authored
      It's not necessary to free netdev allocated with devm_alloc_etherdev()
      and using free_netdev() leads to double free.
      
      Fixes: fd3040b9 ("net: ethernet: Add driver for Sunplus SP7021")
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Link: https://lore.kernel.org/r/20221109150116.2988194-1-weiyongjun@huaweicloud.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      de91b319
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2022-11-10' of... · b7ffd9d9
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2022-11-10' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      - Fix sg_table handling in map_dma_buf (Matthew Auld)
      - Send PSR update also on invalidate (Jouni Högander)
      - Do not set cache_dirty for DGFX (Niranjana Vishwanathapura)
      - Restore userptr probe_range behaviour (Matthew Auld)
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/Y2zCy5q85qE9W0J8@tursulin-desk
      b7ffd9d9
  8. 10 Nov, 2022 1 commit