Changelog in Linux kernel 6.13.3

 
accel/ivpu: Clear runtime_error after pm_runtime_resume_and_get() fails [+ + +]
Author: Jacek Lawrynowicz <[email protected]>
Date:   Wed Jan 29 13:40:08 2025 +0100

    accel/ivpu: Clear runtime_error after pm_runtime_resume_and_get() fails
    
    commit f2bc2afe34c107a02ce829a4039e85514feafe55 upstream.
    
    pm_runtime_resume_and_get() sets dev->power.runtime_error that causes
    all subsequent pm_runtime_get_sync() calls to fail.
    Clear the runtime_error using pm_runtime_set_suspended(), so the driver
    doesn't have to be reloaded to recover when the NPU fails to boot during
    runtime resume.
    
    Fixes: 7d4b4c74432d ("accel/ivpu: Remove suspend_reschedule_counter")
    Cc: [email protected] # v6.11+
    Reviewed-by: Maciej Falkowski <[email protected]>
    Reviewed-by: Jeffrey Hugo <[email protected]>
    Signed-off-by: Jacek Lawrynowicz <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

accel/ivpu: Fix error handling in ivpu_boot() [+ + +]
Author: Jacek Lawrynowicz <[email protected]>
Date:   Wed Jan 29 13:40:07 2025 +0100

    accel/ivpu: Fix error handling in ivpu_boot()
    
    commit f3be8a9b1afffbcc70f8e41063b151b1038d7813 upstream.
    
    Ensure IRQs and IPC are properly disabled if HW sched or DCT
    initialization fails.
    
    Fixes: cc3c72c7e610 ("accel/ivpu: Refactor failure diagnostics during boot")
    Cc: [email protected] # v6.13+
    Reviewed-by: Karol Wachowski <[email protected]>
    Reviewed-by: Jeffrey Hugo <[email protected]>
    Signed-off-by: Jacek Lawrynowicz <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

accel/ivpu: Fix error handling in recovery/reset [+ + +]
Author: Jacek Lawrynowicz <[email protected]>
Date:   Wed Jan 29 13:40:09 2025 +0100

    accel/ivpu: Fix error handling in recovery/reset
    
    commit 41a2d8286c905614f29007f1bc8e652d54654b82 upstream.
    
    Disable runtime PM for the duration of reset/recovery so it is possible
    to set the correct runtime PM state depending on the outcome of the
    `ivpu_resume()`. Don’t suspend or reset the HW if the NPU is suspended
    when the reset/recovery is requested. Also, move common reset/recovery
    code to separate functions for better code readability.
    
    Fixes: 27d19268cf39 ("accel/ivpu: Improve recovery and reset support")
    Cc: [email protected] # v6.8+
    Reviewed-by: Maciej Falkowski <[email protected]>
    Reviewed-by: Jeffrey Hugo <[email protected]>
    Signed-off-by: Jacek Lawrynowicz <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

accel/ivpu: Fix Qemu crash when running in passthrough [+ + +]
Author: Jacek Lawrynowicz <[email protected]>
Date:   Wed Nov 6 11:55:49 2024 +0100

    accel/ivpu: Fix Qemu crash when running in passthrough
    
    commit 901dd2617c9c3554b2449c8844b6338009112fcf upstream.
    
    Restore PCI state after putting the NPU in D0.
    Restoring state before powering up the device caused a Qemu crash
    if NPU was running in passthrough mode and recovery was performed.
    
    Fixes: 3534eacbf101 ("accel/ivpu: Fix PCI D0 state entry in resume")
    Cc: [email protected] # v6.8+
    Reviewed-by: Karol Wachowski <[email protected]>
    Signed-off-by: Jacek Lawrynowicz <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ACPI: PRM: Remove unnecessary strict handler address checks [+ + +]
Author: Aubrey Li <[email protected]>
Date:   Sun Jan 26 10:22:50 2025 +0800

    ACPI: PRM: Remove unnecessary strict handler address checks
    
    commit 7f5704b6a143b8eca640cba820968e798d065e91 upstream.
    
    Commit 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM
    handler and context") added unnecessary strict handler address checks,
    causing the PRM module to fail in translating memory error addresses.
    
    Both static data buffer address and ACPI parameter buffer address may
    be NULL if they are not needed, as described in section 4.1.2 PRM Handler
    Information Structure of Platform Runtime Mechanism specification [1].
    
    Here are two examples from real hardware:
    
    ----PRMT.dsl----
    
    - staic data address is not used
    [10Ch 0268   2]                     Revision : 0000
    [10Eh 0270   2]                       Length : 002C
    [110h 0272  16]                 Handler GUID : F6A58D47-E04F-4F5A-86B8-2A50D4AA109B
    [120h 0288   8]              Handler address : 0000000065CE51F4
    [128h 0296   8]           Satic Data Address : 0000000000000000
    [130h 0304   8]       ACPI Parameter Address : 000000006522A718
    
    - ACPI parameter address is not used
    [1B0h 0432   2]                     Revision : 0000
    [1B2h 0434   2]                       Length : 002C
    [1B4h 0436  16]                 Handler GUID : 657E8AE6-A8FC-4877-BB28-42E7DE1899A5
    [1C4h 0452   8]              Handler address : 0000000065C567C8
    [1CCh 0460   8]           Satic Data Address : 000000006113FB98
    [1D4h 0468   8]       ACPI Parameter Address : 0000000000000000
    
    Fixes: 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context")
    Reported-and-tested-by: Shi Liu <[email protected]>
    Cc: All applicable <[email protected]>
    Signed-off-by: Aubrey Li <[email protected]>
    Link: https://uefi.org/sites/default/files/resources/Platform%20Runtime%20Mechanism%20-%20with%20legal%20notice.pdf # [1]
    Reviewed-by: Koba Ko <[email protected]>
    Acked-by: Ard Biesheuvel <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    [ rjw: Minor changelog edits ]
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ACPI: property: Fix return value for nval == 0 in acpi_data_prop_read() [+ + +]
Author: Andy Shevchenko <[email protected]>
Date:   Mon Feb 3 21:46:29 2025 +0200

    ACPI: property: Fix return value for nval == 0 in acpi_data_prop_read()
    
    [ Upstream commit ab930483eca9f3e816c35824b5868599af0c61d7 ]
    
    While analysing code for software and OF node for the corner case when
    caller asks to read zero items in the supposed to be an array of values
    I found that ACPI behaves differently to what OF does, i.e.
    
     1. It returns -EINVAL when caller asks to read zero items from integer
        array, while OF returns 0, if no other errors happened.
    
     2. It returns -EINVAL when caller asks to read zero items from string
        array, while OF returns -ENODATA, if no other errors happened.
    
    Amend ACPI implementation to follow what OF does.
    
    Fixes: b31384fa5de3 ("Driver core: Unified device properties interface for platform firmware")
    Signed-off-by: Andy Shevchenko <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    [ rjw: Added empty line after a conditional ]
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
ALSA: hda/realtek: Enable headset mic on Positivo C6400 [+ + +]
Author: Edson Juliano Drosdeck <[email protected]>
Date:   Tue Jan 14 14:06:19 2025 -0300

    ALSA: hda/realtek: Enable headset mic on Positivo C6400
    
    commit 1aec3ed2e3e1512aba15e7e790196a44efd5f0a7 upstream.
    
    Positivo C6400 is equipped with ALC269VB, and it needs
    ALC269VB_FIXUP_ASUS_ZENBOOK quirk to make its headset mic work.
    Also must to limits the microphone boost.
    
    Signed-off-by: Edson Juliano Drosdeck <[email protected]>
    Cc: <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: hda/realtek: Enable Mute LED on HP Laptop 14s-fq1xxx [+ + +]
Author: Sebastian Wiese-Wagner <[email protected]>
Date:   Mon Jan 20 19:12:40 2025 +0100

    ALSA: hda/realtek: Enable Mute LED on HP Laptop 14s-fq1xxx
    
    commit 711aad3c43a9853657e00225466d204e46ae528b upstream.
    
    This HP Laptop uses ALC236 codec with COEF 0x07 controlling the mute
    LED. Enable existing quirk for this device.
    
    Signed-off-by: Sebastian Wiese-Wagner <[email protected]>
    Cc: <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: hda/realtek: Fix quirk matching for Legion Pro 7 [+ + +]
Author: Takashi Iwai <[email protected]>
Date:   Sat Jan 25 13:04:40 2025 +0100

    ALSA: hda/realtek: Fix quirk matching for Legion Pro 7
    
    commit 0f3a822ae2254a1e7ce3a130a1efd94e2cab73ee upstream.
    
    The recent cleanup of the quirk table entries with the codec ID
    matching caused a regression on some Lenovo Legion 7 models with PCI
    SSID 17aa:386f: it assumed wrongly as if the codec SSID on the machine
    were also 17aa:386f, but in this case, it was 17aa:38a8.  This made
    the binding with a wrong sub-codec, instead of TAS2781, the Cirrus
    codec was bound.
    
    For addressing the regression, correct the quirk entry to the right
    value 17aa:38a8.
    
    Note that this makes the entry appearing in an unsorted position.
    This exception is needed because the entry must match before the PCI
    SSID 17aa:386f.
    
    Also there is another entry for 17aa:38a8, but the latter is for PCI
    SSID matching while the new entry is for the codec SSID matching.
    
    Fixes: 504f052aa343 ("ALSA: hda/realtek: Use codec SSID matching for Lenovo devices")
    Reported-and-tested-by: Samantha Glocker <[email protected]>
    Closes: https://lore.kernel.org/CAGPQRHYd48U__UKYj2jJnT4+dnNNoWRBi+wj6zPRn=JpNMBUrg@mail.gmail.com
    Cc: <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: hda/realtek: Workaround for resume on Dell Venue 11 Pro 7130 [+ + +]
Author: Takashi Iwai <[email protected]>
Date:   Thu Jan 30 13:32:59 2025 +0100

    ALSA: hda/realtek: Workaround for resume on Dell Venue 11 Pro 7130
    
    commit 8c2fa44132e8cd1b05c77a705adb8d1f5a5daf3f upstream.
    
    It was reported that the headphone output on Dell Venue 11 Pro 7130
    becomes mono after PM resume.  The cause seems to be the BIOS setting
    up the codec COEF 0x0d bit 0x40 wrongly by some reason, and restoring
    the original value 0x2800 fixes the problem.
    
    This patch adds the quirk entry to perform the COEF restore.
    
    Cc: <[email protected]>
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=219697
    Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1235686
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: hda: Fix headset detection failure due to unstable sort [+ + +]
Author: Kuan-Wei Chiu <[email protected]>
Date:   Wed Jan 29 00:54:15 2025 +0800

    ALSA: hda: Fix headset detection failure due to unstable sort
    
    commit 3b4309546b48fc167aa615a2d881a09c0a97971f upstream.
    
    The auto_parser assumed sort() was stable, but the kernel's sort() uses
    heapsort, which has never been stable. After commit 0e02ca29a563
    ("lib/sort: optimize heapsort with double-pop variation"), the order of
    equal elements changed, causing the headset to fail to work.
    
    Fix the issue by recording the original order of elements before
    sorting and using it as a tiebreaker for equal elements in the
    comparison function.
    
    Fixes: b9030a005d58 ("ALSA: hda - Use standard sort function in hda_auto_parser.c")
    Reported-by: Austrum <[email protected]>
    Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219158
    Tested-by: Austrum <[email protected]>
    Cc: [email protected]
    Signed-off-by: Kuan-Wei Chiu <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
APEI: GHES: Have GHES honor the panic= setting [+ + +]
Author: Borislav Petkov <[email protected]>
Date:   Mon Jan 13 13:52:24 2025 +0100

    APEI: GHES: Have GHES honor the panic= setting
    
    [ Upstream commit 5c0e00a391dd0099fe95991bb2f962848d851916 ]
    
    The GHES driver overrides the panic= setting by force-rebooting the
    system after a fatal hw error has been reported. The intent being that
    such an error would be reported earlier.
    
    However, this is not optimal when a hard-to-debug issue requires long
    time to reproduce and when that happens, the box will get rebooted after
    30 seconds and thus destroy the whole hw context of when the error
    happened.
    
    So rip out the default GHES panic timeout and honor the global one.
    
    In the panic disabled (panic=0) case, the error will still be logged to
    dmesg for later inspection and if panic after a hw error is really
    required, then that can be controlled the usual way - use panic= on the
    cmdline or set it in the kernel .config's CONFIG_PANIC_TIMEOUT.
    
    Reported-by: Feng Tang <[email protected]>
    Signed-off-by: Borislav Petkov (AMD) <[email protected]>
    Reviewed-by: Feng Tang <[email protected]>
    Reviewed-by: Ira Weiny <[email protected]>
    Link: https://patch.msgid.link/20250113125224.GFZ4UMiNtWIJvgpveU@fat_crate.local
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
arm64/kvm: Configure HYP TCR.PS/DS based on host stage1 [+ + +]
Author: Ard Biesheuvel <[email protected]>
Date:   Thu Dec 12 09:18:45 2024 +0100

    arm64/kvm: Configure HYP TCR.PS/DS based on host stage1
    
    commit f0da16992aef7e246b2f3bba1492e3a52c38ca0e upstream.
    
    When the host stage1 is configured for LPA2, the value currently being
    programmed into TCR_EL2.T0SZ may be invalid unless LPA2 is configured
    at HYP as well.  This means kvm_lpa2_is_enabled() is not the right
    condition to test when setting TCR_EL2.DS, as it will return false if
    LPA2 is only available for stage 1 but not for stage 2.
    
    Similary, programming TCR_EL2.PS based on a limited IPA range due to
    lack of stage2 LPA2 support could potentially result in problems.
    
    So use lpa2_is_enabled() instead, and set the PS field according to the
    host's IPS, which is capped at 48 bits if LPA2 support is absent or
    disabled. Whether or not we can make meaningful use of such a
    configuration is a different question.
    
    Cc: [email protected]
    Signed-off-by: Ard Biesheuvel <[email protected]>
    Acked-by: Marc Zyngier <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Will Deacon <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
arm64/mm: Ensure adequate HUGE_MAX_HSTATE [+ + +]
Author: Anshuman Khandual <[email protected]>
Date:   Mon Dec 2 12:14:07 2024 +0530

    arm64/mm: Ensure adequate HUGE_MAX_HSTATE
    
    [ Upstream commit 1e5823c8e86de83a43d59a522b4de29066d3b306 ]
    
    This asserts that HUGE_MAX_HSTATE is sufficient enough preventing potential
    hugetlb_max_hstate runtime overflow in hugetlb_add_hstate() thus triggering
    a BUG_ON() there after.
    
    Cc: Catalin Marinas <[email protected]>
    Cc: Will Deacon <[email protected]>
    Cc: Ard Biesheuvel <[email protected]>
    Cc: Ryan Roberts <[email protected]>
    Cc: Mark Rutland <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Signed-off-by: Anshuman Khandual <[email protected]>
    Reviewed-by: Ryan Roberts <[email protected]>
    Reviewed-by: Gavin Shan <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Will Deacon <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64/mm: Override PARange for !LPA2 and use it consistently [+ + +]
Author: Ard Biesheuvel <[email protected]>
Date:   Thu Dec 12 09:18:44 2024 +0100

    arm64/mm: Override PARange for !LPA2 and use it consistently
    
    commit 62cffa496aac0c2c4eeca00d080058affd7a0172 upstream.
    
    When FEAT_LPA{,2} are not implemented, the ID_AA64MMFR0_EL1.PARange and
    TCR.IPS values corresponding with 52-bit physical addressing are
    reserved.
    
    Setting the TCR.IPS field to 0b110 (52-bit physical addressing) has side
    effects, such as how the TTBRn_ELx.BADDR fields are interpreted, and so
    it is important that disabling FEAT_LPA2 (by overriding the
    ID_AA64MMFR0.TGran fields) also presents a PARange field consistent with
    that.
    
    So limit the field to 48 bits unless LPA2 is enabled, and update
    existing references to use the override consistently.
    
    Fixes: 352b0395b505 ("arm64: Enable 52-bit virtual addressing for 4k and 16k granule configs")
    Cc: [email protected]
    Signed-off-by: Ard Biesheuvel <[email protected]>
    Acked-by: Marc Zyngier <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Will Deacon <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64/mm: Reduce PA space to 48 bits when LPA2 is not enabled [+ + +]
Author: Ard Biesheuvel <[email protected]>
Date:   Thu Dec 12 09:18:43 2024 +0100

    arm64/mm: Reduce PA space to 48 bits when LPA2 is not enabled
    
    commit bf74bb73cd87c64bd5afc1fd4b749029997b6170 upstream.
    
    Currently, LPA2 kernel support implies support for up to 52 bits of
    physical addressing, and this is reflected in global definitions such as
    PHYS_MASK_SHIFT and MAX_PHYSMEM_BITS.
    
    This is potentially problematic, given that LPA2 hardware support is
    modeled as a CPU feature which can be overridden, and with LPA2 hardware
    support turned off, attempting to map physical regions with address bits
    [51:48] set (which may exist on LPA2 capable systems booting with
    arm64.nolva) will result in corrupted mappings with a truncated output
    address and bogus shareability attributes.
    
    This means that the accepted physical address range in the mapping
    routines should be at most 48 bits wide when LPA2 support is configured
    but not enabled at runtime.
    
    Fixes: 352b0395b505 ("arm64: Enable 52-bit virtual addressing for 4k and 16k granule configs")
    Cc: [email protected]
    Reviewed-by: Anshuman Khandual <[email protected]>
    Signed-off-by: Ard Biesheuvel <[email protected]>
    Acked-by: Marc Zyngier <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Will Deacon <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
arm64/sme: Move storage of reg_smidr to __cpuinfo_store_cpu() [+ + +]
Author: Mark Brown <[email protected]>
Date:   Tue Dec 17 21:59:48 2024 +0000

    arm64/sme: Move storage of reg_smidr to __cpuinfo_store_cpu()
    
    commit d3c7c48d004f6c8d892f39b5d69884fd0fe98c81 upstream.
    
    In commit 892f7237b3ff ("arm64: Delay initialisation of
    cpuinfo_arm64::reg_{zcr,smcr}") we moved access to ZCR, SMCR and SMIDR
    later in the boot process in order to ensure that we don't attempt to
    interact with them if SVE or SME is disabled on the command line.
    Unfortunately when initialising the boot CPU in init_cpu_features() we work
    on a copy of the struct cpuinfo_arm64 for the boot CPU used only during
    boot, not the percpu copy used by the sysfs code. The expectation of the
    feature identification code was that the ID registers would be read in
    __cpuinfo_store_cpu() and the values not modified by init_cpu_features().
    
    The main reason for the original change was to avoid early accesses to
    ZCR on practical systems that were seen shipping with SVE reported in ID
    registers but traps enabled at EL3 and handled as fatal errors, SME was
    rolled in due to the similarity with SVE. Since then we have removed the
    early accesses to ZCR and SMCR in commits:
    
      abef0695f9665c3d ("arm64/sve: Remove ZCR pseudo register from cpufeature code")
      391208485c3ad50f ("arm64/sve: Remove SMCR pseudo register from cpufeature code")
    
    so only the SMIDR_EL1 part of the change remains. Since SMIDR_EL1 is
    only trapped via FEAT_IDST and not the SME trap it is less likely to be
    affected by similar issues, and the factors that lead to issues with SVE
    are less likely to apply to SME.
    
    Since we have not yet seen practical SME systems that need to use a
    command line override (and are only just beginning to see SME systems at
    all) and the ID register read is much more likely to be safe let's just
    store SMIDR_EL1 along with all the other ID register reads in
    __cpuinfo_store_cpu().
    
    This issue wasn't apparent when testing on emulated platforms that do not
    report values in SMIDR_EL1.
    
    Fixes: 892f7237b3ff ("arm64: Delay initialisation of cpuinfo_arm64::reg_{zcr,smcr}")
    Signed-off-by: Mark Brown <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Will Deacon <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
arm64: dts: mediatek: mt8183: Disable DPI display output by default [+ + +]
Author: Chen-Yu Tsai <[email protected]>
Date:   Fri Oct 25 15:56:27 2024 +0800

    arm64: dts: mediatek: mt8183: Disable DPI display output by default
    
    commit 93a680af46436780fd64f4e856a4cfa8b393be6e upstream.
    
    This reverts commit 377548f05bd0905db52a1d50e5b328b9b4eb049d.
    
    Most SoC dtsi files have the display output interfaces disabled by
    default, and only enabled on boards that utilize them. The MT8183
    has it backwards: the display outputs are left enabled by default,
    and only disabled at the board level.
    
    Reverse the situation for the DPI output so that it follows the
    normal scheme. For ease of backporting the DSI output is handled
    in a separate patch.
    
    Fixes: 009d855a26fd ("arm64: dts: mt8183: add dpi node to mt8183")
    Fixes: 377548f05bd0 ("arm64: dts: mediatek: mt8183-kukui: Disable DPI display interface")
    Cc: [email protected]
    Signed-off-by: Chen-Yu Tsai <[email protected]>
    Reviewed-by: Fei Shao <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: mediatek: mt8183: Disable DSI display output by default [+ + +]
Author: Chen-Yu Tsai <[email protected]>
Date:   Fri Oct 25 15:56:28 2024 +0800

    arm64: dts: mediatek: mt8183: Disable DSI display output by default
    
    commit 26f6e91fa29a58fdc76b47f94f8f6027944a490c upstream.
    
    Most SoC dtsi files have the display output interfaces disabled by
    default, and only enabled on boards that utilize them. The MT8183
    has it backwards: the display outputs are left enabled by default,
    and only disabled at the board level.
    
    Reverse the situation for the DSI output so that it follows the
    normal scheme. For ease of backporting the DPI output is handled
    in a separate patch.
    
    Fixes: 88ec840270e6 ("arm64: dts: mt8183: Add dsi node")
    Fixes: 19b6403f1e2a ("arm64: dts: mt8183: add mt8183 pumpkin board")
    Cc: [email protected]
    Signed-off-by: Chen-Yu Tsai <[email protected]>
    Reviewed-by: Fei Shao <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sdx75: Fix MPSS memory length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:54:09 2024 +0100

    arm64: dts: qcom: sdx75: Fix MPSS memory length
    
    commit 9a27f0e1869e992e4107e2af8ec348e1a3b9d4d5 upstream.
    
    The address space in MPSS/Modem PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB) which has a length of 0x10000.  Value of 0x4040 was
    copied from older DTS, but it grew since then.
    
    This should have no functional impact on Linux users, because PAS loader
    does not use this address space at all.
    
    Cc: [email protected]
    Fixes: 41c72f36b286 ("arm64: dts: qcom: sdx75: Add remoteproc node")
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-20-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm6115: Fix ADSP memory base and length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:54:12 2024 +0100

    arm64: dts: qcom: sm6115: Fix ADSP memory base and length
    
    commit 47d178caac3ec13f5f472afda25fcfdfaa00d0da upstream.
    
    The address space in ADSP PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB): 0x0a40_0000 with length of 0x4040.
    
    0x0ab0_0000, value used so far, is the SSC_QUPV3 block, so entierly
    unrelated.
    
    Correct the base address and length, which should have no functional
    impact on Linux users, because PAS loader does not use this address
    space at all.
    
    Cc: [email protected]
    Fixes: 96ce9227fdbc ("arm64: dts: qcom: sm6115: Add remoteproc nodes")
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-23-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm6115: Fix CDSP memory length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:54:11 2024 +0100

    arm64: dts: qcom: sm6115: Fix CDSP memory length
    
    commit 846f49c3f01680f4af3043bf5b7abc9cf71bb42d upstream.
    
    The address space in MPSS/Modem PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB) which has a length of 0x4040.  Value of 0x100000 covers
    entire Touring/CDSP memory block seems to big here.
    
    This should have no functional impact on Linux users, because PAS loader
    does not use this address space at all.
    
    Cc: [email protected]
    Fixes: 96ce9227fdbc ("arm64: dts: qcom: sm6115: Add remoteproc nodes")
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-22-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm6115: Fix MPSS memory length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:54:10 2024 +0100

    arm64: dts: qcom: sm6115: Fix MPSS memory length
    
    commit 472d65e7cb591c8379dd6f40561f96be73a46f0f upstream.
    
    The address space in MPSS/Modem PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB) which has a length of 0x10000.  Value of 0x100 was
    copied from older DTS, but it grew since then.
    
    This should have no functional impact on Linux users, because PAS loader
    does not use this address space at all.
    
    Cc: [email protected]
    Fixes: 96ce9227fdbc ("arm64: dts: qcom: sm6115: Add remoteproc nodes")
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-21-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm6350: Fix ADSP memory length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:54:04 2024 +0100

    arm64: dts: qcom: sm6350: Fix ADSP memory length
    
    commit b0805a864459a29831577d2a47165afebe338faf upstream.
    
    The address space in ADSP (Peripheral Authentication Service) remoteproc
    node should point to the QDSP PUB address space (QDSP6...SS_PUB) which
    has a length of 0x10000.
    
    This should have no functional impact on Linux users, because PAS loader
    does not use this address space at all.
    
    Fixes: efc33c969f23 ("arm64: dts: qcom: sm6350: Add ADSP nodes")
    Cc: [email protected]
    Tested-by: Luca Weiss <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-15-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm6350: Fix MPSS memory length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:54:05 2024 +0100

    arm64: dts: qcom: sm6350: Fix MPSS memory length
    
    commit cd8d83de9cc9ecfb1f9a12bc838041c4eb4d10bd upstream.
    
    The address space in MPSS/Modem PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB) which has a length of 0x10000.  Value of 0x4040 was
    copied from older DTS, but it grew since then.
    
    This should have no functional impact on Linux users, because PAS loader
    does not use this address space at all.
    
    Fixes: 489be59b635b ("arm64: dts: qcom: sm6350: Add MPSS nodes")
    Cc: [email protected]
    Tested-by: Luca Weiss <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-16-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm6350: Fix uart1 interconnect path [+ + +]
Author: Luca Weiss <[email protected]>
Date:   Fri Dec 20 09:59:50 2024 +0100

    arm64: dts: qcom: sm6350: Fix uart1 interconnect path
    
    commit be2f81eaa2c8e81d3de5b73dca5e133f63384cb3 upstream.
    
    The path MASTER_QUP_0 to SLAVE_EBI_CH0 would be qup-memory path and not
    qup-config. Since the qup-memory path is not part of the qcom,geni-uart
    bindings, just replace that path with the correct path for qup-config.
    
    Fixes: b179f35b887b ("arm64: dts: qcom: sm6350: add uart1 node")
    Cc: [email protected]
    Signed-off-by: Luca Weiss <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm6375: Fix ADSP memory length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:54:06 2024 +0100

    arm64: dts: qcom: sm6375: Fix ADSP memory length
    
    commit bf4dda83da27b7efc49326ebb82cbd8b3e637c38 upstream.
    
    The address space in ADSP (Peripheral Authentication Service) remoteproc
    node should point to the QDSP PUB address space (QDSP6...SS_PUB) which
    has a length of 0x10000.
    
    This should have no functional impact on Linux users, because PAS loader
    does not use this address space at all.
    
    Fixes: fe6fd26aeddf ("arm64: dts: qcom: sm6375: Add ADSP&CDSP")
    Cc: [email protected]
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-17-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm6375: Fix CDSP memory base and length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:54:07 2024 +0100

    arm64: dts: qcom: sm6375: Fix CDSP memory base and length
    
    commit c9f7f341e896836c99709421a23bae5f53039aab upstream.
    
    The address space in CDSP PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB): 0x0b30_0000 with length of 0x10000.
    
    0x0b00_0000, value used so far, is the main region of CDSP.
    
    Correct the base address and length, which should have no functional
    impact on Linux users, because PAS loader does not use this address
    space at all.
    
    Fixes: fe6fd26aeddf ("arm64: dts: qcom: sm6375: Add ADSP&CDSP")
    Cc: [email protected]
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-18-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm6375: Fix MPSS memory base and length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:54:08 2024 +0100

    arm64: dts: qcom: sm6375: Fix MPSS memory base and length
    
    commit 918e71ba0c08c3d609ad69067854b0f675c4a253 upstream.
    
    The address space in MPSS/Modem PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB): 0x0608_0000 with length of 0x10000.
    
    0x0600_0000, value used so far, is the main region of Modem.
    
    Correct the base address and length, which should have no functional
    impact on Linux users, because PAS loader does not use this address
    space at all.
    
    Fixes: 31cc61104f68 ("arm64: dts: qcom: sm6375: Add modem nodes")
    Cc: [email protected]
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-19-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm8350: Fix ADSP memory base and length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:53:50 2024 +0100

    arm64: dts: qcom: sm8350: Fix ADSP memory base and length
    
    commit f9ba85566ddd5a3db8fa291aaecd70c4e55a3732 upstream.
    
    The address space in ADSP PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB): 0x0300_0000 with length of 0x10000.  0x1730_0000,
    value used so far, was copied from downstream DTS, is in the middle of
    unused space and downstream DTS describes the PIL loader, which is a bit
    different interface.
    
    Assume existing value (thus downstream DTS) is not really describing the
    intended ADSP PAS region.
    
    Correct the base address and length, which also moves the node to
    different place to keep things sorted by unit address.  The diff looks
    big, but only the unit address and "reg" property were changed.  This
    should have no functional impact on Linux users, because PAS loader does
    not use this address space at all.
    
    Fixes: 177fcf0aeda2 ("arm64: dts: qcom: sm8350: Add remoteprocs")
    Cc: [email protected]
    Reviewed-by: Konrad Dybcio <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-1-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm8350: Fix CDSP memory base and length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:53:51 2024 +0100

    arm64: dts: qcom: sm8350: Fix CDSP memory base and length
    
    commit f4afd8ba453b6e82245b9068868c72c831aec84e upstream.
    
    The address space in CDSP PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB): 0x0a30_0000 with length of 0x10000.  0x9890_0000,
    value used so far, was copied from downstream DTS, is in the middle of
    RAM/DDR space and downstream DTS describes the PIL loader, which is a
    bit different interface.  Datasheet says that one of the main CDSP
    address spaces is 0x0980_0000, which is oddly similar to 0x9890_0000,
    but quite different.
    
    Assume existing value (thus downstream DTS) is not really describing the
    intended CDSP PAS region.
    
    Correct the base address and length, which also moves the node to
    different place to keep things sorted by unit address.  The diff looks
    big, but only the unit address and "reg" property were changed.  This
    should have no functional impact on Linux users, because PAS loader does
    not use this address space at all.
    
    Fixes: 177fcf0aeda2 ("arm64: dts: qcom: sm8350: Add remoteprocs")
    Cc: [email protected]
    Reviewed-by: Konrad Dybcio <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-2-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm8350: Fix MPSS memory length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:53:52 2024 +0100

    arm64: dts: qcom: sm8350: Fix MPSS memory length
    
    commit da1937dec9cd986e685b6a429b528a4cbc7b1603 upstream.
    
    The address space in MPSS/Modem PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB) which has a length of 0x10000.  Value of 0x4040 was
    copied from older DTS, but it grew since then.
    
    This should have no functional impact on Linux users, because PAS loader
    does not use this address space at all.
    
    Fixes: 177fcf0aeda2 ("arm64: dts: qcom: sm8350: Add remoteprocs")
    Cc: [email protected]
    Reviewed-by: Konrad Dybcio <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-3-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm8450: Fix ADSP memory base and length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:53:53 2024 +0100

    arm64: dts: qcom: sm8450: Fix ADSP memory base and length
    
    commit 13c96bee5d5e5b61a9d8d000c9bb37bb9a2a0551 upstream.
    
    The address space in ADSP PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB): 0x0300_0000 with length of 0x10000, which also matches
    downstream DTS.  0x3000_0000, value used so far, was in datasheet is the
    region of CDSP.
    
    Correct the base address and length, which also moves the node to
    different place to keep things sorted by unit address.  The diff looks
    big, but only the unit address and "reg" property were changed.  This
    should have no functional impact on Linux users, because PAS loader does
    not use this address space at all.
    
    Fixes: 1172729576fb ("arm64: dts: qcom: sm8450: Add remoteproc enablers and instances")
    Cc: [email protected]
    Reviewed-by: Neil Armstrong <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-4-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm8450: Fix CDSP memory length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:53:54 2024 +0100

    arm64: dts: qcom: sm8450: Fix CDSP memory length
    
    commit 3751fe2cba2a9fba2204ef62102bc4bb027cec7b upstream.
    
    The address space in CDSP PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB) which has a length of 0x10000.  Value of 0x1400000 was
    copied from older DTS, but it does not look accurate at all.
    
    This should have no functional impact on Linux users, because PAS loader
    does not use this address space at all.
    
    Fixes: 1172729576fb ("arm64: dts: qcom: sm8450: Add remoteproc enablers and instances")
    Cc: [email protected]
    Reviewed-by: Neil Armstrong <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-5-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm8450: Fix MPSS memory length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:53:55 2024 +0100

    arm64: dts: qcom: sm8450: Fix MPSS memory length
    
    commit fa6442e87ab7c4a58c0b5fc64aab1aacc8034712 upstream.
    
    The address space in MPSS/Modem PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB) which has a length of 0x10000.  Value of 0x4040 was
    copied from older DTS, but it grew since then.
    
    This should have no functional impact on Linux users, because PAS loader
    does not use this address space at all.
    
    Fixes: 1172729576fb ("arm64: dts: qcom: sm8450: Add remoteproc enablers and instances")
    Cc: [email protected]
    Reviewed-by: Neil Armstrong <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-6-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm8550: correct MDSS interconnects [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Sat Oct 26 20:59:40 2024 +0300

    arm64: dts: qcom: sm8550: correct MDSS interconnects
    
    commit b8591df49cde459e3b84cdc0517d7bf92053d244 upstream.
    
    SM8550 lists two interconnects for the display subsystem, mdp0-mem
    (between MDP and LLCC) and mdp1-mem (between LLCC and EBI, memory).
    The second interconnect is a misuse. mdpN-mem paths should be used for
    several outboud MDP interconnects rather than the path between LLCC and
    memory. This kind of misuse can result in bandwidth underflows, possibly
    degrading picture quality as the required memory bandwidth is divided
    between all mdpN-mem paths (and LLCC-EBI should not be a part of such
    division).
    
    Drop the second path and use direct MDP-EBI path for mdp0-mem until we
    support separate MDP-LLCC and LLCC-EBI paths.
    
    Fixes: d7da51db5b81 ("arm64: dts: qcom: sm8550: add display hardware devices")
    Cc: [email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm8550: Fix ADSP memory base and length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:53:56 2024 +0100

    arm64: dts: qcom: sm8550: Fix ADSP memory base and length
    
    commit a6a8f54bc2af555738322783ba1e990c2ae7f443 upstream.
    
    The address space in ADSP PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB): 0x0680_0000 with length of 0x10000.
    
    0x3000_0000, value used so far, is the main region of CDSP.  Downstream
    DTS uses 0x0300_0000, which is oddly similar to 0x3000_0000, yet quite
    different and points to unused area.
    
    Correct the base address and length, which also moves the node to
    different place to keep things sorted by unit address.  The diff looks
    big, but only the unit address and "reg" property were changed.  This
    should have no functional impact on Linux users, because PAS loader does
    not use this address space at all.
    
    Fixes: d0c061e366ed ("arm64: dts: qcom: sm8550: add adsp, cdsp & mdss nodes")
    Cc: [email protected]
    Reviewed-by: Neil Armstrong <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-7-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm8550: Fix CDSP memory length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:53:57 2024 +0100

    arm64: dts: qcom: sm8550: Fix CDSP memory length
    
    commit 6b2570e1e43e4acd0fcb98c6489736fe1c67b222 upstream.
    
    The address space in CDSP PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB) which has a length of 0x10000.  Value of 0x1400000 was
    copied from older DTS, but it does not look accurate at all.
    
    This should have no functional impact on Linux users, because PAS loader
    does not use this address space at all.
    
    Fixes: d0c061e366ed ("arm64: dts: qcom: sm8550: add adsp, cdsp & mdss nodes")
    Cc: [email protected]
    Reviewed-by: Neil Armstrong <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-8-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm8550: Fix MPSS memory length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:53:58 2024 +0100

    arm64: dts: qcom: sm8550: Fix MPSS memory length
    
    commit 8ef227e93a513d431f9345f23cd4d2d65607b985 upstream.
    
    The address space in MPSS/Modem PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB) which has a length of 0x10000.  Value of 0x4040 was
    copied from older DTS, but it grew since then.
    
    This should have no functional impact on Linux users, because PAS loader
    does not use this address space at all.
    
    Fixes: d0c061e366ed ("arm64: dts: qcom: sm8550: add adsp, cdsp & mdss nodes")
    Cc: [email protected]
    Reviewed-by: Neil Armstrong <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-9-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm8650: correct MDSS interconnects [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Sat Oct 26 20:59:41 2024 +0300

    arm64: dts: qcom: sm8650: correct MDSS interconnects
    
    commit 9fa33cbca3d2842f1f47ed4e5f6574e611dae32b upstream.
    
    SM8650 lists two interconnects for the display subsystem, mdp0-mem
    (between MDP and LLCC) and mdp1-mem (between LLCC and EBI, memory).
    The second interconnect is a misuse. mdpN-mem paths should be used for
    several outboud MDP interconnects rather than the path between LLCC and
    memory. This kind of misuse can result in bandwidth underflows, possibly
    degrading picture quality as the required memory bandwidth is divided
    between all mdpN-mem paths (and LLCC-EBI should not be a part of such
    division).
    
    Drop the second path and use direct MDP-EBI path for mdp0-mem until we
    support separate MDP-LLCC and LLCC-EBI paths.
    
    Fixes: 10e024671295 ("arm64: dts: qcom: sm8650: add interconnect dependent device nodes")
    Cc: [email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm8650: Fix ADSP memory base and length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:53:59 2024 +0100

    arm64: dts: qcom: sm8650: Fix ADSP memory base and length
    
    commit b6ddc5c37323f7875c2533cc4949be58d15e430a upstream.
    
    The address space in ADSP PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB): 0x0680_0000 with length of 0x10000.
    
    0x3000_0000, value used so far, is the main region of CDSP.  Downstream
    DTS uses 0x0300_0000, which is oddly similar to 0x3000_0000, yet quite
    different and points to unused area.
    
    Correct the base address and length, which also moves the node to
    different place to keep things sorted by unit address.  The diff looks
    big, but only the unit address and "reg" property were changed.  This
    should have no functional impact on Linux users, because PAS loader does
    not use this address space at all.
    
    Fixes: 10e024671295 ("arm64: dts: qcom: sm8650: add interconnect dependent device nodes")
    Cc: [email protected]
    Reviewed-by: Neil Armstrong <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-10-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm8650: Fix CDSP memory length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:54:00 2024 +0100

    arm64: dts: qcom: sm8650: Fix CDSP memory length
    
    commit aca0053f051625a224c2e802a0e88755770819e4 upstream.
    
    The address space in CDSP PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB) which has a length of 0x10000.  Value of 0x1400000 was
    copied from older DTS, but it does not look accurate at all.
    
    This should have no functional impact on Linux users, because PAS loader
    does not use this address space at all.
    
    Fixes: 10e024671295 ("arm64: dts: qcom: sm8650: add interconnect dependent device nodes")
    Cc: [email protected]
    Reviewed-by: Neil Armstrong <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-11-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: sm8650: Fix MPSS memory length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:54:01 2024 +0100

    arm64: dts: qcom: sm8650: Fix MPSS memory length
    
    commit d4fa87daf3dd39d6bd4b69613e22bfb43c737831 upstream.
    
    The address space in MPSS/Modem PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB) which has a length of 0x10000.  Value of 0x4040 was
    copied from older DTS, but it grew since then.
    
    This should have no functional impact on Linux users, because PAS loader
    does not use this address space at all.
    
    Fixes: 10e024671295 ("arm64: dts: qcom: sm8650: add interconnect dependent device nodes")
    Cc: [email protected]
    Reviewed-by: Neil Armstrong <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-12-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: x1e78100-lenovo-thinkpad-t14s: Fix USB QMP PHY supplies [+ + +]
Author: Stephan Gerhold <[email protected]>
Date:   Tue Dec 10 10:07:33 2024 +0100

    arm64: dts: qcom: x1e78100-lenovo-thinkpad-t14s: Fix USB QMP PHY supplies
    
    commit 6efc01b75f819a2988aa9392f93a4d6501871525 upstream.
    
    On the X1E80100 CRD, &vreg_l3e_1p2 only powers &usb_mp_qmpphy0/1
    (i.e. USBSS_3 and USBSS_4). The QMP PHYs for USB_0, USB_1 and USB_2
    are actually powered by &vreg_l2j_1p2.
    
    Since x1e78100-lenovo-thinkpad-t14s mostly just mirrors the power supplies
    from the x1e80100-crd device tree, assume that the fix also applies here.
    
    Cc: [email protected]
    Fixes: 7d1cbe2f4985 ("arm64: dts: qcom: Add X1E78100 ThinkPad T14s Gen 6")
    Signed-off-by: Stephan Gerhold <[email protected]>
    Reviewed-by: Johan Hovold <[email protected]>
    Link: https://lore.kernel.org/r/20241210-x1e80100-usb-qmp-supply-fix-v1-2-0adda5d30bbd@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: x1e80100-asus-vivobook-s15: Fix USB QMP PHY supplies [+ + +]
Author: Stephan Gerhold <[email protected]>
Date:   Tue Dec 10 10:07:34 2024 +0100

    arm64: dts: qcom: x1e80100-asus-vivobook-s15: Fix USB QMP PHY supplies
    
    commit bf5e9aa844ca74e9c202d8de2ce7390d24ec38a4 upstream.
    
    On the X1E80100 CRD, &vreg_l3e_1p2 only powers &usb_mp_qmpphy0/1
    (i.e. USBSS_3 and USBSS_4). The QMP PHYs for USB_0, USB_1 and USB_2
    are actually powered by &vreg_l2j_1p2.
    
    Since x1e80100-asus-vivobook-s15 mostly just mirrors the power supplies
    from the x1e80100-crd device tree, assume that the fix also applies here.
    
    Cc: [email protected]
    Fixes: d0e2f8f62dff ("arm64: dts: qcom: Add device tree for ASUS Vivobook S 15")
    Signed-off-by: Stephan Gerhold <[email protected]>
    Tested-by: Maud Spierings <[email protected]>
    Reviewed-by: Johan Hovold <[email protected]>
    Link: https://lore.kernel.org/r/20241210-x1e80100-usb-qmp-supply-fix-v1-3-0adda5d30bbd@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: x1e80100-crd: Fix USB QMP PHY supplies [+ + +]
Author: Stephan Gerhold <[email protected]>
Date:   Tue Dec 10 10:07:35 2024 +0100

    arm64: dts: qcom: x1e80100-crd: Fix USB QMP PHY supplies
    
    commit 789209dd08124da448bfa7524b21049a04d98f83 upstream.
    
    On the X1E80100 CRD, &vreg_l3e_1p2 only powers &usb_mp_qmpphy0/1
    (i.e. USBSS_3 and USBSS_4). The QMP PHYs for USB_0, USB_1 and USB_2
    are actually powered by &vreg_l2j_1p2.
    
    Cc: [email protected]
    Fixes: ae5cee8e7349 ("arm64: dts: qcom: x1e80100-crd: Fix USB PHYs regulators")
    Signed-off-by: Stephan Gerhold <[email protected]>
    Reviewed-by: Johan Hovold <[email protected]>
    Link: https://lore.kernel.org/r/20241210-x1e80100-usb-qmp-supply-fix-v1-4-0adda5d30bbd@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: x1e80100-dell-xps13-9345: Fix USB QMP PHY supplies [+ + +]
Author: Stephan Gerhold <[email protected]>
Date:   Tue Dec 10 10:07:36 2024 +0100

    arm64: dts: qcom: x1e80100-dell-xps13-9345: Fix USB QMP PHY supplies
    
    commit 26a1b22aaf0c6f5128f8d0242caf3d983d5a2836 upstream.
    
    On the X1E80100 CRD, &vreg_l3e_1p2 only powers &usb_mp_qmpphy0/1
    (i.e. USBSS_3 and USBSS_4). The QMP PHYs for USB_0, USB_1 and USB_2
    are actually powered by &vreg_l2j_1p2.
    
    Since x1e80100-dell-xps13-9345 mostly just mirrors the power supplies from
    the x1e80100-crd device tree, assume that the fix also applies here.
    
    Cc: [email protected]
    Fixes: f5b788d0e8cd ("arm64: dts: qcom: Add support for X1-based Dell XPS 13 9345")
    Signed-off-by: Stephan Gerhold <[email protected]>
    Tested-by: Aleksandrs Vinarskis <[email protected]>
    Reviewed-by: Johan Hovold <[email protected]>
    Link: https://lore.kernel.org/r/20241210-x1e80100-usb-qmp-supply-fix-v1-5-0adda5d30bbd@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: x1e80100-lenovo-yoga-slim7x: Fix USB QMP PHY supplies [+ + +]
Author: Stephan Gerhold <[email protected]>
Date:   Tue Dec 10 10:07:37 2024 +0100

    arm64: dts: qcom: x1e80100-lenovo-yoga-slim7x: Fix USB QMP PHY supplies
    
    commit 6ba8e1b8242d27dd83ed4ce58a104c709e72f45f upstream.
    
    On the X1E80100 CRD, &vreg_l3e_1p2 only powers &usb_mp_qmpphy0/1
    (i.e. USBSS_3 and USBSS_4). The QMP PHYs for USB_0, USB_1 and USB_2
    are actually powered by &vreg_l2j_1p2.
    
    Since x1e80100-lenovo-yoga-slim7x mostly just mirrors the power supplies
    from the x1e80100-crd device tree, assume that the fix also applies here.
    
    Cc: [email protected]
    Fixes: 45247fe17db2 ("arm64: dts: qcom: x1e80100: add Lenovo Thinkpad Yoga slim 7x devicetree")
    Signed-off-by: Stephan Gerhold <[email protected]>
    Reviewed-by: Johan Hovold <[email protected]>
    Link: https://lore.kernel.org/r/20241210-x1e80100-usb-qmp-supply-fix-v1-6-0adda5d30bbd@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: x1e80100-microsoft-romulus: Fix USB QMP PHY supplies [+ + +]
Author: Stephan Gerhold <[email protected]>
Date:   Tue Dec 10 10:07:38 2024 +0100

    arm64: dts: qcom: x1e80100-microsoft-romulus: Fix USB QMP PHY supplies
    
    commit c0562f51b177d49829a378b5aeda73f78c60d0fc upstream.
    
    On the X1E80100 CRD, &vreg_l3e_1p2 only powers &usb_mp_qmpphy0/1
    (i.e. USBSS_3 and USBSS_4). The QMP PHYs for USB_0, USB_1 and USB_2
    are actually powered by &vreg_l2j_1p2.
    
    Since x1e80100-microsoft-romulus mostly just mirrors the power supplies
    from the x1e80100-crd device tree, assume that the fix also applies here.
    
    Cc: [email protected]
    Fixes: 09d77be56093 ("arm64: dts: qcom: Add support for X1-based Surface Laptop 7 devices")
    Signed-off-by: Stephan Gerhold <[email protected]>
    Reviewed-by: Johan Hovold <[email protected]>
    Link: https://lore.kernel.org/r/20241210-x1e80100-usb-qmp-supply-fix-v1-7-0adda5d30bbd@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: x1e80100-qcp: Fix USB QMP PHY supplies [+ + +]
Author: Stephan Gerhold <[email protected]>
Date:   Tue Dec 10 10:07:39 2024 +0100

    arm64: dts: qcom: x1e80100-qcp: Fix USB QMP PHY supplies
    
    commit 4861ba7cf5a49969dee258dda2bf8d4e819135d1 upstream.
    
    On the X1E80100 QCP, &vreg_l3e_1p2 only powers &usb_mp_qmpphy0/1
    (i.e. USBSS_3 and USBSS_4). The QMP PHYs for USB_0, USB_1 and USB_2
    are actually powered by &vreg_l2j_1p2.
    
    Cc: [email protected]
    Fixes: 20676f7819d7 ("arm64: dts: qcom: x1e80100-qcp: Fix USB PHYs regulators")
    Signed-off-by: Stephan Gerhold <[email protected]>
    Reviewed-by: Johan Hovold <[email protected]>
    Link: https://lore.kernel.org/r/20241210-x1e80100-usb-qmp-supply-fix-v1-8-0adda5d30bbd@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: x1e80100: Fix ADSP memory base and length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:54:02 2024 +0100

    arm64: dts: qcom: x1e80100: Fix ADSP memory base and length
    
    commit 7a003077366946a5ed1adab6d177efb2ab59e815 upstream.
    
    The address space in ADSP PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB): 0x0680_0000 with length of 0x10000.
    
    0x3000_0000, value used so far, is the main region of CDSP and was
    simply copied from other/older DTS.
    
    Correct the base address and length, which also moves the node to
    different place to keep things sorted by unit address.  The diff looks
    big, but only the unit address and "reg" property were changed.  This
    should have no functional impact on Linux users, because PAS loader does
    not use this address space at all.
    
    Fixes: 5f2a9cd4b104 ("arm64: dts: qcom: x1e80100: Add ADSP/CDSP remoteproc nodes")
    Cc: [email protected]
    Reviewed-by: Konrad Dybcio <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Reviewed-by: Johan Hovold <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-13-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: x1e80100: Fix CDSP memory length [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Dec 13 15:54:03 2024 +0100

    arm64: dts: qcom: x1e80100: Fix CDSP memory length
    
    commit 3de1bf12c6bfb9a92f0803941ecae39b08470446 upstream.
    
    The address space in CDSP PAS (Peripheral Authentication Service)
    remoteproc node should point to the QDSP PUB address space
    (QDSP6...SS_PUB) which has a length of 0x10000.  Value of 0x1400000 was
    copied from older DTS, but it does not look accurate at all.
    
    This should have no functional impact on Linux users, because PAS loader
    does not use this address space at all.
    
    Fixes: 5f2a9cd4b104 ("arm64: dts: qcom: x1e80100: Add ADSP/CDSP remoteproc nodes")
    Cc: [email protected]
    Reviewed-by: Konrad Dybcio <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Reviewed-by: Johan Hovold <[email protected]>
    Link: https://lore.kernel.org/r/20241213-dts-qcom-cdsp-mpss-base-address-v3-14-2e0036fccd8d@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: qcom: x1e80100: Fix usb_2 controller interrupts [+ + +]
Author: Abel Vesa <[email protected]>
Date:   Tue Jan 7 15:15:16 2025 +0200

    arm64: dts: qcom: x1e80100: Fix usb_2 controller interrupts
    
    commit 680421056216efe727ff4ed48f481691d5873b9e upstream.
    
    Back when the CRD support was brought up, the usb_2 controller didn't
    have anything connected to it in order to test it properly, so it was
    never enabled.
    
    On the Lenovo ThinkPad T14s, the usb_2 controller has the fingerprint
    controller connected to it. So enabling it, proved that the interrupts
    lines were wrong from the start.
    
    Fix both the pwr_event and the DWC ctrl_irq lines, according to
    documentation.
    
    Fixes: 4af46b7bd66f ("arm64: dts: qcom: x1e80100: Add USB nodes")
    Cc: [email protected]      # 6.9
    Signed-off-by: Abel Vesa <[email protected]>
    Reviewed-by: Johan Hovold <[email protected]>
    Tested-by: Johan Hovold <[email protected]>
    Link: https://lore.kernel.org/r/20250107-x1e80100-fix-usb2-controller-irqs-v1-1-4689aa9852a7@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: dts: rockchip: increase gmac rx_delay on rk3399-puma [+ + +]
Author: Jakob Unterwurzacher <[email protected]>
Date:   Fri Dec 13 10:54:58 2024 +0100

    arm64: dts: rockchip: increase gmac rx_delay on rk3399-puma
    
    commit 9d241b06802c6c2176ae7aa4f9f17f8a577ed337 upstream.
    
    During mass manufacturing, we noticed the mmc_rx_crc_error counter,
    as reported by "ethtool -S eth0 | grep mmc_rx_crc_error", to increase
    above zero during nuttcp speedtests. Most of the time, this did not
    affect the achieved speed, but it prompted this investigation.
    
    Cycling through the rx_delay range on six boards (see table below) of
    various ages shows that there is a large good region from 0x12 to 0x35
    where we see zero crc errors on all tested boards.
    
    The old rx_delay value (0x10) seems to have always been on the edge for
    the KSZ9031RNX that is usually placed on Puma.
    
    Choose "rx_delay = 0x23" to put us smack in the middle of the good
    region. This works fine as well with the KSZ9131RNX PHY that was used
    for a small number of boards during the COVID chip shortages.
    
            Board S/N        PHY        rx_delay good region
            ---------        ---        --------------------
            Puma TT0069903   KSZ9031RNX 0x11 0x35
            Puma TT0157733   KSZ9031RNX 0x11 0x35
            Puma TT0681551   KSZ9031RNX 0x12 0x37
            Puma TT0681156   KSZ9031RNX 0x10 0x38
            Puma 17496030079 KSZ9031RNX 0x10 0x37 (Puma v1.2 from 2017)
            Puma TT0681720   KSZ9131RNX 0x02 0x39 (alternative PHY used in very few boards)
    
            Intersection of good regions = 0x12 0x35
            Middle of good region = 0x23
    
    Fixes: 2c66fc34e945 ("arm64: dts: rockchip: add RK3399-Q7 (Puma) SoM")
    Cc: [email protected]
    Reviewed-by: Quentin Schulz <[email protected]>
    Tested-by: Quentin Schulz <[email protected]> # Puma v2.1 and v2.3 with KSZ9031
    Signed-off-by: Jakob Unterwurzacher <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Heiko Stuebner <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: Filter out SVE hwcaps when FEAT_SVE isn't implemented [+ + +]
Author: Marc Zyngier <[email protected]>
Date:   Tue Jan 7 22:59:41 2025 +0000

    arm64: Filter out SVE hwcaps when FEAT_SVE isn't implemented
    
    commit 064737920bdbca86df91b96aed256e88018fef3a upstream.
    
    The hwcaps code that exposes SVE features to userspace only
    considers ID_AA64ZFR0_EL1, while this is only valid when
    ID_AA64PFR0_EL1.SVE advertises that SVE is actually supported.
    
    The expectations are that when ID_AA64PFR0_EL1.SVE is 0, the
    ID_AA64ZFR0_EL1 register is also 0. So far, so good.
    
    Things become a bit more interesting if the HW implements SME.
    In this case, a few ID_AA64ZFR0_EL1 fields indicate *SME*
    features. And these fields overlap with their SVE interpretations.
    But the architecture says that the SME and SVE feature sets must
    match, so we're still hunky-dory.
    
    This goes wrong if the HW implements SME, but not SVE. In this
    case, we end-up advertising some SVE features to userspace, even
    if the HW has none. That's because we never consider whether SVE
    is actually implemented. Oh well.
    
    Fix it by restricting all SVE capabilities to ID_AA64PFR0_EL1.SVE
    being non-zero. The HWCAPS documentation is amended to reflect the
    actually checks performed by the kernel.
    
    Fixes: 06a916feca2b ("arm64: Expose SVE2 features for userspace")
    Reported-by: Catalin Marinas <[email protected]>
    Signed-off-by: Marc Zyngier <[email protected]>
    Signed-off-by: Mark Brown <[email protected]>
    Cc: Will Deacon <[email protected]>
    Cc: Mark Rutland <[email protected]>
    Cc: [email protected]
    Reviewed-by: Mark Brown <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Will Deacon <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: tegra: Disable Tegra234 sce-fabric node [+ + +]
Author: Sumit Gupta <[email protected]>
Date:   Wed Dec 18 00:07:37 2024 +0000

    arm64: tegra: Disable Tegra234 sce-fabric node
    
    commit a5e6fc0a10fe280989f1367a3b4f8047c7d00ea6 upstream.
    
    Access to safety cluster engine (SCE) fabric registers was blocked
    by firewall after the introduction of Functional Safety Island in
    Tegra234. After that, any access by software to SCE registers is
    correctly resulting in the internal bus error. However, when CPUs
    try accessing the SCE-fabric registers to print error info,
    another firewall error occurs as the fabric registers are also
    firewall protected. This results in a second error to be printed.
    Disable the SCE fabric node to avoid printing the misleading error.
    The first error info will be printed by the interrupt from the
    fabric causing the actual access.
    
    Cc: [email protected]
    Fixes: 302e154000ec ("arm64: tegra: Add node for CBB 2.0 on Tegra234")
    Signed-off-by: Sumit Gupta <[email protected]>
    Signed-off-by: Ivy Huang <[email protected]>
    Reviewed-by: Brad Griffis <[email protected]>
    Reviewed-by: Jon Hunter <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Thierry Reding <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: tegra: Fix Tegra234 PCIe interrupt-map [+ + +]
Author: Brad Griffis <[email protected]>
Date:   Fri Dec 13 23:56:02 2024 +0000

    arm64: tegra: Fix Tegra234 PCIe interrupt-map
    
    commit b615fbd70fce8582d92b3bdbbf3c9b80cadcfb55 upstream.
    
    For interrupt-map entries, the DTS specification requires
    that #address-cells is defined for both the child node and the
    interrupt parent.  For the PCIe interrupt-map entries, the parent
    node ("gic") has not specified #address-cells. The existing layout
    of the PCIe interrupt-map entries indicates that it assumes
    that #address-cells is zero for this node.
    
    Explicitly set #address-cells to zero for "gic" so that it complies
    with the device tree specification.
    
    NVIDIA EDK2 works around this issue by assuming #address-cells
    is zero in this scenario, but that workaround is being removed and so
    this update is needed or else NVIDIA EDK2 cannot successfully parse the
    device tree and the board cannot boot.
    
    Fixes: ec142c44b026 ("arm64: tegra: Add P2U and PCIe controller nodes to Tegra234 DT")
    Signed-off-by: Brad Griffis <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Thierry Reding <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: tegra: Fix typo in Tegra234 dce-fabric compatible [+ + +]
Author: Sumit Gupta <[email protected]>
Date:   Wed Dec 18 00:07:36 2024 +0000

    arm64: tegra: Fix typo in Tegra234 dce-fabric compatible
    
    commit 604120fd9e9df50ee0e803d3c6e77a1f45d2c58e upstream.
    
    The compatible string for the Tegra DCE fabric is currently defined as
    'nvidia,tegra234-sce-fabric' but this is incorrect because this is the
    compatible string for SCE fabric. Update the compatible for the DCE
    fabric to correct the compatible string.
    
    This compatible needs to be correct in order for the interconnect
    to catch things such as improper data accesses.
    
    Cc: [email protected]
    Fixes: 302e154000ec ("arm64: tegra: Add node for CBB 2.0 on Tegra234")
    Signed-off-by: Sumit Gupta <[email protected]>
    Signed-off-by: Ivy Huang <[email protected]>
    Reviewed-by: Brad Griffis <[email protected]>
    Reviewed-by: Jon Hunter <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Thierry Reding <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ARM: dts: dra7: Add bus_dma_limit for l4 cfg bus [+ + +]
Author: Romain Naour <[email protected]>
Date:   Fri Nov 15 11:25:37 2024 +0100

    ARM: dts: dra7: Add bus_dma_limit for l4 cfg bus
    
    commit c1472ec1dc4419d0bae663c1a1e6cb98dc7881ad upstream.
    
    A bus_dma_limit was added for l3 bus by commit cfb5d65f2595
    ("ARM: dts: dra7: Add bus_dma_limit for L3 bus") to fix an issue
    observed only with SATA on DRA7-EVM with 4GB RAM and CONFIG_ARM_LPAE
    enabled.
    
    Since kernel 5.13, the SATA issue can be reproduced again following
    the SATA node move from L3 bus to L4_cfg in commit 8af15365a368
    ("ARM: dts: Configure interconnect target module for dra7 sata").
    
    Fix it by adding an empty dma-ranges property to l4_cfg and
    segment@100000 nodes (parent device tree node of SATA controller) to
    inherit the 2GB dma ranges limit from l3 bus node.
    
    Note: A similar fix was applied for PCIe controller by commit
    90d4d3f4ea45 ("ARM: dts: dra7: Fix bus_dma_limit for PCIe").
    
    Fixes: 8af15365a368 ("ARM: dts: Configure interconnect target module for dra7 sata").
    Link: https://lore.kernel.org/linux-omap/[email protected]/
    Cc: [email protected] # 5.13
    Signed-off-by: Romain Naour <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Kevin Hilman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ARM: dts: ti/omap: gta04: fix pm issues caused by spi module [+ + +]
Author: Andreas Kemnade <[email protected]>
Date:   Wed Dec 4 18:41:52 2024 +0100

    ARM: dts: ti/omap: gta04: fix pm issues caused by spi module
    
    commit 0cfbd7805fe13406500e6a6f2aa08f198d5db4bd upstream.
    
    Despite CM_IDLEST1_CORE and CM_FCLKEN1_CORE behaving normal,
    disabling SPI leads to messages like when suspending:
    Powerdomain (core_pwrdm) didn't enter target state 0
    and according to /sys/kernel/debug/pm_debug/count off state is not
    entered. That was not connected to SPI during the discussion
    of disabling SPI. See:
    https://lore.kernel.org/linux-omap/20230122100852.32ae082c@aktux/
    
    The reason is that SPI is per default in slave mode. Linux driver
    will turn it to master per default. It slave mode, the powerdomain seems to
    be kept active if active chip select input is sensed.
    
    Fix that by explicitly disabling the SPI3 pins which used to be muxed by
    the bootloader since they are available on an optionally fitted header
    which would require dtb overlays anyways.
    
    Fixes: a622310f7f01 ("ARM: dts: gta04: fix excess dma channel usage")
    CC: [email protected]
    Signed-off-by: Andreas Kemnade <[email protected]>
    Reviewed-by: Roger Quadros <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Kevin Hilman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ASoC: acp: Support microphone from Lenovo Go S [+ + +]
Author: Mario Limonciello <[email protected]>
Date:   Wed Jan 22 20:49:13 2025 -0600

    ASoC: acp: Support microphone from Lenovo Go S
    
    commit b9a8ea185f3f8024619b2e74b74375493c87df8c upstream.
    
    On Lenovo Go S there is a DMIC connected to the ACP but the firmware
    has no `AcpDmicConnected` ACPI _DSD.
    
    Add a DMI entry for all possible Lenovo Go S SKUs to enable DMIC.
    
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Signed-off-by: Mario Limonciello <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ASoC: amd: Add ACPI dependency to fix build error [+ + +]
Author: Yu-Chun Lin <[email protected]>
Date:   Fri Jan 10 01:15:47 2025 +0800

    ASoC: amd: Add ACPI dependency to fix build error
    
    [ Upstream commit 7e24ec93aecd12e33d31e38e5af4625553bbc727 ]
    
    As reported by the kernel test robot, the following error occurs:
    
       sound/soc/amd/yc/acp6x-mach.c: In function 'acp6x_probe':
    >> sound/soc/amd/yc/acp6x-mach.c:573:15: error: implicit declaration of function 'acpi_evaluate_integer'; did you mean 'acpi_evaluate_object'? [-Werror=implicit-function-declaration]
         573 |         ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
             |               ^~~~~~~~~~~~~~~~~~~~~
             |               acpi_evaluate_object
       cc1: some warnings being treated as errors
    
    The function 'acpi_evaluate_integer' and its prototype in 'acpi_bus.h'
    are only available when 'CONFIG_ACPI' is enabled. Add a 'depends on ACPI'
    directive in Kconfig to ensure proper compilation.
    
    Reported-by: kernel test robot <[email protected]>
    Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
    Signed-off-by: Yu-Chun Lin <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ASoC: Intel: sof_sdw: Correct quirk for Lenovo Yoga Slim 7 [+ + +]
Author: Simon Trimmer <[email protected]>
Date:   Fri Dec 6 15:58:57 2024 +0800

    ASoC: Intel: sof_sdw: Correct quirk for Lenovo Yoga Slim 7
    
    [ Upstream commit 7662f0e5d55728a009229112ec820e963ed0e21c ]
    
    In addition to changing the DMI match to examine the product name rather
    than the SKU, this adds the quirk to inform the machine driver to not
    bind in the cs42l43 microphone DAI link.
    
    Signed-off-by: Simon Trimmer <[email protected]>
    Reviewed-by: Liam Girdwood <[email protected]>
    Signed-off-by: Bard Liao <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ASoC: renesas: rz-ssi: Add a check for negative sample_space [+ + +]
Author: Dan Carpenter <[email protected]>
Date:   Wed Jan 8 12:28:46 2025 +0300

    ASoC: renesas: rz-ssi: Add a check for negative sample_space
    
    commit 82a0a3e6f8c02b3236b55e784a083fa4ee07c321 upstream.
    
    My static checker rule complains about this code.  The concern is that
    if "sample_space" is negative then the "sample_space >= runtime->channels"
    condition will not work as intended because it will be type promoted to a
    high unsigned int value.
    
    strm->fifo_sample_size is SSI_FIFO_DEPTH (32).  The SSIFSR_TDC_MASK is
    0x3f.  Without any further context it does seem like a reasonable warning
    and it can't hurt to add a check for negatives.
    
    Cc: [email protected]
    Fixes: 03e786bd4341 ("ASoC: sh: Add RZ/G2L SSIF-2 driver")
    Signed-off-by: Dan Carpenter <[email protected]>
    Reviewed-by: Geert Uytterhoeven <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ASoC: renesas: rz-ssi: Terminate all the DMA transactions [+ + +]
Author: Claudiu Beznea <[email protected]>
Date:   Tue Dec 10 19:09:33 2024 +0200

    ASoC: renesas: rz-ssi: Terminate all the DMA transactions
    
    commit 541011dc2d7c4c82523706f726f422a5e23cc86f upstream.
    
    The stop trigger invokes rz_ssi_stop() and rz_ssi_stream_quit().
    - The purpose of rz_ssi_stop() is to disable TX/RX, terminate DMA
      transactions, and set the controller to idle.
    - The purpose of rz_ssi_stream_quit() is to reset the substream-specific
      software data by setting strm->running and strm->substream appropriately.
    
    The function rz_ssi_is_stream_running() checks if both strm->substream and
    strm->running are valid and returns true if so. Its implementation is as
    follows:
    
    static inline bool rz_ssi_is_stream_running(struct rz_ssi_stream *strm)
    {
        return strm->substream && strm->running;
    }
    
    When the controller is configured in full-duplex mode (with both playback
    and capture active), the rz_ssi_stop() function does not modify the
    controller settings when called for the first substream in the full-duplex
    setup. Instead, it simply sets strm->running = 0 and returns if the
    companion substream is still running. The following code illustrates this:
    
    static int rz_ssi_stop(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
    {
        strm->running = 0;
    
        if (rz_ssi_is_stream_running(&ssi->playback) ||
            rz_ssi_is_stream_running(&ssi->capture))
            return 0;
    
        // ...
    }
    
    The controller settings, along with the DMA termination (for the last
    stopped substream), are only applied when the last substream in the
    full-duplex setup is stopped.
    
    While applying the controller settings only when the last substream stops
    is not problematic, terminating the DMA operations for only one substream
    causes failures when starting and stopping full-duplex operations multiple
    times in a loop.
    
    To address this issue, call dmaengine_terminate_async() for both substreams
    involved in the full-duplex setup when the last substream in the setup is
    stopped.
    
    Fixes: 4f8cd05a4305 ("ASoC: sh: rz-ssi: Add full duplex support")
    Cc: [email protected]
    Reviewed-by: Biju Das <[email protected]>
    Signed-off-by: Claudiu Beznea <[email protected]>
    Reviewed-by: Geert Uytterhoeven <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ASoC: soc-pcm: don't use soc_pcm_ret() on .prepare callback [+ + +]
Author: Kuninori Morimoto <[email protected]>
Date:   Fri Dec 13 01:21:10 2024 +0000

    ASoC: soc-pcm: don't use soc_pcm_ret() on .prepare callback
    
    [ Upstream commit 301c26a018acb94dd537a4418cefa0f654500c6f ]
    
    commit 1f5664351410 ("ASoC: lower "no backend DAIs enabled for ... Port"
    log severity") ignores -EINVAL error message on common soc_pcm_ret().
    It is used from many functions, ignoring -EINVAL is over-kill.
    
    The reason why -EINVAL was ignored was it really should only be used
    upon invalid parameters coming from userspace and in that case we don't
    want to log an error since we do not want to give userspace a way to do
    a denial-of-service attack on the syslog / diskspace.
    
    So don't use soc_pcm_ret() on .prepare callback is better idea.
    
    Link: https://lore.kernel.org/r/[email protected]
    Cc: Hans de Goede <[email protected]>
    Signed-off-by: Kuninori Morimoto <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ASoC: SOF: Intel: hda-dai: Ensure DAI widget is valid during params [+ + +]
Author: Bard Liao <[email protected]>
Date:   Tue Dec 3 18:48:53 2024 +0800

    ASoC: SOF: Intel: hda-dai: Ensure DAI widget is valid during params
    
    [ Upstream commit 569922b82ca660f8b24e705f6cf674e6b1f99cc7 ]
    
    Each cpu DAI should associate with a widget. However, the topology might
    not create the right number of DAI widgets for aggregated amps. And it
    will cause NULL pointer deference.
    Check that the DAI widget associated with the CPU DAI is valid to prevent
    NULL pointer deference due to missing DAI widgets in topologies with
    aggregated amps.
    
    Signed-off-by: Bard Liao <[email protected]>
    Reviewed-by: Ranjani Sridharan <[email protected]>
    Reviewed-by: Péter Ujfalusi <[email protected]>
    Reviewed-by: Liam Girdwood <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
ata: libata-sff: Ensure that we cannot write outside the allocated buffer [+ + +]
Author: Niklas Cassel <[email protected]>
Date:   Mon Jan 27 16:43:04 2025 +0100

    ata: libata-sff: Ensure that we cannot write outside the allocated buffer
    
    commit 6e74e53b34b6dec5a50e1404e2680852ec6768d2 upstream.
    
    reveliofuzzing reported that a SCSI_IOCTL_SEND_COMMAND ioctl with out_len
    set to 0xd42, SCSI command set to ATA_16 PASS-THROUGH, ATA command set to
    ATA_NOP, and protocol set to ATA_PROT_PIO, can cause ata_pio_sector() to
    write outside the allocated buffer, overwriting random memory.
    
    While a ATA device is supposed to abort a ATA_NOP command, there does seem
    to be a bug either in libata-sff or QEMU, where either this status is not
    set, or the status is cleared before read by ata_sff_hsm_move().
    Anyway, that is most likely a separate bug.
    
    Looking at __atapi_pio_bytes(), it already has a safety check to ensure
    that __atapi_pio_bytes() cannot write outside the allocated buffer.
    
    Add a similar check to ata_pio_sector(), such that also ata_pio_sector()
    cannot write outside the allocated buffer.
    
    Cc: [email protected]
    Reported-by: reveliofuzzing <[email protected]>
    Closes: https://lore.kernel.org/linux-ide/CA+-ZZ_jTgxh3bS7m+KX07_EWckSnW3N2adX3KV63y4g7M4CZ2A@mail.gmail.com/
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Niklas Cassel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
atomic64: Use arch_spin_locks instead of raw_spin_locks [+ + +]
Author: Steven Rostedt <[email protected]>
Date:   Wed Jan 22 14:43:11 2025 -0500

    atomic64: Use arch_spin_locks instead of raw_spin_locks
    
    commit 6c8ad3ab45ad0e94bfb7a9c71f2fa9c6cacea4b2 upstream.
    
    raw_spin_locks can be traced by lockdep or tracing itself. Atomic64
    operations can be used in the tracing infrastructure. When an architecture
    does not have true atomic64 operations it can use the generic version that
    disables interrupts and uses spin_locks.
    
    The tracing ring buffer code uses atomic64 operations for the time
    keeping. But because some architectures use the default operations, the
    locking inside the atomic operations can cause an infinite recursion.
    
    As atomic64 implementation is architecture specific, it should not be
    using raw_spin_locks() but instead arch_spin_locks as that is the purpose
    of arch_spin_locks. To be used in architecture specific implementations of
    generic infrastructure like atomic64 operations.
    
    Note, by switching from raw_spin_locks to arch_spin_locks, the locks taken
    to emulate the atomic64 operations will not have lockdep, mmio, or any
    kind of checks done on them. They will not even disable preemption,
    although the code will disable interrupts preventing the tasks that hold
    the locks from being preempted. As the locks held are done so for very
    short periods of time, and the logic is only done to emulate atomic64, not
    having them be instrumented should not be an issue.
    
    Cc: [email protected]
    Cc: Mark Rutland <[email protected]>
    Cc: Mathieu Desnoyers <[email protected]>
    Cc: Andrew Morton <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Thomas Gleixner <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Andreas Larsson <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Fixes: c84897c0ff592 ("ring-buffer: Remove 32bit timestamp logic")
    Closes: https://lore.kernel.org/all/[email protected]/
    Reported-by: Ludwig Rydberg <[email protected]>
    Reviewed-by: Masami Hiramatsu (Google) <[email protected]>
    Signed-off-by: Steven Rostedt (Google) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
binfmt_flat: Fix integer overflow bug on 32 bit systems [+ + +]
Author: Dan Carpenter <[email protected]>
Date:   Wed Dec 4 15:07:15 2024 +0300

    binfmt_flat: Fix integer overflow bug on 32 bit systems
    
    commit 55cf2f4b945f6a6416cc2524ba740b83cc9af25a upstream.
    
    Most of these sizes and counts are capped at 256MB so the math doesn't
    result in an integer overflow.  The "relocs" count needs to be checked
    as well.  Otherwise on 32bit systems the calculation of "full_data"
    could be wrong.
    
            full_data = data_len + relocs * sizeof(unsigned long);
    
    Fixes: c995ee28d29d ("binfmt_flat: prevent kernel dammage from corrupted executable headers")
    Cc: [email protected]
    Signed-off-by: Dan Carpenter <[email protected]>
    Acked-by: Nicolas Pitre <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Kees Cook <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
blk-cgroup: Fix class @block_class's subsystem refcount leakage [+ + +]
Author: Zijun Hu <[email protected]>
Date:   Sun Jan 5 16:34:03 2025 +0800

    blk-cgroup: Fix class @block_class's subsystem refcount leakage
    
    commit d1248436cbef1f924c04255367ff4845ccd9025e upstream.
    
    blkcg_fill_root_iostats() iterates over @block_class's devices by
    class_dev_iter_(init|next)(), but does not end iterating with
    class_dev_iter_exit(), so causes the class's subsystem refcount leakage.
    
    Fix by ending the iterating with class_dev_iter_exit().
    
    Fixes: ef45fe470e1e ("blk-cgroup: show global disk stats in root cgroup io.stat")
    Reviewed-by: Michal Koutný <[email protected]>
    Cc: Greg Kroah-Hartman <[email protected]>
    Cc: [email protected]
    Acked-by: Tejun Heo <[email protected]>
    Signed-off-by: Zijun Hu <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
block: don't revert iter for -EIOCBQUEUED [+ + +]
Author: Jens Axboe <[email protected]>
Date:   Thu Jan 23 06:18:41 2025 -0700

    block: don't revert iter for -EIOCBQUEUED
    
    commit b13ee668e8280ca5b07f8ce2846b9957a8a10853 upstream.
    
    blkdev_read_iter() has a few odd checks, like gating the position and
    count adjustment on whether or not the result is bigger-than-or-equal to
    zero (where bigger than makes more sense), and not checking the return
    value of blkdev_direct_IO() before doing an iov_iter_revert(). The
    latter can lead to attempting to revert with a negative value, which
    when passed to iov_iter_revert() as an unsigned value will lead to
    throwing a WARN_ON() because unroll is bigger than MAX_RW_COUNT.
    
    Be sane and don't revert for -EIOCBQUEUED, like what is done in other
    spots.
    
    Cc: [email protected]
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

block: mark GFP_NOIO around sysfs ->store() [+ + +]
Author: Ming Lei <[email protected]>
Date:   Mon Jan 13 09:58:33 2025 +0800

    block: mark GFP_NOIO around sysfs ->store()
    
    commit 7c0be4ead1f8f5f8be0803f347de0de81e3b8e1c upstream.
    
    sysfs ->store is called with queue freezed, meantime we have several
    ->store() callbacks(update_nr_requests, wbt, scheduler) to allocate
    memory with GFP_KERNEL which may run into direct reclaim code path,
    then potential deadlock can be caused.
    
    Fix the issue by marking NOIO around sysfs ->store()
    
    Reported-by: Thomas Hellström <[email protected]>
    Cc: [email protected]
    Signed-off-by: Ming Lei <[email protected]>
    Reviewed-by: Christoph Hellwig <[email protected]>
    Reviewed-by: John Garry <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Link: https://lore.kernel.org/linux-block/Z4RkemI9f6N5zoEF@fedora/T/#mc774c65eeca5c024d29695f9ac6152b87763f305
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
Bluetooth: btusb: Add ID 0x2c7c:0x0130 for Qualcomm WCN785x [+ + +]
Author: Mark Dietzer <[email protected]>
Date:   Thu Dec 12 16:02:55 2024 -0800

    Bluetooth: btusb: Add ID 0x2c7c:0x0130 for Qualcomm WCN785x
    
    [ Upstream commit a6587d7ed2cd8341f8a92112ac772f2c44f09824 ]
    
    Adds a new entry with VID 0x2c7c and PID 0x0130 to the btusb quirks table as it uses a Qualcomm WCN785x chipset
    
    The device information from /sys/kernel/debug/usb/devices is provided below:
    T:  Bus=01 Lev=01 Prnt=01 Port=04 Cnt=05 Dev#=  7 Spd=12   MxCh= 0
    D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=2c7c ProdID=0130 Rev= 0.01
    C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
    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=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=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#= 1 Alt= 7 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  65 Ivl=1ms
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  65 Ivl=1ms
    
    Signed-off-by: Mark Dietzer <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

Bluetooth: btusb: Add new VID/PID 13d3/3610 for MT7922 [+ + +]
Author: Andrew Halaney <[email protected]>
Date:   Tue Dec 24 14:42:11 2024 -0600

    Bluetooth: btusb: Add new VID/PID 13d3/3610 for MT7922
    
    [ Upstream commit 45e7d389bf2e52dfc893779c611dd5cff461b590 ]
    
    A new machine has a Archer AX3000 / TX55e in it,
    and out the box reported issues resetting hci0. It looks like
    this is a MT7922 from the lspci output, so treat it as a MediaTek
    device and use the proper callbacks. With that in place an xbox
    controller can be used without issue as seen below:
    
        [    7.047388] Bluetooth: hci0: HW/SW Version: 0x008a008a, Build Time: 20241106163512
        [    9.583883] Bluetooth: hci0: Device setup in 2582842 usecs
        [    9.583895] Bluetooth: hci0: HCI Enhanced Setup Synchronous Connection command is advertised, but not supported.
        [    9.644780] Bluetooth: hci0: AOSP extensions version v1.00
        [    9.644784] Bluetooth: hci0: AOSP quality report is supported
        [  876.379876] input: Xbox Wireless Controller as /devices/virtual/misc/uhid/0005:045E:0B13.0006/input/input27
        [  876.380215] hid-generic 0005:045E:0B13.0006: input,hidraw3: BLUETOOTH HID v5.15 Gamepad [Xbox Wireless Controller] on c0:bf:be:27:de:f7
        [  876.429368] input: Xbox Wireless Controller as /devices/virtual/misc/uhid/0005:045E:0B13.0006/input/input28
        [  876.429423] microsoft 0005:045E:0B13.0006: input,hidraw3: BLUETOOTH HID v5.15 Gamepad [Xbox Wireless Controller] on c0:bf:be:27:de:f7
    
    lspci output:
    
        root@livingroom:/home/ajhalaney/git# lspci
        ...
        05:00.0 Network controller: MEDIATEK Corp. MT7922 802.11ax PCI Express Wireless Network Adapter
    
    and USB device:
    
        root@livingroom:/home/ajhalaney/git# cat /sys/kernel/debug/usb/devices
        ...
        T:  Bus=01 Lev=01 Prnt=01 Port=10 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=3610 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=btusb
        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=btusb
        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: Andrew Halaney <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

Bluetooth: btusb: Add new VID/PID 13d3/3628 for MT7925 [+ + +]
Author: En-Wei Wu <[email protected]>
Date:   Tue Dec 24 14:35:22 2024 +0800

    Bluetooth: btusb: Add new VID/PID 13d3/3628 for MT7925
    
    [ Upstream commit f63f401130e5c5cd0dd2f18c9df967ab75cd4732 ]
    
    Add VID 13d3 & PID 3628 for MediaTek MT7925 USB Bluetooth chip.
    
    The information in /sys/kernel/debug/usb/devices about the Bluetooth
    device is listed as the below.
    
    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=3628 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=btusb
    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=btusb
    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: En-Wei Wu <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

Bluetooth: L2CAP: accept zero as a special value for MTU auto-selection [+ + +]
Author: Fedor Pchelkin <[email protected]>
Date:   Wed Jan 29 00:08:14 2025 +0300

    Bluetooth: L2CAP: accept zero as a special value for MTU auto-selection
    
    commit 5c61419e02033eaf01733d66e2fcd4044808f482 upstream.
    
    One of the possible ways to enable the input MTU auto-selection for L2CAP
    connections is supposed to be through passing a special "0" value for it
    as a socket option. Commit [1] added one of those into avdtp. However, it
    simply wouldn't work because the kernel still treats the specified value
    as invalid and denies the setting attempt. Recorded BlueZ logs include the
    following:
    
      bluetoothd[496]: profiles/audio/avdtp.c:l2cap_connect() setsockopt(L2CAP_OPTIONS): Invalid argument (22)
    
    [1]: https://github.com/bluez/bluez/commit/ae5be371a9f53fed33d2b34748a95a5498fd4b77
    
    Found by Linux Verification Center (linuxtesting.org).
    
    Fixes: 4b6e228e297b ("Bluetooth: Auto tune if input MTU is set to 0")
    Cc: [email protected]
    Signed-off-by: Fedor Pchelkin <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Bluetooth: L2CAP: handle NULL sock pointer in l2cap_sock_alloc [+ + +]
Author: Fedor Pchelkin <[email protected]>
Date:   Wed Dec 18 00:19:59 2024 +0300

    Bluetooth: L2CAP: handle NULL sock pointer in l2cap_sock_alloc
    
    commit 5f397409f8ee5bc82901eeaf799e1cbc4f8edcf1 upstream.
    
    A NULL sock pointer is passed into l2cap_sock_alloc() when it is called
    from l2cap_sock_new_connection_cb() and the error handling paths should
    also be aware of it.
    
    Seemingly a more elegant solution would be to swap bt_sock_alloc() and
    l2cap_chan_create() calls since they are not interdependent to that moment
    but then l2cap_chan_create() adds the soon to be deallocated and still
    dummy-initialized channel to the global list accessible by many L2CAP
    paths. The channel would be removed from the list in short period of time
    but be a bit more straight-forward here and just check for NULL instead of
    changing the order of function calls.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE static
    analysis tool.
    
    Fixes: 7c4f78cdb8e7 ("Bluetooth: L2CAP: do not leave dangling sk pointer on error in l2cap_sock_create()")
    Cc: [email protected]
    Signed-off-by: Fedor Pchelkin <[email protected]>
    Reviewed-by: Kuniyuki Iwashima <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Bluetooth: MGMT: Fix slab-use-after-free Read in mgmt_remove_adv_monitor_sync [+ + +]
Author: Mazin Al Haddad <[email protected]>
Date:   Tue Dec 24 05:06:16 2024 +0300

    Bluetooth: MGMT: Fix slab-use-after-free Read in mgmt_remove_adv_monitor_sync
    
    [ Upstream commit 26fbd3494a7dd26269cb0817c289267dbcfdec06 ]
    
    This fixes the following crash:
    
    ==================================================================
    BUG: KASAN: slab-use-after-free in mgmt_remove_adv_monitor_sync+0x3a/0xd0 net/bluetooth/mgmt.c:5543
    Read of size 8 at addr ffff88814128f898 by task kworker/u9:4/5961
    
    CPU: 1 UID: 0 PID: 5961 Comm: kworker/u9:4 Not tainted 6.12.0-syzkaller-10684-gf1cd565ce577 #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
    Workqueue: hci0 hci_cmd_sync_work
    Call Trace:
     <TASK>
     __dump_stack lib/dump_stack.c:94 [inline]
     dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
     print_address_description mm/kasan/report.c:378 [inline]
     print_report+0x169/0x550 mm/kasan/report.c:489
     kasan_report+0x143/0x180 mm/kasan/report.c:602
     mgmt_remove_adv_monitor_sync+0x3a/0xd0 net/bluetooth/mgmt.c:5543
     hci_cmd_sync_work+0x22b/0x400 net/bluetooth/hci_sync.c:332
     process_one_work kernel/workqueue.c:3229 [inline]
     process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310
     worker_thread+0x870/0xd30 kernel/workqueue.c:3391
     kthread+0x2f0/0x390 kernel/kthread.c:389
     ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
     ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
     </TASK>
    
    Allocated by task 16026:
     kasan_save_stack mm/kasan/common.c:47 [inline]
     kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
     poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
     __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394
     kasan_kmalloc include/linux/kasan.h:260 [inline]
     __kmalloc_cache_noprof+0x243/0x390 mm/slub.c:4314
     kmalloc_noprof include/linux/slab.h:901 [inline]
     kzalloc_noprof include/linux/slab.h:1037 [inline]
     mgmt_pending_new+0x65/0x250 net/bluetooth/mgmt_util.c:269
     mgmt_pending_add+0x36/0x120 net/bluetooth/mgmt_util.c:296
     remove_adv_monitor+0x102/0x1b0 net/bluetooth/mgmt.c:5568
     hci_mgmt_cmd+0xc47/0x11d0 net/bluetooth/hci_sock.c:1712
     hci_sock_sendmsg+0x7b8/0x11c0 net/bluetooth/hci_sock.c:1832
     sock_sendmsg_nosec net/socket.c:711 [inline]
     __sock_sendmsg+0x221/0x270 net/socket.c:726
     sock_write_iter+0x2d7/0x3f0 net/socket.c:1147
     new_sync_write fs/read_write.c:586 [inline]
     vfs_write+0xaeb/0xd30 fs/read_write.c:679
     ksys_write+0x18f/0x2b0 fs/read_write.c:731
     do_syscall_x64 arch/x86/entry/common.c:52 [inline]
     do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
    Freed by task 16022:
     kasan_save_stack mm/kasan/common.c:47 [inline]
     kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
     kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:582
     poison_slab_object mm/kasan/common.c:247 [inline]
     __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264
     kasan_slab_free include/linux/kasan.h:233 [inline]
     slab_free_hook mm/slub.c:2338 [inline]
     slab_free mm/slub.c:4598 [inline]
     kfree+0x196/0x420 mm/slub.c:4746
     mgmt_pending_foreach+0xd1/0x130 net/bluetooth/mgmt_util.c:259
     __mgmt_power_off+0x183/0x430 net/bluetooth/mgmt.c:9550
     hci_dev_close_sync+0x6c4/0x11c0 net/bluetooth/hci_sync.c:5208
     hci_dev_do_close net/bluetooth/hci_core.c:483 [inline]
     hci_dev_close+0x112/0x210 net/bluetooth/hci_core.c:508
     sock_do_ioctl+0x158/0x460 net/socket.c:1209
     sock_ioctl+0x626/0x8e0 net/socket.c:1328
     vfs_ioctl fs/ioctl.c:51 [inline]
     __do_sys_ioctl fs/ioctl.c:906 [inline]
     __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
     do_syscall_x64 arch/x86/entry/common.c:52 [inline]
     do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
    Reported-by: [email protected]
    Closes: https://syzkaller.appspot.com/bug?extid=479aff51bb361ef5aa18
    Tested-by: [email protected]
    Signed-off-by: Mazin Al Haddad <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
bpf: Improve verifier log for resource leak on exit [+ + +]
Author: Kumar Kartikeya Dwivedi <[email protected]>
Date:   Tue Dec 3 19:03:58 2024 -0800

    bpf: Improve verifier log for resource leak on exit
    
    [ Upstream commit cbd8730aea8d79cda6b0f3c18b406dfdef0c1b80 ]
    
    The verifier log when leaking resources on BPF_EXIT may be a bit
    confusing, as it's a problem only when finally existing from the main
    prog, not from any of the subprogs. Hence, update the verifier error
    string and the corresponding selftests matching on it.
    
    Acked-by: Eduard Zingerman <[email protected]>
    Suggested-by: Eduard Zingerman <[email protected]>
    Signed-off-by: Kumar Kartikeya Dwivedi <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
btrfs: convert BUG_ON in btrfs_reloc_cow_block() to proper error handling [+ + +]
Author: Josef Bacik <[email protected]>
Date:   Thu Oct 3 11:43:03 2024 -0400

    btrfs: convert BUG_ON in btrfs_reloc_cow_block() to proper error handling
    
    [ Upstream commit 6a4730b325aaa48f7a5d5ba97aff0a955e2d9cec ]
    
    This BUG_ON is meant to catch backref cache problems, but these can
    arise from either bugs in the backref cache or corruption in the extent
    tree.  Fix it to be a proper error.
    
    Reviewed-by: Boris Burkov <[email protected]>
    Signed-off-by: Josef Bacik <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

btrfs: do not output error message if a qgroup has been already cleaned up [+ + +]
Author: Qu Wenruo <[email protected]>
Date:   Mon Jan 20 09:40:43 2025 +1030

    btrfs: do not output error message if a qgroup has been already cleaned up
    
    [ Upstream commit c9c863793395cf0a66c2778a29d72c48c02fbb66 ]
    
    [BUG]
    There is a bug report that btrfs outputs the following error message:
    
      BTRFS info (device nvme0n1p2): qgroup scan completed (inconsistency flag cleared)
      BTRFS warning (device nvme0n1p2): failed to cleanup qgroup 0/1179: -2
    
    [CAUSE]
    The error itself is pretty harmless, and the end user should ignore it.
    
    When a subvolume is fully dropped, btrfs will call
    btrfs_qgroup_cleanup_dropped_subvolume() to delete the qgroup.
    
    However if a qgroup rescan happened before a subvolume fully dropped,
    qgroup for that subvolume will not be re-created, as rescan will only
    create new qgroup if there is a BTRFS_ROOT_REF_KEY found.
    
    But before we drop a subvolume, the subvolume is unlinked thus there is no
    BTRFS_ROOT_REF_KEY.
    
    In that case, btrfs_remove_qgroup() will fail with -ENOENT and trigger
    the above error message.
    
    [FIX]
    Just ignore -ENOENT error from btrfs_remove_qgroup() inside
    btrfs_qgroup_cleanup_dropped_subvolume().
    
    Reported-by: John Shand <[email protected]>
    Link: https://bugzilla.suse.com/show_bug.cgi?id=1236056
    Fixes: 839d6ea4f86d ("btrfs: automatically remove the subvolume qgroup")
    Reviewed-by: Filipe Manana <[email protected]>
    Signed-off-by: Qu Wenruo <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

btrfs: don't use btrfs_set_item_key_safe on RAID stripe-extents [+ + +]
Author: Johannes Thumshirn <[email protected]>
Date:   Mon Jan 13 20:31:49 2025 +0100

    btrfs: don't use btrfs_set_item_key_safe on RAID stripe-extents
    
    [ Upstream commit dc14ba10781bd2629835696b7cc1febf914768e9 ]
    
    Don't use btrfs_set_item_key_safe() to modify the keys in the RAID
    stripe-tree, as this can lead to corruption of the tree, which is caught
    by the checks in btrfs_set_item_key_safe():
    
     BTRFS info (device nvme1n1): leaf 49168384 gen 15 total ptrs 194 free space 8329 owner 12
     BTRFS info (device nvme1n1): refs 2 lock_owner 1030 current 1030
      [ snip ]
      item 105 key (354549760 230 20480) itemoff 14587 itemsize 16
                      stride 0 devid 5 physical 67502080
      item 106 key (354631680 230 4096) itemoff 14571 itemsize 16
                      stride 0 devid 1 physical 88559616
      item 107 key (354631680 230 32768) itemoff 14555 itemsize 16
                      stride 0 devid 1 physical 88555520
      item 108 key (354717696 230 28672) itemoff 14539 itemsize 16
                      stride 0 devid 2 physical 67604480
      [ snip ]
     BTRFS critical (device nvme1n1): slot 106 key (354631680 230 32768) new key (354635776 230 4096)
     ------------[ cut here ]------------
     kernel BUG at fs/btrfs/ctree.c:2602!
     Oops: invalid opcode: 0000 [#1] PREEMPT SMP PTI
     CPU: 1 UID: 0 PID: 1055 Comm: fsstress Not tainted 6.13.0-rc1+ #1464
     Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014
     RIP: 0010:btrfs_set_item_key_safe+0xf7/0x270
     Code: <snip>
     RSP: 0018:ffffc90001337ab0 EFLAGS: 00010287
     RAX: 0000000000000000 RBX: ffff8881115fd000 RCX: 0000000000000000
     RDX: 0000000000000001 RSI: 0000000000000001 RDI: 00000000ffffffff
     RBP: ffff888110ed6f50 R08: 00000000ffffefff R09: ffffffff8244c500
     R10: 00000000ffffefff R11: 00000000ffffffff R12: ffff888100586000
     R13: 00000000000000c9 R14: ffffc90001337b1f R15: ffff888110f23b58
     FS:  00007f7d75c72740(0000) GS:ffff88813bd00000(0000) knlGS:0000000000000000
     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: 00007fa811652c60 CR3: 0000000111398001 CR4: 0000000000370eb0
     Call Trace:
      <TASK>
      ? __die_body.cold+0x14/0x1a
      ? die+0x2e/0x50
      ? do_trap+0xca/0x110
      ? do_error_trap+0x65/0x80
      ? btrfs_set_item_key_safe+0xf7/0x270
      ? exc_invalid_op+0x50/0x70
      ? btrfs_set_item_key_safe+0xf7/0x270
      ? asm_exc_invalid_op+0x1a/0x20
      ? btrfs_set_item_key_safe+0xf7/0x270
      btrfs_partially_delete_raid_extent+0xc4/0xe0
      btrfs_delete_raid_extent+0x227/0x240
      __btrfs_free_extent.isra.0+0x57f/0x9c0
      ? exc_coproc_segment_overrun+0x40/0x40
      __btrfs_run_delayed_refs+0x2fa/0xe80
      btrfs_run_delayed_refs+0x81/0xe0
      btrfs_commit_transaction+0x2dd/0xbe0
      ? preempt_count_add+0x52/0xb0
      btrfs_sync_file+0x375/0x4c0
      do_fsync+0x39/0x70
      __x64_sys_fsync+0x13/0x20
      do_syscall_64+0x54/0x110
      entry_SYSCALL_64_after_hwframe+0x76/0x7e
     RIP: 0033:0x7f7d7550ef90
     Code: <snip>
     RSP: 002b:00007ffd70237248 EFLAGS: 00000202 ORIG_RAX: 000000000000004a
     RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f7d7550ef90
     RDX: 000000000000013a RSI: 000000000040eb28 RDI: 0000000000000004
     RBP: 000000000000001b R08: 0000000000000078 R09: 00007ffd7023725c
     R10: 00007f7d75400390 R11: 0000000000000202 R12: 028f5c28f5c28f5c
     R13: 8f5c28f5c28f5c29 R14: 000000000040b520 R15: 00007f7d75c726c8
      </TASK>
    
    While the root cause of the tree order corruption isn't clear, using
    btrfs_duplicate_item() to copy the item and then adjusting both the key
    and the per-device physical addresses is a safe way to counter this
    problem.
    
    Signed-off-by: Johannes Thumshirn <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

btrfs: fix assertion failure when splitting ordered extent after transaction abort [+ + +]
Author: Filipe Manana <[email protected]>
Date:   Mon Jan 13 15:01:08 2025 +0000

    btrfs: fix assertion failure when splitting ordered extent after transaction abort
    
    [ Upstream commit 0d85f5c2dd91df6b5da454406756f463ba923b69 ]
    
    If while we are doing a direct IO write a transaction abort happens, we
    mark all existing ordered extents with the BTRFS_ORDERED_IOERR flag (done
    at btrfs_destroy_ordered_extents()), and then after that if we enter
    btrfs_split_ordered_extent() and the ordered extent has bytes left
    (meaning we have a bio that doesn't cover the whole ordered extent, see
    details at btrfs_extract_ordered_extent()), we will fail on the following
    assertion at btrfs_split_ordered_extent():
    
       ASSERT(!(flags & ~BTRFS_ORDERED_TYPE_FLAGS));
    
    because the BTRFS_ORDERED_IOERR flag is set and the definition of
    BTRFS_ORDERED_TYPE_FLAGS is just the union of all flags that identify the
    type of write (regular, nocow, prealloc, compressed, direct IO, encoded).
    
    Fix this by returning an error from btrfs_extract_ordered_extent() if we
    find the BTRFS_ORDERED_IOERR flag in the ordered extent. The error will
    be the error that resulted in the transaction abort or -EIO if no
    transaction abort happened.
    
    This was recently reported by syzbot with the following trace:
    
       FAULT_INJECTION: forcing a failure.
       name failslab, interval 1, probability 0, space 0, times 1
       CPU: 0 UID: 0 PID: 5321 Comm: syz.0.0 Not tainted 6.13.0-rc5-syzkaller #0
       Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
       Call Trace:
        <TASK>
        __dump_stack lib/dump_stack.c:94 [inline]
        dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
        fail_dump lib/fault-inject.c:53 [inline]
        should_fail_ex+0x3b0/0x4e0 lib/fault-inject.c:154
        should_failslab+0xac/0x100 mm/failslab.c:46
        slab_pre_alloc_hook mm/slub.c:4072 [inline]
        slab_alloc_node mm/slub.c:4148 [inline]
        __do_kmalloc_node mm/slub.c:4297 [inline]
        __kmalloc_noprof+0xdd/0x4c0 mm/slub.c:4310
        kmalloc_noprof include/linux/slab.h:905 [inline]
        kzalloc_noprof include/linux/slab.h:1037 [inline]
        btrfs_chunk_alloc_add_chunk_item+0x244/0x1100 fs/btrfs/volumes.c:5742
        reserve_chunk_space+0x1ca/0x2c0 fs/btrfs/block-group.c:4292
        check_system_chunk fs/btrfs/block-group.c:4319 [inline]
        do_chunk_alloc fs/btrfs/block-group.c:3891 [inline]
        btrfs_chunk_alloc+0x77b/0xf80 fs/btrfs/block-group.c:4187
        find_free_extent_update_loop fs/btrfs/extent-tree.c:4166 [inline]
        find_free_extent+0x42d1/0x5810 fs/btrfs/extent-tree.c:4579
        btrfs_reserve_extent+0x422/0x810 fs/btrfs/extent-tree.c:4672
        btrfs_new_extent_direct fs/btrfs/direct-io.c:186 [inline]
        btrfs_get_blocks_direct_write+0x706/0xfa0 fs/btrfs/direct-io.c:321
        btrfs_dio_iomap_begin+0xbb7/0x1180 fs/btrfs/direct-io.c:525
        iomap_iter+0x697/0xf60 fs/iomap/iter.c:90
        __iomap_dio_rw+0xeb9/0x25b0 fs/iomap/direct-io.c:702
        btrfs_dio_write fs/btrfs/direct-io.c:775 [inline]
        btrfs_direct_write+0x610/0xa30 fs/btrfs/direct-io.c:880
        btrfs_do_write_iter+0x2a0/0x760 fs/btrfs/file.c:1397
        do_iter_readv_writev+0x600/0x880
        vfs_writev+0x376/0xba0 fs/read_write.c:1050
        do_pwritev fs/read_write.c:1146 [inline]
        __do_sys_pwritev2 fs/read_write.c:1204 [inline]
        __se_sys_pwritev2+0x196/0x2b0 fs/read_write.c:1195
        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
        do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
        entry_SYSCALL_64_after_hwframe+0x77/0x7f
       RIP: 0033:0x7f1281f85d29
       RSP: 002b:00007f12819fe038 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
       RAX: ffffffffffffffda RBX: 00007f1282176080 RCX: 00007f1281f85d29
       RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000005
       RBP: 00007f12819fe090 R08: 0000000000000000 R09: 0000000000000003
       R10: 0000000000007000 R11: 0000000000000246 R12: 0000000000000002
       R13: 0000000000000000 R14: 00007f1282176080 R15: 00007ffcb9e23328
        </TASK>
       BTRFS error (device loop0 state A): Transaction aborted (error -12)
       BTRFS: error (device loop0 state A) in btrfs_chunk_alloc_add_chunk_item:5745: errno=-12 Out of memory
       BTRFS info (device loop0 state EA): forced readonly
       assertion failed: !(flags & ~BTRFS_ORDERED_TYPE_FLAGS), in fs/btrfs/ordered-data.c:1234
       ------------[ cut here ]------------
       kernel BUG at fs/btrfs/ordered-data.c:1234!
       Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
       CPU: 0 UID: 0 PID: 5321 Comm: syz.0.0 Not tainted 6.13.0-rc5-syzkaller #0
       Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
       RIP: 0010:btrfs_split_ordered_extent+0xd8d/0xe20 fs/btrfs/ordered-data.c:1234
       RSP: 0018:ffffc9000d1df2b8 EFLAGS: 00010246
       RAX: 0000000000000057 RBX: 000000000006a000 RCX: 9ce21886c4195300
       RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
       RBP: 0000000000000091 R08: ffffffff817f0a3c R09: 1ffff92001a3bdf4
       R10: dffffc0000000000 R11: fffff52001a3bdf5 R12: 1ffff1100a45f401
       R13: ffff8880522fa018 R14: dffffc0000000000 R15: 000000000006a000
       FS:  00007f12819fe6c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 0000557750bd7da8 CR3: 00000000400ea000 CR4: 0000000000352ef0
       DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
       DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
       Call Trace:
        <TASK>
        btrfs_extract_ordered_extent fs/btrfs/direct-io.c:702 [inline]
        btrfs_dio_submit_io+0x4be/0x6d0 fs/btrfs/direct-io.c:737
        iomap_dio_submit_bio fs/iomap/direct-io.c:85 [inline]
        iomap_dio_bio_iter+0x1022/0x1740 fs/iomap/direct-io.c:447
        __iomap_dio_rw+0x13b7/0x25b0 fs/iomap/direct-io.c:703
        btrfs_dio_write fs/btrfs/direct-io.c:775 [inline]
        btrfs_direct_write+0x610/0xa30 fs/btrfs/direct-io.c:880
        btrfs_do_write_iter+0x2a0/0x760 fs/btrfs/file.c:1397
        do_iter_readv_writev+0x600/0x880
        vfs_writev+0x376/0xba0 fs/read_write.c:1050
        do_pwritev fs/read_write.c:1146 [inline]
        __do_sys_pwritev2 fs/read_write.c:1204 [inline]
        __se_sys_pwritev2+0x196/0x2b0 fs/read_write.c:1195
        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
        do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
        entry_SYSCALL_64_after_hwframe+0x77/0x7f
       RIP: 0033:0x7f1281f85d29
       RSP: 002b:00007f12819fe038 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
       RAX: ffffffffffffffda RBX: 00007f1282176080 RCX: 00007f1281f85d29
       RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000005
       RBP: 00007f12819fe090 R08: 0000000000000000 R09: 0000000000000003
       R10: 0000000000007000 R11: 0000000000000246 R12: 0000000000000002
       R13: 0000000000000000 R14: 00007f1282176080 R15: 00007ffcb9e23328
        </TASK>
       Modules linked in:
       ---[ end trace 0000000000000000 ]---
       RIP: 0010:btrfs_split_ordered_extent+0xd8d/0xe20 fs/btrfs/ordered-data.c:1234
       RSP: 0018:ffffc9000d1df2b8 EFLAGS: 00010246
       RAX: 0000000000000057 RBX: 000000000006a000 RCX: 9ce21886c4195300
       RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
       RBP: 0000000000000091 R08: ffffffff817f0a3c R09: 1ffff92001a3bdf4
       R10: dffffc0000000000 R11: fffff52001a3bdf5 R12: 1ffff1100a45f401
       R13: ffff8880522fa018 R14: dffffc0000000000 R15: 000000000006a000
       FS:  00007f12819fe6c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 0000557750bd7da8 CR3: 00000000400ea000 CR4: 0000000000352ef0
       DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
       DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    
    In this case the transaction abort was due to (an injected) memory
    allocation failure when attempting to allocate a new chunk.
    
    Reported-by: [email protected]
    Link: https://lore.kernel.org/linux-btrfs/[email protected]/
    Fixes: 52b1fdca23ac ("btrfs: handle completed ordered extents in btrfs_split_ordered_extent")
    Reviewed-by: Qu Wenruo <[email protected]>
    Signed-off-by: Filipe Manana <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

btrfs: fix data race when accessing the inode's disk_i_size at btrfs_drop_extents() [+ + +]
Author: Hao-ran Zheng <[email protected]>
Date:   Tue Dec 3 15:56:51 2024 +0800

    btrfs: fix data race when accessing the inode's disk_i_size at btrfs_drop_extents()
    
    [ Upstream commit 5324c4e10e9c2ce307a037e904c0d9671d7137d9 ]
    
    A data race occurs when the function `insert_ordered_extent_file_extent()`
    and the function `btrfs_inode_safe_disk_i_size_write()` are executed
    concurrently. The function `insert_ordered_extent_file_extent()` is not
    locked when reading inode->disk_i_size, causing
    `btrfs_inode_safe_disk_i_size_write()` to cause data competition when
    writing inode->disk_i_size, thus affecting the value of `modify_tree`.
    
    The specific call stack that appears during testing is as follows:
    
      ============DATA_RACE============
       btrfs_drop_extents+0x89a/0xa060 [btrfs]
       insert_reserved_file_extent+0xb54/0x2960 [btrfs]
       insert_ordered_extent_file_extent+0xff5/0x1760 [btrfs]
       btrfs_finish_one_ordered+0x1b85/0x36a0 [btrfs]
       btrfs_finish_ordered_io+0x37/0x60 [btrfs]
       finish_ordered_fn+0x3e/0x50 [btrfs]
       btrfs_work_helper+0x9c9/0x27a0 [btrfs]
       process_scheduled_works+0x716/0xf10
       worker_thread+0xb6a/0x1190
       kthread+0x292/0x330
       ret_from_fork+0x4d/0x80
       ret_from_fork_asm+0x1a/0x30
      ============OTHER_INFO============
       btrfs_inode_safe_disk_i_size_write+0x4ec/0x600 [btrfs]
       btrfs_finish_one_ordered+0x24c7/0x36a0 [btrfs]
       btrfs_finish_ordered_io+0x37/0x60 [btrfs]
       finish_ordered_fn+0x3e/0x50 [btrfs]
       btrfs_work_helper+0x9c9/0x27a0 [btrfs]
       process_scheduled_works+0x716/0xf10
       worker_thread+0xb6a/0x1190
       kthread+0x292/0x330
       ret_from_fork+0x4d/0x80
       ret_from_fork_asm+0x1a/0x30
      =================================
    
    The main purpose of the check of the inode's disk_i_size is to avoid
    taking write locks on a btree path when we have a write at or beyond
    EOF, since in these cases we don't expect to find extent items in the
    root to drop. However if we end up taking write locks due to a data
    race on disk_i_size, everything is still correct, we only add extra
    lock contention on the tree in case there's concurrency from other tasks.
    If the race causes us to not take write locks when we actually need them,
    then everything is functionally correct as well, since if we find out we
    have extent items to drop and we took read locks (modify_tree set to 0),
    we release the path and retry again with write locks.
    
    Since this data race does not affect the correctness of the function,
    it is a harmless data race, use data_race() to check inode->disk_i_size.
    
    Reviewed-by: Filipe Manana <[email protected]>
    Signed-off-by: Hao-ran Zheng <[email protected]>
    Signed-off-by: Filipe Manana <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

btrfs: fix lockdep splat while merging a relocation root [+ + +]
Author: Filipe Manana <[email protected]>
Date:   Fri Jan 10 15:22:24 2025 +0000

    btrfs: fix lockdep splat while merging a relocation root
    
    [ Upstream commit a216542027b892e6651c1b4e076012140d04afaf ]
    
    When COWing a relocation tree path, at relocation.c:replace_path(), we
    can trigger a lockdep splat while we are in the btrfs_search_slot() call
    against the relocation root. This happens in that callchain at
    ctree.c:read_block_for_search() when we happen to find a child extent
    buffer already loaded through the fs tree with a lockdep class set to
    the fs tree. So when we attempt to lock that extent buffer through a
    relocation tree we have to reset the lockdep class to the class for a
    relocation tree, since a relocation tree has extent buffers that used
    to belong to a fs tree and may currently be already loaded (we swap
    extent buffers between the two trees at the end of replace_path()).
    
    However we are missing calls to btrfs_maybe_reset_lockdep_class() to reset
    the lockdep class at ctree.c:read_block_for_search() before we read lock
    an extent buffer, just like we did for btrfs_search_slot() in commit
    b40130b23ca4 ("btrfs: fix lockdep splat with reloc root extent buffers").
    
    So add the missing btrfs_maybe_reset_lockdep_class() calls before the
    attempts to read lock an extent buffer at ctree.c:read_block_for_search().
    
    The lockdep splat was reported by syzbot and it looks like this:
    
       ======================================================
       WARNING: possible circular locking dependency detected
       6.13.0-rc5-syzkaller-00163-gab75170520d4 #0 Not tainted
       ------------------------------------------------------
       syz.0.0/5335 is trying to acquire lock:
       ffff8880545dbc38 (btrfs-tree-01){++++}-{4:4}, at: btrfs_tree_read_lock_nested+0x2f/0x250 fs/btrfs/locking.c:146
    
       but task is already holding lock:
       ffff8880545dba58 (btrfs-treloc-02/1){+.+.}-{4:4}, at: btrfs_tree_lock_nested+0x2f/0x250 fs/btrfs/locking.c:189
    
       which lock already depends on the new lock.
    
       the existing dependency chain (in reverse order) is:
    
       -> #2 (btrfs-treloc-02/1){+.+.}-{4:4}:
              reacquire_held_locks+0x3eb/0x690 kernel/locking/lockdep.c:5374
              __lock_release kernel/locking/lockdep.c:5563 [inline]
              lock_release+0x396/0xa30 kernel/locking/lockdep.c:5870
              up_write+0x79/0x590 kernel/locking/rwsem.c:1629
              btrfs_force_cow_block+0x14b3/0x1fd0 fs/btrfs/ctree.c:660
              btrfs_cow_block+0x371/0x830 fs/btrfs/ctree.c:755
              btrfs_search_slot+0xc01/0x3180 fs/btrfs/ctree.c:2153
              replace_path+0x1243/0x2740 fs/btrfs/relocation.c:1224
              merge_reloc_root+0xc46/0x1ad0 fs/btrfs/relocation.c:1692
              merge_reloc_roots+0x3b3/0x980 fs/btrfs/relocation.c:1942
              relocate_block_group+0xb0a/0xd40 fs/btrfs/relocation.c:3754
              btrfs_relocate_block_group+0x77d/0xd90 fs/btrfs/relocation.c:4087
              btrfs_relocate_chunk+0x12c/0x3b0 fs/btrfs/volumes.c:3494
              __btrfs_balance+0x1b0f/0x26b0 fs/btrfs/volumes.c:4278
              btrfs_balance+0xbdc/0x10c0 fs/btrfs/volumes.c:4655
              btrfs_ioctl_balance+0x493/0x7c0 fs/btrfs/ioctl.c:3670
              vfs_ioctl fs/ioctl.c:51 [inline]
              __do_sys_ioctl fs/ioctl.c:906 [inline]
              __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
              do_syscall_x64 arch/x86/entry/common.c:52 [inline]
              do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
              entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
       -> #1 (btrfs-tree-01/1){+.+.}-{4:4}:
              lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
              down_write_nested+0xa2/0x220 kernel/locking/rwsem.c:1693
              btrfs_tree_lock_nested+0x2f/0x250 fs/btrfs/locking.c:189
              btrfs_init_new_buffer fs/btrfs/extent-tree.c:5052 [inline]
              btrfs_alloc_tree_block+0x41c/0x1440 fs/btrfs/extent-tree.c:5132
              btrfs_force_cow_block+0x526/0x1fd0 fs/btrfs/ctree.c:573
              btrfs_cow_block+0x371/0x830 fs/btrfs/ctree.c:755
              btrfs_search_slot+0xc01/0x3180 fs/btrfs/ctree.c:2153
              btrfs_insert_empty_items+0x9c/0x1a0 fs/btrfs/ctree.c:4351
              btrfs_insert_empty_item fs/btrfs/ctree.h:688 [inline]
              btrfs_insert_inode_ref+0x2bb/0xf80 fs/btrfs/inode-item.c:330
              btrfs_rename_exchange fs/btrfs/inode.c:7990 [inline]
              btrfs_rename2+0xcb7/0x2b90 fs/btrfs/inode.c:8374
              vfs_rename+0xbdb/0xf00 fs/namei.c:5067
              do_renameat2+0xd94/0x13f0 fs/namei.c:5224
              __do_sys_renameat2 fs/namei.c:5258 [inline]
              __se_sys_renameat2 fs/namei.c:5255 [inline]
              __x64_sys_renameat2+0xce/0xe0 fs/namei.c:5255
              do_syscall_x64 arch/x86/entry/common.c:52 [inline]
              do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
              entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
       -> #0 (btrfs-tree-01){++++}-{4:4}:
              check_prev_add kernel/locking/lockdep.c:3161 [inline]
              check_prevs_add kernel/locking/lockdep.c:3280 [inline]
              validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904
              __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5226
              lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
              down_read_nested+0xb5/0xa50 kernel/locking/rwsem.c:1649
              btrfs_tree_read_lock_nested+0x2f/0x250 fs/btrfs/locking.c:146
              btrfs_tree_read_lock fs/btrfs/locking.h:188 [inline]
              read_block_for_search+0x718/0xbb0 fs/btrfs/ctree.c:1610
              btrfs_search_slot+0x1274/0x3180 fs/btrfs/ctree.c:2237
              replace_path+0x1243/0x2740 fs/btrfs/relocation.c:1224
              merge_reloc_root+0xc46/0x1ad0 fs/btrfs/relocation.c:1692
              merge_reloc_roots+0x3b3/0x980 fs/btrfs/relocation.c:1942
              relocate_block_group+0xb0a/0xd40 fs/btrfs/relocation.c:3754
              btrfs_relocate_block_group+0x77d/0xd90 fs/btrfs/relocation.c:4087
              btrfs_relocate_chunk+0x12c/0x3b0 fs/btrfs/volumes.c:3494
              __btrfs_balance+0x1b0f/0x26b0 fs/btrfs/volumes.c:4278
              btrfs_balance+0xbdc/0x10c0 fs/btrfs/volumes.c:4655
              btrfs_ioctl_balance+0x493/0x7c0 fs/btrfs/ioctl.c:3670
              vfs_ioctl fs/ioctl.c:51 [inline]
              __do_sys_ioctl fs/ioctl.c:906 [inline]
              __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
              do_syscall_x64 arch/x86/entry/common.c:52 [inline]
              do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
              entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
       other info that might help us debug this:
    
       Chain exists of:
         btrfs-tree-01 --> btrfs-tree-01/1 --> btrfs-treloc-02/1
    
        Possible unsafe locking scenario:
    
              CPU0                    CPU1
              ----                    ----
         lock(btrfs-treloc-02/1);
                                      lock(btrfs-tree-01/1);
                                      lock(btrfs-treloc-02/1);
         rlock(btrfs-tree-01);
    
        *** DEADLOCK ***
    
       8 locks held by syz.0.0/5335:
        #0: ffff88801e3ae420 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write_file+0x5e/0x200 fs/namespace.c:559
        #1: ffff888052c760d0 (&fs_info->reclaim_bgs_lock){+.+.}-{4:4}, at: __btrfs_balance+0x4c2/0x26b0 fs/btrfs/volumes.c:4183
        #2: ffff888052c74850 (&fs_info->cleaner_mutex){+.+.}-{4:4}, at: btrfs_relocate_block_group+0x775/0xd90 fs/btrfs/relocation.c:4086
        #3: ffff88801e3ae610 (sb_internal#2){.+.+}-{0:0}, at: merge_reloc_root+0xf11/0x1ad0 fs/btrfs/relocation.c:1659
        #4: ffff888052c76470 (btrfs_trans_num_writers){++++}-{0:0}, at: join_transaction+0x405/0xda0 fs/btrfs/transaction.c:288
        #5: ffff888052c76498 (btrfs_trans_num_extwriters){++++}-{0:0}, at: join_transaction+0x405/0xda0 fs/btrfs/transaction.c:288
        #6: ffff8880545db878 (btrfs-tree-01/1){+.+.}-{4:4}, at: btrfs_tree_lock_nested+0x2f/0x250 fs/btrfs/locking.c:189
        #7: ffff8880545dba58 (btrfs-treloc-02/1){+.+.}-{4:4}, at: btrfs_tree_lock_nested+0x2f/0x250 fs/btrfs/locking.c:189
    
       stack backtrace:
       CPU: 0 UID: 0 PID: 5335 Comm: syz.0.0 Not tainted 6.13.0-rc5-syzkaller-00163-gab75170520d4 #0
       Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
       Call Trace:
        <TASK>
        __dump_stack lib/dump_stack.c:94 [inline]
        dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
        print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2074
        check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2206
        check_prev_add kernel/locking/lockdep.c:3161 [inline]
        check_prevs_add kernel/locking/lockdep.c:3280 [inline]
        validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904
        __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5226
        lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
        down_read_nested+0xb5/0xa50 kernel/locking/rwsem.c:1649
        btrfs_tree_read_lock_nested+0x2f/0x250 fs/btrfs/locking.c:146
        btrfs_tree_read_lock fs/btrfs/locking.h:188 [inline]
        read_block_for_search+0x718/0xbb0 fs/btrfs/ctree.c:1610
        btrfs_search_slot+0x1274/0x3180 fs/btrfs/ctree.c:2237
        replace_path+0x1243/0x2740 fs/btrfs/relocation.c:1224
        merge_reloc_root+0xc46/0x1ad0 fs/btrfs/relocation.c:1692
        merge_reloc_roots+0x3b3/0x980 fs/btrfs/relocation.c:1942
        relocate_block_group+0xb0a/0xd40 fs/btrfs/relocation.c:3754
        btrfs_relocate_block_group+0x77d/0xd90 fs/btrfs/relocation.c:4087
        btrfs_relocate_chunk+0x12c/0x3b0 fs/btrfs/volumes.c:3494
        __btrfs_balance+0x1b0f/0x26b0 fs/btrfs/volumes.c:4278
        btrfs_balance+0xbdc/0x10c0 fs/btrfs/volumes.c:4655
        btrfs_ioctl_balance+0x493/0x7c0 fs/btrfs/ioctl.c:3670
        vfs_ioctl fs/ioctl.c:51 [inline]
        __do_sys_ioctl fs/ioctl.c:906 [inline]
        __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
        do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
        entry_SYSCALL_64_after_hwframe+0x77/0x7f
       RIP: 0033:0x7f1ac6985d29
       Code: ff ff c3 (...)
       RSP: 002b:00007f1ac63fe038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
       RAX: ffffffffffffffda RBX: 00007f1ac6b76160 RCX: 00007f1ac6985d29
       RDX: 0000000020000180 RSI: 00000000c4009420 RDI: 0000000000000007
       RBP: 00007f1ac6a01b08 R08: 0000000000000000 R09: 0000000000000000
       R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
       R13: 0000000000000001 R14: 00007f1ac6b76160 R15: 00007fffda145a88
        </TASK>
    
    Reported-by: [email protected]
    Link: https://lore.kernel.org/linux-btrfs/[email protected]/
    Fixes: 99785998ed1c ("btrfs: reduce lock contention when eb cache miss for btree search")
    Signed-off-by: Filipe Manana <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

btrfs: fix use-after-free when attempting to join an aborted transaction [+ + +]
Author: Filipe Manana <[email protected]>
Date:   Mon Jan 20 17:26:10 2025 +0000

    btrfs: fix use-after-free when attempting to join an aborted transaction
    
    [ Upstream commit e2f0943cf37305dbdeaf9846e3c941451bcdef63 ]
    
    When we are trying to join the current transaction and if it's aborted,
    we read its 'aborted' field after unlocking fs_info->trans_lock and
    without holding any extra reference count on it. This means that a
    concurrent task that is aborting the transaction may free the transaction
    before we read its 'aborted' field, leading to a use-after-free.
    
    Fix this by reading the 'aborted' field while holding fs_info->trans_lock
    since any freeing task must first acquire that lock and set
    fs_info->running_transaction to NULL before freeing the transaction.
    
    This was reported by syzbot and Dmitry with the following stack traces
    from KASAN:
    
       ==================================================================
       BUG: KASAN: slab-use-after-free in join_transaction+0xd9b/0xda0 fs/btrfs/transaction.c:278
       Read of size 4 at addr ffff888011839024 by task kworker/u4:9/1128
    
       CPU: 0 UID: 0 PID: 1128 Comm: kworker/u4:9 Not tainted 6.13.0-rc7-syzkaller-00019-gc45323b7560e #0
       Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
       Workqueue: events_unbound btrfs_async_reclaim_data_space
       Call Trace:
        <TASK>
        __dump_stack lib/dump_stack.c:94 [inline]
        dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
        print_address_description mm/kasan/report.c:378 [inline]
        print_report+0x169/0x550 mm/kasan/report.c:489
        kasan_report+0x143/0x180 mm/kasan/report.c:602
        join_transaction+0xd9b/0xda0 fs/btrfs/transaction.c:278
        start_transaction+0xaf8/0x1670 fs/btrfs/transaction.c:697
        flush_space+0x448/0xcf0 fs/btrfs/space-info.c:803
        btrfs_async_reclaim_data_space+0x159/0x510 fs/btrfs/space-info.c:1321
        process_one_work kernel/workqueue.c:3236 [inline]
        process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3317
        worker_thread+0x870/0xd30 kernel/workqueue.c:3398
        kthread+0x2f0/0x390 kernel/kthread.c:389
        ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
        ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
        </TASK>
    
       Allocated by task 5315:
        kasan_save_stack mm/kasan/common.c:47 [inline]
        kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
        poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
        __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394
        kasan_kmalloc include/linux/kasan.h:260 [inline]
        __kmalloc_cache_noprof+0x243/0x390 mm/slub.c:4329
        kmalloc_noprof include/linux/slab.h:901 [inline]
        join_transaction+0x144/0xda0 fs/btrfs/transaction.c:308
        start_transaction+0xaf8/0x1670 fs/btrfs/transaction.c:697
        btrfs_create_common+0x1b2/0x2e0 fs/btrfs/inode.c:6572
        lookup_open fs/namei.c:3649 [inline]
        open_last_lookups fs/namei.c:3748 [inline]
        path_openat+0x1c03/0x3590 fs/namei.c:3984
        do_filp_open+0x27f/0x4e0 fs/namei.c:4014
        do_sys_openat2+0x13e/0x1d0 fs/open.c:1402
        do_sys_open fs/open.c:1417 [inline]
        __do_sys_creat fs/open.c:1495 [inline]
        __se_sys_creat fs/open.c:1489 [inline]
        __x64_sys_creat+0x123/0x170 fs/open.c:1489
        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
        do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
        entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
       Freed by task 5336:
        kasan_save_stack mm/kasan/common.c:47 [inline]
        kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
        kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:582
        poison_slab_object mm/kasan/common.c:247 [inline]
        __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264
        kasan_slab_free include/linux/kasan.h:233 [inline]
        slab_free_hook mm/slub.c:2353 [inline]
        slab_free mm/slub.c:4613 [inline]
        kfree+0x196/0x430 mm/slub.c:4761
        cleanup_transaction fs/btrfs/transaction.c:2063 [inline]
        btrfs_commit_transaction+0x2c97/0x3720 fs/btrfs/transaction.c:2598
        insert_balance_item+0x1284/0x20b0 fs/btrfs/volumes.c:3757
        btrfs_balance+0x992/0x10c0 fs/btrfs/volumes.c:4633
        btrfs_ioctl_balance+0x493/0x7c0 fs/btrfs/ioctl.c:3670
        vfs_ioctl fs/ioctl.c:51 [inline]
        __do_sys_ioctl fs/ioctl.c:906 [inline]
        __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
        do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
        entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
       The buggy address belongs to the object at ffff888011839000
        which belongs to the cache kmalloc-2k of size 2048
       The buggy address is located 36 bytes inside of
        freed 2048-byte region [ffff888011839000, ffff888011839800)
    
       The buggy address belongs to the physical page:
       page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11838
       head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
       flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
       page_type: f5(slab)
       raw: 00fff00000000040 ffff88801ac42000 ffffea0000493400 dead000000000002
       raw: 0000000000000000 0000000000080008 00000001f5000000 0000000000000000
       head: 00fff00000000040 ffff88801ac42000 ffffea0000493400 dead000000000002
       head: 0000000000000000 0000000000080008 00000001f5000000 0000000000000000
       head: 00fff00000000003 ffffea0000460e01 ffffffffffffffff 0000000000000000
       head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
       page dumped because: kasan: bad access detected
       page_owner tracks the page as allocated
       page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 57, tgid 57 (kworker/0:2), ts 67248182943, free_ts 67229742023
        set_page_owner include/linux/page_owner.h:32 [inline]
        post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1558
        prep_new_page mm/page_alloc.c:1566 [inline]
        get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3476
        __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753
        alloc_pages_mpol_noprof+0x3e1/0x780 mm/mempolicy.c:2269
        alloc_slab_page+0x6a/0x110 mm/slub.c:2423
        allocate_slab+0x5a/0x2b0 mm/slub.c:2589
        new_slab mm/slub.c:2642 [inline]
        ___slab_alloc+0xc27/0x14a0 mm/slub.c:3830
        __slab_alloc+0x58/0xa0 mm/slub.c:3920
        __slab_alloc_node mm/slub.c:3995 [inline]
        slab_alloc_node mm/slub.c:4156 [inline]
        __do_kmalloc_node mm/slub.c:4297 [inline]
        __kmalloc_node_track_caller_noprof+0x2e9/0x4c0 mm/slub.c:4317
        kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:609
        __alloc_skb+0x1f3/0x440 net/core/skbuff.c:678
        alloc_skb include/linux/skbuff.h:1323 [inline]
        alloc_skb_with_frags+0xc3/0x820 net/core/skbuff.c:6612
        sock_alloc_send_pskb+0x91a/0xa60 net/core/sock.c:2884
        sock_alloc_send_skb include/net/sock.h:1803 [inline]
        mld_newpack+0x1c3/0xaf0 net/ipv6/mcast.c:1747
        add_grhead net/ipv6/mcast.c:1850 [inline]
        add_grec+0x1492/0x19a0 net/ipv6/mcast.c:1988
        mld_send_cr net/ipv6/mcast.c:2114 [inline]
        mld_ifc_work+0x691/0xd90 net/ipv6/mcast.c:2651
       page last free pid 5300 tgid 5300 stack trace:
        reset_page_owner include/linux/page_owner.h:25 [inline]
        free_pages_prepare mm/page_alloc.c:1127 [inline]
        free_unref_page+0xd3f/0x1010 mm/page_alloc.c:2659
        __slab_free+0x2c2/0x380 mm/slub.c:4524
        qlink_free mm/kasan/quarantine.c:163 [inline]
        qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179
        kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286
        __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:329
        kasan_slab_alloc include/linux/kasan.h:250 [inline]
        slab_post_alloc_hook mm/slub.c:4119 [inline]
        slab_alloc_node mm/slub.c:4168 [inline]
        __do_kmalloc_node mm/slub.c:4297 [inline]
        __kmalloc_noprof+0x236/0x4c0 mm/slub.c:4310
        kmalloc_noprof include/linux/slab.h:905 [inline]
        kzalloc_noprof include/linux/slab.h:1037 [inline]
        fib_create_info+0xc14/0x25b0 net/ipv4/fib_semantics.c:1435
        fib_table_insert+0x1f6/0x1f20 net/ipv4/fib_trie.c:1231
        fib_magic+0x3d8/0x620 net/ipv4/fib_frontend.c:1112
        fib_add_ifaddr+0x40c/0x5e0 net/ipv4/fib_frontend.c:1156
        fib_netdev_event+0x375/0x490 net/ipv4/fib_frontend.c:1494
        notifier_call_chain+0x1a5/0x3f0 kernel/notifier.c:85
        __dev_notify_flags+0x207/0x400
        dev_change_flags+0xf0/0x1a0 net/core/dev.c:9045
        do_setlink+0xc90/0x4210 net/core/rtnetlink.c:3109
        rtnl_changelink net/core/rtnetlink.c:3723 [inline]
        __rtnl_newlink net/core/rtnetlink.c:3875 [inline]
        rtnl_newlink+0x1bb6/0x2210 net/core/rtnetlink.c:4012
    
       Memory state around the buggy address:
        ffff888011838f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
        ffff888011838f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
       >ffff888011839000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                      ^
        ffff888011839080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
        ffff888011839100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
       ==================================================================
    
    Reported-by: [email protected]
    Link: https://lore.kernel.org/linux-btrfs/[email protected]/
    Reported-by: Dmitry Vyukov <[email protected]>
    Link: https://lore.kernel.org/linux-btrfs/CACT4Y+ZFBdo7pT8L2AzM=vegZwjp-wNkVJZQf0Ta3vZqtExaSw@mail.gmail.com/
    Fixes: 871383be592b ("btrfs: add missing unlocks to transaction abort paths")
    Reviewed-by: Johannes Thumshirn <[email protected]>
    Reviewed-by: Qu Wenruo <[email protected]>
    Signed-off-by: Filipe Manana <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
ceph: fix memory leak in ceph_mds_auth_match() [+ + +]
Author: Antoine Viallon <[email protected]>
Date:   Tue Jan 14 23:45:14 2025 +0100

    ceph: fix memory leak in ceph_mds_auth_match()
    
    commit 3b7d93db450e9d8ead80d75e2a303248f1528c35 upstream.
    
    We now free the temporary target path substring allocation on every
    possible branch, instead of omitting the default branch.  In some
    cases, a memory leak occured, which could rapidly crash the system
    (depending on how many file accesses were attempted).
    
    This was detected in production because it caused a continuous memory
    growth, eventually triggering kernel OOM and completely hard-locking
    the kernel.
    
    Relevant kmemleak stacktrace:
    
        unreferenced object 0xffff888131e69900 (size 128):
          comm "git", pid 66104, jiffies 4295435999
          hex dump (first 32 bytes):
            76 6f 6c 75 6d 65 73 2f 63 6f 6e 74 61 69 6e 65  volumes/containe
            72 73 2f 67 69 74 65 61 2f 67 69 74 65 61 2f 67  rs/gitea/gitea/g
          backtrace (crc 2f3bb450):
            [<ffffffffaa68fb49>] __kmalloc_noprof+0x359/0x510
            [<ffffffffc32bf1df>] ceph_mds_check_access+0x5bf/0x14e0 [ceph]
            [<ffffffffc3235722>] ceph_open+0x312/0xd80 [ceph]
            [<ffffffffaa7dd786>] do_dentry_open+0x456/0x1120
            [<ffffffffaa7e3729>] vfs_open+0x79/0x360
            [<ffffffffaa832875>] path_openat+0x1de5/0x4390
            [<ffffffffaa834fcc>] do_filp_open+0x19c/0x3c0
            [<ffffffffaa7e44a1>] do_sys_openat2+0x141/0x180
            [<ffffffffaa7e4945>] __x64_sys_open+0xe5/0x1a0
            [<ffffffffac2cc2f7>] do_syscall_64+0xb7/0x210
            [<ffffffffac400130>] entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
    It can be triggered by mouting a subdirectory of a CephFS filesystem,
    and then trying to access files on this subdirectory with an auth token
    using a path-scoped capability:
    
        $ ceph auth get client.services
        [client.services]
                key = REDACTED
                caps mds = "allow rw fsname=cephfs path=/volumes/"
                caps mon = "allow r fsname=cephfs"
                caps osd = "allow rw tag cephfs data=cephfs"
    
        $ cat /proc/self/mounts
        services@[REDACTED].cephfs=/volumes/containers /ceph/containers ceph rw,noatime,name=services,secret=<hidden>,ms_mode=prefer-crc,mount_timeout=300,acl,mon_addr=[REDACTED]:3300,recover_session=clean 0 0
    
        $ seq 1 1000000 | xargs -P32 --replace={} touch /ceph/containers/file-{} && \
        seq 1 1000000 | xargs -P32 --replace={} cat /ceph/containers/file-{}
    
    [ idryomov: combine if statements, rename rc to path_matched and make
                it a bool, formatting ]
    
    Cc: [email protected]
    Fixes: 596afb0b8933 ("ceph: add ceph_mds_check_access() helper")
    Signed-off-by: Antoine Viallon <[email protected]>
    Reviewed-by: Viacheslav Dubeyko <[email protected]>
    Signed-off-by: Ilya Dryomov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
cifs: Remove intermediate object of failed create SFU call [+ + +]
Author: Pali Rohár <[email protected]>
Date:   Wed Dec 25 14:00:39 2024 +0100

    cifs: Remove intermediate object of failed create SFU call
    
    commit 25f6184e24b3991eae977a29ecf27d537cc930b2 upstream.
    
    Check if the server honored ATTR_SYSTEM flag by CREATE_OPTION_SPECIAL
    option. If not then server does not support ATTR_SYSTEM and newly
    created file is not SFU compatible, which means that the call failed.
    
    If CREATE was successful but either setting ATTR_SYSTEM failed or
    writing type/data information failed then remove the intermediate
    object created by CREATE. Otherwise intermediate empty object stay
    on the server.
    
    This ensures that if the creating of SFU files with system attribute is
    unsupported by the server then no empty file stay on the server as a result
    of unsupported operation.
    
    This is for example case with Samba server and Linux tmpfs storage without
    enabled xattr support (where Samba stores ATTR_SYSTEM bit).
    
    Cc: [email protected]
    Signed-off-by: Pali Rohár <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
clk: clk-loongson2: Fix the number count of clk provider [+ + +]
Author: Binbin Zhou <[email protected]>
Date:   Tue Jan 14 21:00:29 2025 +0800

    clk: clk-loongson2: Fix the number count of clk provider
    
    commit 5fb33b6797633ce60908d13dc06c54a101621845 upstream.
    
    Since commit 02fb4f008433 ("clk: clk-loongson2: Fix potential buffer
    overflow in flexible-array member access"), the clk provider register is
    failed.
    
    The count of `clks_num` is shown below:
    
            for (p = data; p->name; p++)
                    clks_num++;
    
    In fact, `clks_num` represents the number of SoC clocks and should be
    expressed as the maximum value of the clock binding id in use (p->id + 1).
    
    Now we fix it to avoid the following error when trying to register a clk
    provider:
    
    [ 13.409595] of_clk_hw_onecell_get: invalid index 17
    
    Cc: [email protected]
    Cc: Gustavo A. R. Silva <[email protected]>
    Fixes: 02fb4f008433 ("clk: clk-loongson2: Fix potential buffer overflow in flexible-array member access")
    Signed-off-by: Binbin Zhou <[email protected]>
    Link: https://lore.kernel.org/r/82e43d89a9a6791129cf8ea14f4eeb666cd87be4.1736856470.git.zhoubinbin@loongson.cn
    Signed-off-by: Stephen Boyd <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: mediatek: mt2701-aud: fix conversion to mtk_clk_simple_probe [+ + +]
Author: Daniel Golle <[email protected]>
Date:   Sun Dec 15 22:14:11 2024 +0000

    clk: mediatek: mt2701-aud: fix conversion to mtk_clk_simple_probe
    
    commit 5fba40be5fbad563914e3ce9d5129a6baaea1ff5 upstream.
    
    Some of the audio subsystem clocks defined in clk-mt2701.h aren't
    actually used by the driver. This broke conversion to
    mtk_clk_simple_probe which expects that the highest possible clk id is
    defined by the ARRAY_SIZE.
    
    Add additional dummy clocks to fill the gaps and remain compatible with
    the existing DT bindings.
    
    Fixes: 0f69a423c458 ("clk: mediatek: Switch to mtk_clk_simple_probe() where possible")
    Cc: [email protected]
    Signed-off-by: Daniel Golle <[email protected]>
    Link: https://lore.kernel.org/r/a07584d803af57b9ce4b5df5e122c09bf5a56ac9.1734300668.git.daniel@makrotopia.org
    Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Stephen Boyd <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: mediatek: mt2701-bdp: add missing dummy clk [+ + +]
Author: Daniel Golle <[email protected]>
Date:   Sun Dec 15 22:14:24 2024 +0000

    clk: mediatek: mt2701-bdp: add missing dummy clk
    
    commit fd291adc5e9a4ee6cd91e57f148f3b427f80647b upstream.
    
    Add dummy clk for index 0 which was missed during the conversion to
    mtk_clk_simple_probe().
    
    Fixes: 973d1607d936 ("clk: mediatek: mt2701: use mtk_clk_simple_probe to simplify driver")
    Cc: [email protected]
    Signed-off-by: Daniel Golle <[email protected]>
    Link: https://lore.kernel.org/r/b8526c882a50f2b158df0eccb4a165956fd8fa13.1734300668.git.daniel@makrotopia.org
    Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Stephen Boyd <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: mediatek: mt2701-img: add missing dummy clk [+ + +]
Author: Daniel Golle <[email protected]>
Date:   Sun Dec 15 22:14:48 2024 +0000

    clk: mediatek: mt2701-img: add missing dummy clk
    
    commit 366640868ccb4a7991aebe8442b01340fab218e2 upstream.
    
    Add dummy clk for index 0 which was missed during the conversion to
    mtk_clk_simple_probe().
    
    Fixes: 973d1607d936 ("clk: mediatek: mt2701: use mtk_clk_simple_probe to simplify driver")
    Cc: [email protected]
    Signed-off-by: Daniel Golle <[email protected]>
    Link: https://lore.kernel.org/r/d677486a5c563fe5c47aa995841adc2aaa183b8a.1734300668.git.daniel@makrotopia.org
    Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Stephen Boyd <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: mediatek: mt2701-mm: add missing dummy clk [+ + +]
Author: Daniel Golle <[email protected]>
Date:   Sun Dec 15 22:14:34 2024 +0000

    clk: mediatek: mt2701-mm: add missing dummy clk
    
    commit 67aea188f23a5dde51c31a720ccf66aed0ce4187 upstream.
    
    Add dummy clk which was missed during the conversion to
    mtk_clk_pdev_probe() and is required for the existing DT bindings to
    keep working.
    
    Fixes: 65c10c50c9c7 ("clk: mediatek: Migrate to mtk_clk_pdev_probe() for multimedia clocks")
    Cc: [email protected]
    Signed-off-by: Daniel Golle <[email protected]>
    Link: https://lore.kernel.org/r/9de23440fcba1ffef9e77d58c9f505105e57a250.1734300668.git.daniel@makrotopia.org
    Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Stephen Boyd <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: mediatek: mt2701-vdec: fix conversion to mtk_clk_simple_probe [+ + +]
Author: Daniel Golle <[email protected]>
Date:   Sun Dec 15 22:13:49 2024 +0000

    clk: mediatek: mt2701-vdec: fix conversion to mtk_clk_simple_probe
    
    commit 7c8746126a4e256fcf1af9174ee7d92cc3f3bc31 upstream.
    
    Commit 973d1607d936 ("clk: mediatek: mt2701: use mtk_clk_simple_probe to
    simplify driver") broke DT bindings as the highest index was reduced by
    1 because the id count starts from 1 and not from 0.
    
    Fix this, like for other drivers which had the same issue, by adding a
    dummy clk at index 0.
    
    Fixes: 973d1607d936 ("clk: mediatek: mt2701: use mtk_clk_simple_probe to simplify driver")
    Cc: [email protected]
    Signed-off-by: Daniel Golle <[email protected]>
    Link: https://lore.kernel.org/r/b126a5577f3667ef19b1b5feea5e70174084fb03.1734300668.git.daniel@makrotopia.org
    Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Stephen Boyd <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: mmp2: call pm_genpd_init() only after genpd.name is set [+ + +]
Author: Lubomir Rintel <[email protected]>
Date:   Tue Dec 31 20:03:35 2024 +0100

    clk: mmp2: call pm_genpd_init() only after genpd.name is set
    
    commit e24b15d4704dcb73920c3d18a6157abd18df08c1 upstream.
    
    Setting the genpd's struct device's name with dev_set_name() is
    happening within pm_genpd_init(). If it remains NULL, things can blow up
    later, such as when crafting the devfs hierarchy for the power domain:
    
      Unable to handle kernel NULL pointer dereference at virtual address 00000000 when read
      ...
      Call trace:
       strlen from start_creating+0x90/0x138
       start_creating from debugfs_create_dir+0x20/0x178
       debugfs_create_dir from genpd_debug_add.part.0+0x4c/0x144
       genpd_debug_add.part.0 from genpd_debug_init+0x74/0x90
       genpd_debug_init from do_one_initcall+0x5c/0x244
       do_one_initcall from kernel_init_freeable+0x19c/0x1f4
       kernel_init_freeable from kernel_init+0x1c/0x12c
       kernel_init from ret_from_fork+0x14/0x28
    
    Bisecting tracks this crash back to commit 899f44531fe6 ("pmdomain: core:
    Add GENPD_FLAG_DEV_NAME_FW flag"), which exchanges use of genpd->name
    with dev_name(&genpd->dev) in genpd_debug_add.part().
    
    Fixes: 899f44531fe6 ("pmdomain: core: Add GENPD_FLAG_DEV_NAME_FW flag")
    Signed-off-by: Lubomir Rintel <[email protected]>
    Cc: [email protected] # v6.12+
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Stephen Boyd <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: qcom: clk-alpha-pll: fix alpha mode configuration [+ + +]
Author: Gabor Juhos <[email protected]>
Date:   Mon Oct 21 19:32:48 2024 +0200

    clk: qcom: clk-alpha-pll: fix alpha mode configuration
    
    commit 33f1722eb86e45320a3dd7b3d42f6593a1d595c2 upstream.
    
    Commit c45ae598fc16 ("clk: qcom: support for alpha mode configuration")
    added support for configuring alpha mode, but it seems that the feature
    was never working in practice.
    
    The value of the alpha_{en,mode}_mask members of the configuration gets
    added to the value parameter passed to the regmap_update_bits() function,
    however the same values are not getting applied to the bitmask. As the
    result, the respective bits in the USER_CTL register are never modifed
    which leads to improper configuration of several PLLs.
    
    The following table shows the PLL configurations where the 'alpha_en_mask'
    member is set and which are passed as a parameter for the
    clk_alpha_pll_configure() function. In the table the 'expected rate' column
    shows the rate the PLL should run at with the given configuration, and
    the 'real rate' column shows the rate the PLL runs at actually. The real
    rates has been verified on hardwareOn IPQ* platforms, on other platforms,
    those are computed values only.
    
          file                 pll         expected rate   real rate
      dispcc-qcm2290.c     disp_cc_pll0      768.0 MHz     768.0 MHz
      dispcc-sm6115.c      disp_cc_pll0      768.0 MHz     768.0 MHz
      gcc-ipq5018.c        ubi32_pll        1000.0 MHz !=  984.0 MHz
      gcc-ipq6018.c        nss_crypto_pll   1200.0 MHz    1200.0 MHz
      gcc-ipq6018.c        ubi32_pll        1497.6 MHz != 1488.0 MHz
      gcc-ipq8074.c        nss_crypto_pll   1200.0 MHz != 1190.4 MHz
      gcc-qcm2290.c        gpll11            532.0 MHz !=  518.4 MHz
      gcc-qcm2290.c        gpll8             533.2 MHz !=  518.4 MHz
      gcc-qcs404.c         gpll3             921.6 MHz     921.6 MHz
      gcc-sm6115.c         gpll11            600.0 MHz !=  595.2 MHz
      gcc-sm6115.c         gpll8             800.0 MHz !=  787.2 MHz
      gpucc-sdm660.c       gpu_cc_pll0       800.0 MHz !=  787.2 MHz
      gpucc-sdm660.c       gpu_cc_pll1       740.0 MHz !=  729.6 MHz
      gpucc-sm6115.c       gpu_cc_pll0      1200.0 MHz != 1190.4 MHz
      gpucc-sm6115.c       gpu_cc_pll1       640.0 MHz !=  633.6 MHz
      gpucc-sm6125.c       gpu_pll0         1020.0 MHz != 1017.6 MHz
      gpucc-sm6125.c       gpu_pll1          930.0 MHz !=  921.6 MHz
      mmcc-sdm660.c        mmpll8            930.0 MHz !=  921.6 MHz
      mmcc-sdm660.c        mmpll5            825.0 MHz !=  806.4 MHz
    
    As it can be seen from the above, there are several PLLs which are
    configured incorrectly.
    
    Change the code to apply both 'alpha_en_mask' and 'alpha_mode_mask'
    values to the bitmask in order to configure the alpha mode correctly.
    
    Applying the 'alpha_en_mask' fixes the initial rate of the PLLs showed
    in the table above. Since the 'alpha_mode_mask' is not used by any driver
    currently, that part of the change causes no functional changes.
    
    Cc: [email protected]
    Fixes: c45ae598fc16 ("clk: qcom: support for alpha mode configuration")
    Signed-off-by: Gabor Juhos <[email protected]>
    Reviewed-by: Dmitry Baryshkov <[email protected]>
    Tested-by: Gabor Juhos <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: qcom: clk-rpmh: prevent integer overflow in recalc_rate [+ + +]
Author: Anastasia Belova <[email protected]>
Date:   Tue Dec 3 11:42:31 2024 +0300

    clk: qcom: clk-rpmh: prevent integer overflow in recalc_rate
    
    commit 89aa5925d201b90a48416784831916ca203658f9 upstream.
    
    aggr_state and unit fields are u32. The result of their
    multiplication may not fit in this type.
    
    Add explicit casting to prevent overflow.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 04053f4d23a4 ("clk: qcom: clk-rpmh: Add IPA clock support")
    Cc: [email protected] # 5.4+
    Signed-off-by: Anastasia Belova <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: qcom: dispcc-sm6350: Add missing parent_map for a clock [+ + +]
Author: Luca Weiss <[email protected]>
Date:   Fri Dec 20 10:03:31 2024 +0100

    clk: qcom: dispcc-sm6350: Add missing parent_map for a clock
    
    commit d4cdb196f182d2fbe336c968228be00d8c3fed05 upstream.
    
    If a clk_rcg2 has a parent, it should also have parent_map defined,
    otherwise we'll get a NULL pointer dereference when calling clk_set_rate
    like the following:
    
      [    3.388105] Call trace:
      [    3.390664]  qcom_find_src_index+0x3c/0x70 (P)
      [    3.395301]  qcom_find_src_index+0x1c/0x70 (L)
      [    3.399934]  _freq_tbl_determine_rate+0x48/0x100
      [    3.404753]  clk_rcg2_determine_rate+0x1c/0x28
      [    3.409387]  clk_core_determine_round_nolock+0x58/0xe4
      [    3.421414]  clk_core_round_rate_nolock+0x48/0xfc
      [    3.432974]  clk_core_round_rate_nolock+0xd0/0xfc
      [    3.444483]  clk_core_set_rate_nolock+0x8c/0x300
      [    3.455886]  clk_set_rate+0x38/0x14c
    
    Add the parent_map property for the clock where it's missing and also
    un-inline the parent_data as well to keep the matching parent_map and
    parent_data together.
    
    Fixes: 837519775f1d ("clk: qcom: Add display clock controller driver for SM6350")
    Cc: [email protected]
    Signed-off-by: Luca Weiss <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: qcom: gcc-mdm9607: Fix cmd_rcgr offset for blsp1_uart6 rcg [+ + +]
Author: Satya Priya Kakitapalli <[email protected]>
Date:   Fri Dec 20 15:20:48 2024 +0530

    clk: qcom: gcc-mdm9607: Fix cmd_rcgr offset for blsp1_uart6 rcg
    
    commit 88d9dca36aac9659446be1e569d8fbe3462b5741 upstream.
    
    Fix cmd_rcgr offset for blsp1_uart6_apps_clk_src on mdm9607 platform.
    
    Fixes: 48b7253264ea ("clk: qcom: Add MDM9607 GCC driver")
    Cc: [email protected]
    Signed-off-by: Satya Priya Kakitapalli <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: qcom: gcc-sm6350: Add missing parent_map for two clocks [+ + +]
Author: Luca Weiss <[email protected]>
Date:   Fri Dec 20 10:03:30 2024 +0100

    clk: qcom: gcc-sm6350: Add missing parent_map for two clocks
    
    commit 96fe1a7ee477d701cfc98ab9d3c730c35d966861 upstream.
    
    If a clk_rcg2 has a parent, it should also have parent_map defined,
    otherwise we'll get a NULL pointer dereference when calling clk_set_rate
    like the following:
    
      [    3.388105] Call trace:
      [    3.390664]  qcom_find_src_index+0x3c/0x70 (P)
      [    3.395301]  qcom_find_src_index+0x1c/0x70 (L)
      [    3.399934]  _freq_tbl_determine_rate+0x48/0x100
      [    3.404753]  clk_rcg2_determine_rate+0x1c/0x28
      [    3.409387]  clk_core_determine_round_nolock+0x58/0xe4
      [    3.421414]  clk_core_round_rate_nolock+0x48/0xfc
      [    3.432974]  clk_core_round_rate_nolock+0xd0/0xfc
      [    3.444483]  clk_core_set_rate_nolock+0x8c/0x300
      [    3.455886]  clk_set_rate+0x38/0x14c
    
    Add the parent_map property for two clocks where it's missing and also
    un-inline the parent_data as well to keep the matching parent_map and
    parent_data together.
    
    Fixes: 131abae905df ("clk: qcom: Add SM6350 GCC driver")
    Cc: [email protected]
    Signed-off-by: Luca Weiss <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: qcom: gcc-sm8550: Do not turn off PCIe GDSCs during gdsc_disable() [+ + +]
Author: Manivannan Sadhasivam <[email protected]>
Date:   Thu Dec 19 22:30:10 2024 +0530

    clk: qcom: gcc-sm8550: Do not turn off PCIe GDSCs during gdsc_disable()
    
    commit 967e011013eda287dbec9e8bd3a19ebe730b8a08 upstream.
    
    With PWRSTS_OFF_ON, PCIe GDSCs are turned off during gdsc_disable(). This
    can happen during scenarios such as system suspend and breaks the resume
    of PCIe controllers from suspend.
    
    So use PWRSTS_RET_ON to indicate the GDSC driver to not turn off the GDSCs
    during gdsc_disable() and allow the hardware to transition the GDSCs to
    retention when the parent domain enters low power state during system
    suspend.
    
    Cc: [email protected] # 6.2
    Fixes: 955f2ea3b9e9 ("clk: qcom: Add GCC driver for SM8550")
    Reported-by: Neil Armstrong <[email protected]>
    Signed-off-by: Manivannan Sadhasivam <[email protected]>
    Reviewed-by: Neil Armstrong <[email protected]>
    Tested-by: Neil Armstrong <[email protected]> # on QRD8550
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: qcom: gcc-sm8650: Do not turn off PCIe GDSCs during gdsc_disable() [+ + +]
Author: Manivannan Sadhasivam <[email protected]>
Date:   Thu Dec 19 22:30:11 2024 +0530

    clk: qcom: gcc-sm8650: Do not turn off PCIe GDSCs during gdsc_disable()
    
    commit a57465766a91c6e173876f9cbb424340e214313f upstream.
    
    With PWRSTS_OFF_ON, PCIe GDSCs are turned off during gdsc_disable(). This
    can happen during scenarios such as system suspend and breaks the resume
    of PCIe controllers from suspend.
    
    So use PWRSTS_RET_ON to indicate the GDSC driver to not turn off the GDSCs
    during gdsc_disable() and allow the hardware to transition the GDSCs to
    retention when the parent domain enters low power state during system
    suspend.
    
    Cc: [email protected] # 6.8
    Fixes: c58225b7e3d7 ("clk: qcom: add the SM8650 Global Clock Controller driver, part 1")
    Reported-by: Neil Armstrong <[email protected]>
    Signed-off-by: Manivannan Sadhasivam <[email protected]>
    Reviewed-by: Neil Armstrong <[email protected]>
    Tested-by: Neil Armstrong <[email protected]> # on QRD8650
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: qcom: Make GCC_8150 depend on QCOM_GDSC [+ + +]
Author: Konrad Dybcio <[email protected]>
Date:   Sat Oct 26 12:58:13 2024 +0200

    clk: qcom: Make GCC_8150 depend on QCOM_GDSC
    
    [ Upstream commit 1474149c4209943b37a2c01b82f07ba39465e5fe ]
    
    Like all other non-ancient Qualcomm clock drivers, QCOM_GDSC is
    required, as the GCC driver defines and instantiates a bunch of GDSCs.
    
    Add the missing dependency.
    
    Reported-by: Vladimir Zapolskiy <[email protected]>
    Closes: https://lore.kernel.org/linux-arm-msm/[email protected]/
    Signed-off-by: Konrad Dybcio <[email protected]>
    Reviewed-by: Dmitry Baryshkov <[email protected]>
    Reviewed-by: Vladimir Zapolskiy <[email protected]>
    Link: https://lore.kernel.org/r/20241026-topic-8150gcc_kconfig-v1-1-3772013d8804@oss.qualcomm.com
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

clk: sunxi-ng: a100: enable MMC clock reparenting [+ + +]
Author: Cody Eksal <[email protected]>
Date:   Fri Nov 8 20:37:37 2024 -0400

    clk: sunxi-ng: a100: enable MMC clock reparenting
    
    commit 16414720045de30945b8d14b7907e0cbf81a4b49 upstream.
    
    While testing the MMC nodes proposed in [1], it was noted that mmc0/1
    would fail to initialize, with "mmc: fatal err update clk timeout" in
    the kernel logs. A closer look at the clock definitions showed that the MMC
    MPs had the "CLK_SET_RATE_NO_REPARENT" flag set. No reason was given for
    adding this flag in the first place, and its original purpose is unknown,
    but it doesn't seem to make sense and results in severe limitations to MMC
    speeds. Thus, remove this flag from the 3 MMC MPs.
    
    [1] https://msgid.link/[email protected]
    
    Fixes: fb038ce4db55 ("clk: sunxi-ng: add support for the Allwinner A100 CCU")
    Cc: [email protected]
    Signed-off-by: Cody Eksal <[email protected]>
    Reviewed-by: Andre Przywara <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Chen-Yu Tsai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
cpufreq: fix using cpufreq-dt as module [+ + +]
Author: Andreas Kemnade <[email protected]>
Date:   Sun Nov 3 22:02:51 2024 +0100

    cpufreq: fix using cpufreq-dt as module
    
    commit f1f010c9d9c62c865d9f54e94075800ba764b4d9 upstream.
    
    This driver can be built as a module since commit 3b062a086984 ("cpufreq:
    dt-platdev: Support building as module"), but unfortunately this caused
    a regression because the cputfreq-dt-platdev.ko module does not autoload.
    
    Usually, this is solved by just using the MODULE_DEVICE_TABLE() macro to
    export all the device IDs as module aliases. But this driver is special
    due how matches with devices and decides what platform supports.
    
    There are two of_device_id lists, an allow list that are for CPU devices
    that always match and a deny list that's for devices that must not match.
    
    The driver registers a cpufreq-dt platform device for all the CPU device
    nodes that either are in the allow list or contain an operating-points-v2
    property and are not in the deny list.
    
    Enforce builtin compile of cpufreq-dt-platdev to make autoload work.
    
    Fixes: 3b062a086984 ("cpufreq: dt-platdev: Support building as module")
    Link: https://lore.kernel.org/all/20241104201424.2a42efdd@akair/
    Link: https://lore.kernel.org/all/[email protected]/
    Cc: [email protected]
    Signed-off-by: Andreas Kemnade <[email protected]>
    Reported-by: Radu Rendec <[email protected]>
    Reported-by: Javier Martinez Canillas <[email protected]>
    [ Viresh: Picked commit log from Javier, updated tags ]
    Signed-off-by: Viresh Kumar <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

cpufreq: s3c64xx: Fix compilation warning [+ + +]
Author: Viresh Kumar <[email protected]>
Date:   Wed Jan 22 11:36:16 2025 +0530

    cpufreq: s3c64xx: Fix compilation warning
    
    commit 43855ac61483cb914f060851535ea753c094b3e0 upstream.
    
    The driver generates following warning when regulator support isn't
    enabled in the kernel. Fix it.
    
       drivers/cpufreq/s3c64xx-cpufreq.c: In function 's3c64xx_cpufreq_set_target':
    >> drivers/cpufreq/s3c64xx-cpufreq.c:55:22: warning: variable 'old_freq' set but not used [-Wunused-but-set-variable]
          55 |         unsigned int old_freq, new_freq;
             |                      ^~~~~~~~
    >> drivers/cpufreq/s3c64xx-cpufreq.c:54:30: warning: variable 'dvfs' set but not used [-Wunused-but-set-variable]
          54 |         struct s3c64xx_dvfs *dvfs;
             |                              ^~~~
    
    Reported-by: kernel test robot <[email protected]>
    Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
    Cc: 5.4+ <[email protected]> # v5.4+
    Signed-off-by: Viresh Kumar <[email protected]>
    Link: https://patch.msgid.link/236b227e929e5adc04d1e9e7af6845a46c8e9432.1737525916.git.viresh.kumar@linaro.org
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
crypto: qce - fix goto jump in error path [+ + +]
Author: Bartosz Golaszewski <[email protected]>
Date:   Tue Dec 3 10:19:29 2024 +0100

    crypto: qce - fix goto jump in error path
    
    commit 5278275c1758a38199b43530adfc50098f4b41c7 upstream.
    
    If qce_check_version() fails, we should jump to err_dma as we already
    called qce_dma_request() a couple lines before.
    
    Cc: [email protected]
    Fixes: ec8f5d8f6f76 ("crypto: qce - Qualcomm crypto engine driver")
    Signed-off-by: Bartosz Golaszewski <[email protected]>
    Reviewed-by: Neil Armstrong <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: qce - fix priority to be less than ARMv8 CE [+ + +]
Author: Eric Biggers <[email protected]>
Date:   Tue Dec 3 10:05:53 2024 -0800

    crypto: qce - fix priority to be less than ARMv8 CE
    
    commit 49b9258b05b97c6464e1964b6a2fddb3ddb65d17 upstream.
    
    As QCE is an order of magnitude slower than the ARMv8 Crypto Extensions
    on the CPU, and is also less well tested, give it a lower priority.
    Previously the QCE SHA algorithms had higher priority than the ARMv8 CE
    equivalents, and the ciphers such as AES-XTS had the same priority which
    meant the QCE versions were chosen if they happened to be loaded later.
    
    Fixes: ec8f5d8f6f76 ("crypto: qce - Qualcomm crypto engine driver")
    Cc: [email protected]
    Cc: Bartosz Golaszewski <[email protected]>
    Cc: Neil Armstrong <[email protected]>
    Cc: Thara Gopinath <[email protected]>
    Signed-off-by: Eric Biggers <[email protected]>
    Reviewed-by: Bartosz Golaszewski <[email protected]>
    Reviewed-by: Ard Biesheuvel <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: qce - unregister previously registered algos in error path [+ + +]
Author: Bartosz Golaszewski <[email protected]>
Date:   Tue Dec 3 10:19:30 2024 +0100

    crypto: qce - unregister previously registered algos in error path
    
    commit e80cf84b608725303113d6fe98bb727bf7b7a40d upstream.
    
    If we encounter an error when registering alorithms with the crypto
    framework, we just bail out and don't unregister the ones we
    successfully registered in prior iterations of the loop.
    
    Add code that goes back over the algos and unregisters them before
    returning an error from qce_register_algs().
    
    Cc: [email protected]
    Fixes: ec8f5d8f6f76 ("crypto: qce - Qualcomm crypto engine driver")
    Signed-off-by: Bartosz Golaszewski <[email protected]>
    Reviewed-by: Neil Armstrong <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
dm-crypt: don't update io->sector after kcryptd_crypt_write_io_submit() [+ + +]
Author: Hou Tao <[email protected]>
Date:   Mon Jan 20 16:29:49 2025 +0800

    dm-crypt: don't update io->sector after kcryptd_crypt_write_io_submit()
    
    commit 9fdbbdbbc92b1474a87b89f8b964892a63734492 upstream.
    
    The updates of io->sector are the leftovers when dm-crypt allocated
    pages for partial write request. However, since commit cf2f1abfbd0db
    ("dm crypt: don't allocate pages for a partial request"), there is no
    partial request anymore.
    
    After the introduction of write request rb-tree, the updates of
    io->sectors may interfere the insertion procedure, because ->sectors of
    these write requests which have already been added in the rb-tree may be
    changed during the insertion of new write request.
    
    Fix it by removing these buggy updates of io->sectors. Considering these
    updates only effect the write request rb-tree, the commit which
    introduces the write request rb-tree is used as the fix tag.
    
    Fixes: b3c5fd305249 ("dm crypt: sort writes")
    Cc: [email protected]
    Signed-off-by: Hou Tao <[email protected]>
    Signed-off-by: Mikulas Patocka <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

dm-crypt: track tag_offset in convert_context [+ + +]
Author: Hou Tao <[email protected]>
Date:   Mon Jan 20 16:29:51 2025 +0800

    dm-crypt: track tag_offset in convert_context
    
    commit 8b8f8037765757861f899ed3a2bfb34525b5c065 upstream.
    
    dm-crypt uses tag_offset to index the integrity metadata for each crypt
    sector. When the initial crypt_convert() returns BLK_STS_DEV_RESOURCE,
    dm-crypt will try to continue the crypt/decrypt procedure in a kworker.
    However, it resets tag_offset as zero instead of using the tag_offset
    related with current sector. It may return unexpected data when using
    random IV or return unexpected integrity related error.
    
    Fix the problem by tracking tag_offset in per-IO convert_context.
    Therefore, when the crypt/decrypt procedure continues in a kworker, it
    could use the next tag_offset saved in convert_context.
    
    Fixes: 8abec36d1274 ("dm crypt: do not wait for backlogged crypto request completion in softirq")
    Cc: [email protected]
    Signed-off-by: Hou Tao <[email protected]>
    Signed-off-by: Mikulas Patocka <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/amd/amdgpu: change the config of cgcg on gfx12 [+ + +]
Author: Kenneth Feng <[email protected]>
Date:   Mon Jan 20 15:33:03 2025 +0800

    drm/amd/amdgpu: change the config of cgcg on gfx12
    
    commit 5cda56bd86c455341087dca29c65dc7c87f84340 upstream.
    
    change the config of cgcg on gfx12
    
    Signed-off-by: Kenneth Feng <[email protected]>
    Reviewed-by: Yang Wang <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Cc: [email protected] # 6.12.x
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/amd/display: Add support for minimum backlight quirk [+ + +]
Author: Thomas Weißschuh <[email protected]>
Date:   Mon Nov 11 19:09:36 2024 +0100

    drm/amd/display: Add support for minimum backlight quirk
    
    [ Upstream commit c2753b2471c65955de18cbc58530641447e5bfe9 ]
    
    Not all platforms provide the full range of PWM backlight capabilities
    supported by the hardware through ATIF.
    Use the generic drm panel minimum backlight quirk infrastructure to
    override the capabilities where necessary.
    
    Testing the backlight quirk together with the "panel_power_savings"
    sysfs file has not shown any negative impact.
    One quirk seems to be that 0% at panel_power_savings=0 seems to be
    slightly darker than at panel_power_savings=4.
    
    Signed-off-by: Thomas Weißschuh <[email protected]>
    Tested-by: Dustin L. Howett <[email protected]>
    Reviewed-by: Mario Limonciello <[email protected]>
    Reviewed-by: Harry Wentland <[email protected]>
    Signed-off-by: Mario Limonciello <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/20241111-amdgpu-min-backlight-quirk-v7-2-f662851fda69@weissschuh.net
    Signed-off-by: Sasha Levin <[email protected]>

drm/amd/display: Fix Mode Cutoff in DSC Passthrough to DP2.1 Monitor [+ + +]
Author: Fangzhi Zuo <[email protected]>
Date:   Mon Dec 2 13:30:37 2024 -0500

    drm/amd/display: Fix Mode Cutoff in DSC Passthrough to DP2.1 Monitor
    
    [ Upstream commit e56ad45e991128bf4db160b75a1d9f647a341d8f ]
    
    Source --> DP2.1 MST hub --> DP1.4/2.1 monitor
    
    When change from DP1.4 to DP2.1 from monitor manual, modes higher than
    4k120 are all cutoff by mode validation. Switch back to DP1.4 gets all
    the modes up to 4k240 available to be enabled by dsc passthrough.
    
    [why]
    Compared to DP1.4 link from hub to monitor, DP2.1 link has larger
    full_pbn value that causes overflow in the process of doing conversion
    from pbn to kbps.
    
    [how]
    Change the data type accordingly to fit into the data limit during
    conversion calculation.
    
    Tested-by: Daniel Wheeler <[email protected]>
    Reviewed-by: Wayne Lin <[email protected]>
    Signed-off-by: Fangzhi Zuo <[email protected]>
    Signed-off-by: Rodrigo Siqueira <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

drm/amd/display: Fix seamless boot sequence [+ + +]
Author: Lo-an Chen <[email protected]>
Date:   Fri Jan 17 17:56:25 2025 +0800

    drm/amd/display: Fix seamless boot sequence
    
    commit e01f07cb92513ca4b9b219ab9caa34d607bc1e2d upstream.
    
    [WHY]
    When the system powers up eDP with external monitors in seamless boot
    sequence, stutter get enabled before TTU and HUBP registers being
    programmed, which resulting in underflow.
    
    [HOW]
    Enable TTU in hubp_init.
    Change the sequence that do not perpare_bandwidth and optimize_bandwidth
    while having seamless boot streams.
    
    Cc: Mario Limonciello <[email protected]>
    Cc: Alex Deucher <[email protected]>
    Cc: [email protected]
    Reviewed-by: Nicholas Kazlauskas <[email protected]>
    Signed-off-by: Lo-an Chen <[email protected]>
    Signed-off-by: Paul Hsieh <[email protected]>
    Signed-off-by: Alex Hung <[email protected]>
    Tested-by: Daniel Wheeler <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/amd/display: Increase sanitizer frame larger than limit when compile testing with clang [+ + +]
Author: Nathan Chancellor <[email protected]>
Date:   Thu Dec 19 16:46:35 2024 -0700

    drm/amd/display: Increase sanitizer frame larger than limit when compile testing with clang
    
    [ Upstream commit e4479aecf6581af81bc0908575447878d2a07e01 ]
    
    Commit 24909d9ec7c3 ("drm/amd/display: Overwriting dualDPP UBF values
    before usage") added a new warning in dml2/display_mode_core.c when
    building allmodconfig with clang:
    
      drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/display_mode_core.c:6268:13: error: stack frame size (3128) exceeds limit (3072) in 'dml_prefetch_check' [-Werror,-Wframe-larger-than]
       6268 | static void dml_prefetch_check(struct display_mode_lib_st *mode_lib)
            |             ^
    
    Commit be4e3509314a ("drm/amd/display: DML21 Reintegration For Various
    Fixes") introduced one in dml2_core/dml2_core_dcn4_calcs.c with the same
    configuration:
    
      drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c:7236:13: error: stack frame size (3256) exceeds limit (3072) in 'dml_core_mode_support' [-Werror,-Wframe-larger-than]
       7236 | static bool dml_core_mode_support(struct dml2_core_calcs_mode_support_ex *in_out_params)
            |             ^
    
    In the case of the first warning, the stack usage was already at the
    limit at the parent change, so the offending change was rather
    innocuous. In the case of the second warning, there was a rather
    dramatic increase in stack usage compared to the parent:
    
      drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c:7032:13: error: stack frame size (2696) exceeds limit (2048) in 'dml_core_mode_support' [-Werror,-Wframe-larger-than]
       7032 | static bool dml_core_mode_support(struct dml2_core_calcs_mode_support_ex *in_out_params)
            |             ^
    
    This is an unfortunate interaction between an issue with stack slot
    reuse in LLVM that gets exacerbated by sanitization (which gets enabled
    with all{mod,yes}config) and function calls using a much higher number
    of parameters than is typical in the kernel, necessitating passing most
    of these values on the stack.
    
    While it is possible that there should be source code changes to address
    these warnings, this code is difficult to modify for various reasons, as
    has been noted in other changes that have occurred for similar reasons,
    such as commit 6740ec97bcdb ("drm/amd/display: Increase frame warning
    limit with KASAN or KCSAN in dml2").
    
    Increase the frame larger than limit when compile testing with clang and
    the sanitizers enabled to avoid this breakage in all{mod,yes}config, as
    they are commonly used and valuable testing targets. While it is not the
    best to hide this issue, it is not really relevant when compile testing,
    as the sanitizers are commonly stressful on optimizations and they are
    only truly useful at runtime, which COMPILE_TEST states will not occur
    with the current build.
    
    Reported-by: kernel test robot <[email protected]>
    Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
    Signed-off-by: Nathan Chancellor <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

drm/amd/display: Limit Scaling Ratio on DCN3.01 [+ + +]
Author: Gabe Teeger <[email protected]>
Date:   Fri Dec 13 15:15:00 2024 -0500

    drm/amd/display: Limit Scaling Ratio on DCN3.01
    
    [ Upstream commit abc0ad6d08440761b199988c329ad7ac83f41c9b ]
    
    [why]
    Underflow and flickering was occuring due to high scaling ratios
    when resizing videos.
    
    [how]
    Limit the scaling ratios by increasing the max scaling factor
    
    Reviewed-by: Nicholas Kazlauskas <[email protected]>
    Signed-off-by: Gabe Teeger <[email protected]>
    Signed-off-by: Tom Chung <[email protected]>
    Tested-by: Daniel Wheeler <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

drm/amd/display: Optimize cursor position updates [+ + +]
Author: Aric Cyr <[email protected]>
Date:   Tue Dec 10 18:38:15 2024 -0500

    drm/amd/display: Optimize cursor position updates
    
    commit 024771f3fb75dc817e9429d5763f1a6eb84b6f21 upstream.
    
    [why]
    Updating the cursor enablement register can be a slow operation and accumulates
    when high polling rate cursors cause frequent updates asynchronously to the
    cursor position.
    
    [how]
    Since the cursor enable bit is cached there is no need to update the
    enablement register if there is no change to it.  This removes the
    read-modify-write from the cursor position programming path in HUBP and
    DPP, leaving only the register writes.
    
    Cc: Mario Limonciello <[email protected]>
    Cc: Alex Deucher <[email protected]>
    Cc: [email protected]
    Reviewed-by: Sung Lee <[email protected]>
    Signed-off-by: Aric Cyr <[email protected]>
    Signed-off-by: Wayne Lin <[email protected]>
    Tested-by: Daniel Wheeler <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/amd/display: Overwriting dualDPP UBF values before usage [+ + +]
Author: Ausef Yousof <[email protected]>
Date:   Tue Nov 26 15:26:01 2024 -0500

    drm/amd/display: Overwriting dualDPP UBF values before usage
    
    [ Upstream commit 24909d9ec7c3afa8da2f3c9afa312e7a4a61f250 ]
    
    [WHY]
    Right now in dml2 mode validation we are calculating UBF parameters for
    prefetch calculation for single and dual DPP scenarios. Data structure
    to store such values are just 1D arrays, the single DPP values are
    overwritten by the dualDPP values, and we end up using dualDPP for
    prefetch calculations twice (once in place of singleDPP support check
    and again for dual).
    
    This naturally leads to many problems, one of which validating a mode in
    "singleDPP" (when we used dual DPP parameters) and sending the singleDPP
    parameters to mode programming, if we cannot support then we observe the
    corruption as described in the ticket.
    
    [HOW]
    UBF values need to have 2d arrays to store values specific to single and
    dual DPP states to avoid single DPP values being overwritten. Other
    parameters are recorded on a per state basis such as prefetch UBF values
    but they are in the same loop used for calculation and at that point its
    fine to overwrite them, its not the case for plain UBF values.
    
    Reviewed-by: Nicholas Kazlauskas <[email protected]>
    Signed-off-by: Ausef Yousof <[email protected]>
    Signed-off-by: Aurabindo Pillai <[email protected]>
    Tested-by: Daniel Wheeler <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

drm/amd/display: Populate chroma prefetch parameters, DET buffer fix [+ + +]
Author: Ausef Yousof <[email protected]>
Date:   Wed Nov 20 12:38:11 2024 -0500

    drm/amd/display: Populate chroma prefetch parameters, DET buffer fix
    
    [ Upstream commit 70fec46519fca859aa209f5f02e7e0a0123aca4a ]
    
    [WHY]
    Soft hang/lag observed during 10bit playback + moving cursor, corruption
    observed in other tickets for same reason, also failing MPO.
    
    1. Currently, we are always running
       calculate_lowest_supported_state_for_temp_read which is only
       necessary on dGPU
    2. Fast validate path does not apply DET buffer allocation policy
    3. Prefetch UrgBFactor chroma parameter not populated in prefetch
       calculation
    
    [HOW]
    1. Add a check to see if we are on APU, if so, skip the code
    2. Add det buffer alloc policy checks to fast validate path
    3. Populate UrgentBurstChroma param in call to calculate
       UrgBChroma prefetch values
    
    -revision commits: small formatting/brackets/null check addition + remove test change + dGPU code
    
    Reviewed-by: Charlene Liu <[email protected]>
    Signed-off-by: Ausef Yousof <[email protected]>
    Signed-off-by: Fangzhi Zuo <[email protected]>
    Tested-by: Daniel Wheeler <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

drm/amd/display: use eld_mutex to protect access to connector->eld [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Fri Dec 6 11:43:07 2024 +0200

    drm/amd/display: use eld_mutex to protect access to connector->eld
    
    [ Upstream commit 819bee01eea06282d7bda17d46caf29cae4f6d84 ]
    
    Reading access to connector->eld can happen at the same time the
    drm_edid_to_eld() updates the data. Take the newly added eld_mutex in
    order to protect connector->eld from concurrent access.
    
    Reviewed-by: Maxime Ripard <[email protected]>
    Reviewed-by: Harry Wentland <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/amd/pm: Mark MM activity as unsupported [+ + +]
Author: Lijo Lazar <[email protected]>
Date:   Wed Jan 22 09:12:41 2025 +0530

    drm/amd/pm: Mark MM activity as unsupported
    
    commit 819bf6662b93a5a8b0c396d2c7e7fab6264c9808 upstream.
    
    Aldebaran doesn't support querying MM activity percentage. Keep the
    field as 0xFFs to mark it as unsupported.
    
    Signed-off-by: Lijo Lazar <[email protected]>
    Reviewed-by: Hawking Zhang <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/amdgpu: add a BO metadata flag to disable write compression for Vulkan [+ + +]
Author: Marek Olšák <[email protected]>
Date:   Fri Jan 24 09:43:45 2025 -0500

    drm/amdgpu: add a BO metadata flag to disable write compression for Vulkan
    
    commit 2255b40cacc2e5ef1b127770fc1808c60de4a2fc upstream.
    
    Vulkan can't support DCC and Z/S compression on GFX12 without
    WRITE_COMPRESS_DISABLE in this commit or a completely different DCC
    interface.
    
    AMDGPU_TILING_GFX12_SCANOUT is added because it's already used by userspace.
    
    Cc: [email protected] # 6.12.x
    Signed-off-by: Marek Olšák <[email protected]>
    Reviewed-by: Alex Deucher <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/amdgpu: Don't enable sdma 4.4.5 CTXEMPTY interrupt [+ + +]
Author: Philip Yang <[email protected]>
Date:   Tue Nov 26 15:45:32 2024 -0500

    drm/amdgpu: Don't enable sdma 4.4.5 CTXEMPTY interrupt
    
    [ Upstream commit b4b7271e5ca95b581f2fcc4ae852c4079215e92d ]
    
    The sdma context empty interrupt is dropped in amdgpu_irq_dispatch
    as unregistered interrupt src_id 243, this interrupt accounts to 1/3 of
    total interrupts and causes IH primary ring overflow when running
    stressful benchmark application. Disable this interrupt has no side
    effect found.
    
    Signed-off-by: Philip Yang <[email protected]>
    Reviewed-by: Felix Kuehling <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/amdkfd: Block per-queue reset when halt_if_hws_hang=1 [+ + +]
Author: Jay Cornwall <[email protected]>
Date:   Thu Jan 16 14:36:39 2025 -0600

    drm/amdkfd: Block per-queue reset when halt_if_hws_hang=1
    
    commit f214b7beb00621b983e67ce97477afc3ab4b38f4 upstream.
    
    The purpose of halt_if_hws_hang is to preserve GPU state for driver
    debugging when queue preemption fails. Issuing per-queue reset may
    kill wavefronts which caused the preemption failure.
    
    Signed-off-by: Jay Cornwall <[email protected]>
    Reviewed-by: Jonathan Kim <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Cc: [email protected] # 6.12.x
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/amdkfd: only flush the validate MES contex [+ + +]
Author: Prike Liang <[email protected]>
Date:   Tue Jan 14 11:20:17 2025 +0800

    drm/amdkfd: only flush the validate MES contex
    
    commit 9078a5bfa21e78ae68b6d7c365d1b92f26720c55 upstream.
    
    The following page fault was observed duringthe KFD process release.
    In this particular error case, the HIP test (./MemcpyPerformance -h)
    does not require the queue. As a result, the process_context_addr was
    not assigned when the KFD process was released, ultimately leading to
    this page fault during the execution of the function
    kfd_process_dequeue_from_all_devices().
    
    [345962.294891] amdgpu 0000:03:00.0: amdgpu: [gfxhub] page fault (src_id:0 ring:153 vmid:0 pasid:0)
    [345962.295333] amdgpu 0000:03:00.0: amdgpu:   in page starting at address 0x0000000000000000 from client 10
    [345962.295775] amdgpu 0000:03:00.0: amdgpu: GCVM_L2_PROTECTION_FAULT_STATUS:0x00000B33
    [345962.296097] amdgpu 0000:03:00.0: amdgpu:     Faulty UTCL2 client ID: CPC (0x5)
    [345962.296394] amdgpu 0000:03:00.0: amdgpu:     MORE_FAULTS: 0x1
    [345962.296633] amdgpu 0000:03:00.0: amdgpu:     WALKER_ERROR: 0x1
    [345962.296876] amdgpu 0000:03:00.0: amdgpu:     PERMISSION_FAULTS: 0x3
    [345962.297135] amdgpu 0000:03:00.0: amdgpu:     MAPPING_ERROR: 0x1
    [345962.297377] amdgpu 0000:03:00.0: amdgpu:     RW: 0x0
    [345962.297682] amdgpu 0000:03:00.0: amdgpu: [gfxhub] page fault (src_id:0 ring:169 vmid:0 pasid:0)
    
    Signed-off-by: Prike Liang <[email protected]>
    Reviewed-by: Jonathan Kim <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/amdkfd: Queue interrupt work to different CPU [+ + +]
Author: Philip Yang <[email protected]>
Date:   Tue Nov 26 11:33:15 2024 -0500

    drm/amdkfd: Queue interrupt work to different CPU
    
    [ Upstream commit 34db5a32617d102e8042151bb87590e43c97132e ]
    
    For CPX mode, each KFD node has interrupt worker to process ih_fifo to
    send events to user space. Currently all interrupt workers of same adev
    queue to same CPU, all workers execution are actually serialized and
    this cause KFD ih_fifo overflow when CPU usage is high.
    
    Use per-GPU unbounded highpri queue with number of workers equals to
    number of partitions, let queue_work select the next CPU round robin
    among the local CPUs of same NUMA.
    
    Signed-off-by: Philip Yang <[email protected]>
    Reviewed-by: Felix Kuehling <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/ast: astdp: Fix timeout for enabling video signal [+ + +]
Author: Thomas Zimmermann <[email protected]>
Date:   Mon Jan 27 14:44:14 2025 +0100

    drm/ast: astdp: Fix timeout for enabling video signal
    
    commit fd39c41bcd82d5ebaaebadb944eab5598c668a90 upstream.
    
    The ASTDP transmitter sometimes takes up to 1 second for enabling the
    video signal, while the timeout is only 200 msec. This results in a
    kernel error message. Increase the timeout to 1 second. An example
    of the error message is shown below.
    
    [  697.084433] ------------[ cut here ]------------
    [  697.091115] ast 0000:02:00.0: [drm] drm_WARN_ON(!__ast_dp_wait_enable(ast, enabled))
    [  697.091233] WARNING: CPU: 1 PID: 160 at drivers/gpu/drm/ast/ast_dp.c:232 ast_dp_set_enable+0x123/0x140 [ast]
    [...]
    [  697.272469] RIP: 0010:ast_dp_set_enable+0x123/0x140 [ast]
    [...]
    [  697.415283] Call Trace:
    [  697.420727]  <TASK>
    [  697.425908]  ? show_trace_log_lvl+0x196/0x2c0
    [  697.433304]  ? show_trace_log_lvl+0x196/0x2c0
    [  697.440693]  ? drm_atomic_helper_commit_modeset_enables+0x30a/0x470
    [  697.450115]  ? ast_dp_set_enable+0x123/0x140 [ast]
    [  697.458059]  ? __warn.cold+0xaf/0xca
    [  697.464713]  ? ast_dp_set_enable+0x123/0x140 [ast]
    [  697.472633]  ? report_bug+0x134/0x1d0
    [  697.479544]  ? handle_bug+0x58/0x90
    [  697.486127]  ? exc_invalid_op+0x13/0x40
    [  697.492975]  ? asm_exc_invalid_op+0x16/0x20
    [  697.500224]  ? preempt_count_sub+0x14/0xc0
    [  697.507473]  ? ast_dp_set_enable+0x123/0x140 [ast]
    [  697.515377]  ? ast_dp_set_enable+0x123/0x140 [ast]
    [  697.523227]  drm_atomic_helper_commit_modeset_enables+0x30a/0x470
    [  697.532388]  drm_atomic_helper_commit_tail+0x58/0x90
    [  697.540400]  ast_mode_config_helper_atomic_commit_tail+0x30/0x40 [ast]
    [  697.550009]  commit_tail+0xfe/0x1d0
    [  697.556547]  drm_atomic_helper_commit+0x198/0x1c0
    
    This is a cosmetical problem. Enabling the video signal still works
    even with the error message. The problem has always been present, but
    only recent versions of the ast driver warn about missing the timeout.
    
    Signed-off-by: Thomas Zimmermann <[email protected]>
    Fixes: 4e29cc7c5c67 ("drm/ast: astdp: Replace ast_dp_set_on_off()")
    Cc: Thomas Zimmermann <[email protected]>
    Cc: Jocelyn Falempe <[email protected]>
    Cc: Dave Airlie <[email protected]>
    Cc: [email protected]
    Cc: <[email protected]> # v6.13+
    Reviewed-by: Jocelyn Falempe <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/bridge: anx7625: use eld_mutex to protect access to connector->eld [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Fri Dec 6 11:43:05 2024 +0200

    drm/bridge: anx7625: use eld_mutex to protect access to connector->eld
    
    [ Upstream commit e72bf423a60afd744d13e40ab2194044a3af5217 ]
    
    Reading access to connector->eld can happen at the same time the
    drm_edid_to_eld() updates the data. Take the newly added eld_mutex in
    order to protect connector->eld from concurrent access.
    
    Reviewed-by: Maxime Ripard <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT [+ + +]
Author: Hermes Wu <[email protected]>
Date:   Mon Dec 30 18:51:22 2024 +0800

    drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT
    
    [ Upstream commit 85597bc0d70c287ba41f17d14d3d857a38a3d727 ]
    
    A HDCP source device shall support max downstream to 127 devices.
    Change definition MAX_HDCP_DOWN_STREAM_COUNT to 127
    
    KSVs shall save for DRM blocked devices check.
    This results in struct it6505 growth by ~0.5 KiB.
    
    Reviewed-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Hermes Wu <[email protected]>
    Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/20241230-v7-upstream-v7-4-e0fdd4844703@ite.corp-partner.google.com
    Signed-off-by: Sasha Levin <[email protected]>

drm/bridge: it6505: fix HDCP Bstatus check [+ + +]
Author: Hermes Wu <[email protected]>
Date:   Mon Dec 30 18:51:23 2024 +0800

    drm/bridge: it6505: fix HDCP Bstatus check
    
    [ Upstream commit 0fd2ff47d8c207fa3173661de04bb9e8201c0ad2 ]
    
    When HDCP is activated,
    a DisplayPort source receiving CP_IRQ from the sink
    shall check Bstatus from DPCD and process the corresponding value
    
    Reviewed-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Hermes Wu <[email protected]>
    Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/20241230-v7-upstream-v7-5-e0fdd4844703@ite.corp-partner.google.com
    Signed-off-by: Sasha Levin <[email protected]>

drm/bridge: it6505: fix HDCP CTS compare V matching [+ + +]
Author: Hermes Wu <[email protected]>
Date:   Mon Dec 30 18:51:26 2024 +0800

    drm/bridge: it6505: fix HDCP CTS compare V matching
    
    [ Upstream commit 0989c02c7a5c887c70afeae80c64d0291624e1a7 ]
    
    When HDCP negotiation with a repeater device.
    Checking SHA V' matching must retry 3 times before restarting HDCP.
    
    Signed-off-by: Hermes Wu <[email protected]>
    Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/20241230-v7-upstream-v7-8-e0fdd4844703@ite.corp-partner.google.com
    Signed-off-by: Sasha Levin <[email protected]>

drm/bridge: it6505: fix HDCP CTS KSV list wait timer [+ + +]
Author: Hermes Wu <[email protected]>
Date:   Mon Dec 30 18:51:27 2024 +0800

    drm/bridge: it6505: fix HDCP CTS KSV list wait timer
    
    [ Upstream commit 9f9eef9ec1a2b57d95a86fe81df758e8253a7766 ]
    
    HDCP must disabled encryption and restart authentication after
    waiting KSV for 5s.
    The original method uses a counter in a waitting loop that may
    wait much longer than it is supposed to.
    Use time_after() for KSV wait timeout.
    
    Signed-off-by: Hermes Wu <[email protected]>
    Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/20241230-v7-upstream-v7-9-e0fdd4844703@ite.corp-partner.google.com
    Signed-off-by: Sasha Levin <[email protected]>

drm/bridge: it6505: fix HDCP encryption when R0 ready [+ + +]
Author: Hermes Wu <[email protected]>
Date:   Mon Dec 30 18:51:24 2024 +0800

    drm/bridge: it6505: fix HDCP encryption when R0 ready
    
    [ Upstream commit 8c01b0bae2f9e58f2fee0e811cb90d8331986554 ]
    
    When starting HDCP authentication, HDCP encryption should be enabled
    when R0'is checked.
    
    Change encryption enables time at R0' ready.
    The hardware HDCP engine trigger is changed and the repeater KSV fails
    will restart HDCP.
    
    Signed-off-by: Hermes Wu <[email protected]>
    Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/20241230-v7-upstream-v7-6-e0fdd4844703@ite.corp-partner.google.com
    Signed-off-by: Sasha Levin <[email protected]>

drm/bridge: ite-it66121: use eld_mutex to protect access to connector->eld [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Fri Dec 6 11:43:06 2024 +0200

    drm/bridge: ite-it66121: use eld_mutex to protect access to connector->eld
    
    [ Upstream commit 39ead6e02ea7d19b421e9d42299d4293fed3064e ]
    
    Reading access to connector->eld can happen at the same time the
    drm_edid_to_eld() updates the data. Take the newly added eld_mutex in
    order to protect connector->eld from concurrent access.
    
    Reviewed-by: Maxime Ripard <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/client: Handle tiled displays better [+ + +]
Author: Maarten Lankhorst <[email protected]>
Date:   Thu Jan 16 15:28:25 2025 +0100

    drm/client: Handle tiled displays better
    
    commit 10026f536843eb8c9148ef6ffb4c6deeebc26838 upstream.
    
    When testing on my tiled display, initially the tiled display is
    detected correctly:
    [90376.523692] xe 0000:67:00.0: [drm:drm_client_firmware_config.isra.0 [drm]] fallback: Not all outputs enabled
    [90376.523713] xe 0000:67:00.0: [drm:drm_client_firmware_config.isra.0 [drm]] Enabled: 0, detected: 2
    ...
    [90376.523967] xe 0000:67:00.0: [drm:drm_client_modeset_probe [drm]] [CRTC:82:pipe A] desired mode 1920x2160 set (1920,0)
    [90376.524020] xe 0000:67:00.0: [drm:drm_client_modeset_probe [drm]] [CRTC:134:pipe B] desired mode 1920x2160 set (0,0)
    
    But then, when modes have been set:
    [90379.729525] xe 0000:67:00.0: [drm:drm_client_firmware_config.isra.0 [drm]] [CONNECTOR:287:DP-4] on [CRTC:82:pipe A]: 1920x2160
    [90379.729640] xe 0000:67:00.0: [drm:drm_client_firmware_config.isra.0 [drm]] [CONNECTOR:289:DP-5] on [CRTC:134:pipe B]: 1920x2160
    ...
    [90379.730036] xe 0000:67:00.0: [drm:drm_client_modeset_probe [drm]] [CRTC:82:pipe A] desired mode 1920x2160 set (0,0)
    [90379.730124] xe 0000:67:00.0: [drm:drm_client_modeset_probe [drm]] [CRTC:134:pipe B] desired mode 1920x2160 set (0,0)
    
    Call drm_client_get_tile_offsets() in drm_client_firmware_config() as
    well, to ensure that the offset is set correctly.
    
    This has to be done as a separate pass, as the tile order may not be
    equal to the drm connector order.
    
    Acked-by: Thomas Zimmermann <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Maarten Lankhorst <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/connector: add mutex to protect ELD from concurrent access [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Fri Dec 6 11:43:04 2024 +0200

    drm/connector: add mutex to protect ELD from concurrent access
    
    [ Upstream commit df7c8e3dde37a9d81c0613285b43600f3cc70f34 ]
    
    The connector->eld is accessed by the .get_eld() callback. This access
    can collide with the drm_edid_to_eld() updating the data at the same
    time. Add drm_connector.eld_mutex to protect the data from concurrenct
    access. Individual drivers are not updated (to reduce possible issues
    while applying the patch), maintainers are to find a best suitable way
    to lock that mutex while accessing the ELD data.
    
    Reviewed-by: Maxime Ripard <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/exynos: hdmi: use eld_mutex to protect access to connector->eld [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Fri Dec 6 11:43:08 2024 +0200

    drm/exynos: hdmi: use eld_mutex to protect access to connector->eld
    
    [ Upstream commit 5e8436d334ed7f6785416447c50b42077c6503e0 ]
    
    Reading access to connector->eld can happen at the same time the
    drm_edid_to_eld() updates the data. Take the newly added eld_mutex in
    order to protect connector->eld from concurrent access.
    
    Reviewed-by: Maxime Ripard <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/i915/dp: fix the Adaptive sync Operation mode for SDP [+ + +]
Author: Ankit Nautiyal <[email protected]>
Date:   Thu Jan 30 10:46:06 2025 +0530

    drm/i915/dp: fix the Adaptive sync Operation mode for SDP
    
    [ Upstream commit 4466302262b38f5e6c65325035b4036a42efc934 ]
    
    Currently we support Adaptive sync operation mode with dynamic frame
    rate, but instead the operation mode with fixed rate is set.
    This was initially set correctly in the earlier version of changes but
    later got changed, while defining a macro for the same.
    
    Fixes: a5bd5991cb8a ("drm/i915/display: Compute AS SDP parameters")
    Cc: Mitul Golani <[email protected]>
    Cc: Ankit Nautiyal <[email protected]>
    Cc: Jani Nikula <[email protected]>
    Reviewed-by: Mitul Golani <[email protected]>
    Signed-off-by: Ankit Nautiyal <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    (cherry picked from commit c5806862543ff6c2ad242409fcdf0667eac26dae)
    Signed-off-by: Rodrigo Vivi <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

drm/i915/dp: Iterate DSC BPP from high to low on all platforms [+ + +]
Author: Jani Nikula <[email protected]>
Date:   Fri Jan 31 14:49:54 2025 +0200

    drm/i915/dp: Iterate DSC BPP from high to low on all platforms
    
    commit 230b19bc2bcc5897d0e20b4ce7e9790a469a2db0 upstream.
    
    Commit 1c56e9a39833 ("drm/i915/dp: Get optimal link config to have best
    compressed bpp") tries to find the best compressed bpp for the
    link. However, it iterates from max to min bpp on display 13+, and from
    min to max on other platforms. This presumably leads to minimum
    compressed bpp always being chosen on display 11-12.
    
    Iterate from high to low on all platforms to actually use the best
    possible compressed bpp.
    
    Fixes: 1c56e9a39833 ("drm/i915/dp: Get optimal link config to have best compressed bpp")
    Cc: Ankit Nautiyal <[email protected]>
    Cc: Imre Deak <[email protected]>
    Cc: <[email protected]> # v6.7+
    Reviewed-by: Imre Deak <[email protected]>
    Reviewed-by: Ankit Nautiyal <[email protected]>
    Signed-off-by: Jani Nikula <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/3bba67923cbcd13a59d26ef5fa4bb042b13c8a9b.1738327620.git.jani.nikula@intel.com
    (cherry picked from commit 56b0337d429356c3b9ecc36a03023c8cc856b196)
    Signed-off-by: Rodrigo Vivi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/i915/guc: Debug print LRC state entries only if the context is pinned [+ + +]
Author: Daniele Ceraolo Spurio <[email protected]>
Date:   Tue Jan 14 16:13:34 2025 -0800

    drm/i915/guc: Debug print LRC state entries only if the context is pinned
    
    commit 57965269896313e1629a518d3971ad55f599b792 upstream.
    
    After the context is unpinned the backing memory can also be unpinned,
    so any accesses via the lrc_reg_state pointer can end up in unmapped
    memory. To avoid that, make sure to only access that memory if the
    context is pinned when printing its info.
    
    v2: fix newline alignment
    
    Fixes: 28ff6520a34d ("drm/i915/guc: Update GuC debugfs to support new GuC")
    Signed-off-by: Daniele Ceraolo Spurio <[email protected]>
    Cc: John Harrison <[email protected]>
    Cc: Matthew Brost <[email protected]>
    Cc: <[email protected]> # v5.15+
    Reviewed-by: John Harrison <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    (cherry picked from commit 5bea40687c5cf2a33bf04e9110eb2e2b80222ef5)
    Signed-off-by: Rodrigo Vivi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/i915/hdcp: Fix Repeater authentication during topology change [+ + +]
Author: Suraj Kandpal <[email protected]>
Date:   Tue Dec 17 14:07:23 2024 +0530

    drm/i915/hdcp: Fix Repeater authentication during topology change
    
    [ Upstream commit 448060463198924c0a485e7e1622fa8a9c03cf3e ]
    
    When topology changes, before beginning a new HDCP authentication by
    sending AKE_init message we need to first authenticate only the
    repeater. Only after repeater authentication failure, it makes sense
    to start a new HDCP authentication. Even though it made sense to not
    enable HDCP directly from check_link and schedule it for later, repeater
    authentication needs to be done immediately.
    
    --v2
    -Fix comment grammatical errors [Ankit]
    
    Fixes: 47ef55a8b784 ("drm/i915/hdcp: Don't enable HDCP2.2 directly from check_link")
    Signed-off-by: Suraj Kandpal <[email protected]>
    Reviewed-by: Ankit Nautiyal <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    (cherry picked from commit 605a33e765890e4f1345315afc25268d4ae0fb7c)
    Signed-off-by: Rodrigo Vivi <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/i915: Drop 64bpp YUV formats from ICL+ SDR planes [+ + +]
Author: Ville Syrjälä <[email protected]>
Date:   Wed Dec 18 19:36:47 2024 +0200

    drm/i915: Drop 64bpp YUV formats from ICL+ SDR planes
    
    commit c7b49506b3ba7a62335e6f666a43f67d5cd9fd1e upstream.
    
    I'm seeing underruns with these 64bpp YUV formats on TGL.
    
    The weird details:
    - only happens on pipe B/C/D SDR planes, pipe A SDR planes
      seem fine, as do all HDR planes
    - somehow CDCLK related, higher CDCLK allows for bigger plane
      with these formats without underruns. With 300MHz CDCLK I
      can only go up to 1200 pixels wide or so, with 650MHz even
      a 3840 pixel wide plane was OK
    - ICL and ADL so far appear unaffected
    
    So not really sure what's the deal with this, but bspec does
    state "64-bit formats supported only on the HDR planes" so
    let's just drop these formats from the SDR planes. We already
    disallow 64bpp RGB formats.
    
    Cc: [email protected]
    Signed-off-by: Ville Syrjälä <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Reviewed-by: Juha-Pekka Heikkila <[email protected]>
    (cherry picked from commit 35e1aacfe536d6e8d8d440cd7155366da2541ad4)
    Signed-off-by: Rodrigo Vivi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/i915: Fix page cleanup on DMA remap failure [+ + +]
Author: Brian Geffon <[email protected]>
Date:   Mon Jan 27 15:43:32 2025 -0500

    drm/i915: Fix page cleanup on DMA remap failure
    
    commit fa6182c8b13ebfdc70ebdc09161a70dd8131f3b1 upstream.
    
    When converting to folios the cleanup path of shmem_get_pages() was
    missed. When a DMA remap fails and the max segment size is greater than
    PAGE_SIZE it will attempt to retry the remap with a PAGE_SIZEd segment
    size. The cleanup code isn't properly using the folio apis and as a
    result isn't handling compound pages correctly.
    
    v2 -> v3:
    (Ville) Just use shmem_sg_free_table() as-is in the failure path of
    shmem_get_pages(). shmem_sg_free_table() will clear mapping unevictable
    but it will be reset when it retries in shmem_sg_alloc_table().
    
    v1 -> v2:
    (Ville) Fixed locations where we were not clearing mapping unevictable.
    
    Cc: [email protected]
    Cc: Ville Syrjala <[email protected]>
    Cc: Vidya Srinivas <[email protected]>
    Link: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13487
    Link: https://lore.kernel.org/lkml/[email protected]/
    Fixes: 0b62af28f249 ("i915: convert shmem_sg_free_table() to use a folio_batch")
    Signed-off-by: Brian Geffon <[email protected]>
    Suggested-by: Tomasz Figa <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Reviewed-by: Jonathan Cavitt <[email protected]>
    Tested-by: Vidya Srinivas <[email protected]>
    Signed-off-by: Ville Syrjälä <[email protected]>
    (cherry picked from commit 9e304a18630875352636ad52a3d2af47c3bde824)
    Signed-off-by: Rodrigo Vivi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/komeda: Add check for komeda_get_layer_fourcc_list() [+ + +]
Author: Haoxiang Li <[email protected]>
Date:   Thu Dec 19 17:02:56 2024 +0800

    drm/komeda: Add check for komeda_get_layer_fourcc_list()
    
    commit 79fc672a092d93a7eac24fe20a571d4efd8fa5a4 upstream.
    
    Add check for the return value of komeda_get_layer_fourcc_list()
    to catch the potential exception.
    
    Fixes: 5d51f6c0da1b ("drm/komeda: Add writeback support")
    Cc: [email protected]
    Signed-off-by: Haoxiang Li <[email protected]>
    Acked-by: Liviu Dudau <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Liviu Dudau <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/modeset: Handle tiled displays in pan_display_atomic. [+ + +]
Author: Maarten Lankhorst <[email protected]>
Date:   Thu Jan 16 15:28:24 2025 +0100

    drm/modeset: Handle tiled displays in pan_display_atomic.
    
    commit f4a9dd57e549a17a7dac1c1defec26abd7e5c2d4 upstream.
    
    Tiled displays have a different x/y offset to begin with. Instead of
    attempting to remember this, just apply a delta instead.
    
    This fixes the first tile being duplicated on other tiles when vt
    switching.
    
    Acked-by: Thomas Zimmermann <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Maarten Lankhorst <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/msm/dp: use eld_mutex to protect access to connector->eld [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Fri Dec 6 11:43:10 2024 +0200

    drm/msm/dp: use eld_mutex to protect access to connector->eld
    
    [ Upstream commit 9aad030dc64f6994dc5de7bb81ceca55dbc555c3 ]
    
    Reading access to connector->eld can happen at the same time the
    drm_edid_to_eld() updates the data. Take the newly added eld_mutex in
    order to protect connector->eld from concurrent access.
    
    Reviewed-by: Maxime Ripard <[email protected]>
    Acked-by: Abhinav Kumar <[email protected]>
    Reviewed-by: Abhinav Kumar <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/msm/dpu: filter out too wide modes if no 3dmux is present [+ + +]
Author: Abhinav Kumar <[email protected]>
Date:   Mon Dec 9 13:18:36 2024 -0800

    drm/msm/dpu: filter out too wide modes if no 3dmux is present
    
    [ Upstream commit dbc7bb1a93f41c533fe31ddc97bdf777d7a61faa ]
    
    On chipsets such as QCS615, there is no 3dmux present. In such
    a case, a layer exceeding the max_mixer_width cannot be split,
    hence cannot be supported.
    
    Filter out the modes which exceed the max_mixer_width when there
    is no 3dmux present. Also, add a check in the dpu_crtc_atomic_check()
    to return failure for such modes.
    
    Signed-off-by: Abhinav Kumar <[email protected]>
    Reviewed-by: Dmitry Baryshkov <[email protected]>
    Tested-by: Xiangxu Yin <[email protected]> # QCS615
    Patchwork: https://patchwork.freedesktop.org/patch/627974/
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/radeon: use eld_mutex to protect access to connector->eld [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Fri Dec 6 11:43:11 2024 +0200

    drm/radeon: use eld_mutex to protect access to connector->eld
    
    [ Upstream commit b54c14f82428c8a602392d4cae1958a71a578132 ]
    
    Reading access to connector->eld can happen at the same time the
    drm_edid_to_eld() updates the data. Take the newly added eld_mutex in
    order to protect connector->eld from concurrent access.
    
    Reviewed-by: Maxime Ripard <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/rockchip: cdn-dp: Use drm_connector_helper_hpd_irq_event() [+ + +]
Author: Thomas Zimmermann <[email protected]>
Date:   Tue Nov 5 14:38:16 2024 +0100

    drm/rockchip: cdn-dp: Use drm_connector_helper_hpd_irq_event()
    
    commit 666e1960464140cc4bc9203c203097e70b54c95a upstream.
    
    The code for detecting and updating the connector status in
    cdn_dp_pd_event_work() has a number of problems.
    
    - It does not aquire the locks to call the detect helper and update
    the connector status. These are struct drm_mode_config.connection_mutex
    and struct drm_mode_config.mutex.
    
    - It does not use drm_helper_probe_detect(), which helps with the
    details of locking and detection.
    
    - It uses the connector's status field to determine a change to
    the connector status. The epoch_counter field is the correct one. The
    field signals a change even if the connector status' value did not
    change.
    
    Replace the code with a call to drm_connector_helper_hpd_irq_event(),
    which fixes all these problems.
    
    Signed-off-by: Thomas Zimmermann <[email protected]>
    Fixes: 81632df69772 ("drm/rockchip: cdn-dp: do not use drm_helper_hpd_irq_event")
    Cc: Chris Zhong <[email protected]>
    Cc: Guenter Roeck <[email protected]>
    Cc: Sandy Huang <[email protected]>
    Cc: "Heiko Stübner" <[email protected]>
    Cc: Andy Yan <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: <[email protected]> # v4.11+
    Signed-off-by: Heiko Stuebner <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/sti: hdmi: use eld_mutex to protect access to connector->eld [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Fri Dec 6 11:43:12 2024 +0200

    drm/sti: hdmi: use eld_mutex to protect access to connector->eld
    
    [ Upstream commit e99c0b517bcd53cf61f998a3c4291333401cb391 ]
    
    Reading access to connector->eld can happen at the same time the
    drm_edid_to_eld() updates the data. Take the newly added eld_mutex in
    order to protect connector->eld from concurrent access.
    
    Reviewed-by: Maxime Ripard <[email protected]>
    Acked-by: Raphael Gallais-Pou <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/tests: hdmi: handle empty modes in find_preferred_mode() [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Sat Nov 30 03:52:26 2024 +0200

    drm/tests: hdmi: handle empty modes in find_preferred_mode()
    
    [ Upstream commit d3314efd6ebf335a3682b1d6b1b81cdab3d8254a ]
    
    If the connector->modes list is empty, then list_first_entry() returns a
    bogus entry. Change that to use list_first_entry_or_null().
    
    Reviewed-by: Maxime Ripard <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

drm/tests: hdmi: return meaningful value from set_connector_edid() [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Sat Nov 30 03:52:28 2024 +0200

    drm/tests: hdmi: return meaningful value from set_connector_edid()
    
    [ Upstream commit a8403be6eea91e4f5d8ad5dbc463dd08339eaece ]
    
    The set_connector_edid() function returns a bogus 0, performing the
    check on the connector->funcs->fill_modes() result internally. Make the
    function pass the fill_modes()'s return value to the caller and move
    corresponding checks to the caller site.
    
    Reviewed-by: Maxime Ripard <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/vc4: hdmi: use eld_mutex to protect access to connector->eld [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Fri Dec 6 11:43:13 2024 +0200

    drm/vc4: hdmi: use eld_mutex to protect access to connector->eld
    
    [ Upstream commit 81a9a93b169a273ccc4a9a1ee56f17e9981d3f98 ]
    
    Reading access to connector->eld can happen at the same time the
    drm_edid_to_eld() updates the data. Take the newly added eld_mutex in
    order to protect connector->eld from concurrent access.
    
    Reviewed-by: Maxime Ripard <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/virtio: New fence for every plane update [+ + +]
Author: Dongwon Kim <[email protected]>
Date:   Mon Oct 21 02:08:03 2024 +0300

    drm/virtio: New fence for every plane update
    
    [ Upstream commit d3c55b8ab6fe5fa2e7ab02efd36d09c39ee5022f ]
    
    Having a fence linked to a virtio_gpu_framebuffer in the plane update
    sequence would cause conflict when several planes referencing the same
    framebuffer (e.g. Xorg screen covering multi-displays configured for an
    extended mode) and those planes are updated concurrently. So it is needed
    to allocate a fence for every plane state instead of the framebuffer.
    
    Signed-off-by: Dongwon Kim <[email protected]>
    [[email protected]: rebase, fix up, edit commit message]
    Signed-off-by: Dmitry Osipenko <[email protected]>
    Acked-by: Vivek Kasireddy <[email protected]>
    Reviewed-by: Rob Clark <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/xe/devcoredump: Move exec queue snapshot to Contexts section [+ + +]
Author: Lucas De Marchi <[email protected]>
Date:   Wed Jan 22 21:11:11 2025 -0800

    drm/xe/devcoredump: Move exec queue snapshot to Contexts section
    
    commit 042c48b73699c47d84b6ace73036e5a31a0d4cfc upstream.
    
    Having the exec queue snapshot inside a "GuC CT" section was always
    wrong.  Commit c28fd6c358db ("drm/xe/devcoredump: Improve section
    headings and add tile info") tried to fix that bug, but with that also
    broke the mesa tool that parses the devcoredump, hence it was reverted
    in commit a53da2fb25a3 ("drm/xe: Revert some changes that break a mesa
    debug tool").
    
    With the mesa tool also fixed, this can propagate as a fix on both
    kernel and userspace side to avoid unnecessary headache for a debug
    feature.
    
    Cc: John Harrison <[email protected]>
    Cc: Julia Filipchuk <[email protected]>
    Cc: José Roberto de Souza <[email protected]>
    Cc: [email protected]
    Fixes: a53da2fb25a3 ("drm/xe: Revert some changes that break a mesa debug tool")
    Reviewed-by: José Roberto de Souza <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Lucas De Marchi <[email protected]>
    (cherry picked from commit a37934ea75d331fafa7fe80b6180642ba5193422)
    Signed-off-by: Rodrigo Vivi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/xe/oa: Preserve oa_ctrl unused bits [+ + +]
Author: Ashutosh Dixit <[email protected]>
Date:   Thu Jan 16 19:21:55 2025 -0800

    drm/xe/oa: Preserve oa_ctrl unused bits
    
    [ Upstream commit 588c20079e17dae9e1f49ba42981a05de1c9136e ]
    
    UMD's have interest in setting unused bits of the oa_ctrl register "out of
    band" for certain experiments. To facilitate this, don't clobber previous
    oa_ctrl unused bits, i.e. rmw the values rather than simply write them.
    
    Fixes: e936f885f1e9 ("drm/xe/oa/uapi: Expose OA stream fd")
    Signed-off-by: Ashutosh Dixit <[email protected]>
    Reviewed-by: Umesh Nerlige Ramappa <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    (cherry picked from commit cfa9d40db8c30d894171010fe765d96e9bc6a47e)
    Signed-off-by: Rodrigo Vivi <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/xe/pf: Fix migration initialization [+ + +]
Author: Michal Wajdeczko <[email protected]>
Date:   Tue Jan 21 00:24:43 2025 +0100

    drm/xe/pf: Fix migration initialization
    
    [ Upstream commit 9f706fd8024208b0686bb8ec68589d758f765672 ]
    
    The migration support only needs to be initialized once, but it
    was incorrectly called from the xe_gt_sriov_pf_init_hw(), which
    is part of the reset flow and may be called multiple times.
    
    Fixes: d86e3737c7ab ("drm/xe/pf: Add functions to save and restore VF GuC state")
    Signed-off-by: Michal Wajdeczko <[email protected]>
    Cc: Michał Winiarski <[email protected]>
    Reviewed-by: Rodrigo Vivi <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    (cherry picked from commit 9ebb5846e1a3b1705f8a7cbc528888a1aa0b163e)
    Signed-off-by: Rodrigo Vivi <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/xe: Fix and re-enable xe_print_blob_ascii85() [+ + +]
Author: Lucas De Marchi <[email protected]>
Date:   Thu Jan 23 12:22:03 2025 -0800

    drm/xe: Fix and re-enable xe_print_blob_ascii85()
    
    commit a9ab6591b45258b79af1cb66112fd9f83c8855da upstream.
    
    Commit 70fb86a85dc9 ("drm/xe: Revert some changes that break a mesa
    debug tool") partially reverted some changes to workaround breakage
    caused to mesa tools. However, in doing so it also broke fetching the
    GuC log via debugfs since xe_print_blob_ascii85() simply bails out.
    
    The fix is to avoid the extra newlines: the devcoredump interface is
    line-oriented and adding random newlines in the middle breaks it. If a
    tool is able to parse it by looking at the data and checking for chars
    that are out of the ascii85 space, it can still do so. A format change
    that breaks the line-oriented output on devcoredump however needs better
    coordination with existing tools.
    
    v2: Add suffix description comment
    v3: Reword explanation of xe_print_blob_ascii85() calling drm_puts()
        in a loop
    
    Reviewed-by: José Roberto de Souza <[email protected]>
    Cc: John Harrison <[email protected]>
    Cc: Julia Filipchuk <[email protected]>
    Cc: José Roberto de Souza <[email protected]>
    Cc: [email protected]
    Fixes: 70fb86a85dc9 ("drm/xe: Revert some changes that break a mesa debug tool")
    Fixes: ec1455ce7e35 ("drm/xe/devcoredump: Add ASCII85 dump helper function")
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Lucas De Marchi <[email protected]>
    (cherry picked from commit 2c95bbf5002776117a69caed3b31c10bf7341bec)
    Signed-off-by: Rodrigo Vivi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm: Add panel backlight quirks [+ + +]
Author: Thomas Weißschuh <[email protected]>
Date:   Mon Nov 11 19:09:35 2024 +0100

    drm: Add panel backlight quirks
    
    [ Upstream commit 22e5c7ae12145af13785e3ff138395d5b1a22116 ]
    
    Panels using a PWM-controlled backlight source do not have a standard
    way to communicate their valid PWM ranges.
    On x86 the ranges are read from ACPI through driver-specific tables.
    The built-in ranges are not necessarily correct, or may grow stale if an
    older device can be retrofitted with newer panels.
    
    Add a quirk infrastructure with which the minimum valid backlight value
    can be maintained as part of the kernel.
    
    Signed-off-by: Thomas Weißschuh <[email protected]>
    Tested-by: Dustin L. Howett <[email protected]>
    Reviewed-by: Mario Limonciello <[email protected]>
    Reviewed-by: Harry Wentland <[email protected]>
    Signed-off-by: Mario Limonciello <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/20241111-amdgpu-min-backlight-quirk-v7-1-f662851fda69@weissschuh.net
    Signed-off-by: Sasha Levin <[email protected]>

drm: panel-backlight-quirks: Add Framework 13 glossy and 2.8k panels [+ + +]
Author: Dustin L. Howett <[email protected]>
Date:   Mon Nov 11 19:09:38 2024 +0100

    drm: panel-backlight-quirks: Add Framework 13 glossy and 2.8k panels
    
    [ Upstream commit d80b5c5b9be6b2e1cdeaaeaa8259523b63cae292 ]
    
    I have tested these panels on the Framework Laptop 13 AMD with firmware
    revision 3.05 (latest at time of submission).
    
    Signed-off-by: Dustin L. Howett <[email protected]>
    Signed-off-by: Thomas Weißschuh <[email protected]>
    Reviewed-by: Mario Limonciello <[email protected]>
    Reviewed-by: Harry Wentland <[email protected]>
    Signed-off-by: Mario Limonciello <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/20241111-amdgpu-min-backlight-quirk-v7-4-f662851fda69@weissschuh.net
    Signed-off-by: Sasha Levin <[email protected]>

drm: panel-backlight-quirks: Add Framework 13 matte panel [+ + +]
Author: Thomas Weißschuh <[email protected]>
Date:   Mon Nov 11 19:09:37 2024 +0100

    drm: panel-backlight-quirks: Add Framework 13 matte panel
    
    [ Upstream commit 916ecc0db336768d80e14ef28a8c64a775274f95 ]
    
    The value of "min_input_signal" returned from ATIF on a Framework AMD 13
    is "12". This leads to a fairly bright minimum display backlight.
    
    Add a quirk to override that the minimum backlight PWM to "0" which
    leads to a much lower minimum brightness, which is still visible.
    
    Tested on a Framework AMD 13 BIOS 3.05 with the matte panel.
    
    Link: https://community.frame.work/t/25711/9
    Link: https://community.frame.work/t/47036
    Signed-off-by: Thomas Weißschuh <[email protected]>
    Tested-by: Dustin L. Howett <[email protected]>
    Reviewed-by: Mario Limonciello <[email protected]>
    Reviewed-by: Harry Wentland <[email protected]>
    Signed-off-by: Mario Limonciello <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/20241111-amdgpu-min-backlight-quirk-v7-3-f662851fda69@weissschuh.net
    Signed-off-by: Sasha Levin <[email protected]>

 
efi: libstub: Use '-std=gnu11' to fix build with GCC 15 [+ + +]
Author: Nathan Chancellor <[email protected]>
Date:   Tue Jan 21 18:11:34 2025 -0700

    efi: libstub: Use '-std=gnu11' to fix build with GCC 15
    
    commit 8ba14d9f490aef9fd535c04e9e62e1169eb7a055 upstream.
    
    GCC 15 changed the default C standard version to C23, which should not
    have impacted the kernel because it requests the gnu11 standard via
    '-std=' in the main Makefile. However, the EFI libstub Makefile uses its
    own set of KBUILD_CFLAGS for x86 without a '-std=' value (i.e., using
    the default), resulting in errors from the kernel's definitions of bool,
    true, and false in stddef.h, which are reserved keywords under C23.
    
      ./include/linux/stddef.h:11:9: error: expected identifier before ‘false’
         11 |         false   = 0,
      ./include/linux/types.h:35:33: error: two or more data types in declaration specifiers
         35 | typedef _Bool                   bool;
    
    Set '-std=gnu11' in the x86 cflags to resolve the error and consistently
    use the same C standard version for the entire kernel. All other
    architectures reuse KBUILD_CFLAGS from the rest of the kernel, so this
    issue is not visible for them.
    
    Cc: [email protected]
    Reported-by: Kostadin Shishmanov <[email protected]>
    Closes: https://lore.kernel.org/4OAhbllK7x4QJGpZjkYjtBYNLd_2whHx9oFiuZcGwtVR4hIzvduultkgfAIRZI3vQpZylu7Gl929HaYFRGeMEalWCpeMzCIIhLxxRhq4U-Y=@protonmail.com/
    Reported-by: Jakub Jelinek <[email protected]>
    Closes: https://lore.kernel.org/Z4467umXR2PZ0M1H@tucnak/
    Signed-off-by: Nathan Chancellor <[email protected]>
    Signed-off-by: Ard Biesheuvel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ethtool: ntuple: fix rss + ring_cookie check [+ + +]
Author: Jakub Kicinski <[email protected]>
Date:   Fri Jan 31 17:30:38 2025 -0800

    ethtool: ntuple: fix rss + ring_cookie check
    
    [ Upstream commit 2b91cc1214b165c25ac9b0885db89a0d3224028a ]
    
    The info.flow_type is for RXFH commands, ntuple flow_type is inside
    the flow spec. The check currently does nothing, as info.flow_type
    is 0 (or even uninitialized by user space) for ETHTOOL_SRXCLSRLINS.
    
    Fixes: 9e43ad7a1ede ("net: ethtool: only allow set_rxnfc with rss + ring_cookie if driver opts in")
    Reviewed-by: Gal Pressman <[email protected]>
    Reviewed-by: Joe Damato <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ethtool: rss: fix hiding unsupported fields in dumps [+ + +]
Author: Jakub Kicinski <[email protected]>
Date:   Fri Jan 31 17:30:37 2025 -0800

    ethtool: rss: fix hiding unsupported fields in dumps
    
    [ Upstream commit 244f8aa46fa9e2f4ea5fe0e04988b395d5e30fc7 ]
    
    Commit ec6e57beaf8b ("ethtool: rss: don't report key if device
    doesn't support it") intended to stop reporting key fields for
    additional rss contexts if device has a global hashing key.
    
    Later we added dump support and the filtering wasn't properly
    added there. So we end up reporting the key fields in dumps
    but not in dos:
    
      # ./pyynl/cli.py --spec netlink/specs/ethtool.yaml --do rss-get \
                    --json '{"header": {"dev-index":2}, "context": 1 }'
      {
         "header": { ... },
         "context": 1,
         "indir": [0, 1, 2, 3, ...]]
      }
    
      # ./pyynl/cli.py --spec netlink/specs/ethtool.yaml --dump rss-get
      [
         ... snip context 0 ...
         { "header": { ... },
           "context": 1,
           "indir": [0, 1, 2, 3, ...],
     ->    "input_xfrm": 255,
     ->    "hfunc": 1,
     ->    "hkey": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
         }
      ]
    
    Hide these fields correctly.
    
    The drivers/net/hw/rss_ctx.py selftest catches this when run on
    a device with single key, already:
    
      # Check| At /root/./ksft-net-drv/drivers/net/hw/rss_ctx.py, line 381, in test_rss_context_dump:
      # Check|     ksft_ne(set(data.get('hkey', [1])), {0}, "key is all zero")
      # Check failed {0} == {0} key is all zero
      not ok 8 rss_ctx.test_rss_context_dump
    
    Fixes: f6122900f4e2 ("ethtool: rss: support dumping RSS contexts")
    Reviewed-by: Gal Pressman <[email protected]>
    Reviewed-by: Joe Damato <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
exec: fix up /proc/pid/comm in the execveat(AT_EMPTY_PATH) case [+ + +]
Author: Kees Cook <[email protected]>
Date:   Thu Nov 21 07:07:05 2024 -0800

    exec: fix up /proc/pid/comm in the execveat(AT_EMPTY_PATH) case
    
    [ Upstream commit 543841d1806029889c2f69f040e88b247aba8e22 ]
    
    Zbigniew mentioned at Linux Plumber's that systemd is interested in
    switching to execveat() for service execution, but can't, because the
    contents of /proc/pid/comm are the file descriptor which was used,
    instead of the path to the binary[1]. This makes the output of tools like
    top and ps useless, especially in a world where most fds are opened
    CLOEXEC so the number is truly meaningless.
    
    When the filename passed in is empty (e.g. with AT_EMPTY_PATH), use the
    dentry's filename for "comm" instead of using the useless numeral from
    the synthetic fdpath construction. This way the actual exec machinery
    is unchanged, but cosmetically the comm looks reasonable to admins
    investigating things.
    
    Instead of adding TASK_COMM_LEN more bytes to bprm, use one of the unused
    flag bits to indicate that we need to set "comm" from the dentry.
    
    Suggested-by: Zbigniew Jędrzejewski-Szmek <[email protected]>
    Suggested-by: Tycho Andersen <[email protected]>
    Suggested-by: Al Viro <[email protected]>
    Suggested-by: Linus Torvalds <[email protected]>
    Link: https://github.com/uapi-group/kernel-features#set-comm-field-before-exec [1]
    Reviewed-by: Aleksa Sarai <[email protected]>
    Tested-by: Zbigniew Jędrzejewski-Szmek <[email protected]>
    Signed-off-by: Kees Cook <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
fgraph: Fix set_graph_notrace with setting TRACE_GRAPH_NOTRACE_BIT [+ + +]
Author: Steven Rostedt <[email protected]>
Date:   Sat Feb 8 00:15:11 2025 -0500

    fgraph: Fix set_graph_notrace with setting TRACE_GRAPH_NOTRACE_BIT
    
    commit c8c9b1d2d5b4377c72a979f5a26e842a869aefc9 upstream.
    
    The code was restructured where the function graph notrace code, that
    would not trace a function and all its children is done by setting a
    NOTRACE flag when the function that is not to be traced is hit.
    
    There's a TRACE_GRAPH_NOTRACE_BIT which defines the bit in the flags and a
    TRACE_GRAPH_NOTRACE which is the mask with that bit set. But the
    restructuring used TRACE_GRAPH_NOTRACE_BIT when it should have used
    TRACE_GRAPH_NOTRACE.
    
    For example:
    
     # cd /sys/kernel/tracing
     # echo set_track_prepare stack_trace_save  > set_graph_notrace
     # echo function_graph > current_tracer
     # cat trace
    [..]
     0)               |                          __slab_free() {
     0)               |                            free_to_partial_list() {
     0)               |                                  arch_stack_walk() {
     0)               |                                    __unwind_start() {
     0)   0.501 us    |                                      get_stack_info();
    
    Where a non filter trace looks like:
    
     # echo > set_graph_notrace
     # cat trace
     0)               |                            free_to_partial_list() {
     0)               |                              set_track_prepare() {
     0)               |                                stack_trace_save() {
     0)               |                                  arch_stack_walk() {
     0)               |                                    __unwind_start() {
    
    Where the filter should look like:
    
     # cat trace
     0)               |                            free_to_partial_list() {
     0)               |                              _raw_spin_lock_irqsave() {
     0)   0.350 us    |                                preempt_count_add();
     0)   0.351 us    |                                do_raw_spin_lock();
     0)   2.440 us    |                              }
    
    Cc: [email protected]
    Cc: Masami Hiramatsu <[email protected]>
    Cc: Mark Rutland <[email protected]>
    Cc: Mathieu Desnoyers <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Fixes: b84214890a9bc ("function_graph: Move graph notrace bit to shadow stack global var")
    Signed-off-by: Steven Rostedt (Google) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
firmware: iscsi_ibft: fix ISCSI_IBFT Kconfig entry [+ + +]
Author: Prasad Pandit <[email protected]>
Date:   Mon Mar 11 16:21:22 2024 +0530

    firmware: iscsi_ibft: fix ISCSI_IBFT Kconfig entry
    
    [ Upstream commit e1e17a1715982201034024863efbf238bee2bdf9 ]
    
    Fix ISCSI_IBFT Kconfig entry, replace tab with a space character.
    
    Fixes: 138fe4e0697 ("Firmware: add iSCSI iBFT Support")
    Signed-off-by: Prasad Pandit <[email protected]>
    Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

firmware: qcom: scm: Fix missing read barrier in qcom_scm_get_tzmem_pool() [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Mon Dec 9 15:27:55 2024 +0100

    firmware: qcom: scm: Fix missing read barrier in qcom_scm_get_tzmem_pool()
    
    commit b628510397b5cafa1f5d3e848a28affd1c635302 upstream.
    
    Commit 2e4955167ec5 ("firmware: qcom: scm: Fix __scm and waitq
    completion variable initialization") introduced a write barrier in probe
    function to store global '__scm' variable.  We all known barriers are
    paired (see memory-barriers.txt: "Note that write barriers should
    normally be paired with read or address-dependency barriers"), therefore
    accessing it from concurrent contexts requires read barrier.  Previous
    commit added such barrier in qcom_scm_is_available(), so let's use that
    directly.
    
    Lack of this read barrier can result in fetching stale '__scm' variable
    value, NULL, and dereferencing it.
    
    Note that barrier in qcom_scm_is_available() satisfies here the control
    dependency.
    
    Fixes: ca61d6836e6f ("firmware: qcom: scm: fix a NULL-pointer dereference")
    Fixes: 449d0d84bcd8 ("firmware: qcom: scm: smc: switch to using the SCM allocator")
    Cc: [email protected]
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241209-qcom-scm-missing-barriers-and-all-sort-of-srap-v2-2-9061013c8d92@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

firmware: qcom: scm: Fix missing read barrier in qcom_scm_is_available() [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Mon Dec 9 15:27:54 2024 +0100

    firmware: qcom: scm: Fix missing read barrier in qcom_scm_is_available()
    
    commit 0a744cceebd0480cb39587b3b1339d66a9d14063 upstream.
    
    Commit 2e4955167ec5 ("firmware: qcom: scm: Fix __scm and waitq
    completion variable initialization") introduced a write barrier in probe
    function to store global '__scm' variable.  It also claimed that it
    added a read barrier, because as we all known barriers are paired (see
    memory-barriers.txt: "Note that write barriers should normally be paired
    with read or address-dependency barriers"), however it did not really
    add it.
    
    The offending commit used READ_ONCE() to access '__scm' global which is
    not a barrier.
    
    The barrier is needed so the store to '__scm' will be properly visible.
    This is most likely not fatal in current driver design, because missing
    read barrier would mean qcom_scm_is_available() callers will access old
    value, NULL.  Driver does not support unbinding and does not correctly
    handle probe failures, thus there is no risk of stale or old pointer in
    '__scm' variable.
    
    However for code correctness, readability and to be sure that we did not
    mess up something in this tricky topic of SMP barriers, add a read
    barrier for accessing '__scm'.  Change also comment from useless/obvious
    what does barrier do, to what is expected: which other parts of the code
    are involved here.
    
    Fixes: 2e4955167ec5 ("firmware: qcom: scm: Fix __scm and waitq completion variable initialization")
    Cc: [email protected]
    Reviewed-by: Bartosz Golaszewski <[email protected]>
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/20241209-qcom-scm-missing-barriers-and-all-sort-of-srap-v2-1-9061013c8d92@linaro.org
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
fs/netfs/read_collect: fix crash due to uninitialized `prev` variable [+ + +]
Author: Max Kellermann <[email protected]>
Date:   Fri Feb 14 14:12:25 2025 +0100

    fs/netfs/read_collect: fix crash due to uninitialized `prev` variable
    
    [ Just like the other two netfs patches I sent yesterday, this one
      doesn't apply to v6.14 as it was obsoleted by commit e2d46f2ec332
      ("netfs: Change the read result collector to only use one work item").  ]
    
    When checking whether the edges of adjacent subrequests touch, the
    `prev` variable is deferenced, but it might not have been initialized.
    This causes crashes like this one:
    
     BUG: unable to handle page fault for address: 0000000181343843
     #PF: supervisor read access in kernel mode
     #PF: error_code(0x0000) - not-present page
     PGD 8000001c66db0067 P4D 8000001c66db0067 PUD 0
     Oops: Oops: 0000 [#1] SMP PTI
     CPU: 1 UID: 33333 PID: 24424 Comm: php-cgi8.2 Kdump: loaded Not tainted 6.13.2-cm4all0-hp+ #427
     Hardware name: HP ProLiant DL380 Gen9/ProLiant DL380 Gen9, BIOS P89 11/23/2021
     RIP: 0010:netfs_consume_read_data.isra.0+0x5ef/0xb00
     Code: fe ff ff 48 8b 83 88 00 00 00 48 8b 4c 24 30 4c 8b 43 78 48 85 c0 48 8d 51 70 75 20 48 8b 73 30 48 39 d6 74 17 48 8b 7c 24 40 <48> 8b 4f 78 48 03 4f 68 48 39 4b 68 0f 84 ab 02 00 00 49 29 c0 48
     RSP: 0000:ffffc90037adbd00 EFLAGS: 00010283
     RAX: 0000000000000000 RBX: ffff88811bda0600 RCX: ffff888620e7b980
     RDX: ffff888620e7b9f0 RSI: ffff88811bda0428 RDI: 00000001813437cb
     RBP: 0000000000000000 R08: 0000000000004000 R09: 0000000000000000
     R10: ffffffff82e070c0 R11: 0000000007ffffff R12: 0000000000004000
     R13: ffff888620e7bb68 R14: 0000000000008000 R15: ffff888620e7bb68
     FS:  00007ff2e0e7ddc0(0000) GS:ffff88981f840000(0000) knlGS:0000000000000000
     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: 0000000181343843 CR3: 0000001bc10ba006 CR4: 00000000001706f0
     Call Trace:
      <TASK>
      ? __die+0x1f/0x60
      ? page_fault_oops+0x15c/0x450
      ? search_extable+0x22/0x30
      ? netfs_consume_read_data.isra.0+0x5ef/0xb00
      ? search_module_extables+0xe/0x40
      ? exc_page_fault+0x5e/0x100
      ? asm_exc_page_fault+0x22/0x30
      ? netfs_consume_read_data.isra.0+0x5ef/0xb00
      ? intel_iommu_unmap_pages+0xaa/0x190
      ? __pfx_cachefiles_read_complete+0x10/0x10
      netfs_read_subreq_terminated+0x24f/0x390
      cachefiles_read_complete+0x48/0xf0
      iomap_dio_bio_end_io+0x125/0x160
      blk_update_request+0xea/0x3e0
      scsi_end_request+0x27/0x190
      scsi_io_completion+0x43/0x6c0
      blk_complete_reqs+0x40/0x50
      handle_softirqs+0xd1/0x280
      irq_exit_rcu+0x91/0xb0
      common_interrupt+0x3b/0xa0
      asm_common_interrupt+0x22/0x40
     RIP: 0033:0x55fe8470d2ab
     Code: 00 00 3c 7e 74 3b 3c b6 0f 84 dd 03 00 00 3c 1e 74 2f 83 c1 01 48 83 c2 38 48 83 c7 30 44 39 d1 74 3e 48 63 42 08 85 c0 79 a3 <49> 8b 46 48 8b 04 38 f6 c4 04 75 0b 0f b6 42 30 83 e0 0c 3c 04 75
     RSP: 002b:00007ffca5ef2720 EFLAGS: 00000216
     RAX: 0000000000000023 RBX: 0000000000000008 RCX: 000000000000001b
     RDX: 00007ff2e0cdb6f8 RSI: 0000000000000006 RDI: 0000000000000510
     RBP: 00007ffca5ef27a0 R08: 00007ffca5ef2720 R09: 0000000000000001
     R10: 000000000000001e R11: 00007ff2e0c10d08 R12: 0000000000000001
     R13: 0000000000000120 R14: 00007ff2e0cb1ed0 R15: 00000000000000b0
      </TASK>
    
    Fixes: ee4cdf7ba857 ("netfs: Speed up buffered reading")
    Cc: [email protected]
    Signed-off-by: Max Kellermann <[email protected]>
    Signed-off-by: David Howells <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
fs/netfs/read_pgpriv2: skip folio queues without `marks3` [+ + +]
Author: Max Kellermann <[email protected]>
Date:   Mon Feb 10 23:31:44 2025 +0100

    fs/netfs/read_pgpriv2: skip folio queues without `marks3`
    
    [ Note this patch doesn't apply to v6.14 as it was obsoleted by commit
      e2d46f2ec332 ("netfs: Change the read result collector to only use one
      work item"). ]
    
    At the beginning of the function, folio queues with marks3==0 are
    skipped, but after that, the `marks3` field is ignored.  If one such
    queue is found, `slot` is set to 64 (because `__ffs(0)==64`), leading
    to a buffer overflow in the folioq_folio() call.  The resulting crash
    may look like this:
    
     BUG: kernel NULL pointer dereference, address: 0000000000000000
     #PF: supervisor read access in kernel mode
     #PF: error_code(0x0000) - not-present page
     PGD 0 P4D 0
     Oops: Oops: 0000 [#1] SMP PTI
     CPU: 11 UID: 0 PID: 2909 Comm: kworker/u262:1 Not tainted 6.13.1-cm4all2-vm #415
     Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014
     Workqueue: events_unbound netfs_read_termination_worker
     RIP: 0010:netfs_pgpriv2_write_to_the_cache+0x15a/0x3f0
     Code: 48 85 c0 48 89 44 24 08 0f 84 24 01 00 00 48 8b 80 40 01 00 00 48 8b 7c 24 08 f3 48 0f bc c0 89 44 24 18 89 c0 48 8b 74 c7 08 <48> 8b 06 48 c7 04 24 00 10 00 00 a8 40 74 10 0f b6 4e 40 b8 00 10
     RSP: 0018:ffffbbc440effe18 EFLAGS: 00010203
     RAX: 0000000000000040 RBX: ffff96f8fc034000 RCX: 0000000000000000
     RDX: 0000000000000040 RSI: 0000000000000000 RDI: ffff96f8fc036400
     RBP: 0000000000001000 R08: ffff96f9132bb400 R09: 0000000000001000
     R10: ffff96f8c1263c80 R11: 0000000000000003 R12: 0000000000001000
     R13: ffff96f8fb75ade8 R14: fffffaaf5ca90000 R15: ffff96f8fb75ad00
     FS:  0000000000000000(0000) GS:ffff9703cf0c0000(0000) knlGS:0000000000000000
     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: 0000000000000000 CR3: 000000010c9ca003 CR4: 00000000001706b0
     DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
     DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
     Call Trace:
      <TASK>
      ? __die+0x1f/0x60
      ? page_fault_oops+0x158/0x450
      ? search_extable+0x22/0x30
      ? netfs_pgpriv2_write_to_the_cache+0x15a/0x3f0
      ? search_module_extables+0xe/0x40
      ? exc_page_fault+0x62/0x120
      ? asm_exc_page_fault+0x22/0x30
      ? netfs_pgpriv2_write_to_the_cache+0x15a/0x3f0
      ? netfs_pgpriv2_write_to_the_cache+0xf6/0x3f0
      netfs_read_termination_worker+0x1f/0x60
      process_one_work+0x138/0x2d0
      worker_thread+0x2a5/0x3b0
      ? __pfx_worker_thread+0x10/0x10
      kthread+0xba/0xe0
      ? __pfx_kthread+0x10/0x10
      ret_from_fork+0x30/0x50
      ? __pfx_kthread+0x10/0x10
      ret_from_fork_asm+0x1a/0x30
      </TASK>
    
    Fixes: ee4cdf7ba857 ("netfs: Speed up buffered reading")
    Cc: [email protected]
    Signed-off-by: Max Kellermann <[email protected]>
    Signed-off-by: David Howells <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
fs/proc: do_task_stat: Fix ESP not readable during coredump [+ + +]
Author: Nam Cao <[email protected]>
Date:   Thu Jan 2 09:22:56 2025 +0100

    fs/proc: do_task_stat: Fix ESP not readable during coredump
    
    commit ab251dacfbae28772c897f068a4184f478189ff2 upstream.
    
    The field "eip" (instruction pointer) and "esp" (stack pointer) of a task
    can be read from /proc/PID/stat. These fields can be interesting for
    coredump.
    
    However, these fields were disabled by commit 0a1eb2d474ed ("fs/proc: Stop
    reporting eip and esp in /proc/PID/stat"), because it is generally unsafe
    to do so. But it is safe for a coredumping process, and therefore
    exceptions were made:
    
      - for a coredumping thread by commit fd7d56270b52 ("fs/proc: Report
        eip/esp in /prod/PID/stat for coredumping").
    
      - for all other threads in a coredumping process by commit cb8f381f1613
        ("fs/proc/array.c: allow reporting eip/esp for all coredumping
        threads").
    
    The above two commits check the PF_DUMPCORE flag to determine a coredump thread
    and the PF_EXITING flag for the other threads.
    
    Unfortunately, commit 92307383082d ("coredump:  Don't perform any cleanups
    before dumping core") moved coredump to happen earlier and before PF_EXITING is
    set. Thus, checking PF_EXITING is no longer the correct way to determine
    threads in a coredumping process.
    
    Instead of PF_EXITING, use PF_POSTCOREDUMP to determine the other threads.
    
    Checking of PF_EXITING was added for coredumping, so it probably can now be
    removed. But it doesn't hurt to keep.
    
    Fixes: 92307383082d ("coredump:  Don't perform any cleanups before dumping core")
    Cc: [email protected]
    Cc: Eric W. Biederman <[email protected]>
    Acked-by: Oleg Nesterov <[email protected]>
    Acked-by: Kees Cook <[email protected]>
    Signed-off-by: Nam Cao <[email protected]>
    Link: https://lore.kernel.org/r/d89af63d478d6c64cc46a01420b46fd6eb147d6f.1735805772.git.namcao@linutronix.de
    Signed-off-by: Christian Brauner <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
fs: fix adding security options to statmount.mnt_opt [+ + +]
Author: Miklos Szeredi <[email protected]>
Date:   Wed Jan 29 16:12:53 2025 +0100

    fs: fix adding security options to statmount.mnt_opt
    
    commit 5eb987105357cb7cfa7cf3b1e2f66d5c0977e412 upstream.
    
    Prepending security options was made conditional on sb->s_op->show_options,
    but security options are independent of sb options.
    
    Fixes: 056d33137bf9 ("fs: prepend statmount.mnt_opts string with security_sb_mnt_opts()")
    Fixes: f9af549d1fd3 ("fs: export mount options via statmount()")
    Cc: [email protected] # v6.11
    Signed-off-by: Miklos Szeredi <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Christian Brauner <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

fs: prepend statmount.mnt_opts string with security_sb_mnt_opts() [+ + +]
Author: Jeff Layton <[email protected]>
Date:   Fri Nov 15 10:35:53 2024 -0500

    fs: prepend statmount.mnt_opts string with security_sb_mnt_opts()
    
    commit 056d33137bf9364456ee70aa265ccbb948daee49 upstream.
    
    Currently these mount options aren't accessible via statmount().
    
    The read handler for /proc/#/mountinfo calls security_sb_show_options()
    to emit the security options after emitting superblock flag options, but
    before calling sb->s_op->show_options.
    
    Have statmount_mnt_opts() call security_sb_show_options() before
    calling ->show_options.
    
    Signed-off-by: Jeff Layton <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Christian Brauner <[email protected]>
    Stable-dep-of: 5eb987105357 ("fs: fix adding security options to statmount.mnt_opt")
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
gpio: GPIO_GRGPIO should depend on OF [+ + +]
Author: Geert Uytterhoeven <[email protected]>
Date:   Wed Feb 5 14:05:03 2025 +0100

    gpio: GPIO_GRGPIO should depend on OF
    
    [ Upstream commit 5393f40a640b8c4f716bf87e7b0d4328bf1f22b2 ]
    
    While the Aeroflex Gaisler GRGPIO driver has no build-time dependency on
    gpiolib-of, it supports only DT-based configuration, and is used only on
    DT systems.  Hence add a dependency on OF, to prevent asking the user
    about this driver when configuring a kernel without DT support.
    
    Fixes: bc40668def384256 ("gpio: grgpio: drop Kconfig dependency on OF_GPIO")
    Signed-off-by: Geert Uytterhoeven <[email protected]>
    Reviewed-by: Andreas Larsson <[email protected]>
    Link: https://lore.kernel.org/r/db6da3d11bf850d89f199e5c740d8f133e38078d.1738760539.git.geert+renesas@glider.be
    Signed-off-by: Bartosz Golaszewski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

gpio: pca953x: Improve interrupt support [+ + +]
Author: Mark Tomlinson <[email protected]>
Date:   Thu Jun 6 15:31:02 2024 +1200

    gpio: pca953x: Improve interrupt support
    
    [ Upstream commit d6179f6c6204f9932aed3a7a2100b4a295dfed9d ]
    
    The GPIO drivers with latch interrupt support (typically types starting
    with PCAL) have interrupt status registers to determine which particular
    inputs have caused an interrupt. Unfortunately there is no atomic
    operation to read these registers and clear the interrupt. Clearing the
    interrupt is done by reading the input registers.
    
    The code was reading the interrupt status registers, and then reading
    the input registers. If an input changed between these two events it was
    lost.
    
    The solution in this patch is to revert to the non-latch version of
    code, i.e. remembering the previous input status, and looking for the
    changes. This system results in no more I2C transfers, so is no slower.
    The latch property of the device still means interrupts will still be
    noticed if the input changes back to its initial state.
    
    Fixes: 44896beae605 ("gpio: pca953x: add PCAL9535 interrupt support for Galileo Gen2")
    Signed-off-by: Mark Tomlinson <[email protected]>
    Reviewed-by: Andy Shevchenko <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bartosz Golaszewski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

gpio: sim: lock hog configfs items if present [+ + +]
Author: Bartosz Golaszewski <[email protected]>
Date:   Mon Feb 3 12:01:23 2025 +0100

    gpio: sim: lock hog configfs items if present
    
    [ Upstream commit 015b7dae084fa95465ff89f6cbf15fe49906a370 ]
    
    Depending on the user config, the leaf entry may be the hog directory,
    not line. Check it and lock the correct item.
    
    Fixes: 8bd76b3d3f3a ("gpio: sim: lock up configfs that an instantiated device depends on")
    Tested-by: Koichiro Den <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bartosz Golaszewski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
gpu: drm_dp_cec: fix broken CEC adapter properties check [+ + +]
Author: Hans Verkuil <[email protected]>
Date:   Wed Jan 29 10:51:48 2025 +0100

    gpu: drm_dp_cec: fix broken CEC adapter properties check
    
    [ Upstream commit 6daaae5ff7f3b23a2dacc9c387ff3d4f95b67cad ]
    
    If the hotplug detect of a display is low for longer than one second
    (configurable through drm_dp_cec_unregister_delay), then the CEC adapter
    is unregistered since we assume the display was disconnected. If the
    HPD went low for less than one second, then we check if the properties
    of the CEC adapter have changed, since that indicates that we actually
    switch to new hardware and we have to unregister the old CEC device and
    register a new one.
    
    Unfortunately, the test for changed properties was written poorly, and
    after a new CEC capability was added to the CEC core code the test always
    returned true (i.e. the properties had changed).
    
    As a result the CEC device was unregistered and re-registered for every
    HPD toggle. If the CEC remote controller integration was also enabled
    (CONFIG_MEDIA_CEC_RC was set), then the corresponding input device was
    also unregistered and re-registered. As a result the input device in
    /sys would keep incrementing its number, e.g.:
    
    /sys/devices/pci0000:00/0000:00:08.1/0000:e7:00.0/rc/rc0/input20
    
    Since short HPD toggles are common, the number could over time get into
    the thousands.
    
    While not a serious issue (i.e. nothing crashes), it is not intended
    to work that way.
    
    This patch changes the test so that it only checks for the single CEC
    capability that can actually change, and it ignores any other
    capabilities, so this is now safe as well if new caps are added in
    the future.
    
    With the changed test the bit under #ifndef CONFIG_MEDIA_CEC_RC can be
    dropped as well, so that's a nice cleanup.
    
    Signed-off-by: Hans Verkuil <[email protected]>
    Reported-by: Farblos <[email protected]>
    Reviewed-by: Dmitry Baryshkov <[email protected]>
    Fixes: 2c6d1fffa1d9 ("drm: add support for DisplayPort CEC-Tunneling-over-AUX")
    Tested-by: Farblos <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
HID: hid-asus: Disable OOBE mode on the ProArt P16 [+ + +]
Author: Luke D. Jones <[email protected]>
Date:   Sat Jan 11 14:01:53 2025 +1300

    HID: hid-asus: Disable OOBE mode on the ProArt P16
    
    [ Upstream commit 53078a736fbc60e5d3a1e14f4cd4214003815026 ]
    
    The new ASUS ProArt 16" laptop series come with their keyboards stuck in
    an Out-Of-Box-Experience mode. While in this mode most functions will
    not work such as LED control or Fn key combos. The correct init sequence
    is now done to disable this OOBE.
    
    This patch addresses only the ProArt series so far and it is unknown if
    there may be others, in which case a new quirk may be required.
    
    Signed-off-by: Luke D. Jones <[email protected]>
    Co-developed-by: Connor Belli <[email protected]>
    Signed-off-by: Connor Belli <[email protected]>
    Tested-by: Jan Schmidt <[email protected]>
    Signed-off-by: Jiri Kosina <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

HID: hid-sensor-hub: don't use stale platform-data on remove [+ + +]
Author: Heiko Stuebner <[email protected]>
Date:   Thu Nov 7 12:47:04 2024 +0100

    HID: hid-sensor-hub: don't use stale platform-data on remove
    
    commit 8a5b38c3fd709e8acd2bfdedf66c25e6af759576 upstream.
    
    The hid-sensor-hub creates the individual device structs and transfers them
    to the created mfd platform-devices via the platform_data in the mfd_cell.
    
    Before e651a1da442a ("HID: hid-sensor-hub: Allow parallel synchronous reads")
    the sensor-hub was managing access centrally, with one "completion" in the
    hub's data structure, which needed to be finished on removal at the latest.
    
    The mentioned commit then moved this central management to each hid sensor
    device, resulting on a completion in each struct hid_sensor_hub_device.
    The remove procedure was adapted to go through all sensor devices and
    finish any pending "completion".
    
    What this didn't take into account was, platform_device_add_data() that is
    used by mfd_add{_hotplug}_devices() does a kmemdup on the submitted
    platform-data. So the data the platform-device gets is a copy of the
    original data, meaning that the device worked on a different completion
    than what sensor_hub_remove() currently wants to access.
    
    To fix that, use device_for_each_child() to go through each child-device
    similar to how mfd_remove_devices() unregisters the devices later and
    with that get the live platform_data to finalize the correct completion.
    
    Fixes: e651a1da442a ("HID: hid-sensor-hub: Allow parallel synchronous reads")
    Cc: [email protected]
    Signed-off-by: Heiko Stuebner <[email protected]>
    Acked-by: Benjamin Tissoires <[email protected]>
    Acked-by: Srinivas Pandruvada <[email protected]>
    Acked-by: Jiri Kosina <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

HID: multitouch: Add quirk for Hantick 5288 touchpad [+ + +]
Author: Youwan Wang <[email protected]>
Date:   Mon Dec 16 10:18:01 2024 +0800

    HID: multitouch: Add quirk for Hantick 5288 touchpad
    
    [ Upstream commit b5e65ae557da9fd17b08482ee44ee108ba636182 ]
    
    This device sometimes doesn't send touch release signals when moving
    from >=2 fingers to <2 fingers. Using MT_QUIRK_NOT_SEEN_MEANS_UP instead
    of MT_QUIRK_ALWAYS_VALID makes sure that no touches become stuck.
    
    Signed-off-by: Enze Xie <[email protected]>
    Signed-off-by: Youwan Wang <[email protected]>
    Signed-off-by: Jiri Kosina <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

HID: Wacom: Add PCI Wacom device support [+ + +]
Author: Even Xu <[email protected]>
Date:   Thu Dec 26 09:35:27 2024 +0800

    HID: Wacom: Add PCI Wacom device support
    
    [ Upstream commit c4c123504a65583e3689b3de04a61dc5272e453a ]
    
    Add PCI device ID of wacom device into driver support list.
    
    Signed-off-by: Even Xu <[email protected]>
    Tested-by: Tatsunosuke Tobita <[email protected]>
    Reviewed-by: Ping Cheng <[email protected]>
    Signed-off-by: Jiri Kosina <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
hrtimers: Force migrate away hrtimers queued after CPUHP_AP_HRTIMERS_DYING [+ + +]
Author: Frederic Weisbecker <[email protected]>
Date:   Sat Jan 18 00:24:33 2025 +0100

    hrtimers: Force migrate away hrtimers queued after CPUHP_AP_HRTIMERS_DYING
    
    commit 53dac345395c0d2493cbc2f4c85fe38aef5b63f5 upstream.
    
    hrtimers are migrated away from the dying CPU to any online target at
    the CPUHP_AP_HRTIMERS_DYING stage in order not to delay bandwidth timers
    handling tasks involved in the CPU hotplug forward progress.
    
    However wakeups can still be performed by the outgoing CPU after
    CPUHP_AP_HRTIMERS_DYING. Those can result again in bandwidth timers being
    armed. Depending on several considerations (crystal ball power management
    based election, earliest timer already enqueued, timer migration enabled or
    not), the target may eventually be the current CPU even if offline. If that
    happens, the timer is eventually ignored.
    
    The most notable example is RCU which had to deal with each and every of
    those wake-ups by deferring them to an online CPU, along with related
    workarounds:
    
    _ e787644caf76 (rcu: Defer RCU kthreads wakeup when CPU is dying)
    _ 9139f93209d1 (rcu/nocb: Fix RT throttling hrtimer armed from offline CPU)
    _ f7345ccc62a4 (rcu/nocb: Fix rcuog wake-up from offline softirq)
    
    The problem isn't confined to RCU though as the stop machine kthread
    (which runs CPUHP_AP_HRTIMERS_DYING) reports its completion at the end
    of its work through cpu_stop_signal_done() and performs a wake up that
    eventually arms the deadline server timer:
    
       WARNING: CPU: 94 PID: 588 at kernel/time/hrtimer.c:1086 hrtimer_start_range_ns+0x289/0x2d0
       CPU: 94 UID: 0 PID: 588 Comm: migration/94 Not tainted
       Stopper: multi_cpu_stop+0x0/0x120 <- stop_machine_cpuslocked+0x66/0xc0
       RIP: 0010:hrtimer_start_range_ns+0x289/0x2d0
       Call Trace:
       <TASK>
         start_dl_timer
         enqueue_dl_entity
         dl_server_start
         enqueue_task_fair
         enqueue_task
         ttwu_do_activate
         try_to_wake_up
         complete
         cpu_stopper_thread
    
    Instead of providing yet another bandaid to work around the situation, fix
    it in the hrtimers infrastructure instead: always migrate away a timer to
    an online target whenever it is enqueued from an offline CPU.
    
    This will also allow to revert all the above RCU disgraceful hacks.
    
    Fixes: 5c0930ccaad5 ("hrtimers: Push pending hrtimers away from outgoing CPU earlier")
    Reported-by: Vlad Poenaru <[email protected]>
    Reported-by: Usama Arif <[email protected]>
    Signed-off-by: Frederic Weisbecker <[email protected]>
    Signed-off-by: Paul E. McKenney <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: [email protected]
    Tested-by: Paul E. McKenney <[email protected]>
    Link: https://lore.kernel.org/all/[email protected]
    Closes: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
i2c: Force ELAN06FA touchpad I2C bus freq to 100KHz [+ + +]
Author: Randolph Ha <[email protected]>
Date:   Mon Jan 13 14:52:37 2025 -0500

    i2c: Force ELAN06FA touchpad I2C bus freq to 100KHz
    
    [ Upstream commit bfd74cd1fbc026f04446e67d6915c7e199c2bffd ]
    
    When a 400KHz freq is used on this model of ELAN touchpad in Linux,
    excessive smoothing (similar to when the touchpad's firmware detects
    a noisy signal) is sometimes applied. As some devices' (e.g, Lenovo
    V15 G4) ACPI tables specify a 400KHz frequency for this device and
    some I2C busses (e.g, Designware I2C) default to a 400KHz freq,
    force the speed to 100KHz as a workaround.
    
    For future investigation: This problem may be related to the default
    HCNT/LCNT values given by some busses' drivers, because they are not
    specified in the aforementioned devices' ACPI tables, and because
    the device works without issues on Windows at what is expected to be
    a 400KHz frequency. The root cause of the issue is not known.
    
    Signed-off-by: Randolph Ha <[email protected]>
    Reviewed-by: Mika Westerberg <[email protected]>
    Signed-off-by: Wolfram Sang <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
i3c: master: Fix missing 'ret' assignment in set_speed() [+ + +]
Author: Frank Li <[email protected]>
Date:   Wed Jan 8 17:55:33 2025 -0500

    i3c: master: Fix missing 'ret' assignment in set_speed()
    
    commit b266e0d4dac00eecdfaf50ec3f708fd0c3b39637 upstream.
    
    Fix a probe failure in the i3c master driver that occurs when no i3c
    devices are connected to the bus.
    
    The issue arises in `i3c_master_bus_init()` where the `ret` value is not
    updated after calling `master->ops->set_speed()`. If no devices are
    present, `ret` remains set to `I3C_ERROR_M2`, causing the code to
    incorrectly proceed to `err_bus_cleanup`.
    
    Cc: [email protected]
    Fixes: aef79e189ba2 ("i3c: master: support to adjust first broadcast address speed")
    Signed-off-by: Frank Li <[email protected]>
    Reviewed-by: Wolfram Sang <[email protected]>
    Tested-by: Wolfram Sang <[email protected]>
    Acked-by: Mukesh Kumar Savaliya <[email protected]>
    Reviewed-by: Miquel Raynal <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexandre Belloni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ice: Add check for devm_kzalloc() [+ + +]
Author: Jiasheng Jiang <[email protected]>
Date:   Fri Jan 31 01:38:32 2025 +0000

    ice: Add check for devm_kzalloc()
    
    [ Upstream commit a8aa6a6ddce9b5585f2b74f27f3feea1427fb4e7 ]
    
    Add check for the return value of devm_kzalloc() to guarantee the success
    of allocation.
    
    Fixes: 42c2eb6b1f43 ("ice: Implement devlink-rate API")
    Signed-off-by: Jiasheng Jiang <[email protected]>
    Reviewed-by: Michal Swiatkowski <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ice: gather page_count()'s of each frag right before XDP prog call [+ + +]
Author: Maciej Fijalkowski <[email protected]>
Date:   Thu Jan 23 16:01:17 2025 +0100

    ice: gather page_count()'s of each frag right before XDP prog call
    
    [ Upstream commit 11c4aa074d547d825b19cd8d9f288254d89d805c ]
    
    If we store the pgcnt on few fragments while being in the middle of
    gathering the whole frame and we stumbled upon DD bit not being set, we
    terminate the NAPI Rx processing loop and come back later on. Then on
    next NAPI execution we work on previously stored pgcnt.
    
    Imagine that second half of page was used actively by networking stack
    and by the time we came back, stack is not busy with this page anymore
    and decremented the refcnt. The page reuse algorithm in this case should
    be good to reuse the page but given the old refcnt it will not do so and
    attempt to release the page via page_frag_cache_drain() with
    pagecnt_bias used as an arg. This in turn will result in negative refcnt
    on struct page, which was initially observed by Xu Du.
    
    Therefore, move the page count storage from ice_get_rx_buf() to a place
    where we are sure that whole frame has been collected, but before
    calling XDP program as it internally can also change the page count of
    fragments belonging to xdp_buff.
    
    Fixes: ac0753391195 ("ice: Store page count inside ice_rx_buf")
    Reported-and-tested-by: Xu Du <[email protected]>
    Reviewed-by: Przemek Kitszel <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Co-developed-by: Jacob Keller <[email protected]>
    Signed-off-by: Jacob Keller <[email protected]>
    Signed-off-by: Maciej Fijalkowski <[email protected]>
    Tested-by: Chandan Kumar Rout <[email protected]> (A Contingent Worker at Intel)
    Signed-off-by: Tony Nguyen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ice: put Rx buffers after being done with current frame [+ + +]
Author: Maciej Fijalkowski <[email protected]>
Date:   Thu Jan 23 16:01:16 2025 +0100

    ice: put Rx buffers after being done with current frame
    
    [ Upstream commit 743bbd93cf29f653fae0e1416a31f03231689911 ]
    
    Introduce a new helper ice_put_rx_mbuf() that will go through gathered
    frags from current frame and will call ice_put_rx_buf() on them. Current
    logic that was supposed to simplify and optimize the driver where we go
    through a batch of all buffers processed in current NAPI instance turned
    out to be broken for jumbo frames and very heavy load that was coming
    from both multi-thread iperf and nginx/wrk pair between server and
    client. The delay introduced by approach that we are dropping is simply
    too big and we need to take the decision regarding page
    recycling/releasing as quick as we can.
    
    While at it, address an error path of ice_add_xdp_frag() - we were
    missing buffer putting from day 1 there.
    
    As a nice side effect we get rid of annoying and repetitive three-liner:
    
            xdp->data = NULL;
            rx_ring->first_desc = ntc;
            rx_ring->nr_frags = 0;
    
    by embedding it within introduced routine.
    
    Fixes: 1dc1a7e7f410 ("ice: Centrallize Rx buffer recycling")
    Reported-and-tested-by: Xu Du <[email protected]>
    Reviewed-by: Przemek Kitszel <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Co-developed-by: Jacob Keller <[email protected]>
    Signed-off-by: Jacob Keller <[email protected]>
    Signed-off-by: Maciej Fijalkowski <[email protected]>
    Tested-by: Chandan Kumar Rout <[email protected]> (A Contingent Worker at Intel)
    Signed-off-by: Tony Nguyen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ice: stop storing XDP verdict within ice_rx_buf [+ + +]
Author: Maciej Fijalkowski <[email protected]>
Date:   Thu Jan 23 16:01:18 2025 +0100

    ice: stop storing XDP verdict within ice_rx_buf
    
    [ Upstream commit 468a1952df78f65c5991b7ac885c8b5b7dd87bab ]
    
    Idea behind having ice_rx_buf::act was to simplify and speed up the Rx
    data path by walking through buffers that were representing cleaned HW
    Rx descriptors. Since it caused us a major headache recently and we
    rolled back to old approach that 'puts' Rx buffers right after running
    XDP prog/creating skb, this is useless now and should be removed.
    
    Get rid of ice_rx_buf::act and related logic. We still need to take care
    of a corner case where XDP program releases a particular fragment.
    
    Make ice_run_xdp() to return its result and use it within
    ice_put_rx_mbuf().
    
    Fixes: 2fba7dc5157b ("ice: Add support for XDP multi-buffer on Rx side")
    Reviewed-by: Przemek Kitszel <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Signed-off-by: Maciej Fijalkowski <[email protected]>
    Tested-by: Chandan Kumar Rout <[email protected]> (A Contingent Worker at Intel)
    Signed-off-by: Tony Nguyen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
iio: chemical: bme680: Fix uninitialized variable in __bme680_read_raw() [+ + +]
Author: Dan Carpenter <[email protected]>
Date:   Wed Jan 8 12:37:22 2025 +0300

    iio: chemical: bme680: Fix uninitialized variable in __bme680_read_raw()
    
    commit 20eb1fae4145bc45717aa8a6d05fcd6a64ed856a upstream.
    
    The bme680_read_temp() function takes a pointer to s16 but we're passing
    an int pointer to it.  This will not work on big endian systems and it
    also means that the other 16 bits are uninitialized.
    
    Pass an s16 type variable.
    
    Fixes: f51171ce2236 ("iio: chemical: bme680: Add SCALE and RAW channels")
    Signed-off-by: Dan Carpenter <[email protected]>
    Acked-by: Vasileios Amoiridis <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Cc: <[email protected]>
    Signed-off-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

iio: dac: ad3552r-common: fix ad3541/2r ranges [+ + +]
Author: Angelo Dureghello <[email protected]>
Date:   Wed Jan 8 18:29:15 2025 +0100

    iio: dac: ad3552r-common: fix ad3541/2r ranges
    
    commit 1e758b613212b6964518a67939535910b5aee831 upstream.
    
    Fix ad3541/2r voltage ranges to be as per ad3542r datasheet,
    rev. C, table 38 (page 57).
    
    The wrong ad354xr ranges was generating erroneous Vpp output.
    
    In more details:
    - fix wrong number of ranges, they are 5 ranges, not 6,
    - remove non-existent 0-3V range,
    - adjust order, since ad3552r_find_range() get a wrong index,
      producing a wrong Vpp as output.
    
    Retested all the ranges on real hardware, EVALAD3542RFMCZ:
    
    adi,output-range-microvolt (fdt):
    <(000000) (2500000)>;   ok (Rfbx1, switch 10)
    <(000000) (5000000)>;   ok (Rfbx1, switch 10)
    <(000000) (10000000)>;  ok (Rfbx1, switch 10)
    <(-5000000) (5000000)>; ok (Rfbx2, switch +/- 5)
    <(-2500000) (7500000)>; ok (Rfbx2, switch -2.5/7.5)
    
    Fixes: 8f2b54824b28 ("drivers:iio:dac: Add AD3552R driver support")
    Signed-off-by: Angelo Dureghello <[email protected]>
    Reviewed-by: David Lechner <[email protected]>
    Link: https://patch.msgid.link/20250108-wip-bl-ad3552r-axi-v0-iio-testing-carlos-v2-1-2dac02f04638@baylibre.com
    Cc: <[email protected]>
    Signed-off-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

iio: dac: ad3552r-hs: clear reset status flag [+ + +]
Author: Angelo Dureghello <[email protected]>
Date:   Wed Jan 8 18:29:16 2025 +0100

    iio: dac: ad3552r-hs: clear reset status flag
    
    commit 012b8276f08a67b9f2e2fd0f35363ae4a75e5267 upstream.
    
    Clear reset status flag, to keep error status register
    clean after reset (ad3552r manual, rev B table 38).
    
    Reset error flag was left to 1, so debugging registers, the
    "Error Status Register" was dirty (0x01). It is important
    to clear this bit, so if there is any reset event over normal
    working mode, it is possible to detect it.
    
    Fixes: 0b4d9fe58be8 ("iio: dac: ad3552r: add high-speed platform driver")
    Signed-off-by: Angelo Dureghello <[email protected]>
    Reviewed-by: David Lechner <[email protected]>
    Link: https://patch.msgid.link/20250108-wip-bl-ad3552r-axi-v0-iio-testing-carlos-v2-2-2dac02f04638@baylibre.com
    Cc: <[email protected]>
    Signed-off-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

iio: light: as73211: fix channel handling in only-color triggered buffer [+ + +]
Author: Javier Carrasco <[email protected]>
Date:   Sat Dec 14 23:55:50 2024 +0100

    iio: light: as73211: fix channel handling in only-color triggered buffer
    
    commit ab09c6cfe01b317f515bcd944668697241a54b9d upstream.
    
    The channel index is off by one unit if AS73211_SCAN_MASK_ALL is not
    set (optimized path for color channel readings), and it must be shifted
    instead of leaving an empty channel for the temperature when it is off.
    
    Once the channel index is fixed, the uninitialized channel must be set
    to zero to avoid pushing uninitialized data.
    
    Add available_scan_masks for all channels and only-color channels to let
    the IIO core demux and repack the enabled channels.
    
    Cc: [email protected]
    Fixes: 403e5586b52e ("iio: light: as73211: New driver")
    Tested-by: Christian Eggers <[email protected]>
    Signed-off-by: Javier Carrasco <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
Input: allocate keycode for phone linking [+ + +]
Author: Illia Ostapyshyn <[email protected]>
Date:   Thu Nov 14 18:39:29 2024 +0100

    Input: allocate keycode for phone linking
    
    [ Upstream commit 1bebc7869c99d466f819dd2cffaef0edf7d7a035 ]
    
    The F11 key on the new Lenovo Thinkpad T14 Gen 5, T16 Gen 3, and P14s
    Gen 5 laptops includes a symbol showing a smartphone and a laptop
    chained together.  According to the user manual, it starts the Microsoft
    Phone Link software used to connect to Android/iOS devices and relay
    messages/calls or sync data.
    
    As there are no suitable keycodes for this action, introduce a new one.
    
    Signed-off-by: Illia Ostapyshyn <[email protected]>
    Acked-by: Dmitry Torokhov <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

Input: bbnsm_pwrkey - add remove hook [+ + +]
Author: Peng Fan <[email protected]>
Date:   Thu Dec 12 11:03:22 2024 +0800

    Input: bbnsm_pwrkey - add remove hook
    
    commit 55b75306c3edf369285ce22ba1ced45e335094c2 upstream.
    
    Without remove hook to clear wake irq, there will be kernel dump when
    doing module test.
    "bbnsm_pwrkey 44440000.bbnsm:pwrkey: wake irq already initialized"
    
    Add remove hook to clear wake irq and set wakeup to false.
    
    Signed-off-by: Peng Fan <[email protected]>
    Fixes: 40e40fdfec3f ("Input: bbnsm_pwrkey - add bbnsm power key support")
    Link: https://lore.kernel.org/r/[email protected]
    Cc: [email protected]
    Signed-off-by: Dmitry Torokhov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Input: synaptics - fix crash when enabling pass-through port [+ + +]
Author: Dmitry Torokhov <[email protected]>
Date:   Fri Jan 17 09:23:40 2025 -0800

    Input: synaptics - fix crash when enabling pass-through port
    
    commit 08bd5b7c9a2401faabdaa1472d45c7de0755fd7e upstream.
    
    When enabling a pass-through port an interrupt might come before psmouse
    driver binds to the pass-through port. However synaptics sub-driver
    tries to access psmouse instance presumably associated with the
    pass-through port to figure out if only 1 byte of response or entire
    protocol packet needs to be forwarded to the pass-through port and may
    crash if psmouse instance has not been attached to the port yet.
    
    Fix the crash by introducing open() and close() methods for the port and
    check if the port is open before trying to access psmouse instance.
    Because psmouse calls serio_open() only after attaching psmouse instance
    to serio port instance this prevents the potential crash.
    
    Reported-by: Takashi Iwai <[email protected]>
    Fixes: 100e16959c3c ("Input: libps2 - attach ps2dev instances as serio port's drvdata")
    Link: https://bugzilla.suse.com/show_bug.cgi?id=1219522
    Cc: [email protected]
    Reviewed-by: Takashi Iwai <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Dmitry Torokhov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
io_uring/net: don't retry connect operation on EPOLLERR [+ + +]
Author: Jens Axboe <[email protected]>
Date:   Thu Jan 30 08:40:29 2025 -0700

    io_uring/net: don't retry connect operation on EPOLLERR
    
    commit 8c8492ca64e79c6e0f433e8c9d2bcbd039ef83d0 upstream.
    
    If a socket is shutdown before the connection completes, POLLERR is set
    in the poll mask. However, connect ignores this as it doesn't know, and
    attempts the connection again. This may lead to a bogus -ETIMEDOUT
    result, where it should have noticed the POLLERR and just returned
    -ECONNRESET instead.
    
    Have the poll logic check for whether or not POLLERR is set in the mask,
    and if so, mark the request as failed. Then connect can appropriately
    fail the request rather than retry it.
    
    Reported-by: Sergey Galas <[email protected]>
    Cc: [email protected]
    Link: https://github.com/axboe/liburing/discussions/1335
    Fixes: 3fb1bd688172 ("io_uring/net: handle -EINPROGRESS correct for IORING_OP_CONNECT")
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
io_uring: fix multishots with selected buffers [+ + +]
Author: Pavel Begunkov <[email protected]>
Date:   Tue Jan 28 00:55:24 2025 +0000

    io_uring: fix multishots with selected buffers
    
    commit d63b0e8a628e62ca85a0f7915230186bb92f8bb4 upstream.
    
    We do io_kbuf_recycle() when arming a poll but every iteration of a
    multishot can grab more buffers, which is why we need to flush the kbuf
    ring state before continuing with waiting.
    
    Cc: [email protected]
    Fixes: b3fdea6ecb55c ("io_uring: multishot recv")
    Reported-by: Muhammad Ramdhan <[email protected]>
    Reported-by: Bing-Jhong Billy Jheng <[email protected]>
    Reported-by: Jacob Soo <[email protected]>
    Signed-off-by: Pavel Begunkov <[email protected]>
    Link: https://lore.kernel.org/r/1bfc9990fe435f1fc6152ca9efeba5eb3e68339c.1738025570.git.asml.silence@gmail.com
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
iommu/arm-smmu-qcom: add sdm670 adreno iommu compatible [+ + +]
Author: Richard Acayan <[email protected]>
Date:   Wed Nov 13 19:47:16 2024 -0500

    iommu/arm-smmu-qcom: add sdm670 adreno iommu compatible
    
    [ Upstream commit 42314738906380cbd3b6e9caf3ad34e1b2d66035 ]
    
    Add the compatible for the separate IOMMU on SDM670 for the Adreno GPU.
    
    This IOMMU has the compatible strings:
    
            "qcom,sdm670-smmu-v2", "qcom,adreno-smmu", "qcom,smmu-v2"
    
    While the SMMU 500 doesn't need an entry for this specific SoC, the
    SMMU v2 compatible should have its own entry, as the fallback entry in
    arm-smmu.c handles "qcom,smmu-v2" without per-process page table support
    unless there is an entry here. This entry can't be the
    "qcom,adreno-smmu" compatible because dedicated GPU IOMMUs can also be
    SMMU 500 with different handling.
    
    Signed-off-by: Richard Acayan <[email protected]>
    Reviewed-by: Dmitry Baryshkov <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Will Deacon <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
iommu/arm-smmu-v3: Clean up more on probe failure [+ + +]
Author: Robin Murphy <[email protected]>
Date:   Thu Dec 5 16:33:57 2024 +0000

    iommu/arm-smmu-v3: Clean up more on probe failure
    
    [ Upstream commit fcbd621567420b3a2f21f49bbc056de8b273c625 ]
    
    kmemleak noticed that the iopf queue allocated deep down within
    arm_smmu_init_structures() can be leaked by a subsequent error return
    from arm_smmu_device_probe(). Furthermore, after arm_smmu_device_reset()
    we will also leave the SMMU enabled with an empty Stream Table, silently
    blocking all DMA. This proves rather annoying for debugging said probe
    failure, so let's handle it a bit better by putting the SMMU back into
    (more or less) the same state as if it hadn't probed at all.
    
    Signed-off-by: Robin Murphy <[email protected]>
    Link: https://lore.kernel.org/r/5137901958471cf67f2fad5c2229f8a8f1ae901a.1733406914.git.robin.murphy@arm.com
    Signed-off-by: Will Deacon <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
iommu/tegra241-cmdqv: Read SMMU IDR1.CMDQS instead of hardcoding [+ + +]
Author: Nicolin Chen <[email protected]>
Date:   Wed Dec 18 21:14:21 2024 -0800

    iommu/tegra241-cmdqv: Read SMMU IDR1.CMDQS instead of hardcoding
    
    commit e94dc6ddda8dd3770879a132d577accd2cce25f9 upstream.
    
    The hardware limitation "max=19" actually comes from SMMU Command Queue.
    So, it'd be more natural for tegra241-cmdqv driver to read it out rather
    than hardcoding it itself.
    
    This is not an issue yet for a kernel on a baremetal system, but a guest
    kernel setting the queue base/size in form of IPA/gPA might result in a
    noncontiguous queue in the physical address space, if underlying physical
    pages backing up the guest RAM aren't contiguous entirely: e.g. 2MB-page
    backed guest RAM cannot guarantee a contiguous queue if it is 8MB (capped
    to VCMDQ_LOG2SIZE_MAX=19). This might lead to command errors when HW does
    linear-read from a noncontiguous queue memory.
    
    Adding this extra IDR1.CMDQS cap (in the guest kernel) allows VMM to set
    SMMU's IDR1.CMDQS=17 for the case mentioned above, so a guest-level queue
    will be capped to maximum 2MB, ensuring a contiguous queue memory.
    
    Fixes: a3799717b881 ("iommu/tegra241-cmdqv: Fix alignment failure at max_n_shift")
    Reported-by: Ian Kalinowski <[email protected]>
    Cc: [email protected]
    Signed-off-by: Nicolin Chen <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Will Deacon <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
iommu/vt-d: Avoid use of NULL after WARN_ON_ONCE [+ + +]
Author: Kees Bakker <[email protected]>
Date:   Tue Jan 7 10:17:42 2025 +0800

    iommu/vt-d: Avoid use of NULL after WARN_ON_ONCE
    
    [ Upstream commit 60f030f7418d3f1d94f2fb207fe3080e1844630b ]
    
    There is a WARN_ON_ONCE to catch an unlikely situation when
    domain_remove_dev_pasid can't find the `pasid`. In case it nevertheless
    happens we must avoid using a NULL pointer.
    
    Signed-off-by: Kees Bakker <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Lu Baolu <[email protected]>
    Signed-off-by: Joerg Roedel <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
iommufd/fault: Destroy response and mutex in iommufd_fault_destroy() [+ + +]
Author: Nicolin Chen <[email protected]>
Date:   Tue Jan 14 22:55:59 2025 -0800

    iommufd/fault: Destroy response and mutex in iommufd_fault_destroy()
    
    commit 3f4818ec139030f425476bf8a10b616bab53a7b5 upstream.
    
    Both were missing in the initial patch.
    
    Fixes: 07838f7fd529 ("iommufd: Add iommufd fault object")
    Link: https://patch.msgid.link/r/bc8bb13e215af27e62ee51bdba3648dd4ed2dce3.1736923732.git.nicolinc@nvidia.com
    Cc: [email protected]
    Reviewed-by: Jason Gunthorpe <[email protected]>
    Reviewed-by: Kevin Tian <[email protected]>
    Reviewed-by: Lu Baolu <[email protected]>
    Signed-off-by: Nicolin Chen <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

iommufd/fault: Use a separate spinlock to protect fault->deliver list [+ + +]
Author: Nicolin Chen <[email protected]>
Date:   Fri Jan 17 11:29:01 2025 -0800

    iommufd/fault: Use a separate spinlock to protect fault->deliver list
    
    commit 3d49020a327cd7d069059317c11df24e407ccfa3 upstream.
    
    The fault->mutex serializes the fault read()/write() fops and the
    iommufd_fault_auto_response_faults(), mainly for fault->response. Also, it
    was conveniently used to fence the fault->deliver in poll() fop and
    iommufd_fault_iopf_handler().
    
    However, copy_from/to_user() may sleep if pagefaults are enabled. Thus,
    they could take a long time to wait for user pages to swap in, blocking
    iommufd_fault_iopf_handler() and its caller that is typically a shared IRQ
    handler of an IOMMU driver, resulting in a potential global DOS.
    
    Instead of reusing the mutex to protect the fault->deliver list, add a
    separate spinlock, nested under the mutex, to do the job.
    iommufd_fault_iopf_handler() would no longer be blocked by
    copy_from/to_user().
    
    Add a free_list in iommufd_auto_response_faults(), so the spinlock can
    simply fence a fast list_for_each_entry_safe routine.
    
    Provide two deliver list helpers for iommufd_fault_fops_read() to use:
     - Fetch the first iopf_group out of the fault->deliver list
     - Restore an iopf_group back to the head of the fault->deliver list
    
    Lastly, move the mutex closer to the response in the fault structure,
    and update its kdoc accordingly.
    
    Fixes: 07838f7fd529 ("iommufd: Add iommufd fault object")
    Link: https://patch.msgid.link/r/[email protected]
    Cc: [email protected]
    Suggested-by: Jason Gunthorpe <[email protected]>
    Reviewed-by: Kevin Tian <[email protected]>
    Reviewed-by: Lu Baolu <[email protected]>
    Reviewed-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Nicolin Chen <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
iommufd: Fix struct iommu_hwpt_pgfault init and padding [+ + +]
Author: Nicolin Chen <[email protected]>
Date:   Mon Jan 20 11:50:51 2025 -0800

    iommufd: Fix struct iommu_hwpt_pgfault init and padding
    
    commit e721f619e3ec9bae08bf419c3944cf1e6966c821 upstream.
    
    The iommu_hwpt_pgfault is used to report IO page fault data to userspace,
    but iommufd_fault_fops_read was never zeroing its padding. This leaks the
    content of the kernel stack memory to userspace.
    
    Also, the iommufd uAPI requires explicit padding and use of __aligned_u64
    to ensure ABI compatibility's with 32 bit.
    
    pahole result, before:
    struct iommu_hwpt_pgfault {
            __u32     flags;                /*     0     4 */
            __u32     dev_id;               /*     4     4 */
            __u32     pasid;                /*     8     4 */
            __u32     grpid;                /*    12     4 */
            __u32     perm;                 /*    16     4 */
    
            /* XXX 4 bytes hole, try to pack */
    
            __u64     addr;                 /*    24     8 */
            __u32     length;               /*    32     4 */
            __u32     cookie;               /*    36     4 */
    
            /* size: 40, cachelines: 1, members: 8 */
            /* sum members: 36, holes: 1, sum holes: 4 */
            /* last cacheline: 40 bytes */
    };
    
    pahole result, after:
    struct iommu_hwpt_pgfault {
            __u32      flags;                /*     0     4 */
            __u32      dev_id;               /*     4     4 */
            __u32      pasid;                /*     8     4 */
            __u32      grpid;                /*    12     4 */
            __u32      perm;                 /*    16     4 */
            __u32      __reserved;           /*    20     4 */
            __u64      addr __attribute__((__aligned__(8))); /*    24     8 */
            __u32      length;               /*    32     4 */
            __u32      cookie;               /*    36     4 */
    
            /* size: 40, cachelines: 1, members: 9 */
            /* forced alignments: 1 */
            /* last cacheline: 40 bytes */
    } __attribute__((__aligned__(8)));
    
    Fixes: c714f15860fc ("iommufd: Add fault and response message definitions")
    Link: https://patch.msgid.link/r/[email protected]
    Cc: [email protected]
    Reviewed-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Nicolin Chen <[email protected]>
    Reviewed-by: Kevin Tian <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
irqchip/apple-aic: Only handle PMC interrupt as FIQ when configured so [+ + +]
Author: Nick Chan <[email protected]>
Date:   Sun Jan 19 00:31:42 2025 +0800

    irqchip/apple-aic: Only handle PMC interrupt as FIQ when configured so
    
    commit 698244bbb3bfd32ddf9a0b70a12b1c7d69056497 upstream.
    
    The CPU PMU in Apple SoCs can be configured to fire its interrupt in one of
    several ways, and since Apple A11 one of the methods is FIQ, but the check
    of the configuration register fails to test explicitely for FIQ mode. It
    tests whether the IMODE bitfield is zero or not and the PMCRO_IACT bit is
    set. That results in false positives when the IMODE bitfield is not zero,
    but does not have the mode PMCR0_IMODE_FIQ.
    
    Only handle the PMC interrupt as a FIQ when the CPU PMU has been configured
    to fire FIQs, i.e. the IMODE bitfield value is PMCR0_IMODE_FIQ and
    PMCR0_IACT is set.
    
    Fixes: c7708816c944 ("irqchip/apple-aic: Wire PMU interrupts")
    Signed-off-by: Nick Chan <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/all/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
irqchip/irq-mvebu-icu: Fix access to msi_data from irq_domain::host_data [+ + +]
Author: Stefan Eichenberger <[email protected]>
Date:   Fri Jan 24 09:50:39 2025 +0100

    irqchip/irq-mvebu-icu: Fix access to msi_data from irq_domain::host_data
    
    commit 987f379b54091cc1b1db986bde71cee1081350b3 upstream.
    
    mvebu_icu_translate() incorrectly casts irq_domain::host_data directly to
    mvebu_icu_msi_data. However, host_data actually points to a structure of
    type msi_domain_info.
    
    This incorrect cast causes issues such as the thermal sensors of the
    CP110 platform malfunctioning. Specifically, the translation of the SEI
    interrupt to IRQ_TYPE_EDGE_RISING fails, preventing proper interrupt
    handling. The following error was observed:
    
      genirq: Setting trigger mode 4 for irq 85 failed (irq_chip_set_type_parent+0x0/0x34)
      armada_thermal f2400000.system-controller:thermal-sensor@70: Cannot request threaded IRQ 85
    
    Resolve the issue by first casting host_data to msi_domain_info and then
    accessing mvebu_icu_msi_data through msi_domain_info::chip_data.
    
    Fixes: d929e4db22b6 ("irqchip/irq-mvebu-icu: Prepare for real per device MSI")
    Signed-off-by: Stefan Eichenberger <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/all/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
irqchip/lan966x-oic: Make CONFIG_LAN966X_OIC depend on CONFIG_MCHP_LAN966X_PCI [+ + +]
Author: Geert Uytterhoeven <[email protected]>
Date:   Mon Jan 20 15:35:02 2025 +0100

    irqchip/lan966x-oic: Make CONFIG_LAN966X_OIC depend on CONFIG_MCHP_LAN966X_PCI
    
    [ Upstream commit e06c9e3682f58fbeb632b7b866bb4fe66a4a4b42 ]
    
    The Microchip LAN966x outband interrupt controller is only present on
    Microchip LAN966x SoCs, and only used in PCI endpoint mode.  Hence add a
    dependency on MCHP_LAN966X_PCI, to prevent asking the user about this
    driver when configuring a kernel without Microchip LAN966x PCIe support.
    
    Fixes: 3e3a7b35332924c8 ("irqchip: Add support for LAN966x OIC")
    Signed-off-by: Geert Uytterhoeven <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Acked-by: Herve Codina <[email protected]>
    Link: https://lore.kernel.org/all/28e8a605e72ee45e27f0d06b2b71366159a9c782.1737383314.git.geert+renesas@glider.be
    Signed-off-by: Sasha Levin <[email protected]>
 
jiffies: Cast to unsigned long in secs_to_jiffies() conversion [+ + +]
Author: Easwar Hariharan <[email protected]>
Date:   Thu Jan 30 19:26:58 2025 +0000

    jiffies: Cast to unsigned long in secs_to_jiffies() conversion
    
    commit bb2784d9ab49587ba4fbff37a319fff2924db289 upstream.
    
    While converting users of msecs_to_jiffies(), lkp reported that some range
    checks would always be true because of the mismatch between the implied int
    value of secs_to_jiffies() vs the unsigned long return value of the
    msecs_to_jiffies() calls it was replacing.
    
    Fix this by casting the secs_to_jiffies() input value to unsigned long.
    
    Fixes: b35108a51cf7ba ("jiffies: Define secs_to_jiffies()")
    Reported-by: kernel test robot <[email protected]>
    Signed-off-by: Easwar Hariharan <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/all/[email protected]
    Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
kbuild: Move -Wenum-enum-conversion to W=2 [+ + +]
Author: Nathan Chancellor <[email protected]>
Date:   Thu Oct 17 10:09:22 2024 -0700

    kbuild: Move -Wenum-enum-conversion to W=2
    
    commit 8f6629c004b193d23612641c3607e785819e97ab upstream.
    
    -Wenum-enum-conversion was strengthened in clang-19 to warn for C, which
    caused the kernel to move it to W=1 in commit 75b5ab134bb5 ("kbuild:
    Move -Wenum-{compare-conditional,enum-conversion} into W=1") because
    there were numerous instances that would break builds with -Werror.
    Unfortunately, this is not a full solution, as more and more developers,
    subsystems, and distributors are building with W=1 as well, so they
    continue to see the numerous instances of this warning.
    
    Since the move to W=1, there have not been many new instances that have
    appeared through various build reports and the ones that have appeared
    seem to be following similar existing patterns, suggesting that most
    instances of this warning will not be real issues. The only alternatives
    for silencing this warning are adding casts (which is generally seen as
    an ugly practice) or refactoring the enums to macro defines or a unified
    enum (which may be undesirable because of type safety in other parts of
    the code).
    
    Move the warning to W=2, where warnings that occur frequently but may be
    relevant should reside.
    
    Cc: [email protected]
    Fixes: 75b5ab134bb5 ("kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1")
    Link: https://lore.kernel.org/[email protected]/
    Signed-off-by: Nathan Chancellor <[email protected]>
    Acked-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
KEYS: trusted: dcp: fix improper sg use with CONFIG_VMAP_STACK=y [+ + +]
Author: David Gstir <[email protected]>
Date:   Wed Nov 13 22:27:54 2024 +0100

    KEYS: trusted: dcp: fix improper sg use with CONFIG_VMAP_STACK=y
    
    commit e8d9fab39d1f87b52932646b2f1e7877aa3fc0f4 upstream.
    
    With vmalloc stack addresses enabled (CONFIG_VMAP_STACK=y) DCP trusted
    keys can crash during en- and decryption of the blob encryption key via
    the DCP crypto driver. This is caused by improperly using sg_init_one()
    with vmalloc'd stack buffers (plain_key_blob).
    
    Fix this by always using kmalloc() for buffers we give to the DCP crypto
    driver.
    
    Cc: [email protected] # v6.10+
    Fixes: 0e28bf61a5f9 ("KEYS: trusted: dcp: fix leak of blob encryption key")
    Signed-off-by: David Gstir <[email protected]>
    Reviewed-by: Jarkko Sakkinen <[email protected]>
    Signed-off-by: Jarkko Sakkinen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
kfence: skip __GFP_THISNODE allocations on NUMA systems [+ + +]
Author: Marco Elver <[email protected]>
Date:   Fri Jan 24 13:01:38 2025 +0100

    kfence: skip __GFP_THISNODE allocations on NUMA systems
    
    commit e64f81946adf68cd75e2207dd9a51668348a4af8 upstream.
    
    On NUMA systems, __GFP_THISNODE indicates that an allocation _must_ be on
    a particular node, and failure to allocate on the desired node will result
    in a failed allocation.
    
    Skip __GFP_THISNODE allocations if we are running on a NUMA system, since
    KFENCE can't guarantee which node its pool pages are allocated on.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 236e9f153852 ("kfence: skip all GFP_ZONEMASK allocations")
    Signed-off-by: Marco Elver <[email protected]>
    Reported-by: Vlastimil Babka <[email protected]>
    Acked-by: Vlastimil Babka <[email protected]>
    Cc: Christoph Lameter <[email protected]>
    Cc: Alexander Potapenko <[email protected]>
    Cc: Chistoph Lameter <[email protected]>
    Cc: Dmitriy Vyukov <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ksmbd: fix integer overflows on 32 bit systems [+ + +]
Author: Dan Carpenter <[email protected]>
Date:   Wed Jan 15 09:28:35 2025 +0900

    ksmbd: fix integer overflows on 32 bit systems
    
    commit aab98e2dbd648510f8f51b83fbf4721206ccae45 upstream.
    
    On 32bit systems the addition operations in ipc_msg_alloc() can
    potentially overflow leading to memory corruption.
    Add bounds checking using KSMBD_IPC_MAX_PAYLOAD to avoid overflow.
    
    Fixes: 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
    Cc: [email protected]
    Signed-off-by: Dan Carpenter <[email protected]>
    Signed-off-by: Namjae Jeon <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
KVM: arm64: timer: Always evaluate the need for a soft timer [+ + +]
Author: Marc Zyngier <[email protected]>
Date:   Tue Feb 4 11:00:48 2025 +0000

    KVM: arm64: timer: Always evaluate the need for a soft timer
    
    commit b450dcce93bc2cf6d2bfaf5a0de88a94ebad8f89 upstream.
    
    When updating the interrupt state for an emulated timer, we return
    early and skip the setup of a soft timer that runs in parallel
    with the guest.
    
    While this is OK if we have set the interrupt pending, it is pretty
    wrong if the guest moved CVAL into the future.  In that case,
    no timer is armed and the guest can wait for a very long time
    (it will take a full put/load cycle for the situation to resolve).
    
    This is specially visible with EDK2 running at EL2, but still
    using the EL1 virtual timer, which in that case is fully emulated.
    Any key-press takes ages to be captured, as there is no UART
    interrupt and EDK2 relies on polling from a timer...
    
    The fix is simply to drop the early return. If the timer interrupt
    is pending, we will still return early, and otherwise arm the soft
    timer.
    
    Fixes: 4d74ecfa6458b ("KVM: arm64: Don't arm a hrtimer for an already pending timer")
    Cc: [email protected]
    Tested-by: Dmytro Terletskyi <[email protected]>
    Reviewed-by: Oliver Upton <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Marc Zyngier <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
kvm: defer huge page recovery vhost task to later [+ + +]
Author: Keith Busch <[email protected]>
Date:   Thu Jan 23 07:35:43 2025 -0800

    kvm: defer huge page recovery vhost task to later
    
    commit 931656b9e2ff7029aee0b36e17780621948a6ac1 upstream.
    
    Some libraries want to ensure they are single threaded before forking,
    so making the kernel's kvm huge page recovery process a vhost task of
    the user process breaks those. The minijail library used by crosvm is
    one such affected application.
    
    Defer the task to after the first VM_RUN call, which occurs after the
    parent process has forked all its jailed processes. This needs to happen
    only once for the kvm instance, so introduce some general-purpose
    infrastructure for that, too.  It's similar in concept to pthread_once;
    except it is actually usable, because the callback takes a parameter.
    
    Cc: Sean Christopherson <[email protected]>
    Cc: Paolo Bonzini <[email protected]>
    Tested-by: Alyssa Ross <[email protected]>
    Signed-off-by: Keith Busch <[email protected]>
    Message-ID: <[email protected]>
    [Move call_once API to include/linux. - Paolo]
    Cc: [email protected]
    Fixes: d96c77bd4eeb ("KVM: x86: switch hugepage recovery thread to vhost_task")
    Signed-off-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
KVM: Explicitly verify target vCPU is online in kvm_get_vcpu() [+ + +]
Author: Sean Christopherson <[email protected]>
Date:   Wed Oct 9 08:04:50 2024 -0700

    KVM: Explicitly verify target vCPU is online in kvm_get_vcpu()
    
    commit 1e7381f3617d14b3c11da80ff5f8a93ab14cfc46 upstream.
    
    Explicitly verify the target vCPU is fully online _prior_ to clamping the
    index in kvm_get_vcpu().  If the index is "bad", the nospec clamping will
    generate '0', i.e. KVM will return vCPU0 instead of NULL.
    
    In practice, the bug is unlikely to cause problems, as it will only come
    into play if userspace or the guest is buggy or misbehaving, e.g. KVM may
    send interrupts to vCPU0 instead of dropping them on the floor.
    
    However, returning vCPU0 when it shouldn't exist per online_vcpus is
    problematic now that KVM uses an xarray for the vCPUs array, as KVM needs
    to insert into the xarray before publishing the vCPU to userspace (see
    commit c5b077549136 ("KVM: Convert the kvm->vcpus array to a xarray")),
    i.e. before vCPU creation is guaranteed to succeed.
    
    As a result, incorrectly providing access to vCPU0 will trigger a
    use-after-free if vCPU0 is dereferenced and kvm_vm_ioctl_create_vcpu()
    bails out of vCPU creation due to an error and frees vCPU0.  Commit
    afb2acb2e3a3 ("KVM: Fix vcpu_array[0] races") papered over that issue, but
    in doing so introduced an unsolvable teardown conundrum.  Preventing
    accesses to vCPU0 before it's fully online will allow reverting commit
    afb2acb2e3a3, without re-introducing the vcpu_array[0] UAF race.
    
    Fixes: 1d487e9bf8ba ("KVM: fix spectrev1 gadgets")
    Cc: [email protected]
    Cc: Will Deacon <[email protected]>
    Cc: Michal Luczaj <[email protected]>
    Reviewed-by: Pankaj Gupta <[email protected]>
    Acked-by: Will Deacon <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: nVMX: Defer SVI update to vmcs01 on EOI when L2 is active w/o VID [+ + +]
Author: Chao Gao <[email protected]>
Date:   Wed Nov 27 16:00:10 2024 -0800

    KVM: nVMX: Defer SVI update to vmcs01 on EOI when L2 is active w/o VID
    
    commit 04bc93cf49d16d01753b95ddb5d4f230b809a991 upstream.
    
    If KVM emulates an EOI for L1's virtual APIC while L2 is active, defer
    updating GUEST_INTERUPT_STATUS.SVI, i.e. the VMCS's cache of the highest
    in-service IRQ, until L1 is active, as vmcs01, not vmcs02, needs to track
    vISR.  The missed SVI update for vmcs01 can result in L1 interrupts being
    incorrectly blocked, e.g. if there is a pending interrupt with lower
    priority than the interrupt that was EOI'd.
    
    This bug only affects use cases where L1's vAPIC is effectively passed
    through to L2, e.g. in a pKVM scenario where L2 is L1's depriveleged host,
    as KVM will only emulate an EOI for L1's vAPIC if Virtual Interrupt
    Delivery (VID) is disabled in vmc12, and L1 isn't intercepting L2 accesses
    to its (virtual) APIC page (or if x2APIC is enabled, the EOI MSR).
    
    WARN() if KVM updates L1's ISR while L2 is active with VID enabled, as an
    EOI from L2 is supposed to affect L2's vAPIC, but still defer the update,
    to try to keep L1 alive.  Specifically, KVM forwards all APICv-related
    VM-Exits to L1 via nested_vmx_l1_wants_exit():
    
            case EXIT_REASON_APIC_ACCESS:
            case EXIT_REASON_APIC_WRITE:
            case EXIT_REASON_EOI_INDUCED:
                    /*
                     * The controls for "virtualize APIC accesses," "APIC-
                     * register virtualization," and "virtual-interrupt
                     * delivery" only come from vmcs12.
                     */
                    return true;
    
    Fixes: c7c9c56ca26f ("x86, apicv: add virtual interrupt delivery support")
    Cc: [email protected]
    Link: https://lore.kernel.org/kvm/[email protected]
    Reported-by: Markku Ahvenjärvi <[email protected]>
    Closes: https://lore.kernel.org/all/[email protected]
    Cc: Janne Karhunen <[email protected]>
    Signed-off-by: Chao Gao <[email protected]>
    [sean: drop request, handle in VMX, write changelog]
    Tested-by: Chao Gao <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: s390: vsie: fix some corner-cases when grabbing vsie pages [+ + +]
Author: David Hildenbrand <[email protected]>
Date:   Tue Jan 7 16:43:41 2025 +0100

    KVM: s390: vsie: fix some corner-cases when grabbing vsie pages
    
    commit 5f230f41fdd9e799f43a699348dc572bca7159aa upstream.
    
    We try to reuse the same vsie page when re-executing the vsie with a
    given SCB address. The result is that we use the same shadow SCB --
    residing in the vsie page -- and can avoid flushing the TLB when
    re-running the vsie on a CPU.
    
    So, when we allocate a fresh vsie page, or when we reuse a vsie page for
    a different SCB address -- reusing the shadow SCB in different context --
    we set ihcpu=0xffff to trigger the flush.
    
    However, after we looked up the SCB address in the radix tree, but before
    we grabbed the vsie page by raising the refcount to 2, someone could reuse
    the vsie page for a different SCB address, adjusting page->index and the
    radix tree. In that case, we would be reusing the vsie page with a
    wrong page->index.
    
    Another corner case is that we might set the SCB address for a vsie
    page, but fail the insertion into the radix tree. Whoever would reuse
    that page would remove the corresponding radix tree entry -- which might
    now be a valid entry pointing at another page, resulting in the wrong
    vsie page getting removed from the radix tree.
    
    Let's handle such races better, by validating that the SCB address of a
    vsie page didn't change after we grabbed it (not reuse for a different
    SCB; the alternative would be performing another tree lookup), and by
    setting the SCB address to invalid until the insertion in the tree
    succeeded (SCB addresses are aligned to 512, so ULONG_MAX is invalid).
    
    These scenarios are rare, the effects a bit unclear, and these issues were
    only found by code inspection. Let's CC stable to be safe.
    
    Fixes: a3508fbe9dc6 ("KVM: s390: vsie: initial support for nested virtualization")
    Cc: [email protected]
    Signed-off-by: David Hildenbrand <[email protected]>
    Reviewed-by: Claudio Imbrenda <[email protected]>
    Reviewed-by: Christoph Schlameuss <[email protected]>
    Tested-by: Christoph Schlameuss <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Claudio Imbrenda <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: x86/mmu: Ensure NX huge page recovery thread is alive before waking [+ + +]
Author: Sean Christopherson <[email protected]>
Date:   Fri Jan 24 15:46:23 2025 -0800

    KVM: x86/mmu: Ensure NX huge page recovery thread is alive before waking
    
    commit 43fb96ae78551d7bfa4ecca956b258f085d67c40 upstream.
    
    When waking a VM's NX huge page recovery thread, ensure the thread is
    actually alive before trying to wake it.  Now that the thread is spawned
    on-demand during KVM_RUN, a VM without a recovery thread is reachable via
    the related module params.
    
      BUG: kernel NULL pointer dereference, address: 0000000000000040
      #PF: supervisor read access in kernel mode
      #PF: error_code(0x0000) - not-present page
      Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
      RIP: 0010:vhost_task_wake+0x5/0x10
      Call Trace:
       <TASK>
       set_nx_huge_pages+0xcc/0x1e0 [kvm]
       param_attr_store+0x8a/0xd0
       module_attr_store+0x1a/0x30
       kernfs_fop_write_iter+0x12f/0x1e0
       vfs_write+0x233/0x3e0
       ksys_write+0x60/0xd0
       do_syscall_64+0x5b/0x160
       entry_SYSCALL_64_after_hwframe+0x4b/0x53
      RIP: 0033:0x7f3b52710104
       </TASK>
      Modules linked in: kvm_intel kvm
      CR2: 0000000000000040
    
    Fixes: 931656b9e2ff ("kvm: defer huge page recovery vhost task to later")
    Cc: [email protected]
    Cc: Keith Busch <[email protected]>
    Signed-off-by: Sean Christopherson <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
leds: lp8860: Write full EEPROM, not only half of it [+ + +]
Author: Alexander Sverdlin <[email protected]>
Date:   Thu Nov 14 11:13:59 2024 +0100

    leds: lp8860: Write full EEPROM, not only half of it
    
    commit 0d2e820a86793595e2a776855d04701109e46663 upstream.
    
    I struggle to explain dividing an ARRAY_SIZE() by the size of an element
    once again. As the latter equals to 2, only the half of EEPROM was ever
    written. Drop the unexplainable division and write full ARRAY_SIZE().
    
    Cc: [email protected]
    Fixes: 7a8685accb95 ("leds: lp8860: Introduce TI lp8860 4 channel LED driver")
    Signed-off-by: Alexander Sverdlin <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
Linux: Linux 6.13.3 [+ + +]
Author: Greg Kroah-Hartman <[email protected]>
Date:   Mon Feb 17 11:36:59 2025 +0100

    Linux 6.13.3
    
    Link: https://lore.kernel.org/r/[email protected]
    Tested-by: Ronald Warsow <[email protected]>
    Tested-by: Pavel Machek (CIP) <[email protected]>
    Tested-by: Florian Fainelli <[email protected]>
    Tested-by: Takeshi Ogasawara <[email protected]>
    Tested-by: Salvatore Bonaccorso <[email protected]>
    Tested-by: Justin M. Forbes <[email protected]>
    Tested-by: Mark Brown <[email protected]>
    Tested-by: Hardik Garg <[email protected]>
    Tested-by: Peter Schneider <[email protected]>
    Tested-by: Ron Economos <[email protected]>
    Tested-by: Luna Jernberg <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Tested-by: Ronald Warsow <[email protected]>
    Tested-by: Slade Watkins <[email protected]>
    Tested-by: Hardik Garg <[email protected]>
    Tested-by: Takeshi Ogasawara <[email protected]>
    Tested-by: Mark Brown <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Tested-by: Takeshi Ogasawara <[email protected]>
    Tested-by: Ronald Warsow <[email protected]>
    Tested-by: Jon Hunter <[email protected]>
    Tested-by: Slade Watkins <[email protected]>
    Tested-by: Peter Schneider <[email protected]>
    Tested-by: Pavel Machek (CIP) <[email protected]>
    Tested-by: Kexy Biscuit <[email protected]>
    Tested-by: Mark Brown <[email protected]>
    Tested-by: Miguel Ojeda <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
lockdep: Fix upper limit for LOCKDEP_*_BITS configs [+ + +]
Author: Carlos Llamas <[email protected]>
Date:   Thu Oct 24 18:36:26 2024 +0000

    lockdep: Fix upper limit for LOCKDEP_*_BITS configs
    
    [ Upstream commit e638072e61726cae363d48812815197a2a0e097f ]
    
    Lockdep has a set of configs used to determine the size of the static
    arrays that it uses. However, the upper limit that was initially setup
    for these configs is too high (30 bit shift). This equates to several
    GiB of static memory for individual symbols. Using such high values
    leads to linker errors:
    
      $ make defconfig
      $ ./scripts/config -e PROVE_LOCKING --set-val LOCKDEP_BITS 30
      $ make olddefconfig all
      [...]
      ld: kernel image bigger than KERNEL_IMAGE_SIZE
      ld: section .bss VMA wraps around address space
    
    Adjust the upper limits to the maximum values that avoid these issues.
    The need for anything more, likely points to a problem elsewhere. Note
    that LOCKDEP_CHAINS_BITS was intentionally left out as its upper limit
    had a different symptom and has already been fixed [1].
    
    Reported-by: J. R. Okajima <[email protected]>
    Closes: https://lore.kernel.org/all/30795.1620913191@jrobl/ [1]
    Cc: Peter Zijlstra <[email protected]>
    Cc: Boqun Feng <[email protected]>
    Cc: Ingo Molnar <[email protected]>
    Cc: Waiman Long <[email protected]>
    Cc: Will Deacon <[email protected]>
    Acked-by: Waiman Long <[email protected]>
    Signed-off-by: Carlos Llamas <[email protected]>
    Signed-off-by: Boqun Feng <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
locking/ww_mutex/test: Use swap() macro [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Wed Jul 31 15:58:51 2024 +0200

    locking/ww_mutex/test: Use swap() macro
    
    [ Upstream commit 0d3547df6934b8f9600630322799a2a76b4567d8 ]
    
    Fixes the following Coccinelle/coccicheck warning reported by
    swap.cocci:
    
      WARNING opportunity for swap()
    
    Compile-tested only.
    
    [Boqun: Add the report tags from Jiapeng and Abaci Robot [1].]
    
    Reported-by: Abaci Robot <[email protected]>
    Reported-by: Jiapeng Chong <[email protected]>
    Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=11531
    Link: https://lore.kernel.org/r/[email protected] [1]
    Acked-by: Waiman Long <[email protected]>
    Signed-off-by: Thorsten Blum <[email protected]>
    Signed-off-by: Boqun Feng <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
LoongArch: Extend the maximum number of watchpoints [+ + +]
Author: Tiezhu Yang <[email protected]>
Date:   Sun Jan 26 21:49:59 2025 +0800

    LoongArch: Extend the maximum number of watchpoints
    
    commit 531936dee53e471a3ec668de3c94ca357f54b7e8 upstream.
    
    The maximum number of load/store watchpoints and fetch instruction
    watchpoints is 14 each according to LoongArch Reference Manual, so
    extend the maximum number of watchpoints from 8 to 14 for ptrace.
    
    By the way, just simply change 8 to 14 for the definition in struct
    user_watch_state at the beginning, but it may corrupt uapi, then add
    a new struct user_watch_state_v2 directly.
    
    As far as I can tell, the only users for this struct in the userspace
    are GDB and LLDB, there are no any problems of software compatibility
    between the application and kernel according to the analysis.
    
    The compatibility problem has been considered while developing and
    testing. When the applications in the userspace get watchpoint state,
    the length will be specified which is no bigger than the sizeof struct
    user_watch_state or user_watch_state_v2, the actual length is assigned
    as the minimal value of the application and kernel in the generic code
    of ptrace:
    
    kernel/ptrace.c: ptrace_regset():
    
            kiov->iov_len = min(kiov->iov_len,
                               (__kernel_size_t) (regset->n * regset->size));
    
            if (req == PTRACE_GETREGSET)
                    return copy_regset_to_user(task, view, regset_no, 0,
                                              kiov->iov_len, kiov->iov_base);
            else
                    return copy_regset_from_user(task, view, regset_no, 0,
                                              kiov->iov_len, kiov->iov_base);
    
    For example, there are four kind of combinations, all of them work well.
    
    (1) "older kernel + older gdb", the actual length is 8+(8+8+4+4)*8=200;
    (2) "newer kernel + newer gdb", the actual length is 8+(8+8+4+4)*14=344;
    (3) "older kernel + newer gdb", the actual length is 8+(8+8+4+4)*8=200;
    (4) "newer kernel + older gdb", the actual length is 8+(8+8+4+4)*8=200.
    
    Link: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#control-and-status-registers-related-to-watchpoints
    Cc: [email protected]
    Fixes: 1a69f7a161a7 ("LoongArch: ptrace: Expose hardware breakpoints to debuggers")
    Reviewed-by: WANG Xuerui <[email protected]>
    Reviewed-by: Xi Ruoyao <[email protected]>
    Signed-off-by: Tiezhu Yang <[email protected]>
    Signed-off-by: Huacai Chen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
m68k: vga: Fix I/O defines [+ + +]
Author: Thomas Zimmermann <[email protected]>
Date:   Tue Jan 7 10:58:56 2025 +0100

    m68k: vga: Fix I/O defines
    
    commit 53036937a101b5faeaf98e7438555fa854a1a844 upstream.
    
    Including m68k's <asm/raw_io.h> in vga.h on nommu platforms results
    in conflicting defines with io_no.h for various I/O macros from the
    __raw_read and __raw_write families. An example error is
    
       In file included from arch/m68k/include/asm/vga.h:12,
                     from include/video/vga.h:22,
                     from include/linux/vgaarb.h:34,
                     from drivers/video/aperture.c:12:
    >> arch/m68k/include/asm/raw_io.h:39: warning: "__raw_readb" redefined
          39 | #define __raw_readb in_8
             |
       In file included from arch/m68k/include/asm/io.h:6,
                        from include/linux/io.h:13,
                        from include/linux/irq.h:20,
                        from include/asm-generic/hardirq.h:17,
                        from ./arch/m68k/include/generated/asm/hardirq.h:1,
                        from include/linux/hardirq.h:11,
                        from include/linux/interrupt.h:11,
                        from include/linux/trace_recursion.h:5,
                        from include/linux/ftrace.h:10,
                        from include/linux/kprobes.h:28,
                        from include/linux/kgdb.h:19,
                        from include/linux/fb.h:6,
                        from drivers/video/aperture.c:5:
       arch/m68k/include/asm/io_no.h:16: note: this is the location of the previous definition
          16 | #define __raw_readb(addr) \
             |
    
    Include <asm/io.h>, which avoids raw_io.h on nommu platforms.
    Also change the defined values of some of the read/write symbols in
    vga.h to __raw_read/__raw_write as the raw_in/raw_out symbols are not
    generally available.
    
    Signed-off-by: Thomas Zimmermann <[email protected]>
    Reported-by: kernel test robot <[email protected]>
    Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
    Fixes: 5c3f968712ce ("m68k/video: Create <asm/vga.h>")
    Cc: Geert Uytterhoeven <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Cc: Helge Deller <[email protected]>
    Cc: [email protected] # v3.5+
    Reviewed-by: Geert Uytterhoeven <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Geert Uytterhoeven <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mailbox: tegra-hsp: Clear mailbox before using message [+ + +]
Author: Pekka Pessi <[email protected]>
Date:   Mon Dec 2 15:35:59 2024 +0530

    mailbox: tegra-hsp: Clear mailbox before using message
    
    commit 0b7f8328f988178b55ee11d772a6e1238c04d29d upstream.
    
    The Tegra RCE (Camera) driver expects the mailbox to be empty before
    processing the IVC messages. On RT kernel, the threads processing the
    IVC messages (which are invoked after `mbox_chan_received_data()` is
    called) may be on a different CPU or running with a higher priority
    than the HSP interrupt handler thread. This can cause it to act on the
    message before the mailbox gets cleared in the HSP interrupt handler
    resulting in a loss of IVC notification.
    
    Fix this by clearing the mailbox data register before calling
    `mbox_chan_received_data()`.
    
    Fixes: 8f585d14030d ("mailbox: tegra-hsp: Add tegra_hsp_sm_ops")
    Fixes: 74c20dd0f892 ("mailbox: tegra-hsp: Add 128-bit shared mailbox support")
    Cc: [email protected]
    Signed-off-by: Pekka Pessi <[email protected]>
    Signed-off-by: Kartik Rajput <[email protected]>
    Acked-by: Thierry Reding <[email protected]>
    Signed-off-by: Jassi Brar <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mailbox: zynqmp: Remove invalid __percpu annotation in zynqmp_ipi_probe() [+ + +]
Author: Uros Bizjak <[email protected]>
Date:   Sat Dec 14 10:12:59 2024 +0100

    mailbox: zynqmp: Remove invalid __percpu annotation in zynqmp_ipi_probe()
    
    commit 170a264d2611a0bfa96b7818730473db5e7546fc upstream.
    
    struct zynqmp_ipi_pdata __percpu *pdata is not a per-cpu variable,
    so it should not be annotated with __percpu annotation.
    
    Remove invalid __percpu annotation to fix several
    
    zynqmp-ipi-mailbox.c:920:15: warning: incorrect type in assignment (different address spaces)
    zynqmp-ipi-mailbox.c:920:15:    expected struct zynqmp_ipi_pdata [noderef] __percpu *pdata
    zynqmp-ipi-mailbox.c:920:15:    got void *
    zynqmp-ipi-mailbox.c:927:56: warning: incorrect type in argument 3 (different address spaces)
    zynqmp-ipi-mailbox.c:927:56:    expected unsigned int [usertype] *out_value
    zynqmp-ipi-mailbox.c:927:56:    got unsigned int [noderef] __percpu *
    ...
    
    and several
    
    drivers/mailbox/zynqmp-ipi-mailbox.c:924:9: warning: dereference of noderef expression
    ...
    
    sparse warnings.
    
    There were no changes in the resulting object file.
    
    Cc: [email protected]
    Fixes: 6ffb1635341b ("mailbox: zynqmp: handle SGI for shared IPI")
    Signed-off-by: Uros Bizjak <[email protected]>
    Reviewed-by: Michal Simek <[email protected]>
    Reviewed-by: Tanmay Shah <[email protected]>
    Signed-off-by: Jassi Brar <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
maple_tree: simplify split calculation [+ + +]
Author: Wei Yang <[email protected]>
Date:   Wed Nov 13 03:16:14 2024 +0000

    maple_tree: simplify split calculation
    
    commit 4f6a6bed0bfef4b966f076f33eb4f5547226056a upstream.
    
    Patch series "simplify split calculation", v3.
    
    
    This patch (of 3):
    
    The current calculation for splitting nodes tries to enforce a minimum
    span on the leaf nodes.  This code is complex and never worked correctly
    to begin with, due to the min value being passed as 0 for all leaves.
    
    The calculation should just split the data as equally as possible
    between the new nodes.  Note that b_end will be one more than the data,
    so the left side is still favoured in the calculation.
    
    The current code may also lead to a deficient node by not leaving enough
    data for the right side of the split. This issue is also addressed with
    the split calculation change.
    
    [[email protected]: rephrase the change log]
    Link: https://lkml.kernel.org/r/[email protected]
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 54a611b60590 ("Maple Tree: add new data structure")
    Signed-off-by: Wei Yang <[email protected]>
    Reviewed-by: Liam R. Howlett <[email protected]>
    Cc: Sidhartha Kumar <[email protected]>
    Cc: Lorenzo Stoakes <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
md/md-linear: Fix a NULL vs IS_ERR() bug in linear_add() [+ + +]
Author: Dan Carpenter <[email protected]>
Date:   Wed Jan 15 09:53:52 2025 +0300

    md/md-linear: Fix a NULL vs IS_ERR() bug in linear_add()
    
    commit 62c552070a980363d55a6082b432ebd1cade7a6e upstream.
    
    The linear_conf() returns error pointers, it doesn't return NULL.  Update
    the error checking to match.
    
    Fixes: 127186cfb184 ("md: reintroduce md-linear")
    Signed-off-by: Dan Carpenter <[email protected]>
    Reviewed-by: Yu Kuai <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Song Liu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
md: Fix linear_set_limits() [+ + +]
Author: Bart Van Assche <[email protected]>
Date:   Wed Jan 29 14:56:35 2025 -0800

    md: Fix linear_set_limits()
    
    commit a572593ac80e51eb69ecede7e614289fcccdbf8d upstream.
    
    queue_limits_cancel_update() must only be called if
    queue_limits_start_update() is called first. Remove the
    queue_limits_cancel_update() call from linear_set_limits() because
    there is no corresponding queue_limits_start_update() call.
    
    This bug was discovered by annotating all mutex operations with clang
    thread-safety attributes and by building the kernel with clang and
    -Wthread-safety.
    
    Cc: Yu Kuai <[email protected]>
    Cc: Coly Li <[email protected]>
    Cc: Mike Snitzer <[email protected]>
    Cc: Christoph Hellwig <[email protected]>
    Fixes: 127186cfb184 ("md: reintroduce md-linear")
    Signed-off-by: Bart Van Assche <[email protected]>
    Reviewed-by: Christoph Hellwig <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Song Liu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

md: reintroduce md-linear [+ + +]
Author: Yu Kuai <[email protected]>
Date:   Thu Jan 2 19:28:41 2025 +0800

    md: reintroduce md-linear
    
    commit 127186cfb184eaccdfe948e6da66940cfa03efc5 upstream.
    
    THe md-linear is removed by commit 849d18e27be9 ("md: Remove deprecated
    CONFIG_MD_LINEAR") because it has been marked as deprecated for a long
    time.
    
    However, md-linear is used widely for underlying disks with different size,
    sadly we didn't know this until now, and it's true useful to create
    partitions and assemble multiple raid and then append one to the other.
    
    People have to use dm-linear in this case now, however, they will prefer
    to minimize the number of involved modules.
    
    Fixes: 849d18e27be9 ("md: Remove deprecated CONFIG_MD_LINEAR")
    Cc: [email protected]
    Signed-off-by: Yu Kuai <[email protected]>
    Acked-by: Coly Li <[email protected]>
    Acked-by: Mike Snitzer <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Song Liu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
media: ccs: Clean up parsed CCS static data on parse failure [+ + +]
Author: Sakari Ailus <[email protected]>
Date:   Tue Dec 3 12:23:01 2024 +0200

    media: ccs: Clean up parsed CCS static data on parse failure
    
    commit da73efa8e675a2b58f1c7ae61201acfe57714bf7 upstream.
    
    ccs_data_parse() releases the allocated in-memory data structure when the
    parser fails, but it does not clean up parsed metadata that is there to
    help access the actual data. Do that, in order to return the data
    structure in a sane state.
    
    Fixes: a6b396f410b1 ("media: ccs: Add CCS static data parser library")
    Cc: [email protected]
    Signed-off-by: Sakari Ailus <[email protected]>
    Reviewed-by: Mehdi Djait <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: ccs: Fix CCS static data parsing for large block sizes [+ + +]
Author: Sakari Ailus <[email protected]>
Date:   Tue Dec 3 10:10:23 2024 +0200

    media: ccs: Fix CCS static data parsing for large block sizes
    
    commit 82b696750f0b60e7513082a10ad42786854f59f8 upstream.
    
    The length field of the CCS static data blocks was mishandled, leading to
    wrong interpretation of the length header for blocks that are 16 kiB in
    size. Such large blocks are very, very rare and so this wasn't found
    earlier.
    
    As the length is used as part of input validation, the issue has no
    security implications.
    
    Fixes: a6b396f410b1 ("media: ccs: Add CCS static data parser library")
    Cc: [email protected]
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: ccs: Fix cleanup order in ccs_probe() [+ + +]
Author: Mehdi Djait <[email protected]>
Date:   Wed Dec 11 14:30:45 2024 +0100

    media: ccs: Fix cleanup order in ccs_probe()
    
    commit 6fdbff0f54786e94f0f630ff200ec1d666b1633e upstream.
    
    ccs_limits is allocated in ccs_read_all_limits() after the allocation of
    mdata.backing. Ensure that resources are freed in the reverse order of
    their allocation by moving out_free_ccs_limits up.
    
    Fixes: a11d3d6891f0 ("media: ccs: Read CCS static data from firmware binaries")
    Cc: [email protected]
    Signed-off-by: Mehdi Djait <[email protected]>
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: Documentation: tx-rx: Fix formatting [+ + +]
Author: Sakari Ailus <[email protected]>
Date:   Mon Dec 16 16:13:16 2024 +0200

    media: Documentation: tx-rx: Fix formatting
    
    commit b76fb1f2c5a39e8e1b785e94a08448847fe4c626 upstream.
    
    Fix formatting under "``.enable_streams()`` and ``.disable_streams()``
    callbacks" in tx-rx.rst.
    
    Fixes: 30fe661eb9d3 ("media: Documentation: Deprecate s_stream video op, update docs")
    Cc: [email protected]
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: i2c: ds90ub960: Fix logging SP & EQ status only for UB9702 [+ + +]
Author: Tomi Valkeinen <[email protected]>
Date:   Fri Dec 6 10:26:40 2024 +0200

    media: i2c: ds90ub960: Fix logging SP & EQ status only for UB9702
    
    commit 42d0ec194aa12e9b97f09a94fe565ba2e5f631a2 upstream.
    
    UB9702 does not have SP and EQ registers, but the driver uses them in
    log_status(). Fix this by separating the SP and EQ related log_status()
    work into a separate function (for clarity) and calling that function
    only for UB960.
    
    Cc: [email protected]
    Fixes: afe267f2d368 ("media: i2c: add DS90UB960 driver")
    Reviewed-by: Jai Luthra <[email protected]>
    Signed-off-by: Tomi Valkeinen <[email protected]>
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: i2c: ds90ub960: Fix UB9702 refclk register access [+ + +]
Author: Tomi Valkeinen <[email protected]>
Date:   Fri Dec 6 10:26:38 2024 +0200

    media: i2c: ds90ub960: Fix UB9702 refclk register access
    
    commit ba3bdb93947c90f098061de1fb2458e2ca040093 upstream.
    
    UB9702 has the refclk freq register at a different offset than UB960,
    but the code uses the UB960's offset for both chips. Fix this.
    
    The refclk freq is only used for a debug print, so there's no functional
    change here.
    
    Cc: [email protected]
    Fixes: afe267f2d368 ("media: i2c: add DS90UB960 driver")
    Reviewed-by: Jai Luthra <[email protected]>
    Signed-off-by: Tomi Valkeinen <[email protected]>
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: i2c: ds90ub960: Fix UB9702 VC map [+ + +]
Author: Tomi Valkeinen <[email protected]>
Date:   Fri Dec 6 10:26:41 2024 +0200

    media: i2c: ds90ub960: Fix UB9702 VC map
    
    commit 5dbbd0609b83f6eb72c005e2e5979d0cd25243c8 upstream.
    
    The driver uses a static CSI-2 virtual channel mapping where all virtual
    channels from an RX port are mapped to a virtual channel number matching
    the RX port number.
    
    The UB960 and UB9702 have different registers for the purpose, and the
    UB9702 version is not correct. Each of the VC_ID_MAP registers do not
    contain a single mapping, as the driver currently thinks, but two.
    
    This can cause received VCs other than 0 to be mapped in a wrong way.
    
    Fix this by writing both mappings to each register.
    
    Cc: [email protected]
    Fixes: afe267f2d368 ("media: i2c: add DS90UB960 driver")
    Reviewed-by: Jai Luthra <[email protected]>
    Signed-off-by: Tomi Valkeinen <[email protected]>
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: i2c: ds90ub960: Fix use of non-existing registers on UB9702 [+ + +]
Author: Tomi Valkeinen <[email protected]>
Date:   Fri Dec 6 10:26:39 2024 +0200

    media: i2c: ds90ub960: Fix use of non-existing registers on UB9702
    
    commit 698cf6df87ffa83f259703e7443c15a4c5ceae86 upstream.
    
    UB9702 doesn't have the registers for SP and EQ. Adjust the code in
    ub960_rxport_wait_locks() to not use those registers for UB9702. As
    these values are only used for a debug print here, there's no functional
    change.
    
    Cc: [email protected]
    Fixes: afe267f2d368 ("media: i2c: add DS90UB960 driver")
    Reviewed-by: Jai Luthra <[email protected]>
    Signed-off-by: Tomi Valkeinen <[email protected]>
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: i2c: ds90ub9x3: Fix extra fwnode_handle_put() [+ + +]
Author: Tomi Valkeinen <[email protected]>
Date:   Fri Dec 6 10:26:37 2024 +0200

    media: i2c: ds90ub9x3: Fix extra fwnode_handle_put()
    
    commit 60b45ece41c5632a3a3274115a401cb244180646 upstream.
    
    The ub913 and ub953 drivers call fwnode_handle_put(priv->sd.fwnode) as
    part of their remove process, and if the driver is removed multiple
    times, eventually leads to put "overflow", possibly causing memory
    corruption or crash.
    
    The fwnode_handle_put() is a leftover from commit 905f88ccebb1 ("media:
    i2c: ds90ub9x3: Fix sub-device matching"), which changed the code
    related to the sd.fwnode, but missed removing these fwnode_handle_put()
    calls.
    
    Cc: [email protected]
    Fixes: 905f88ccebb1 ("media: i2c: ds90ub9x3: Fix sub-device matching")
    Reviewed-by: Jai Luthra <[email protected]>
    Signed-off-by: Tomi Valkeinen <[email protected]>
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: imx296: Add standby delay during probe [+ + +]
Author: Naushir Patuck <[email protected]>
Date:   Fri Nov 15 20:07:17 2024 +0200

    media: imx296: Add standby delay during probe
    
    commit 57d10bcac67707caaa542e09dee86e13ea85defc upstream.
    
    Add a 2-5ms delay when coming out of standby and before reading the
    sensor info register durning probe, as instructed by the datasheet. This
    standby delay is already present when the sensor starts streaming.
    
    During a cold-boot, reading the IMX296_SENSOR_INFO register would often
    return a value of 0x0000, if this delay is not present before.
    
    Fixes: cb33db2b6ccf ("media: i2c: IMX296 camera sensor driver")
    Cc: [email protected]
    Tested-by: Alexandru Ardelean <[email protected]>
    Signed-off-by: Naushir Patuck <[email protected]>
    Reviewed-by: Kieran Bingham <[email protected]>
    Reviewed-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: intel/ipu6: remove cpu latency qos request on error [+ + +]
Author: Stanislaw Gruszka <[email protected]>
Date:   Wed Dec 11 12:49:05 2024 +0100

    media: intel/ipu6: remove cpu latency qos request on error
    
    commit facb541ff0805314e0b56e508f7d3cbd07af513c upstream.
    
    Fix cpu latency qos list corruption like below. It happens when
    we do not remove cpu latency request on error path and free
    corresponding memory.
    
    [   30.634378] l7 kernel: list_add corruption. prev->next should be next (ffffffff9645e960), but was 0000000100100001. (prev=ffff8e9e877e20a8).
    [   30.634388] l7 kernel: WARNING: CPU: 2 PID: 2008 at lib/list_debug.c:32 __list_add_valid_or_report+0x83/0xa0
    <snip>
    [   30.634640] l7 kernel: Call Trace:
    [   30.634650] l7 kernel:  <TASK>
    [   30.634659] l7 kernel:  ? __list_add_valid_or_report+0x83/0xa0
    [   30.634669] l7 kernel:  ? __warn.cold+0x93/0xf6
    [   30.634678] l7 kernel:  ? __list_add_valid_or_report+0x83/0xa0
    [   30.634690] l7 kernel:  ? report_bug+0xff/0x140
    [   30.634702] l7 kernel:  ? handle_bug+0x58/0x90
    [   30.634712] l7 kernel:  ? exc_invalid_op+0x17/0x70
    [   30.634723] l7 kernel:  ? asm_exc_invalid_op+0x1a/0x20
    [   30.634733] l7 kernel:  ? __list_add_valid_or_report+0x83/0xa0
    [   30.634742] l7 kernel:  plist_add+0xdd/0x140
    [   30.634754] l7 kernel:  pm_qos_update_target+0xa0/0x1f0
    [   30.634764] l7 kernel:  cpu_latency_qos_update_request+0x61/0xc0
    [   30.634773] l7 kernel:  intel_dp_aux_xfer+0x4c7/0x6e0 [i915 1f824655ed04687c2b0d23dbce759fa785f6d033]
    
    Reported-by: Genes Lists <[email protected]>
    Closes: https://lore.kernel.org/linux-media/[email protected]/
    Fixes: f50c4ca0a820 ("media: intel/ipu6: add the main input system driver")
    Cc: [email protected]
    Signed-off-by: Stanislaw Gruszka <[email protected]>
    Reviewed-by: Hans de Goede <[email protected]>
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: mc: fix endpoint iteration [+ + +]
Author: Cosmin Tanislav <[email protected]>
Date:   Fri Nov 22 16:55:24 2024 +0200

    media: mc: fix endpoint iteration
    
    commit fb2bd86270cd0ad004f4c614ba4f8c63a5720e25 upstream.
    
    When creating links from a subdev to a sink, the current logic tries to
    iterate over the endpoints of dev's fwnode.
    
    This might not be correct when the subdev uses a different fwnode
    compared to the dev's fwnode.
    
    If, when registering, the subdev's fwnode is not set, the code inside
    v4l2_async_register_subdev will set it to the dev's fwnode.
    
    To fix this, just use the subdev's fwnode.
    
    Signed-off-by: Cosmin Tanislav <[email protected]>
    Fixes: 0d3c81e82da9 ("media: v4l2-mc: add v4l2_create_fwnode_links helpers")
    Cc: [email protected]
    Reviewed-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: mmp: Bring back registration of the device [+ + +]
Author: Lubomir Rintel <[email protected]>
Date:   Tue Dec 31 20:04:34 2024 +0100

    media: mmp: Bring back registration of the device
    
    commit fbb5298bf1a7b71723cd2bb193642429ceb0fb84 upstream.
    
    In commit 4af65141e38e ("media: marvell: cafe: Register V4L2 device
    earlier"), a call to v4l2_device_register() was moved away from
    mccic_register() into its caller, marvell/cafe's cafe_pci_probe().
    This is not the only caller though -- there's also marvell/mmp.
    
    Add v4l2_device_register() into mmpcam_probe() to unbreak the MMP camera
    driver, in a fashion analogous to what's been done to the Cafe driver.
    Same for the teardown path.
    
    Fixes: 4af65141e38e ("media: marvell: cafe: Register V4L2 device earlier")
    Signed-off-by: Lubomir Rintel <[email protected]>
    Cc: [email protected] # v6.6+
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: nuvoton: Fix an error check in npcm_video_ece_init() [+ + +]
Author: Zhen Lei <[email protected]>
Date:   Tue Oct 15 09:40:53 2024 +0800

    media: nuvoton: Fix an error check in npcm_video_ece_init()
    
    commit c4b7779abc6633677e6edb79e2809f4f61fde157 upstream.
    
    When function of_find_device_by_node() fails, it returns NULL instead of
    an error code. So the corresponding error check logic should be modified
    to check whether the return value is NULL and set the error code to be
    returned as -ENODEV.
    
    Fixes: 46c15a4ff1f4 ("media: nuvoton: Add driver for NPCM video capture and encoding engine")
    Cc: [email protected]
    Signed-off-by: Zhen Lei <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: ov5640: fix get_light_freq on auto [+ + +]
Author: Sam Bobrowicz <[email protected]>
Date:   Fri Nov 22 09:28:01 2024 +0100

    media: ov5640: fix get_light_freq on auto
    
    commit 001d3753538d26ddcbef011f5643cfff58a7f672 upstream.
    
    Light frequency was not properly returned when in auto
    mode and the detected frequency was 60Hz.
    
    Fixes: 19a81c1426c1 ("[media] add Omnivision OV5640 sensor driver")
    Cc: [email protected]
    Signed-off-by: Sam Bobrowicz <[email protected]>
    Signed-off-by: Michal Simek <[email protected]>
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: stm32: dcmipp: correct dma_set_mask_and_coherent mask value [+ + +]
Author: Alain Volmat <[email protected]>
Date:   Thu Dec 12 10:17:25 2024 +0100

    media: stm32: dcmipp: correct dma_set_mask_and_coherent mask value
    
    commit b36077ba289b827b4e76e25e8d8e0cc90fa09186 upstream.
    
    Correct the call to dma_set_mask_and_coherent which should be set
    to DMA_BIT_MASK(32).
    
    Fixes: 28e0f3772296 ("media: stm32-dcmipp: STM32 DCMIPP camera interface driver")
    Cc: [email protected]
    Signed-off-by: Alain Volmat <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: uvcvideo: Fix crash during unbind if gpio unit is in use [+ + +]
Author: Ricardo Ribalda <[email protected]>
Date:   Wed Nov 6 20:36:07 2024 +0000

    media: uvcvideo: Fix crash during unbind if gpio unit is in use
    
    commit a9ea1a3d88b7947ce8cadb2afceee7a54872bbc5 upstream.
    
    We used the wrong device for the device managed functions. We used the
    usb device, when we should be using the interface device.
    
    If we unbind the driver from the usb interface, the cleanup functions
    are never called. In our case, the IRQ is never disabled.
    
    If an IRQ is triggered, it will try to access memory sections that are
    already free, causing an OOPS.
    
    We cannot use the function devm_request_threaded_irq here. The devm_*
    clean functions may be called after the main structure is released by
    uvc_delete.
    
    Luckily this bug has small impact, as it is only affected by devices
    with gpio units and the user has to unbind the device, a disconnect will
    not trigger this error.
    
    Cc: [email protected]
    Fixes: 2886477ff987 ("media: uvcvideo: Implement UVC_EXT_GPIO_UNIT")
    Reviewed-by: Sergey Senozhatsky <[email protected]>
    Signed-off-by: Ricardo Ribalda <[email protected]>
    Reviewed-by: Laurent Pinchart <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: uvcvideo: Fix event flags in uvc_ctrl_send_events [+ + +]
Author: Ricardo Ribalda <[email protected]>
Date:   Thu Nov 14 19:10:30 2024 +0000

    media: uvcvideo: Fix event flags in uvc_ctrl_send_events
    
    commit c31cffd5ae2c3d7ef21d9008977a9d117ce7a64e upstream.
    
    If there is an event that needs the V4L2_EVENT_CTRL_CH_FLAGS flag, all
    the following events will have that flag, regardless if they need it or
    not.
    
    This is because we keep using the same variable all the time and we do
    not reset its original value.
    
    Cc: [email protected]
    Fixes: 805e9b4a06bf ("[media] uvcvideo: Send control change events for slave ctrls when the master changes")
    Signed-off-by: Ricardo Ribalda <[email protected]>
    Reviewed-by: Laurent Pinchart <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: uvcvideo: Only save async fh if success [+ + +]
Author: Ricardo Ribalda <[email protected]>
Date:   Tue Dec 3 21:20:08 2024 +0000

    media: uvcvideo: Only save async fh if success
    
    commit d9fecd096f67a4469536e040a8a10bbfb665918b upstream.
    
    Now we keep a reference to the active fh for any call to uvc_ctrl_set,
    regardless if it is an actual set or if it is a just a try or if the
    device refused the operation.
    
    We should only keep the file handle if the device actually accepted
    applying the operation.
    
    Cc: [email protected]
    Fixes: e5225c820c05 ("media: uvcvideo: Send a control event when a Control Change interrupt arrives")
    Suggested-by: Hans de Goede <[email protected]>
    Reviewed-by: Hans de Goede <[email protected]>
    Reviewed-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Ricardo Ribalda <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: uvcvideo: Remove dangling pointers [+ + +]
Author: Ricardo Ribalda <[email protected]>
Date:   Tue Dec 3 21:20:10 2024 +0000

    media: uvcvideo: Remove dangling pointers
    
    commit 221cd51efe4565501a3dbf04cc011b537dcce7fb upstream.
    
    When an async control is written, we copy a pointer to the file handle
    that started the operation. That pointer will be used when the device is
    done. Which could be anytime in the future.
    
    If the user closes that file descriptor, its structure will be freed,
    and there will be one dangling pointer per pending async control, that
    the driver will try to use.
    
    Clean all the dangling pointers during release().
    
    To avoid adding a performance penalty in the most common case (no async
    operation), a counter has been introduced with some logic to make sure
    that it is properly handled.
    
    Cc: [email protected]
    Fixes: e5225c820c05 ("media: uvcvideo: Send a control event when a Control Change interrupt arrives")
    Reviewed-by: Hans de Goede <[email protected]>
    Signed-off-by: Ricardo Ribalda <[email protected]>
    Reviewed-by: Laurent Pinchart <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: uvcvideo: Remove redundant NULL assignment [+ + +]
Author: Ricardo Ribalda <[email protected]>
Date:   Tue Dec 3 21:20:09 2024 +0000

    media: uvcvideo: Remove redundant NULL assignment
    
    commit 04d3398f66d2d31c4b8caea88f051a4257b7a161 upstream.
    
    ctrl->handle will only be different than NULL for controls that have
    mappings. This is because that assignment is only done inside
    uvc_ctrl_set() for mapped controls.
    
    Cc: [email protected]
    Fixes: e5225c820c05 ("media: uvcvideo: Send a control event when a Control Change interrupt arrives")
    Reviewed-by: Laurent Pinchart <[email protected]>
    Reviewed-by: Hans de Goede <[email protected]>
    Signed-off-by: Ricardo Ribalda <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: uvcvideo: Support partial control reads [+ + +]
Author: Ricardo Ribalda <[email protected]>
Date:   Thu Nov 28 20:53:41 2024 +0000

    media: uvcvideo: Support partial control reads
    
    commit f00ee2ca8da25ebccb8e19956d853c9055e2c8d0 upstream.
    
    Some cameras, like the ELMO MX-P3, do not return all the bytes
    requested from a control if it can fit in less bytes.
    Eg: Returning 0xab instead of 0x00ab.
    usb 3-9: Failed to query (GET_DEF) UVC control 3 on unit 2: 1 (exp. 2).
    
    Extend the returned value from the camera and return it.
    
    Cc: [email protected]
    Fixes: a763b9fb58be ("media: uvcvideo: Do not return positive errors in uvc_query_ctrl()")
    Reviewed-by: Hans de Goede <[email protected]>
    Signed-off-by: Ricardo Ribalda <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Hans de Goede <[email protected]>
    Reviewed-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: venus: destroy hfi session after m2m_ctx release [+ + +]
Author: Sergey Senozhatsky <[email protected]>
Date:   Tue Dec 24 16:24:05 2024 +0900

    media: venus: destroy hfi session after m2m_ctx release
    
    commit df4ff47448fe0d392b29868e8398e3b0e587514d upstream.
    
    This partially reverts commit that made hfi_session_destroy()
    the first step of vdec/venc close().  The reason being is a
    regression report when, supposedly, encode/decoder is closed
    with still active streaming (no ->stop_streaming() call before
    close()) and pending pkts, so isr_thread cannot find instance
    and fails to process those pending pkts.  This was the idea
    behind the original patch - make it impossible to use instance
    under destruction, because this is racy, but apparently there
    are uses cases that depend on that unsafe pattern.  Return to
    the old (unsafe) behaviour for the time being (until a better
    fix is found).
    
    Fixes: 45b1a1b348ec ("media: venus: sync with threaded IRQ during inst destruction")
    Cc: [email protected]
    Reported-by: Nathan Hebert <[email protected]>
    Signed-off-by: Sergey Senozhatsky <[email protected]>
    Signed-off-by: Stanimir Varbanov <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mfd: lpc_ich: Add another Gemini Lake ISA bridge PCI device-id [+ + +]
Author: Hans de Goede <[email protected]>
Date:   Thu Nov 14 20:38:08 2024 +0100

    mfd: lpc_ich: Add another Gemini Lake ISA bridge PCI device-id
    
    [ Upstream commit 1e89d21f8189d286f80b900e1b7cf57cb1f3037e ]
    
    On N4100 / N4120 Gemini Lake SoCs the ISA bridge PCI device-id is 31e8
    rather the 3197 found on e.g. the N4000 / N4020.
    
    While at fix the existing GLK PCI-id table entry breaking the table
    being sorted by device-id.
    
    Signed-off-by: Hans de Goede <[email protected]>
    Reviewed-by: Andy Shevchenko <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
mips/math-emu: fix emulation of the prefx instruction [+ + +]
Author: Mateusz Jończyk <[email protected]>
Date:   Sun Jan 5 22:18:06 2025 +0100

    mips/math-emu: fix emulation of the prefx instruction
    
    commit 42a39e4aa59a10aa4afdc14194f3ee63d2db94e1 upstream.
    
    Currently, installation of Debian 12.8 for mipsel fails on machines
    without an FPU [1]. This is caused by the fact that zstd (which is used
    for initramfs compression) executes the prefx instruction, which is not
    emulated properly by the kernel.
    
    The prefx (Prefetch Indexed) instruction fetches data from memory into
    the cache without any side effects. Though functionally unrelated, it
    requires an FPU [2].
    
    Bytecode format of this instruction ends on "001111" binary:
    
            (prefx instruction format) & 0x0000003f = 0x0000000f
    
    The code in fpux_emu() runs like so:
    
            #define MIPSInst(x) x
            #define MIPSInst_FMA_FFMT(x) (MIPSInst(x) & 0x00000007)
            #define MIPSInst_FUNC(x) (MIPSInst(x) & 0x0000003f)
            enum cop1x_func { ..., pfetch_op = 0x0f, ... };
    
            ...
    
            switch (MIPSInst_FMA_FFMT(ir)) {
            ...
    
            case 0x3:
                    if (MIPSInst_FUNC(ir) != pfetch_op)
                            return SIGILL;
    
                    /* ignore prefx operation */
                    break;
    
            default:
                    return SIGILL;
            }
    
    That snippet above contains a logic error and the
            if (MIPSInst_FUNC(ir) != pfetch_op)
    comparison always fires.
    
    When MIPSInst_FUNC(ir) is equal to pfetch_op, ir must end on 001111
    binary. In this case, MIPSInst_FMA_FFMT(ir) must be equal to 0x7, which
    does not match that case label.
    
    This causes emulation failure for the prefx instruction. Fix it.
    
    This has been broken by
    commit 919af8b96c89 ("MIPS: Make definitions of MIPSInst_FMA_{FUNC,FMTM} consistent with MIPS64 manual")
    which modified the MIPSInst_FMA_FFMT macro without updating the users.
    
    Signed-off-by: Mateusz Jończyk <[email protected]>
    Cc: [email protected] # after 3 weeks
    Cc: Dengcheng Zhu <[email protected]>
    Cc: Thomas Bogendoerfer <[email protected]>
    Cc: Ming Wang <[email protected]>
    Cc: Tiezhu Yang <[email protected]>
    Fixes: 919af8b96c89 ("MIPS: Make definitions of MIPSInst_FMA_{FUNC,FMTM} consistent with MIPS64 manual")
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    
    [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1091858
    [2] MIPS Architecture For Programmers Volume II-A: The MIPS32 Instruction Set
    
    Signed-off-by: Thomas Bogendoerfer <[email protected]>

 
MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static [+ + +]
Author: WangYuli <[email protected]>
Date:   Sat Jan 4 22:47:08 2025 +0800

    MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static
    
    commit ddd068d81445b17ac0bed084dfeb9e58b4df3ddd upstream.
    
    Declare ftrace_get_parent_ra_addr() as static to suppress clang
    compiler warning that 'no previous prototype'. This function is
    not intended to be called from other parts.
    
    Fix follow error with clang-19:
    
    arch/mips/kernel/ftrace.c:251:15: error: no previous prototype for function 'ftrace_get_parent_ra_addr' [-Werror,-Wmissing-prototypes]
      251 | unsigned long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long
          |               ^
    arch/mips/kernel/ftrace.c:251:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
      251 | unsigned long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long
          | ^
          | static
    1 error generated.
    
    Signed-off-by: WangYuli <[email protected]>
    Acked-by: Masami Hiramatsu (Google) <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Signed-off-by: Thomas Bogendoerfer <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

MIPS: Loongson64: remove ROM Size unit in boardinfo [+ + +]
Author: Kexy Biscuit <[email protected]>
Date:   Sat Jan 11 01:22:08 2025 +0800

    MIPS: Loongson64: remove ROM Size unit in boardinfo
    
    commit bd2212d658d7659b9d83c7e2f3a06789d4db1e90 upstream.
    
    Per Appendix A.7 in Q/LS 0013-2014 (龙芯CPU开发系统固件与内核接口规范 V2.2,
    lit. Loongson DevSys Firmware Kernel Interface Specification V2.2),
    interface_info.size is size of this interface, not size of the LEFI BIOS
    ROM.
    
    In any case, the BIOS ROM Size just cannot be several kilobytes (KB) on
    Loongson64 LEFI platforms.
    
    Reported-by: Mingcong Bai <[email protected]>
    Suggested-by: Icenowy Zheng <[email protected]>
    Fixes: 6c1bfbd9df8c ("MIPS: Loongson64: Add /sys/firmware/lefi/boardinfo")
    Cc: [email protected]
    Signed-off-by: Kexy Biscuit <[email protected]>
    Acked-by: Jiaxun Yang <[email protected]>
    Signed-off-by: Thomas Bogendoerfer <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

MIPS: pci-legacy: Override pci_address_to_pio [+ + +]
Author: Jiaxun Yang <[email protected]>
Date:   Tue Jan 14 18:11:58 2025 +0000

    MIPS: pci-legacy: Override pci_address_to_pio
    
    commit df1b8d6e89db0edd572a1e375f5d3dd5575b9a9b upstream.
    
    pci-legacy systems are not using logic_pio to managed PIO
    allocations, thus the generic pci_address_to_pio won't work
    when PCI_IOBASE is defined.
    
    Override the function to use architecture implementation to
    fix the problem.
    
    Cc: [email protected]
    Fixes: 4bfb53e7d317 ("mips: add <asm-generic/io.h> including")
    Reported-by: Mateusz Jończyk <[email protected]>
    Closes: https://lore.kernel.org/r/[email protected]/
    Signed-off-by: Jiaxun Yang <[email protected]>
    Signed-off-by: Thomas Bogendoerfer <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
misc: fastrpc: Deregister device nodes properly in error scenarios [+ + +]
Author: Anandu Krishnan E <[email protected]>
Date:   Fri Jan 10 13:42:37 2025 +0000

    misc: fastrpc: Deregister device nodes properly in error scenarios
    
    commit 637c20002dc8c347001292664055bfbf56544ec6 upstream.
    
    During fastrpc_rpmsg_probe, if secure device node registration
    succeeds but non-secure device node registration fails, the secure
    device node deregister is not called during error cleanup. Add proper
    exit paths to ensure proper cleanup in case of error.
    
    Fixes: 3abe3ab3cdab ("misc: fastrpc: add secure domain support")
    Cc: [email protected]
    Signed-off-by: Anandu Krishnan E <[email protected]>
    Signed-off-by: Srinivas Kandagatla <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

misc: fastrpc: Fix copy buffer page size [+ + +]
Author: Ekansh Gupta <[email protected]>
Date:   Fri Jan 10 13:42:39 2025 +0000

    misc: fastrpc: Fix copy buffer page size
    
    commit e966eae72762ecfdbdb82627e2cda48845b9dd66 upstream.
    
    For non-registered buffer, fastrpc driver copies the buffer and
    pass it to the remote subsystem. There is a problem with current
    implementation of page size calculation which is not considering
    the offset in the calculation. This might lead to passing of
    improper and out-of-bounds page size which could result in
    memory issue. Calculate page start and page end using the offset
    adjusted address instead of absolute address.
    
    Fixes: 02b45b47fbe8 ("misc: fastrpc: fix remote page size calculation")
    Cc: [email protected]
    Signed-off-by: Ekansh Gupta <[email protected]>
    Signed-off-by: Srinivas Kandagatla <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

misc: fastrpc: Fix registered buffer page address [+ + +]
Author: Ekansh Gupta <[email protected]>
Date:   Fri Jan 10 13:42:38 2025 +0000

    misc: fastrpc: Fix registered buffer page address
    
    commit 6ca4ea1f88a06a04ed7b2c9c6bf9f00833b68214 upstream.
    
    For registered  buffers, fastrpc driver sends the buffer information
    to remote subsystem. There is a problem with current implementation
    where the page address is being sent with an offset leading to
    improper buffer address on DSP. This is leads to functional failures
    as DSP expects base address in page information and extracts offset
    information from remote arguments. Mask the offset and pass the base
    page address to DSP.
    
    This issue is observed is a corner case when some buffer which is registered
    with fastrpc framework is passed with some offset by user and then the DSP
    implementation tried to read the data. As DSP expects base address and takes
    care of offsetting with remote arguments, passing an offsetted address will
    result in some unexpected data read in DSP.
    
    All generic usecases usually pass the buffer as it is hence is problem is
    not usually observed. If someone tries to pass offsetted buffer and then
    tries to compare data at HLOS and DSP end, then the ambiguity will be observed.
    
    Fixes: 80f3afd72bd4 ("misc: fastrpc: consider address offset before sending to DSP")
    Cc: [email protected]
    Signed-off-by: Ekansh Gupta <[email protected]>
    Signed-off-by: Srinivas Kandagatla <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

misc: misc_minor_alloc to use ida for all dynamic/misc dynamic minors [+ + +]
Author: Vimal Agrawal <[email protected]>
Date:   Mon Oct 21 13:38:12 2024 +0000

    misc: misc_minor_alloc to use ida for all dynamic/misc dynamic minors
    
    commit 6d04d2b554b14ae6c428a9c60b6c85f1e5c89f68 upstream.
    
    misc_minor_alloc was allocating id using ida for minor only in case of
    MISC_DYNAMIC_MINOR but misc_minor_free was always freeing ids
    using ida_free causing a mismatch and following warn:
    > > WARNING: CPU: 0 PID: 159 at lib/idr.c:525 ida_free+0x3e0/0x41f
    > > ida_free called for id=127 which is not allocated.
    > > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    ...
    > > [<60941eb4>] ida_free+0x3e0/0x41f
    > > [<605ac993>] misc_minor_free+0x3e/0xbc
    > > [<605acb82>] misc_deregister+0x171/0x1b3
    
    misc_minor_alloc is changed to allocate id from ida for all minors
    falling in the range of dynamic/ misc dynamic minors
    
    Fixes: ab760791c0cf ("char: misc: Increase the maximum number of dynamic misc devices to 1048448")
    Signed-off-by: Vimal Agrawal <[email protected]>
    Reviewed-by: Dirk VanDerMerwe <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mm/compaction: fix UBSAN shift-out-of-bounds warning [+ + +]
Author: Liu Shixin <[email protected]>
Date:   Thu Jan 23 10:10:29 2025 +0800

    mm/compaction: fix UBSAN shift-out-of-bounds warning
    
    commit d1366e74342e75555af2648a2964deb2d5c92200 upstream.
    
    syzkaller reported a UBSAN shift-out-of-bounds warning of (1UL << order)
    in isolate_freepages_block().  The bogus compound_order can be any value
    because it is union with flags.  Add back the MAX_PAGE_ORDER check to fix
    the warning.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 3da0272a4c7d ("mm/compaction: correctly return failure with bogus compound_order in strict mode")
    Signed-off-by: Liu Shixin <[email protected]>
    Reviewed-by: Kemeng Shi <[email protected]>
    Acked-by: David Hildenbrand <[email protected]>
    Reviewed-by: Oscar Salvador <[email protected]>
    Cc: Baolin Wang <[email protected]>
    Cc: David Hildenbrand <[email protected]>
    Cc: Kemeng Shi <[email protected]>
    Cc: Matthew Wilcox <[email protected]>
    Cc: Mel Gorman <[email protected]>
    Cc: Nanyong Sun <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mm/hugetlb: fix avoid_reserve to allow taking folio from subpool [+ + +]
Author: Peter Xu <[email protected]>
Date:   Tue Jan 7 15:39:56 2025 -0500

    mm/hugetlb: fix avoid_reserve to allow taking folio from subpool
    
    commit 58db7c5fbe7daa42098d4965133a864f98ba90ba upstream.
    
    Patch series "mm/hugetlb: Refactor hugetlb allocation resv accounting",
    v2.
    
    This is a follow up on Ackerley's series here as replacement:
    
    https://lore.kernel.org/r/[email protected]
    
    The goal of this series is to cleanup hugetlb resv accounting, especially
    during folio allocation, to decouple a few things:
    
      - Hugetlb folios v.s. Hugetlbfs: IOW, the hope is in the future hugetlb
        folios can be allocated completely without hugetlbfs.
    
      - Decouple VMA v.s. hugetlb folio allocations: allocating a hugetlb folio
        should not always require a hugetlbfs VMA.  For example, either it got
        allocated from the inode level (see hugetlbfs_fallocate() where it used
        a pesudo VMA for allocation), or it can be allocated by other kernel
        subsystems.
    
    It paves way for other users to allocate hugetlb folios out of either
    system reservations, or subpools (instead of hugetlbfs, as a file system).
    For longer term, this prepares hugetlb as a separate concept versus
    hugetlbfs, so that hugetlb folios can be allocated by not only hugetlbfs
    and other things.
    
    Tests I've done:
    
    - I had a reproducer in patch 1 for the bug I found, this will start to
      work after patch 1 or the whole set applied.
    
    - Hugetlb regression tests (on x86_64 2MBs), includes:
    
      - All vmtests on hugetlbfs
    
      - libhugetlbfs test suite (which may fail some tests, but no new failures
        will be introduced by this series, so all such failures happen before
        this series so shouldn't be relevant).
    
    
    This patch (of 7):
    
    Since commit 04f2cbe35699 ("hugetlb: guarantee that COW faults for a
    process that called mmap(MAP_PRIVATE) on hugetlbfs will succeed"),
    avoid_reserve was introduced for a special case of CoW on hugetlb private
    mappings, and only if the owner VMA is trying to allocate yet another
    hugetlb folio that is not reserved within the private vma reserved map.
    
    Later on, in commit d85f69b0b533 ("mm/hugetlb: alloc_huge_page handle
    areas hole punched by fallocate"), alloc_huge_page() enforced to not
    consume any global reservation as long as avoid_reserve=true.  This
    operation doesn't look correct, because even if it will enforce the
    allocation to not use global reservation at all, it will still try to take
    one reservation from the spool (if the subpool existed).  Then since the
    spool reserved pages take from global reservation, it'll also take one
    reservation globally.
    
    Logically it can cause global reservation to go wrong.
    
    I wrote a reproducer below, trigger this special path, and every run of
    such program will cause global reservation count to increment by one, until
    it hits the number of free pages:
    
      #define _GNU_SOURCE             /* See feature_test_macros(7) */
      #include <stdio.h>
      #include <fcntl.h>
      #include <errno.h>
      #include <unistd.h>
      #include <stdlib.h>
      #include <sys/mman.h>
    
      #define  MSIZE  (2UL << 20)
    
      int main(int argc, char *argv[])
      {
          const char *path;
          int *buf;
          int fd, ret;
          pid_t child;
    
          if (argc < 2) {
              printf("usage: %s <hugetlb_file>\n", argv[0]);
              return -1;
          }
    
          path = argv[1];
    
          fd = open(path, O_RDWR | O_CREAT, 0666);
          if (fd < 0) {
              perror("open failed");
              return -1;
          }
    
          ret = fallocate(fd, 0, 0, MSIZE);
          if (ret != 0) {
              perror("fallocate");
              return -1;
          }
    
          buf = mmap(NULL, MSIZE, PROT_READ|PROT_WRITE,
                     MAP_PRIVATE, fd, 0);
    
          if (buf == MAP_FAILED) {
              perror("mmap() failed");
              return -1;
          }
    
          /* Allocate a page */
          *buf = 1;
    
          child = fork();
          if (child == 0) {
              /* child doesn't need to do anything */
              exit(0);
          }
    
          /* Trigger CoW from owner */
          *buf = 2;
    
          munmap(buf, MSIZE);
          close(fd);
          unlink(path);
    
          return 0;
      }
    
    It can only reproduce with a sub-mount when there're reserved pages on the
    spool, like:
    
      # sysctl vm.nr_hugepages=128
      # mkdir ./hugetlb-pool
      # mount -t hugetlbfs -o min_size=8M,pagesize=2M none ./hugetlb-pool
    
    Then run the reproducer on the mountpoint:
    
      # ./reproducer ./hugetlb-pool/test
    
    Fix it by taking the reservation from spool if available.  In general,
    avoid_reserve is IMHO more about "avoid vma resv map", not spool's.
    
    I copied stable, however I have no intention for backporting if it's not a
    clean cherry-pick, because private hugetlb mapping, and then fork() on top
    is too rare to hit.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: d85f69b0b533 ("mm/hugetlb: alloc_huge_page handle areas hole punched by fallocate")
    Signed-off-by: Peter Xu <[email protected]>
    Reviewed-by: Ackerley Tng <[email protected]>
    Tested-by: Ackerley Tng <[email protected]>
    Reviewed-by: Oscar Salvador <[email protected]>
    Cc: Breno Leitao <[email protected]>
    Cc: Muchun Song <[email protected]>
    Cc: Naoya Horiguchi <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: Roman Gushchin <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mm/hugetlb: fix hugepage allocation for interleaved memory nodes [+ + +]
Author: Ritesh Harjani (IBM) <[email protected]>
Date:   Sat Jan 11 16:36:55 2025 +0530

    mm/hugetlb: fix hugepage allocation for interleaved memory nodes
    
    commit 76e961157e078bc5d3cd2df08317e00b00a829eb upstream.
    
    gather_bootmem_prealloc() assumes the start nid as 0 and size as
    num_node_state(N_MEMORY).  That means in case if memory attached numa
    nodes are interleaved, then gather_bootmem_prealloc_parallel() will fail
    to scan few of these nodes.
    
    Since memory attached numa nodes can be interleaved in any fashion, hence
    ensure that the current code checks for all numa node ids
    (.size = nr_node_ids). Let's still keep max_threads as N_MEMORY, so that
    it can distributes all nr_node_ids among the these many no. threads.
    
    e.g. qemu cmdline
    ========================
    numa_cmd="-numa node,nodeid=1,memdev=mem1,cpus=2-3 -numa node,nodeid=0,cpus=0-1 -numa dist,src=0,dst=1,val=20"
    mem_cmd="-object memory-backend-ram,id=mem1,size=16G"
    
    w/o this patch for cmdline (default_hugepagesz=1GB hugepagesz=1GB hugepages=2):
    ==========================
    ~ # cat /proc/meminfo  |grep -i huge
    AnonHugePages:         0 kB
    ShmemHugePages:        0 kB
    FileHugePages:         0 kB
    HugePages_Total:       0
    HugePages_Free:        0
    HugePages_Rsvd:        0
    HugePages_Surp:        0
    Hugepagesize:    1048576 kB
    Hugetlb:               0 kB
    
    with this patch for cmdline (default_hugepagesz=1GB hugepagesz=1GB hugepages=2):
    ===========================
    ~ # cat /proc/meminfo |grep -i huge
    AnonHugePages:         0 kB
    ShmemHugePages:        0 kB
    FileHugePages:         0 kB
    HugePages_Total:       2
    HugePages_Free:        2
    HugePages_Rsvd:        0
    HugePages_Surp:        0
    Hugepagesize:    1048576 kB
    Hugetlb:         2097152 kB
    
    Link: https://lkml.kernel.org/r/f8d8dad3a5471d284f54185f65d575a6aaab692b.1736592534.git.ritesh.list@gmail.com
    Fixes: b78b27d02930 ("hugetlb: parallelize 1G hugetlb initialization")
    Signed-off-by: Ritesh Harjani (IBM) <[email protected]>
    Reported-by: Pavithra Prakash <[email protected]>
    Suggested-by: Muchun Song <[email protected]>
    Tested-by: Sourabh Jain <[email protected]>
    Reviewed-by: Luiz Capitulino <[email protected]>
    Acked-by: David Rientjes <[email protected]>
    Cc: Donet Tom <[email protected]>
    Cc: Gang Li <[email protected]>
    Cc: Daniel Jordan <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mm/vmscan: accumulate nr_demoted for accurate demotion statistics [+ + +]
Author: Li Zhijian <[email protected]>
Date:   Fri Jan 10 20:21:32 2025 +0800

    mm/vmscan: accumulate nr_demoted for accurate demotion statistics
    
    commit a479b078fddb0ad7f9e3c6da22d9cf8f2b5c7799 upstream.
    
    In shrink_folio_list(), demote_folio_list() can be called 2 times.
    Currently stat->nr_demoted will only store the last nr_demoted( the later
    nr_demoted is always zero, the former nr_demoted will get lost), as a
    result number of demoted pages is not accurate.
    
    Accumulate the nr_demoted count across multiple calls to
    demote_folio_list(), ensuring accurate reporting of demotion statistics.
    
    [[email protected]: introduce local nr_demoted to fix nr_reclaimed double counting]
      Link: https://lkml.kernel.org/r/[email protected]
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: f77f0c751478 ("mm,memcg: provide per-cgroup counters for NUMA balancing operations")
    Signed-off-by: Li Zhijian <[email protected]>
    Acked-by: Kaiyang Zhao <[email protected]>
    Tested-by: Donet Tom <[email protected]>
    Reviewed-by: Donet Tom <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mm: gup: fix infinite loop within __get_longterm_locked [+ + +]
Author: Zhaoyang Huang <[email protected]>
Date:   Tue Jan 21 10:01:59 2025 +0800

    mm: gup: fix infinite loop within __get_longterm_locked
    
    commit 1aaf8c122918aa8897605a9aa1e8ed6600d6f930 upstream.
    
    We can run into an infinite loop in __get_longterm_locked() when
    collect_longterm_unpinnable_folios() finds only folios that are isolated
    from the LRU or were never added to the LRU.  This can happen when all
    folios to be pinned are never added to the LRU, for example when
    vm_ops->fault allocated pages using cma_alloc() and never added them to
    the LRU.
    
    Fix it by simply taking a look at the list in the single caller, to see if
    anything was added.
    
    [[email protected]: move definition of local]
      Link: https://lkml.kernel.org/r/[email protected]
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 67e139b02d99 ("mm/gup.c: refactor check_and_migrate_movable_pages()")
    Signed-off-by: Zhaoyang Huang <[email protected]>
    Reviewed-by: John Hubbard <[email protected]>
    Reviewed-by: David Hildenbrand <[email protected]>
    Suggested-by: David Hildenbrand <[email protected]>
    Acked-by: David Hildenbrand <[email protected]>
    Cc: Aijun Sun <[email protected]>
    Cc: Alistair Popple <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mm: kmemleak: fix upper boundary check for physical address objects [+ + +]
Author: Catalin Marinas <[email protected]>
Date:   Mon Jan 27 18:42:33 2025 +0000

    mm: kmemleak: fix upper boundary check for physical address objects
    
    commit 488b5b9eca68497b533ced059be5eff19578bbca upstream.
    
    Memblock allocations are registered by kmemleak separately, based on their
    physical address.  During the scanning stage, it checks whether an object
    is within the min_low_pfn and max_low_pfn boundaries and ignores it
    otherwise.
    
    With the recent addition of __percpu pointer leak detection (commit
    6c99d4eb7c5e ("kmemleak: enable tracking for percpu pointers")), kmemleak
    started reporting leaks in setup_zone_pageset() and
    setup_per_cpu_pageset().  These were caused by the node_data[0] object
    (initialised in alloc_node_data()) ending on the PFN_PHYS(max_low_pfn)
    boundary.  The non-strict upper boundary check introduced by commit
    84c326299191 ("mm: kmemleak: check physical address when scan") causes the
    pg_data_t object to be ignored (not scanned) and the __percpu pointers it
    contains to be reported as leaks.
    
    Make the max_low_pfn upper boundary check strict when deciding whether to
    ignore a physical address object and not scan it.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 84c326299191 ("mm: kmemleak: check physical address when scan")
    Signed-off-by: Catalin Marinas <[email protected]>
    Reported-by: Jakub Kicinski <[email protected]>
    Tested-by: Matthieu Baerts (NGI0) <[email protected]>
    Cc: Patrick Wang <[email protected]>
    Cc: <[email protected]>    [6.0.x]
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mmc: core: Respect quirk_max_rate for non-UHS SDIO card [+ + +]
Author: Shawn Lin <[email protected]>
Date:   Fri Nov 22 17:37:22 2024 +0800

    mmc: core: Respect quirk_max_rate for non-UHS SDIO card
    
    [ Upstream commit a2a44f8da29352f76c99c6904ee652911b8dc7dd ]
    
    The card-quirk was added to limit the clock-rate for a card with UHS-mode
    support, although let's respect the quirk for non-UHS mode too, to make the
    behaviour consistent.
    
    Signed-off-by: Shawn Lin <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Ulf Hansson <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

mmc: sdhci-esdhc-imx: enable 'SDHCI_QUIRK_NO_LED' quirk for S32G [+ + +]
Author: Ciprian Marian Costea <[email protected]>
Date:   Mon Nov 25 10:33:56 2024 +0200

    mmc: sdhci-esdhc-imx: enable 'SDHCI_QUIRK_NO_LED' quirk for S32G
    
    [ Upstream commit 0202dfbdc5dea70e213205aa42ab49a1a08aad3a ]
    
    Enable SDHCI_QUIRK_NO_LED quirk for S32G2/S32G3 variants as the controller
    does not have a LED signal line.
    
    Signed-off-by: Ciprian Marian Costea <[email protected]>
    Reviewed-by: Frank Li <[email protected]>
    Acked-by: Adrian Hunter <[email protected]>
    Reviewed-by: Haibo Chen <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Ulf Hansson <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

mmc: sdhci-msm: Correctly set the load for the regulator [+ + +]
Author: Yuanjie Yang <[email protected]>
Date:   Tue Jan 14 16:35:14 2025 +0800

    mmc: sdhci-msm: Correctly set the load for the regulator
    
    [ Upstream commit 20a0c37e44063997391430c4ae09973e9cbc3911 ]
    
    Qualcomm regulator supports two power supply modes: HPM and LPM.
    Currently, the sdhci-msm.c driver does not set the load to adjust
    the current for eMMC and SD. If the regulator dont't set correct
    load in LPM state, it will lead to the inability to properly
    initialize eMMC and SD.
    
    Set the correct regulator current for eMMC and SD to ensure that the
    device can work normally even when the regulator is in LPM.
    
    Signed-off-by: Yuanjie Yang <[email protected]>
    Reviewed-by: Dmitry Baryshkov <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Ulf Hansson <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
mtd: onenand: Fix uninitialized retlen in do_otp_read() [+ + +]
Author: Ivan Stepchenko <[email protected]>
Date:   Thu Nov 14 16:29:51 2024 +0300

    mtd: onenand: Fix uninitialized retlen in do_otp_read()
    
    commit 70a71f8151b9879b0950668ce3ad76263261fee0 upstream.
    
    The function do_otp_read() does not set the output parameter *retlen,
    which is expected to contain the number of bytes actually read.
    As a result, in onenand_otp_walk(), the tmp_retlen variable remains
    uninitialized after calling do_otp_walk() and used to change
    the values of the buf, len and retlen variables.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 49dc08eeda70 ("[MTD] [OneNAND] fix numerous races")
    Cc: [email protected]
    Signed-off-by: Ivan Stepchenko <[email protected]>
    Signed-off-by: Miquel Raynal <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
net/mlx5: HWS, change error flow on matcher disconnect [+ + +]
Author: Yevgeny Kliteynik <[email protected]>
Date:   Thu Jan 2 20:14:05 2025 +0200

    net/mlx5: HWS, change error flow on matcher disconnect
    
    [ Upstream commit 1ce840c7a659aa53a31ef49f0271b4fd0dc10296 ]
    
    Currently, when firmware failure occurs during matcher disconnect flow,
    the error flow of the function reconnects the matcher back and returns
    an error, which continues running the calling function and eventually
    frees the matcher that is being disconnected.
    This leads to a case where we have a freed matcher on the matchers list,
    which in turn leads to use-after-free and eventual crash.
    
    This patch fixes that by not trying to reconnect the matcher back when
    some FW command fails during disconnect.
    
    Note that we're dealing here with FW error. We can't overcome this
    problem. This might lead to bad steering state (e.g. wrong connection
    between matchers), and will also lead to resource leakage, as it is
    the case with any other error handling during resource destruction.
    
    However, the goal here is to allow the driver to continue and not crash
    the machine with use-after-free error.
    
    Signed-off-by: Yevgeny Kliteynik <[email protected]>
    Signed-off-by: Itamar Gozlan <[email protected]>
    Reviewed-by: Mark Bloch <[email protected]>
    Signed-off-by: Tariq Toukan <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net/mlx5: HWS, num_of_rules counter on matcher should be atomic [+ + +]
Author: Yevgeny Kliteynik <[email protected]>
Date:   Thu Jan 2 20:14:08 2025 +0200

    net/mlx5: HWS, num_of_rules counter on matcher should be atomic
    
    [ Upstream commit 61fb92701b8ac9174857c417cfa988adc24e32c2 ]
    
    Rule counter in matcher's struct is used in two places:
    
    1. As heuristics to decide when the number of rules have crossed a
    certain percentage threshold and the matcher should be resized.
    We don't mind here if the number will be off by 1-2 due to concurrency.
    
    2. When destroying matcher, the counter value is checked and the
    user is warned if it is not 0. Here we lock all the queues, so the
    counter will be correct.
    
    We don't need to always have *exact* number, but we do need this
    number to not be corrupted, which is what is happening when the
    counter isn't atomic, due to update by different threads.
    
    Signed-off-by: Yevgeny Kliteynik <[email protected]>
    Reviewed-by: Erez Shitrit <[email protected]>
    Reviewed-by: Mark Bloch <[email protected]>
    Signed-off-by: Tariq Toukan <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net/mlx5: use do_aux_work for PHC overflow checks [+ + +]
Author: Vadim Fedorenko <[email protected]>
Date:   Tue Jan 7 02:48:12 2025 -0800

    net/mlx5: use do_aux_work for PHC overflow checks
    
    [ Upstream commit e61e6c415ba9ff2b32bb6780ce1b17d1d76238f1 ]
    
    The overflow_work is using system wq to do overflow checks and updates
    for PHC device timecounter, which might be overhelmed by other tasks.
    But there is dedicated kthread in PTP subsystem designed for such
    things. This patch changes the work queue to proper align with PTP
    subsystem and to avoid overloading system work queue.
    The adjfine() function acts the same way as overflow check worker,
    we can postpone ptp aux worker till the next overflow period after
    adjfine() was called.
    
    Reviewed-by: Dragos Tatulea <[email protected]>
    Signed-off-by: Vadim Fedorenko <[email protected]>
    Acked-by: Tariq Toukan <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
net/ncsi: wait for the last response to Deselect Package before configuring channel [+ + +]
Author: Paul Fertser <[email protected]>
Date:   Thu Jan 16 18:29:00 2025 +0300

    net/ncsi: wait for the last response to Deselect Package before configuring channel
    
    commit 6bb194d036c6e1b329dcdff459338cdd9a54802a upstream.
    
    The NCSI state machine as it's currently implemented assumes that
    transition to the next logical state is performed either explicitly by
    calling `schedule_work(&ndp->work)` to re-queue itself or implicitly
    after processing the predefined (ndp->pending_req_num) number of
    replies. Thus to avoid the configuration FSM from advancing prematurely
    and getting out of sync with the process it's essential to not skip
    waiting for a reply.
    
    This patch makes the code wait for reception of the Deselect Package
    response for the last package probed before proceeding to channel
    configuration.
    
    Thanks go to Potin Lai and Cosmo Chou for the initial investigation and
    testing.
    
    Fixes: 8e13f70be05e ("net/ncsi: Probe single packages to avoid conflict")
    Cc: [email protected]
    Signed-off-by: Paul Fertser <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
net: atlantic: fix warning during hot unplug [+ + +]
Author: Jacob Moroni <[email protected]>
Date:   Mon Feb 3 09:36:05 2025 -0500

    net: atlantic: fix warning during hot unplug
    
    [ Upstream commit 028676bb189ed6d1b550a0fc570a9d695b6acfd3 ]
    
    Firmware deinitialization performs MMIO accesses which are not
    necessary if the device has already been removed. In some cases,
    these accesses happen via readx_poll_timeout_atomic which ends up
    timing out, resulting in a warning at hw_atl2_utils_fw.c:112:
    
    [  104.595913] Call Trace:
    [  104.595915]  <TASK>
    [  104.595918]  ? show_regs+0x6c/0x80
    [  104.595923]  ? __warn+0x8d/0x150
    [  104.595925]  ? aq_a2_fw_deinit+0xcf/0xe0 [atlantic]
    [  104.595934]  ? report_bug+0x182/0x1b0
    [  104.595938]  ? handle_bug+0x6e/0xb0
    [  104.595940]  ? exc_invalid_op+0x18/0x80
    [  104.595942]  ? asm_exc_invalid_op+0x1b/0x20
    [  104.595944]  ? aq_a2_fw_deinit+0xcf/0xe0 [atlantic]
    [  104.595952]  ? aq_a2_fw_deinit+0xcf/0xe0 [atlantic]
    [  104.595959]  aq_nic_deinit.part.0+0xbd/0xf0 [atlantic]
    [  104.595964]  aq_nic_deinit+0x17/0x30 [atlantic]
    [  104.595970]  aq_ndev_close+0x2b/0x40 [atlantic]
    [  104.595975]  __dev_close_many+0xad/0x160
    [  104.595978]  dev_close_many+0x99/0x170
    [  104.595979]  unregister_netdevice_many_notify+0x18b/0xb20
    [  104.595981]  ? __call_rcu_common+0xcd/0x700
    [  104.595984]  unregister_netdevice_queue+0xc6/0x110
    [  104.595986]  unregister_netdev+0x1c/0x30
    [  104.595988]  aq_pci_remove+0xb1/0xc0 [atlantic]
    
    Fix this by skipping firmware deinitialization altogether if the
    PCI device is no longer present.
    
    Tested with an AQC113 attached via Thunderbolt by performing
    repeated unplug cycles while traffic was running via iperf.
    
    Fixes: 97bde5c4f909 ("net: ethernet: aquantia: Support for NIC-specific code")
    Signed-off-by: Jacob Moroni <[email protected]>
    Reviewed-by: Igor Russkikh <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: bcmgenet: Correct overlaying of PHY and MAC Wake-on-LAN [+ + +]
Author: Florian Fainelli <[email protected]>
Date:   Wed Jan 29 15:13:42 2025 -0800

    net: bcmgenet: Correct overlaying of PHY and MAC Wake-on-LAN
    
    [ Upstream commit 46ded709232344b5750a852747a8881763c721ab ]
    
    Some Wake-on-LAN modes such as WAKE_FILTER may only be supported by the MAC,
    while others might be only supported by the PHY. Make sure that the .get_wol()
    returns the union of both rather than only that of the PHY if the PHY supports
    Wake-on-LAN.
    
    When disabling Wake-on-LAN, make sure that this is done at both the PHY
    and MAC level, rather than doing an early return from the PHY driver.
    
    Fixes: 7e400ff35cbe ("net: bcmgenet: Add support for PHY-based Wake-on-LAN")
    Fixes: 9ee09edc05f2 ("net: bcmgenet: Properly overlay PHY and MAC Wake-on-LAN capabilities")
    Signed-off-by: Florian Fainelli <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: ethernet: ti: am65-cpsw: ensure proper channel cleanup in error path [+ + +]
Author: Roger Quadros <[email protected]>
Date:   Fri Jan 17 16:06:33 2025 +0200

    net: ethernet: ti: am65-cpsw: ensure proper channel cleanup in error path
    
    [ Upstream commit 681eb2beb3efe21e630bcc4881595e3b42dd7948 ]
    
    We are missing netif_napi_del() and am65_cpsw_nuss_free_tx/rx_chns()
    in error path when am65_cpsw_nuss_init_tx/rx_chns() is used anywhere
    other than at probe(). i.e. am65_cpsw_nuss_update_tx_rx_chns and
    am65_cpsw_nuss_resume()
    
    As reported, in am65_cpsw_nuss_update_tx_rx_chns(),
    if am65_cpsw_nuss_init_tx_chns() partially fails then
    devm_add_action(dev, am65_cpsw_nuss_free_tx_chns,..) is added
    but the cleanup via am65_cpsw_nuss_free_tx_chns() will not run.
    
    Same issue exists for am65_cpsw_nuss_init_tx/rx_chns() failures
    in am65_cpsw_nuss_resume() as well.
    
    This would otherwise require more instances of devm_add/remove_action
    and is clearly more of a distraction than any benefit.
    
    So, drop devm_add/remove_action for am65_cpsw_nuss_free_tx/rx_chns()
    and call am65_cpsw_nuss_free_tx/rx_chns() and netif_napi_del()
    where required.
    
    Reported-by: Siddharth Vadapalli <[email protected]>
    Closes: https://lore.kernel.org/all/m4rhkzcr7dlylxr54udyt6lal5s2q4krrvmyay6gzgzhcu4q2c@r34snfumzqxy/
    Signed-off-by: Roger Quadros <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: phy: c45-tjaxx: add delay between MDIO write and read in soft_reset [+ + +]
Author: Milos Reljin <[email protected]>
Date:   Fri Jan 24 10:41:02 2025 +0000

    net: phy: c45-tjaxx: add delay between MDIO write and read in soft_reset
    
    commit bd1bbab717608757cccbbe08b0d46e6c3ed0ced5 upstream.
    
    In application note (AN13663) for TJA1120, on page 30, there's a figure
    with average PHY startup timing values following software reset.
    The time it takes for SMI to become operational after software reset
    ranges roughly from 500 us to 1500 us.
    
    This commit adds 2000 us delay after MDIO write which triggers software
    reset. Without this delay, soft_reset function returns an error and
    prevents successful PHY init.
    
    Cc: [email protected]
    Fixes: b050f2f15e04 ("phy: nxp-c45: add driver for tja1103")
    Signed-off-by: Milos Reljin <[email protected]>
    Reviewed-by: Andrew Lunn <[email protected]>
    Link: https://patch.msgid.link/AM8P250MB0124D258E5A71041AF2CC322E1E32@AM8P250MB0124.EURP250.PROD.OUTLOOK.COM
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: rose: lock the socket in rose_bind() [+ + +]
Author: Eric Dumazet <[email protected]>
Date:   Mon Feb 3 17:08:38 2025 +0000

    net: rose: lock the socket in rose_bind()
    
    [ Upstream commit a1300691aed9ee852b0a9192e29e2bdc2411a7e6 ]
    
    syzbot reported a soft lockup in rose_loopback_timer(),
    with a repro calling bind() from multiple threads.
    
    rose_bind() must lock the socket to avoid this issue.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/netdev/[email protected]/T/#u
    Signed-off-by: Eric Dumazet <[email protected]>
    Acked-by: Paolo Abeni <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: sched: Fix truncation of offloaded action statistics [+ + +]
Author: Ido Schimmel <[email protected]>
Date:   Tue Feb 4 14:38:39 2025 +0200

    net: sched: Fix truncation of offloaded action statistics
    
    [ Upstream commit 811b8f534fd85e17077bd2ac0413bcd16cc8fb9b ]
    
    In case of tc offload, when user space queries the kernel for tc action
    statistics, tc will query the offloaded statistics from device drivers.
    Among other statistics, drivers are expected to pass the number of
    packets that hit the action since the last query as a 64-bit number.
    
    Unfortunately, tc treats the number of packets as a 32-bit number,
    leading to truncation and incorrect statistics when the number of
    packets since the last query exceeds 0xffffffff:
    
    $ tc -s filter show dev swp2 ingress
    filter protocol all pref 1 flower chain 0
    filter protocol all pref 1 flower chain 0 handle 0x1
      skip_sw
      in_hw in_hw_count 1
            action order 1: mirred (Egress Redirect to device swp1) stolen
            index 1 ref 1 bind 1 installed 58 sec used 0 sec
            Action statistics:
            Sent 1133877034176 bytes 536959475 pkt (dropped 0, overlimits 0 requeues 0)
    [...]
    
    According to the above, 2111-byte packets were redirected which is
    impossible as only 64-byte packets were transmitted and the MTU was
    1500.
    
    Fix by treating packets as a 64-bit number:
    
    $ tc -s filter show dev swp2 ingress
    filter protocol all pref 1 flower chain 0
    filter protocol all pref 1 flower chain 0 handle 0x1
      skip_sw
      in_hw in_hw_count 1
            action order 1: mirred (Egress Redirect to device swp1) stolen
            index 1 ref 1 bind 1 installed 61 sec used 0 sec
            Action statistics:
            Sent 1370624380864 bytes 21416005951 pkt (dropped 0, overlimits 0 requeues 0)
    [...]
    
    Which shows that only 64-byte packets were redirected (1370624380864 /
    21416005951 = 64).
    
    Fixes: 380407023526 ("net/sched: Enable netdev drivers to update statistics of offloaded actions")
    Reported-by: Joe Botha <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>
    Reviewed-by: Petr Machata <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: wwan: iosm: Fix hibernation by re-binding the driver around it [+ + +]
Author: Maciej S. Szmigiero <[email protected]>
Date:   Thu Jan 9 00:33:50 2025 +0100

    net: wwan: iosm: Fix hibernation by re-binding the driver around it
    
    [ Upstream commit 0b6f6593aa8c3a05f155c12fd0e7ad33a5149c31 ]
    
    Currently, the driver is seriously broken with respect to the
    hibernation (S4): after image restore the device is back into
    IPC_MEM_EXEC_STAGE_BOOT (which AFAIK means bootloader stage) and needs
    full re-launch of the rest of its firmware, but the driver restore
    handler treats the device as merely sleeping and just sends it a
    wake-up command.
    
    This wake-up command times out but device nodes (/dev/wwan*) remain
    accessible.
    However attempting to use them causes the bootloader to crash and
    enter IPC_MEM_EXEC_STAGE_CD_READY stage (which apparently means "a crash
    dump is ready").
    
    It seems that the device cannot be re-initialized from this crashed
    stage without toggling some reset pin (on my test platform that's
    apparently what the device _RST ACPI method does).
    
    While it would theoretically be possible to rewrite the driver to tear
    down the whole MUX / IPC layers on hibernation (so the bootloader does
    not crash from improper access) and then re-launch the device on
    restore this would require significant refactoring of the driver
    (believe me, I've tried), since there are quite a few assumptions
    hard-coded in the driver about the device never being partially
    de-initialized (like channels other than devlink cannot be closed,
    for example).
    Probably this would also need some programming guide for this hardware.
    
    Considering that the driver seems orphaned [1] and other people are
    hitting this issue too [2] fix it by simply unbinding the PCI driver
    before hibernation and re-binding it after restore, much like
    USB_QUIRK_RESET_RESUME does for USB devices that exhibit a similar
    problem.
    
    Tested on XMM7360 in HP EliteBook 855 G7 both with s2idle (which uses
    the existing suspend / resume handlers) and S4 (which uses the new code).
    
    [1]: https://lore.kernel.org/all/[email protected]/
    [2]:
    https://github.com/xmm7360/xmm7360-pci/issues/211#issuecomment-1804139413
    
    Reviewed-by: Sergey Ryazanov <[email protected]>
    Signed-off-by: Maciej S. Szmigiero <[email protected]>
    Link: https://patch.msgid.link/e60287ebdb0ab54c4075071b72568a40a75d0205.1736372610.git.mail@maciej.szmigiero.name
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
netem: Update sch->q.qlen before qdisc_tree_reduce_backlog() [+ + +]
Author: Cong Wang <[email protected]>
Date:   Mon Feb 3 16:58:40 2025 -0800

    netem: Update sch->q.qlen before qdisc_tree_reduce_backlog()
    
    [ Upstream commit 638ba5089324796c2ee49af10427459c2de35f71 ]
    
    qdisc_tree_reduce_backlog() notifies parent qdisc only if child
    qdisc becomes empty, therefore we need to reduce the backlog of the
    child qdisc before calling it. Otherwise it would miss the opportunity
    to call cops->qlen_notify(), in the case of DRR, it resulted in UAF
    since DRR uses ->qlen_notify() to maintain its active list.
    
    Fixes: f8d4bc455047 ("net/sched: netem: account for backlog updates from child qdisc")
    Cc: Martin Ottens <[email protected]>
    Reported-by: Mingi Cho <[email protected]>
    Signed-off-by: Cong Wang <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
NFC: nci: Add bounds checking in nci_hci_create_pipe() [+ + +]
Author: Dan Carpenter <[email protected]>
Date:   Fri Jan 17 12:38:41 2025 +0300

    NFC: nci: Add bounds checking in nci_hci_create_pipe()
    
    commit 110b43ef05342d5a11284cc8b21582b698b4ef1c upstream.
    
    The "pipe" variable is a u8 which comes from the network.  If it's more
    than 127, then it results in memory corruption in the caller,
    nci_hci_connect_gate().
    
    Cc: [email protected]
    Fixes: a1b0b9415817 ("NFC: nci: Create pipe on specific gate in nci_hci_connect_gate")
    Signed-off-by: Dan Carpenter <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Reviewed-by: Krzysztof Kozlowski <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
nfs: Make NFS_FSCACHE select NETFS_SUPPORT instead of depending on it [+ + +]
Author: Dragan Simic <[email protected]>
Date:   Fri Dec 27 20:17:58 2024 +0100

    nfs: Make NFS_FSCACHE select NETFS_SUPPORT instead of depending on it
    
    commit 90190ba1c3b11687e2c251fda1f5d9893b4bab17 upstream.
    
    Having the NFS_FSCACHE option depend on the NETFS_SUPPORT options makes
    selecting NFS_FSCACHE impossible unless another option that additionally
    selects NETFS_SUPPORT is already selected.
    
    As a result, for example, being able to reach and select the NFS_FSCACHE
    option requires the CEPH_FS or CIFS option to be selected beforehand, which
    obviously doesn't make much sense.
    
    Let's correct this by making the NFS_FSCACHE option actually select the
    NETFS_SUPPORT option, instead of depending on it.
    
    Fixes: 915cd30cdea8 ("netfs, fscache: Combine fscache with netfs")
    Cc: [email protected]
    Reported-by: Diederik de Haas <[email protected]>
    Signed-off-by: Dragan Simic <[email protected]>
    Signed-off-by: Anna Schumaker <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
NFSD: Encode COMPOUND operation status on page boundaries [+ + +]
Author: Chuck Lever <[email protected]>
Date:   Mon Dec 30 19:28:52 2024 -0500

    NFSD: Encode COMPOUND operation status on page boundaries
    
    commit ef3675b45bcb6c17cabbbde620c6cea52ffb21ac upstream.
    
    J. David reports an odd corruption of a READDIR reply sent to a
    FreeBSD client.
    
    xdr_reserve_space() has to do a special trick when the @nbytes value
    requests more space than there is in the current page of the XDR
    buffer.
    
    In that case, xdr_reserve_space() returns a pointer to the start of
    the next page, and then the next call to xdr_reserve_space() invokes
    __xdr_commit_encode() to copy enough of the data item back into the
    previous page to make that data item contiguous across the page
    boundary.
    
    But we need to be careful in the case where buffer space is reserved
    early for a data item whose value will be inserted into the buffer
    later.
    
    One such caller, nfsd4_encode_operation(), reserves 8 bytes in the
    encoding buffer for each COMPOUND operation. However, a READDIR
    result can sometimes encode file names so that there are only 4
    bytes left at the end of the current XDR buffer page (though plenty
    of pages are left to handle the remaining encoding tasks).
    
    If a COMPOUND operation follows the READDIR result (say, a GETATTR),
    then nfsd4_encode_operation() will reserve 8 bytes for the op number
    (9) and the op status (usually NFS4_OK). In this weird case,
    xdr_reserve_space() returns a pointer to byte zero of the next buffer
    page, as it assumes the data item will be copied back into place (in
    the previous page) on the next call to xdr_reserve_space().
    
    nfsd4_encode_operation() writes the op num into the buffer, then
    saves the next 4-byte location for the op's status code. The next
    xdr_reserve_space() call is part of GETATTR encoding, so the op num
    gets copied back into the previous page, but the saved location for
    the op status continues to point to the wrong spot in the current
    XDR buffer page because __xdr_commit_encode() moved that data item.
    
    After GETATTR encoding is complete, nfsd4_encode_operation() writes
    the op status over the first XDR data item in the GETATTR result.
    The NFS4_OK status code (0) makes it look like there are zero items
    in the GETATTR's attribute bitmask.
    
    The patch description of commit 2825a7f90753 ("nfsd4: allow encoding
    across page boundaries") [2014] remarks that NFSD "can't handle a
    new operation starting close to the end of a page." This bug appears
    to be one reason for that remark.
    
    Reported-by: J David <[email protected]>
    Closes: https://lore.kernel.org/linux-nfs/[email protected]/T/#t
    Tested-by: Rick Macklem <[email protected]>
    Reviewed-by: NeilBrown <[email protected]>
    Reviewed-by: Jeff Layton <[email protected]>
    Cc: [email protected]
    Signed-off-by: Chuck Lever <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
nilfs2: fix possible int overflows in nilfs_fiemap() [+ + +]
Author: Nikita Zhandarovich <[email protected]>
Date:   Sat Jan 25 07:20:53 2025 +0900

    nilfs2: fix possible int overflows in nilfs_fiemap()
    
    commit 6438ef381c183444f7f9d1de18f22661cba1e946 upstream.
    
    Since nilfs_bmap_lookup_contig() in nilfs_fiemap() calculates its result
    by being prepared to go through potentially maxblocks == INT_MAX blocks,
    the value in n may experience an overflow caused by left shift of blkbits.
    
    While it is extremely unlikely to occur, play it safe and cast right hand
    expression to wider type to mitigate the issue.
    
    Found by Linux Verification Center (linuxtesting.org) with static analysis
    tool SVACE.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 622daaff0a89 ("nilfs2: fiemap support")
    Signed-off-by: Nikita Zhandarovich <[email protected]>
    Signed-off-by: Ryusuke Konishi <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
nvkm/gsp: correctly advance the read pointer of GSP message queue [+ + +]
Author: Zhi Wang <[email protected]>
Date:   Thu Oct 17 00:19:20 2024 -0700

    nvkm/gsp: correctly advance the read pointer of GSP message queue
    
    [ Upstream commit 8d9beb4aebc02c4bd09e1d39c9c5f1c68c786dbc ]
    
    A GSP event message consists three parts: message header, RPC header,
    message body. GSP calculates the number of pages to write from the
    total size of a GSP message. This behavior can be observed from the
    movement of the write pointer.
    
    However, nvkm takes only the size of RPC header and message body as
    the message size when advancing the read pointer. When handling a
    two-page GSP message in the non rollback case, It wrongly takes the
    message body of the previous message as the message header of the next
    message. As the "message length" tends to be zero, in the calculation of
    size needs to be copied (0 - size of (message header)), the size needs to
    be copied will be "0xffffffxx". It also triggers a kernel panic due to a
    NULL pointer error.
    
    [  547.614102] msg: 00000f90: ff ff ff ff ff ff ff ff 40 d7 18 fb 8b 00 00 00  ........@.......
    [  547.622533] msg: 00000fa0: 00 00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00  ................
    [  547.630965] msg: 00000fb0: ff ff ff ff ff ff ff ff 00 00 00 00 ff ff ff ff  ................
    [  547.639397] msg: 00000fc0: ff ff ff ff 00 00 00 00 ff ff ff ff ff ff ff ff  ................
    [  547.647832] nvkm 0000:c1:00.0: gsp: peek msg rpc fn:0 len:0x0/0xffffffffffffffe0
    [  547.655225] nvkm 0000:c1:00.0: gsp: get msg rpc fn:0 len:0x0/0xffffffffffffffe0
    [  547.662532] BUG: kernel NULL pointer dereference, address: 0000000000000020
    [  547.669485] #PF: supervisor read access in kernel mode
    [  547.674624] #PF: error_code(0x0000) - not-present page
    [  547.679755] PGD 0 P4D 0
    [  547.682294] Oops: 0000 [#1] PREEMPT SMP NOPTI
    [  547.686643] CPU: 22 PID: 322 Comm: kworker/22:1 Tainted: G            E      6.9.0-rc6+ #1
    [  547.694893] Hardware name: ASRockRack 1U1G-MILAN/N/ROMED8-NL, BIOS L3.12E 09/06/2022
    [  547.702626] Workqueue: events r535_gsp_msgq_work [nvkm]
    [  547.707921] RIP: 0010:r535_gsp_msg_recv+0x87/0x230 [nvkm]
    [  547.713375] Code: 00 8b 70 08 48 89 e1 31 d2 4c 89 f7 e8 12 f5 ff ff 48 89 c5 48 85 c0 0f 84 cf 00 00 00 48 81 fd 00 f0 ff ff 0f 87 c4 00 00 00 <8b> 55 10 41 8b 46 30 85 d2 0f 85 f6 00 00 00 83 f8 04 76 10 ba 05
    [  547.732119] RSP: 0018:ffffabe440f87e10 EFLAGS: 00010203
    [  547.737335] RAX: 0000000000000010 RBX: 0000000000000008 RCX: 000000000000003f
    [  547.744461] RDX: 0000000000000000 RSI: ffffabe4480a8030 RDI: 0000000000000010
    [  547.751585] RBP: 0000000000000010 R08: 0000000000000000 R09: ffffabe440f87bb0
    [  547.758707] R10: ffffabe440f87dc8 R11: 0000000000000010 R12: 0000000000000000
    [  547.765834] R13: 0000000000000000 R14: ffff9351df1e5000 R15: 0000000000000000
    [  547.772958] FS:  0000000000000000(0000) GS:ffff93708eb00000(0000) knlGS:0000000000000000
    [  547.781035] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  547.786771] CR2: 0000000000000020 CR3: 00000003cc220002 CR4: 0000000000770ef0
    [  547.793896] PKRU: 55555554
    [  547.796600] Call Trace:
    [  547.799046]  <TASK>
    [  547.801152]  ? __die+0x20/0x70
    [  547.804211]  ? page_fault_oops+0x75/0x170
    [  547.808221]  ? print_hex_dump+0x100/0x160
    [  547.812226]  ? exc_page_fault+0x64/0x150
    [  547.816152]  ? asm_exc_page_fault+0x22/0x30
    [  547.820341]  ? r535_gsp_msg_recv+0x87/0x230 [nvkm]
    [  547.825184]  r535_gsp_msgq_work+0x42/0x50 [nvkm]
    [  547.829845]  process_one_work+0x196/0x3d0
    [  547.833861]  worker_thread+0x2fc/0x410
    [  547.837613]  ? __pfx_worker_thread+0x10/0x10
    [  547.841885]  kthread+0xdf/0x110
    [  547.845031]  ? __pfx_kthread+0x10/0x10
    [  547.848775]  ret_from_fork+0x30/0x50
    [  547.852354]  ? __pfx_kthread+0x10/0x10
    [  547.856097]  ret_from_fork_asm+0x1a/0x30
    [  547.860019]  </TASK>
    [  547.862208] Modules linked in: nvkm(E) gsp_log(E) snd_seq_dummy(E) snd_hrtimer(E) snd_seq(E) snd_timer(E) snd_seq_device(E) snd(E) soundcore(E) rfkill(E) qrtr(E) vfat(E) fat(E) ipmi_ssif(E) amd_atl(E) intel_rapl_msr(E) intel_rapl_common(E) amd64_edac(E) mlx5_ib(E) edac_mce_amd(E) kvm_amd(E) ib_uverbs(E) kvm(E) ib_core(E) acpi_ipmi(E) ipmi_si(E) ipmi_devintf(E) mxm_wmi(E) joydev(E) rapl(E) ptdma(E) i2c_piix4(E) acpi_cpufreq(E) wmi_bmof(E) pcspkr(E) k10temp(E) ipmi_msghandler(E) xfs(E) libcrc32c(E) ast(E) i2c_algo_bit(E) drm_shmem_helper(E) crct10dif_pclmul(E) drm_kms_helper(E) ahci(E) crc32_pclmul(E) nvme_tcp(E) libahci(E) nvme(E) crc32c_intel(E) nvme_fabrics(E) cdc_ether(E) nvme_core(E) usbnet(E) mlx5_core(E) ghash_clmulni_intel(E) drm(E) libata(E) ccp(E) mii(E) t10_pi(E) mlxfw(E) sp5100_tco(E) psample(E) pci_hyperv_intf(E) wmi(E) dm_multipath(E) sunrpc(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) be2iscsi(E) bnx2i(E) cnic(E) uio(E) cxgb4i(E) cxgb4(E) tls(E) libcxgbi(E) libcxgb(E) qla4xxx(E)
    [  547.862283]  iscsi_boot_sysfs(E) iscsi_tcp(E) libiscsi_tcp(E) libiscsi(E) scsi_transport_iscsi(E) fuse(E) [last unloaded: gsp_log(E)]
    [  547.962691] CR2: 0000000000000020
    [  547.966003] ---[ end trace 0000000000000000 ]---
    [  549.012012] clocksource: Long readout interval, skipping watchdog check: cs_nsec: 1370499158 wd_nsec: 1370498904
    [  549.043676] pstore: backend (erst) writing error (-28)
    [  549.050924] RIP: 0010:r535_gsp_msg_recv+0x87/0x230 [nvkm]
    [  549.056389] Code: 00 8b 70 08 48 89 e1 31 d2 4c 89 f7 e8 12 f5 ff ff 48 89 c5 48 85 c0 0f 84 cf 00 00 00 48 81 fd 00 f0 ff ff 0f 87 c4 00 00 00 <8b> 55 10 41 8b 46 30 85 d2 0f 85 f6 00 00 00 83 f8 04 76 10 ba 05
    [  549.075138] RSP: 0018:ffffabe440f87e10 EFLAGS: 00010203
    [  549.080361] RAX: 0000000000000010 RBX: 0000000000000008 RCX: 000000000000003f
    [  549.087484] RDX: 0000000000000000 RSI: ffffabe4480a8030 RDI: 0000000000000010
    [  549.094609] RBP: 0000000000000010 R08: 0000000000000000 R09: ffffabe440f87bb0
    [  549.101733] R10: ffffabe440f87dc8 R11: 0000000000000010 R12: 0000000000000000
    [  549.108857] R13: 0000000000000000 R14: ffff9351df1e5000 R15: 0000000000000000
    [  549.115982] FS:  0000000000000000(0000) GS:ffff93708eb00000(0000) knlGS:0000000000000000
    [  549.124061] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  549.129807] CR2: 0000000000000020 CR3: 00000003cc220002 CR4: 0000000000770ef0
    [  549.136940] PKRU: 55555554
    [  549.139653] Kernel panic - not syncing: Fatal exception
    [  549.145054] Kernel Offset: 0x18c00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
    [  549.165074] ---[ end Kernel panic - not syncing: Fatal exception ]---
    
    Also, nvkm wrongly advances the read pointer when handling a two-page GSP
    message in the rollback case. In the rollback case, the GSP message will
    be copied in two rounds. When handling a two-page GSP message, nvkm first
    copies amount of (GSP_PAGE_SIZE - header) data into the buffer, then
    advances the read pointer by the result of DIV_ROUND_UP(size,
    GSP_PAGE_SIZE). Thus, the read pointer is advanced by 1.
    
    Next, nvkm copies the amount of (total size - (GSP_PAGE_SIZE -
    header)) data into the buffer. The left amount of the data will be always
    larger than one page since the message header is not taken into account
    in the first copy. Thus, the read pointer is advanced by DIV_ROUND_UP(
    size(larger than one page), GSP_PAGE_SIZE) = 2.
    
    In the end, the read pointer is wrongly advanced by 3 when handling a
    two-page GSP message in the rollback case.
    
    Fix the problems by taking the total size of the message into account
    when advancing the read pointer and calculate the read pointer in the end
    of the all copies for the rollback case.
    
    BTW: the two-page GSP message can be observed in the msgq when vGPU is
    enabled.
    
    Signed-off-by: Zhi Wang <[email protected]>
    Signed-off-by: Danilo Krummrich <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
nvkm: correctly calculate the available space of the GSP cmdq buffer [+ + +]
Author: Zhi Wang <[email protected]>
Date:   Thu Oct 17 00:19:21 2024 -0700

    nvkm: correctly calculate the available space of the GSP cmdq buffer
    
    [ Upstream commit 01ed662bdd6fce4f59c1804b334610d710d79fa0 ]
    
    r535_gsp_cmdq_push() waits for the available page in the GSP cmdq
    buffer when handling a large RPC request. When it sees at least one
    available page in the cmdq, it quits the waiting with the amount of
    free buffer pages in the queue.
    
    Unfortunately, it always takes the [write pointer, buf_size) as
    available buffer pages before rolling back and wrongly calculates the
    size of the data should be copied. Thus, it can overwrite the RPC
    request that GSP is currently reading, which causes GSP hang due
    to corrupted RPC request:
    
    [  549.209389] ------------[ cut here ]------------
    [  549.214010] WARNING: CPU: 8 PID: 6314 at drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:116 r535_gsp_msgq_wait+0xd0/0x190 [nvkm]
    [  549.225678] Modules linked in: nvkm(E+) gsp_log(E) snd_seq_dummy(E) snd_hrtimer(E) snd_seq(E) snd_timer(E) snd_seq_device(E) snd(E) soundcore(E) rfkill(E) qrtr(E) vfat(E) fat(E) ipmi_ssif(E) amd_atl(E) intel_rapl_msr(E) intel_rapl_common(E) mlx5_ib(E) amd64_edac(E) edac_mce_amd(E) kvm_amd(E) ib_uverbs(E) kvm(E) ib_core(E) acpi_ipmi(E) ipmi_si(E) mxm_wmi(E) ipmi_devintf(E) rapl(E) i2c_piix4(E) wmi_bmof(E) joydev(E) ptdma(E) acpi_cpufreq(E) k10temp(E) pcspkr(E) ipmi_msghandler(E) xfs(E) libcrc32c(E) ast(E) i2c_algo_bit(E) crct10dif_pclmul(E) drm_shmem_helper(E) nvme_tcp(E) crc32_pclmul(E) ahci(E) drm_kms_helper(E) libahci(E) nvme_fabrics(E) crc32c_intel(E) nvme(E) cdc_ether(E) mlx5_core(E) nvme_core(E) usbnet(E) drm(E) libata(E) ccp(E) ghash_clmulni_intel(E) mii(E) t10_pi(E) mlxfw(E) sp5100_tco(E) psample(E) pci_hyperv_intf(E) wmi(E) dm_multipath(E) sunrpc(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) be2iscsi(E) bnx2i(E) cnic(E) uio(E) cxgb4i(E) cxgb4(E) tls(E) libcxgbi(E) libcxgb(E) qla4xxx(E)
    [  549.225752]  iscsi_boot_sysfs(E) iscsi_tcp(E) libiscsi_tcp(E) libiscsi(E) scsi_transport_iscsi(E) fuse(E) [last unloaded: gsp_log(E)]
    [  549.326293] CPU: 8 PID: 6314 Comm: insmod Tainted: G            E      6.9.0-rc6+ #1
    [  549.334039] Hardware name: ASRockRack 1U1G-MILAN/N/ROMED8-NL, BIOS L3.12E 09/06/2022
    [  549.341781] RIP: 0010:r535_gsp_msgq_wait+0xd0/0x190 [nvkm]
    [  549.347343] Code: 08 00 00 89 da c1 e2 0c 48 8d ac 11 00 10 00 00 48 8b 0c 24 48 85 c9 74 1f c1 e0 0c 4c 8d 6d 30 83 e8 30 89 01 e9 68 ff ff ff <0f> 0b 49 c7 c5 92 ff ff ff e9 5a ff ff ff ba ff ff ff ff be c0 0c
    [  549.366090] RSP: 0018:ffffacbccaaeb7d0 EFLAGS: 00010246
    [  549.371315] RAX: 0000000000000000 RBX: 0000000000000012 RCX: 0000000000923e28
    [  549.378451] RDX: 0000000000000000 RSI: 0000000055555554 RDI: ffffacbccaaeb730
    [  549.385590] RBP: 0000000000000001 R08: ffff8bd14d235f70 R09: ffff8bd14d235f70
    [  549.392721] R10: 0000000000000002 R11: ffff8bd14d233864 R12: 0000000000000020
    [  549.399854] R13: ffffacbccaaeb818 R14: 0000000000000020 R15: ffff8bb298c67000
    [  549.406988] FS:  00007f5179244740(0000) GS:ffff8bd14d200000(0000) knlGS:0000000000000000
    [  549.415076] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  549.420829] CR2: 00007fa844000010 CR3: 00000001567dc005 CR4: 0000000000770ef0
    [  549.427963] PKRU: 55555554
    [  549.430672] Call Trace:
    [  549.433126]  <TASK>
    [  549.435233]  ? __warn+0x7f/0x130
    [  549.438473]  ? r535_gsp_msgq_wait+0xd0/0x190 [nvkm]
    [  549.443426]  ? report_bug+0x18a/0x1a0
    [  549.447098]  ? handle_bug+0x3c/0x70
    [  549.450589]  ? exc_invalid_op+0x14/0x70
    [  549.454430]  ? asm_exc_invalid_op+0x16/0x20
    [  549.458619]  ? r535_gsp_msgq_wait+0xd0/0x190 [nvkm]
    [  549.463565]  r535_gsp_msg_recv+0x46/0x230 [nvkm]
    [  549.468257]  r535_gsp_rpc_push+0x106/0x160 [nvkm]
    [  549.473033]  r535_gsp_rpc_rm_ctrl_push+0x40/0x130 [nvkm]
    [  549.478422]  nvidia_grid_init_vgpu_types+0xbc/0xe0 [nvkm]
    [  549.483899]  nvidia_grid_init+0xb1/0xd0 [nvkm]
    [  549.488420]  ? srso_alias_return_thunk+0x5/0xfbef5
    [  549.493213]  nvkm_device_pci_probe+0x305/0x420 [nvkm]
    [  549.498338]  local_pci_probe+0x46/0xa0
    [  549.502096]  pci_call_probe+0x56/0x170
    [  549.505851]  pci_device_probe+0x79/0xf0
    [  549.509690]  ? driver_sysfs_add+0x59/0xc0
    [  549.513702]  really_probe+0xd9/0x380
    [  549.517282]  __driver_probe_device+0x78/0x150
    [  549.521640]  driver_probe_device+0x1e/0x90
    [  549.525746]  __driver_attach+0xd2/0x1c0
    [  549.529594]  ? __pfx___driver_attach+0x10/0x10
    [  549.534045]  bus_for_each_dev+0x78/0xd0
    [  549.537893]  bus_add_driver+0x112/0x210
    [  549.541750]  driver_register+0x5c/0x120
    [  549.545596]  ? __pfx_nvkm_init+0x10/0x10 [nvkm]
    [  549.550224]  do_one_initcall+0x44/0x300
    [  549.554063]  ? do_init_module+0x23/0x240
    [  549.557989]  do_init_module+0x64/0x240
    
    Calculate the available buffer page before rolling back based on
    the result from the waiting.
    
    Signed-off-by: Zhi Wang <[email protected]>
    Signed-off-by: Danilo Krummrich <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
nvme-fc: use ctrl state getter [+ + +]
Author: Daniel Wagner <[email protected]>
Date:   Tue Jan 28 17:34:47 2025 +0100

    nvme-fc: use ctrl state getter
    
    [ Upstream commit c8ed6cb5d37bc09c7e25e49a670e9fd1a3bd1dfa ]
    
    Do not access the state variable directly, instead use proper
    synchronization so not stale data is read.
    
    Fixes: e6e7f7ac03e4 ("nvme: ensure reset state check ordering")
    Signed-off-by: Daniel Wagner <[email protected]>
    Reviewed-by: Christoph Hellwig <[email protected]>
    Reviewed-by: Sagi Grimberg <[email protected]>
    Signed-off-by: Keith Busch <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
nvme-pci: Add TUXEDO IBP Gen9 to Samsung sleep quirk [+ + +]
Author: Georg Gottleuber <[email protected]>
Date:   Mon Dec 16 23:28:04 2024 +0100

    nvme-pci: Add TUXEDO IBP Gen9 to Samsung sleep quirk
    
    commit 11cb3529d18514f7d28ad2190533192aedefd761 upstream.
    
    On the TUXEDO InfinityBook Pro Gen9 Intel, a Samsung 990 Evo NVMe leads to
    a high power consumption in s2idle sleep (4 watts).
    
    This patch applies 'Force No Simple Suspend' quirk to achieve a sleep with
    a lower power consumption, typically around 1.2 watts.
    
    Signed-off-by: Georg Gottleuber <[email protected]>
    Cc: [email protected]
    Signed-off-by: Werner Sembach <[email protected]>
    Reviewed-by: Christoph Hellwig <[email protected]>
    Signed-off-by: Keith Busch <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

nvme-pci: Add TUXEDO InfinityFlex to Samsung sleep quirk [+ + +]
Author: Georg Gottleuber <[email protected]>
Date:   Mon Dec 16 23:28:03 2024 +0100

    nvme-pci: Add TUXEDO InfinityFlex to Samsung sleep quirk
    
    commit dbf2bb1a1319b7c7d8828905378a6696cca6b0f2 upstream.
    
    On the TUXEDO InfinityFlex, a Samsung 990 Evo NVMe leads to a high power
    consumption in s2idle sleep (4 watts).
    
    This patch applies 'Force No Simple Suspend' quirk to achieve a sleep with
    a lower power consumption, typically around 1.4 watts.
    
    Signed-off-by: Georg Gottleuber <[email protected]>
    Cc: [email protected]
    Signed-off-by: Werner Sembach <[email protected]>
    Reviewed-by: Christoph Hellwig <[email protected]>
    Signed-off-by: Keith Busch <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
nvme: handle connectivity loss in nvme_set_queue_count [+ + +]
Author: Daniel Wagner <[email protected]>
Date:   Thu Jan 9 14:30:48 2025 +0100

    nvme: handle connectivity loss in nvme_set_queue_count
    
    [ Upstream commit 294b2b7516fd06a8dd82e4a6118f318ec521e706 ]
    
    When the set feature attempts fails with any NVME status code set in
    nvme_set_queue_count, the function still report success. Though the
    numbers of queues set to 0. This is done to support controllers in
    degraded state (the admin queue is still up and running but no IO
    queues).
    
    Though there is an exception. When nvme_set_features reports an host
    path error, nvme_set_queue_count should propagate this error as the
    connectivity is lost, which means also the admin queue is not working
    anymore.
    
    Fixes: 9a0be7abb62f ("nvme: refactor set_queue_count")
    Reviewed-by: Christoph Hellwig <[email protected]>
    Reviewed-by: Hannes Reinecke <[email protected]>
    Reviewed-by: Sagi Grimberg <[email protected]>
    Signed-off-by: Daniel Wagner <[email protected]>
    Signed-off-by: Keith Busch <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

nvme: make nvme_tls_attrs_group static [+ + +]
Author: Keith Busch <[email protected]>
Date:   Tue Jan 28 07:22:31 2025 -0800

    nvme: make nvme_tls_attrs_group static
    
    [ Upstream commit 2d1a2dab95cdc6f2e0c6af3c0514b0bea94af482 ]
    
    To suppress the compiler "warning: symbol 'nvme_tls_attrs_group' was not
    declared. Should it be static?"
    
    Fixes: 1e48b34c9bc79a ("nvme: split off TLS sysfs attributes into a separate group")
    Reviewed-by: Christoph Hellwig <[email protected]>
    Reviewed-by: Sagi Grimberg <[email protected]>
    Signed-off-by: Keith Busch <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
nvmem: core: improve range check for nvmem_cell_write() [+ + +]
Author: Jennifer Berringer <[email protected]>
Date:   Mon Dec 30 14:19:01 2024 +0000

    nvmem: core: improve range check for nvmem_cell_write()
    
    commit 31507fc2ad36e0071751a710449db19c85d82a7f upstream.
    
    When __nvmem_cell_entry_write() is called for an nvmem cell that does
    not need bit shifting, it requires that the len parameter exactly
    matches the nvmem cell size. However, when the nvmem cell has a nonzero
    bit_offset, it was skipping this check.
    
    Accepting values of len larger than the cell size results in
    nvmem_cell_prepare_write_buffer() trying to write past the end of a heap
    buffer that it allocates. Add a check to avoid that problem and instead
    return -EINVAL when len doesn't match the number of bits expected by the
    nvmem cell when bit_offset is nonzero.
    
    This check uses cell->nbits in order to allow providing the smaller size
    to cells that are shifted into another byte by bit_offset. For example,
    a cell with nbits=8 and nonzero bit_offset would have bytes=2 but should
    accept a 1-byte write here, although no current callers depend on this.
    
    Fixes: 69aba7948cbe ("nvmem: Add a simple NVMEM framework for consumers")
    Cc: [email protected]
    Signed-off-by: Jennifer Berringer <[email protected]>
    Signed-off-by: Srinivas Kandagatla <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

nvmem: imx-ocotp-ele: fix MAC address byte order [+ + +]
Author: Sascha Hauer <[email protected]>
Date:   Mon Dec 30 14:18:58 2024 +0000

    nvmem: imx-ocotp-ele: fix MAC address byte order
    
    commit 391b06ecb63e6eacd054582cb4eb738dfbf5eb77 upstream.
    
    According to the i.MX93 Fusemap the two MAC addresses are stored in
    words 315 to 317 like this:
    
    315     MAC1_ADDR_31_0[31:0]
    316     MAC1_ADDR_47_32[47:32]
            MAC2_ADDR_15_0[15:0]
    317     MAC2_ADDR_47_16[31:0]
    
    This means the MAC addresses are stored in reverse byte order. We have
    to swap the bytes before passing them to the upper layers. The storage
    format is consistent to the one used on i.MX6 using imx-ocotp driver
    which does the same byte swapping as introduced here.
    
    With this patch the MAC address on my i.MX93 TQ board correctly reads as
    00:d0:93:6b:27:b8 instead of b8:27:6b:93:d0:00.
    
    Fixes: 22e9e6fcfb50 ("nvmem: imx: support i.MX93 OCOTP")
    Signed-off-by: Sascha Hauer <[email protected]>
    Cc: stable <[email protected]>
    Reviewed-by: Peng Fan <[email protected]>
    Signed-off-by: Srinivas Kandagatla <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

nvmem: imx-ocotp-ele: fix reading from non zero offset [+ + +]
Author: Sascha Hauer <[email protected]>
Date:   Mon Dec 30 14:18:57 2024 +0000

    nvmem: imx-ocotp-ele: fix reading from non zero offset
    
    commit 3c9e2cb6cecf65f7501004038c5d1ed85fb7db84 upstream.
    
    In imx_ocotp_reg_read() the offset comes in as bytes and not as words.
    This means we have to divide offset by 4 to get to the correct word
    offset.
    
    Also the incoming offset might not be word aligned. In order to read
    from the OCOTP the driver aligns down the previous word boundary and
    reads from there. This means we have to skip this alignment offset from
    the temporary buffer when copying the data to the output buffer.
    
    Fixes: 22e9e6fcfb50 ("nvmem: imx: support i.MX93 OCOTP")
    Signed-off-by: Sascha Hauer <[email protected]>
    Cc: stable <[email protected]>
    Reviewed-by: Peng Fan <[email protected]>
    Signed-off-by: Srinivas Kandagatla <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

nvmem: imx-ocotp-ele: set word length to 1 [+ + +]
Author: Sascha Hauer <[email protected]>
Date:   Mon Dec 30 14:18:59 2024 +0000

    nvmem: imx-ocotp-ele: set word length to 1
    
    commit 1b2cb4d0b5b6a9d9fe78470704309ec75f8a1c3a upstream.
    
    The ELE hardware internally has a word length of 4. However, among other
    things we store MAC addresses in the ELE OCOTP. With a length of 6 bytes
    these are naturally unaligned to the word length. Therefore we must
    support unaligned reads in reg_read() and indeed it works properly when
    reg_read() is called via nvmem_reg_read(). Setting the word size to 4
    has the only visible effect that doing unaligned reads from userspace
    via bin_attr_nvmem_read() do not work because they are rejected by that
    function.
    
    Given that we have to abstract from word accesses to byte accesses in
    the driver, set the word size to 1. This allows bytewise accesses from
    userspace to be able to test what the driver has to support anyway.
    
    Fixes: 22e9e6fcfb50 ("nvmem: imx: support i.MX93 OCOTP")
    Signed-off-by: Sascha Hauer <[email protected]>
    Cc: stable <[email protected]>
    Reviewed-by: Peng Fan <[email protected]>
    Signed-off-by: Srinivas Kandagatla <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

nvmem: imx-ocotp-ele: simplify read beyond device check [+ + +]
Author: Sascha Hauer <[email protected]>
Date:   Mon Dec 30 14:18:56 2024 +0000

    nvmem: imx-ocotp-ele: simplify read beyond device check
    
    commit 343aa1e289e8e3dba5e3d054c4eb27da7b4e1ecc upstream.
    
    Do the read beyond device check on function entry in bytes instead of
    32bit words which is easier to follow.
    
    Fixes: 22e9e6fcfb50 ("nvmem: imx: support i.MX93 OCOTP")
    Signed-off-by: Sascha Hauer <[email protected]>
    Cc: stable <[email protected]>
    Reviewed-by: Peng Fan <[email protected]>
    Signed-off-by: Srinivas Kandagatla <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

nvmem: qcom-spmi-sdam: Set size in struct nvmem_config [+ + +]
Author: Luca Weiss <[email protected]>
Date:   Mon Dec 30 14:19:00 2024 +0000

    nvmem: qcom-spmi-sdam: Set size in struct nvmem_config
    
    commit e88f516ea417c71bb3702603ac6af9e95338cfa6 upstream.
    
    Let the nvmem core know what size the SDAM is, most notably this fixes
    the size of /sys/bus/nvmem/devices/spmi_sdam*/nvmem being '0' and makes
    user space work with that file.
    
      ~ # hexdump -C -s 64 /sys/bus/nvmem/devices/spmi_sdam2/nvmem
      00000040  02 01 00 00 04 00 00 00  00 00 00 00 00 00 00 00  |................|
      00000050  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
      *
      00000080
    
    Fixes: 40ce9798794f ("nvmem: add QTI SDAM driver")
    Cc: [email protected]
    Signed-off-by: Luca Weiss <[email protected]>
    Reviewed-by: Vladimir Zapolskiy <[email protected]>
    Signed-off-by: Srinivas Kandagatla <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
nvmet: fix a memory leak in controller identify [+ + +]
Author: Sagi Grimberg <[email protected]>
Date:   Fri Jan 24 13:00:33 2025 +0200

    nvmet: fix a memory leak in controller identify
    
    [ Upstream commit 58f5c8d5ca07a2f9fa93fb073f5b1646ec482ff2 ]
    
    Simply free an allocated buffer once we copied its content
    to the request sgl.
    
    kmemleak complaint:
    unreferenced object 0xffff8cd40c388000 (size 4096):
      comm "kworker/2:2H", pid 14739, jiffies 4401313113
      hex dump (first 32 bytes):
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      backtrace (crc 0):
        [<ffffffff9e01087a>] kmemleak_alloc+0x4a/0x90
        [<ffffffff9d30324a>] __kmalloc_cache_noprof+0x35a/0x420
        [<ffffffffc180b0e2>] nvmet_execute_identify+0x912/0x9f0 [nvmet]
        [<ffffffffc181a72c>] nvmet_tcp_try_recv_pdu+0x84c/0xc90 [nvmet_tcp]
        [<ffffffffc181ac02>] nvmet_tcp_io_work+0x82/0x8b0 [nvmet_tcp]
        [<ffffffff9cfa7158>] process_one_work+0x178/0x3e0
        [<ffffffff9cfa8e9c>] worker_thread+0x2ec/0x420
        [<ffffffff9cfb2140>] kthread+0xf0/0x120
        [<ffffffff9cee36a4>] ret_from_fork+0x44/0x70
        [<ffffffff9ce7fdda>] ret_from_fork_asm+0x1a/0x30
    
    Fixes: 84909f7decbd ("nvmet: use kzalloc instead of ZERO_PAGE in nvme_execute_identify_ns_nvm()")
    Signed-off-by: Sagi Grimberg <[email protected]>
    Reviewed-by: Nilay Shroff <[email protected]>
    Signed-off-by: Keith Busch <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
ocfs2: fix incorrect CPU endianness conversion causing mount failure [+ + +]
Author: Heming Zhao <[email protected]>
Date:   Tue Jan 21 19:22:03 2025 +0800

    ocfs2: fix incorrect CPU endianness conversion causing mount failure
    
    commit f921da2c34692dfec5f72b5ae347b1bea22bb369 upstream.
    
    Commit 23aab037106d ("ocfs2: fix UBSAN warning in ocfs2_verify_volume()")
    introduced a regression bug.  The blksz_bits value is already converted to
    CPU endian in the previous code; therefore, the code shouldn't use
    le32_to_cpu() anymore.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 23aab037106d ("ocfs2: fix UBSAN warning in ocfs2_verify_volume()")
    Signed-off-by: Heming Zhao <[email protected]>
    Reviewed-by: Joseph Qi <[email protected]>
    Cc: Mark Fasheh <[email protected]>
    Cc: Joel Becker <[email protected]>
    Cc: Junxiao Bi <[email protected]>
    Cc: Changwei Ge <[email protected]>
    Cc: Jun Piao <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ocfs2: handle a symlink read error correctly [+ + +]
Author: Matthew Wilcox (Oracle) <[email protected]>
Date:   Thu Dec 5 17:16:29 2024 +0000

    ocfs2: handle a symlink read error correctly
    
    commit 2b4c2094da6d84e69b843dd3317902e977bf64bd upstream.
    
    Patch series "Convert ocfs2 to use folios".
    
    Mark did a conversion of ocfs2 to use folios and sent it to me as a
    giant patch for review ;-)
    
    So I've redone it as individual patches, and credited Mark for the patches
    where his code is substantially the same.  It's not a bad way to do it;
    his patch had some bugs and my patches had some bugs.  Hopefully all our
    bugs were different from each other.  And hopefully Mark likes all the
    changes I made to his code!
    
    
    This patch (of 23):
    
    If we can't read the buffer, be sure to unlock the page before returning.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
    Reviewed-by: Joseph Qi <[email protected]>
    Cc: Mark Fasheh <[email protected]>
    Cc: Joel Becker <[email protected]>
    Cc: Junxiao Bi <[email protected]>
    Cc: Changwei Ge <[email protected]>
    Cc: Jun Piao <[email protected]>
    Cc: Mark Tinguely <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
octeon_ep: update tx/rx stats locally for persistence [+ + +]
Author: Shinas Rasheed <[email protected]>
Date:   Fri Jan 17 01:46:51 2025 -0800

    octeon_ep: update tx/rx stats locally for persistence
    
    [ Upstream commit 10fad79846e49f67ad1a0a05910837125c6ca9ad ]
    
    Update tx/rx stats locally, so that ndo_get_stats64()
    can use that and not rely on per queue resources to obtain statistics.
    The latter used to cause race conditions when the device stopped.
    
    Signed-off-by: Shinas Rasheed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
octeon_ep_vf: update tx/rx stats locally for persistence [+ + +]
Author: Shinas Rasheed <[email protected]>
Date:   Fri Jan 17 01:46:53 2025 -0800

    octeon_ep_vf: update tx/rx stats locally for persistence
    
    [ Upstream commit f84039939512e6d88b0f2f353695530f123be789 ]
    
    Update tx/rx stats locally, so that ndo_get_stats64()
    can use that and not rely on per queue resources to obtain statistics.
    The latter used to cause race conditions when the device stopped.
    
    Signed-off-by: Shinas Rasheed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
of: address: Fix empty resource handling in __of_address_resource_bounds() [+ + +]
Author: Thomas Weißschuh <[email protected]>
Date:   Mon Jan 20 15:09:40 2025 +0100

    of: address: Fix empty resource handling in __of_address_resource_bounds()
    
    commit 15e2f65f2ecfeb8e39315522e2b5cfdc5651fc10 upstream.
    
    "resource->end" needs to always be equal to "resource->start + size - 1".
    The previous version of the function did not perform the "- 1" in case
    of an empty resource.
    
    Also make sure to allow an empty resource at address 0.
    
    Reported-by: Basharath Hussain Khaja <[email protected]>
    Closes: https://lore.kernel.org/lkml/[email protected]/
    Fixes: 1a52a094c2f0 ("of: address: Unify resource bounds overflow checking")
    Cc: [email protected]
    Signed-off-by: Thomas Weißschuh <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Rob Herring (Arm) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

of: Correct child specifier used as input of the 2nd nexus node [+ + +]
Author: Zijun Hu <[email protected]>
Date:   Thu Jan 9 21:26:52 2025 +0800

    of: Correct child specifier used as input of the 2nd nexus node
    
    commit e4c00c9b1f70cd11792ff5b825899a6ee0234a62 upstream.
    
    API of_parse_phandle_with_args_map() will use wrong input for nexus node
    Nexus_2 as shown below:
    
        Node_1              Nexus_1                              Nexus_2
    &Nexus_1,arg_1 -> arg_1,&Nexus_2,arg_2' -> &Nexus_2,arg_2 -> arg_2,...
                      map-pass-thru=<...>
    
    Nexus_1's output arg_2 should be used as input of Nexus_2, but the API
    wrongly uses arg_2' instead which != arg_2 due to Nexus_1's map-pass-thru.
    
    Fix by always making @match_array point to @initial_match_array into
    which to store nexus output.
    
    Fixes: bd6f2fd5a1d5 ("of: Support parsing phandle argument lists through a nexus node")
    Cc: [email protected]
    Signed-off-by: Zijun Hu <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Rob Herring (Arm) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

of: Fix of_find_node_opts_by_path() handling of alias+path+options [+ + +]
Author: Zijun Hu <[email protected]>
Date:   Mon Dec 16 08:40:40 2024 +0800

    of: Fix of_find_node_opts_by_path() handling of alias+path+options
    
    commit b9e58c934c56aa35b0fb436d9afd86ef326bae0e upstream.
    
    of_find_node_opts_by_path() fails to find OF device node when its
    @path parameter have pattern below:
    
    "alias-name/node-name-1/.../node-name-N:options".
    
    The reason is that alias name length calculated by the API is wrong, as
    explained by example below:
    
    "testcase-alias/phandle-tests/consumer-a:testaliasoption".
     ^             ^                        ^
     0             14                       39
    
    The right length of alias 'testcase-alias' is 14, but the result worked
    out by the API is 39 which is obvious wrong.
    
    Fix by using index of either '/' or ':' as the length who comes earlier.
    
    Fixes: 75c28c09af99 ("of: add optional options parameter to of_find_node_by_path()")
    Cc: [email protected]
    Signed-off-by: Zijun Hu <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Rob Herring (Arm) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

of: reserved-memory: Fix using wrong number of cells to get property 'alignment' [+ + +]
Author: Zijun Hu <[email protected]>
Date:   Thu Jan 9 21:27:00 2025 +0800

    of: reserved-memory: Fix using wrong number of cells to get property 'alignment'
    
    commit 267b21d0bef8e67dbe6c591c9991444e58237ec9 upstream.
    
    According to DT spec, size of property 'alignment' is based on parent
    node’s #size-cells property.
    
    But __reserved_mem_alloc_size() wrongly uses @dt_root_addr_cells to get
    the property obviously.
    
    Fix by using @dt_root_size_cells instead of @dt_root_addr_cells.
    
    Fixes: 3f0c82066448 ("drivers: of: add initialization code for dynamic reserved memory")
    Cc: [email protected]
    Signed-off-by: Zijun Hu <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Rob Herring (Arm) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

of: reserved-memory: Warn for missing static reserved memory regions [+ + +]
Author: Zijun Hu <[email protected]>
Date:   Tue Jan 14 23:23:04 2025 +0800

    of: reserved-memory: Warn for missing static reserved memory regions
    
    commit 81dfedd5234b42df11a473eefe7328ea4a0416ad upstream.
    
    For child node of /reserved-memory, its property 'reg' may contain
    multiple regions, but fdt_scan_reserved_mem_reg_nodes() only takes
    into account the first region, and miss remaining regions.
    
    But there are no simple approach to fix it, so give user warning
    message when miss remaining regions.
    
    Fixes: 8a6e02d0c00e ("of: reserved_mem: Restructure how the reserved memory regions are processed")
    Cc: [email protected]
    Signed-off-by: Zijun Hu <[email protected]>
    Reviewed-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Rob Herring (Arm) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
parisc: Temporarily disable jump label support [+ + +]
Author: Helge Deller <[email protected]>
Date:   Thu Jan 16 21:17:47 2025 +0100

    parisc: Temporarily disable jump label support
    
    commit 3599bae489d86fbabe039f9a2ab5472ffb04f7f1 upstream.
    
    The 32-bit Debian kernel 6.12 fails to boot and crashes like this:
    
     init (pid 65): Protection id trap (code 7)
     CPU: 0 UID: 0 PID: 65 Comm: init Not tainted 6.12.9 #2
     Hardware name: 9000/778/B160L
    
          YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
     PSW: 00000000000001000000000000001111 Not tainted
     r00-03  0004000f 110d39d0 109a6558 12974400
     r04-07  12a810e0 12a810e0 00000000 12a81144
     r08-11  12a81174 00000007 00000000 00000002
     r12-15  f8c55c08 0000006c 00000001 f8c55c08
     r16-19  00000002 f8c58620 002da3a8 0000004e
     r20-23  00001a46 0000000f 10754f84 00000000
     r24-27  00000000 00000003 12ae6980 1127b9d0
     r28-31  00000000 00000000 12974440 109a6558
     sr00-03  00000000 00000000 00000000 00000010
     sr04-07  00000000 00000000 00000000 00000000
    
     IASQ: 00000000 00000000 IAOQ: 110d39d0 110d39d4
      IIR: baadf00d    ISR: 00000000  IOR: 110d39d0
      CPU:        0   CR30: 128740c0 CR31: 00000000
      ORIG_R28: 000003f3
      IAOQ[0]: 0x110d39d0
      IAOQ[1]: 0x110d39d4
      RP(r2): security_sk_free+0x70/0x1a4
     Backtrace:
      [<10d8c844>] __sk_destruct+0x2bc/0x378
      [<10d8e33c>] sk_destruct+0x68/0x8c
      [<10d8e3dc>] __sk_free+0x7c/0x148
      [<10d8e560>] sk_free+0xb8/0xf0
      [<10f6420c>] unix_release_sock+0x3ac/0x50c
      [<10f643b8>] unix_release+0x4c/0x7c
      [<10d832f8>] __sock_release+0x5c/0xf8
      [<10d833b4>] sock_close+0x20/0x44
      [<107ba52c>] __fput+0xf8/0x468
      [<107baa08>] __fput_sync+0xb4/0xd4
      [<107b471c>] sys_close+0x44/0x94
      [<10405334>] syscall_exit+0x0/0x10
    
    Bisecting points to this commit which triggers the issue:
            commit  417c5643cd67a55f424b203b492082035d0236c3
            Author: KP Singh <[email protected]>
            Date:   Fri Aug 16 17:43:07 2024 +0200
                    lsm: replace indirect LSM hook calls with static calls
    
    After more analysis it seems that we don't fully implement the static calls
    and jump tables yet. Additionally the functions which mark kernel memory
    read-only or read-write-executable needs to be further enhanced to be able to
    fully support static calls.
    
    Enabling CONFIG_SECURITY_YAMA=y was one possibility to trigger the issue,
    although YAMA isn't the reason for the fault.
    
    As a temporary solution disable JUMP_LABEL functionality to
    avoid the crashes.
    
    Signed-off-by: Helge Deller <[email protected]>
    Cc: Guenter Roeck <[email protected]>
    Reviewed-by: Guenter Roeck <[email protected]>
    Cc: <[email protected]> # v6.12+
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
PCI/TPH: Restore TPH Requester Enable correctly [+ + +]
Author: Robin Murphy <[email protected]>
Date:   Wed Feb 5 12:52:13 2025 +0000

    PCI/TPH: Restore TPH Requester Enable correctly
    
    [ Upstream commit 6f64b83d9fe9729000a0616830cb1606945465d8 ]
    
    When we reenable TPH after changing a Steering Tag value, we need the
    actual TPH Requester Enable value, not the ST Mode (which only happens to
    work out by chance for non-extended TPH in interrupt vector mode).
    
    Link: https://lore.kernel.org/r/13118098116d7bce07aa20b8c52e28c7d1847246.1738759933.git.robin.murphy@arm.com
    Fixes: d2e8a34876ce ("PCI/TPH: Add Steering Tag support")
    Signed-off-by: Robin Murphy <[email protected]>
    Signed-off-by: Bjorn Helgaas <[email protected]>
    Reviewed-by: Wei Huang <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
PCI: Avoid putting some root ports into D3 on TUXEDO Sirius Gen1 [+ + +]
Author: Werner Sembach <[email protected]>
Date:   Tue Jan 14 23:23:54 2025 +0100

    PCI: Avoid putting some root ports into D3 on TUXEDO Sirius Gen1
    
    commit b1049f2d68693c80a576c4578d96774a68df2bad upstream.
    
    commit 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend") sets the
    policy that all PCIe ports are allowed to use D3.  When the system is
    suspended if the port is not power manageable by the platform and won't be
    used for wakeup via a PME this sets up the policy for these ports to go
    into D3hot.
    
    This policy generally makes sense from an OSPM perspective but it leads to
    problems with wakeup from suspend on the TUXEDO Sirius 16 Gen 1 with a
    specific old BIOS. This manifests as a system hang.
    
    On the affected Device + BIOS combination, add a quirk for the root port of
    the problematic controller to ensure that these root ports are not put into
    D3hot at suspend.
    
    This patch is based on
    
      https://lore.kernel.org/linux-pci/[email protected]
    
    but with the added condition both in the documentation and in the code to
    apply only to the TUXEDO Sirius 16 Gen 1 with a specific old BIOS and only
    the affected root ports.
    
    Fixes: 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend")
    Suggested-by: Mario Limonciello <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Co-developed-by: Georg Gottleuber <[email protected]>
    Signed-off-by: Georg Gottleuber <[email protected]>
    Signed-off-by: Werner Sembach <[email protected]>
    Signed-off-by: Krzysztof Wilczyński <[email protected]>
    Cc: <[email protected]> # 6.1+
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

PCI: dwc: ep: Prevent changing BAR size/flags in pci_epc_set_bar() [+ + +]
Author: Niklas Cassel <[email protected]>
Date:   Fri Dec 13 15:33:03 2024 +0100

    PCI: dwc: ep: Prevent changing BAR size/flags in pci_epc_set_bar()
    
    commit 3708acbd5f169ebafe1faa519cb28adc56295546 upstream.
    
    In commit 4284c88fff0e ("PCI: designware-ep: Allow pci_epc_set_bar() update
    inbound map address") set_bar() was modified to support dynamically
    changing the backing physical address of a BAR that was already configured.
    
    This means that set_bar() can be called twice, without ever calling
    clear_bar() (as calling clear_bar() would clear the BAR's PCI address
    assigned by the host).
    
    This can only be done if the new BAR size/flags does not differ from the
    existing BAR configuration. Add these missing checks.
    
    If we allow set_bar() to set e.g. a new BAR size that differs from the
    existing BAR size, the new address translation range will be smaller than
    the BAR size already determined by the host, which would mean that a read
    past the new BAR size would pass the iATU untranslated, which could allow
    the host to read memory not belonging to the new struct pci_epf_bar.
    
    While at it, add comments which clarifies the support for dynamically
    changing the physical address of a BAR. (Which was also missing.)
    
    Fixes: 4284c88fff0e ("PCI: designware-ep: Allow pci_epc_set_bar() update inbound map address")
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Niklas Cassel <[email protected]>
    Signed-off-by: Krzysztof Wilczyński <[email protected]>
    Reviewed-by: Manivannan Sadhasivam <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

PCI: dwc: ep: Write BAR_MASK before iATU registers in pci_epc_set_bar() [+ + +]
Author: Niklas Cassel <[email protected]>
Date:   Fri Dec 13 15:33:02 2024 +0100

    PCI: dwc: ep: Write BAR_MASK before iATU registers in pci_epc_set_bar()
    
    commit 33a6938e0c3373f2d11f92d098f337668cd64fdd upstream.
    
    The "DesignWare Cores PCI Express Controller Register Descriptions,
    Version 4.60a", section "1.21.70 IATU_LWR_TARGET_ADDR_OFF_INBOUND_i",
    fields LWR_TARGET_RW and LWR_TARGET_HW both state that:
    "Field size depends on log2(BAR_MASK+1) in BAR match mode."
    
    I.e. only the upper bits are writable, and the number of writable bits is
    dependent on the configured BAR_MASK.
    
    If we do not write the BAR_MASK before writing the iATU registers, we are
    relying the reset value of the BAR_MASK being larger than the requested
    BAR size (which is supplied in the struct pci_epf_bar which is passed to
    pci_epc_set_bar()). The reset value of the BAR_MASK is SoC dependent.
    
    Thus, if the struct pci_epf_bar requests a BAR size that is larger than the
    reset value of the BAR_MASK, the iATU will try to write to read-only bits,
    which will cause the iATU to end up redirecting to a physical address that
    is different from the address that was intended.
    
    Thus, we should always write the iATU registers after writing the BAR_MASK.
    
    Fixes: f8aed6ec624f ("PCI: dwc: designware: Add EP mode support")
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Niklas Cassel <[email protected]>
    Signed-off-by: Krzysztof Wilczyński <[email protected]>
    Reviewed-by: Manivannan Sadhasivam <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

PCI: endpoint: Finish virtual EP removal in pci_epf_remove_vepf() [+ + +]
Author: Zijun Hu <[email protected]>
Date:   Tue Dec 10 22:00:20 2024 +0800

    PCI: endpoint: Finish virtual EP removal in pci_epf_remove_vepf()
    
    commit 3b9f942eb21c92041905e3943a8d5177c9a9d89d upstream.
    
    When removing a virtual Endpoint, pci_epf_remove_vepf() failed to clear
    epf_vf->epf_pf, which caused a subsequent pci_epf_add_vepf() to incorrectly
    return -EBUSY:
    
      pci_epf_add_vepf(epf_pf, epf_vf)      // add
      pci_epf_remove_vepf(epf_pf, epf_vf)   // remove
      pci_epf_add_vepf(epf_pf, epf_vf)      // add again, -EBUSY error
    
    Fix by clearing epf_vf->epf_pf in pci_epf_remove_vepf().
    
    Link: https://lore.kernel.org/r/[email protected]
    Fixes: 1cf362e907f3 ("PCI: endpoint: Add support to add virtual function in endpoint core")
    Signed-off-by: Zijun Hu <[email protected]>
    Signed-off-by: Bjorn Helgaas <[email protected]>
    Reviewed-by: Frank Li <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
perf bench: Fix undefined behavior in cmpworker() [+ + +]
Author: Kuan-Wei Chiu <[email protected]>
Date:   Thu Jan 16 19:08:42 2025 +0800

    perf bench: Fix undefined behavior in cmpworker()
    
    commit 62892e77b8a64b9dc0e1da75980aa145347b6820 upstream.
    
    The comparison function cmpworker() violates the C standard's
    requirements for qsort() comparison functions, which mandate symmetry
    and transitivity:
    
    Symmetry: If x < y, then y > x.
    Transitivity: If x < y and y < z, then x < z.
    
    In its current implementation, cmpworker() incorrectly returns 0 when
    w1->tid < w2->tid, which breaks both symmetry and transitivity. This
    violation causes undefined behavior, potentially leading to issues such
    as memory corruption in glibc [1].
    
    Fix the issue by returning -1 when w1->tid < w2->tid, ensuring
    compliance with the C standard and preventing undefined behavior.
    
    Link: https://www.qualys.com/2024/01/30/qsort.txt [1]
    Fixes: 121dd9ea0116 ("perf bench: Add epoll parallel epoll_wait benchmark")
    Cc: [email protected]
    Signed-off-by: Kuan-Wei Chiu <[email protected]>
    Reviewed-by: James Clark <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Namhyung Kim <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
perf: imx9_perf: Introduce AXI filter version to refactor the driver and better extension [+ + +]
Author: Xu Yang <[email protected]>
Date:   Thu Dec 12 14:57:08 2024 +0800

    perf: imx9_perf: Introduce AXI filter version to refactor the driver and better extension
    
    commit f3edf03a4c59e59e52c0c1fd958f64a76a038302 upstream.
    
    The imx93 is the first supported DDR PMU that supports read transaction,
    write transaction and read beats events which corresponding respecitively
    to counter 2, 3 and 4.
    
    However, transaction-based AXI match has low accuracy when get total bits
    compared to beats-based. And imx93 doesn't assign AXI_ID to each master.
    So axi filter is not used widely on imx93. This could be regards as AXI
    filter version 1.
    
    To improve the AXI filter capability, imx95 supports 1 read beats and 3
    write beats event which corresponding respecitively to counter 2-5. imx95
    also detailed AXI_ID allocation so that most of the master could be count
    individually. This could be regards as AXI filter version 2.
    
    This will introduce AXI filter version to refactor the driver and support
    better extension, such as coming imx943. This is also a potential fix on
    imx91 when configure axi filter.
    
    Fixes: 44798fe136dc ("perf: imx_perf: add support for i.MX91 platform")
    Cc: [email protected]
    Reviewed-by: Frank Li <[email protected]>
    Signed-off-by: Xu Yang <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Will Deacon <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
pfifo_tail_enqueue: Drop new packet when sch->limit == 0 [+ + +]
Author: Quang Le <[email protected]>
Date:   Mon Feb 3 16:58:38 2025 -0800

    pfifo_tail_enqueue: Drop new packet when sch->limit == 0
    
    [ Upstream commit 647cef20e649c576dff271e018d5d15d998b629d ]
    
    Expected behaviour:
    In case we reach scheduler's limit, pfifo_tail_enqueue() will drop a
    packet in scheduler's queue and decrease scheduler's qlen by one.
    Then, pfifo_tail_enqueue() enqueue new packet and increase
    scheduler's qlen by one. Finally, pfifo_tail_enqueue() return
    `NET_XMIT_CN` status code.
    
    Weird behaviour:
    In case we set `sch->limit == 0` and trigger pfifo_tail_enqueue() on a
    scheduler that has no packet, the 'drop a packet' step will do nothing.
    This means the scheduler's qlen still has value equal 0.
    Then, we continue to enqueue new packet and increase scheduler's qlen by
    one. In summary, we can leverage pfifo_tail_enqueue() to increase qlen by
    one and return `NET_XMIT_CN` status code.
    
    The problem is:
    Let's say we have two qdiscs: Qdisc_A and Qdisc_B.
     - Qdisc_A's type must have '->graft()' function to create parent/child relationship.
       Let's say Qdisc_A's type is `hfsc`. Enqueue packet to this qdisc will trigger `hfsc_enqueue`.
     - Qdisc_B's type is pfifo_head_drop. Enqueue packet to this qdisc will trigger `pfifo_tail_enqueue`.
     - Qdisc_B is configured to have `sch->limit == 0`.
     - Qdisc_A is configured to route the enqueued's packet to Qdisc_B.
    
    Enqueue packet through Qdisc_A will lead to:
     - hfsc_enqueue(Qdisc_A) -> pfifo_tail_enqueue(Qdisc_B)
     - Qdisc_B->q.qlen += 1
     - pfifo_tail_enqueue() return `NET_XMIT_CN`
     - hfsc_enqueue() check for `NET_XMIT_SUCCESS` and see `NET_XMIT_CN` => hfsc_enqueue() don't increase qlen of Qdisc_A.
    
    The whole process lead to a situation where Qdisc_A->q.qlen == 0 and Qdisc_B->q.qlen == 1.
    Replace 'hfsc' with other type (for example: 'drr') still lead to the same problem.
    This violate the design where parent's qlen should equal to the sum of its childrens'qlen.
    
    Bug impact: This issue can be used for user->kernel privilege escalation when it is reachable.
    
    Fixes: 57dbb2d83d10 ("sched: add head drop fifo queue")
    Reported-by: Quang Le <[email protected]>
    Signed-off-by: Quang Le <[email protected]>
    Signed-off-by: Cong Wang <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
pidfs: check for valid ioctl commands [+ + +]
Author: Christian Brauner <[email protected]>
Date:   Fri Nov 29 21:16:37 2024 +0100

    pidfs: check for valid ioctl commands
    
    commit 8ce3528188207a2e1896cc3173fba6d99a59013a upstream.
    
    Prior to doing any work, check whether the provided ioctl command is
    supported by pidfs.
    
    Signed-off-by: Christian Brauner <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

pidfs: improve ioctl handling [+ + +]
Author: Christian Brauner <[email protected]>
Date:   Tue Feb 4 14:51:20 2025 +0100

    pidfs: improve ioctl handling
    
    commit 091ee63e36e8289f9067f659a48d497911e49d6f upstream.
    
    Pidfs supports extensible and non-extensible ioctls. The extensible
    ioctls need to check for the ioctl number itself not just the ioctl
    command otherwise both backward- and forward compatibility are broken.
    
    The pidfs ioctl handler also needs to look at the type of the ioctl
    command to guard against cases where "[...] a daemon receives some
    random file descriptor from a (potentially less privileged) client and
    expects the FD to be of some specific type, it might call ioctl() on
    this FD with some type-specific command and expect the call to fail if
    the FD is of the wrong type; but due to the missing type check, the
    kernel instead performs some action that userspace didn't expect."
    (cf. [1]]
    
    Link: https://lore.kernel.org/r/[email protected]
    Link: https://lore.kernel.org/r/CAG48ez2K9A5GwtgqO31u9ZL292we8ZwAA=TJwwEv7wRuJ3j4Lw@mail.gmail.com [1]
    Fixes: 8ce352818820 ("pidfs: check for valid ioctl commands")
    Acked-by: Luca Boccassi <[email protected]>
    Reported-by: Jann Horn <[email protected]>
    Cc: [email protected] # v6.13; please backport with 8ce352818820 ("pidfs: check for valid ioctl commands")
    Signed-off-by: Christian Brauner <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
pinctrl: renesas: rzg2l: Fix PFC_MASK for RZ/V2H and RZ/G3E [+ + +]
Author: Lad Prabhakar <[email protected]>
Date:   Fri Jan 10 22:10:45 2025 +0000

    pinctrl: renesas: rzg2l: Fix PFC_MASK for RZ/V2H and RZ/G3E
    
    commit accabfaae0940f9427c782bfee7340ce4c15151c upstream.
    
    The PFC_MASK value for the PFC_mx registers is currently hardcoded to
    0x07, which is correct for SoCs in the RZ/G2L family, but insufficient
    for RZ/V2H and RZ/G3E, where the mask value should be 0x0f.  This
    discrepancy causes incorrect PFC register configuration on RZ/V2H and
    RZ/G3E SoCs.
    
    On RZ/G2L, the PFC_mx bitfields are also 4 bits wide, with bit 4 marked
    as reserved.  The reserved bits are documented to read as zero and be
    ignored when written.  Updating the PFC_MASK definition from 0x07 to
    0x0f ensures compatibility with both SoC families while maintaining
    correct behavior on RZ/G2L.
    
    Fixes: 9bd95ac86e70 ("pinctrl: renesas: rzg2l: Add support for RZ/V2H SoC")
    Cc: [email protected]
    Reported-by: Hien Huynh <[email protected]>
    Signed-off-by: Lad Prabhakar <[email protected]>
    Reviewed-by: Geert Uytterhoeven <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Geert Uytterhoeven <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

pinctrl: samsung: fix fwnode refcount cleanup if platform_get_irq_optional() fails [+ + +]
Author: Javier Carrasco <[email protected]>
Date:   Wed Nov 6 23:04:39 2024 +0100

    pinctrl: samsung: fix fwnode refcount cleanup if platform_get_irq_optional() fails
    
    commit 459915f55509f4bfd6076daa1428e28490ddee3b upstream.
    
    Commit 50ebd19e3585 ("pinctrl: samsung: drop pin banks references on
    error paths") fixed the pin bank references on the error paths of the
    probe function, but there is still an error path where this is not done.
    
    If samsung_pinctrl_get_soc_data() does not fail, the child references
    will have acquired, and they will need to be released in the error path
    of platform_get_irq_optional(), as it is done in the following error
    paths within the probe function.
    
    Replace the direct return in the error path with a goto instruction to
    the cleanup function.
    
    Cc: [email protected]
    Fixes: a382d568f144 ("pinctrl: samsung: Use platform_get_irq_optional() to get the interrupt")
    Signed-off-by: Javier Carrasco <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    [krzysztof: change Fixes SHA to point to commit introducing the return
     leading to OF node leak]
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
platform/x86: acer-wmi: add support for Acer Nitro AN515-58 [+ + +]
Author: Hridesh MG <[email protected]>
Date:   Mon Jan 13 18:44:13 2025 +0530

    platform/x86: acer-wmi: add support for Acer Nitro AN515-58
    
    [ Upstream commit 549fcf58cf5837d401d0de906093169b05365609 ]
    
    Add predator_v4 quirk for the Acer Nitro AN515-58 to enable fan speed
    monitoring and platform_profile handling.
    
    Signed-off-by: Hridesh MG <[email protected]>
    Reviewed-by: Kurt Borja <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

platform/x86: acer-wmi: Add support for Acer PH14-51 [+ + +]
Author: Armin Wolf <[email protected]>
Date:   Tue Dec 10 01:16:53 2024 +0100

    platform/x86: acer-wmi: Add support for Acer PH14-51
    
    [ Upstream commit 9741f9aa13f6dc3ff24e1d006b2ced5f460e6b6f ]
    
    Add the Acer Predator PT14-51 to acer_quirks to provide support
    for the turbo button and predator_v4 hwmon interface.
    
    Reported-by: Rayan Margham <[email protected]>
    Closes: https://lore.kernel.org/platform-driver-x86/CACzB==6tUsCnr5musVMz-EymjTUCJfNtKzhMFYqMRU_h=kydXA@mail.gmail.com
    Tested-by: Rayan Margham <[email protected]>
    Signed-off-by: Armin Wolf <[email protected]>
    Reviewed-by: Kurt Borja <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

platform/x86: acer-wmi: Add support for Acer Predator PH16-72 [+ + +]
Author: Armin Wolf <[email protected]>
Date:   Tue Jan 7 18:56:52 2025 +0100

    platform/x86: acer-wmi: Add support for Acer Predator PH16-72
    
    [ Upstream commit c85b516b44d21e9cf751c4f73a6c235ed170d887 ]
    
    Add the Acer Predator PT16-72 to acer_quirks to provide support
    for the turbo button and predator_v4 interfaces.
    
    Tested-by: Eric Johnsten <[email protected]>
    Signed-off-by: Armin Wolf <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

platform/x86: acer-wmi: Ignore AC events [+ + +]
Author: Armin Wolf <[email protected]>
Date:   Sun Jan 19 21:17:22 2025 +0100

    platform/x86: acer-wmi: Ignore AC events
    
    [ Upstream commit f6bfa25c6665f8721421ea94fe506cc22f1d4b43 ]
    
    On the Acer Swift SFG14-41, the events 8 - 1 and 8 - 0 are printed on
    AC connect/disconnect. Ignore those events to avoid spamming the
    kernel log with error messages.
    
    Reported-by: Farhan Anwar <[email protected]>
    Closes: https://lore.kernel.org/platform-driver-x86/[email protected]
    Tested-by: Rayan Margham <[email protected]>
    Reviewed-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Armin Wolf <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

platform/x86: int3472: Check for adev == NULL [+ + +]
Author: Hans de Goede <[email protected]>
Date:   Mon Dec 9 23:05:19 2024 +0100

    platform/x86: int3472: Check for adev == NULL
    
    [ Upstream commit cd2fd6eab480dfc247b737cf7a3d6b009c4d0f1c ]
    
    Not all devices have an ACPI companion fwnode, so adev might be NULL. This
    can e.g. (theoretically) happen when a user manually binds one of
    the int3472 drivers to another i2c/platform device through sysfs.
    
    Add a check for adev not being set and return -ENODEV in that case to
    avoid a possible NULL pointer deref in skl_int3472_get_acpi_buffer().
    
    Signed-off-by: Hans de Goede <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

platform/x86: serdev_helpers: Check for serial_ctrl_uid == NULL [+ + +]
Author: Hans de Goede <[email protected]>
Date:   Wed Dec 4 21:42:14 2024 +0100

    platform/x86: serdev_helpers: Check for serial_ctrl_uid == NULL
    
    commit 478b00a623d6c8ae23a1be7bcc96cb5497045cef upstream.
    
    dell_uart_bl_pdev_probe() calls get_serdev_controller() with the
    serial_ctrl_uid parameter set to NULL.
    
    In case of errors this NULL parameter then gets passed to pr_err()
    as argument matching a "%s" conversion specification. This leads to
    compiler warnings when building with "make W=1".
    
    Check serial_ctrl_uid before passing it to pr_err() to avoid these.
    
    Fixes: dc5afd720f84 ("platform/x86: Add new get_serdev_controller() helper")
    Cc: [email protected]
    Suggested-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Hans de Goede <[email protected]>
    Reviewed-by: Andy Shevchenko <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
pnfs/flexfiles: retry getting layout segment for reads [+ + +]
Author: Mike Snitzer <[email protected]>
Date:   Thu Jan 16 20:05:39 2025 -0500

    pnfs/flexfiles: retry getting layout segment for reads
    
    commit eb3fabde15bccdf34f1c9b35a83aa4c0dacbb4ca upstream.
    
    If ff_layout_pg_get_read()'s attempt to get a layout segment results
    in -EAGAIN have ff_layout_pg_init_read() retry it after sleeping.
    
    If "softerr" mount is used, use 'io_maxretrans' to limit the number of
    attempts to get a layout segment.
    
    This fixes a long-standing issue of O_DIRECT reads failing with
    -EAGAIN (11) when using flexfiles Client Side Mirroring (CSM).
    
    Cc: [email protected]
    Signed-off-by: Mike Snitzer <[email protected]>
    Signed-off-by: Anna Schumaker <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
powerpc/pseries/eeh: Fix get PE state translation [+ + +]
Author: Narayana Murty N <[email protected]>
Date:   Thu Jan 16 04:39:54 2025 -0600

    powerpc/pseries/eeh: Fix get PE state translation
    
    commit 11b93559000c686ad7e5ab0547e76f21cc143844 upstream.
    
    The PE Reset State "0" returned by RTAS calls
    "ibm_read_slot_reset_[state|state2]" indicates that the reset is
    deactivated and the PE is in a state where MMIO and DMA are allowed.
    However, the current implementation of "pseries_eeh_get_state()" does
    not reflect this, causing drivers to incorrectly assume that MMIO and
    DMA operations cannot be resumed.
    
    The userspace drivers as a part of EEH recovery using VFIO ioctls fail
    to detect when the recovery process is complete. The VFIO_EEH_PE_GET_STATE
    ioctl does not report the expected EEH_PE_STATE_NORMAL state, preventing
    userspace drivers from functioning properly on pseries systems.
    
    The patch addresses this issue by updating 'pseries_eeh_get_state()'
    to include "EEH_STATE_MMIO_ENABLED" and "EEH_STATE_DMA_ENABLED" in
    the result mask for PE Reset State "0". This ensures correct state
    reporting to the callers, aligning the behavior with the PAPR specification
    and fixing the bug in EEH recovery for VFIO user workflows.
    
    Fixes: 00ba05a12b3c ("powerpc/pseries: Cleanup on pseries_eeh_get_state()")
    Cc: [email protected]
    Reviewed-by: Ritesh Harjani (IBM) <[email protected]>
    Signed-off-by: Narayana Murty N <[email protected]>
    Link: https://lore.kernel.org/stable/20241212075044.10563-1-nnmlinux%40linux.ibm.com
    Signed-off-by: Madhavan Srinivasan <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
printk: Fix signed integer overflow when defining LOG_BUF_LEN_MAX [+ + +]
Author: Kuan-Wei Chiu <[email protected]>
Date:   Sat Sep 28 19:36:08 2024 +0800

    printk: Fix signed integer overflow when defining LOG_BUF_LEN_MAX
    
    [ Upstream commit 3d6f83df8ff2d5de84b50377e4f0d45e25311c7a ]
    
    Shifting 1 << 31 on a 32-bit int causes signed integer overflow, which
    leads to undefined behavior. To prevent this, cast 1 to u32 before
    performing the shift, ensuring well-defined behavior.
    
    This change explicitly avoids any potential overflow by ensuring that
    the shift occurs on an unsigned 32-bit integer.
    
    Signed-off-by: Kuan-Wei Chiu <[email protected]>
    Acked-by: Petr Mladek <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Petr Mladek <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
ptp: Ensure info->enable callback is always set [+ + +]
Author: Thomas Weißschuh <[email protected]>
Date:   Thu Jan 23 08:22:40 2025 +0100

    ptp: Ensure info->enable callback is always set
    
    commit fd53aa40e65f518453115b6f56183b0c201db26b upstream.
    
    The ioctl and sysfs handlers unconditionally call the ->enable callback.
    Not all drivers implement that callback, leading to NULL dereferences.
    Example of affected drivers: ptp_s390.c, ptp_vclock.c and ptp_mock.c.
    
    Instead use a dummy callback if no better was specified by the driver.
    
    Fixes: d94ba80ebbea ("ptp: Added a brand new class driver for ptp clocks.")
    Cc: [email protected]
    Signed-off-by: Thomas Weißschuh <[email protected]>
    Acked-by: Richard Cochran <[email protected]>
    Reviewed-by: Michal Swiatkowski <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
pwm: microchip-core: fix incorrect comparison with max period [+ + +]
Author: Conor Dooley <[email protected]>
Date:   Wed Jan 22 14:42:56 2025 +0000

    pwm: microchip-core: fix incorrect comparison with max period
    
    commit 752b6e3af374460a2de18f0c10bfa06bf844dbe8 upstream.
    
    In mchp_core_pwm_apply_locked(), if hw_period_steps is equal to its max,
    an error is reported and .apply fails. The max value is actually a
    permitted value however, and so this check can fail where multiple
    channels are enabled.
    
    For example, the first channel to be configured requests a period that
    sets hw_period_steps to the maximum value, and when a second channel
    is enabled the driver reads hw_period_steps back from the hardware and
    finds it to be the maximum possible value, triggering the warning on a
    permitted value. The value to be avoided is 255 (PERIOD_STEPS_MAX + 1),
    as that will produce undesired behaviour, so test for greater than,
    rather than equal to.
    
    Fixes: 2bf7ecf7b4ff ("pwm: add microchip soft ip corePWM driver")
    Cc: [email protected]
    Signed-off-by: Conor Dooley <[email protected]>
    Link: https://lore.kernel.org/r/20250122-pastor-fancied-0b993da2d2d2@spud
    Signed-off-by: Uwe Kleine-König <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
RDMA/mlx5: Fix a race for an ODP MR which leads to CQE with error [+ + +]
Author: Yishai Hadas <[email protected]>
Date:   Sun Jan 19 14:38:25 2025 +0200

    RDMA/mlx5: Fix a race for an ODP MR which leads to CQE with error
    
    commit abb604a1a9c87255c7a6f3b784410a9707baf467 upstream.
    
    This patch addresses a race condition for an ODP MR that can result in a
    CQE with an error on the UMR QP.
    
    During the __mlx5_ib_dereg_mr() flow, the following sequence of calls
    occurs:
    
    mlx5_revoke_mr()
     mlx5r_umr_revoke_mr()
     mlx5r_umr_post_send_wait()
    
    At this point, the lkey is freed from the hardware's perspective.
    
    However, concurrently, mlx5_ib_invalidate_range() might be triggered by
    another task attempting to invalidate a range for the same freed lkey.
    
    This task will:
     - Acquire the umem_odp->umem_mutex lock.
     - Call mlx5r_umr_update_xlt() on the UMR QP.
     - Since the lkey has already been freed, this can lead to a CQE error,
       causing the UMR QP to enter an error state [1].
    
    To resolve this race condition, the umem_odp->umem_mutex lock is now also
    acquired as part of the mlx5_revoke_mr() scope.  Upon successful revoke,
    we set umem_odp->private which points to that MR to NULL, preventing any
    further invalidation attempts on its lkey.
    
    [1] From dmesg:
    
       infiniband rocep8s0f0: dump_cqe:277:(pid 0): WC error: 6, Message: memory bind operation error
       cqe_dump: 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
       cqe_dump: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
       cqe_dump: 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
       cqe_dump: 00000030: 00 00 00 00 08 00 78 06 25 00 11 b9 00 0e dd d2
    
       WARNING: CPU: 15 PID: 1506 at drivers/infiniband/hw/mlx5/umr.c:394 mlx5r_umr_post_send_wait+0x15a/0x2b0 [mlx5_ib]
       Modules linked in: ip6table_mangle ip6table_natip6table_filter ip6_tables iptable_mangle xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter rpcsec_gss_krb5 auth_rpcgss oid_registry overlay rpcrdma rdma_ucm ib_iser libiscsi scsi_transport_iscsi rdma_cm iw_cm ib_umad ib_ipoib ib_cm mlx5_ib ib_uverbs ib_core fuse mlx5_core
       CPU: 15 UID: 0 PID: 1506 Comm: ibv_rc_pingpong Not tainted 6.12.0-rc7+ #1626
       Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
       RIP: 0010:mlx5r_umr_post_send_wait+0x15a/0x2b0 [mlx5_ib]
       [..]
       Call Trace:
       <TASK>
       mlx5r_umr_update_xlt+0x23c/0x3e0 [mlx5_ib]
       mlx5_ib_invalidate_range+0x2e1/0x330 [mlx5_ib]
       __mmu_notifier_invalidate_range_start+0x1e1/0x240
       zap_page_range_single+0xf1/0x1a0
       madvise_vma_behavior+0x677/0x6e0
       do_madvise+0x1a2/0x4b0
       __x64_sys_madvise+0x25/0x30
       do_syscall_64+0x6b/0x140
       entry_SYSCALL_64_after_hwframe+0x76/0x7e
    
    Fixes: e6fb246ccafb ("RDMA/mlx5: Consolidate MR destruction to mlx5_ib_dereg_mr()")
    Cc: [email protected]
    Link: https://patch.msgid.link/r/68a1e007c25b2b8fe5d625f238cc3b63e5341f77.1737290229.git.leon@kernel.org
    Signed-off-by: Yishai Hadas <[email protected]>
    Reviewed-by: Artemy Kovalyov <[email protected]>
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
remoteproc: omap: Handle ARM dma_iommu_mapping [+ + +]
Author: Robin Murphy <[email protected]>
Date:   Mon Oct 28 17:58:35 2024 +0000

    remoteproc: omap: Handle ARM dma_iommu_mapping
    
    commit 1dc7c8ed7cb378dd3974387692dfa833aee718d4 upstream.
    
    It's no longer practical for the OMAP IOMMU driver to trick
    arm_setup_iommu_dma_ops() into ignoring its presence, so let's use the
    same tactic as other IOMMU API users on 32-bit ARM and explicitly kick
    the arch code's dma_iommu_mapping out of the way to avoid problems.
    
    Fixes: 4720287c7bf7 ("iommu: Remove struct iommu_ops *iommu from arch_setup_dma_ops()")
    Signed-off-by: Robin Murphy <[email protected]>
    Tested-by: Beleswar Padhi <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/r/6186e311cb6f64a787f87fd41e49a73f409b789c.1730136799.git.robin.murphy@arm.com
    [Fixed changelog title]
    Signed-off-by: Mathieu Poirier <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
Revert "drm/amd/display: Fix green screen issue after suspend" [+ + +]
Author: Rodrigo Siqueira <[email protected]>
Date:   Thu Nov 14 15:32:52 2024 -0700

    Revert "drm/amd/display: Fix green screen issue after suspend"
    
    commit 04d6273faed083e619fc39a738ab0372b6a4db20 upstream.
    
    This reverts commit 87b7ebc2e16c14d32a912f18206a4d6cc9abc3e8.
    
    A long time ago, we had an issue with the Raven system when it was
    connected to two displays: one with DP and another with HDMI. After the
    system woke up from suspension, we saw a solid green screen caused by an
    underflow generated by bad DCC metadata. To workaround this issue, the
    'commit 87b7ebc2e16c ("drm/amd/display: Fix green screen issue after
    suspend")' was introduced to disable the DCC for a few frames after in
    the resume phase. However, in hindsight, this solution was probably a
    workaround at the kernel level for some issues from another part
    (probably other driver components or user space). After applying this
    patch and trying to reproduce the green issue in a similar hardware
    system but using the latest kernel and userspace, we cannot see the
    issue, which makes this workaround obsolete and creates extra
    unnecessary complexity to the code; for all of this reason, this commit
    reverts the original change.
    
    Cc: Mario Limonciello <[email protected]>
    Cc: Pierre-Eric Pelloux-Prayer <[email protected]>
    Tested-by: Daniel Wheeler <[email protected]>
    Reviewed-by: Aurabindo Pillai <[email protected]>
    Signed-off-by: Rodrigo Siqueira <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Revert "drm/amd/display: Use HW lock mgr for PSR1" [+ + +]
Author: Tom Chung <[email protected]>
Date:   Tue Feb 4 15:07:44 2025 +0800

    Revert "drm/amd/display: Use HW lock mgr for PSR1"
    
    commit f245b400a223a71d6d5f4c72a2cb9b573a7fc2b6 upstream.
    
    This reverts commit
    a2b5a9956269 ("drm/amd/display: Use HW lock mgr for PSR1")
    
    Because it may cause system hang while connect with two edp panel.
    
    Acked-by: Wayne Lin <[email protected]>
    Signed-off-by: Tom Chung <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
Revert "media: uvcvideo: Require entities to have a non-zero unique ID" [+ + +]
Author: Thadeu Lima de Souza Cascardo <[email protected]>
Date:   Tue Jan 14 17:00:45 2025 -0300

    Revert "media: uvcvideo: Require entities to have a non-zero unique ID"
    
    commit 8004d635f27bbccaa5c083c50d4d5302a6ffa00e upstream.
    
    This reverts commit 3dd075fe8ebbc6fcbf998f81a75b8c4b159a6195.
    
    Tomasz has reported that his device, Generalplus Technology Inc. 808 Camera,
    with ID 1b3f:2002, stopped being detected:
    
    $ ls -l /dev/video*
    zsh: no matches found: /dev/video*
    [    7.230599] usb 3-2: Found multiple Units with ID 5
    
    This particular device is non-compliant, having both the Output Terminal
    and Processing Unit with ID 5. uvc_scan_fallback, though, is able to build
    a chain. However, when media elements are added and uvc_mc_create_links
    call uvc_entity_by_id, it will get the incorrect entity,
    media_create_pad_link will WARN, and it will fail to register the entities.
    
    In order to reinstate support for such devices in a timely fashion,
    reverting the fix for these warnings is appropriate. A proper fix that
    considers the existence of such non-compliant devices will be submitted in
    a later development cycle.
    
    Reported-by: Tomasz Sikora <[email protected]>
    Fixes: 3dd075fe8ebb ("media: uvcvideo: Require entities to have a non-zero unique ID")
    Cc: [email protected]
    Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]>
    Reviewed-by: Laurent Pinchart <[email protected]>
    Reviewed-by: Hans de Goede <[email protected]>
    Reviewed-by: Ricardo Ribalda <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
Revert "mfd: axp20x: Allow multiple regulators" [+ + +]
Author: Andre Przywara <[email protected]>
Date:   Wed Jan 8 16:43:59 2025 +0000

    Revert "mfd: axp20x: Allow multiple regulators"
    
    [ Upstream commit b246bd32a34c1b0d80670e60e4e4102be6366191 ]
    
    As Chris and Vasily reported, the attempt to support multiple AXP PMICs
    in one system [1] breaks some of the battery and charging functionality
    on devices with AXP PMICs. The reason is that the drivers now fail to get
    the correct IIO channel for the ADC component, as the current code seems
    to rely on the zero-based enumeration of the regulator devices.
    A fix is possible, but not trivial, as it requires some rework in the AXP
    MFD driver, which cannot be fully reviewed or tested in time for the
    6.13 release.
    
    So revert this patch for now, to avoid regressions on battery powered
    devices. This patch was really only necessary for devices with two
    PMICs, support for which is not mainline yet anyway, so we don't lose
    any functionality.
    
    This reverts commit e37ec32188701efa01455b9be42a392adab06ce4.
    
    [1] https://lore.kernel.org/linux-sunxi/[email protected]/
    
    Reported-by: Chris Morgan <[email protected]>
    Closes: https://lore.kernel.org/linux-sunxi/[email protected]/
    Reported-by: Vasily Khoruzhick <[email protected]>
    Closes: https://lore.kernel.org/linux-sunxi/CA+E=qVf8_9gn0y=mcdKXvj2PFoHT2eF+JN=CmtTNdRGaSnpgKg@mail.gmail.com/
    Signed-off-by: Andre Przywara <[email protected]>
    Acked-by: Chen-Yu Tsai <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
Revert "MIPS: csrc-r4k: Select HAVE_UNSTABLE_SCHED_CLOCK if SMP && 64BIT" [+ + +]
Author: Xi Ruoyao <[email protected]>
Date:   Mon Dec 23 17:20:41 2024 +0800

    Revert "MIPS: csrc-r4k: Select HAVE_UNSTABLE_SCHED_CLOCK if SMP && 64BIT"
    
    commit 078b831638e1aa06dd7ffa9f244c8ac6b2995561 upstream.
    
    This reverts commit 426fa8e4fe7bb914b5977cbce453a9926bf5b2e6.
    
    The commit has caused two issues on Loongson 3A4000:
    
    1. The timestamp in dmesg become erratic, like:
    
        [3.736957] amdgpu 0000:04:00.0: ... ...
        [3.748895] [drm] Initialized amdgpu ... ...
        [18446744073.381141] amdgpu 0000:04:00:0: ... ...
        [1.613326] igb 0000:03:00.0 enp3s0: ... ...
    
    2. More seriously, some workloads (for example, the test
       stdlib/test-cxa_atexit2 in the Glibc test suite) triggers an RCU
       stall and hang the system with a high probably (4 hangs out of 5
       tests).
    
    Revert this commit to use jiffie on Loongson MIPS systems and fix these
    issues for now.  The root cause may need more investigation.
    
    Cc: [email protected] # 6.11+
    Cc: Jiaxun Yang <[email protected]>
    Cc: Icenowy Zheng <[email protected]>
    Signed-off-by: Xi Ruoyao <[email protected]>
    Reviewed-by: Jiaxun Yang <[email protected]>
    Signed-off-by: Thomas Bogendoerfer <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ring-buffer: Do not allow events in NMI with generic atomic64 cmpxchg() [+ + +]
Author: Steven Rostedt <[email protected]>
Date:   Mon Jan 20 18:56:56 2025 -0500

    ring-buffer: Do not allow events in NMI with generic atomic64 cmpxchg()
    
    commit cd2375a3567fd3d93aa6c68e0027a5756213bda0 upstream.
    
    Some architectures can not safely do atomic64 operations in NMI context.
    Since the ring buffer relies on atomic64 operations to do its time
    keeping, if an event is requested in NMI context, reject it for these
    architectures.
    
    Cc: [email protected]
    Cc: Mark Rutland <[email protected]>
    Cc: Mathieu Desnoyers <[email protected]>
    Cc: Andrew Morton <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Thomas Gleixner <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Andreas Larsson <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Fixes: c84897c0ff592 ("ring-buffer: Remove 32bit timestamp logic")
    Closes: https://lore.kernel.org/all/[email protected]/
    Reported-by: Ludwig Rydberg <[email protected]>
    Reviewed-by: Masami Hiramatsu (Google) <[email protected]>
    Signed-off-by: Steven Rostedt (Google) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ring-buffer: Make reading page consistent with the code logic [+ + +]
Author: Jeongjun Park <[email protected]>
Date:   Sat Jan 11 01:26:12 2025 +0900

    ring-buffer: Make reading page consistent with the code logic
    
    [ Upstream commit 6e31b759b076eebb4184117234f0c4eb9e4bc460 ]
    
    In the loop of __rb_map_vma(), the 's' variable is calculated from the
    same logic that nr_pages is and they both come from nr_subbufs. But the
    relationship is not obvious and there's a WARN_ON_ONCE() around the 's'
    variable to make sure it never becomes equal to nr_subbufs within the
    loop. If that happens, then the code is buggy and needs to be fixed.
    
    The 'page' variable is calculated from cpu_buffer->subbuf_ids[s] which is
    an array of 'nr_subbufs' entries. If the code becomes buggy and 's'
    becomes equal to or greater than 'nr_subbufs' then this will be an out of
    bounds hit before the WARN_ON() is triggered and the code exiting safely.
    
    Make the 'page' initialization consistent with the code logic and assign
    it after the out of bounds check.
    
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Jeongjun Park <[email protected]>
    [ sdr: rewrote change log ]
    Signed-off-by: Steven Rostedt (Google) <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
rtc: zynqmp: Fix optional clock name property [+ + +]
Author: Michal Simek <[email protected]>
Date:   Wed Nov 27 17:01:22 2024 +0100

    rtc: zynqmp: Fix optional clock name property
    
    commit 2a388ff22d2cbfc5cbd628ef085bdcd3b7dc64f5 upstream.
    
    Clock description in DT binding introduced by commit f69060c14431
    ("dt-bindings: rtc: zynqmp: Add clock information") is talking about "rtc"
    clock name but driver is checking "rtc_clk" name instead.
    Because clock is optional property likely in was never handled properly by
    the driver.
    
    Fixes: 07dcc6f9c762 ("rtc: zynqmp: Add calibration set and get support")
    Signed-off-by: Michal Simek <[email protected]>
    Cc: [email protected]
    Reviewed-by: Peter Korsgaard <[email protected]>
    Link: https://lore.kernel.org/r/cd5f0c9d01ec1f5a240e37a7e0d85b8dacb3a869.1732723280.git.michal.simek@amd.com
    Signed-off-by: Alexandre Belloni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
rtla/osnoise: Distinguish missing workload option [+ + +]
Author: Tomas Glozar <[email protected]>
Date:   Tue Jan 7 15:48:21 2025 +0100

    rtla/osnoise: Distinguish missing workload option
    
    commit 80d3ba1cf51bfbbb3b098434f2b2c95cd7c0ae5c upstream.
    
    osnoise_set_workload returns -1 for both missing OSNOISE_WORKLOAD option
    and failure in setting the option.
    
    Return -1 for missing and -2 for failure to distinguish them.
    
    Cc: [email protected]
    Cc: John Kacur <[email protected]>
    Cc: Luis Goncalves <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Tomas Glozar <[email protected]>
    Signed-off-by: Steven Rostedt (Google) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads [+ + +]
Author: Tomas Glozar <[email protected]>
Date:   Tue Jan 7 15:48:22 2025 +0100

    rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads
    
    commit d8d866171a414ed88bd0d720864095fd75461134 upstream.
    
    When using rtla timerlat with userspace threads (-u or -U), rtla
    disables the OSNOISE_WORKLOAD option in
    /sys/kernel/tracing/osnoise/options. This option is not re-enabled in a
    subsequent run with kernel-space threads, leading to rtla collecting no
    results if the previous run exited abnormally:
    
    $ rtla timerlat hist -u
    ^\Quit (core dumped)
    $ rtla timerlat hist -k -d 1s
    Index
    over:
    count:
    min:
    avg:
    max:
    ALL:        IRQ       Thr       Usr
    count:        0         0         0
    min:          -         -         -
    avg:          -         -         -
    max:          -         -         -
    
    The issue persists until OSNOISE_WORKLOAD is set manually by running:
    $ echo OSNOISE_WORKLOAD > /sys/kernel/tracing/osnoise/options
    
    Set OSNOISE_WORKLOAD when running rtla with kernel-space threads if
    available to fix the issue.
    
    Cc: [email protected]
    Cc: John Kacur <[email protected]>
    Cc: Luis Goncalves <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Fixes: ed774f7481fa ("rtla/timerlat_hist: Add timerlat user-space support")
    Signed-off-by: Tomas Glozar <[email protected]>
    Signed-off-by: Steven Rostedt (Google) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

rtla/timerlat_hist: Stop timerlat tracer on signal [+ + +]
Author: Tomas Glozar <[email protected]>
Date:   Thu Jan 16 15:49:28 2025 +0100

    rtla/timerlat_hist: Stop timerlat tracer on signal
    
    commit c73cab9dbed04d8f65ca69177b4b21ed3e09dfa7 upstream.
    
    Currently, when either SIGINT from the user or SIGALRM from the duration
    timer is caught by rtla-timerlat, stop_tracing is set to break out of
    the main loop. This is not sufficient for cases where the timerlat
    tracer is producing more data than rtla can consume, since in that case,
    rtla is looping indefinitely inside tracefs_iterate_raw_events, never
    reaches the check of stop_tracing and hangs.
    
    In addition to setting stop_tracing, also stop the timerlat tracer on
    received signal (SIGINT or SIGALRM). This will stop new samples so that
    the existing samples may be processed and tracefs_iterate_raw_events
    eventually exits.
    
    Cc: [email protected]
    Cc: John Kacur <[email protected]>
    Cc: Luis Goncalves <[email protected]>
    Cc: Gabriele Monaco <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Fixes: 1eeb6328e8b3 ("rtla/timerlat: Add timerlat hist mode")
    Signed-off-by: Tomas Glozar <[email protected]>
    Signed-off-by: Steven Rostedt (Google) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads [+ + +]
Author: Tomas Glozar <[email protected]>
Date:   Tue Jan 7 15:48:23 2025 +0100

    rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads
    
    commit 217f0b1e990e30a1f06f6d531fdb4530f4788d48 upstream.
    
    When using rtla timerlat with userspace threads (-u or -U), rtla
    disables the OSNOISE_WORKLOAD option in
    /sys/kernel/tracing/osnoise/options. This option is not re-enabled in a
    subsequent run with kernel-space threads, leading to rtla collecting no
    results if the previous run exited abnormally:
    
    $ rtla timerlat top -u
    ^\Quit (core dumped)
    $ rtla timerlat top -k -d 1s
                                         Timer Latency
      0 00:00:01   |          IRQ Timer Latency (us)        |         Thread Timer Latency (us)
    CPU COUNT      |      cur       min       avg       max |      cur       min       avg       max
    
    The issue persists until OSNOISE_WORKLOAD is set manually by running:
    $ echo OSNOISE_WORKLOAD > /sys/kernel/tracing/osnoise/options
    
    Set OSNOISE_WORKLOAD when running rtla with kernel-space threads if
    available to fix the issue.
    
    Cc: [email protected]
    Cc: John Kacur <[email protected]>
    Cc: Luis Goncalves <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Fixes: cdca4f4e5e8e ("rtla/timerlat_top: Add timerlat user-space support")
    Signed-off-by: Tomas Glozar <[email protected]>
    Signed-off-by: Steven Rostedt (Google) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

rtla/timerlat_top: Stop timerlat tracer on signal [+ + +]
Author: Tomas Glozar <[email protected]>
Date:   Thu Jan 16 15:49:29 2025 +0100

    rtla/timerlat_top: Stop timerlat tracer on signal
    
    commit a4dfce7559d75430c464294ddee554be2a413c4a upstream.
    
    Currently, when either SIGINT from the user or SIGALRM from the duration
    timer is caught by rtla-timerlat, stop_tracing is set to break out of
    the main loop. This is not sufficient for cases where the timerlat
    tracer is producing more data than rtla can consume, since in that case,
    rtla is looping indefinitely inside tracefs_iterate_raw_events, never
    reaches the check of stop_tracing and hangs.
    
    In addition to setting stop_tracing, also stop the timerlat tracer on
    received signal (SIGINT or SIGALRM). This will stop new samples so that
    the existing samples may be processed and tracefs_iterate_raw_events
    eventually exits.
    
    Cc: [email protected]
    Cc: John Kacur <[email protected]>
    Cc: Luis Goncalves <[email protected]>
    Cc: Gabriele Monaco <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Fixes: a828cd18bc4a ("rtla: Add timerlat tool and timelart top mode")
    Signed-off-by: Tomas Glozar <[email protected]>
    Signed-off-by: Steven Rostedt (Google) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
rtla: Add trace_instance_stop [+ + +]
Author: Tomas Glozar <[email protected]>
Date:   Thu Jan 16 15:49:27 2025 +0100

    rtla: Add trace_instance_stop
    
    commit e879b5dcf8d044f3865a32d95cc5b213f314c54f upstream.
    
    Support not only turning trace on for the timerlat tracer, but also
    turning it off.
    
    This will be used in subsequent patches to stop the timerlat tracer
    without also wiping the trace buffer.
    
    Cc: [email protected]
    Cc: John Kacur <[email protected]>
    Cc: Luis Goncalves <[email protected]>
    Cc: Gabriele Monaco <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Tomas Glozar <[email protected]>
    Signed-off-by: Steven Rostedt (Google) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
rust: init: use explicit ABI to clean warning in future compilers [+ + +]
Author: Miguel Ojeda <[email protected]>
Date:   Tue Jan 21 21:09:34 2025 +0100

    rust: init: use explicit ABI to clean warning in future compilers
    
    commit c21bdb3d8a850afdfa4afe77eea39ae9533629b0 upstream.
    
    Starting with Rust 1.86.0 (currently in nightly, to be released on
    2025-04-03), the `missing_abi` lint is warn-by-default [1]:
    
        error: extern declarations without an explicit ABI are deprecated
            --> rust/doctests_kernel_generated.rs:3158:1
             |
        3158 | extern {
             | ^^^^^^ help: explicitly specify the C ABI: `extern "C"`
             |
             = note: `-D missing-abi` implied by `-D warnings`
             = help: to override `-D warnings` add `#[allow(missing_abi)]`
    
    Thus clean it up.
    
    Cc: <[email protected]> # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
    Fixes: 7f8977a7fe6d ("rust: init: add `{pin_}chain` functions to `{Pin}Init<T, E>`")
    Link: https://github.com/rust-lang/rust/pull/132397 [1]
    Reviewed-by: Gary Guo <[email protected]>
    Reviewed-by: Alice Ryhl <[email protected]>
    Reviewed-by: Fiona Behrens <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    [ Added 6.13.y to Cc: stable tag. - Miguel ]
    Signed-off-by: Miguel Ojeda <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
rv: Reset per-task monitors also for idle tasks [+ + +]
Author: Gabriele Monaco <[email protected]>
Date:   Wed Jan 15 16:15:48 2025 +0100

    rv: Reset per-task monitors also for idle tasks
    
    commit 8259cb14a70680553d5e82d65d1302fe589e9b39 upstream.
    
    RV per-task monitors are implemented through a monitor structure
    available for each task_struct. This structure is reset every time the
    monitor is (re-)started, to avoid inconsistencies if the monitor was
    activated previously.
    To do so, we reset the monitor on all threads using the macro
    for_each_process_thread. However, this macro excludes the idle tasks on
    each CPU. Idle tasks could be considered tasks on their own right and it
    should be up to the model whether to ignore them or not.
    
    Reset monitors also on the idle tasks for each present CPU whenever we
    reset all per-task monitors.
    
    Cc: [email protected]
    Cc: Juri Lelli <[email protected]>
    Cc: Thomas Gleixner <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: John Kacur <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Fixes: 792575348ff7 ("rv/include: Add deterministic automata monitor definition via C macros")
    Signed-off-by: Gabriele Monaco <[email protected]>
    Signed-off-by: Steven Rostedt (Google) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
rxrpc: Fix call state set to not include the SERVER_SECURING state [+ + +]
Author: David Howells <[email protected]>
Date:   Tue Feb 4 23:05:53 2025 +0000

    rxrpc: Fix call state set to not include the SERVER_SECURING state
    
    [ Upstream commit 41b996ce83bf944de5569d6263c8dbd5513e7ed0 ]
    
    The RXRPC_CALL_SERVER_SECURING state doesn't really belong with the other
    states in the call's state set as the other states govern the call's Rx/Tx
    phase transition and govern when packets can and can't be received or
    transmitted.  The "Securing" state doesn't actually govern the reception of
    packets and would need to be split depending on whether or not we've
    received the last packet yet (to mirror RECV_REQUEST/ACK_REQUEST).
    
    The "Securing" state is more about whether or not we can start forwarding
    packets to the application as recvmsg will need to decode them and the
    decoding can't take place until the challenge/response exchange has
    completed.
    
    Fix this by removing the RXRPC_CALL_SERVER_SECURING state from the state
    set and, instead, using a flag, RXRPC_CALL_CONN_CHALLENGING, to track
    whether or not we can queue the call for reception by recvmsg() or notify
    the kernel app that data is ready.  In the event that we've already
    received all the packets, the connection event handler will poke the app
    layer in the appropriate manner.
    
    Also there's a race whereby the app layer sees the last packet before rxrpc
    has managed to end the rx phase and change the state to one amenable to
    allowing a reply.  Fix this by queuing the packet after calling
    rxrpc_end_rx_phase().
    
    Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both")
    Signed-off-by: David Howells <[email protected]>
    cc: Marc Dionne <[email protected]>
    cc: Simon Horman <[email protected]>
    cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

rxrpc: Fix the rxrpc_connection attend queue handling [+ + +]
Author: David Howells <[email protected]>
Date:   Mon Feb 3 11:03:04 2025 +0000

    rxrpc: Fix the rxrpc_connection attend queue handling
    
    [ Upstream commit 4241a702e0d0c2ca9364cfac08dbf134264962de ]
    
    The rxrpc_connection attend queue is never used because conn::attend_link
    is never initialised and so is always NULL'd out and thus always appears to
    be busy.  This requires the following fix:
    
     (1) Fix this the attend queue problem by initialising conn::attend_link.
    
    And, consequently, two further fixes for things masked by the above bug:
    
     (2) Fix rxrpc_input_conn_event() to handle being invoked with a NULL
         sk_buff pointer - something that can now happen with the above change.
    
     (3) Fix the RXRPC_SKB_MARK_SERVICE_CONN_SECURED message to carry a pointer
         to the connection and a ref on it.
    
    Signed-off-by: David Howells <[email protected]>
    cc: Marc Dionne <[email protected]>
    cc: Jakub Kicinski <[email protected]>
    cc: "David S. Miller" <[email protected]>
    cc: Eric Dumazet <[email protected]>
    cc: Paolo Abeni <[email protected]>
    cc: Simon Horman <[email protected]>
    cc: [email protected]
    cc: [email protected]
    Fixes: f2cce89a074e ("rxrpc: Implement a mechanism to send an event notification to a connection")
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
s390/fpu: Add fpc exception handler / remove fixup section again [+ + +]
Author: Heiko Carstens <[email protected]>
Date:   Fri Jan 10 11:52:17 2025 +0100

    s390/fpu: Add fpc exception handler / remove fixup section again
    
    commit ae02615b7fcea9ce9a4ec40b3c5b5dafd322b179 upstream.
    
    The fixup section was added again by mistake when test_fp_ctl() was
    removed. The reason for the removal of the fixup section is described in
    commit 484a8ed8b7d1 ("s390/extable: add dedicated uaccess handler").
    Remove it again for the same reason.
    
    Add an exception handler which handles exceptions when the floating point
    control register is attempted to be set to invalid values. The exception
    handler sets the floating point control register to zero and continues
    execution at the specified address.
    
    The new sfpc inline assembly is open-coded to make back porting a bit
    easier.
    
    Fixes: 702644249d3e ("s390/fpu: get rid of test_fp_ctl()")
    Cc: [email protected]
    Reviewed-by: Alexander Gordeev <[email protected]>
    Signed-off-by: Heiko Carstens <[email protected]>
    Signed-off-by: Alexander Gordeev <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
s390/futex: Fix FUTEX_OP_ANDN implementation [+ + +]
Author: Heiko Carstens <[email protected]>
Date:   Tue Jan 7 11:28:58 2025 +0100

    s390/futex: Fix FUTEX_OP_ANDN implementation
    
    commit 26701574cee6777f867f89b4a5c667817e1ee0dd upstream.
    
    The futex operation FUTEX_OP_ANDN is supposed to implement
    
    *(int *)UADDR2 &= ~OPARG;
    
    The s390 implementation just implements an AND instead of ANDN.
    Add the missing bitwise not operation to oparg to fix this.
    
    This is broken since nearly 19 years, so it looks like user space is
    not making use of this operation.
    
    Fixes: 3363fbdd6fb4 ("[PATCH] s390: futex atomic operations")
    Cc: [email protected]
    Signed-off-by: Heiko Carstens <[email protected]>
    Acked-by: Alexander Gordeev <[email protected]>
    Signed-off-by: Alexander Gordeev <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
s390/pci: Fix SR-IOV for PFs initially in standby [+ + +]
Author: Niklas Schnelle <[email protected]>
Date:   Wed Jan 22 14:36:01 2025 +0100

    s390/pci: Fix SR-IOV for PFs initially in standby
    
    commit dc287e4c9149ab54a5003b4d4da007818b5fda3d upstream.
    
    Since commit 25f39d3dcb48 ("s390/pci: Ignore RID for isolated VFs") PFs
    which are not initially configured but in standby are considered
    isolated. That is they create only a single function PCI domain. Due to
    the PCI domains being created on discovery, this means that even if they
    are configured later on, sibling PFs and their child VFs will not be
    added to their PCI domain breaking SR-IOV expectations.
    
    The reason the referenced commit ignored standby PFs for the creation of
    multi-function PCI subhierarchies, was to work around a PCI domain
    renumbering scenario on reboot. The renumbering would occur after
    removing a previously in standby PF, whose domain number is used for its
    configured sibling PFs and their child VFs, but which itself remained in
    standby. When this is followed by a reboot, the sibling PF is used
    instead to determine the PCI domain number of it and its child VFs.
    
    In principle it is not possible to know which standby PFs will be
    configured later and which may be removed. The PCI domain and root bus
    are pre-requisites for hotplug slots so the decision of which functions
    belong to which domain can not be postponed. With the renumbering
    occurring only in rare circumstances and being generally benign, accept
    it as an oddity and fix SR-IOV for initially standby PFs simply by
    allowing them to create PCI domains.
    
    Cc: [email protected]
    Reviewed-by: Gerd Bayer <[email protected]>
    Fixes: 25f39d3dcb48 ("s390/pci: Ignore RID for isolated VFs")
    Signed-off-by: Niklas Schnelle <[email protected]>
    Signed-off-by: Alexander Gordeev <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
s390/stackleak: Use exrl instead of ex in __stackleak_poison() [+ + +]
Author: Sven Schnelle <[email protected]>
Date:   Wed Jan 8 15:27:02 2025 +0100

    s390/stackleak: Use exrl instead of ex in __stackleak_poison()
    
    [ Upstream commit a88c26bb8e04ee5f2678225c0130a5fbc08eef85 ]
    
    exrl is present in all machines currently supported, therefore prefer
    it over ex. This saves one instruction and doesn't need an additional
    register to hold the address of the target instruction.
    
    Signed-off-by: Sven Schnelle <[email protected]>
    Reviewed-by: Heiko Carstens <[email protected]>
    Signed-off-by: Alexander Gordeev <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
safesetid: check size of policy writes [+ + +]
Author: Leo Stone <[email protected]>
Date:   Tue Dec 17 10:26:57 2024 -0800

    safesetid: check size of policy writes
    
    [ Upstream commit f09ff307c7299392f1c88f763299e24bc99811c7 ]
    
    syzbot attempts to write a buffer with a large size to a sysfs entry
    with writes handled by handle_policy_update(), triggering a warning
    in kmalloc.
    
    Check the size specified for write buffers before allocating.
    
    Reported-by: [email protected]
    Closes: https://syzkaller.appspot.com/bug?extid=4eb7a741b3216020043a
    Signed-off-by: Leo Stone <[email protected]>
    [PM: subject tweak]
    Signed-off-by: Paul Moore <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
sched/fair: Fix inaccurate h_nr_runnable accounting with delayed dequeue [+ + +]
Author: K Prateek Nayak <[email protected]>
Date:   Fri Jan 17 10:58:52 2025 +0000

    sched/fair: Fix inaccurate h_nr_runnable accounting with delayed dequeue
    
    [ Upstream commit 3429dd57f0deb1a602c2624a1dd7c4c11b6c4734 ]
    
    set_delayed() adjusts cfs_rq->h_nr_runnable for the hierarchy when an
    entity is delayed irrespective of whether the entity corresponds to a
    task or a cfs_rq.
    
    Consider the following scenario:
    
            root
           /    \
          A      B (*) delayed since B is no longer eligible on root
          |      |
        Task0  Task1 <--- dequeue_task_fair() - task blocks
    
    When Task1 blocks (dequeue_entity() for task's se returns true),
    dequeue_entities() will continue adjusting cfs_rq->h_nr_* for the
    hierarchy of Task1. However, when the sched_entity corresponding to
    cfs_rq B is delayed, set_delayed() will adjust the h_nr_runnable for the
    hierarchy too leading to both dequeue_entity() and set_delayed()
    decrementing h_nr_runnable for the dequeue of the same task.
    
    A SCHED_WARN_ON() to inspect h_nr_runnable post its update in
    dequeue_entities() like below:
    
        cfs_rq->h_nr_runnable -= h_nr_runnable;
        SCHED_WARN_ON(((int) cfs_rq->h_nr_runnable) < 0);
    
    is consistently tripped when running wakeup intensive workloads like
    hackbench in a cgroup.
    
    This error is self correcting since cfs_rq are per-cpu and cannot
    migrate. The entitiy is either picked for full dequeue or is requeued
    when a task wakes up below it. Both those paths call clear_delayed()
    which again increments h_nr_runnable of the hierarchy without
    considering if the entity corresponds to a task or not.
    
    h_nr_runnable will eventually reflect the correct value however in the
    interim, the incorrect values can still influence PELT calculation which
    uses se->runnable_weight or cfs_rq->h_nr_runnable.
    
    Since only delayed tasks take the early return path in
    dequeue_entities() and enqueue_task_fair(), adjust the
    h_nr_runnable in {set,clear}_delayed() only when a task is delayed as
    this path skips the h_nr_* update loops and returns early.
    
    For entities corresponding to cfs_rq, the h_nr_* update loop in the
    caller will do the right thing.
    
    Fixes: 76f2f783294d ("sched/eevdf: More PELT vs DELAYED_DEQUEUE")
    Signed-off-by: K Prateek Nayak <[email protected]>
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Reviewed-by: Gautham R. Shenoy <[email protected]>
    Tested-by: Swapnil Sapkal <[email protected]>
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
sched: Don't try to catch up excess steal time. [+ + +]
Author: Suleiman Souhlal <[email protected]>
Date:   Mon Nov 18 13:37:45 2024 +0900

    sched: Don't try to catch up excess steal time.
    
    [ Upstream commit 108ad0999085df2366dd9ef437573955cb3f5586 ]
    
    When steal time exceeds the measured delta when updating clock_task, we
    currently try to catch up the excess in future updates.
    However, this results in inaccurate run times for the future things using
    clock_task, in some situations, as they end up getting additional steal
    time that did not actually happen.
    This is because there is a window between reading the elapsed time in
    update_rq_clock() and sampling the steal time in update_rq_clock_task().
    If the VCPU gets preempted between those two points, any additional
    steal time is accounted to the outgoing task even though the calculated
    delta did not actually contain any of that "stolen" time.
    When this race happens, we can end up with steal time that exceeds the
    calculated delta, and the previous code would try to catch up that excess
    steal time in future clock updates, which is given to the next,
    incoming task, even though it did not actually have any time stolen.
    
    This behavior is particularly bad when steal time can be very long,
    which we've seen when trying to extend steal time to contain the duration
    that the host was suspended [0]. When this happens, clock_task stays
    frozen, during which the running task stays running for the whole
    duration, since its run time doesn't increase.
    However the race can happen even under normal operation.
    
    Ideally we would read the elapsed cpu time and the steal time atomically,
    to prevent this race from happening in the first place, but doing so
    is non-trivial.
    
    Since the time between those two points isn't otherwise accounted anywhere,
    neither to the outgoing task nor the incoming task (because the "end of
    outgoing task" and "start of incoming task" timestamps are the same),
    I would argue that the right thing to do is to simply drop any excess steal
    time, in order to prevent these issues.
    
    [0] https://lore.kernel.org/kvm/[email protected]/
    
    Signed-off-by: Suleiman Souhlal <[email protected]>
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
scripts/gdb: fix aarch64 userspace detection in get_current_task [+ + +]
Author: Jan Kiszka <[email protected]>
Date:   Fri Jan 10 11:36:33 2025 +0100

    scripts/gdb: fix aarch64 userspace detection in get_current_task
    
    commit 4ebc417ef9cb34010a71270421fe320ec5d88aa2 upstream.
    
    At least recent gdb releases (seen with 14.2) return SP_EL0 as signed long
    which lets the right-shift always return 0.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Jan Kiszka <[email protected]>
    Cc: Barry Song <[email protected]>
    Cc: Kieran Bingham <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
scsi: core: Do not retry I/Os during depopulation [+ + +]
Author: Igor Pylypiv <[email protected]>
Date:   Fri Jan 31 10:44:07 2025 -0800

    scsi: core: Do not retry I/Os during depopulation
    
    commit 9ff7c383b8ac0c482a1da7989f703406d78445c6 upstream.
    
    Fail I/Os instead of retry to prevent user space processes from being
    blocked on the I/O completion for several minutes.
    
    Retrying I/Os during "depopulation in progress" or "depopulation restore in
    progress" results in a continuous retry loop until the depopulation
    completes or until the I/O retry loop is aborted due to a timeout by the
    scsi_cmd_runtime_exceeced().
    
    Depopulation is slow and can take 24+ hours to complete on 20+ TB HDDs.
    Most I/Os in the depopulation retry loop end up taking several minutes
    before returning the failure to user space.
    
    Cc: [email protected] # 4.18.x: 2bbeb8d scsi: core: Handle depopulation and restoration in progress
    Cc: [email protected] # 4.18.x
    Fixes: e37c7d9a0341 ("scsi: core: sanitize++ in progress")
    Signed-off-by: Igor Pylypiv <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

scsi: qla2xxx: Move FCE Trace buffer allocation to user control [+ + +]
Author: Quinn Tran <[email protected]>
Date:   Fri Nov 15 18:33:09 2024 +0530

    scsi: qla2xxx: Move FCE Trace buffer allocation to user control
    
    commit 841df27d619ee1f5ca6473e15227b39d6136562d upstream.
    
    Currently FCE Tracing is enabled to log additional ELS events. Instead,
    user will enable or disable this feature through debugfs.
    
    Modify existing DFS knob to allow user to enable or disable this
    feature.
    
    echo [1 | 0] > /sys/kernel/debug/qla2xxx/qla2xxx_??/fce
    cat  /sys/kernel/debug/qla2xxx/qla2xxx_??/fce
    
    Cc: [email protected]
    Fixes: df613b96077c ("[SCSI] qla2xxx: Add Fibre Channel Event (FCE) tracing support.")
    Signed-off-by: Quinn Tran <[email protected]>
    Signed-off-by: Nilesh Javali <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Himanshu Madhani <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

scsi: st: Don't set pos_unknown just after device recognition [+ + +]
Author: Kai Mäkisara <[email protected]>
Date:   Mon Dec 16 13:37:55 2024 +0200

    scsi: st: Don't set pos_unknown just after device recognition
    
    commit 98b37881b7492ae9048ad48260cc8a6ee9eb39fd upstream.
    
    Commit 9604eea5bd3a ("scsi: st: Add third party poweron reset handling") in
    v6.6 added new code to handle the Power On/Reset Unit Attention (POR UA)
    sense data. This was in addition to the existing method. When this Unit
    Attention is received, the driver blocks attempts to read, write and some
    other operations because the reset may have rewinded the tape. Because of
    the added code, also the initial POR UA resulted in blocking operations,
    including those that are used to set the driver options after the device is
    recognized. Also, reading and writing are refused, whereas they succeeded
    before this commit.
    
    Add code to not set pos_unknown to block operations if the POR UA is
    received from the first test_ready() call after the st device has been
    created. This restores the behavior before v6.6.
    
    Signed-off-by: Kai Mäkisara <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Fixes: 9604eea5bd3a ("scsi: st: Add third party poweron reset handling")
    CC: [email protected]
    Closes: https://lore.kernel.org/linux-scsi/[email protected]/
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

scsi: storvsc: Set correct data length for sending SCSI command without payload [+ + +]
Author: Long Li <[email protected]>
Date:   Wed Jan 22 19:07:22 2025 -0800

    scsi: storvsc: Set correct data length for sending SCSI command without payload
    
    commit 87c4b5e8a6b65189abd9ea5010ab308941f964a4 upstream.
    
    In StorVSC, payload->range.len is used to indicate if this SCSI command
    carries payload. This data is allocated as part of the private driver data
    by the upper layer and may get passed to lower driver uninitialized.
    
    For example, the SCSI error handling mid layer may send TEST_UNIT_READY or
    REQUEST_SENSE while reusing the buffer from a failed command. The private
    data section may have stale data from the previous command.
    
    If the SCSI command doesn't carry payload, the driver may use this value as
    is for communicating with host, resulting in possible corruption.
    
    Fix this by always initializing this value.
    
    Fixes: be0cf6ca301c ("scsi: storvsc: Set the tablesize based on the information given by the host")
    Cc: [email protected]
    Tested-by: Roman Kisel <[email protected]>
    Reviewed-by: Roman Kisel <[email protected]>
    Reviewed-by: Michael Kelley <[email protected]>
    Signed-off-by: Long Li <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

scsi: ufs: core: Fix the HIGH/LOW_TEMP Bit Definitions [+ + +]
Author: Bao D. Nguyen <[email protected]>
Date:   Mon Jan 13 10:32:07 2025 -0800

    scsi: ufs: core: Fix the HIGH/LOW_TEMP Bit Definitions
    
    commit 1b3e2d4ec0c5848776cc56d2624998aa5b2f0d27 upstream.
    
    According to the UFS Device Specification, the dExtendedUFSFeaturesSupport
    defines the support for TOO_HIGH_TEMPERATURE as bit[4] and the
    TOO_LOW_TEMPERATURE as bit[5]. Correct the code to match with
    the UFS device specification definition.
    
    Cc: [email protected]
    Fixes: e88e2d32200a ("scsi: ufs: core: Probe for temperature notification support")
    Signed-off-by: Bao D. Nguyen <[email protected]>
    Link: https://lore.kernel.org/r/69992b3e3e3434a5c7643be5a64de48be892ca46.1736793068.git.quic_nguyenb@quicinc.com
    Reviewed-by: Avri Altman <[email protected]>
    Reviewed-by: Peter Wang <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

scsi: ufs: core: Fix use-after free in init error and remove paths [+ + +]
Author: André Draszik <[email protected]>
Date:   Fri Jan 24 15:09:00 2025 +0000

    scsi: ufs: core: Fix use-after free in init error and remove paths
    
    commit f8fb2403ddebb5eea0033d90d9daae4c88749ada upstream.
    
    devm_blk_crypto_profile_init() registers a cleanup handler to run when
    the associated (platform-) device is being released. For UFS, the
    crypto private data and pointers are stored as part of the ufs_hba's
    data structure 'struct ufs_hba::crypto_profile'. This structure is
    allocated as part of the underlying ufshcd and therefore Scsi_host
    allocation.
    
    During driver release or during error handling in ufshcd_pltfrm_init(),
    this structure is released as part of ufshcd_dealloc_host() before the
    (platform-) device associated with the crypto call above is released.
    Once this device is released, the crypto cleanup code will run, using
    the just-released 'struct ufs_hba::crypto_profile'. This causes a
    use-after-free situation:
    
      Call trace:
       kfree+0x60/0x2d8 (P)
       kvfree+0x44/0x60
       blk_crypto_profile_destroy_callback+0x28/0x70
       devm_action_release+0x1c/0x30
       release_nodes+0x6c/0x108
       devres_release_all+0x98/0x100
       device_unbind_cleanup+0x20/0x70
       really_probe+0x218/0x2d0
    
    In other words, the initialisation code flow is:
    
      platform-device probe
        ufshcd_pltfrm_init()
          ufshcd_alloc_host()
            scsi_host_alloc()
              allocation of struct ufs_hba
              creation of scsi-host devices
        devm_blk_crypto_profile_init()
          devm registration of cleanup handler using platform-device
    
    and during error handling of ufshcd_pltfrm_init() or during driver
    removal:
    
      ufshcd_dealloc_host()
        scsi_host_put()
          put_device(scsi-host)
            release of struct ufs_hba
      put_device(platform-device)
        crypto cleanup handler
    
    To fix this use-after free, change ufshcd_alloc_host() to register a
    devres action to automatically cleanup the underlying SCSI device on
    ufshcd destruction, without requiring explicit calls to
    ufshcd_dealloc_host(). This way:
    
        * the crypto profile and all other ufs_hba-owned resources are
          destroyed before SCSI (as they've been registered after)
        * a memleak is plugged in tc-dwc-g210-pci.c remove() as a
          side-effect
        * EXPORT_SYMBOL_GPL(ufshcd_dealloc_host) can be removed fully as
          it's not needed anymore
        * no future drivers using ufshcd_alloc_host() could ever forget
          adding the cleanup
    
    Fixes: cb77cb5abe1f ("blk-crypto: rename blk_keyslot_manager to blk_crypto_profile")
    Fixes: d76d9d7d1009 ("scsi: ufs: use devm_blk_ksm_init()")
    Cc: [email protected]
    Signed-off-by: André Draszik <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Bean Huo <[email protected]>
    Reviewed-by: Manivannan Sadhasivam <[email protected]>
    Acked-by: Eric Biggers <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

scsi: ufs: qcom: Fix crypto key eviction [+ + +]
Author: Eric Biggers <[email protected]>
Date:   Mon Dec 9 19:08:39 2024 -0800

    scsi: ufs: qcom: Fix crypto key eviction
    
    commit 7a0905caf5665be41094a6ceb5e9d2524de4627a upstream.
    
    Commit 56541c7c4468 ("scsi: ufs: ufs-qcom: Switch to the new ICE API")
    introduced an incorrect check of the algorithm ID into the key eviction
    path, and thus qcom_ice_evict_key() is no longer ever called.  Fix it.
    
    Fixes: 56541c7c4468 ("scsi: ufs: ufs-qcom: Switch to the new ICE API")
    Cc: [email protected]
    Cc: Abel Vesa <[email protected]>
    Signed-off-by: Eric Biggers <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
seccomp: passthrough uretprobe systemcall without filtering [+ + +]
Author: Eyal Birger <[email protected]>
Date:   Sun Feb 2 08:29:20 2025 -0800

    seccomp: passthrough uretprobe systemcall without filtering
    
    commit cf6cb56ef24410fb5308f9655087f1eddf4452e6 upstream.
    
    When attaching uretprobes to processes running inside docker, the attached
    process is segfaulted when encountering the retprobe.
    
    The reason is that now that uretprobe is a system call the default seccomp
    filters in docker block it as they only allow a specific set of known
    syscalls. This is true for other userspace applications which use seccomp
    to control their syscall surface.
    
    Since uretprobe is a "kernel implementation detail" system call which is
    not used by userspace application code directly, it is impractical and
    there's very little point in forcing all userspace applications to
    explicitly allow it in order to avoid crashing tracked processes.
    
    Pass this systemcall through seccomp without depending on configuration.
    
    Note: uretprobe is currently only x86_64 and isn't expected to ever be
    supported in i386.
    
    Fixes: ff474a78cef5 ("uprobe: Add uretprobe syscall to speed up return probe")
    Reported-by: Rafael Buchbinder <[email protected]>
    Closes: https://lore.kernel.org/lkml/CAHsH6Gs3Eh8DFU0wq58c_LF8A4_+o6z456J7BidmcVY2AqOnHQ@mail.gmail.com/
    Link: https://lore.kernel.org/lkml/[email protected]/T/#me2676c378eff2d6a33f3054fed4a5f3afa64e65b
    Link: https://lore.kernel.org/lkml/[email protected]/
    Cc: [email protected]
    Signed-off-by: Eyal Birger <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    [kees: minimized changes for easier backporting, tweaked commit log]
    Signed-off-by: Kees Cook <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
selftests/net/ipsec: Fix Null pointer dereference in rtattr_pack() [+ + +]
Author: Liu Ye <[email protected]>
Date:   Thu Jan 16 09:30:37 2025 +0800

    selftests/net/ipsec: Fix Null pointer dereference in rtattr_pack()
    
    [ Upstream commit 3a0b7fa095212b51ed63892540c4f249991a2d74 ]
    
    Address Null pointer dereference / undefined behavior in rtattr_pack
    (note that size is 0 in the bad case).
    
    Flagged by cppcheck as:
        tools/testing/selftests/net/ipsec.c:230:25: warning: Possible null pointer
        dereference: payload [nullPointer]
        memcpy(RTA_DATA(attr), payload, size);
                               ^
        tools/testing/selftests/net/ipsec.c:1618:54: note: Calling function 'rtattr_pack',
        4th argument 'NULL' value is 0
        if (rtattr_pack(&req.nh, sizeof(req), XFRMA_IF_ID, NULL, 0)) {
                                                           ^
        tools/testing/selftests/net/ipsec.c:230:25: note: Null pointer dereference
        memcpy(RTA_DATA(attr), payload, size);
                               ^
    Signed-off-by: Liu Ye <[email protected]>
    
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
selftests: drv-net: rss_ctx: add missing cleanup in queue reconfigure [+ + +]
Author: Jakub Kicinski <[email protected]>
Date:   Fri Jan 31 17:30:39 2025 -0800

    selftests: drv-net: rss_ctx: add missing cleanup in queue reconfigure
    
    [ Upstream commit de379dfd9ada2995699052f4a1ecebe5d8f8d70f ]
    
    Commit under Fixes adds ntuple rules but never deletes them.
    
    Fixes: 29a4bc1fe961 ("selftest: extend test_rss_context_queue_reconfigure for action addition")
    Reviewed-by: Joe Damato <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

selftests: mptcp: connect: -f: no reconnect [+ + +]
Author: Matthieu Baerts (NGI0) <[email protected]>
Date:   Tue Feb 4 23:19:53 2025 +0100

    selftests: mptcp: connect: -f: no reconnect
    
    commit 5368a67307b3b2c347dc8965ac55b888be665934 upstream.
    
    The '-f' parameter is there to force the kernel to emit MPTCP FASTCLOSE
    by closing the connection with unread bytes in the receive queue.
    
    The xdisconnect() helper was used to stop the connection, but it does
    more than that: it will shut it down, then wait before reconnecting to
    the same address. This causes the mptcp_join's "fastclose test" to fail
    all the time.
    
    This failure is due to a recent change, with commit 218cc166321f
    ("selftests: mptcp: avoid spurious errors on disconnect"), but that went
    unnoticed because the test is currently ignored. The recent modification
    only shown an existing issue: xdisconnect() doesn't need to be used
    here, only the shutdown() part is needed.
    
    Fixes: 6bf41020b72b ("selftests: mptcp: update and extend fastclose test-cases")
    Cc: [email protected]
    Reviewed-by: Mat Martineau <[email protected]>
    Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
serial: sh-sci: Do not probe the serial port if its slot in sci_ports[] is in use [+ + +]
Author: Claudiu Beznea <[email protected]>
Date:   Thu Jan 16 20:22:47 2025 +0200

    serial: sh-sci: Do not probe the serial port if its slot in sci_ports[] is in use
    
    commit 9f7dea875cc7f9c1a56a5c688290634a59cd1420 upstream.
    
    In the sh-sci driver, sci_ports[0] is used by earlycon. If the earlycon is
    still active when sci_probe() is called and the new serial port is supposed
    to map to sci_ports[0], return -EBUSY to prevent breaking the earlycon.
    
    This situation should occurs in debug scenarios, and users should be
    aware of the potential conflict.
    
    Fixes: 0b0cced19ab1 ("serial: sh-sci: Add CONFIG_SERIAL_EARLYCON support")
    Cc: [email protected]
    Signed-off-by: Claudiu Beznea <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

serial: sh-sci: Drop __initdata macro for port_cfg [+ + +]
Author: Claudiu Beznea <[email protected]>
Date:   Thu Jan 16 20:22:45 2025 +0200

    serial: sh-sci: Drop __initdata macro for port_cfg
    
    commit eaeee4225dba30bef4d424bdf134a07b7f423e8b upstream.
    
    The port_cfg object is used by serial_console_write(), which serves as
    the write function for the earlycon device. Marking port_cfg as __initdata
    causes it to be freed after kernel initialization, resulting in earlycon
    becoming unavailable thereafter. Remove the __initdata macro from port_cfg
    to resolve this issue.
    
    Fixes: 0b0cced19ab1 ("serial: sh-sci: Add CONFIG_SERIAL_EARLYCON support")
    Cc: [email protected]
    Reviewed-by: Geert Uytterhoeven <[email protected]>
    Signed-off-by: Claudiu Beznea <[email protected]>
    Fixes: 0b0cced19ab15c9e ("serial: sh-sci: Add CONFIG_SERIAL_EARLYCON support")
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
smb: client: change lease epoch type from unsigned int to __u16 [+ + +]
Author: Meetakshi Setiya <[email protected]>
Date:   Thu Feb 6 01:50:41 2025 -0500

    smb: client: change lease epoch type from unsigned int to __u16
    
    commit 57e4a9bd61c308f607bc3e55e8fa02257b06b552 upstream.
    
    MS-SMB2 section 2.2.13.2.10 specifies that 'epoch' should be a 16-bit
    unsigned integer used to track lease state changes. Change the data
    type of all instances of 'epoch' from unsigned int to __u16. This
    simplifies the epoch change comparisons and makes the code more
    compliant with the protocol spec.
    
    Cc: [email protected]
    Signed-off-by: Meetakshi Setiya <[email protected]>
    Reviewed-by: Shyam Prasad N <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

smb: client: fix order of arguments of tracepoints [+ + +]
Author: Ruben Devos <[email protected]>
Date:   Sat Jan 18 21:03:30 2025 +0100

    smb: client: fix order of arguments of tracepoints
    
    commit 11f8b80ab9f99291dc88d09855b9f8f43b772335 upstream.
    
    The tracepoints based on smb3_inf_compound_*_class have tcon id and
    session id swapped around. This results in incorrect output in
    `trace-cmd report`.
    
    Fix the order of arguments to resolve this issue. The trace-cmd output
    below shows the before and after of the smb3_delete_enter and
    smb3_delete_done events as an example. The smb3_cmd_* events show the
    correct session and tcon id for reference.
    
    Also fix tracepoint set -> get in the SMB2_OP_GET_REPARSE case.
    
    BEFORE:
    rm-2211  [001] .....  1839.550888: smb3_delete_enter:    xid=281 sid=0x5 tid=0x3d path=\hello2.txt
    rm-2211  [001] .....  1839.550894: smb3_cmd_enter:        sid=0x1ac000000003d tid=0x5 cmd=5 mid=61
    rm-2211  [001] .....  1839.550896: smb3_cmd_enter:        sid=0x1ac000000003d tid=0x5 cmd=6 mid=62
    rm-2211  [001] .....  1839.552091: smb3_cmd_done:         sid=0x1ac000000003d tid=0x5 cmd=5 mid=61
    rm-2211  [001] .....  1839.552093: smb3_cmd_done:         sid=0x1ac000000003d tid=0x5 cmd=6 mid=62
    rm-2211  [001] .....  1839.552103: smb3_delete_done:     xid=281 sid=0x5 tid=0x3d
    
    AFTER:
    rm-2501  [001] .....  3237.656110: smb3_delete_enter:    xid=88 sid=0x1ac0000000041 tid=0x5 path=\hello2.txt
    rm-2501  [001] .....  3237.656122: smb3_cmd_enter:        sid=0x1ac0000000041 tid=0x5 cmd=5 mid=84
    rm-2501  [001] .....  3237.656123: smb3_cmd_enter:        sid=0x1ac0000000041 tid=0x5 cmd=6 mid=85
    rm-2501  [001] .....  3237.657909: smb3_cmd_done:         sid=0x1ac0000000041 tid=0x5 cmd=5 mid=84
    rm-2501  [001] .....  3237.657909: smb3_cmd_done:         sid=0x1ac0000000041 tid=0x5 cmd=6 mid=85
    rm-2501  [001] .....  3237.657922: smb3_delete_done:     xid=88 sid=0x1ac0000000041 tid=0x5
    
    Cc: [email protected]
    Signed-off-by: Ruben Devos <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
soc: mediatek: mtk-devapc: Fix leaking IO map on driver remove [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Sat Jan 4 15:20:12 2025 +0100

    soc: mediatek: mtk-devapc: Fix leaking IO map on driver remove
    
    commit c9c0036c1990da8d2dd33563e327e05a775fcf10 upstream.
    
    Driver removal should fully clean up - unmap the memory.
    
    Fixes: 0890beb22618 ("soc: mediatek: add mt6779 devapc driver")
    Cc: [email protected]
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

soc: mediatek: mtk-devapc: Fix leaking IO map on error paths [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Sat Jan 4 15:20:11 2025 +0100

    soc: mediatek: mtk-devapc: Fix leaking IO map on error paths
    
    commit c0eb059a4575ed57f265d9883a5203799c19982c upstream.
    
    Error paths of mtk_devapc_probe() should unmap the memory.  Reported by
    Smatch:
    
      drivers/soc/mediatek/mtk-devapc.c:292 mtk_devapc_probe() warn: 'ctx->infra_base' from of_iomap() not released on lines: 277,281,286.
    
    Fixes: 0890beb22618 ("soc: mediatek: add mt6779 devapc driver")
    Cc: [email protected]
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

soc: qcom: llcc: Enable LLCC_WRCACHE at boot on X1 [+ + +]
Author: Konrad Dybcio <[email protected]>
Date:   Thu Dec 19 19:53:29 2024 +0100

    soc: qcom: llcc: Enable LLCC_WRCACHE at boot on X1
    
    commit 35d8bc131de0f0f280f0db42499512d79f05f456 upstream.
    
    The Last Level Cache is split into many slices, each one of which can
    be toggled on or off.
    
    Only certain slices are recommended to be turned on unconditionally,
    in order to reach optimal performance/latency/power levels.
    
    Enable WRCACHE on X1 at boot, in accordance with internal
    recommendations.
    
    No significant performance difference is expected.
    
    Fixes: b3cf69a43502 ("soc: qcom: llcc: Add configuration data for X1E80100")
    Cc: [email protected]
    Reviewed-by: Rajendra Nayak <[email protected]>
    Signed-off-by: Konrad Dybcio <[email protected]>
    Reviewed-by: Johan Hovold <[email protected]>
    Tested-by: Johan Hovold <[email protected]>
    Link: https://lore.kernel.org/r/20241219-topic-llcc_x1e_wrcache-v3-1-b9848d9c3d63@oss.qualcomm.com
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

soc: qcom: smem_state: fix missing of_node_put in error path [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Thu Aug 22 18:48:51 2024 +0200

    soc: qcom: smem_state: fix missing of_node_put in error path
    
    commit 70096b4990848229d0784c5e51dc3c7c072f1111 upstream.
    
    If of_parse_phandle_with_args() succeeds, the OF node reference should
    be dropped, regardless of number of phandle arguments.
    
    Cc: [email protected]
    Fixes: 9460ae2ff308 ("soc: qcom: Introduce common SMEM state machine code")
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Reviewed-by: Dmitry Baryshkov <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

soc: qcom: socinfo: Avoid out of bounds read of serial number [+ + +]
Author: Stephan Gerhold <[email protected]>
Date:   Mon Dec 30 20:59:35 2024 +0100

    soc: qcom: socinfo: Avoid out of bounds read of serial number
    
    commit 22cf4fae6660b6e1a583a41cbf84e3046ca9ccd0 upstream.
    
    On MSM8916 devices, the serial number exposed in sysfs is constant and does
    not change across individual devices. It's always:
    
      db410c:/sys/devices/soc0$ cat serial_number
      2644893864
    
    The firmware used on MSM8916 exposes SOCINFO_VERSION(0, 8), which does not
    have support for the serial_num field in the socinfo struct. There is an
    existing check to avoid exposing the serial number in that case, but it's
    not correct: When checking the item_size returned by SMEM, we need to make
    sure the *end* of the serial_num is within bounds, instead of comparing
    with the *start* offset. The serial_number currently exposed on MSM8916
    devices is just an out of bounds read of whatever comes after the socinfo
    struct in SMEM.
    
    Fix this by changing offsetof() to offsetofend(), so that the size of the
    field is also taken into account.
    
    Cc: [email protected]
    Fixes: efb448d0a3fc ("soc: qcom: Add socinfo driver")
    Signed-off-by: Stephan Gerhold <[email protected]>
    Reviewed-by: Dmitry Baryshkov <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

soc: samsung: exynos-pmu: Fix uninitialized ret in tensor_set_bits_atomic() [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Sat Jan 4 14:56:05 2025 +0100

    soc: samsung: exynos-pmu: Fix uninitialized ret in tensor_set_bits_atomic()
    
    commit eca836dfd8386b32f1aae60f8e323218ac6a0b75 upstream.
    
    If tensor_set_bits_atomic() is called with a mask of 0 the function will
    just iterate over its bit, not perform any updates and return stack
    value of 'ret'.
    
    Also reported by smatch:
    
      drivers/soc/samsung/exynos-pmu.c:129 tensor_set_bits_atomic() error: uninitialized symbol 'ret'.
    
    Fixes: 0b7c6075022c ("soc: samsung: exynos-pmu: Add regmap support for SoCs that protect PMU regs")
    Cc: [email protected]
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
spi: atmel-qspi: Memory barriers after memory-mapped I/O [+ + +]
Author: Bence Csókás <[email protected]>
Date:   Thu Dec 19 10:12:58 2024 +0100

    spi: atmel-qspi: Memory barriers after memory-mapped I/O
    
    commit be92ab2de0ee1a13291c3b47b2d7eb24d80c0a2c upstream.
    
    The QSPI peripheral control and status registers are
    accessible via the SoC's APB bus, whereas MMIO transactions'
    data travels on the AHB bus.
    
    Microchip documentation and even sample code from Atmel
    emphasises the need for a memory barrier before the first
    MMIO transaction to the AHB-connected QSPI, and before the
    last write to its registers via APB. This is achieved by
    the following lines in `atmel_qspi_transfer()`:
    
            /* Dummy read of QSPI_IFR to synchronize APB and AHB accesses */
            (void)atmel_qspi_read(aq, QSPI_IFR);
    
    However, the current documentation makes no mention to
    synchronization requirements in the other direction, i.e.
    after the last data written via AHB, and before the first
    register access on APB.
    
    In our case, we were facing an issue where the QSPI peripheral
    would cease to send any new CSR (nCS Rise) interrupts,
    leading to a timeout in `atmel_qspi_wait_for_completion()`
    and ultimately this panic in higher levels:
    
            ubi0 error: ubi_io_write: error -110 while writing 63108 bytes
     to PEB 491:128, written 63104 bytes
    
    After months of extensive research of the codebase, fiddling
    around the debugger with kgdb, and back-and-forth with
    Microchip, we came to the conclusion that the issue is
    probably that the peripheral is still busy receiving on AHB
    when the LASTXFER bit is written to its Control Register
    on APB, therefore this write gets lost, and the peripheral
    still thinks there is more data to come in the MMIO transfer.
    This was first formulated when we noticed that doubling the
    write() of QSPI_CR_LASTXFER seemed to solve the problem.
    
    Ultimately, the solution is to introduce memory barriers
    after the AHB-mapped MMIO transfers, to ensure ordering.
    
    Fixes: d5433def3153 ("mtd: spi-nor: atmel-quadspi: Add spi-mem support to atmel-quadspi")
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected] # c0a0203cf579: ("spi: atmel-quadspi: Create `atmel_qspi_ops`"...)
    Cc: [email protected] # 6.x.y
    Signed-off-by: Bence Csókás <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: atmel-quadspi: Create `atmel_qspi_ops` to support newer SoC families [+ + +]
Author: Csókás, Bence <[email protected]>
Date:   Thu Nov 28 18:43:14 2024 +0100

    spi: atmel-quadspi: Create `atmel_qspi_ops` to support newer SoC families
    
    commit c0a0203cf57963792d59b3e4317a1d07b73df42a upstream.
    
    Refactor the code to introduce an ops struct, to prepare for merging
    support for later SoCs, such as SAMA7G5. This code was based on the
    vendor's kernel (linux4microchip). Cc'ing original contributors.
    
    Signed-off-by: Csókás, Bence <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
statmount: let unset strings be empty [+ + +]
Author: Miklos Szeredi <[email protected]>
Date:   Thu Jan 30 13:15:00 2025 +0100

    statmount: let unset strings be empty
    
    commit e52e97f09fb66fd868260d05bd6b74a9a3db39ee upstream.
    
    Just like it's normal for unset values to be zero, unset strings should be
    empty instead of containing random values.
    
    It seems to be a typical mistake that the mask returned by statmount is not
    checked, which can result in various bugs.
    
    With this fix, these bugs are prevented, since it is highly likely that
    userspace would just want to turn the missing mask case into an empty
    string anyway (most of the recently found cases are of this type).
    
    Link: https://lore.kernel.org/all/CAJfpegsVCPfCn2DpM8iiYSS5DpMsLB8QBUCHecoj6s0Vxf4jzg@mail.gmail.com/
    Fixes: 68385d77c05b ("statmount: simplify string option retrieval")
    Fixes: 46eae99ef733 ("add statmount(2) syscall")
    Cc: [email protected] # v6.8
    Signed-off-by: Miklos Szeredi <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Jeff Layton <[email protected]>
    Signed-off-by: Christian Brauner <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
tg3: Disable tg3 PCIe AER on system reboot [+ + +]
Author: Lenny Szubowicz <[email protected]>
Date:   Thu Jan 30 16:57:54 2025 -0500

    tg3: Disable tg3 PCIe AER on system reboot
    
    [ Upstream commit e0efe83ed325277bb70f9435d4d9fc70bebdcca8 ]
    
    Disable PCIe AER on the tg3 device on system reboot on a limited
    list of Dell PowerEdge systems. This prevents a fatal PCIe AER event
    on the tg3 device during the ACPI _PTS (prepare to sleep) method for
    S5 on those systems. The _PTS is invoked by acpi_enter_sleep_state_prep()
    as part of the kernel's reboot sequence as a result of commit
    38f34dba806a ("PM: ACPI: reboot: Reinstate S5 for reboot").
    
    There was an earlier fix for this problem by commit 2ca1c94ce0b6
    ("tg3: Disable tg3 device on system reboot to avoid triggering AER").
    But it was discovered that this earlier fix caused a reboot hang
    when some Dell PowerEdge servers were booted via ipxe. To address
    this reboot hang, the earlier fix was essentially reverted by commit
    9fc3bc764334 ("tg3: power down device only on SYSTEM_POWER_OFF").
    This re-exposed the tg3 PCIe AER on reboot problem.
    
    This fix is not an ideal solution because the root cause of the AER
    is in system firmware. Instead, it's a targeted work-around in the
    tg3 driver.
    
    Note also that the PCIe AER must be disabled on the tg3 device even
    if the system is configured to use "firmware first" error handling.
    
    V3:
       - Fix sparse warning on improper comparison of pdev->current_state
       - Adhere to netdev comment style
    
    Fixes: 9fc3bc764334 ("tg3: power down device only on SYSTEM_POWER_OFF")
    Signed-off-by: Lenny Szubowicz <[email protected]>
    Reviewed-by: Pavan Chebbi <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
timers/migration: Fix off-by-one root mis-connection [+ + +]
Author: Frederic Weisbecker <[email protected]>
Date:   Wed Feb 5 17:02:20 2025 +0100

    timers/migration: Fix off-by-one root mis-connection
    
    commit 868c9037df626b3c245ee26a290a03ae1f9f58d3 upstream.
    
    Before attaching a new root to the old root, the children counter of the
    new root is checked to verify that only the upcoming CPU's top group have
    been connected to it. However since the recently added commit b729cc1ec21a
    ("timers/migration: Fix another race between hotplug and idle entry/exit")
    this check is not valid anymore because the old root is pre-accounted
    as a child to the new root. Therefore after connecting the upcoming
    CPU's top group to the new root, the children count to be expected must
    be 2 and not 1 anymore.
    
    This omission results in the old root to not be connected to the new
    root. Then eventually the system may run with more than one top level,
    which defeats the purpose of a single idle migrator.
    
    Also the old root is pre-accounted but not connected upon the new root
    creation. But it can be connected to the new root later on. Therefore
    the old root may be accounted twice to the new root. The propagation of
    such overcommit can end up creating a double final top-level root with a
    groupmask incorrectly initialized. Although harmless given that the final
    top level roots will never have a parent to walk up to, this oddity
    opportunistically reported the core issue:
    
      WARNING: CPU: 8 PID: 0 at kernel/time/timer_migration.c:543 tmigr_requires_handle_remote
      CPU: 8 UID: 0 PID: 0 Comm: swapper/8
      RIP: 0010:tmigr_requires_handle_remote
      Call Trace:
       <IRQ>
       ? tmigr_requires_handle_remote
       ? hrtimer_run_queues
       update_process_times
       tick_periodic
       tick_handle_periodic
       __sysvec_apic_timer_interrupt
       sysvec_apic_timer_interrupt
      </IRQ>
    
    Fix the problem by taking the old root into account in the children count
    of the new root so the connection is not omitted.
    
    Also warn when more than one top level group exists to better detect
    similar issues in the future.
    
    Fixes: b729cc1ec21a ("timers/migration: Fix another race between hotplug and idle entry/exit")
    Reported-by: Matt Fleming <[email protected]>
    Signed-off-by: Frederic Weisbecker <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/all/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
tipc: re-order conditions in tipc_crypto_key_rcv() [+ + +]
Author: Dan Carpenter <[email protected]>
Date:   Fri Jan 17 12:36:14 2025 +0300

    tipc: re-order conditions in tipc_crypto_key_rcv()
    
    [ Upstream commit 5fe71fda89745fc3cd95f70d06e9162b595c3702 ]
    
    On a 32bit system the "keylen + sizeof(struct tipc_aead_key)" math could
    have an integer wrapping issue.  It doesn't matter because the "keylen"
    is checked on the next line, but just to make life easier for static
    analysis tools, let's re-order these conditions and avoid the integer
    overflow.
    
    Signed-off-by: Dan Carpenter <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
tomoyo: don't emit warning in tomoyo_write_control() [+ + +]
Author: Tetsuo Handa <[email protected]>
Date:   Mon Dec 16 19:38:40 2024 +0900

    tomoyo: don't emit warning in tomoyo_write_control()
    
    [ Upstream commit 3df7546fc03b8f004eee0b9e3256369f7d096685 ]
    
    syzbot is reporting too large allocation warning at tomoyo_write_control(),
    for one can write a very very long line without new line character. To fix
    this warning, I use __GFP_NOWARN rather than checking for KMALLOC_MAX_SIZE,
    for practically a valid line should be always shorter than 32KB where the
    "too small to fail" memory-allocation rule applies.
    
    One might try to write a valid line that is longer than 32KB, but such
    request will likely fail with -ENOMEM. Therefore, I feel that separately
    returning -EINVAL when a line is longer than KMALLOC_MAX_SIZE is redundant.
    There is no need to distinguish over-32KB and over-KMALLOC_MAX_SIZE.
    
    Reported-by: [email protected]
    Closes: https://syzkaller.appspot.com/bug?extid=7536f77535e5210a5c76
    Reported-by: Leo Stone <[email protected]>
    Closes: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Tetsuo Handa <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
tpm: Change to kvalloc() in eventlog/acpi.c [+ + +]
Author: Jarkko Sakkinen <[email protected]>
Date:   Fri Dec 27 17:39:09 2024 +0200

    tpm: Change to kvalloc() in eventlog/acpi.c
    
    commit a3a860bc0fd6c07332e4911cf9a238d20de90173 upstream.
    
    The following failure was reported on HPE ProLiant D320:
    
    [   10.693310][    T1] tpm_tis STM0925:00: 2.0 TPM (device-id 0x3, rev-id 0)
    [   10.848132][    T1] ------------[ cut here ]------------
    [   10.853559][    T1] WARNING: CPU: 59 PID: 1 at mm/page_alloc.c:4727 __alloc_pages_noprof+0x2ca/0x330
    [   10.862827][    T1] Modules linked in:
    [   10.866671][    T1] CPU: 59 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.0-lp155.2.g52785e2-default #1 openSUSE Tumbleweed (unreleased) 588cd98293a7c9eba9013378d807364c088c9375
    [   10.882741][    T1] Hardware name: HPE ProLiant DL320 Gen12/ProLiant DL320 Gen12, BIOS 1.20 10/28/2024
    [   10.892170][    T1] RIP: 0010:__alloc_pages_noprof+0x2ca/0x330
    [   10.898103][    T1] Code: 24 08 e9 4a fe ff ff e8 34 36 fa ff e9 88 fe ff ff 83 fe 0a 0f 86 b3 fd ff ff 80 3d 01 e7 ce 01 00 75 09 c6 05 f8 e6 ce 01 01 <0f> 0b 45 31 ff e9 e5 fe ff ff f7 c2 00 00 08 00 75 42 89 d9 80 e1
    [   10.917750][    T1] RSP: 0000:ffffb7cf40077980 EFLAGS: 00010246
    [   10.923777][    T1] RAX: 0000000000000000 RBX: 0000000000040cc0 RCX: 0000000000000000
    [   10.931727][    T1] RDX: 0000000000000000 RSI: 000000000000000c RDI: 0000000000040cc0
    
    The above transcript shows that ACPI pointed a 16 MiB buffer for the log
    events because RSI maps to the 'order' parameter of __alloc_pages_noprof().
    Address the bug by moving from devm_kmalloc() to devm_add_action() and
    kvmalloc() and devm_add_action().
    
    Suggested-by: Ard Biesheuvel <[email protected]>
    Cc: [email protected] # v2.6.16+
    Fixes: 55a82ab3181b ("[PATCH] tpm: add bios measurement log")
    Reported-by: Andy Liang <[email protected]>
    Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219495
    Reviewed-by: Ard Biesheuvel <[email protected]>
    Reviewed-by: Stefan Berger <[email protected]>
    Reviewed-by: Takashi Iwai <[email protected]>
    Tested-by: Andy Liang <[email protected]>
    Signed-off-by: Jarkko Sakkinen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
tracing/osnoise: Fix resetting of tracepoints [+ + +]
Author: Steven Rostedt <[email protected]>
Date:   Thu Jan 23 20:41:59 2025 -0500

    tracing/osnoise: Fix resetting of tracepoints
    
    commit e3ff4245928f948f3eb2e852aa350b870421c358 upstream.
    
    If a timerlat tracer is started with the osnoise option OSNOISE_WORKLOAD
    disabled, but then that option is enabled and timerlat is removed, the
    tracepoints that were enabled on timerlat registration do not get
    disabled. If the option is disabled again and timelat is started, then it
    triggers a warning in the tracepoint code due to registering the
    tracepoint again without ever disabling it.
    
    Do not use the same user space defined options to know to disable the
    tracepoints when timerlat is removed. Instead, set a global flag when it
    is enabled and use that flag to know to disable the events.
    
     ~# echo NO_OSNOISE_WORKLOAD > /sys/kernel/tracing/osnoise/options
     ~# echo timerlat > /sys/kernel/tracing/current_tracer
     ~# echo OSNOISE_WORKLOAD > /sys/kernel/tracing/osnoise/options
     ~# echo nop > /sys/kernel/tracing/current_tracer
     ~# echo NO_OSNOISE_WORKLOAD > /sys/kernel/tracing/osnoise/options
     ~# echo timerlat > /sys/kernel/tracing/current_tracer
    
    Triggers:
    
     ------------[ cut here ]------------
     WARNING: CPU: 6 PID: 1337 at kernel/tracepoint.c:294 tracepoint_add_func+0x3b6/0x3f0
     Modules linked in:
     CPU: 6 UID: 0 PID: 1337 Comm: rtla Not tainted 6.13.0-rc4-test-00018-ga867c441128e-dirty #73
     Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
     RIP: 0010:tracepoint_add_func+0x3b6/0x3f0
     Code: 48 8b 53 28 48 8b 73 20 4c 89 04 24 e8 23 59 11 00 4c 8b 04 24 e9 36 fe ff ff 0f 0b b8 ea ff ff ff 45 84 e4 0f 84 68 fe ff ff <0f> 0b e9 61 fe ff ff 48 8b 7b 18 48 85 ff 0f 84 4f ff ff ff 49 8b
     RSP: 0018:ffffb9b003a87ca0 EFLAGS: 00010202
     RAX: 00000000ffffffef RBX: ffffffff92f30860 RCX: 0000000000000000
     RDX: 0000000000000000 RSI: ffff9bf59e91ccd0 RDI: ffffffff913b6410
     RBP: 000000000000000a R08: 00000000000005c7 R09: 0000000000000002
     R10: ffffb9b003a87ce0 R11: 0000000000000002 R12: 0000000000000001
     R13: ffffb9b003a87ce0 R14: ffffffffffffffef R15: 0000000000000008
     FS:  00007fce81209240(0000) GS:ffff9bf6fdd00000(0000) knlGS:0000000000000000
     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: 000055e99b728000 CR3: 00000001277c0002 CR4: 0000000000172ef0
     Call Trace:
      <TASK>
      ? __warn.cold+0xb7/0x14d
      ? tracepoint_add_func+0x3b6/0x3f0
      ? report_bug+0xea/0x170
      ? handle_bug+0x58/0x90
      ? exc_invalid_op+0x17/0x70
      ? asm_exc_invalid_op+0x1a/0x20
      ? __pfx_trace_sched_migrate_callback+0x10/0x10
      ? tracepoint_add_func+0x3b6/0x3f0
      ? __pfx_trace_sched_migrate_callback+0x10/0x10
      ? __pfx_trace_sched_migrate_callback+0x10/0x10
      tracepoint_probe_register+0x78/0xb0
      ? __pfx_trace_sched_migrate_callback+0x10/0x10
      osnoise_workload_start+0x2b5/0x370
      timerlat_tracer_init+0x76/0x1b0
      tracing_set_tracer+0x244/0x400
      tracing_set_trace_write+0xa0/0xe0
      vfs_write+0xfc/0x570
      ? do_sys_openat2+0x9c/0xe0
      ksys_write+0x72/0xf0
      do_syscall_64+0x79/0x1c0
      entry_SYSCALL_64_after_hwframe+0x76/0x7e
    
    Cc: [email protected]
    Cc: Masami Hiramatsu <[email protected]>
    Cc: Mathieu Desnoyers <[email protected]>
    Cc: Tomas Glozar <[email protected]>
    Cc: Gabriele Monaco <[email protected]>
    Cc: Luis Goncalves <[email protected]>
    Cc: John Kacur <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Fixes: e88ed227f639e ("tracing/timerlat: Add user-space interface")
    Signed-off-by: Steven Rostedt (Google) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
tty: Permit some TIOCL_SETSEL modes without CAP_SYS_ADMIN [+ + +]
Author: Günther Noack <[email protected]>
Date:   Fri Jan 10 14:21:22 2025 +0000

    tty: Permit some TIOCL_SETSEL modes without CAP_SYS_ADMIN
    
    commit 2f83e38a095f8bf7c6029883d894668b03b9bd93 upstream.
    
    With this, processes without CAP_SYS_ADMIN are able to use TIOCLINUX with
    subcode TIOCL_SETSEL, in the selection modes TIOCL_SETPOINTER,
    TIOCL_SELCLEAR and TIOCL_SELMOUSEREPORT.
    
    TIOCL_SETSEL was previously changed to require CAP_SYS_ADMIN, as this IOCTL
    let callers change the selection buffer and could be used to simulate
    keypresses.  These three TIOCL_SETSEL selection modes, however, are safe to
    use, as they do not modify the selection buffer.
    
    This fixes a mouse support regression that affected Emacs (invisible mouse
    cursor).
    
    Cc: stable <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Fixes: 8d1b43f6a6df ("tty: Restrict access to TIOCLINUX' copy-and-paste subcommands")
    Signed-off-by: Günther Noack <[email protected]>
    Reviewed-by: Kees Cook <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

tty: xilinx_uartps: split sysrq handling [+ + +]
Author: Sean Anderson <[email protected]>
Date:   Fri Jan 10 16:38:22 2025 -0500

    tty: xilinx_uartps: split sysrq handling
    
    commit b06f388994500297bb91be60ffaf6825ecfd2afe upstream.
    
    lockdep detects the following circular locking dependency:
    
    CPU 0                      CPU 1
    ========================== ============================
    cdns_uart_isr()            printk()
      uart_port_lock(port)       console_lock()
                                 cdns_uart_console_write()
                                   if (!port->sysrq)
                                     uart_port_lock(port)
      uart_handle_break()
        port->sysrq = ...
      uart_handle_sysrq_char()
        printk()
          console_lock()
    
    The fixed commit attempts to avoid this situation by only taking the
    port lock in cdns_uart_console_write if port->sysrq unset. However, if
    (as shown above) cdns_uart_console_write runs before port->sysrq is set,
    then it will try to take the port lock anyway. This may result in a
    deadlock.
    
    Fix this by splitting sysrq handling into two parts. We use the prepare
    helper under the port lock and defer handling until we release the lock.
    
    Fixes: 74ea66d4ca06 ("tty: xuartps: Improve sysrq handling")
    Signed-off-by: Sean Anderson <[email protected]>
    Cc: [email protected] # c980248179d: serial: xilinx_uartps: Use port lock wrappers
    Acked-by: John Ogness <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
tun: fix group permission check [+ + +]
Author: Stas Sergeev <[email protected]>
Date:   Thu Dec 5 10:36:14 2024 +0300

    tun: fix group permission check
    
    [ Upstream commit 3ca459eaba1bf96a8c7878de84fa8872259a01e3 ]
    
    Currently tun checks the group permission even if the user have matched.
    Besides going against the usual permission semantic, this has a
    very interesting implication: if the tun group is not among the
    supplementary groups of the tun user, then effectively no one can
    access the tun device. CAP_SYS_ADMIN still can, but its the same as
    not setting the tun ownership.
    
    This patch relaxes the group checking so that either the user match
    or the group match is enough. This avoids the situation when no one
    can access the device even though the ownership is properly set.
    
    Also I simplified the logic by removing the redundant inversions:
    tun_not_capable() --> !tun_capable()
    
    Signed-off-by: Stas Sergeev <[email protected]>
    Reviewed-by: Willem de Bruijn <[email protected]>
    Acked-by: Jason Wang <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

tun: revert fix group permission check [+ + +]
Author: Willem de Bruijn <[email protected]>
Date:   Tue Feb 4 11:10:06 2025 -0500

    tun: revert fix group permission check
    
    [ Upstream commit a70c7b3cbc0688016810bb2e0b9b8a0d6a530045 ]
    
    This reverts commit 3ca459eaba1bf96a8c7878de84fa8872259a01e3.
    
    The blamed commit caused a regression when neither tun->owner nor
    tun->group is set. This is intended to be allowed, but now requires
    CAP_NET_ADMIN.
    
    Discussion in the referenced thread pointed out that the original
    issue that prompted this patch can be resolved in userspace.
    
    The relaxed access control may also make a device accessible when it
    previously wasn't, while existing users may depend on it to not be.
    
    This is a clean pure git revert, except for fixing the indentation on
    the gid_valid line that checkpatch correctly flagged.
    
    Fixes: 3ca459eaba1b ("tun: fix group permission check")
    Link: https://lore.kernel.org/netdev/CAFqZXNtkCBT4f+PwyVRmQGoT3p1eVa01fCG_aNtpt6dakXncUg@mail.gmail.com/
    Signed-off-by: Willem de Bruijn <[email protected]>
    Cc: Ondrej Mosnacek <[email protected]>
    Cc: Stas Sergeev <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
ubi: Add a check for ubi_num [+ + +]
Author: Denis Arefev <[email protected]>
Date:   Mon Dec 2 12:36:52 2024 +0300

    ubi: Add a check for ubi_num
    
    commit 97bbf9e312c3fbaf0baa56120238825d2eb23b8a upstream.
    
    Added a check for ubi_num for negative numbers
    If the variable ubi_num takes negative values then we get:
    
    qemu-system-arm ... -append "ubi.mtd=0,0,0,-22222345" ...
    [    0.745065]  ubi_attach_mtd_dev from ubi_init+0x178/0x218
    [    0.745230]  ubi_init from do_one_initcall+0x70/0x1ac
    [    0.745344]  do_one_initcall from kernel_init_freeable+0x198/0x224
    [    0.745474]  kernel_init_freeable from kernel_init+0x18/0x134
    [    0.745600]  kernel_init from ret_from_fork+0x14/0x28
    [    0.745727] Exception stack(0x90015fb0 to 0x90015ff8)
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 83ff59a06663 ("UBI: support ubi_num on mtd.ubi command line")
    Cc: [email protected]
    Signed-off-by: Denis Arefev <[email protected]>
    Reviewed-by: Zhihao Cheng <[email protected]>
    Signed-off-by: Richard Weinberger <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
udp: gso: do not drop small packets when PMTU reduces [+ + +]
Author: Yan Zhai <[email protected]>
Date:   Fri Jan 31 00:31:39 2025 -0800

    udp: gso: do not drop small packets when PMTU reduces
    
    [ Upstream commit 235174b2bed88501fda689c113c55737f99332d8 ]
    
    Commit 4094871db1d6 ("udp: only do GSO if # of segs > 1") avoided GSO
    for small packets. But the kernel currently dismisses GSO requests only
    after checking MTU/PMTU on gso_size. This means any packets, regardless
    of their payload sizes, could be dropped when PMTU becomes smaller than
    requested gso_size. We encountered this issue in production and it
    caused a reliability problem that new QUIC connection cannot be
    established before PMTU cache expired, while non GSO sockets still
    worked fine at the same time.
    
    Ideally, do not check any GSO related constraints when payload size is
    smaller than requested gso_size, and return EMSGSIZE instead of EINVAL
    on MTU/PMTU check failure to be more specific on the error cause.
    
    Fixes: 4094871db1d6 ("udp: only do GSO if # of segs > 1")
    Signed-off-by: Yan Zhai <[email protected]>
    Suggested-by: Willem de Bruijn <[email protected]>
    Reviewed-by: Willem de Bruijn <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
usb: gadget: f_tcm: Decrement command ref count on cleanup [+ + +]
Author: Thinh Nguyen <[email protected]>
Date:   Wed Dec 11 00:31:48 2024 +0000

    usb: gadget: f_tcm: Decrement command ref count on cleanup
    
    commit 3b2a52e88ab0c9469eaadd4d4c8f57d072477820 upstream.
    
    We submitted the command with TARGET_SCF_ACK_KREF, which requires
    acknowledgment of command completion. If the command fails, make sure to
    decrement the ref count.
    
    Fixes: cff834c16d23 ("usb-gadget/tcm: Convert to TARGET_SCF_ACK_KREF I/O krefs")
    Cc: [email protected]
    Signed-off-by: Thinh Nguyen <[email protected]>
    Link: https://lore.kernel.org/r/3c667b4d9c8b0b580346a69ff53616b6a74cfea2.1733876548.git.Thinh.Nguyen@synopsys.com
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usb: gadget: f_tcm: Don't prepare BOT write request twice [+ + +]
Author: Thinh Nguyen <[email protected]>
Date:   Wed Dec 11 00:32:07 2024 +0000

    usb: gadget: f_tcm: Don't prepare BOT write request twice
    
    commit 94d9bf671ae314cacc2d7bf96bd233b4abc7cede upstream.
    
    The duplicate kmalloc here is causing memory leak. The request
    preparation in bot_send_write_request is also done in
    usbg_prepare_w_request. Remove the duplicate work.
    
    Fixes: c52661d60f63 ("usb-gadget: Initial merge of target module for UASP + BOT")
    Cc: [email protected]
    Signed-off-by: Thinh Nguyen <[email protected]>
    Link: https://lore.kernel.org/r/f4f26c3d586cde0d46f8c3bcb4e8ae32311b650d.1733876548.git.Thinh.Nguyen@synopsys.com
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usb: gadget: f_tcm: ep_autoconfig with fullspeed endpoint [+ + +]
Author: Thinh Nguyen <[email protected]>
Date:   Wed Dec 11 00:32:01 2024 +0000

    usb: gadget: f_tcm: ep_autoconfig with fullspeed endpoint
    
    commit 25224c1f07d31c261d04dfbc705a7a0f314a825d upstream.
    
    Match usb endpoint using fullspeed endpoint descriptor to make sure the
    wMaxPacketSize for fullspeed descriptors is automatically configured.
    
    Fixes: c52661d60f63 ("usb-gadget: Initial merge of target module for UASP + BOT")
    Cc: [email protected]
    Signed-off-by: Thinh Nguyen <[email protected]>
    Link: https://lore.kernel.org/r/e4507bc824aed6e7c7f5a718392ab6a7c1480a7f.1733876548.git.Thinh.Nguyen@synopsys.com
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usb: gadget: f_tcm: Translate error to sense [+ + +]
Author: Thinh Nguyen <[email protected]>
Date:   Wed Dec 11 00:31:43 2024 +0000

    usb: gadget: f_tcm: Translate error to sense
    
    commit 98fa00fd3ae43b857b4976984a135483d89d9281 upstream.
    
    When respond with check_condition error status, clear from_transport
    input so the target layer can translate the sense reason reported by
    f_tcm.
    
    Fixes: c52661d60f63 ("usb-gadget: Initial merge of target module for UASP + BOT")
    Cc: [email protected]
    Signed-off-by: Thinh Nguyen <[email protected]>
    Link: https://lore.kernel.org/r/b2a5577efe7abd0af0051229622cf7d3be5cdcd0.1733876548.git.Thinh.Nguyen@synopsys.com
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
usbnet: ipheth: break up NCM header size computation [+ + +]
Author: Foster Snowhill <[email protected]>
Date:   Sun Jan 26 00:54:07 2025 +0100

    usbnet: ipheth: break up NCM header size computation
    
    commit efcbc678a14be268040ffc1fa33c98faf2d55141 upstream.
    
    Originally, the total NCM header size was computed as the sum of two
    vaguely labelled constants. While accurate, it wasn't particularly clear
    where they were coming from.
    
    Use sizes of existing NCM structs where available. Define the total
    NDP16 size based on the maximum amount of DPEs that can fit into the
    iOS-specific fixed-size header.
    
    This change does not fix any particular issue. Rather, it introduces
    intermediate constants that will simplify subsequent commits.
    It should also make it clearer for the reader where the constant values
    come from.
    
    Cc: [email protected] # 6.5.x
    Signed-off-by: Foster Snowhill <[email protected]>
    Reviewed-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usbnet: ipheth: check that DPE points past NCM header [+ + +]
Author: Foster Snowhill <[email protected]>
Date:   Sun Jan 26 00:54:04 2025 +0100

    usbnet: ipheth: check that DPE points past NCM header
    
    commit 429fa68b58cefb9aa9de27e4089637298b46b757 upstream.
    
    By definition, a DPE points at the start of a network frame/datagram.
    Thus it makes no sense for it to point at anything that's part of the
    NCM header. It is not a security issue, but merely an indication of
    a malformed DPE.
    
    Enforce that all DPEs point at the data portion of the URB, past the
    NCM header.
    
    Fixes: a2d274c62e44 ("usbnet: ipheth: add CDC NCM support")
    Cc: [email protected]
    Signed-off-by: Foster Snowhill <[email protected]>
    Reviewed-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usbnet: ipheth: document scope of NCM implementation [+ + +]
Author: Foster Snowhill <[email protected]>
Date:   Sun Jan 26 00:54:09 2025 +0100

    usbnet: ipheth: document scope of NCM implementation
    
    commit be154b598fa54136e2be17d6dd13c8a8bc0078ce upstream.
    
    Clarify that the "NCM" implementation in `ipheth` is very limited, as
    iOS devices aren't compatible with the CDC NCM specification in regular
    tethering mode.
    
    For a standards-compliant implementation, one shall turn to
    the `cdc_ncm` module.
    
    Cc: [email protected] # 6.5.x
    Signed-off-by: Foster Snowhill <[email protected]>
    Reviewed-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usbnet: ipheth: fix DPE OoB read [+ + +]
Author: Foster Snowhill <[email protected]>
Date:   Sun Jan 26 00:54:08 2025 +0100

    usbnet: ipheth: fix DPE OoB read
    
    commit ee591f2b281721171896117f9946fced31441418 upstream.
    
    Fix an out-of-bounds DPE read, limit the number of processed DPEs to
    the amount that fits into the fixed-size NDP16 header.
    
    Fixes: a2d274c62e44 ("usbnet: ipheth: add CDC NCM support")
    Cc: [email protected]
    Signed-off-by: Foster Snowhill <[email protected]>
    Reviewed-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usbnet: ipheth: fix possible overflow in DPE length check [+ + +]
Author: Foster Snowhill <[email protected]>
Date:   Sun Jan 26 00:54:03 2025 +0100

    usbnet: ipheth: fix possible overflow in DPE length check
    
    commit c219427ed296f94bb4b91d08626776dc7719ee27 upstream.
    
    Originally, it was possible for the DPE length check to overflow if
    wDatagramIndex + wDatagramLength > U16_MAX. This could lead to an OoB
    read.
    
    Move the wDatagramIndex term to the other side of the inequality.
    
    An existing condition ensures that wDatagramIndex < urb->actual_length.
    
    Fixes: a2d274c62e44 ("usbnet: ipheth: add CDC NCM support")
    Cc: [email protected]
    Signed-off-by: Foster Snowhill <[email protected]>
    Reviewed-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usbnet: ipheth: refactor NCM datagram loop [+ + +]
Author: Foster Snowhill <[email protected]>
Date:   Sun Jan 26 00:54:06 2025 +0100

    usbnet: ipheth: refactor NCM datagram loop
    
    commit 2a9a196429e98fcc64078366c2679bc40aba5466 upstream.
    
    Introduce an rx_error label to reduce repetitions in the header
    signature checks.
    
    Store wDatagramIndex and wDatagramLength after endianness conversion to
    avoid repeated le16_to_cpu() calls.
    
    Rewrite the loop to return on a null trailing DPE, which is required
    by the CDC NCM spec. In case it is missing, fall through to rx_error.
    
    This change does not fix any particular issue. Its purpose is to
    simplify a subsequent commit that fixes a potential OoB read by limiting
    the maximum amount of processed DPEs.
    
    Cc: [email protected] # 6.5.x
    Signed-off-by: Foster Snowhill <[email protected]>
    Reviewed-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usbnet: ipheth: use static NDP16 location in URB [+ + +]
Author: Foster Snowhill <[email protected]>
Date:   Sun Jan 26 00:54:05 2025 +0100

    usbnet: ipheth: use static NDP16 location in URB
    
    commit 86586dcb75cb8fd062a518aca8ee667938b91efb upstream.
    
    Original code allowed for the start of NDP16 to be anywhere within the
    URB based on the `wNdpIndex` value in NTH16. Only the start position of
    NDP16 was checked, so it was possible for even the fixed-length part
    of NDP16 to extend past the end of URB, leading to an out-of-bounds
    read.
    
    On iOS devices, the NDP16 header always directly follows NTH16. Rely on
    and check for this specific format.
    
    This, along with NCM-specific minimal URB length check that already
    exists, will ensure that the fixed-length part of NDP16 plus a set
    amount of DPEs fit within the URB.
    
    Note that this commit alone does not fully address the OoB read.
    The limit on the amount of DPEs needs to be enforced separately.
    
    Fixes: a2d274c62e44 ("usbnet: ipheth: add CDC NCM support")
    Cc: [email protected]
    Signed-off-by: Foster Snowhill <[email protected]>
    Reviewed-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
vfio/platform: check the bounds of read/write syscalls [+ + +]
Author: Alex Williamson <[email protected]>
Date:   Wed Jan 22 10:38:30 2025 -0700

    vfio/platform: check the bounds of read/write syscalls
    
    commit ce9ff21ea89d191e477a02ad7eabf4f996b80a69 upstream.
    
    count and offset are passed from user space and not checked, only
    offset is capped to 40 bits, which can be used to read/write out of
    bounds of the device.
    
    Fixes: 6e3f26456009 (“vfio/platform: read and write support for the device fd”)
    Cc: [email protected]
    Reported-by: Mostafa Saleh <[email protected]>
    Reviewed-by: Eric Auger <[email protected]>
    Reviewed-by: Mostafa Saleh <[email protected]>
    Tested-by: Mostafa Saleh <[email protected]>
    Signed-off-by: Alex Williamson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
vmxnet3: Fix tx queue race condition with XDP [+ + +]
Author: Sankararaman Jayaraman <[email protected]>
Date:   Fri Jan 31 09:53:41 2025 +0530

    vmxnet3: Fix tx queue race condition with XDP
    
    [ Upstream commit 3f1baa91a1fdf3de9dbad4bd615b35fab347874b ]
    
    If XDP traffic runs on a CPU which is greater than or equal to
    the number of the Tx queues of the NIC, then vmxnet3_xdp_get_tq()
    always picks up queue 0 for transmission as it uses reciprocal scale
    instead of simple modulo operation.
    
    vmxnet3_xdp_xmit() and vmxnet3_xdp_xmit_frame() use the above
    returned queue without any locking which can lead to race conditions
    when multiple XDP xmits run in parallel on different CPU's.
    
    This patch uses a simple module scheme when the current CPU equals or
    exceeds the number of Tx queues on the NIC. It also adds locking in
    vmxnet3_xdp_xmit() and vmxnet3_xdp_xmit_frame() functions.
    
    Fixes: 54f00cce1178 ("vmxnet3: Add XDP support.")
    Signed-off-by: Sankararaman Jayaraman <[email protected]>
    Signed-off-by: Ronak Doshi <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
wifi: ath12k: ath12k_mac_op_set_key(): fix uninitialized symbol 'ret' [+ + +]
Author: Kalle Valo <[email protected]>
Date:   Tue Nov 26 19:11:38 2024 +0200

    wifi: ath12k: ath12k_mac_op_set_key(): fix uninitialized symbol 'ret'
    
    [ Upstream commit ad969bc9ee73fa9eda6223be2a7c0c6caf937d71 ]
    
    Dan reported that in some cases the ret variable could be uninitialized. Fix
    that by removing the out label entirely and returning zero explicitly on
    succesful cases.
    
    Also remove the unnecessary else branches to follow more the style used in
    ath12k and now it's easier to see the error handling.
    
    No functional changes.
    
    Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
    Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
    
    Reported-by: kernel test robot <[email protected]>
    Reported-by: Dan Carpenter <[email protected]>
    Closes: https://lore.kernel.org/all/[email protected]/
    Signed-off-by: Kalle Valo <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

wifi: ath12k: Fix for out-of bound access error [+ + +]
Author: Karol Przybylski <[email protected]>
Date:   Tue Nov 5 11:11:31 2024 +0100

    wifi: ath12k: Fix for out-of bound access error
    
    [ Upstream commit eb8c0534713865d190856f10bfc97cf0b88475b1 ]
    
    Selfgen stats are placed in a buffer using print_array_to_buf_index() function.
    Array length parameter passed to the function is too big, resulting in possible
    out-of bound memory error.
    Decreasing buffer size by one fixes faulty upper bound of passed array.
    
    Discovered in coverity scan, CID 1600742 and CID 1600758
    
    Signed-off-by: Karol Przybylski <[email protected]>
    Acked-by: Kalle Valo <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jeff Johnson <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

wifi: brcmfmac: Check the return value of of_property_read_string_index() [+ + +]
Author: Stefan Dösinger <[email protected]>
Date:   Mon Jan 6 20:09:58 2025 +0300

    wifi: brcmfmac: Check the return value of of_property_read_string_index()
    
    [ Upstream commit 082d9e263af8de68f0c34f67b251818205160f6e ]
    
    Somewhen between 6.10 and 6.11 the driver started to crash on my
    MacBookPro14,3. The property doesn't exist and 'tmp' remains
    uninitialized, so we pass a random pointer to devm_kstrdup().
    
    The crash I am getting looks like this:
    
    BUG: unable to handle page fault for address: 00007f033c669379
    PF: supervisor read access in kernel mode
    PF: error_code(0x0001) - permissions violation
    PGD 8000000101341067 P4D 8000000101341067 PUD 101340067 PMD 1013bb067 PTE 800000010aee9025
    Oops: Oops: 0001 [#1] SMP PTI
    CPU: 4 UID: 0 PID: 827 Comm: (udev-worker) Not tainted 6.11.8-gentoo #1
    Hardware name: Apple Inc. MacBookPro14,3/Mac-551B86E5744E2388, BIOS 529.140.2.0.0 06/23/2024
    RIP: 0010:strlen+0x4/0x30
    Code: f7 75 ec 31 c0 c3 cc cc cc cc 48 89 f8 c3 cc cc cc cc 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa <80> 3f 00 74 14 48 89 f8 48 83 c0 01 80 38 00 75 f7 48 29 f8 c3 cc
    RSP: 0018:ffffb4aac0683ad8 EFLAGS: 00010202
    RAX: 00000000ffffffea RBX: 00007f033c669379 RCX: 0000000000000001
    RDX: 0000000000000cc0 RSI: 00007f033c669379 RDI: 00007f033c669379
    RBP: 00000000ffffffea R08: 0000000000000000 R09: 00000000c0ba916a
    R10: ffffffffffffffff R11: ffffffffb61ea260 R12: ffff91f7815b50c8
    R13: 0000000000000cc0 R14: ffff91fafefffe30 R15: ffffb4aac0683b30
    FS:  00007f033ccbe8c0(0000) GS:ffff91faeed00000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007f033c669379 CR3: 0000000107b1e004 CR4: 00000000003706f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
     <TASK>
     ? __die+0x23/0x70
     ? page_fault_oops+0x149/0x4c0
     ? raw_spin_rq_lock_nested+0xe/0x20
     ? sched_balance_newidle+0x22b/0x3c0
     ? update_load_avg+0x78/0x770
     ? exc_page_fault+0x6f/0x150
     ? asm_exc_page_fault+0x26/0x30
     ? __pfx_pci_conf1_write+0x10/0x10
     ? strlen+0x4/0x30
     devm_kstrdup+0x25/0x70
     brcmf_of_probe+0x273/0x350 [brcmfmac]
    
    Signed-off-by: Stefan Dösinger <[email protected]>
    Acked-by: Arend van Spriel <[email protected]>
    Signed-off-by: Kalle Valo <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

wifi: brcmfmac: fix NULL pointer dereference in brcmf_txfinalize() [+ + +]
Author: Marcel Hamer <[email protected]>
Date:   Thu Jan 16 14:22:40 2025 +0100

    wifi: brcmfmac: fix NULL pointer dereference in brcmf_txfinalize()
    
    commit 68abd0c4ebf24cd499841a488b97a6873d5efabb upstream.
    
    On removal of the device or unloading of the kernel module a potential NULL
    pointer dereference occurs.
    
    The following sequence deletes the interface:
    
      brcmf_detach()
        brcmf_remove_interface()
          brcmf_del_if()
    
    Inside the brcmf_del_if() function the drvr->if2bss[ifidx] is updated to
    BRCMF_BSSIDX_INVALID (-1) if the bsscfgidx matches.
    
    After brcmf_remove_interface() call the brcmf_proto_detach() function is
    called providing the following sequence:
    
      brcmf_detach()
        brcmf_proto_detach()
          brcmf_proto_msgbuf_detach()
            brcmf_flowring_detach()
              brcmf_msgbuf_delete_flowring()
                brcmf_msgbuf_remove_flowring()
                  brcmf_flowring_delete()
                    brcmf_get_ifp()
                    brcmf_txfinalize()
    
    Since brcmf_get_ip() can and actually will return NULL in this case the
    call to brcmf_txfinalize() will result in a NULL pointer dereference inside
    brcmf_txfinalize() when trying to update ifp->ndev->stats.tx_errors.
    
    This will only happen if a flowring still has an skb.
    
    Although the NULL pointer dereference has only been seen when trying to
    update the tx statistic, all other uses of the ifp pointer have been
    guarded as well with an early return if ifp is NULL.
    
    Cc: [email protected]
    Signed-off-by: Marcel Hamer <[email protected]>
    Link: https://lore.kernel.org/all/[email protected]/
    Acked-by: Arend van Spriel  <[email protected]>
    Signed-off-by: Kalle Valo <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: brcmsmac: add gain range check to wlc_phy_iqcal_gainparams_nphy() [+ + +]
Author: Dmitry Antipov <[email protected]>
Date:   Tue Dec 10 10:04:41 2024 +0300

    wifi: brcmsmac: add gain range check to wlc_phy_iqcal_gainparams_nphy()
    
    [ Upstream commit 3f4a0948c3524ae50f166dbc6572a3296b014e62 ]
    
    In 'wlc_phy_iqcal_gainparams_nphy()', add gain range check to WARN()
    instead of possible out-of-bounds 'tbl_iqcal_gainparams_nphy' access.
    Compile tested only.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Signed-off-by: Dmitry Antipov <[email protected]>
    Acked-by: Arend van Spriel <[email protected]>
    Signed-off-by: Kalle Valo <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

wifi: iwlwifi: avoid memory leak [+ + +]
Author: Miri Korenblit <[email protected]>
Date:   Sat Dec 28 22:34:15 2024 +0200

    wifi: iwlwifi: avoid memory leak
    
    [ Upstream commit 80e96206a3ef348fbd658d98f2f43149c36df8bc ]
    
    A caller of iwl_acpi_get_dsm_object must free the returned object.
    iwl_acpi_get_dsm_integer returns immediately without freeing
    it if the expected size is more than 8 bytes. Fix that.
    
    Note that with the current code this will never happen, since the caller
    of iwl_acpi_get_dsm_integer already checks that the expected size if
    either 1 or 4 bytes, so it can't exceed 8 bytes.
    
    While at it, print the DSM value instead of the return value, as this
    was the intention in the first place.
    
    Signed-off-by: Miri Korenblit <[email protected]>
    Link: https://patch.msgid.link/20241228223206.bf61eaab99f8.Ibdc5df02f885208c222456d42c889c43b7e3b2f7@changeid
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

wifi: iwlwifi: pcie: Add support for new device ids [+ + +]
Author: Somashekhar(Som) <[email protected]>
Date:   Thu Dec 26 17:44:53 2024 +0200

    wifi: iwlwifi: pcie: Add support for new device ids
    
    [ Upstream commit 9b45ba3976945e8d53f2dd40541a66c690f12286 ]
    
    Add support for new device-ids 0x2730 and 0x272F.
    
    Signed-off-by: Somashekhar(Som) <[email protected]>
    Reviewed-by: Johannes Berg <[email protected]>
    Link: https://patch.msgid.link/20241226174257.6a0db60436e7.I50a66544dde6c88acd9abe4b31badab96ef04cfc@changeid
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

wifi: mt76: mt7915: add module param to select 5 GHz or 6 GHz on MT7916 [+ + +]
Author: Shayne Chen <[email protected]>
Date:   Thu Oct 10 10:38:16 2024 +0200

    wifi: mt76: mt7915: add module param to select 5 GHz or 6 GHz on MT7916
    
    commit 57af267d2b8f5d88485c6372761386d79c5e6a1a upstream.
    
    Due to a limitation in available memory, the MT7916 firmware can only
    handle either 5 GHz or 6 GHz at a time. It does not support runtime
    switching without a full restart.
    
    On older firmware, this accidentally worked to some degree due to missing
    checks, but couldn't be supported properly, because it left the 6 GHz
    channels uncalibrated.
    Newer firmware refuses to start on either band if the passed EEPROM
    data indicates support for both.
    
    Deal with this limitation by using a module parameter to specify the
    preferred band in case both are supported.
    
    Fixes: b4d093e321bd ("mt76: mt7915: add 6 GHz support")
    Cc: [email protected]
    Signed-off-by: Shayne Chen <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Felix Fietkau <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: mt76: mt7921u: Add VID/PID for TP-Link TXE50UH [+ + +]
Author: Nick Morrow <[email protected]>
Date:   Thu Dec 19 08:12:14 2024 -0600

    wifi: mt76: mt7921u: Add VID/PID for TP-Link TXE50UH
    
    commit 47d9a8ba1d7f31c674b6936b3c34ee934aa9b420 upstream.
    
    Add VID/PID 35bc/0107 for recently released TP-Link TXE50UH USB WiFi adapter.
    
    Tested-by: Shang Chieh Tseng <[email protected]>
    Signed-off-by: Nick Morrow <[email protected]>
    Cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Felix Fietkau <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: rtlwifi: rtl8821ae: Fix media status report [+ + +]
Author: Bitterblue Smith <[email protected]>
Date:   Wed Dec 18 00:53:11 2024 +0200

    wifi: rtlwifi: rtl8821ae: Fix media status report
    
    commit 66ef0289ac99e155d206ddaa0fdfad09ae3cd007 upstream.
    
    RTL8821AE is stuck transmitting at the lowest rate allowed by the rate
    mask. This is because the firmware doesn't know the device is connected
    to a network.
    
    Fix the macros SET_H2CCMD_MSRRPT_PARM_OPMODE and
    SET_H2CCMD_MSRRPT_PARM_MACID_IND to work on the first byte of __cmd,
    not the second. Now the firmware is correctly notified when the device
    is connected to a network and it activates the rate control.
    
    Before (MCS3):
    
    [  5]   0.00-1.00   sec  12.5 MBytes   105 Mbits/sec    0    339 KBytes
    [  5]   1.00-2.00   sec  10.6 MBytes  89.1 Mbits/sec    0    339 KBytes
    [  5]   2.00-3.00   sec  10.6 MBytes  89.1 Mbits/sec    0    386 KBytes
    [  5]   3.00-4.00   sec  10.6 MBytes  89.1 Mbits/sec    0    386 KBytes
    [  5]   4.00-5.00   sec  10.2 MBytes  86.0 Mbits/sec    0    427 KBytes
    
    After (MCS9):
    
    [  5]   0.00-1.00   sec  33.9 MBytes   284 Mbits/sec    0    771 KBytes
    [  5]   1.00-2.00   sec  31.6 MBytes   265 Mbits/sec    0    865 KBytes
    [  5]   2.00-3.00   sec  29.9 MBytes   251 Mbits/sec    0    963 KBytes
    [  5]   3.00-4.00   sec  28.2 MBytes   237 Mbits/sec    0    963 KBytes
    [  5]   4.00-5.00   sec  26.8 MBytes   224 Mbits/sec    0    963 KBytes
    
    Fixes: 39f40710d0b5 ("rtlwifi: rtl88821ae: Remove usage of private bit manipulation macros")
    Cc: [email protected]
    Signed-off-by: Bitterblue Smith <[email protected]>
    Acked-by: Ping-Ke Shih <[email protected]>
    Signed-off-by: Ping-Ke Shih <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: rtw88: 8703b: Fix RX/TX issues [+ + +]
Author: Vasily Khoruzhick <[email protected]>
Date:   Thu Jan 2 23:50:53 2025 -0800

    wifi: rtw88: 8703b: Fix RX/TX issues
    
    commit a806a8160a0fcaff368bb510c8a52eff37faf727 upstream.
    
    Fix 3 typos in 8703b driver. 2 typos in calibration routines are not
    fatal and do not seem to have any impact, just fix them to match vendor
    driver.
    
    However the last one in rtw8703b_set_channel_bb() clears too many bits
    in REG_OFDM0_TX_PSD_NOISE, causing TX and RX issues (neither rate goes
    above MCS0-MCS1). Vendor driver clears only 2 most significant bits.
    
    With the last typo fixed, the driver is able to reach MCS7 on Pinebook
    
    Cc: [email protected]
    Fixes: 9bb762b3a957 ("wifi: rtw88: Add definitions for 8703b chip")
    Signed-off-by: Vasily Khoruzhick <[email protected]>
    Acked-by: Ping-Ke Shih <[email protected]>
    Tested-by: Fiona Klute <[email protected]>
    Tested-by: Andrey Skvortsov <[email protected]>
    Signed-off-by: Ping-Ke Shih <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: rtw88: add __packed attribute to efuse layout struct [+ + +]
Author: Ping-Ke Shih <[email protected]>
Date:   Thu Dec 12 13:42:03 2024 +0800

    wifi: rtw88: add __packed attribute to efuse layout struct
    
    [ Upstream commit 0daa521a1c8c29ffbefe6530f0d276e74e2749d0 ]
    
    The layout struct of efuse should not do address alignment by compiler.
    Otherwise it leads unexpected layout and size for certain arch suc as arm.
    In x86-64, the results are identical before and after this patch.
    
    Also adjust bit-field to prevent over adjacent byte to avoid warning:
      rtw88/rtw8822b.h:66:1: note: offset of packed bit-field `res2` has changed in GCC 4.4
       66 | } __packed;
          | ^
    
    Reported-by: kernel test robot <[email protected]>
    Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
    Signed-off-by: Ping-Ke Shih <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

wifi: rtw88: sdio: Fix disconnection after beacon loss [+ + +]
Author: Fiona Klute <[email protected]>
Date:   Mon Jan 6 15:54:34 2025 +0200

    wifi: rtw88: sdio: Fix disconnection after beacon loss
    
    commit fb2fcfbe5eef9ae26b0425978435ae1308951e51 upstream.
    
    This is the equivalent of commit 28818b4d871b ("wifi: rtw88: usb: Fix
    disconnection after beacon loss") for SDIO chips.
    Tested on Pinephone (RTL8723CS), random disconnections became rare,
    instead of a frequent nuisance.
    
    Cc: [email protected]
    Signed-off-by: Fiona Klute <[email protected]>
    Tested-by: Vasily Khoruzhick <[email protected]> # Tested on Pinebook
    Acked-by: Ping-Ke Shih <[email protected]>
    Signed-off-by: Ping-Ke Shih <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: rtw89: add crystal_cap check to avoid setting as overflow value [+ + +]
Author: Chih-Kang Chang <[email protected]>
Date:   Thu Nov 28 13:54:33 2024 +0800

    wifi: rtw89: add crystal_cap check to avoid setting as overflow value
    
    [ Upstream commit 7b98caea39676561f22db58752551161bb36462b ]
    
    In the original flow, the crystal_cap might be calculated as a negative
    value and set as an overflow value. Therefore, we added a check to limit
    the calculated crystal_cap value. Additionally, we shrank the crystal_cap
    adjustment according to specific CFO.
    
    Signed-off-by: Chih-Kang Chang <[email protected]>
    Signed-off-by: Ping-Ke Shih <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

wifi: rtw89: pci: disable PCIE wake bit when PCIE deinit [+ + +]
Author: Ping-Ke Shih <[email protected]>
Date:   Mon Nov 11 14:38:35 2024 +0800

    wifi: rtw89: pci: disable PCIE wake bit when PCIE deinit
    
    commit 9c1df813e08832c3836c254bc8a2f83ff22dbc06 upstream.
    
    The PCIE wake bit is to control PCIE wake signal to host. When PCIE is
    going down, clear this bit to prevent waking up host unexpectedly.
    
    Signed-off-by: Ping-Ke Shih <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
x86/acpi: Fix LAPIC/x2APIC parsing order [+ + +]
Author: Zhang Rui <[email protected]>
Date:   Fri Jan 17 16:14:20 2025 +0800

    x86/acpi: Fix LAPIC/x2APIC parsing order
    
    commit 0141978ae75bd48bac13fca6de131a5071c32011 upstream.
    
    On some systems, the same CPU (with the same APIC ID) is assigned a
    different logical CPU id after commit ec9aedb2aa1a ("x86/acpi: Ignore
    invalid x2APIC entries").
    
    This means that Linux enumerates the CPUs in a different order, which
    violates ACPI specification[1] that states:
    
      "OSPM should initialize processors in the order that they appear in
       the MADT"
    
    The problematic commit parses all LAPIC entries before any x2APIC
    entries, aiming to ignore x2APIC entries with APIC ID < 255 when valid
    LAPIC entries exist. However, it disrupts the CPU enumeration order on
    systems where x2APIC entries precede LAPIC entries in the MADT.
    
    Fix this problem by:
    
     1) Parsing LAPIC entries first without registering them in the
        topology to evaluate whether valid LAPIC entries exist.
    
     2) Restoring the MADT in order parser which invokes either the LAPIC
        or the X2APIC parser function depending on the entry type.
    
    The X2APIC parser still ignores entries < 0xff in case that #1 found
    valid LAPIC entries independent of their position in the MADT table.
    
    Link: https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html#madt-processor-local-apic-sapic-structure-entry-order
    Cc: All applicable <[email protected]>
    Reported-by: Jim Mattson <[email protected]>
    Closes: https://lore.kernel.org/all/[email protected]/
    Fixes: ec9aedb2aa1a ("x86/acpi: Ignore invalid x2APIC entries")
    Signed-off-by: Zhang Rui <[email protected]>
    Reviewed-by: Jim Mattson <[email protected]>
    Tested-by: Jim Mattson <[email protected]>
    Reviewed-by: Thomas Gleixner <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
x86/amd_nb: Restrict init function to AMD-based systems [+ + +]
Author: Yazen Ghannam <[email protected]>
Date:   Fri Dec 6 16:11:55 2024 +0000

    x86/amd_nb: Restrict init function to AMD-based systems
    
    [ Upstream commit bee9e840609cc67d0a7d82f22a2130fb7a0a766d ]
    
    The code implicitly operates on AMD-based systems by matching on PCI
    IDs. However, the use of these IDs is going away.
    
    Add an explicit CPU vendor check instead of relying on PCI IDs.
    
    Signed-off-by: Yazen Ghannam <[email protected]>
    Signed-off-by: Borislav Petkov (AMD) <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
x86/boot: Use '-std=gnu11' to fix build with GCC 15 [+ + +]
Author: Nathan Chancellor <[email protected]>
Date:   Tue Jan 21 18:11:33 2025 -0700

    x86/boot: Use '-std=gnu11' to fix build with GCC 15
    
    commit ee2ab467bddfb2d7f68d996dbab94d7b88f8eaf7 upstream.
    
    GCC 15 changed the default C standard version to C23, which should not
    have impacted the kernel because it requests the gnu11 standard via
    '-std=' in the main Makefile. However, the x86 compressed boot Makefile
    uses its own set of KBUILD_CFLAGS without a '-std=' value (i.e., using
    the default), resulting in errors from the kernel's definitions of bool,
    true, and false in stddef.h, which are reserved keywords under C23.
    
      ./include/linux/stddef.h:11:9: error: expected identifier before ‘false’
         11 |         false   = 0,
      ./include/linux/types.h:35:33: error: two or more data types in declaration specifiers
         35 | typedef _Bool                   bool;
    
    Set '-std=gnu11' in the x86 compressed boot Makefile to resolve the
    error and consistently use the same C standard version for the entire
    kernel.
    
    Closes: https://lore.kernel.org/4OAhbllK7x4QJGpZjkYjtBYNLd_2whHx9oFiuZcGwtVR4hIzvduultkgfAIRZI3vQpZylu7Gl929HaYFRGeMEalWCpeMzCIIhLxxRhq4U-Y=@protonmail.com/
    Closes: https://lore.kernel.org/Z4467umXR2PZ0M1H@tucnak/
    Reported-by: Kostadin Shishmanov <[email protected]>
    Reported-by: Jakub Jelinek <[email protected]>
    Signed-off-by: Nathan Chancellor <[email protected]>
    Signed-off-by: Dave Hansen <[email protected]>
    Reviewed-by: Ard Biesheuvel <[email protected]>
    Cc:[email protected]
    Link: https://lore.kernel.org/all/20250121-x86-use-std-consistently-gcc-15-v1-1-8ab0acf645cb%40kernel.org
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
x86/efi: skip memattr table on kexec boot [+ + +]
Author: Dave Young <[email protected]>
Date:   Thu Jan 23 14:36:27 2025 +0800

    x86/efi: skip memattr table on kexec boot
    
    commit 64b45dd46e154ee7641d7e0457f3fa266e57179f upstream.
    
    efi_memattr_init() added a sanity check to avoid firmware caused corruption.
    The check is based on efi memmap entry numbers, but kexec only takes the
    runtime related memmap entries thus this caused many false warnings, see
    below thread for details:
    
    https://lore.kernel.org/all/[email protected]/
    
    Ard suggests to skip the efi memattr table in kexec, this makes sense because
    those memattr fixups are not critical.
    
    Fixes: 8fbe4c49c0cc ("efi/memattr: Ignore table if the size is clearly bogus")
    Cc: <[email protected]> # v6.13+
    Reported-by: Breno Leitao <[email protected]>
    Reported-and-tested-by: Usama Arif <[email protected]>
    Suggested-by: Ard Biesheuvel <[email protected]>
    Signed-off-by: Dave Young <[email protected]>
    Signed-off-by: Ard Biesheuvel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
x86/kexec: Allocate PGD for x86_64 transition page tables separately [+ + +]
Author: David Woodhouse <[email protected]>
Date:   Thu Dec 5 15:05:11 2024 +0000

    x86/kexec: Allocate PGD for x86_64 transition page tables separately
    
    [ Upstream commit 4b5bc2ec9a239bce261ffeafdd63571134102323 ]
    
    Now that the following fix:
    
      d0ceea662d45 ("x86/mm: Add _PAGE_NOPTISHADOW bit to avoid updating userspace page tables")
    
    stops kernel_ident_mapping_init() from scribbling over the end of a
    4KiB PGD by assuming the following 4KiB will be a userspace PGD,
    there's no good reason for the kexec PGD to be part of a single
    8KiB allocation with the control_code_page.
    
    ( It's not clear that that was the reason for x86_64 kexec doing it that
      way in the first place either; there were no comments to that effect and
      it seems to have been the case even before PTI came along. It looks like
      it was just a happy accident which prevented memory corruption on kexec. )
    
    Either way, it definitely isn't needed now. Just allocate the PGD
    separately on x86_64, like i386 already does.
    
    Signed-off-by: David Woodhouse <[email protected]>
    Signed-off-by: Ingo Molnar <[email protected]>
    Cc: Baoquan He <[email protected]>
    Cc: Vivek Goyal <[email protected]>
    Cc: Dave Young <[email protected]>
    Cc: Eric Biederman <[email protected]>
    Cc: Ard Biesheuvel <[email protected]>
    Cc: "H. Peter Anvin" <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
x86/mm: Convert unreachable() to BUG() [+ + +]
Author: Peter Zijlstra <[email protected]>
Date:   Mon Dec 16 11:08:12 2024 +0100

    x86/mm: Convert unreachable() to BUG()
    
    commit 41a1e976623eb430f7b5a8619d3810b44e6235ad upstream.
    
    Commit 2190966fbc14 ("x86: Convert unreachable() to BUG()") missed
    one.
    
    And after commit 06e24745985c ("objtool: Remove
    annotate_{,un}reachable()") the invalid use of unreachable()
    (rightfully) triggers warnings:
    
      vmlinux.o: warning: objtool: page_fault_oops() falls through to next function is_prefetch()
    
    Fixes: 2190966fbc14 ("x86: Convert unreachable() to BUG()")
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
x86/xen: add FRAME_END to xen_hypercall_hvm() [+ + +]
Author: Juergen Gross <[email protected]>
Date:   Wed Feb 5 10:07:56 2025 +0100

    x86/xen: add FRAME_END to xen_hypercall_hvm()
    
    [ Upstream commit 0bd797b801bd8ee06c822844e20d73aaea0878dd ]
    
    xen_hypercall_hvm() is missing a FRAME_END at the end, add it.
    
    Reported-by: kernel test robot <[email protected]>
    Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
    Fixes: b4845bb63838 ("x86/xen: add central hypercall functions")
    Signed-off-by: Juergen Gross <[email protected]>
    Reviewed-by: Jan Beulich <[email protected]>
    Reviewed-by: Andrew Cooper <[email protected]>
    Signed-off-by: Juergen Gross <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

x86/xen: fix xen_hypercall_hvm() to not clobber %rbx [+ + +]
Author: Juergen Gross <[email protected]>
Date:   Wed Feb 5 09:43:31 2025 +0100

    x86/xen: fix xen_hypercall_hvm() to not clobber %rbx
    
    [ Upstream commit 98a5cfd2320966f40fe049a9855f8787f0126825 ]
    
    xen_hypercall_hvm(), which is used when running as a Xen PVH guest at
    most only once during early boot, is clobbering %rbx. Depending on
    whether the caller relies on %rbx to be preserved across the call or
    not, this clobbering might result in an early crash of the system.
    
    This can be avoided by using an already saved register instead of %rbx.
    
    Fixes: b4845bb63838 ("x86/xen: add central hypercall functions")
    Signed-off-by: Juergen Gross <[email protected]>
    Reviewed-by: Jan Beulich <[email protected]>
    Reviewed-by: Andrew Cooper <[email protected]>
    Signed-off-by: Juergen Gross <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
x86: Convert unreachable() to BUG() [+ + +]
Author: Peter Zijlstra <[email protected]>
Date:   Thu Nov 28 10:39:02 2024 +0100

    x86: Convert unreachable() to BUG()
    
    [ Upstream commit 2190966fbc14ca2cd4ea76eefeb96a47d8e390df ]
    
    Avoid unreachable() as it can (and will in the absence of UBSAN)
    generate fallthrough code. Use BUG() so we get a UD2 trap (with
    unreachable annotation).
    
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Acked-by: Josh Poimboeuf <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

x86: rust: set rustc-abi=x86-softfloat on rustc>=1.86.0 [+ + +]
Author: Alice Ryhl <[email protected]>
Date:   Mon Feb 3 08:40:57 2025 +0000

    x86: rust: set rustc-abi=x86-softfloat on rustc>=1.86.0
    
    commit 6273a058383e05465083b535ed9469f2c8a48321 upstream.
    
    When using Rust on the x86 architecture, we are currently using the
    unstable target.json feature to specify the compilation target. Rustc is
    going to change how softfloat is specified in the target.json file on
    x86, thus update generate_rust_target.rs to specify softfloat using the
    new option.
    
    Note that if you enable this parameter with a compiler that does not
    recognize it, then that triggers a warning but it does not break the
    build.
    
    [ For future reference, this solves the following error:
    
            RUSTC L rust/core.o
          error: Error loading target specification: target feature
          `soft-float` is incompatible with the ABI but gets enabled in
          target spec. Run `rustc --print target-list` for a list of
          built-in targets
    
      - Miguel ]
    
    Cc: <[email protected]> # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
    Link: https://github.com/rust-lang/rust/pull/136146
    Signed-off-by: Alice Ryhl <[email protected]>
    Acked-by: Dave Hansen <[email protected]> # for x86
    Link: https://lore.kernel.org/r/[email protected]
    [ Added 6.13.y too to Cc: stable tag and added reasoning to avoid
      over-backporting. - Miguel ]
    Signed-off-by: Miguel Ojeda <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
xfs: Add error handling for xfs_reflink_cancel_cow_range [+ + +]
Author: Wentao Liang <[email protected]>
Date:   Fri Jan 24 11:45:09 2025 +0800

    xfs: Add error handling for xfs_reflink_cancel_cow_range
    
    commit 26b63bee2f6e711c5a169997fd126fddcfb90848 upstream.
    
    In xfs_inactive(), xfs_reflink_cancel_cow_range() is called
    without error handling, risking unnoticed failures and
    inconsistent behavior compared to other parts of the code.
    
    Fix this issue by adding an error handling for the
    xfs_reflink_cancel_cow_range(), improving code robustness.
    
    Fixes: 6231848c3aa5 ("xfs: check for cow blocks before trying to clear them")
    Cc: [email protected] # v4.17
    Reviewed-by: Darrick J. Wong <[email protected]>
    Signed-off-by: Wentao Liang <[email protected]>
    Signed-off-by: Carlos Maiolino <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

xfs: don't call remap_verify_area with sb write protection held [+ + +]
Author: Christoph Hellwig <[email protected]>
Date:   Wed Jan 22 06:43:21 2025 +0100

    xfs: don't call remap_verify_area with sb write protection held
    
    commit f5f0ed89f13e3e5246404a322ee85169a226bfb5 upstream.
    
    The XFS_IOC_EXCHANGE_RANGE ioctl with the XFS_EXCHANGE_RANGE_TO_EOF flag
    operates on a range bounded by the end of the file.  This means the
    actual amount of blocks exchanged is derived from the inode size, which
    is only stable with the IOLOCK (i_rwsem) held.  Do that, it currently
    calls remap_verify_area from inside the sb write protection which nests
    outside the IOLOCK.  But this makes fsnotify_file_area_perm which is
    called from remap_verify_area unhappy when the kernel is built with
    lockdep and the recently added CONFIG_FANOTIFY_ACCESS_PERMISSIONS
    option.
    
    Fix this by always calling remap_verify_area before taking the write
    protection, and passing a 0 size to remap_verify_area similar to
    the FICLONE/FICLONERANGE ioctls when they are asked to clone until
    the file end.
    
    (Note: the size argument gets passed to fsnotify_file_area_perm, but
    then isn't actually used there).
    
    Fixes: 9a64d9b3109d ("xfs: introduce new file range exchange ioctl")
    Cc: <[email protected]> # v6.10
    Signed-off-by: Christoph Hellwig <[email protected]>
    Reviewed-by: Darrick J. Wong <[email protected]>
    Signed-off-by: Carlos Maiolino <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

xfs: Propagate errors from xfs_reflink_cancel_cow_range in xfs_dax_write_iomap_end [+ + +]
Author: Wentao Liang <[email protected]>
Date:   Fri Jan 24 11:22:28 2025 +0800

    xfs: Propagate errors from xfs_reflink_cancel_cow_range in xfs_dax_write_iomap_end
    
    commit fb95897b8c60653805aa09daec575ca30983f768 upstream.
    
    In xfs_dax_write_iomap_end(), directly return the result of
    xfs_reflink_cancel_cow_range() when !written, ensuring proper
    error propagation and improving code robustness.
    
    Fixes: ea6c49b784f0 ("xfs: support CoW in fsdax mode")
    Cc: [email protected] # v6.0
    Reviewed-by: Darrick J. Wong <[email protected]>
    Signed-off-by: Wentao Liang <[email protected]>
    Signed-off-by: Carlos Maiolino <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>