1. 14 Oct, 2023 6 commits
  2. 13 Oct, 2023 16 commits
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 8cb1f10d
      Linus Torvalds authored
      Pull SCSI fix from James Bottomley:
       "A single tiny fix in the ufs driver core correcting the reversed logic
        in an error message"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: ufs: core: Correct clear TM error log
      8cb1f10d
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-6.6-rc6' of https://github.com/ceph/ceph-client · a1ef447d
      Linus Torvalds authored
      Pull ceph fixes from Ilya Dryomov:
       "Fixes for an overreaching WARN_ON, two error paths and a switch to
        kernel_connect() which recently grown protection against someone using
        BPF to rewrite the address.
      
        All but one marked for stable"
      
      * tag 'ceph-for-6.6-rc6' of https://github.com/ceph/ceph-client:
        ceph: fix type promotion bug on 32bit systems
        libceph: use kernel_connect()
        ceph: remove unnecessary IS_ERR() check in ceph_fname_to_usr()
        ceph: fix incorrect revoked caps assert in ceph_fill_file_size()
      a1ef447d
    • Linus Torvalds's avatar
      Merge tag 'acpi-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · ad7f1bae
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "Add an ACPI EC GPE detection quirk for HP Pavilion Gaming 15-dk1xxx
        and ACPI IRQ override quirks for TongFang GM6BGEQ, GM6BG5Q and
        GM6BG0Q, and for ASUS ExpertBook B1402CBA (Hans de Goede).
      
      * tag 'acpi-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: resource: Add TongFang GM6BGEQ, GM6BG5Q and GM6BG0Q to irq1_edge_low_force_override[]
        ACPI: EC: Add quirk for the HP Pavilion Gaming 15-dk1xxx
        ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CBA
      ad7f1bae
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · b82fbd8f
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - A handful of build fixes
      
       - A fix to avoid mixing up user/kernel-mode breakpoints, which can
         manifest as a hang when mixing k/uprobes with other breakpoint
         sources
      
       - A fix to avoid double-allocting crash kernel memory
      
       - A fix for tracefs syscall name mangling, which was causing syscalls
         not to show up in tracefs
      
       - A fix to the perf driver to enable the hw events when selected, which
         can trigger a BUG on some userspace access patterns
      
      * tag 'riscv-for-linus-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        drivers: perf: Fix panic in riscv SBI mmap support
        riscv: Fix ftrace syscall handling which are now prefixed with __riscv_
        RISC-V: Fix wrong use of CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK
        riscv: kdump: fix crashkernel reserving problem on RISC-V
        riscv: Remove duplicate objcopy flag
        riscv: signal: fix sigaltstack frame size checking
        riscv: errata: andes: Makefile: Fix randconfig build issue
        riscv: Only consider swbp/ss handlers for correct privileged mode
        riscv: kselftests: Fix mm build by removing testcases subdirectory
      b82fbd8f
    • Linus Torvalds's avatar
      Merge tag 'soundwire-6.6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire · 17325a21
      Linus Torvalds authored
      Pull soundwire fix from Vinod Koul:
       "A single fix for making sdw bus irq conditionally built"
      
      * tag 'soundwire-6.6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
        soundwire: bus: Make IRQ handling conditionally built
      17325a21
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-fix-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine · 3439b2a8
      Linus Torvalds authored
      Pull dmaengine fixes from Vinod Koul:
       "Driver fixes for:
      
         - stm32 dma residue calculation and chaining
      
         - stm32 mdma for setting inflight bytes, residue calculation and
           resume abort
      
         - channel request, channel enable and dma error in fsl_edma
      
         - runtime pm imbalance in ste_dma40 driver
      
         - deadlock fix in mediatek driver"
      
      * tag 'dmaengine-fix-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
        dmaengine: fsl-edma: fix all channels requested when call fsl_edma3_xlate()
        dmaengine: stm32-dma: fix residue in case of MDMA chaining
        dmaengine: stm32-dma: fix stm32_dma_prep_slave_sg in case of MDMA chaining
        dmaengine: stm32-mdma: set in_flight_bytes in case CRQA flag is set
        dmaengine: stm32-mdma: use Link Address Register to compute residue
        dmaengine: stm32-mdma: abort resume if no ongoing transfer
        dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe
        dmaengine: mediatek: Fix deadlock caused by synchronize_irq()
        dmaengine: idxd: use spin_lock_irqsave before wait_event_lock_irq
        dmaengine: fsl-edma: fix edma4 channel enable failure on second attempt
        dt-bindings: dmaengine: zynqmp_dma: add xlnx,bus-width required property
        dmaengine: fsl-dma: fix DMA error when enabling sg if 'DONE' bit is set
      3439b2a8
    • Linus Torvalds's avatar
      Merge tag 'media/v6.6-5' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · 7c367d8e
      Linus Torvalds authored
      Pull media fixes from Mauro Carvalho Chehab:
      
       - a core fix: Don't report V4L2_SUBDEV_CAP_STREAMS when API is disabled
      
       - ipu-bridge: Add a missing acpi_dev_put()
      
       - ov8858: fix driver for probe to work after 6.6-rc1
      
       - xilinx-vipp: fix async notifier logic
      
      * tag 'media/v6.6-5' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
        media: i2c: ov8858: Don't set fwnode in the driver
        media: ipu-bridge: Add missing acpi_dev_put() in ipu_bridge_get_ivsc_acpi_dev()
        media: xilinx-vipp: Look for entities also in waiting_list
        media: subdev: Don't report V4L2_SUBDEV_CAP_STREAMS when the streams API is disabled
      7c367d8e
    • Rafael J. Wysocki's avatar
      Merge branches 'acpi-ec' and 'acpi-resource' · 9bc2fb9a
      Rafael J. Wysocki authored
      Merge ACPI EC driver and ACPI resources handlig changes for 6.6-rc6:
      
       - Add EC GPE fixup quirk for HP Pavilion Gaming 15-dk1xxx (Hans de
         Goede).
      
       - Add ACPI IRQ override quirks for TongFang GM6BGEQ, GM6BG5Q and
         GM6BG0Q, and for ASUS ExpertBook B1402CBA (ans de Goede).
      
      * acpi-ec:
        ACPI: EC: Add quirk for the HP Pavilion Gaming 15-dk1xxx
      
      * acpi-resource:
        ACPI: resource: Add TongFang GM6BGEQ, GM6BG5Q and GM6BG0Q to irq1_edge_low_force_override[]
        ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CBA
      9bc2fb9a
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2023-10-13' of git://anongit.freedesktop.org/drm/drm · 10a6e5fe
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Weekly fixes, the core is msm and amdgpu with some scattered fixes
        across vmwgfx, panel and the core stuff.
      
        atomic-helper:
         - Relax checks for unregistered connectors
      
        dma-buf:
         - Work around race condition when retrieving fence timestamp
      
        gem:
         - Avoid OOB access in BO memory range
      
        panel:
         - boe-tv101wun-ml6: Fix flickering
      
        simpledrm:
         - Fix error output
      
        vwmgfx:
         - Fix size calculation in texture-state code
         - Ref GEM BOs in surfaces
      
        msm:
         - PHY/link training reset fix
         - msm8998 - correct highest bank bit
         - skip video mode if timing engine disabled
         - check irq_of_parse_and_map return code
         - add new lines to some prints
         - fail atomic check for max mdp clk test
      
        amdgpu:
         - Seamless boot fix
         - Fix TTM BO resource check
         - SI fix for doorbell handling"
      
      * tag 'drm-fixes-2023-10-13' of git://anongit.freedesktop.org/drm/drm:
        drm/tiny: correctly print `struct resource *` on error
        drm: Do not overrun array in drm_gem_get_pages()
        drm/atomic-helper: relax unregistered connector check
        drm/panel: boe-tv101wum-nl6: Completely pull GPW to VGL before TP term
        drm/amdgpu: fix SI failure due to doorbells allocation
        drm/amdgpu: add missing NULL check
        drm/amd/display: Don't set dpms_off for seamless boot
        drm/vmwgfx: Keep a gem reference to user bos in surfaces
        drm/vmwgfx: fix typo of sizeof argument
        drm/msm/dpu: fail dpu_plane_atomic_check() based on mdp clk limits
        dma-buf: add dma_fence_timestamp helper
        drm/msm/dp: Add newlines to debug printks
        drm/msm/dpu: change _dpu_plane_calc_bw() to use u64 to avoid overflow
        drm/msm/dsi: fix irq_of_parse_and_map() error checking
        drm/msm/dsi: skip the wait for video mode done if not applicable
        drm/msm/mdss: fix highest-bank-bit for msm8998
        drm/msm/dp: do not reinitialize phy unless retry during link training
      10a6e5fe
    • Dave Airlie's avatar
      Merge tag 'amd-drm-fixes-6.6-2023-10-11' of... · 30873697
      Dave Airlie authored
      Merge tag 'amd-drm-fixes-6.6-2023-10-11' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
      
      amd-drm-fixes-6.6-2023-10-11:
      
      amdgpu:
      - Seemless boot fix
      - Fix TTM BO resource check
      - SI fix for doorbell handling
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Alex Deucher <alexander.deucher@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20231012025637.7783-1-alexander.deucher@amd.com
      30873697
    • Dave Airlie's avatar
      Merge tag 'drm-msm-fixes-2023-10-07' of https://gitlab.freedesktop.org/drm/msm into drm-fixes · 7731cb65
      Dave Airlie authored
      Fixes for v6.6-rc5
      
      - fix to not reset the PHY everytime we start link training but only
        do it if link training fails. Without this, the PLL unlocked
        interrupt fires causing "Unexpected DP AUX IRQ 0x01000000 when
        not busy" spam in the logs since last 2-3 cycles
      - correct the highest bank bit to match downstream device tree for
        msm8998
      - skip the video mode wait if the timing engine is not enabled. This
        was introduced after pre_enable flag for DSI video mode panels
        where we would end up waiting for the video mode done interrupt
        even before enabling timing engine causing error spam and long
        bootup times.
      - check the correct return code of irq_of_parse_and_map() in DSI code
      - avoid overflow issues in the dpu bandwidth calculation . This was
        exposed for high resolution displays and a critical fix to avoid
        atomic_check failure
      - minor fix to add new lines in DP print messages.
      - Fix to fail atomic_check() if the resolution exceeds max mdp clk.
        This leads to underflow otherwise if we try to allow that frame.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Rob Clark <robdclark@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGv-HNxQ=VBtZ8geGzYJum9jtManEdbvhcjo_WWF_J9Ziw@mail.gmail.com
      7731cb65
    • Linus Torvalds's avatar
      Merge tag 'for-v6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply · ce583d5f
      Linus Torvalds authored
      Pull power supply fixes from Sebastian Reichel:
      
       - qcom_battmgr: endianness fixes
      
      * tag 'for-v6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply:
        power: supply: qcom_battmgr: fix enable request endianness
        power: supply: qcom_battmgr: fix battery_id type
      ce583d5f
    • Linus Torvalds's avatar
      Merge tag 'block-6.6-2023-10-12' of git://git.kernel.dk/linux · 4ee22162
      Linus Torvalds authored
      Pull block fix from Jens Axboe:
       "Just a single fix for a longstanding regression with using fallocate
        on a block device"
      
      * tag 'block-6.6-2023-10-12' of git://git.kernel.dk/linux:
        block: Don't invalidate pagecache for invalid falloc modes
      4ee22162
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2023-10-12' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · dcad98b1
      Dave Airlie authored
      Short summary of fixes pull:
      
       * atomic-helper: Relax checks for unregistered connectors
       * dma-buf: Work around race condition when retrieving fence timestamp
       * gem: Avoid OOB access in BO memory range
       * panel:
         * boe-tv101wun-ml6: Fix flickering
       * simpledrm: Fix error output
       * vwmgfx:
         * Fix size calculation in texture-state code
         * Ref GEM BOs in surfaces
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Thomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20231012111638.GA25037@linux-uq9g
      dcad98b1
    • Linus Torvalds's avatar
      Merge tag 'cgroup-for-6.6-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup · 20f4757f
      Linus Torvalds authored
      Pull cgroup fixes from Tejun Heo:
      
       - In cgroup1, the `tasks` file could have duplicate pids which can
         trigger a warning in seq_file. Fix it by removing duplicate items
         after sorting
      
       - Comment update
      
      * tag 'cgroup-for-6.6-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
        cgroup: Fix incorrect css_set_rwsem reference in comment
        cgroup: Remove duplicates in cgroup v1 tasks file
      20f4757f
    • Linus Torvalds's avatar
      Merge tag 'wq-for-6.6-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq · e5e11703
      Linus Torvalds authored
      Pull workqueue fixes from Tejun Heo:
      
       - Fix access-after-free in pwq allocation error path
      
       - Implicitly ordered unbound workqueues should lose the implicit
         ordering if an attribute change which isn't compatible with ordered
         operation is requested. However, attribute changes requested through
         the sysfs interface weren't doing that leaving no way to override the
         implicit ordering through the sysfs interface. Fix it.
      
       - Other doc and misc updates
      
      * tag 'wq-for-6.6-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
        workqueue: fix -Wformat-truncation in create_worker
        workqueue: Override implicit ordered attribute in workqueue_apply_unbound_cpumask()
        workqueue: Use the kmem_cache_free() instead of kfree() to release pwq
        workqueue: doc: Fix function and sysfs path errors
        workqueue: Fix UAF report by KASAN in pwq_release_workfn()
      e5e11703
  3. 12 Oct, 2023 18 commits
    • Dmitry Torokhov's avatar
      Revert "Input: psmouse - add delay when deactivating for SMBus mode" · b3572639
      Dmitry Torokhov authored
      This reverts commit 92e24e0e.
      
      While the patch itself is correct, it uncovered an issue with fallback
      to PS/2 mode, where we were leaving psmouse->fast_reconnect handler set
      to psmouse_smbus_reconnect(), which caused crashes.
      
      While discussing various approaches to fix the issue it was noted that
      this patch ass undesired delay in the "fast" resume path of PS/2 device,
      and it would be better to actually use "reset_delay" option defined in
      struct rmi_device_platform_data and have RMI code handle it for SMBus
      transport as well. So this patch is being reverted to deal with crashes
      and a better solution will be merged shortly.
      Reported-by: default avatarThorsten Leemhuis <linux@leemhuis.info>
      Closes: https://lore.kernel.org/all/ca0109fa-c64b-43c1-a651-75b294d750a1@leemhuis.info/Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      b3572639
    • Linus Torvalds's avatar
      Merge tag 'net-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · e8c127b0
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from CAN and BPF.
      
        We have a regression in TC currently under investigation, otherwise
        the things that stand off most are probably the TCP and AF_PACKET
        fixes, with both issues coming from 6.5.
      
        Previous releases - regressions:
      
         - af_packet: fix fortified memcpy() without flex array.
      
         - tcp: fix crashes trying to free half-baked MTU probes
      
         - xdp: fix zero-size allocation warning in xskq_create()
      
         - can: sja1000: always restart the tx queue after an overrun
      
         - eth: mlx5e: again mutually exclude RX-FCS and RX-port-timestamp
      
         - eth: nfp: avoid rmmod nfp crash issues
      
         - eth: octeontx2-pf: fix page pool frag allocation warning
      
        Previous releases - always broken:
      
         - mctp: perform route lookups under a RCU read-side lock
      
         - bpf: s390: fix clobbering the caller's backchain in the trampoline
      
         - phy: lynx-28g: cancel the CDR check work item on the remove path
      
         - dsa: qca8k: fix qca8k driver for Turris 1.x
      
         - eth: ravb: fix use-after-free issue in ravb_tx_timeout_work()
      
         - eth: ixgbe: fix crash with empty VF macvlan list"
      
      * tag 'net-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (54 commits)
        rswitch: Fix imbalance phy_power_off() calling
        rswitch: Fix renesas_eth_sw_remove() implementation
        octeontx2-pf: Fix page pool frag allocation warning
        nfc: nci: assert requested protocol is valid
        af_packet: Fix fortified memcpy() without flex array.
        net: tcp: fix crashes trying to free half-baked MTU probes
        net/smc: Fix pos miscalculation in statistics
        nfp: flower: avoid rmmod nfp crash issues
        net: usb: dm9601: fix uninitialized variable use in dm9601_mdio_read
        ethtool: Fix mod state of verbose no_mask bitset
        net: nfc: fix races in nfc_llcp_sock_get() and nfc_llcp_sock_get_sn()
        mctp: perform route lookups under a RCU read-side lock
        net: skbuff: fix kernel-doc typos
        s390/bpf: Fix unwinding past the trampoline
        s390/bpf: Fix clobbering the caller's backchain in the trampoline
        net/mlx5e: Again mutually exclude RX-FCS and RX-port-timestamp
        net/smc: Fix dependency of SMC on ISM
        ixgbe: fix crash with empty VF macvlan list
        net/mlx5e: macsec: use update_pn flag instead of PN comparation
        net: phy: mscc: macsec: reject PN update requests
        ...
      e8c127b0
    • Lucy Mielke's avatar
      workqueue: fix -Wformat-truncation in create_worker · 5d9c7a1e
      Lucy Mielke authored
      Compiling with W=1 emitted the following warning
      (Compiler: gcc (x86-64, ver. 13.2.1, .config: result of make allyesconfig,
      "Treat warnings as errors" turned off):
      
      kernel/workqueue.c:2188:54: warning: ‘%d’ directive output may be
      	truncated writing between 1 and 10 bytes into a region of size
      	between 5 and 14 [-Wformat-truncation=]
      kernel/workqueue.c:2188:50: note: directive argument in the range
      	[0, 2147483647]
      kernel/workqueue.c:2188:17: note: ‘snprintf’ output between 4 and 23 bytes
      	into a destination of size 16
      
      setting "id_buf" to size 23 will silence the warning, since GCC
      determines snprintf's output to be max. 23 bytes in line 2188.
      
      Please let me know if there are any mistakes in my patch!
      Signed-off-by: default avatarLucy Mielke <lucymielke@icloud.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      5d9c7a1e
    • Waiman Long's avatar
      workqueue: Override implicit ordered attribute in workqueue_apply_unbound_cpumask() · ca10d851
      Waiman Long authored
      Commit 5c0338c6 ("workqueue: restore WQ_UNBOUND/max_active==1
      to be ordered") enabled implicit ordered attribute to be added to
      WQ_UNBOUND workqueues with max_active of 1. This prevented the changing
      of attributes to these workqueues leading to fix commit 0a94efb5
      ("workqueue: implicit ordered attribute should be overridable").
      
      However, workqueue_apply_unbound_cpumask() was not updated at that time.
      So sysfs changes to wq_unbound_cpumask has no effect on WQ_UNBOUND
      workqueues with implicit ordered attribute. Since not all WQ_UNBOUND
      workqueues are visible on sysfs, we are not able to make all the
      necessary cpumask changes even if we iterates all the workqueue cpumasks
      in sysfs and changing them one by one.
      
      Fix this problem by applying the corresponding change made
      to apply_workqueue_attrs_locked() in the fix commit to
      workqueue_apply_unbound_cpumask().
      
      Fixes: 5c0338c6 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered")
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      ca10d851
    • Linus Torvalds's avatar
      Merge tag 'soc-fixes-6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 9a5a1494
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "AngeloGioacchino Del Regno is stepping in as co-maintainer for the
        MediaTek SoC platform and starts by sending some dts fixes for the
        mt8195 platform that had been pending for a while.
      
        On the ixp4xx platform, Krzysztof Halasa steps down as co-maintainer,
        reflecting that Linus Walleij has been handling this on his own for
        the past few years.
      
        Generic RISC-V kernels are now marked as incompatible with the RZ/Five
        platform that requires custom hacks both for managing its DMA bounce
        buffers and for addressing low virtual memory.
      
       Finally, there is one bugfix for the AMDTEE firmware driver to prevent
       a use-after-free bug"
      
      * tag 'soc-fixes-6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
        IXP4xx MAINTAINERS entries
        arm64: dts: mediatek: mt8195: Set DSU PMU status to fail
        arm64: dts: mediatek: fix t-phy unit name
        arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
        arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
        MAINTAINERS: Add Angelo as MediaTek SoC co-maintainer
        soc: renesas: Make ARCH_R9A07G043 (riscv version) depend on NONPORTABLE
        tee: amdtee: fix use-after-free vulnerability in amdtee_close_session
      9a5a1494
    • Alexandre Ghiti's avatar
      drivers: perf: Fix panic in riscv SBI mmap support · 3fec3233
      Alexandre Ghiti authored
      The following panic can happen when mmap is called before the pmu add
      callback which sets the hardware counter index: this happens for example
      with the following command `perf record --no-bpf-event -n kill`.
      
      [   99.461486] CPU: 1 PID: 1259 Comm: perf Tainted: G            E      6.6.0-rc4ubuntu-defconfig #2
      [   99.461669] Hardware name: riscv-virtio,qemu (DT)
      [   99.461748] epc : pmu_sbi_set_scounteren+0x42/0x44
      [   99.462337]  ra : smp_call_function_many_cond+0x126/0x5b0
      [   99.462369] epc : ffffffff809f9d24 ra : ffffffff800f93e0 sp : ff60000082153aa0
      [   99.462407]  gp : ffffffff82395c98 tp : ff6000009a218040 t0 : ff6000009ab3a4f0
      [   99.462425]  t1 : 0000000000000004 t2 : 0000000000000100 s0 : ff60000082153ab0
      [   99.462459]  s1 : 0000000000000000 a0 : ff60000098869528 a1 : 0000000000000000
      [   99.462473]  a2 : 000000000000001f a3 : 0000000000f00000 a4 : fffffffffffffff8
      [   99.462488]  a5 : 00000000000000cc a6 : 0000000000000000 a7 : 0000000000735049
      [   99.462502]  s2 : 0000000000000001 s3 : ffffffff809f9ce2 s4 : ff60000098869528
      [   99.462516]  s5 : 0000000000000002 s6 : 0000000000000004 s7 : 0000000000000001
      [   99.462530]  s8 : ff600003fec98bc0 s9 : ffffffff826c5890 s10: ff600003fecfcde0
      [   99.462544]  s11: ff600003fec98bc0 t3 : ffffffff819e2558 t4 : ff1c000004623840
      [   99.462557]  t5 : 0000000000000901 t6 : ff6000008feeb890
      [   99.462570] status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000003
      [   99.462658] [<ffffffff809f9d24>] pmu_sbi_set_scounteren+0x42/0x44
      [   99.462979] Code: 1060 4785 97bb 00d7 8fd9 9073 1067 6422 0141 8082 (9002) 0013
      [   99.463335] Kernel BUG [#2]
      
      To circumvent this, try to enable userspace access to the hardware counter
      when it is selected in addition to when the event is mapped. And vice-versa
      when the event is stopped/unmapped.
      
      Fixes: cc4c07c8 ("drivers: perf: Implement perf event mmap support in the SBI backend")
      Signed-off-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
      Link: https://lore.kernel.org/r/20231006082010.11963-1-alexghiti@rivosinc.com
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      3fec3233
    • Alexandre Ghiti's avatar
      riscv: Fix ftrace syscall handling which are now prefixed with __riscv_ · a87e7d3e
      Alexandre Ghiti authored
      ftrace creates entries for each syscall in the tracefs but has failed
      since commit 08d0ce30 ("riscv: Implement syscall wrappers") which
      prefixes all riscv syscalls with __riscv_.
      
      So fix this by implementing arch_syscall_match_sym_name() which allows us
      to ignore this prefix.
      
      And also ignore compat syscalls like x86/arm64 by implementing
      arch_trace_is_compat_syscall().
      
      Fixes: 08d0ce30 ("riscv: Implement syscall wrappers")
      Signed-off-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
      Reviewed-by: default avatarSami Tolvanen <samitolvanen@google.com>
      Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Tested-by: default avatarBjörn Töpel <bjorn@rivosinc.com>
      Link: https://lore.kernel.org/r/20231003182407.32198-1-alexghiti@rivosinc.com
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      a87e7d3e
    • Linus Torvalds's avatar
      Merge tag 'pmdomain-v6.6-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm · 9b1ad4ba
      Linus Torvalds authored
      Pull pmdomain fix from Ulf Hansson:
      
       - imx: scu-pd: Correct the DMA2 channel
      
      * tag 'pmdomain-v6.6-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm:
        pmdomain: imx: scu-pd: correct DMA2 channel
      9b1ad4ba
    • Jiexun Wang's avatar
      RISC-V: Fix wrong use of CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK · 07a27665
      Jiexun Wang authored
      If configuration options SOFTIRQ_ON_OWN_STACK and PREEMPT_RT
      are enabled simultaneously under RISC-V architecture,
      it will result in a compilation failure:
      
      arch/riscv/kernel/irq.c:64:6: error: redefinition of 'do_softirq_own_stack'
         64 | void do_softirq_own_stack(void)
            |      ^~~~~~~~~~~~~~~~~~~~
      In file included from ./arch/riscv/include/generated/asm/softirq_stack.h:1,
                       from arch/riscv/kernel/irq.c:15:
      ./include/asm-generic/softirq_stack.h:8:20: note: previous definition of 'do_softirq_own_stack' was here
          8 | static inline void do_softirq_own_stack(void)
            |                    ^~~~~~~~~~~~~~~~~~~~
      
      After changing CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK to CONFIG_SOFTIRQ_ON_OWN_STACK,
      compilation can be successful.
      
      Fixes: dd69d07a ("riscv: stack: Support HAVE_SOFTIRQ_ON_OWN_STACK")
      Reviewed-by: default avatarGuo Ren <guoren@kernel.org>
      Signed-off-by: default avatarJiexun Wang <wangjiexun@tinylab.org>
      Reviewed-by: default avatarSamuel Holland <samuel@sholland.org>
      Link: https://lore.kernel.org/r/20230913052940.374686-1-wangjiexun@tinylab.org
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      07a27665
    • Chen Jiahao's avatar
      riscv: kdump: fix crashkernel reserving problem on RISC-V · 1d6cd214
      Chen Jiahao authored
      When testing on risc-v QEMU environment with "crashkernel="
      parameter enabled, a problem occurred with the following
      message:
      
      [    0.000000] crashkernel low memory reserved: 0xf8000000 - 0x100000000 (128 MB)
      [    0.000000] crashkernel reserved: 0x0000000177e00000 - 0x0000000277e00000 (4096 MB)
      [    0.000000] ------------[ cut here ]------------
      [    0.000000] WARNING: CPU: 0 PID: 0 at kernel/resource.c:779 __insert_resource+0x8e/0xd0
      [    0.000000] Modules linked in:
      [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 6.6.0-rc2-next-20230920 #1
      [    0.000000] Hardware name: riscv-virtio,qemu (DT)
      [    0.000000] epc : __insert_resource+0x8e/0xd0
      [    0.000000]  ra : insert_resource+0x28/0x4e
      [    0.000000] epc : ffffffff80017344 ra : ffffffff8001742e sp : ffffffff81203db0
      [    0.000000]  gp : ffffffff812ece98 tp : ffffffff8120dac0 t0 : ff600001f7ff2b00
      [    0.000000]  t1 : 0000000000000000 t2 : 3428203030303030 s0 : ffffffff81203dc0
      [    0.000000]  s1 : ffffffff81211e18 a0 : ffffffff81211e18 a1 : ffffffff81289380
      [    0.000000]  a2 : 0000000277dfffff a3 : 0000000177e00000 a4 : 0000000177e00000
      [    0.000000]  a5 : ffffffff81289380 a6 : 0000000277dfffff a7 : 0000000000000078
      [    0.000000]  s2 : ffffffff81289380 s3 : ffffffff80a0bac8 s4 : ff600001f7ff2880
      [    0.000000]  s5 : 0000000000000280 s6 : 8000000a00006800 s7 : 000000000000007f
      [    0.000000]  s8 : 0000000080017038 s9 : 0000000080038ea0 s10: 0000000000000000
      [    0.000000]  s11: 0000000000000000 t3 : ffffffff80a0bc00 t4 : ffffffff80a0bc00
      [    0.000000]  t5 : ffffffff80a0bbd0 t6 : ffffffff80a0bc00
      [    0.000000] status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000003
      [    0.000000] [<ffffffff80017344>] __insert_resource+0x8e/0xd0
      [    0.000000] ---[ end trace 0000000000000000 ]---
      [    0.000000] Failed to add a Crash kernel resource at 177e00000
      
      The crashkernel memory has been allocated successfully, whereas
      it failed to insert into iomem_resource. This is due to the
      unique reserving logic in risc-v arch specific code, i.e.
      crashk_res/crashk_low_res will be added into iomem_resource
      later in init_resources(), which is not aligned with current
      unified reserving logic in reserve_crashkernel_{generic,low}()
      and therefore leads to the failure of crashkernel reservation.
      
      Removing the arch specific code within #ifdef CONFIG_KEXEC_CORE
      in init_resources() to fix above problem.
      
      Fixes: 31549153088e ("riscv: kdump: use generic interface to simplify crashkernel reservation")
      Signed-off-by: default avatarChen Jiahao <chenjiahao16@huawei.com>
      Link: https://lore.kernel.org/r/20230925024333.730964-1-chenjiahao16@huawei.com
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      1d6cd214
    • Song Shuai's avatar
      riscv: Remove duplicate objcopy flag · 505b0295
      Song Shuai authored
      There are two duplicate `-O binary` flags when objcopying from vmlinux
      to Image/xipImage.
      
      RISC-V set `-O binary` flag in both OBJCOPYFLAGS in the top-level riscv
      Makefile and OBJCOPYFLAGS_* in the boot/Makefile, and the objcopy cmd
      in Kbuild would join them together.
      
      The `-O binary` flag is only needed for objcopying Image, so remove the
      OBJCOPYFLAGS in the top-level riscv Makefile.
      
      Fixes: c0fbcd99 ("RISC-V: Build flat and compressed kernel images")
      Signed-off-by: default avatarSong Shuai <songshuaishuai@tinylab.org>
      Reviewed-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      Link: https://lore.kernel.org/r/20230914091334.1458542-1-songshuaishuai@tinylab.org
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      505b0295
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 82a040a8
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
       "Some pin control fixes for v6.6 which have been stacking up in my
        tree.
      
        Dmitry's fix to some locking in the core is the most substantial, that
        was a really neat fix.
      
        The rest is the usual assorted spray of minor driver fixes.
      
         - Drop some minor code causing warnings in the Lantiq driver
      
         - Fix out of bounds write in the Nuvoton driver
      
         - Fix lost IRQs with CONFIG_PM in the Starfive driver
      
         - Fix a locking issue in find_pinctrl()
      
         - Revert a regressive Tegra debug patch
      
         - Fix the Renesas RZN1 pin muxing"
      
      * tag 'pinctrl-v6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: renesas: rzn1: Enable missing PINMUX
        Revert "pinctrl: tegra: Add support to display pin function"
        pinctrl: avoid unsafe code pattern in find_pinctrl()
        pinctrl: starfive: jh7110: Add system pm ops to save and restore context
        pinctrl: starfive: jh7110: Fix failure to set irq after CONFIG_PM is enabled
        pinctrl: nuvoton: wpcm450: fix out of bounds write
        pinctrl: lantiq: Remove unsued declaration ltq_pinctrl_unregister()
      82a040a8
    • Zqiang's avatar
      workqueue: Use the kmem_cache_free() instead of kfree() to release pwq · 7b42f401
      Zqiang authored
      Currently, the kfree() be used for pwq objects allocated with
      kmem_cache_alloc() in alloc_and_link_pwqs(), this isn't wrong.
      but usually, use "trace_kmem_cache_alloc/trace_kmem_cache_free"
      to track memory allocation and free. this commit therefore use
      kmem_cache_free() instead of kfree() in alloc_and_link_pwqs()
      and also consistent with release of the pwq in rcu_free_pwq().
      Signed-off-by: default avatarZqiang <qiang.zhang1211@gmail.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      7b42f401
    • WangJinchao's avatar
      workqueue: doc: Fix function and sysfs path errors · bd9e7326
      WangJinchao authored
      alloc_ordered_queue -> alloc_ordered_workqueue
      /sys/devices/virtual/WQ_NAME/
          -> /sys/devices/virtual/workqueue/WQ_NAME/
      Signed-off-by: default avatarWangJinchao <wangjinchao@xfusion.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      bd9e7326
    • Waiman Long's avatar
      cgroup: Fix incorrect css_set_rwsem reference in comment · 13cc9ee8
      Waiman Long authored
      Since commit f0d9a5f1 ("cgroup: make css_set_rwsem a spinlock
      and rename it to css_set_lock"), css_set_rwsem has been replaced by
      css_set_lock. That commit, however, missed the css_set_rwsem reference
      in include/linux/cgroup-defs.h. Fix that by changing it to css_set_lock
      as well.
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      13cc9ee8
    • Andy Chiu's avatar
      riscv: signal: fix sigaltstack frame size checking · 14a270bf
      Andy Chiu authored
      The alternative stack checking in get_sigframe introduced by the Vector
      support is not needed and has a problem. It is not needed as we have
      already validate it at the beginning of the function if we are already
      on an altstack. If not, the size of an altstack is always validated at
      its allocation stage with sigaltstack_size_valid().
      
      Besides, we must only regard the size of an altstack if the handler of a
      signal is registered with SA_ONSTACK. So, blindly checking overflow of
      an altstack if sas_ss_size not equals to zero will check against wrong
      signal handlers if only a subset of signals are registered with
      SA_ONSTACK.
      
      Fixes: 8ee0b418 ("riscv: signal: Add sigcontext save/restore for vector")
      Reported-by: default avatarPrashanth Swaminathan <prashanthsw@google.com>
      Signed-off-by: default avatarAndy Chiu <andy.chiu@sifive.com>
      Link: https://lore.kernel.org/r/20230822164904.21660-1-andy.chiu@sifive.comSigned-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      14a270bf
    • Krzysztof Hałasa's avatar
      IXP4xx MAINTAINERS entries · 26de1483
      Krzysztof Hałasa authored
      Update MAINTAINERS entries for Intel IXP4xx SoCs.
      
      Linus has been handling all IXP4xx stuff since 2019 or so.
      Signed-off-by: default avatarKrzysztof Hałasa <khalasa@piap.pl>
      Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Acked-by: default avatarDeepak Saxena <dsaxena@plexity.net>
      Link: https://lore.kernel.org/r/m3ttqxu4ru.fsf@t19.piap.plSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      26de1483
    • Paolo Abeni's avatar
      Merge branch 'rswitch-fix-issues-on-specific-conditions' · b91e8403
      Paolo Abeni authored
      Yoshihiro Shimoda says:
      
      ====================
      rswitch: Fix issues on specific conditions
      
      This patch series fix some issues of rswitch driver on specific
      condtions.
      ====================
      
      Link: https://lore.kernel.org/r/20231010124858.183891-1-yoshihiro.shimoda.uh@renesas.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      b91e8403