6.6.30-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainerPATCH 132/186 btrfs: fix wrong block_start calculation for btrfs_drop_extent_map_range()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <[email protected]>
commit fe1c6c7acce10baf9521d6dccc17268d91ee2305 upstream.
[BUG]
During my extent_map cleanup/refactor, with extra sanity checks, extent-map-tests::test_case_7() would not pass the checks.
The problem is, after btrfs_drop_extent_map_range(), the resulted extent_map has a @block_start way too large.
Meanwhile my btrfs_file_extent_item based members are returning a correct @disk_bytenr/@offset combination.
The extent map layout looks like this:
0 16K 32K 48K
| PINNED | | Regular |The regular em at [32K, 48K) also has 32K @block_start.
Then drop range [0, 36K), which should shrink the regular one to be [36K, 48K).
However the @block_start is incorrect, we expect 32K + 4K, but got 52K.
[CAUSE]
Inside btrfs_drop_extent_map_range() function, if we hit an extent_map that covers the target range but is still beyond it, we need to split that extent map into half:
|<-- drop range -->| |<----- existing extent_map --->|
And if the extent map is not compressed, we need to forward extent_map::block_start by the difference between the end of drop range and the extent map start.
However in that particular case, the difference is calculated using (start + len - em->start).
The problem is @start can be modified if the drop range covers any pinned extent.
This leads to wrong calculation, and would be caught by my later extent_map sanity checks, which checks the em::block_start against btrfs_file_extent_item::disk_bytenr + btrfs_file_extent_item::offset.
This is a regression caused by commit c962098ca4af ("btrfs: fix incorrect splitting in btrfs_drop_extent_map_range"), which removed the @len update for pinned extents.
[FIX]
Fix it by avoiding using @start completely, and use @end - em->start instead, which @end is exclusive bytenr number.
And update the test case to verify the @block_start to prevent such problem from happening.
Thankfully this is not going to lead to any data corruption, as IO path does not utilize btrfs_drop_extent_map_range() with @skip_pinned set.
So this fix is only here for the sake of consistency/correctness.
--- fs/btrfs/extent_map.c | 2 +- fs/btrfs/tests/extent-map-tests.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
fs/btrfs/extent_map.c +1 -1
@@ -843,7 +843,7 @@ void btrfs_drop_extent_map_range(struct split->block_len = em->block_len; split->orig_start = em->orig_start; }else { -const u64 diff = start + len - em->start; +const u64 diff = end - em->start; split->block_len = split->len; split->block_start += diff;
fs/btrfs/tests/extent-map-tests.c +5 -0
@@ -826,6 +826,11 @@ static int test_case_7(void) goto out; } +if (em->block_start !=SZ_32K +SZ_4K ) { +test_err ("em->block_start is %llu, expected 36K" , em->block_start); + goto out; + } +free_extent_map (em);read_lock (&em_tree->lock);
Greg Kroah-Hartman
maintainerPATCH 133/186 btrfs: scrub: run relocation repair when/only needed
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Naohiro Aota <[email protected]>
commit 7192833c4e55b26e8f15ef58577867a1bc808036 upstream.
When btrfs scrub finds an error, it reads mirrors to find correct data. If all the errors are fixed, sctx->error_bitmap is cleared for the stripe range. However, in the zoned mode, it runs relocation to repair scrub errors when the bitmap is *not* empty, which is a flipped condition.
Also, it runs the relocation even if the scrub is read-only. This was missed by a fix in commit 1f2030ff6e49 ("btrfs: scrub: respect the read-only flag during repair").
The repair is only necessary when there is a repaired sector and should be done on read-write scrub. So, tweak the condition for both regular and zoned case.
--- fs/btrfs/scrub.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
fs/btrfs/scrub.c +9 -9
@@ -1013,6 +1013,7 @@ static void scrub_stripe_read_repair_worstruct btrfs_fs_info *fs_info = sctx->fs_info;int num_copies =btrfs_num_copies (fs_info, stripe->bg->start, stripe->bg->length); +unsigned long repaired;int mirror;int i;
@@ -1079,16 +1080,15 @@ out:* Submit the repaired sectors. For zoned case, we cannot do repair * in-place, but queue the bg to be relocated. */ -if (btrfs_is_zoned (fs_info)) { -if (!bitmap_empty (&stripe->error_bitmap, stripe->nr_sectors)) +bitmap_andnot (&repaired, &stripe->init_error_bitmap, &stripe->error_bitmap, + stripe->nr_sectors); +if (!sctx->readonly && !bitmap_empty (&repaired, stripe->nr_sectors)) { +if (btrfs_is_zoned (fs_info)) {btrfs_repair_one_zone (fs_info, sctx->stripes[0 ].bg->start); - }else if (!sctx->readonly) { -unsigned long repaired; - -bitmap_andnot (&repaired, &stripe->init_error_bitmap, - &stripe->error_bitmap, stripe->nr_sectors); -scrub_write_sectors (sctx, stripe, repaired, false); -wait_scrub_stripe_io (stripe); + }else { +scrub_write_sectors (sctx, stripe, repaired, false); +wait_scrub_stripe_io (stripe); + } }scrub_stripe_report_errors (sctx, stripe);
Greg Kroah-Hartman
maintainerPATCH 134/186 btrfs: fix information leak in btrfs_ioctl_logical_to_ino()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Thumshirn <[email protected]>
commit 2f7ef5bb4a2f3e481ef05fab946edb97c84f67cf upstream.
Syzbot reported the following information leak for in btrfs_ioctl_logical_to_ino():
BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:114 [inline] BUG: KMSAN: kernel-infoleak in _copy_to_user+0xbc/0x110 lib/usercopy.c:40 instrument_copy_to_user include/linux/instrumented.h:114 [inline] _copy_to_user+0xbc/0x110 lib/usercopy.c:40 copy_to_user include/linux/uaccess.h:191 [inline] btrfs_ioctl_logical_to_ino+0x440/0x750 fs/btrfs/ioctl.c:3499 btrfs_ioctl+0x714/0x1260 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl+0x261/0x450 fs/ioctl.c:890 __x64_sys_ioctl+0x96/0xe0 fs/ioctl.c:890 x64_sys_call+0x1883/0x3b50 arch/x86/include/generated/asm/syscalls_64.h:17 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f
Uninit was created at:
__kmalloc_large_node+0x231/0x370 mm/slub.c:3921 __do_kmalloc_node mm/slub.c:3954 [inline] __kmalloc_node+0xb07/0x1060 mm/slub.c:3973 kmalloc_node include/linux/slab.h:648 [inline] kvmalloc_node+0xc0/0x2d0 mm/util.c:634 kvmalloc include/linux/slab.h:766 [inline] init_data_container+0x49/0x1e0 fs/btrfs/backref.c:2779 btrfs_ioctl_logical_to_ino+0x17c/0x750 fs/btrfs/ioctl.c:3480 btrfs_ioctl+0x714/0x1260 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl+0x261/0x450 fs/ioctl.c:890 __x64_sys_ioctl+0x96/0xe0 fs/ioctl.c:890 x64_sys_call+0x1883/0x3b50 arch/x86/include/generated/asm/syscalls_64.h:17 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f
Bytes 40-65535 of 65536 are uninitialized Memory access of size 65536 starts at ffff888045a40000
This happens, because we're copying a 'struct btrfs_data_container' back to user-space. This btrfs_data_container is allocated in 'init_data_container()' via kvmalloc(), which does not zero-fill the memory.
Fix this by using kvzalloc() which zeroes out the memory on allocation.
--- fs/btrfs/backref.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
fs/btrfs/backref.c +3 -9
@@ -2770,20 +2770,14 @@ struct btrfs_data_container *init_data_csize_t alloc_bytes; alloc_bytes =max_t (size_t, total_bytes,sizeof (*data)); - data =kvmalloc (alloc_bytes,GFP_KERNEL ); + data =kvzalloc (alloc_bytes,GFP_KERNEL );if (!data)return ERR_PTR (-ENOMEM ); -if (total_bytes >=sizeof (*data)) { +if (total_bytes >=sizeof (*data)) data->bytes_left = total_bytes -sizeof (*data); - data->bytes_missing =0 ; - }else { +else data->bytes_missing =sizeof (*data) - total_bytes; - data->bytes_left =0 ; - } - - data->elem_cnt =0 ; - data->elem_missed =0 ;return data; }
Greg Kroah-Hartman
maintainerPATCH 135/186 cpu: Re-enable CPU mitigations by default for !X86 architectures
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <[email protected]>
commit fe42754b94a42d08cf9501790afc25c4f6a5f631 upstream.
Rename x86's to CPU_MITIGATIONS, define it in generic code, and force it on for all architectures exception x86. A recent commit to turn mitigations off by default if SPECULATION_MITIGATIONS=n kinda sorta missed that "cpu_mitigations" is completely generic, whereas SPECULATION_MITIGATIONS is x86-specific.
Rename x86's SPECULATIVE_MITIGATIONS instead of keeping both and have it select CPU_MITIGATIONS, as having two configs for the same thing is unnecessary and confusing. This will also allow x86 to use the knob to manage mitigations that aren't strictly related to speculative execution.
Use another Kconfig to communicate to common code that CPU_MITIGATIONS is already defined instead of having x86's menu depend on the common CPU_MITIGATIONS. This allows keeping a single point of contact for all of x86's mitigations, and it's not clear that other architectures *want* to allow disabling mitigations at compile-time.
--- arch/Kconfig | 8 ++++++++ arch/x86/Kconfig | 11 ++++++----- kernel/cpu.c | 4 ++-- 3 files changed, 16 insertions(+), 7 deletions(-)
arch/Kconfig +8 -0
@@ -9,6 +9,14 @@ # source "arch/$(SRCARCH)/Kconfig" +config ARCH_CONFIGURES_CPU_MITIGATIONS + bool + +if !ARCH_CONFIGURES_CPU_MITIGATIONS +config CPU_MITIGATIONS + def_bool y +endif + menu "General architecture-dependent options" config ARCH_HAS_SUBPAGE_FAULTS
arch/x86/Kconfig +6 -5
@@ -62,6 +62,7 @@ config X86 select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI select ARCH_32BIT_OFF_T if X86_32 select ARCH_CLOCKSOURCE_INIT + select ARCH_CONFIGURES_CPU_MITIGATIONS select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE select ARCH_ENABLE_HUGEPAGE_MIGRATION if X86_64 && HUGETLB_PAGE && MIGRATION select ARCH_ENABLE_MEMORY_HOTPLUG if X86_64
@@ -2421,17 +2422,17 @@ config PREFIX_SYMBOLS def_bool y depends on CALL_PADDING && !CFI_CLANG -menuconfig SPECULATION_MITIGATIONS - bool "Mitigations for speculative execution vulnerabilities" +menuconfig CPU_MITIGATIONS + bool "Mitigations for CPU vulnerabilities" default y help - Say Y here to enable options which enable mitigations for - speculative execution hardware vulnerabilities. + Say Y here to enable options which enable mitigations for hardware + vulnerabilities (usually related to speculative execution). If you say N, all mitigations will be disabled. You really should know what you are doing to say so. -if SPECULATION_MITIGATIONS +if CPU_MITIGATIONS config PAGE_TABLE_ISOLATION bool "Remove the kernel mapping in user mode"
kernel/cpu.c +2 -2
@@ -3208,8 +3208,8 @@ enum cpu_mitigations { };static enum cpu_mitigations cpu_mitigations__ro_after_init = -IS_ENABLED (CONFIG_SPECULATION_MITIGATIONS ) ?CPU_MITIGATIONS_AUTO : -CPU_MITIGATIONS_OFF ; +IS_ENABLED (CONFIG_CPU_MITIGATIONS ) ?CPU_MITIGATIONS_AUTO : +CPU_MITIGATIONS_OFF ;static int __init mitigations_parse_cmdline (char *arg) {
Greg Kroah-Hartman
maintainerPATCH 136/186 LoongArch: Fix callchain parse error with kernel tracepoint events
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huacai Chen <[email protected]>
commit d3119bc985fb645ad3b2a9cf9952c1d56d9daaa3 upstream.
In order to fix perf's callchain parse error for LoongArch, we implement perf_arch_fetch_caller_regs() which fills several necessary registers used for callchain unwinding, including sp, fp, and era. This is similar to the following commits.
commit b3eac0265bf6:
("arm: perf: Fix callchain parse error with kernel tracepoint events")
commit 5b09a094f2fb:
("arm64: perf: Fix callchain parse error with kernel tracepoint events")
commit 9a7e8ec0d4cc:
("riscv: perf: Fix callchain parse error with kernel tracepoint events")
Test with commands:
perf record -e sched:sched_switch -g --call-graph dwarf perf report
Without this patch:
Children Self Command Shared Object Symbol ........ ........ ............. ................. ....................
43.41% 43.41% swapper [unknown] [k] 0000000000000000
10.94% 10.94% loong-container [unknown] [k] 0000000000000000
|
|--5.98%--0x12006ba38
|
|--2.56%--0x12006bb84
|
--2.40%--0x12006b6b8With this patch, callchain can be parsed correctly:
Children Self Command Shared Object Symbol ........ ........ ............. ................. ....................
47.57% 47.57% swapper [kernel.vmlinux] [k] __schedule
|
---__schedule 26.76% 26.76% loong-container [kernel.vmlinux] [k] __schedule
|
|--13.78%--0x12006ba38
| |
| |--9.19%--__schedule
| |
| --4.59%--handle_syscall
| do_syscall
| sys_futex
| do_futex
| futex_wait
| futex_wait_queue_me
| hrtimer_start_range_ns
| __schedule
|
|--8.38%--0x12006bb84
| handle_syscall
| do_syscall
| sys_epoll_pwait
| do_epoll_wait
| schedule_hrtimeout_range_clock
| hrtimer_start_range_ns
| __schedule
|
--4.59%--0x12006b6b8
handle_syscall
do_syscall
sys_nanosleep
hrtimer_nanosleep
do_nanosleep
hrtimer_start_range_ns
__schedule--- arch/loongarch/include/asm/perf_event.h | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/loongarch/include/asm/perf_event.h +8 -0
@@ -7,6 +7,14 @@#ifndef __LOONGARCH_PERF_EVENT_H__#define __LOONGARCH_PERF_EVENT_H__ +#include <asm/ptrace.h> +#define perf_arch_bpf_user_pt_regs (regs) (struct user_pt_regs *)regs +#define perf_arch_fetch_caller_regs (regs, __ip) { \ + (regs)->csr_era = (__ip); \ + (regs)->regs[3] = current_stack_pointer; \ + (regs)->regs[22] = (unsigned long) __builtin_frame_address(0); \ +} +#endif /* __LOONGARCH_PERF_EVENT_H__ */
Greg Kroah-Hartman
maintainerPATCH 137/186 LoongArch: Fix access error when read fault on a write-only VMA
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiantao Shan <[email protected]>
commit efb44ff64c95340b06331fc48634b99efc9dd77c upstream.
As with most architectures, allow handling of read faults in VMAs that have VM_WRITE but without VM_READ (WRITE implies READ).
Otherwise, reading before writing a write-only memory will error while reading after writing everything is fine.
BTW, move the VM_EXEC judgement before VM_READ/VM_WRITE to make logic a little clearer.
--- arch/loongarch/mm/fault.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/loongarch/mm/fault.c +2 -2
@@ -202,10 +202,10 @@ good_area:if (!(vma->vm_flags &VM_WRITE )) goto bad_area; }else { -if (!(vma->vm_flags &VM_READ ) && address !=exception_era (regs)) - goto bad_area;if (!(vma->vm_flags &VM_EXEC ) && address ==exception_era (regs)) goto bad_area; +if (!(vma->vm_flags & (VM_READ |VM_WRITE )) && address !=exception_era (regs)) + goto bad_area; }/*
Greg Kroah-Hartman
maintainerPATCH 138/186 arm64: dts: qcom: sc8280xp: add missing PCIe minimum OPP
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 8b8ec83a1d7d3b6605d9163d2e306971295a4ce8 upstream.
Add the missing PCIe CX performance level votes to avoid relying on other drivers (e.g. USB or UFS) to maintain the nominal performance level required for Gen3 speeds.
--- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +5 -0
@@ -1773,6 +1773,7 @@ reset-names = "pci"; power-domains = <&gcc PCIE_4_GDSC>; + required-opps = <&rpmhpd_opp_nom>; phys = <&pcie4_phy>; phy-names = "pciephy";
@@ -1871,6 +1872,7 @@ reset-names = "pci"; power-domains = <&gcc PCIE_3B_GDSC>; + required-opps = <&rpmhpd_opp_nom>; phys = <&pcie3b_phy>; phy-names = "pciephy";
@@ -1969,6 +1971,7 @@ reset-names = "pci"; power-domains = <&gcc PCIE_3A_GDSC>; + required-opps = <&rpmhpd_opp_nom>; phys = <&pcie3a_phy>; phy-names = "pciephy";
@@ -2070,6 +2073,7 @@ reset-names = "pci"; power-domains = <&gcc PCIE_2B_GDSC>; + required-opps = <&rpmhpd_opp_nom>; phys = <&pcie2b_phy>; phy-names = "pciephy";
@@ -2168,6 +2172,7 @@ reset-names = "pci"; power-domains = <&gcc PCIE_2A_GDSC>; + required-opps = <&rpmhpd_opp_nom>; phys = <&pcie2a_phy>; phy-names = "pciephy";
Greg Kroah-Hartman
maintainerPATCH 139/186 arm64: dts: qcom: sm8450: Fix the msi-map entries
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manivannan Sadhasivam <[email protected]>
commit ecc3ac293ed15ac2536e9fde2810154486f84010 upstream.
While adding the GIC ITS MSI support, it was found that the msi-map entries needed to be swapped to receive MSIs from the endpoint.
But later it was identified that the swapping was needed due to a bug in the Qualcomm PCIe controller driver. And since the bug is now fixed with commit bf79e33cdd89 ("PCI: qcom: Enable BDF to SID translation properly"), let's fix the msi-map entries also to reflect the actual mapping in the hardware.
--- arch/arm64/boot/dts/qcom/sm8450.dtsi | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/qcom/sm8450.dtsi +4 -12
@@ -1774,12 +1774,8 @@ ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>, <0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0x3d00000>; - /* - * MSIs for BDF (1:0.0) only works with Device ID 0x5980. - * Hence, the IDs are swapped. - */ - msi-map = <0x0 &gic_its 0x5981 0x1>, - <0x100 &gic_its 0x5980 0x1>; + msi-map = <0x0 &gic_its 0x5980 0x1>, + <0x100 &gic_its 0x5981 0x1>; msi-map-mask = <0xff00>; interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
@@ -1888,12 +1884,8 @@ ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; - /* - * MSIs for BDF (1:0.0) only works with Device ID 0x5a00. - * Hence, the IDs are swapped. - */ - msi-map = <0x0 &gic_its 0x5a01 0x1>, - <0x100 &gic_its 0x5a00 0x1>; + msi-map = <0x0 &gic_its 0x5a00 0x1>, + <0x100 &gic_its 0x5a01 0x1>; msi-map-mask = <0xff00>; interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
Greg Kroah-Hartman
maintainerPATCH 140/186 arm64: dts: rockchip: enable internal pull-up for Q7_THRM# on RK3399 Puma
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Iskander Amara <[email protected]>
commit 0ac417b8f124427c90ec8c2ef4f632b821d924cc upstream.
Q7_THRM# pin is connected to a diode on the module which is used as a level shifter, and the pin have a pull-down enabled by default. We need to configure it to internal pull-up, other- wise whenever the pin is configured as INPUT and we try to control it externally the value will always remain zero.
--- arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi +10 -0
@@ -407,6 +407,16 @@ }; &pinctrl { + pinctrl-names = "default"; + pinctrl-0 = <&q7_thermal_pin>; + + gpios { + q7_thermal_pin: q7-thermal-pin { + rockchip,pins = + <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + i2c8 { i2c8_xfer_a: i2c8-xfer { rockchip,pins =
Greg Kroah-Hartman
maintainerPATCH 141/186 drm/amdgpu/sdma5.2: use legacy HDP flush for SDMA2/3
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 9792b7cc18aaa0c2acae6af5d0acf249bcb1ab0d upstream.
This avoids a potential conflict with firmwares with the newer HDP flush mechanism.
--- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +14 -10
@@ -292,17 +292,21 @@ static void sdma_v5_2_ring_emit_hdp_flusu32 ref_and_mask =0 ;const struct nbio_hdp_flush_reg *nbio_hf_reg = adev->nbio.hdp_flush_reg; - ref_and_mask = nbio_hf_reg->ref_and_mask_sdma0 << ring->me; +if (ring->me >1 ) { +amdgpu_asic_flush_hdp (adev, ring); + }else { + ref_and_mask = nbio_hf_reg->ref_and_mask_sdma0 << ring->me; -amdgpu_ring_write (ring,SDMA_PKT_HEADER_OP (SDMA_OP_POLL_REGMEM ) | -SDMA_PKT_POLL_REGMEM_HEADER_HDP_FLUSH (1 ) | -SDMA_PKT_POLL_REGMEM_HEADER_FUNC (3 ));/* == */ -amdgpu_ring_write (ring, (adev->nbio.funcs->get_hdp_flush_done_offset (adev)) <<2 ); -amdgpu_ring_write (ring, (adev->nbio.funcs->get_hdp_flush_req_offset (adev)) <<2 ); -amdgpu_ring_write (ring, ref_and_mask);/* reference */ -amdgpu_ring_write (ring, ref_and_mask);/* mask */ -amdgpu_ring_write (ring,SDMA_PKT_POLL_REGMEM_DW5_RETRY_COUNT (0xfff ) | -SDMA_PKT_POLL_REGMEM_DW5_INTERVAL (10 ));/* retry count, poll interval */ +amdgpu_ring_write (ring,SDMA_PKT_HEADER_OP (SDMA_OP_POLL_REGMEM ) | +SDMA_PKT_POLL_REGMEM_HEADER_HDP_FLUSH (1 ) | +SDMA_PKT_POLL_REGMEM_HEADER_FUNC (3 ));/* == */ +amdgpu_ring_write (ring, (adev->nbio.funcs->get_hdp_flush_done_offset (adev)) <<2 ); +amdgpu_ring_write (ring, (adev->nbio.funcs->get_hdp_flush_req_offset (adev)) <<2 ); +amdgpu_ring_write (ring, ref_and_mask);/* reference */ +amdgpu_ring_write (ring, ref_and_mask);/* mask */ +amdgpu_ring_write (ring,SDMA_PKT_POLL_REGMEM_DW5_RETRY_COUNT (0xfff ) | +SDMA_PKT_POLL_REGMEM_DW5_INTERVAL (10 ));/* retry count, poll interval */ + } }/**
Greg Kroah-Hartman
maintainerPATCH 142/186 drm/amdgpu: Assign correct bits for SDMA HDP flush
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lijo Lazar <[email protected]>
commit aebd3eb9d3ae017e6260043f6bcace2f5ef60694 upstream.
HDP Flush request bit can be kept unique per AID, and doesn't need to be unique SOC-wide. Assign only bits 10-13 for SDMA v4.4.2.
--- drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +2 -1
@@ -365,7 +365,8 @@ static void sdma_v4_4_2_ring_emit_hdp_flu32 ref_and_mask =0 ;const struct nbio_hdp_flush_reg *nbio_hf_reg = adev->nbio.hdp_flush_reg; - ref_and_mask = nbio_hf_reg->ref_and_mask_sdma0 << ring->me; + ref_and_mask = nbio_hf_reg->ref_and_mask_sdma0 + << (ring->me % adev->sdma.num_inst_per_aid); sdma_v4_4_2_wait_reg_mem(ring, 0, 1, adev->nbio.funcs->get_hdp_flush_done_offset(adev),
Greg Kroah-Hartman
maintainerPATCH 143/186 drm/amdgpu: Fix leak when GPU memory allocation fails
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mukul Joshi <[email protected]>
commit 25e9227c6afd200bed6774c866980b8e36d033af upstream.
Free the sync object if the memory allocation fails for any reason.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +1 -0
@@ -1785,6 +1785,7 @@ err_node_allow: err_bo_create:amdgpu_amdkfd_unreserve_mem_limit (adev, aligned_size, flags, xcp_id); err_reserve_limit: +amdgpu_sync_free (&(*mem)->sync);mutex_destroy (&(*mem)->lock);if (gobj)drm_gem_object_put (gobj);
Greg Kroah-Hartman
maintainerPATCH 144/186 irqchip/gic-v3-its: Prevent double free on error
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guanrui Huang <[email protected]>
commit c26591afd33adce296c022e3480dea4282b7ef91 upstream.
The error handling path in its_vpe_irq_domain_alloc() causes a double free when its_vpe_init() fails after successfully allocating at least one interrupt. This happens because its_vpe_irq_domain_free() frees the interrupts along with the area bitmap and the vprop_page and its_vpe_irq_domain_alloc() subsequently frees the area bitmap and the vprop_page again.
Fix this by unconditionally invoking its_vpe_irq_domain_free() which handles all cases correctly and by removing the bitmap/vprop_page freeing from its_vpe_irq_domain_alloc().
[ tglx: Massaged change log ]
--- drivers/irqchip/irq-gic-v3-its.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/irqchip/irq-gic-v3-its.c +2 -7
@@ -4561,13 +4561,8 @@ static int its_vpe_irq_domain_alloc(struirqd_set_resend_when_in_progress (irq_get_irq_data (virq + i)); } -if (err) { -if (i >0 ) -its_vpe_irq_domain_free (domain, virq, i); - -its_lpi_free (bitmap, base, nr_ids); -its_free_prop_table (vprop_page); - } +if (err) +its_vpe_irq_domain_free (domain, virq, i);return err; }
Greg Kroah-Hartman
maintainerPATCH 145/186 ACPI: CPPC: Use access_width over bit_width for system memory accesses
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jarred White <[email protected]>
commit 2f4a4d63a193be6fd530d180bb13c3592052904c upstream.
To align with ACPI 6.3+, since bit_width can be any 8-bit value, it cannot be depended on to be always on a clean 8b boundary. This was uncovered on the Cobalt 100 platform.
SError Interrupt on CPU26, code 0xbe000011 -- SError
CPU: 26 PID: 1510 Comm: systemd-udevd Not tainted 5.15.2.1-13 #1 Hardware name: MICROSOFT CORPORATION, BIOS MICROSOFT CORPORATION pstate: 62400009 (nZCv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--) pc : cppc_get_perf_caps+0xec/0x410 lr : cppc_get_perf_caps+0xe8/0x410 sp : ffff8000155ab730 x29: ffff8000155ab730 x28: ffff0080139d0038 x27: ffff0080139d0078 x26: 0000000000000000 x25: ffff0080139d0058 x24: 00000000ffffffff x23: ffff0080139d0298 x22: ffff0080139d0278 x21: 0000000000000000 x20: ffff00802b251910 x19: ffff0080139d0000 x18: ffffffffffffffff x17: 0000000000000000 x16: ffffdc7e111bad04 x15: ffff00802b251008 x14: ffffffffffffffff x13: ffff013f1fd63300 x12: 0000000000000006 x11: ffffdc7e128f4420 x10: 0000000000000000 x9 : ffffdc7e111badec x8 : ffff00802b251980 x7 : 0000000000000000 x6 : ffff0080139d0028 x5 : 0000000000000000 x4 : ffff0080139d0018 x3 : 00000000ffffffff x2 : 0000000000000008 x1 : ffff8000155ab7a0 x0 : 0000000000000000 Kernel panic - not syncing: Asynchronous SError Interrupt CPU: 26 PID: 1510 Comm: systemd-udevd Not tainted 5.15.2.1-13 #1 Hardware name: MICROSOFT CORPORATION, BIOS MICROSOFT CORPORATION Call trace: dump_backtrace+0x0/0x1e0 show_stack+0x24/0x30 dump_stack_lvl+0x8c/0xb8 dump_stack+0x18/0x34 panic+0x16c/0x384 add_taint+0x0/0xc0 arm64_serror_panic+0x7c/0x90 arm64_is_fatal_ras_serror+0x34/0xa4 do_serror+0x50/0x6c el1h_64_error_handler+0x40/0x74 el1h_64_error+0x7c/0x80 cppc_get_perf_caps+0xec/0x410 cppc_cpufreq_cpu_init+0x74/0x400 [cppc_cpufreq] cpufreq_online+0x2dc/0xa30 cpufreq_add_dev+0xc0/0xd4 subsys_interface_register+0x134/0x14c cpufreq_register_driver+0x1b0/0x354 cppc_cpufreq_init+0x1a8/0x1000 [cppc_cpufreq] do_one_initcall+0x50/0x250 do_init_module+0x60/0x27c load_module+0x2300/0x2570 __do_sys_finit_module+0xa8/0x114 __arm64_sys_finit_module+0x2c/0x3c invoke_syscall+0x78/0x100 el0_svc_common.constprop.0+0x180/0x1a0 do_el0_svc+0x84/0xa0 el0_svc+0x2c/0xc0 el0t_64_sync_handler+0xa4/0x12c el0t_64_sync+0x1a4/0x1a8
Instead, use access_width to determine the size and use the offset and width to shift and mask the bits to read/write out. Make sure to add a check for system memory since pcc redefines the access_width to subspace id.
If access_width is not set, then fall back to using bit_width.
--- drivers/acpi/cppc_acpi.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-)
drivers/acpi/cppc_acpi.c +26 -5
@@ -163,6 +163,13 @@ show_cppc_data(cppc_get_perf_caps, cppc_show_cppc_data (cppc_get_perf_ctrs, cppc_perf_fb_ctrs, reference_perf);show_cppc_data (cppc_get_perf_ctrs, cppc_perf_fb_ctrs, wraparound_time); +/* Check for valid access_width, otherwise, fallback to using bit_width */ +#define GET_BIT_WIDTH (reg) ((reg)->access_width ? (8 << ((reg)->access_width - 1)) : (reg)->bit_width) + +/* Shift and apply the mask for CPC reads/writes */ +#define MASK_VAL (reg, val) ((val) >> ((reg)->bit_offset & \ + GENMASK(((reg)->bit_width), 0))) +static ssize_t show_feedback_ctrs (struct kobject *kobj,struct kobj_attribute *attr,char *buf) {
@@ -777,6 +784,7 @@ int acpi_cppc_processor_probe(struct acp }else if (gas_t->space_id ==ACPI_ADR_SPACE_SYSTEM_MEMORY ) {if (gas_t->address) {void __iomem *addr; +size_t access_width;if (!osc_cpc_flexible_adr_space_confirmed) {pr_debug ("Flexible address space capability not supported\n" );
@@ -784,7 +792,8 @@ int acpi_cppc_processor_probe(struct acp goto out_free; } - addr =ioremap (gas_t->address, gas_t->bit_width/8 ); + access_width =GET_BIT_WIDTH (gas_t) /8 ; + addr =ioremap (gas_t->address, access_width);if (!addr) goto out_free; cpc_ptr->cpc_regs[i-2 ].sys_mem_vaddr = addr;
@@ -980,6 +989,7 @@ int __weak cpc_write_ffh(int cpunum, strstatic int cpc_read (int cpu,struct cpc_register_resource *reg_res,u64 *val) {void __iomem *vaddr =NULL ; +int size;int pcc_ss_id =per_cpu (cpu_pcc_subspace_idx, cpu);struct cpc_reg *reg = ®_res->cpc_entry.reg;
@@ -991,7 +1001,7 @@ static int cpc_read(int cpu, struct cpc_ *val =0 ;if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_IO ) { -u32 width =8 << (reg->access_width -1 ); +u32 width =GET_BIT_WIDTH (reg);u32 val_u32;acpi_status status;
@@ -1015,7 +1025,9 @@ static int cpc_read(int cpu, struct cpc_return acpi_os_read_memory ((acpi_physical_address )reg->address, val, reg->bit_width); -switch (reg->bit_width) { + size =GET_BIT_WIDTH (reg); + +switch (size) {case 8 : *val =readb_relaxed (vaddr);break ;
@@ -1034,18 +1046,22 @@ static int cpc_read(int cpu, struct cpc_return -EFAULT ; } +if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_MEMORY ) + *val =MASK_VAL (reg, *val); +return 0 ; }static int cpc_write (int cpu,struct cpc_register_resource *reg_res,u64 val) {int ret_val =0 ; +int size;void __iomem *vaddr =NULL ;int pcc_ss_id =per_cpu (cpu_pcc_subspace_idx, cpu);struct cpc_reg *reg = ®_res->cpc_entry.reg;if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_IO ) { -u32 width =8 << (reg->access_width -1 ); +u32 width =GET_BIT_WIDTH (reg);acpi_status status; status = acpi_os_write_port((acpi_io_address)reg->address,
@@ -1067,7 +1083,12 @@ static int cpc_write(int cpu, struct cpcreturn acpi_os_write_memory ((acpi_physical_address )reg->address, val, reg->bit_width); -switch (reg->bit_width) { + size =GET_BIT_WIDTH (reg); + +if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_MEMORY ) + val =MASK_VAL (reg, val); + +switch (size) {case 8 :writeb_relaxed (val, vaddr);break ;
Greg Kroah-Hartman
maintainerPATCH 146/186 ACPI: CPPC: Fix bit_offset shift in MASK_VAL() macro
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jarred White <[email protected]>
commit 05d92ee782eeb7b939bdd0189e6efcab9195bf95 upstream.
Commit 2f4a4d63a193 ("ACPI: CPPC: Use access_width over bit_width for system memory accesses") neglected to properly wrap the bit_offset shift when it comes to applying the mask. This may cause incorrect values to be read and may cause the cpufreq module not be loaded.
[ 11.059751] cpu_capacity: CPU0 missing/invalid highest performance. [ 11.066005] cpu_capacity: partial information: fallback to 1024 for all CPUs
Also, corrected the bitmask generation in GENMASK (extra bit being added).
--- drivers/acpi/cppc_acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/cppc_acpi.c +2 -2
@@ -167,8 +167,8 @@ show_cppc_data(cppc_get_perf_ctrs, cppc_#define GET_BIT_WIDTH (reg) ((reg)->access_width ? (8 << ((reg)->access_width - 1)) : (reg)->bit_width)/* Shift and apply the mask for CPC reads/writes */ -#define MASK_VAL (reg, val) ((val) >> ((reg)->bit_offset & \ - GENMASK(((reg)->bit_width), 0))) +#define MASK_VAL (reg, val) (((val) >> (reg)->bit_offset) & \ + GENMASK(((reg)->bit_width) - 1, 0))static ssize_t show_feedback_ctrs (struct kobject *kobj,struct kobj_attribute *attr,char *buf)
Greg Kroah-Hartman
maintainerPATCH 147/186 ACPI: CPPC: Fix access width used for PCC registers
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vanshidhar Konda <[email protected]>
commit f489c948028b69cea235d9c0de1cc10eeb26a172 upstream.
commit 2f4a4d63a193 ("ACPI: CPPC: Use access_width over bit_width for system memory accesses") modified cpc_read()/cpc_write() to use access_width to read CPC registers.
However, for PCC registers the access width field in the ACPI register macro specifies the PCC subspace ID. For non-zero PCC subspace ID it is incorrectly treated as access width. This causes errors when reading from PCC registers in the CPPC driver.
For PCC registers, base the size of read/write on the bit width field. The debug message in cpc_read()/cpc_write() is updated to print relevant information for the address space type used to read the register.
--- drivers/acpi/cppc_acpi.c | 53 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 16 deletions(-)
drivers/acpi/cppc_acpi.c +37 -16
@@ -999,14 +999,14 @@ static int cpc_read(int cpu, struct cpc_ } *val =0 ; + size =GET_BIT_WIDTH (reg);if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_IO ) { -u32 width =GET_BIT_WIDTH (reg);u32 val_u32;acpi_status status; status =acpi_os_read_port ((acpi_io_address )reg->address, - &val_u32, width); + &val_u32, size);if (ACPI_FAILURE (status)) {pr_debug ("Error: Failed to read SystemIO port %llx\n" , reg->address);
@@ -1015,17 +1015,22 @@ static int cpc_read(int cpu, struct cpc_ *val = val_u32;return 0 ; - }else if (reg->space_id ==ACPI_ADR_SPACE_PLATFORM_COMM && pcc_ss_id >=0 ) + }else if (reg->space_id ==ACPI_ADR_SPACE_PLATFORM_COMM && pcc_ss_id >=0 ) { +/* +* For registers in PCC space, the register size is determined +* by the bit width field; the access size is used to indicate +* the PCC subspace id. +*/ + size = reg->bit_width; vaddr =GET_PCC_VADDR (reg->address, pcc_ss_id); + }else if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_MEMORY ) vaddr = reg_res->sys_mem_vaddr;else if (reg->space_id ==ACPI_ADR_SPACE_FIXED_HARDWARE )return cpc_read_ffh (cpu, reg, val);else return acpi_os_read_memory ((acpi_physical_address )reg->address, - val, reg->bit_width); - - size =GET_BIT_WIDTH (reg); + val, size);switch (size) {case 8 :
@@ -1041,8 +1046,13 @@ static int cpc_read(int cpu, struct cpc_ *val =readq_relaxed (vaddr);break ;default : -pr_debug ("Error: Cannot read %u bit width from PCC for ss: %d\n" , - reg->bit_width, pcc_ss_id); +if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_MEMORY ) { +pr_debug ("Error: Cannot read %u bit width from system memory: 0x%llx\n" , + size, reg->address); + }else if (reg->space_id ==ACPI_ADR_SPACE_PLATFORM_COMM ) { +pr_debug ("Error: Cannot read %u bit width from PCC for ss: %d\n" , + size, pcc_ss_id); + }return -EFAULT ; }
@@ -1060,12 +1070,13 @@ static int cpc_write(int cpu, struct cpcint pcc_ss_id =per_cpu (cpu_pcc_subspace_idx, cpu);struct cpc_reg *reg = ®_res->cpc_entry.reg; + size =GET_BIT_WIDTH (reg); +if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_IO ) { -u32 width =GET_BIT_WIDTH (reg);acpi_status status; status =acpi_os_write_port ((acpi_io_address )reg->address, - (u32 )val, width); + (u32 )val, size);if (ACPI_FAILURE (status)) {pr_debug ("Error: Failed to write SystemIO port %llx\n" , reg->address);
@@ -1073,17 +1084,22 @@ static int cpc_write(int cpu, struct cpc }return 0 ; - }else if (reg->space_id ==ACPI_ADR_SPACE_PLATFORM_COMM && pcc_ss_id >=0 ) + }else if (reg->space_id ==ACPI_ADR_SPACE_PLATFORM_COMM && pcc_ss_id >=0 ) { +/* +* For registers in PCC space, the register size is determined +* by the bit width field; the access size is used to indicate +* the PCC subspace id. +*/ + size = reg->bit_width; vaddr =GET_PCC_VADDR (reg->address, pcc_ss_id); + }else if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_MEMORY ) vaddr = reg_res->sys_mem_vaddr;else if (reg->space_id ==ACPI_ADR_SPACE_FIXED_HARDWARE )return cpc_write_ffh (cpu, reg, val);else return acpi_os_write_memory ((acpi_physical_address )reg->address, - val, reg->bit_width); - - size =GET_BIT_WIDTH (reg); + val, size);if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_MEMORY ) val =MASK_VAL (reg, val);
@@ -1102,8 +1118,13 @@ static int cpc_write(int cpu, struct cpcwriteq_relaxed (val, vaddr);break ;default : -pr_debug ("Error: Cannot write %u bit width to PCC for ss: %d\n" , - reg->bit_width, pcc_ss_id); +if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_MEMORY ) { +pr_debug ("Error: Cannot write %u bit width to system memory: 0x%llx\n" , + size, reg->address); + }else if (reg->space_id ==ACPI_ADR_SPACE_PLATFORM_COMM ) { +pr_debug ("Error: Cannot write %u bit width to PCC for ss: %d\n" , + size, pcc_ss_id); + } ret_val = -EFAULT ;break ; }
Greg Kroah-Hartman
maintainerPATCH 148/186 ethernet: Add helper for assigning packet type when dest address does not match device address
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rahul Rameshbabu <[email protected]>
commit 6e159fd653d7ebf6290358e0330a0cb8a75cf73b upstream.
Enable reuse of logic in eth_type_trans for determining packet type.
--- include/linux/etherdevice.h | 25 +++++++++++++++++++++++++ net/ethernet/eth.c | 12 +----------- 2 files changed, 26 insertions(+), 11 deletions(-)
include/linux/etherdevice.h +25 -0
@@ -608,6 +608,31 @@ static inline void eth_hw_addr_gen(struc }/** +* eth_skb_pkt_type - Assign packet type if destination address does not match +* @skb: Assigned a packet type if address does not match @dev address +* @dev: Network device used to compare packet address against +* +* If the destination MAC address of the packet does not match the network +* device address, assign an appropriate packet type. +*/ +static inline void eth_skb_pkt_type (struct sk_buff *skb, +const struct net_device *dev) +{ +const struct ethhdr *eth =eth_hdr (skb); + +if (unlikely (!ether_addr_equal_64bits (eth->h_dest, dev->dev_addr))) { +if (unlikely (is_multicast_ether_addr_64bits (eth->h_dest))) { +if (ether_addr_equal_64bits (eth->h_dest, dev->broadcast)) + skb->pkt_type =PACKET_BROADCAST ; +else + skb->pkt_type =PACKET_MULTICAST ; + }else { + skb->pkt_type =PACKET_OTHERHOST ; + } + } +} + +/** * eth_skb_pad - Pad buffer to mininum number of octets for Ethernet frame * @skb: Buffer to pad *
net/ethernet/eth.c +1 -11
@@ -164,17 +164,7 @@ __be16 eth_type_trans(struct sk_buff *sk eth = (struct ethhdr *)skb->data;skb_pull_inline (skb,ETH_HLEN ); -if (unlikely (!ether_addr_equal_64bits (eth->h_dest, - dev->dev_addr))) { -if (unlikely (is_multicast_ether_addr_64bits (eth->h_dest))) { -if (ether_addr_equal_64bits (eth->h_dest, dev->broadcast)) - skb->pkt_type =PACKET_BROADCAST ; -else - skb->pkt_type =PACKET_MULTICAST ; - }else { - skb->pkt_type =PACKET_OTHERHOST ; - } - } +eth_skb_pkt_type (skb, dev);/* * Some variants of DSA tagging don't have an ethertype field
Greg Kroah-Hartman
maintainerPATCH 149/186 net: b44: set pause params only when interface is up
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Münster <[email protected]>
commit e3eb7dd47bd4806f00e104eb6da092c435f9fb21 upstream.
b44_free_rings() accesses b44::rx_buffers (and ::tx_buffers) unconditionally, but b44::rx_buffers is only valid when the device is up (they get allocated in b44_open(), and deallocated again in b44_close()), any other time these are just a NULL pointers.
So if you try to change the pause params while the network interface is disabled/administratively down, everything explodes (which likely netifd tries to do).
--- drivers/net/ethernet/broadcom/b44.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/net/ethernet/broadcom/b44.c +8 -6
@@ -2009,12 +2009,14 @@ static int b44_set_pauseparam(struct net bp->flags |=B44_FLAG_TX_PAUSE ; else bp->flags &= ~B44_FLAG_TX_PAUSE; -if (bp->flags &B44_FLAG_PAUSE_AUTO ) { -b44_halt (bp); -b44_init_rings (bp); -b44_init_hw (bp,B44_FULL_RESET ); - }else { -__b44_set_flow_ctrl (bp, bp->flags); +if (netif_running (dev)) { +if (bp->flags &B44_FLAG_PAUSE_AUTO ) { +b44_halt (bp); +b44_init_rings (bp); +b44_init_hw (bp,B44_FULL_RESET ); + }else { +__b44_set_flow_ctrl (bp, bp->flags); + } }spin_unlock_irq (&bp->lock);
Greg Kroah-Hartman
maintainerPATCH 150/186 stackdepot: respect __GFP_NOLOCKDEP allocation flag
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Ryabinin <[email protected]>
commit 6fe60465e1d53ea321ee909be26d97529e8f746c upstream.
If stack_depot_save_flags() allocates memory it always drops __GFP_NOLOCKDEP flag. So when KASAN tries to track __GFP_NOLOCKDEP allocation we may end up with lockdep splat like bellow:
======================================================
WARNING: possible circular locking dependency detected 6.9.0-rc3+ #49 Not tainted
------------------------------------------------------
kswapd0/149 is trying to acquire lock:
ffff88811346a920
(&xfs_nondir_ilock_class){++++}-{4:4}, at: xfs_reclaim_inode+0x3ac/0x590 [xfs]
but task is already holding lock:
ffffffff8bb33100 (fs_reclaim){+.+.}-{0:0}, at:balance_pgdat+0x5d9/0xad0
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (fs_reclaim){+.+.}-{0:0}:
__lock_acquire+0x7da/0x1030
lock_acquire+0x15d/0x400
fs_reclaim_acquire+0xb5/0x100
prepare_alloc_pages.constprop.0+0xc5/0x230
__alloc_pages+0x12a/0x3f0
alloc_pages_mpol+0x175/0x340
stack_depot_save_flags+0x4c5/0x510
kasan_save_stack+0x30/0x40
kasan_save_track+0x10/0x30
__kasan_slab_alloc+0x83/0x90
kmem_cache_alloc+0x15e/0x4a0
__alloc_object+0x35/0x370
__create_object+0x22/0x90
__kmalloc_node_track_caller+0x477/0x5b0
krealloc+0x5f/0x110
xfs_iext_insert_raw+0x4b2/0x6e0 [xfs]
xfs_iext_insert+0x2e/0x130 [xfs]
xfs_iread_bmbt_block+0x1a9/0x4d0 [xfs]
xfs_btree_visit_block+0xfb/0x290 [xfs]
xfs_btree_visit_blocks+0x215/0x2c0 [xfs]
xfs_iread_extents+0x1a2/0x2e0 [xfs]
xfs_buffered_write_iomap_begin+0x376/0x10a0 [xfs]
iomap_iter+0x1d1/0x2d0
iomap_file_buffered_write+0x120/0x1a0
xfs_file_buffered_write+0x128/0x4b0 [xfs]
vfs_write+0x675/0x890
ksys_write+0xc3/0x160
do_syscall_64+0x94/0x170
entry_SYSCALL_64_after_hwframe+0x71/0x79Always preserve __GFP_NOLOCKDEP to fix this.
--- lib/stackdepot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/stackdepot.c +2 -2
@@ -402,10 +402,10 @@ depot_stack_handle_t __stack_depot_save(/* * Zero out zone modifiers, as we don't have specific zone * requirements. Keep the flags related to allocation in atomic -* contexts and I/O. +* contexts, I/O, nolockdep. */ alloc_flags &= ~GFP_ZONEMASK ; - alloc_flags &= (GFP_ATOMIC |GFP_KERNEL ); + alloc_flags &= (GFP_ATOMIC |GFP_KERNEL | __GFP_NOLOCKDEP); alloc_flags |= __GFP_NOWARN; page =alloc_pages (alloc_flags,DEPOT_POOL_ORDER );if (page)
Greg Kroah-Hartman
maintainerPATCH 151/186 fbdev: fix incorrect address computation in deferred IO
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nam Cao <[email protected]>
commit 78d9161d2bcd442d93d917339297ffa057dbee8c upstream.
With deferred IO enabled, a page fault happens when data is written to the framebuffer device. Then driver determines which page is being updated by calculating the offset of the written virtual address within the virtual memory area, and uses this offset to get the updated page within the internal buffer. This page is later copied to hardware (thus the name "deferred IO").
This offset calculation is only correct if the virtual memory area is mapped to the beginning of the internal buffer. Otherwise this is wrong. For example, if users do:
mmap(ptr, 4096, PROT_WRITE, MAP_FIXED | MAP_SHARED, fd, 0xff000);
Then the virtual memory area will mapped at offset 0xff000 within the internal buffer. This offset 0xff000 is not accounted for, and wrong page is updated.
Correct the calculation by using vmf->pgoff instead. With this change, the variable "offset" will no longer hold the exact offset value, but it is rounded down to multiples of PAGE_SIZE. But this is still correct, because this variable is only used to calculate the page offset.
--- drivers/video/fbdev/core/fb_defio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/core/fb_defio.c +1 -1
@@ -196,7 +196,7 @@ err_mutex_unlock:*/ static vm_fault_t fb_deferred_io_page_mkwrite (struct fb_info *info,struct vm_fault *vmf) { -unsigned long offset = vmf->address - vmf->vma->vm_start; +unsigned long offset = vmf->pgoff <<PAGE_SHIFT ;struct page *page = vmf->page;file_update_time (vmf->vma->vm_file);
Greg Kroah-Hartman
maintainerPATCH 152/186 udp: preserve the connected status if only UDP cmsg
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yick Xie <[email protected]>
commit 680d11f6e5427b6af1321932286722d24a8b16c1 upstream.
If "udp_cmsg_send()" returned 0 (i.e. only UDP cmsg), "connected" should not be set to 0. Otherwise it stops the connected socket from using the cached route.
--- net/ipv4/udp.c | 5 +++-- net/ipv6/udp.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-)
net/ipv4/udp.c +3 -2
@@ -1124,16 +1124,17 @@ int udp_sendmsg(struct sock *sk, structif (msg->msg_controllen) { err =udp_cmsg_send (sk, msg, &ipc.gso_size); -if (err >0 ) +if (err >0 ) { err =ip_cmsg_send (sk, msg, &ipc, sk->sk_family ==AF_INET6 ); + connected =0 ; + }if (unlikely (err <0 )) {kfree (ipc.opt);return err; }if (ipc.opt) free =1 ; - connected =0 ; }if (!ipc.opt) {struct ip_options_rcu *inet_opt;
net/ipv6/udp.c +3 -2
@@ -1476,9 +1476,11 @@ do_udp_sendmsg: ipc6.opt = opt; err =udp_cmsg_send (sk, msg, &ipc6.gso_size); -if (err >0 ) +if (err >0 ) { err =ip6_datagram_send_ctl (sock_net (sk), sk, msg, fl6, &ipc6); + connected = false; + }if (err <0 ) {fl6_sock_release (flowlabel);return err;
@@ -1490,7 +1492,6 @@ do_udp_sendmsg: }if (!(opt->opt_nflen|opt->opt_flen)) opt =NULL ; - connected = false; }if (!opt) { opt =txopt_get (np);
Greg Kroah-Hartman
maintainerPATCH 153/186 mtd: diskonchip: work around ubsan link failure
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 21c9fb611c25d5cd038f6fe485232e7884bb0b3d upstream.
I ran into a randconfig build failure with UBSAN using gcc-13.2:
arm-linux-gnueabi-ld: error: unplaced orphan section .bss..Lubsan_data31' from drivers/mtd/nand/raw/diskonchip.o'
I'm not entirely sure what is going on here, but I suspect this has something to do with the check for the end of the doc_locations[] array that contains an (unsigned long)0xffffffff element, which is compared against the signed (int)0xffffffff. If this is the case, we should get a runtime check for undefined behavior, but we instead get an unexpected build-time error.
I would have expected this to work fine on 32-bit architectures despite the signed integer overflow, though on 64-bit architectures this likely won't ever work.
Changing the contition to instead check for the size of the array makes the code safe everywhere and avoids the ubsan check that leads to the link error. The loop code goes back to before 2.6.12.
--- drivers/mtd/nand/raw/diskonchip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/nand/raw/diskonchip.c +2 -2
@@ -53,7 +53,7 @@ static unsigned long doc_locations[] __i 0xe8000, 0xea000, 0xec000, 0xee000, #endif #endif - 0xffffffff }; +}; static struct mtd_info *doclist = NULL;
@@ -1552,7 +1552,7 @@ static int __init init_nanddoc(void)if (ret <0 )return ret; }else { -for (i =0 ; (doc_locations[i] !=0xffffffff ); i++) { +for (i =0 ; i <ARRAY_SIZE (doc_locations); i++) {doc_probe (doc_locations[i]); } }
Greg Kroah-Hartman
maintainerPATCH 154/186 phy: qcom: qmp-combo: Fix register base for QSERDES_DP_PHY_MODE
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
commit ee13e1f3c72b9464a4d73017c060ab503eed653a upstream.
The register base that was used to write to the QSERDES_DP_PHY_MODE register was 'dp_dp_phy' before commit 815891eee668 ("phy:
qcom-qmp-combo: Introduce orientation variable"). There isn't any explanation in the commit why this is changed, so I suspect it was an oversight or happened while being extracted from some other series. Oddly the value being 0x4c or 0x5c doesn't seem to matter for me, so I suspect this is dead code, but that can be fixed in another patch. It's not good to write to the wrong register space, and maybe some other version of this phy relies on this.
--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +2 -2
@@ -2047,9 +2047,9 @@ static bool qmp_combo_configure_dp_mode(writel (val, qmp->dp_dp_phy +QSERDES_DP_PHY_PD_CTL );if (reverse) -writel (0x4c , qmp->pcs +QSERDES_DP_PHY_MODE ); +writel (0x4c , qmp->dp_dp_phy +QSERDES_DP_PHY_MODE );else -writel (0x5c , qmp->pcs +QSERDES_DP_PHY_MODE ); +writel (0x5c , qmp->dp_dp_phy +QSERDES_DP_PHY_MODE );return reverse; }
Greg Kroah-Hartman
maintainerPATCH 155/186 phy: qcom: qmp-combo: Fix VCO div offset on v3
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
commit 5abed58a8bde6d349bde364a160510b5bb904d18 upstream.
Commit ec17373aebd0 ("phy: qcom: qmp-combo: extract common function to setup clocks") changed the offset that is used to write to DP_PHY_VCO_DIV from QSERDES_V3_DP_PHY_VCO_DIV to QSERDES_V4_DP_PHY_VCO_DIV. Unfortunately, this offset is different between v3 and v4 phys:
#define QSERDES_V3_DP_PHY_VCO_DIV 0x064
#define QSERDES_V4_DP_PHY_VCO_DIV 0x070
meaning that we write the wrong register on v3 phys now. Add another generic register to 'regs' and use it here instead of a version specific define to fix this.
This was discovered after Abhinav looked over register dumps with me from sc7180 Trogdor devices that started failing to light up the external display with v6.6 based kernels. It turns out that some monitors are very specific about their link clk frequency and if the default power on reset value is still there the monitor will show a blank screen or a garbled display. Other monitors are perfectly happy to get a bad clock signal.
--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +5 -1
@@ -112,6 +112,7 @@ enum qphy_reg_layout {QPHY_COM_BIAS_EN_CLKBUFLR_EN ,QPHY_DP_PHY_STATUS , +QPHY_DP_PHY_VCO_DIV ,QPHY_TX_TX_POL_INV , QPHY_TX_TX_DRV_LVL,
@@ -137,6 +138,7 @@ static const unsigned int qmp_v3_usb3phy [QPHY_COM_BIAS_EN_CLKBUFLR_EN] = QSERDES_V3_COM_BIAS_EN_CLKBUFLR_EN, [QPHY_DP_PHY_STATUS] = QSERDES_V3_DP_PHY_STATUS, + [QPHY_DP_PHY_VCO_DIV] = QSERDES_V3_DP_PHY_VCO_DIV, [QPHY_TX_TX_POL_INV] = QSERDES_V3_TX_TX_POL_INV, [QPHY_TX_TX_DRV_LVL] = QSERDES_V3_TX_TX_DRV_LVL,
@@ -161,6 +163,7 @@ static const unsigned int qmp_v45_usb3ph [QPHY_COM_BIAS_EN_CLKBUFLR_EN] = QSERDES_V4_COM_BIAS_EN_CLKBUFLR_EN, [QPHY_DP_PHY_STATUS] = QSERDES_V4_DP_PHY_STATUS, + [QPHY_DP_PHY_VCO_DIV] = QSERDES_V4_DP_PHY_VCO_DIV, [QPHY_TX_TX_POL_INV] = QSERDES_V4_TX_TX_POL_INV, [QPHY_TX_TX_DRV_LVL] = QSERDES_V4_TX_TX_DRV_LVL,
@@ -2059,6 +2062,7 @@ static int qmp_combo_configure_dp_clocksconst struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts;u32 phy_vco_div;unsigned long pixel_freq; +const struct qmp_phy_cfg *cfg = qmp->cfg;switch (dp_opts->link_rate) {case 1620 :
@@ -2081,7 +2085,7 @@ static int qmp_combo_configure_dp_clocks/* Other link rates aren't supported */ return -EINVAL ; } -writel (phy_vco_div, qmp->dp_dp_phy +QSERDES_V4_DP_PHY_VCO_DIV ); +writel (phy_vco_div, qmp->dp_dp_phy + cfg->regs[QPHY_DP_PHY_VCO_DIV ]);clk_set_rate (qmp->dp_link_hw.clk, dp_opts->link_rate *100000 );clk_set_rate (qmp->dp_pixel_hw.clk, pixel_freq);
Greg Kroah-Hartman
maintainerPATCH 156/186 x86/tdx: Preserve shared bit on mprotect()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kirill A. Shutemov <[email protected]>
commit a0a8d15a798be4b8f20aca2ba91bf6b688c6a640 upstream.
The TDX guest platform takes one bit from the physical address to indicate if the page is shared (accessible by VMM). This bit is not part of the physical_mask and is not preserved during mprotect(). As a result, the 'shared' bit is lost during mprotect() on shared mappings.
_COMMON_PAGE_CHG_MASK specifies which PTE bits need to be preserved during modification. AMD includes 'sme_me_mask' in the define to preserve the 'encrypt' bit.
To cover both Intel and AMD cases, include 'cc_mask' in _COMMON_PAGE_CHG_MASK instead of 'sme_me_mask'.
--- arch/x86/include/asm/coco.h | 5 ++++- arch/x86/include/asm/pgtable_types.h | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-)
arch/x86/include/asm/coco.h +4 -1
@@ -12,9 +12,10 @@ enum cc_vendor { };extern enum cc_vendor cc_vendor; -extern u64 cc_mask;#ifdef CONFIG_ARCH_HAS_CC_PLATFORM +extern u64 cc_mask; +static inline void cc_set_mask (u64 mask) {RIP_REL_REF (cc_mask) = mask;
@@ -24,6 +25,8 @@ u64 cc_mkenc(u64 val);u64 cc_mkdec (u64 val);void cc_random_init (void );#else +static const u64 cc_mask =0 ; +static inline u64 cc_mkenc (u64 val) {return val;
arch/x86/include/asm/pgtable_types.h +2 -1
@@ -148,7 +148,7 @@#define _COMMON_PAGE_CHG_MASK (PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT | \ _PAGE_SPECIAL | _PAGE_ACCESSED | \ _PAGE_DIRTY_BITS | _PAGE_SOFT_DIRTY | \ - _PAGE_DEVMAP | _PAGE_ENC | _PAGE_UFFD_WP) + _PAGE_DEVMAP | _PAGE_CC | _PAGE_UFFD_WP)#define _PAGE_CHG_MASK (_COMMON_PAGE_CHG_MASK | _PAGE_PAT)#define _HPAGE_CHG_MASK (_COMMON_PAGE_CHG_MASK | _PAGE_PSE | _PAGE_PAT_LARGE)
@@ -173,6 +173,7 @@ enum page_cache_mode { };#endif +#define _PAGE_CC (_AT(pteval_t, cc_mask))#define _PAGE_ENC (_AT(pteval_t, sme_me_mask))#define _PAGE_CACHE_MASK (_PAGE_PWT | _PAGE_PCD | _PAGE_PAT)
Greg Kroah-Hartman
maintainerPATCH 157/186 mm: turn folio_test_hugetlb into a PageType
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wilcox (Oracle) <[email protected]>
commit d99e3140a4d33e26066183ff727d8f02f56bec64 upstream.
The current folio_test_hugetlb() can be fooled by a concurrent folio split into returning true for a folio which has never belonged to hugetlbfs. This can't happen if the caller holds a refcount on it, but we have a few places (memory-failure, compaction, procfs) which do not and should not take a speculative reference.
Since hugetlb pages do not use individual page mapcounts (they are always fully mapped and use the entire_mapcount field to record the number of mappings), the PageType field is available now that page_mapcount() ignores the value in this field.
In compaction and with CONFIG_DEBUG_VM enabled, the current implementation can result in an oops, as reported by Luis. This happens since 9c5ccf2db04b ("mm: remove HUGETLB_PAGE_DTOR") effectively added some VM_BUG_ON() checks in the PageHuge() testing path.
--- include/linux/page-flags.h | 70 +++++++++++++++++++---------------------- include/trace/events/mmflags.h | 1 kernel/crash_core.c | 5 +- mm/hugetlb.c | 22 +----------- 4 files changed, 39 insertions(+), 59 deletions(-)
include/linux/page-flags.h +33 -37
@@ -190,7 +190,6 @@ enum pageflags {/* At least one page in this folio has the hwpoison flag set */ PG_has_hwpoisoned = PG_error, - PG_hugetlb = PG_active, PG_large_rmappable = PG_workingset, /* anon or file-backed */ };
@@ -836,29 +835,6 @@ TESTPAGEFLAG_FALSE(LargeRmappable, large#define PG_head_mask ((1UL << PG_head)) -#ifdef CONFIG_HUGETLB_PAGE -int PageHuge (struct page *page); -SETPAGEFLAG(HugeTLB, hugetlb, PF_SECOND) -CLEARPAGEFLAG (HugeTLB, hugetlb,PF_SECOND ) - -/** -* folio_test_hugetlb - Determine if the folio belongs to hugetlbfs -* @folio: The folio to test. -* -* Context: Any context. Caller should have a reference on the folio to -* prevent it from being turned into a tail page. -* Return: True for hugetlbfs folios, false for anon folios or folios -* belonging to other filesystems. - */ -static inline bool folio_test_hugetlb (struct folio *folio) -{ -return folio_test_large (folio) && -test_bit (PG_hugetlb,folio_flags (folio,1 )); -} -#else -TESTPAGEFLAG_FALSE(Huge, hugetlb) -#endif -#ifdef CONFIG_TRANSPARENT_HUGEPAGE /* * PageHuge() only returns true for hugetlbfs pages, but not for
@@ -915,18 +891,6 @@ PAGEFLAG_FALSE(HasHWPoisoned, has_hwpois#endif /* -* Check if a page is currently marked HWPoisoned. Note that this check is -* best effort only and inherently racy: there is no way to synchronize with -* failing hardware. -*/ -static inline bool is_page_hwpoison (struct page *page) -{ -if (PageHWPoison (page)) -return true; -return PageHuge (page) &&PageHWPoison (compound_head (page)); -} - -/* * For pages that are never mapped to userspace (and aren't PageSlab), * page_type may be used. Because it is initialised to -1, we invert the * sense of the bit, so __SetPageFoo *clears* the bit used for PageFoo, and
@@ -942,6 +906,7 @@ static inline bool is_page_hwpoison(stru#define PG_offline 0x00000100#define PG_table 0x00000200#define PG_guard 0x00000400 +#define PG_hugetlb 0x00000800#define PageType (page, flag) \ ((page->page_type & (PAGE_TYPE_BASE | flag)) == PAGE_TYPE_BASE)
@@ -1036,6 +1001,37 @@ PAGE_TYPE_OPS(Table, table, pgtable)*/ PAGE_TYPE_OPS(Guard, guard, guard) +#ifdef CONFIG_HUGETLB_PAGE +FOLIO_TYPE_OPS(hugetlb, hugetlb) +#else +FOLIO_TEST_FLAG_FALSE(hugetlb) +#endif + +/** +* PageHuge - Determine if the page belongs to hugetlbfs +* @page: The page to test. +* +* Context: Any context. +* Return: True for hugetlbfs pages, false for anon pages or pages +* belonging to other filesystems. +*/ +static inline bool PageHuge (const struct page *page) +{ +return folio_test_hugetlb (page_folio (page)); +} + +/* +* Check if a page is currently marked HWPoisoned. Note that this check is +* best effort only and inherently racy: there is no way to synchronize with +* failing hardware. +*/ +static inline bool is_page_hwpoison (struct page *page) +{ +if (PageHWPoison (page)) +return true; +return PageHuge (page) &&PageHWPoison (compound_head (page)); +} +extern bool is_free_buddy_page (struct page *page);PAGEFLAG (Isolated, isolated,PF_ANY );
@@ -1102,7 +1098,7 @@ static __always_inline void __ClearPageA*/ #define PAGE_FLAGS_SECOND \ (0xffUL /* order */ | 1UL << PG_has_hwpoisoned | \ - 1UL << PG_hugetlb | 1UL << PG_large_rmappable) + 1UL << PG_large_rmappable)#define PAGE_FLAGS_PRIVATE \ (1UL << PG_private | 1UL << PG_private_2)
include/trace/events/mmflags.h +1 -0
@@ -135,6 +135,7 @@ IF_HAVE_PG_ARCH_X(arch_3)#define DEF_PAGETYPE_NAME (_name) { PG_##_name, __stringify(_name) }#define __def_pagetype_names \ + DEF_PAGETYPE_NAME(hugetlb), \ DEF_PAGETYPE_NAME(offline), \ DEF_PAGETYPE_NAME(guard), \ DEF_PAGETYPE_NAME(table), \
kernel/crash_core.c +2 -3
@@ -675,11 +675,10 @@ static int __init crash_save_vmcoreinfo_VMCOREINFO_NUMBER (PG_head_mask);#define PAGE_BUDDY_MAPCOUNT_VALUE (~PG_buddy)VMCOREINFO_NUMBER (PAGE_BUDDY_MAPCOUNT_VALUE ); -#ifdef CONFIG_HUGETLB_PAGE -VMCOREINFO_NUMBER (PG_hugetlb); +#define PAGE_HUGETLB_MAPCOUNT_VALUE (~PG_hugetlb) +VMCOREINFO_NUMBER (PAGE_HUGETLB_MAPCOUNT_VALUE );#define PAGE_OFFLINE_MAPCOUNT_VALUE (~PG_offline)VMCOREINFO_NUMBER (PAGE_OFFLINE_MAPCOUNT_VALUE ); -#endif #ifdef CONFIG_KALLSYMS VMCOREINFO_SYMBOL (kallsyms_names);
mm/hugetlb.c +3 -19
@@ -1630,7 +1630,7 @@ static inline void __clear_hugetlb_destr {lockdep_assert_held (&hugetlb_lock); -folio_clear_hugetlb (folio); +__folio_clear_hugetlb (folio); }/*
@@ -1717,7 +1717,7 @@ static void add_hugetlb_folio(struct hst h->surplus_huge_pages_node[nid]++; } -folio_set_hugetlb (folio); +__folio_set_hugetlb (folio);folio_change_private (folio,NULL );/* * We have to set hugetlb_vmemmap_optimized again as above
@@ -1971,7 +1971,7 @@ static void __prep_new_hugetlb_folio(str {hugetlb_vmemmap_optimize (h, &folio->page);INIT_LIST_HEAD (&folio->lru); -folio_set_hugetlb (folio); +__folio_set_hugetlb (folio);hugetlb_set_folio_subpool (folio,NULL );set_hugetlb_cgroup (folio,NULL );set_hugetlb_cgroup_rsvd (folio,NULL );
@@ -2075,22 +2075,6 @@ static bool prep_compound_gigantic_folio }/* -* PageHuge() only returns true for hugetlbfs pages, but not for normal or -* transparent huge pages. See the PageTransHuge() documentation for more -* details. -*/ -int PageHuge (struct page *page) -{ -struct folio *folio; - -if (!PageCompound (page)) -return 0 ; - folio =page_folio (page); -return folio_test_hugetlb (folio); -} -EXPORT_SYMBOL_GPL (PageHuge); - -/* * Find and lock address space (mapping) in write mode. * * Upon entry, the page is locked which means that page_mapping() is
Greg Kroah-Hartman
maintainerPATCH 158/186 dmaengine: owl: fix register access functions
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 43c633ef93a5d293c96ebcedb40130df13128428 ]
When building with 'make W=1', clang notices that the computed register values are never actually written back but instead the wrong variable is set:
drivers/dma/owl-dma.c:244:6: error: variable 'regval' set but not used [-Werror,-Wunused-but-set-variable]
244 | u32 regval;
| ^drivers/dma/owl-dma.c:268:6: error: variable 'regval' set but not used [-Werror,-Wunused-but-set-variable]
268 | u32 regval;
| ^
Change these to what was most likely intended.
--- drivers/dma/owl-dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma/owl-dma.c +2 -2
@@ -250,7 +250,7 @@ static void pchan_update(struct owl_dma_pchan *pchan, u32 reg,else regval &= ~val; -writel (val, pchan->base + reg); +writel (regval, pchan->base + reg); }static void pchan_writel (struct owl_dma_pchan *pchan,u32 reg,u32 data)
@@ -274,7 +274,7 @@ static void dma_update(struct owl_dma *od, u32 reg, u32 val, bool state)else regval &= ~val; -writel (val, od->base + reg); +writel (regval, od->base + reg); }static void dma_writel (struct owl_dma *od,u32 reg,u32 data)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 159/186 dmaengine: tegra186: Fix residual calculation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Akhil R <[email protected]>
[ Upstream commit 30f0ced9971b2d8c8c24ae75786f9079489a012d ]
The existing residual calculation returns an incorrect value when bytes_xfer == bytes_req. This scenario occurs particularly with drivers like UART where DMA is scheduled for maximum number of bytes and is terminated when the bytes inflow stops. At higher baud rates, it could request the tx_status while there is no bytes left to transfer. This will lead to incorrect residual being set. Hence return residual as '0' when bytes transferred equals to the bytes requested.
--- drivers/dma/tegra186-gpc-dma.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/dma/tegra186-gpc-dma.c +3 -0
@@ -746,6 +746,9 @@ static int tegra_dma_get_residual(struct tegra_dma_channel *tdc) bytes_xfer = dma_desc->bytes_xfer + sg_req[dma_desc->sg_idx].len - (wcount *4 ); +if (dma_desc->bytes_req == bytes_xfer) +return 0 ; + residual = dma_desc->bytes_req - (bytes_xfer % dma_desc->bytes_req);return residual;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 160/186 idma64: Dont try to serve interrupts when device is powered off
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
[ Upstream commit 9140ce47872bfd89fca888c2f992faa51d20c2bc ]
When iDMA 64-bit device is powered off, the IRQ status register is all 1:s. This is never happen in real case and signalling that the device is simply powered off. Don't try to serve interrupts that are not ours.
--- drivers/dma/idma64.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/dma/idma64.c +4 -0
@@ -171,6 +171,10 @@ static irqreturn_t idma64_irq(int irq, void *dev)u32 status_err;unsigned short i; +/* Since IRQ may be shared, check if DMA controller is powered on */ +if (status ==GENMASK (31 ,0 )) +return IRQ_NONE ; +dev_vdbg (idma64->dma.dev,"%s: status=%#x\n" , __func__, status);/* Check if we have any interrupt from the DMA controller */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 161/186 soundwire: amd: fix for wake interrupt handling for clockstop mode
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vijendar Mukunda <[email protected]>
[ Upstream commit 63dc588e7af1392576071a1841298198c9cddee3 ]
When SoundWire Wake interrupt is enabled along with SoundWire Wake enable register, SoundWire wake interrupt will be reported when SoundWire manager is in D3 state and ACP is in D3 state.
When SoundWire Wake interrupt is reported, it will invoke runtime resume of the SoundWire manager device.
In case of system level suspend, for ClockStop Mode SoundWire Wake interrupt should be disabled.
It should be enabled only for runtime suspend scenario. Change wake interrupt enable/disable sequence for ClockStop Mode in system level suspend and runtime suspend sceanrio.
--- drivers/soundwire/amd_manager.c | 15 +++++++++++++++ drivers/soundwire/amd_manager.h | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-)
drivers/soundwire/amd_manager.c +15 -0
@@ -148,6 +148,19 @@ static void amd_sdw_set_frameshape(struct amd_sdw_manager *amd_manager)writel (frame_size, amd_manager->mmio +ACP_SW_FRAMESIZE ); } +static void amd_sdw_wake_enable (struct amd_sdw_manager *amd_manager,bool enable) +{ +u32 wake_ctrl; + + wake_ctrl =readl (amd_manager->mmio +ACP_SW_STATE_CHANGE_STATUS_MASK_8TO11 ); +if (enable) + wake_ctrl |=AMD_SDW_WAKE_INTR_MASK ; +else + wake_ctrl &= ~AMD_SDW_WAKE_INTR_MASK ; + +writel (wake_ctrl, amd_manager->mmio +ACP_SW_STATE_CHANGE_STATUS_MASK_8TO11 ); +} +static void amd_sdw_ctl_word_prep (u32 *lower_word,u32 *upper_word,struct sdw_msg *msg,int cmd_offset) {
@@ -1122,6 +1135,7 @@ static int __maybe_unused amd_suspend(struct device *dev) }if (amd_manager->power_mode_mask &AMD_SDW_CLK_STOP_MODE ) { +amd_sdw_wake_enable (amd_manager, false);return amd_sdw_clock_stop (amd_manager); }else if (amd_manager->power_mode_mask &AMD_SDW_POWER_OFF_MODE ) {/*
@@ -1148,6 +1162,7 @@ static int __maybe_unused amd_suspend_runtime(struct device *dev)return 0 ; }if (amd_manager->power_mode_mask &AMD_SDW_CLK_STOP_MODE ) { +amd_sdw_wake_enable (amd_manager, true);return amd_sdw_clock_stop (amd_manager); }else if (amd_manager->power_mode_mask &AMD_SDW_POWER_OFF_MODE ) { ret =amd_sdw_clock_stop (amd_manager);
drivers/soundwire/amd_manager.h +2 -1
@@ -152,7 +152,7 @@#define AMD_SDW0_EXT_INTR_MASK 0x200000#define AMD_SDW1_EXT_INTR_MASK 4#define AMD_SDW_IRQ_MASK_0TO7 0x77777777 -#define AMD_SDW_IRQ_MASK_8TO11 0x000d7777 +#define AMD_SDW_IRQ_MASK_8TO11 0x000c7777#define AMD_SDW_IRQ_ERROR_MASK 0xff#define AMD_SDW_MAX_FREQ_NUM 1#define AMD_SDW0_MAX_TX_PORTS 3
@@ -190,6 +190,7 @@#define AMD_SDW_CLK_RESUME_REQ 2#define AMD_SDW_CLK_RESUME_DONE 3#define AMD_SDW_WAKE_STAT_MASK BIT(16) +#define AMD_SDW_WAKE_INTR_MASK BIT(16)static u32 amd_sdw_freq_tbl[AMD_SDW_MAX_FREQ_NUM ] = {AMD_SDW_DEFAULT_CLK_FREQ ,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 162/186 phy: marvell: a3700-comphy: Fix out of bounds read
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikhail Kobuk <[email protected]>
[ Upstream commit e4308bc22b9d46cf33165c9dfaeebcf29cd56f04 ]
There is an out of bounds read access of 'gbe_phy_init_fix[fix_idx].addr' every iteration after 'fix_idx' reaches 'ARRAY_SIZE(gbe_phy_init_fix)'.
Make sure 'gbe_phy_init[addr]' is used when all elements of 'gbe_phy_init_fix' array are handled.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/phy/marvell/phy-mvebu-a3700-comphy.c +4 -3
@@ -611,11 +611,12 @@ static void comphy_gbe_phy_init(struct mvebu_a3700_comphy_lane *lane,* comparison to 3.125 Gbps values. These register values are * stored in "gbe_phy_init_fix" array. */ -if (!is_1gbps && gbe_phy_init_fix[fix_idx].addr == addr) { +if (!is_1gbps && + fix_idx <ARRAY_SIZE (gbe_phy_init_fix) && + gbe_phy_init_fix[fix_idx].addr == addr) {/* Use new value */ val = gbe_phy_init_fix[fix_idx].value; -if (fix_idx <ARRAY_SIZE (gbe_phy_init_fix)) - fix_idx++; + fix_idx++; }else { val = gbe_phy_init[addr]; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 163/186 phy: marvell: a3700-comphy: Fix hardcoded array size
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikhail Kobuk <[email protected]>
[ Upstream commit 627207703b73615653eea5ab7a841d5b478d961e ]
Replace hardcoded 'gbe_phy_init' array size by explicit one.
--- drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/marvell/phy-mvebu-a3700-comphy.c +1 -1
@@ -603,7 +603,7 @@ static void comphy_gbe_phy_init(struct mvebu_a3700_comphy_lane *lane,u16 val; fix_idx =0 ; -for (addr =0 ; addr <512 ; addr++) { +for (addr =0 ; addr <ARRAY_SIZE (gbe_phy_init); addr++) {/* * All PHY register values are defined in full for 3.125Gbps * SERDES speed. The values required for 1.25 Gbps are almost
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 164/186 phy: freescale: imx8m-pcie: fix pcie link-up instability
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcel Ziswiler <[email protected]>
[ Upstream commit 3a161017f1de55cc48be81f6156004c151f32677 ]
Leaving AUX_PLL_REFCLK_SEL at its reset default of AUX_IN (PLL clock) proves to be more stable on the i.MX 8M Mini.
--- drivers/phy/freescale/phy-fsl-imx8m-pcie.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/phy/freescale/phy-fsl-imx8m-pcie.c +4 -2
@@ -110,8 +110,10 @@ static int imx8_pcie_phy_power_on(struct phy *phy)/* Source clock from SoC internal PLL */ writel (ANA_PLL_CLK_OUT_TO_EXT_IO_SEL , imx8_phy->base +IMX8MM_PCIE_PHY_CMN_REG062 ); -writel (AUX_PLL_REFCLK_SEL_SYS_PLL , - imx8_phy->base +IMX8MM_PCIE_PHY_CMN_REG063 ); +if (imx8_phy->drvdata->variant !=IMX8MM ) { +writel (AUX_PLL_REFCLK_SEL_SYS_PLL , + imx8_phy->base +IMX8MM_PCIE_PHY_CMN_REG063 ); + } val =ANA_AUX_RX_TX_SEL_TX |ANA_AUX_TX_TERM ;writel (val |ANA_AUX_RX_TERM_GND_EN , imx8_phy->base +IMX8MM_PCIE_PHY_CMN_REG064 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 165/186 phy: rockchip-snps-pcie3: fix bifurcation on rk3588
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Tomek <[email protected]>
[ Upstream commit f8020dfb311d2b6cf657668792aaa5fa8863a7dd ]
So far all RK3588 boards use fully aggregated PCIe. CM3588 is one of the few boards using this feature and apparently it is broken.
The PHY offers the following mapping options:
port 0 lane 0 - always mapped to controller 0 (4L) port 0 lane 1 - to controller 0 or 2 (1L0) port 1 lane 0 - to controller 0 or 1 (2L) port 1 lane 1 - to controller 0, 1 or 3 (1L1)
The data-lanes DT property maps these as follows:
0 = no controller (unsupported by the HW)
1 = 4L
2 = 2L
3 = 1L0
4 = 1L1
That allows the following configurations with first column being the mainline data-lane mapping, second column being the downstream name, third column being PCIE3PHY_GRF_CMN_CON0 and PHP_GRF_PCIESEL register values and final column being the user visible lane setup:
<1 1 1 1> = AGGREG = [4 0] = x4 (aggregation)
<1 1 2 2> = NANBNB = [0 0] = x2 x2 (no bif.)
<1 3 2 2> = NANBBI = [1 1] = x2 x1x1 (bif. of port 0) <1 1 2 4> = NABINB = [2 2] = x1x1 x2 (bif. of port 1) <1 3 2 4> = NABIBI = [3 3] = x1x1 x1x1 (bif. of both ports)
The driver currently does not program PHP_GRF_PCIESEL correctly, which is fixed by this patch. As a side-effect the new logic is much simpler than the old logic.
--- .../phy/rockchip/phy-rockchip-snps-pcie3.c | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-)
drivers/phy/rockchip/phy-rockchip-snps-pcie3.c +8 -16
@@ -132,7 +132,7 @@ static const struct rockchip_p3phy_ops rk3568_ops = {static int rockchip_p3phy_rk3588_init (struct rockchip_p3phy_priv *priv) {u32 reg =0 ; -u8 mode =0 ; +u8 mode =RK3588_LANE_AGGREGATION ;/* default */ int ret;/* Deassert PCIe PMA output clamp mode */
@@ -140,28 +140,20 @@ static int rockchip_p3phy_rk3588_init(struct rockchip_p3phy_priv *priv)/* Set bifurcation if needed */ for (int i =0 ; i < priv->num_lanes; i++) { -if (!priv->lanes[i]) - mode |= (BIT (i) <<3 ); -if (priv->lanes[i] >1 ) - mode |= (BIT (i) >>1 ); - } - -if (!mode) - reg =RK3588_LANE_AGGREGATION ; -else { -if (mode & (BIT (0 ) |BIT (1 ))) - reg |=RK3588_BIFURCATION_LANE_0_1 ; - -if (mode & (BIT (2 ) |BIT (3 ))) - reg |=RK3588_BIFURCATION_LANE_2_3 ; + mode &= ~RK3588_LANE_AGGREGATION ; +if (priv->lanes[i] ==3 ) + mode |=RK3588_BIFURCATION_LANE_0_1 ; +if (priv->lanes[i] ==4 ) + mode |=RK3588_BIFURCATION_LANE_2_3 ; } + reg = mode;regmap_write (priv->phy_grf,RK3588_PCIE3PHY_GRF_CMN_CON0 , (0x7 <<16 ) | reg);/* Set pcie1ln_sel in PHP_GRF_PCIESEL_CON */ if (!IS_ERR (priv->pipe_grf)) { - reg = (mode & (BIT (6 ) |BIT (7 ))) >>6 ; + reg = mode &3 ;if (reg)regmap_write (priv->pipe_grf,PHP_GRF_PCIESEL_CON , (reg <<16 ) | reg);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 166/186 phy: rockchip-snps-pcie3: fix clearing PHP_GRF_PCIESEL_CON bits
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <[email protected]>
[ Upstream commit 55491a5fa163bf15158f34f3650b3985f25622b9 ]
Currently the PCIe v3 PHY driver only sets the pcie1ln_sel bits, but does not clear them because of an incorrect write mask. This fixes up the issue by using a newly introduced constant for the write mask.
While at it also introduces a proper GENMASK based constant for the PCIE30_PHY_MODE.
--- drivers/phy/rockchip/phy-rockchip-snps-pcie3.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/phy/rockchip/phy-rockchip-snps-pcie3.c +6 -3
@@ -40,6 +40,8 @@#define RK3588_BIFURCATION_LANE_0_1 BIT(0)#define RK3588_BIFURCATION_LANE_2_3 BIT(1)#define RK3588_LANE_AGGREGATION BIT(2) +#define RK3588_PCIE1LN_SEL_EN (GENMASK(1, 0) << 16) +#define RK3588_PCIE30_PHY_MODE_EN (GENMASK(2, 0) << 16)struct rockchip_p3phy_ops ;
@@ -149,14 +151,15 @@ static int rockchip_p3phy_rk3588_init(struct rockchip_p3phy_priv *priv) } reg = mode; -regmap_write (priv->phy_grf,RK3588_PCIE3PHY_GRF_CMN_CON0 , (0x7 <<16 ) | reg); +regmap_write (priv->phy_grf,RK3588_PCIE3PHY_GRF_CMN_CON0 , +RK3588_PCIE30_PHY_MODE_EN | reg);/* Set pcie1ln_sel in PHP_GRF_PCIESEL_CON */ if (!IS_ERR (priv->pipe_grf)) { - reg = mode &3 ; + reg = mode & (RK3588_BIFURCATION_LANE_0_1 |RK3588_BIFURCATION_LANE_2_3 );if (reg)regmap_write (priv->pipe_grf,PHP_GRF_PCIESEL_CON , - (reg <<16 ) | reg); +RK3588_PCIE1LN_SEL_EN | reg); }reset_control_deassert (priv->p30phy);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 167/186 phy: rockchip: naneng-combphy: Fix mux on rk3588
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <[email protected]>
[ Upstream commit d16d4002fea69b6609b852dd8db1f5844c02fbe4 ]
The pcie1l0_sel and pcie1l1_sel bits in PCIESEL_CON configure the mux for PCIe1L0 and PCIe1L1 to either the PIPE Combo PHYs or the PCIe3 PHY. Thus this configuration interfers with the data-lanes configuration done by the PCIe3 PHY.
RK3588 has three Combo PHYs. The first one has a dedicated PCIe controller and is not affected by this. For the other two Combo PHYs, there is one mux for each of them.
pcie1l0_sel selects if PCIe 1L0 is muxed to Combo PHY 1 when bit is set to 0 or to the PCIe3 PHY when bit is set to 1.
pcie1l1_sel selects if PCIe 1L1 is muxed to Combo PHY 2 when bit is set to 0 or to the PCIe3 PHY when bit is set to 1.
Currently the code always muxes 1L0 and 1L1 to the Combi PHYs once one of them is being used in PCIe mode. This is obviously wrong when at least one of the ports should be muxed to the PCIe3 PHY.
Fix this by introducing Combo PHY identification and then only setting up the required bit.
--- .../rockchip/phy-rockchip-naneng-combphy.c | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-)
drivers/phy/rockchip/phy-rockchip-naneng-combphy.c +33 -3
@@ -125,12 +125,15 @@ struct rockchip_combphy_grfcfg { };struct rockchip_combphy_cfg { +unsigned int num_phys; +unsigned int phy_ids[3 ];const struct rockchip_combphy_grfcfg *grfcfg;int (*combphy_cfg)(struct rockchip_combphy_priv *priv); };struct rockchip_combphy_priv {u8 type; +int id;void __iomem *mmio;int num_clks;struct clk_bulk_data *clks;
@@ -320,7 +323,7 @@ static int rockchip_combphy_probe(struct platform_device *pdev)struct rockchip_combphy_priv *priv;const struct rockchip_combphy_cfg *phy_cfg;struct resource *res; -int ret; +int ret, id; phy_cfg =of_device_get_match_data (dev);if (!phy_cfg) {
@@ -338,6 +341,15 @@ static int rockchip_combphy_probe(struct platform_device *pdev)return ret; } +/* find the phy-id from the io address */ + priv->id = -ENODEV ; +for (id =0 ; id < phy_cfg->num_phys; id++) { +if (res->start == phy_cfg->phy_ids[id]) { + priv->id = id; +break ; + } + } + priv->dev = dev; priv->type =PHY_NONE ; priv->cfg = phy_cfg;
@@ -562,6 +574,12 @@ static const struct rockchip_combphy_grfcfg rk3568_combphy_grfcfgs = { };static const struct rockchip_combphy_cfg rk3568_combphy_cfgs = { + .num_phys =3 , + .phy_ids = { +0xfe820000 , +0xfe830000 , +0xfe840000 , + }, .grfcfg = &rk3568_combphy_grfcfgs, .combphy_cfg = rk3568_combphy_cfg, };
@@ -578,8 +596,14 @@ static int rk3588_combphy_cfg(struct rockchip_combphy_priv *priv)rockchip_combphy_param_write (priv->phy_grf, &cfg->con1_for_pcie, true);rockchip_combphy_param_write (priv->phy_grf, &cfg->con2_for_pcie, true);rockchip_combphy_param_write (priv->phy_grf, &cfg->con3_for_pcie, true); -rockchip_combphy_param_write (priv->pipe_grf, &cfg->pipe_pcie1l0_sel, true); -rockchip_combphy_param_write (priv->pipe_grf, &cfg->pipe_pcie1l1_sel, true); +switch (priv->id) { +case 1 : +rockchip_combphy_param_write (priv->pipe_grf, &cfg->pipe_pcie1l0_sel, true); +break ; +case 2 : +rockchip_combphy_param_write (priv->pipe_grf, &cfg->pipe_pcie1l1_sel, true); +break ; + }break ;case PHY_TYPE_USB3 :/* Set SSC downward spread spectrum */
@@ -736,6 +760,12 @@ static const struct rockchip_combphy_grfcfg rk3588_combphy_grfcfgs = { };static const struct rockchip_combphy_cfg rk3588_combphy_cfgs = { + .num_phys =3 , + .phy_ids = { +0xfee00000 , +0xfee10000 , +0xfee20000 , + }, .grfcfg = &rk3588_combphy_grfcfgs, .combphy_cfg = rk3588_combphy_cfg, };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 168/186 phy: qcom: m31: match requested regulator name with dt schema
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabor Juhos <[email protected]>
[ Upstream commit 47b3e2f3914ae5e8d9025d65ae5cffcbb54bc9c3 ]
According to the 'qcom,ipq5332-usb-hsphy.yaml' schema, the 5V supply regulator must be defined via the 'vdd-supply' property. The driver however requests for the 'vdda-phy' regulator which results in the following message when the driver is probed on a IPQ5018 based board with a device tree matching to the schema:
qcom-m31usb-phy 5b000.phy: supply vdda-phy not found, using dummy regulator qcom-m31usb-phy 5b000.phy: Registered M31 USB phy
This means that the regulator specified in the device tree never gets enabled.
Change the driver to use the 'vdd' name for the regulator as per defined in the schema in order to ensure that the corresponding regulator gets enabled.
--- drivers/phy/qualcomm/phy-qcom-m31.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-m31.c +1 -1
@@ -253,7 +253,7 @@ static int m31usb_phy_probe(struct platform_device *pdev)return dev_err_probe (dev,PTR_ERR (qphy->phy),"failed to create phy\n" ); - qphy->vreg =devm_regulator_get (dev,"vdda-phy" ); + qphy->vreg =devm_regulator_get (dev,"vdd" );if (IS_ERR (qphy->vreg))return dev_err_probe (dev,PTR_ERR (qphy->vreg),"failed to get vreg\n" );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 169/186 dmaengine: idxd: Convert spinlock to mutex to lock evl workqueue
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rex Zhang <[email protected]>
[ Upstream commit d5638de827cff0fce77007e426ec0ffdedf68a44 ]
drain_workqueue() cannot be called safely in a spinlocked context due to possible task rescheduling. In the multi-task scenario, calling queue_work() while drain_workqueue() will lead to a Call Trace as pushing a work on a draining workqueue is not permitted in spinlocked context.
Call Trace:
<TASK>
? __warn+0x7d/0x140
? __queue_work+0x2b2/0x440
? report_bug+0x1f8/0x200
? handle_bug+0x3c/0x70
? exc_invalid_op+0x18/0x70
? asm_exc_invalid_op+0x1a/0x20
? __queue_work+0x2b2/0x440
queue_work_on+0x28/0x30
idxd_misc_thread+0x303/0x5a0 [idxd]
? __schedule+0x369/0xb40
? __pfx_irq_thread_fn+0x10/0x10
? irq_thread+0xbc/0x1b0
irq_thread_fn+0x21/0x70
irq_thread+0x102/0x1b0
? preempt_count_add+0x74/0xa0
? __pfx_irq_thread_dtor+0x10/0x10
? __pfx_irq_thread+0x10/0x10
kthread+0x103/0x140
? __pfx_kthread+0x10/0x10
ret_from_fork+0x31/0x50
? __pfx_kthread+0x10/0x10
ret_from_fork_asm+0x1b/0x30
</TASK>The current implementation uses a spinlock to protect event log workqueue and will lead to the Call Trace due to potential task rescheduling.
To address the locking issue, convert the spinlock to mutex, allowing the drain_workqueue() to be called in a safe mutex-locked context.
This change ensures proper synchronization when accessing the event log workqueue, preventing potential Call Trace and improving the overall robustness of the code.
--- drivers/dma/idxd/cdev.c | 5 ++--- drivers/dma/idxd/debugfs.c | 4 ++-- drivers/dma/idxd/device.c | 8 ++++---- drivers/dma/idxd/idxd.h | 2 +- drivers/dma/idxd/init.c | 2 +- drivers/dma/idxd/irq.c | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-)
drivers/dma/idxd/cdev.c +2 -3
@@ -342,7 +342,7 @@ static void idxd_cdev_evl_drain_pasid(struct idxd_wq *wq, u32 pasid)if (!evl)return ; -spin_lock (&evl->lock); +mutex_lock (&evl->lock); status.bits =ioread64 (idxd->reg_base +IDXD_EVLSTATUS_OFFSET ); t = status.tail; h = status.head;
@@ -354,9 +354,8 @@ static void idxd_cdev_evl_drain_pasid(struct idxd_wq *wq, u32 pasid)set_bit (h, evl->bmap); h = (h +1 ) % size; } -spin_unlock (&evl->lock); -drain_workqueue (wq->wq); +mutex_unlock (&evl->lock); }static int idxd_cdev_release (struct inode *node,struct file *filep)
drivers/dma/idxd/debugfs.c +2 -2
@@ -66,7 +66,7 @@ static int debugfs_evl_show(struct seq_file *s, void *d)if (!evl || !evl->log)return 0 ; -spin_lock (&evl->lock); +mutex_lock (&evl->lock); evl_status.bits =ioread64 (idxd->reg_base +IDXD_EVLSTATUS_OFFSET ); t = evl_status.tail;
@@ -87,7 +87,7 @@ static int debugfs_evl_show(struct seq_file *s, void *d)dump_event_entry (idxd, s, i, &count, processed); } -spin_unlock (&evl->lock); +mutex_unlock (&evl->lock);return 0 ; }
drivers/dma/idxd/device.c +4 -4
@@ -770,7 +770,7 @@ static int idxd_device_evl_setup(struct idxd_device *idxd) goto err_alloc; } -spin_lock (&evl->lock); +mutex_lock (&evl->lock); evl->log = addr; evl->dma = dma_addr; evl->log_size = size;
@@ -791,7 +791,7 @@ static int idxd_device_evl_setup(struct idxd_device *idxd) gencfg.evl_en =1 ;iowrite32 (gencfg.bits, idxd->reg_base +IDXD_GENCFG_OFFSET ); -spin_unlock (&evl->lock); +mutex_unlock (&evl->lock);return 0 ; err_alloc:
@@ -814,7 +814,7 @@ static void idxd_device_evl_free(struct idxd_device *idxd)if (!gencfg.evl_en)return ; -spin_lock (&evl->lock); +mutex_lock (&evl->lock); gencfg.evl_en =0 ;iowrite32 (gencfg.bits, idxd->reg_base +IDXD_GENCFG_OFFSET );
@@ -831,7 +831,7 @@ static void idxd_device_evl_free(struct idxd_device *idxd) evl_dma = evl->dma; evl->log =NULL ; evl->size =IDXD_EVL_SIZE_MIN ; -spin_unlock (&evl->lock); +mutex_unlock (&evl->lock);dma_free_coherent (dev, evl_log_size, evl_log, evl_dma); }
drivers/dma/idxd/idxd.h +1 -1
@@ -279,7 +279,7 @@ struct idxd_driver_data {struct idxd_evl {/* Lock to protect event log access. */ -spinlock_t lock; +struct mutex lock;void *log;dma_addr_t dma;/* Total size of event log = number of entries * entry size. */
drivers/dma/idxd/init.c +1 -1
@@ -353,7 +353,7 @@ static int idxd_init_evl(struct idxd_device *idxd)if (!evl)return -ENOMEM ; -spin_lock_init (&evl->lock); +mutex_init (&evl->lock); evl->size =IDXD_EVL_SIZE_MIN ; idxd_name =dev_name (idxd_confdev (idxd));
drivers/dma/idxd/irq.c +2 -2
@@ -363,7 +363,7 @@ static void process_evl_entries(struct idxd_device *idxd) evl_status.bits =0 ; evl_status.int_pending =1 ; -spin_lock (&evl->lock); +mutex_lock (&evl->lock);/* Clear interrupt pending bit */ iowrite32 (evl_status.bits_upper32, idxd->reg_base +IDXD_EVLSTATUS_OFFSET +sizeof (u32));
@@ -380,7 +380,7 @@ static void process_evl_entries(struct idxd_device *idxd) evl_status.head = h;iowrite32 (evl_status.bits_lower32, idxd->reg_base +IDXD_EVLSTATUS_OFFSET ); -spin_unlock (&evl->lock); +mutex_unlock (&evl->lock); }irqreturn_t idxd_misc_thread (int vec,void *data)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 170/186 dma: xilinx_dpdma: Fix locking
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Anderson <[email protected]>
[ Upstream commit 244296cc3a155199a8b080d19e645d7d49081a38 ]
There are several places where either chan->lock or chan->vchan.lock was not held. Add appropriate locking. This fixes lockdep warnings like
[ 31.077578] ------------[ cut here ]------------ [ 31.077831] WARNING: CPU: 2 PID: 40 at drivers/dma/xilinx/xilinx_dpdma.c:834 xilinx_dpdma_chan_queue_transfer+0x274/0x5e0 [ 31.077953] Modules linked in: [ 31.078019] CPU: 2 PID: 40 Comm: kworker/u12:1 Not tainted 6.6.20+ #98 [ 31.078102] Hardware name: xlnx,zynqmp (DT) [ 31.078169] Workqueue: events_unbound deferred_probe_work_func [ 31.078272] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 31.078377] pc : xilinx_dpdma_chan_queue_transfer+0x274/0x5e0 [ 31.078473] lr : xilinx_dpdma_chan_queue_transfer+0x270/0x5e0 [ 31.078550] sp : ffffffc083bb2e10 [ 31.078590] x29: ffffffc083bb2e10 x28: 0000000000000000 x27: ffffff880165a168 [ 31.078754] x26: ffffff880164e920 x25: ffffff880164eab8 x24: ffffff880164d480 [ 31.078920] x23: ffffff880165a148 x22: ffffff880164e988 x21: 0000000000000000 [ 31.079132] x20: ffffffc082aa3000 x19: ffffff880164e880 x18: 0000000000000000 [ 31.079295] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 [ 31.079453] x14: 0000000000000000 x13: ffffff8802263dc0 x12: 0000000000000001 [ 31.079613] x11: 0001ffc083bb2e34 x10: 0001ff880164e98f x9 : 0001ffc082aa3def [ 31.079824] x8 : 0001ffc082aa3dec x7 : 0000000000000000 x6 : 0000000000000516 [ 31.079982] x5 : ffffffc7f8d43000 x4 : ffffff88003c9c40 x3 : ffffffffffffffff [ 31.080147] x2 : ffffffc7f8d43000 x1 : 00000000000000c0 x0 : 0000000000000000 [ 31.080307] Call trace: [ 31.080340] xilinx_dpdma_chan_queue_transfer+0x274/0x5e0 [ 31.080518] xilinx_dpdma_issue_pending+0x11c/0x120 [ 31.080595] zynqmp_disp_layer_update+0x180/0x3ac [ 31.080712] zynqmp_dpsub_plane_atomic_update+0x11c/0x21c [ 31.080825] drm_atomic_helper_commit_planes+0x20c/0x684 [ 31.080951] drm_atomic_helper_commit_tail+0x5c/0xb0 [ 31.081139] commit_tail+0x234/0x294 [ 31.081246] drm_atomic_helper_commit+0x1f8/0x210 [ 31.081363] drm_atomic_commit+0x100/0x140 [ 31.081477] drm_client_modeset_commit_atomic+0x318/0x384 [ 31.081634] drm_client_modeset_commit_locked+0x8c/0x24c [ 31.081725] drm_client_modeset_commit+0x34/0x5c [ 31.081812] __drm_fb_helper_restore_fbdev_mode_unlocked+0x104/0x168 [ 31.081899] drm_fb_helper_set_par+0x50/0x70 [ 31.081971] fbcon_init+0x538/0xc48 [ 31.082047] visual_init+0x16c/0x23c [ 31.082207] do_bind_con_driver.isra.0+0x2d0/0x634 [ 31.082320] do_take_over_console+0x24c/0x33c [ 31.082429] do_fbcon_takeover+0xbc/0x1b0 [ 31.082503] fbcon_fb_registered+0x2d0/0x34c [ 31.082663] register_framebuffer+0x27c/0x38c [ 31.082767] __drm_fb_helper_initial_config_and_unlock+0x5c0/0x91c [ 31.082939] drm_fb_helper_initial_config+0x50/0x74 [ 31.083012] drm_fbdev_dma_client_hotplug+0xb8/0x108 [ 31.083115] drm_client_register+0xa0/0xf4 [ 31.083195] drm_fbdev_dma_setup+0xb0/0x1cc [ 31.083293] zynqmp_dpsub_drm_init+0x45c/0x4e0 [ 31.083431] zynqmp_dpsub_probe+0x444/0x5e0 [ 31.083616] platform_probe+0x8c/0x13c [ 31.083713] really_probe+0x258/0x59c [ 31.083793] __driver_probe_device+0xc4/0x224 [ 31.083878] driver_probe_device+0x70/0x1c0 [ 31.083961] __device_attach_driver+0x108/0x1e0 [ 31.084052] bus_for_each_drv+0x9c/0x100 [ 31.084125] __device_attach+0x100/0x298 [ 31.084207] device_initial_probe+0x14/0x20 [ 31.084292] bus_probe_device+0xd8/0xdc [ 31.084368] deferred_probe_work_func+0x11c/0x180 [ 31.084451] process_one_work+0x3ac/0x988 [ 31.084643] worker_thread+0x398/0x694 [ 31.084752] kthread+0x1bc/0x1c0 [ 31.084848] ret_from_fork+0x10/0x20 [ 31.084932] irq event stamp: 64549 [ 31.084970] hardirqs last enabled at (64548): [<ffffffc081adf35c>] _raw_spin_unlock_irqrestore+0x80/0x90 [ 31.085157] hardirqs last disabled at (64549): [<ffffffc081adf010>] _raw_spin_lock_irqsave+0xc0/0xdc [ 31.085277] softirqs last enabled at (64503): [<ffffffc08001071c>] __do_softirq+0x47c/0x500 [ 31.085390] softirqs last disabled at (64498): [<ffffffc080017134>] ____do_softirq+0x10/0x1c [ 31.085501] ---[ end trace 0000000000000000 ]---
--- drivers/dma/xilinx/xilinx_dpdma.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/dma/xilinx/xilinx_dpdma.c +10 -3
@@ -214,7 +214,8 @@ struct xilinx_dpdma_tx_desc {* @running: true if the channel is running * @first_frame: flag for the first frame of stream * @video_group: flag if multi-channel operation is needed for video channels -* @lock: lock to access struct xilinx_dpdma_chan +* @lock: lock to access struct xilinx_dpdma_chan. Must be taken before +* @vchan.lock, if both are to be held. * @desc_pool: descriptor allocation pool * @err_task: error IRQ bottom half handler * @desc: References to descriptors being processed
@@ -1097,12 +1098,14 @@ static void xilinx_dpdma_chan_vsync_irq(struct xilinx_dpdma_chan *chan)* Complete the active descriptor, if any, promote the pending * descriptor to active, and queue the next transfer, if any. */ +spin_lock (&chan->vchan.lock);if (chan->desc.active)vchan_cookie_complete (&chan->desc.active->vdesc); chan->desc.active = pending; chan->desc.pending =NULL ;xilinx_dpdma_chan_queue_transfer (chan); +spin_unlock (&chan->vchan.lock); out:spin_unlock_irqrestore (&chan->lock, flags);
@@ -1264,10 +1267,12 @@ static void xilinx_dpdma_issue_pending(struct dma_chan *dchan)struct xilinx_dpdma_chan *chan =to_xilinx_chan (dchan);unsigned long flags; -spin_lock_irqsave (&chan->vchan.lock, flags); +spin_lock_irqsave (&chan->lock, flags); +spin_lock (&chan->vchan.lock);if (vchan_issue_pending (&chan->vchan))xilinx_dpdma_chan_queue_transfer (chan); -spin_unlock_irqrestore (&chan->vchan.lock, flags); +spin_unlock (&chan->vchan.lock); +spin_unlock_irqrestore (&chan->lock, flags); } static int xilinx_dpdma_config(struct dma_chan *dchan,
@@ -1495,7 +1500,9 @@ static void xilinx_dpdma_chan_err_task(struct tasklet_struct *t) XILINX_DPDMA_EINTR_CHAN_ERR_MASK << chan->id);spin_lock_irqsave (&chan->lock, flags); +spin_lock (&chan->vchan.lock);xilinx_dpdma_chan_queue_transfer (chan); +spin_unlock (&chan->vchan.lock);spin_unlock_irqrestore (&chan->lock, flags); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 171/186 dmaengine: idxd: Fix oops during rmmod on single-CPU platforms
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fenghua Yu <[email protected]>
[ Upstream commit f221033f5c24659dc6ad7e5cf18fb1b075f4a8be ]
During the removal of the idxd driver, registered offline callback is invoked as part of the clean up process. However, on systems with only one CPU online, no valid target is available to migrate the perf context, resulting in a kernel oops:
BUG: unable to handle page fault for address: 000000000002a2b8
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD 1470e1067 P4D 0
Oops: 0002 [#1] PREEMPT SMP NOPTI
CPU: 0 PID: 20 Comm: cpuhp/0 Not tainted 6.8.0-rc6-dsa+ #57
Hardware name: Intel Corporation AvenueCity/AvenueCity, BIOS BHSDCRB1.86B.2492.D03.2307181620 07/18/2023
RIP: 0010:mutex_lock+0x2e/0x50
...
Call Trace:
<TASK>
__die+0x24/0x70
page_fault_oops+0x82/0x160
do_user_addr_fault+0x65/0x6b0
__pfx___rdmsr_safe_on_cpu+0x10/0x10
exc_page_fault+0x7d/0x170
asm_exc_page_fault+0x26/0x30
mutex_lock+0x2e/0x50
mutex_lock+0x1e/0x50
perf_pmu_migrate_context+0x87/0x1f0
perf_event_cpu_offline+0x76/0x90 [idxd]
cpuhp_invoke_callback+0xa2/0x4f0
__pfx_perf_event_cpu_offline+0x10/0x10 [idxd]
cpuhp_thread_fun+0x98/0x150
smpboot_thread_fn+0x27/0x260
smpboot_thread_fn+0x1af/0x260
__pfx_smpboot_thread_fn+0x10/0x10
kthread+0x103/0x140
__pfx_kthread+0x10/0x10
ret_from_fork+0x31/0x50
__pfx_kthread+0x10/0x10
ret_from_fork_asm+0x1b/0x30
<TASK>Fix the issue by preventing the migration of the perf context to an invalid target.
--- drivers/dma/idxd/perfmon.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/dma/idxd/perfmon.c +3 -6
@@ -528,14 +528,11 @@ static int perf_event_cpu_offline(unsigned int cpu, struct hlist_node *node)return 0 ; target =cpumask_any_but (cpu_online_mask, cpu); -/* migrate events if there is a valid target */ -if (target < nr_cpu_ids) +if (target < nr_cpu_ids) {cpumask_set_cpu (target, &perfmon_dsa_cpu_mask); -else - target =-1 ; - -perf_pmu_migrate_context (&idxd_pmu->pmu, cpu, target); +perf_pmu_migrate_context (&idxd_pmu->pmu, cpu, target); + }return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 172/186 riscv: fix VMALLOC_START definition
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baoquan He <[email protected]>
[ Upstream commit ac88ff6b9d7dea9f0907c86bdae204dde7d5c0e6 ]
When below config items are set, compiler complained:
--------------------CONFIG_CRASH_CORE=yCONFIG_KEXEC_CORE=yCONFIG_CRASH_DUMP=y
......
-----------------------
-------------------------------------------------------------------arch/riscv/kernel/crash_core.c: In function 'arch_crash_save_vmcoreinfo':arch/riscv/kernel/crash_core.c:11:58: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'int' [-Wformat=]
11 | vmcoreinfo_append_str("NUMBER(VMALLOC_START)=0x%lx\n", VMALLOC_START);
| ~~^
| |
| long unsigned int
| %x----------------------------------------------------------------------
This is because on riscv macro VMALLOC_START has different type when CONFIG_MMU is set or unset.
arch/riscv/include/asm/pgtable.h:
--------------------------------------------------
Changing it to _AC(0, UL) in case CONFIG_MMU=n can fix the warning.
Stable-dep-of: 6065e736f82c ("riscv: Fix TASK_SIZE on 64-bit NOMMU")
--- arch/riscv/include/asm/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/include/asm/pgtable.h +1 -1
@@ -904,7 +904,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)#define PAGE_KERNEL __pgprot(0)#define swapper_pg_dir NULL#define TASK_SIZE 0xffffffffUL -#define VMALLOC_START 0 +#define VMALLOC_START _AC(0, UL)#define VMALLOC_END TASK_SIZE#endif /* !CONFIG_MMU */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 173/186 riscv: Fix TASK_SIZE on 64-bit NOMMU
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Samuel Holland <[email protected]>
[ Upstream commit 6065e736f82c817c9a597a31ee67f0ce4628e948 ]
On NOMMU, userspace memory can come from anywhere in physical RAM. The current definition of TASK_SIZE is wrong if any RAM exists above 4G, causing spurious failures in the userspace access routines.
--- arch/riscv/include/asm/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/include/asm/pgtable.h +1 -1
@@ -903,7 +903,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)#define PAGE_SHARED __pgprot(0)#define PAGE_KERNEL __pgprot(0)#define swapper_pg_dir NULL -#define TASK_SIZE 0xffffffffUL +#define TASK_SIZE _AC(-1, UL)#define VMALLOC_START _AC(0, UL)#define VMALLOC_END TASK_SIZE
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 174/186 riscv: Fix loading 64-bit NOMMU kernels past the start of RAM
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Samuel Holland <[email protected]>
[ Upstream commit aea702dde7e9876fb00571a2602f25130847bf0f ]
commit 3335068f8721 ("riscv: Use PUD/P4D/PGD pages for the linear mapping") added logic to allow using RAM below the kernel load address. However, this does not work for NOMMU, where PAGE_OFFSET is fixed to the kernel load address. Since that range of memory corresponds to PFNs below ARCH_PFN_OFFSET, mm initialization runs off the beginning of mem_map and corrupts adjacent kernel memory. Fix this by restoring the previous behavior for NOMMU kernels.
--- arch/riscv/include/asm/page.h | 2 +- arch/riscv/mm/init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/riscv/include/asm/page.h +1 -1
@@ -89,7 +89,7 @@ typedef struct page *pgtable_t;#define PTE_FMT "%08lx"#endif -#ifdef CONFIG_64BIT +#if defined(CONFIG_64BIT ) && defined(CONFIG_MMU )/* * We override this value as its generic definition uses __pa too early in * the boot process (before kernel_map.va_pa_offset is set).
arch/riscv/mm/init.c +1 -1
@@ -230,7 +230,7 @@ static void __init setup_bootmem(void)* In 64-bit, any use of __va/__pa before this point is wrong as we * did not know the start of DRAM before. */ -if (IS_ENABLED (CONFIG_64BIT )) +if (IS_ENABLED (CONFIG_64BIT ) &&IS_ENABLED (CONFIG_MMU )) kernel_map.va_pa_offset =PAGE_OFFSET - phys_ram_base;/*
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 175/186 phy: ti: tusb1210: Resolve charger-det crash if charger psy is unregistered
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit bf6e4ee5c43690e4c5a8a057bbcd4ff986bed052 ]
The power_supply frame-work is not really designed for there to be long living in kernel references to power_supply devices.
Specifically unregistering a power_supply while some other code has a reference to it triggers a WARN in power_supply_unregister():
WARN_ON(atomic_dec_return(&psy->use_cnt));
Folllowed by the power_supply still getting removed and the backing data freed anyway, leaving the tusb1210 charger-detect code with a dangling reference, resulting in a crash the next time tusb1210_get_online() is called.
Fix this by only holding the reference in tusb1210_get_online() freeing it at the end of the function. Note this still leaves a theoretical race window, but it avoids the issue when manually rmmod-ing the charger chip driver during development.
--- drivers/phy/ti/phy-tusb1210.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
drivers/phy/ti/phy-tusb1210.c +12 -11
@@ -65,7 +65,6 @@ struct tusb1210 {struct delayed_work chg_det_work;struct notifier_block psy_nb;struct power_supply *psy; -struct power_supply *charger;#endif };
@@ -231,19 +230,24 @@ static const char * const tusb1210_chargers[] = {static bool tusb1210_get_online (struct tusb1210 *tusb) { +struct power_supply *charger =NULL ;union power_supply_propval val; -int i; +bool online = false; +int i, ret; -for (i =0 ; i <ARRAY_SIZE (tusb1210_chargers) && !tusb->charger; i++) - tusb->charger =power_supply_get_by_name (tusb1210_chargers[i]); +for (i =0 ; i <ARRAY_SIZE (tusb1210_chargers) && !charger; i++) + charger =power_supply_get_by_name (tusb1210_chargers[i]); -if (!tusb->charger) +if (!charger)return false; -if (power_supply_get_property (tusb->charger,POWER_SUPPLY_PROP_ONLINE , &val)) -return false; + ret =power_supply_get_property (charger,POWER_SUPPLY_PROP_ONLINE , &val); +if (ret ==0 ) + online = val.intval; + +power_supply_put (charger); -return val.intval; +return online; }static void tusb1210_chg_det_work (struct work_struct *work)
@@ -467,9 +471,6 @@ static void tusb1210_remove_charger_detect(struct tusb1210 *tusb)cancel_delayed_work_sync (&tusb->chg_det_work); power_supply_unregister(tusb->psy); } - -if (tusb->charger) -power_supply_put (tusb->charger); }#else static void tusb1210_probe_charger_detect (struct tusb1210 *tusb) { }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 176/186 sched/eevdf: Always update V if se->on_rq when reweighting
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tianchen Ding <[email protected]>
[ Upstream commit 11b1b8bc2b98e21ddf47e08b56c21502c685b2c3 ]
reweight_eevdf() needs the latest V to do accurate calculation for new ve and vd. So update V unconditionally when se is runnable.
--- kernel/sched/fair.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/sched/fair.c +2 -3
@@ -3740,9 +3740,8 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se,if (se->on_rq) {/* commit outstanding execution time */ -if (curr) -update_curr (cfs_rq); -else +update_curr (cfs_rq); +if (!curr)__dequeue_entity (cfs_rq, se);update_load_sub (&cfs_rq->load, se->load.weight); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 177/186 sched/eevdf: Fix miscalculation in reweight_entity() when se is not curr
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tianchen Ding <[email protected]>
[ Upstream commit afae8002b4fd3560c8f5f1567f3c3202c30a70fa ]
reweight_eevdf() only keeps V unchanged inside itself. When se != cfs_rq->curr, it would be dequeued from rb tree first. So that V is changed and the result is wrong. Pass the original V to reweight_eevdf() to fix this issue.
--- kernel/sched/fair.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
kernel/sched/fair.c +6 -5
@@ -3626,11 +3626,10 @@ static inline void dequeue_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) { }#endif -static void reweight_eevdf (struct cfs_rq *cfs_rq,struct sched_entity *se, +static void reweight_eevdf (struct sched_entity *se,u64 avruntime,unsigned long weight) {unsigned long old_weight = se->load.weight; -u64 avruntime =avg_vruntime (cfs_rq);s64 vlag, vslice;/*
@@ -3737,24 +3736,26 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, unsigned long weight) {bool curr = cfs_rq->curr == se; +u64 avruntime;if (se->on_rq) {/* commit outstanding execution time */ update_curr (cfs_rq); + avruntime =avg_vruntime (cfs_rq);if (!curr)__dequeue_entity (cfs_rq, se);update_load_sub (&cfs_rq->load, se->load.weight); }dequeue_load_avg (cfs_rq, se); -if (!se->on_rq) { +if (se->on_rq) { +reweight_eevdf (se, avruntime, weight); + }else {/* * Because we keep se->vlag = V - v_i, while: lag_i = w_i*(V - v_i), * we need to scale se->vlag when w_i changes. */ se->vlag =div_s64 (se->vlag * se->load.weight, weight); - }else { -reweight_eevdf (cfs_rq, se, weight); }update_load_set (&se->load, weight);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 178/186 sched/eevdf: Prevent vlag from going out of bounds in reweight_eevdf()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xuewen Yan <[email protected]>
[ Upstream commit 1560d1f6eb6b398bddd80c16676776c0325fe5fe ]
It was possible to have pick_eevdf() return NULL, which then causes a NULL-deref. This turned out to be due to entity_eligible() returning falsely negative because of a s64 multiplcation overflow.
Specifically, reweight_eevdf() computes the vlag without considering the limit placed upon vlag as update_entity_lag() does, and then the scaling multiplication (remember that weight is 20bit fixed point) can overflow. This then leads to the new vruntime being weird which then causes the above entity_eligible() to go side-ways and claim nothing is eligible.
Thus limit the range of vlag accordingly.
All this was quite rare, but fatal when it does happen.
--- kernel/sched/fair.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
kernel/sched/fair.c +12 -6
@@ -707,15 +707,21 @@ u64 avg_vruntime(struct cfs_rq *cfs_rq)* * XXX could add max_slice to the augmented data to track this. */ -static void update_entity_lag (struct cfs_rq *cfs_rq,struct sched_entity *se) +static s64 entity_lag (u64 avruntime,struct sched_entity *se) { -s64 lag, limit; +s64 vlag, limit; + + vlag = avruntime - se->vruntime; + limit =calc_delta_fair (max_t (u64,2 *se->slice,TICK_NSEC ), se); + +return clamp (vlag, -limit, limit); +} +static void update_entity_lag (struct cfs_rq *cfs_rq,struct sched_entity *se) +{SCHED_WARN_ON (!se->on_rq); - lag =avg_vruntime (cfs_rq) - se->vruntime; - limit =calc_delta_fair (max_t (u64,2 *se->slice,TICK_NSEC ), se); - se->vlag =clamp (lag, -limit, limit); + se->vlag =entity_lag (avg_vruntime (cfs_rq), se); }/*
@@ -3710,7 +3716,7 @@ static void reweight_eevdf(struct sched_entity *se, u64 avruntime,* = V - vl' */ if (avruntime != se->vruntime) { - vlag = (s64)(avruntime - se->vruntime); + vlag =entity_lag (avruntime, se); vlag =div_s64 (vlag * old_weight, weight); se->vruntime = avruntime - vlag; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 179/186 i2c: smbus: fix NULL function pointer dereference
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wolfram Sang <[email protected]>
[ Upstream commit 91811a31b68d3765b3065f4bb6d7d6d84a7cfc9f ]
Baruch reported an OOPS when using the designware controller as target only. Target-only modes break the assumption of one transfer function always being available. Fix this by always checking the pointer in __i2c_transfer.
--- drivers/i2c/i2c-core-base.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/i2c/i2c-core-base.c +6 -6
@@ -2187,13 +2187,18 @@ static int i2c_check_for_quirks(struct i2c_adapter *adap, struct i2c_msg *msgs,* Returns negative errno, else the number of messages executed. * * Adapter lock must be held when calling this function. No debug logging -* takes place. adap->algo->master_xfer existence isn't checked. +* takes place. */ int __i2c_transfer (struct i2c_adapter *adap,struct i2c_msg *msgs,int num) {unsigned long orig_jiffies;int ret, try; +if (!adap->algo->master_xfer) { +dev_dbg (&adap->dev,"I2C level transfers not supported\n" ); +return -EOPNOTSUPP ; + } +if (WARN_ON (!msgs || num <1 ))return -EINVAL ;
@@ -2260,11 +2265,6 @@ int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) {int ret; -if (!adap->algo->master_xfer) { -dev_dbg (&adap->dev,"I2C level transfers not supported\n" ); -return -EOPNOTSUPP ; - } -/* REVISIT the fault reporting model here is weak: * * - When we get an error after receiving N bytes from a slave,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 180/186 phy: qcom: qmp-combo: fix VCO div offset on v5_5nm and v6
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 025a6f7448f7bb5f4fceb62498ee33d89ae266bb upstream.
Commit 5abed58a8bde ("phy: qcom: qmp-combo: Fix VCO div offset on v3") fixed a regression introduced in 6.5 by making sure that the correct offset is used for the DP_PHY_VCO_DIV register on v3 hardware.
Unfortunately, that fix instead broke DisplayPort on v5_5nm and v6 hardware as it failed to add the corresponding offsets also to those register tables.
--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 2 ++ drivers/phy/qualcomm/phy-qcom-qmp.h | 2 ++ 2 files changed, 4 insertions(+)
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +2 -0
@@ -188,6 +188,7 @@ static const unsigned int qmp_v5_5nm_usb [QPHY_COM_BIAS_EN_CLKBUFLR_EN] = QSERDES_V5_COM_BIAS_EN_CLKBUFLR_EN, [QPHY_DP_PHY_STATUS] = QSERDES_V5_DP_PHY_STATUS, + [QPHY_DP_PHY_VCO_DIV] = QSERDES_V5_DP_PHY_VCO_DIV, [QPHY_TX_TX_POL_INV] = QSERDES_V5_5NM_TX_TX_POL_INV, [QPHY_TX_TX_DRV_LVL] = QSERDES_V5_5NM_TX_TX_DRV_LVL,
@@ -212,6 +213,7 @@ static const unsigned int qmp_v6_usb3phy [QPHY_COM_BIAS_EN_CLKBUFLR_EN] = QSERDES_V6_COM_PLL_BIAS_EN_CLK_BUFLR_EN, [QPHY_DP_PHY_STATUS] = QSERDES_V6_DP_PHY_STATUS, + [QPHY_DP_PHY_VCO_DIV] = QSERDES_V6_DP_PHY_VCO_DIV, [QPHY_TX_TX_POL_INV] = QSERDES_V6_TX_TX_POL_INV, [QPHY_TX_TX_DRV_LVL] = QSERDES_V6_TX_TX_DRV_LVL,
drivers/phy/qualcomm/phy-qcom-qmp.h +2 -0
@@ -134,9 +134,11 @@#define QPHY_V4_PCS_MISC_TYPEC_STATUS 0x10#define QPHY_V4_PCS_MISC_PLACEHOLDER_STATUS 0x14 +#define QSERDES_V5_DP_PHY_VCO_DIV 0x070#define QSERDES_V5_DP_PHY_STATUS 0x0dc/* Only for QMP V6 PHY - DP PHY registers */ +#define QSERDES_V6_DP_PHY_VCO_DIV 0x070#define QSERDES_V6_DP_PHY_AUX_INTERRUPT_STATUS 0x0e0#define QSERDES_V6_DP_PHY_STATUS 0x0e4
Greg Kroah-Hartman
maintainerPATCH 181/186 ovl: fix memory leak in ovl_parse_param()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <[email protected]>
commit 37f32f52643869131ec01bb69bdf9f404f6109fb upstream.
On failure to parse parameters in ovl_parse_param_lowerdir(), it is necessary to update ctx->nr with the correct nr before using ovl_reset_lowerdirs() to release l->name.
--- fs/overlayfs/params.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
fs/overlayfs/params.c +5 -6
@@ -438,7 +438,7 @@ static int ovl_parse_param_lowerdir(consstruct ovl_fs_context *ctx = fc->fs_private;struct ovl_fs_context_layer *l;char *dup =NULL , *iter; -ssize_t nr_lower =0 , nr =0 , nr_data =0 ; +ssize_t nr_lower, nr;bool data_layer = false;/*
@@ -490,6 +490,7 @@ static int ovl_parse_param_lowerdir(cons iter = dup; l = ctx->lower;for (nr =0 ; nr < nr_lower; nr++, l++) { + ctx->nr++;memset (l,0 ,sizeof (*l)); err =ovl_mount_dir (iter, &l->path);
@@ -506,10 +507,10 @@ static int ovl_parse_param_lowerdir(cons goto out_put;if (data_layer) - nr_data++; + ctx->nr_data++;/* Calling strchr() again would overrun. */ -if ((nr +1 ) == nr_lower) +if (ctx->nr == nr_lower)break ; err = -EINVAL ;
@@ -519,7 +520,7 @@ static int ovl_parse_param_lowerdir(cons* This is a regular layer so we require that * there are no data layers. */ -if ((ctx->nr_data + nr_data) >0 ) { +if (ctx->nr_data >0 ) {pr_err ("regular lower layers cannot follow data lower layers" ); goto out_put; }
@@ -532,8 +533,6 @@ static int ovl_parse_param_lowerdir(cons data_layer = true; iter++; } - ctx->nr = nr_lower; - ctx->nr_data += nr_data;kfree (dup);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 182/186 Revert "riscv: kdump: fix crashkernel reserving problem on RISC-V"
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mingzheng Xing <[email protected]>
This reverts commit 1d6cd2146c2b58bc91266db1d5d6a5f9632e14c0 which was mistakenly added into v6.6.y and the commit corresponding to the 'Fixes:' tag is invalid. For more information, see link [1].
This will result in the loss of Crashkernel data in /proc/iomem, and kdump failed:
``` Memory for crashkernel is not reserved Please reserve memory by passing"crashkernel=Y@X" parameter to kernel Then try to loading kdump kernel ```
After revert, kdump works fine. Tested on QEMU riscv.
--- arch/riscv/kernel/setup.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
arch/riscv/kernel/setup.c +13 -0
@@ -173,6 +173,19 @@ static void __init init_resources(void)if (ret <0 ) goto error; +#ifdef CONFIG_KEXEC_CORE +if (crashk_res.start != crashk_res.end) { + ret =add_resource (&iomem_resource, &crashk_res); +if (ret <0 ) + goto error; + } +if (crashk_low_res.start != crashk_low_res.end) { + ret =add_resource (&iomem_resource, &crashk_low_res); +if (ret <0 ) + goto error; + } +#endif +#ifdef CONFIG_CRASH_DUMP if (elfcorehdr_size >0 ) { elfcorehdr_res.start = elfcorehdr_addr;
Greg Kroah-Hartman
maintainerPATCH 183/186 macsec: Enable devices to advertise whether they update sk_buff md_dst during offloads
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rahul Rameshbabu <[email protected]>
commit 475747a19316b08e856c666a20503e73d7ed67ed upstream.
Omit rx_use_md_dst comment in upstream commit since macsec_ops is not documented.
Cannot know whether a Rx skb missing md_dst is intended for MACsec or not without knowing whether the device is able to update this field during an offload. Assume that an offload to a MACsec device cannot support updating md_dst by default. Capable devices can advertise that they do indicate that an skb is related to a MACsec offloaded packet using the md_dst.
--- include/net/macsec.h | 1 + 1 file changed, 1 insertion(+)
include/net/macsec.h +1 -0
@@ -303,6 +303,7 @@ struct macsec_ops {int (*mdo_get_tx_sa_stats)(struct macsec_context *ctx);int (*mdo_get_rx_sc_stats)(struct macsec_context *ctx);int (*mdo_get_rx_sa_stats)(struct macsec_context *ctx); +bool rx_uses_md_dst; };void macsec_pn_wrapped (struct macsec_secy *secy,struct macsec_tx_sa *tx_sa);
Greg Kroah-Hartman
maintainerPATCH 184/186 macsec: Detect if Rx skb is macsec-related for offloading devices that update md_dst
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rahul Rameshbabu <[email protected]>
commit 642c984dd0e37dbaec9f87bd1211e5fac1f142bf upstream.
Can now correctly identify where the packets should be delivered by using md_dst or its absence on devices that provide it.
This detection is not possible without device drivers that update md_dst. A fallback pattern should be used for supporting such device drivers. This fallback mode causes multicast messages to be cloned to both the non-macsec and macsec ports, independent of whether the multicast message received was encrypted over MACsec or not. Other non-macsec traffic may also fail to be handled correctly for devices in promiscuous mode.
--- drivers/net/macsec.c | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-)
drivers/net/macsec.c +36 -10
@@ -996,10 +996,12 @@ static enum rx_handler_result handle_notstruct metadata_dst *md_dst;struct macsec_rxh_data *rxd;struct macsec_dev *macsec; +bool is_macsec_md_dst;rcu_read_lock (); rxd =macsec_data_rcu (skb->dev); md_dst =skb_metadata_dst (skb); + is_macsec_md_dst = md_dst && md_dst->type ==METADATA_MACSEC ;list_for_each_entry_rcu (macsec, &rxd->secys, secys) {struct sk_buff *nskb;
@@ -1010,14 +1012,42 @@ static enum rx_handler_result handle_not* the SecTAG, so we have to deduce which port to deliver to. */ if (macsec_is_offloaded (macsec) &&netif_running (ndev)) { -struct macsec_rx_sc *rx_sc =NULL ; +const struct macsec_ops *ops; -if (md_dst && md_dst->type ==METADATA_MACSEC ) - rx_sc =find_rx_sc (&macsec->secy, md_dst->u.macsec_info.sci); + ops =macsec_get_ops (macsec,NULL ); -if (md_dst && md_dst->type ==METADATA_MACSEC && !rx_sc) +if (ops->rx_uses_md_dst && !is_macsec_md_dst)continue ; +if (is_macsec_md_dst) { +struct macsec_rx_sc *rx_sc; + +/* All drivers that implement MACsec offload +* support using skb metadata destinations must +* indicate that they do so. +*/ +DEBUG_NET_WARN_ON_ONCE (!ops->rx_uses_md_dst); + rx_sc =find_rx_sc (&macsec->secy, + md_dst->u.macsec_info.sci); +if (!rx_sc) +continue ; +/* device indicated macsec offload occurred */ + skb->dev = ndev; + skb->pkt_type =PACKET_HOST ; +eth_skb_pkt_type (skb, ndev); + ret =RX_HANDLER_ANOTHER ; + goto out; + } + +/* This datapath is insecure because it is unable to +* enforce isolation of broadcast/multicast traffic and +* unicast traffic with promiscuous mode on the macsec +* netdev. Since the core stack has no mechanism to +* check that the hardware did indeed receive MACsec +* traffic, it is possible that the response handling +* done by the MACsec port was to a plaintext packet. +* This violates the MACsec protocol standard. +*/ if (ether_addr_equal_64bits (hdr->h_dest, ndev->dev_addr)) {/* exact match, divert skb to this port */
@@ -1033,14 +1063,10 @@ static enum rx_handler_result handle_notbreak ; nskb->dev = ndev; -if (ether_addr_equal_64bits (hdr->h_dest, - ndev->broadcast)) - nskb->pkt_type =PACKET_BROADCAST ; -else - nskb->pkt_type =PACKET_MULTICAST ; +eth_skb_pkt_type (nskb, ndev);__netif_rx (nskb); - }else if (rx_sc || ndev->flags &IFF_PROMISC ) { + }else if (ndev->flags &IFF_PROMISC ) { skb->dev = ndev; skb->pkt_type =PACKET_HOST ; ret =RX_HANDLER_ANOTHER ;
Greg Kroah-Hartman
maintainerPATCH 185/186 net/mlx5e: Advertise mlx5 ethernet driver updates sk_buff md_dst for MACsec
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rahul Rameshbabu <[email protected]>
commit 39d26a8f2efcb8b5665fe7d54a7dba306a8f1dff upstream.
mlx5 Rx flow steering and CQE handling enable the driver to be able to update an skb's md_dst attribute as MACsec when MACsec traffic arrives when a device is configured for offloading. Advertise this to the core stack to take advantage of this capability.
--- drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c +1 -0
@@ -1640,6 +1640,7 @@ static const struct macsec_ops macsec_of .mdo_add_secy = mlx5e_macsec_add_secy, .mdo_upd_secy = mlx5e_macsec_upd_secy, .mdo_del_secy = mlx5e_macsec_del_secy, + .rx_uses_md_dst = true, };bool mlx5e_macsec_handle_tx_skb (struct mlx5e_macsec *macsec,struct sk_buff *skb)
Greg Kroah-Hartman
maintainerPATCH 186/186 bounds: Use the right number of bits for power-of-two CONFIG_NR_CPUS
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wilcox (Oracle) <[email protected]>
commit 5af385f5f4cddf908f663974847a4083b2ff2c79 upstream.
bits_per() rounds up to the next power of two when passed a power of two. This causes crashes on some machines and configurations.
--- kernel/bounds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bounds.c +1 -1
@@ -19,7 +19,7 @@ int main(void)DEFINE (NR_PAGEFLAGS , __NR_PAGEFLAGS);DEFINE (MAX_NR_ZONES , __MAX_NR_ZONES);#ifdef CONFIG_SMP -DEFINE (NR_CPUS_BITS ,bits_per (CONFIG_NR_CPUS )); +DEFINE (NR_CPUS_BITS ,order_base_2 (CONFIG_NR_CPUS ));#endif DEFINE (SPINLOCK_SIZE ,sizeof (spinlock_t));#ifdef CONFIG_LRU_GEN
Hi Greg,
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 02 May 2024 10:30:27 +0000. Anything received after that time might be too late.
No problems seen on x86_64 and aarch64 with our testing.
Thanks,
Harshit
Quoted 9 lines
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.30-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Hello,
Quoted 5 lines · On Tue, 30 Apr 2024 12:37:32 +0200 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 8 lines
Responses should be made by Thu, 02 May 2024 10:30:27 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.30-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.
This rc kernel passes DAMON functionality test[1] on my test machine. Attaching the test results summary below. Please note that I retrieved the kernel from linux-stable-rc tree[2].
[1] https://github.com/awslabs/damon-tests/tree/next/corr
[2] f679e6546f84 ("Linux 6.6.30-rc1")
Thanks,
SJ
[...]
---
ok 1 selftests: damon: debugfs_attrs.sh
ok 2 selftests: damon: debugfs_schemes.sh
ok 3 selftests: damon: debugfs_target_ids.sh
ok 4 selftests: damon: debugfs_empty_targets.sh
ok 5 selftests: damon: debugfs_huge_count_read_write.sh
ok 6 selftests: damon: debugfs_duplicate_context_creation.sh
ok 7 selftests: damon: debugfs_rm_non_contexts.sh
ok 8 selftests: damon: sysfs.sh
ok 9 selftests: damon: sysfs_update_removed_scheme_dir.sh
ok 10 selftests: damon: reclaim.sh
ok 11 selftests: damon: lru_sort.sh
ok 1 selftests: damon-tests: kunit.sh
ok 2 selftests: damon-tests: huge_count_read_write.sh
ok 3 selftests: damon-tests: buffer_overflow.sh
ok 4 selftests: damon-tests: rm_contexts.sh
ok 5 selftests: damon-tests: record_null_deref.sh
ok 6 selftests: damon-tests: dbgfs_target_ids_read_before_terminate_race.sh ok 7 selftests: damon-tests: dbgfs_target_ids_pid_leak.sh
ok 8 selftests: damon-tests: damo_tests.sh
ok 9 selftests: damon-tests: masim-record.sh
ok 10 selftests: damon-tests: build_i386.sh
ok 11 selftests: damon-tests: build_arm64.sh
ok 12 selftests: damon-tests: build_m68k.sh
ok 13 selftests: damon-tests: build_i386_idle_flag.sh
ok 14 selftests: damon-tests: build_i386_highpte.sh
ok 15 selftests: damon-tests: build_nomemcg.sh
[33m
[92mPASS [39m
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 02 May 2024 10:30:27 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.30-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 02 May 2024 10:30:27 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.30-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 02 May 2024 10:30:27 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.30-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 6.6.30-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-6.6.y
* git commit: f679e6546f84b5a2cc73e8f3388bcd8f35faaed2
* git describe: v6.6.29-187-gf679e6546f84
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.6.y/build/v6.6.29-187-gf679e6546f84
## Test Regressions (compared to v6.6.27)
## Metric Regressions (compared to v6.6.27)
## Test Fixes (compared to v6.6.27)
## Metric Fixes (compared to v6.6.27)
## Test result summary
total: 177787, pass: 154198, fail: 2697, skip: 20681, xfail: 211
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 128 total, 128 passed, 0 failed
* arm64: 38 total, 38 passed, 0 failed
* i386: 28 total, 28 passed, 0 failed
* mips: 24 total, 24 passed, 0 failed
* parisc: 3 total, 3 passed, 0 failed
* powerpc: 34 total, 34 passed, 0 failed
* riscv: 17 total, 17 passed, 0 failed
* s390: 12 total, 12 passed, 0 failed
* sh: 10 total, 10 passed, 0 failed
* sparc: 6 total, 6 passed, 0 failed
* x86_64: 32 total, 32 passed, 0 failed
## Test suites summary
* boot
* kselftest-android
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers-dma-buf
* kselftest-efivarfs
* kselftest-exec
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-filesystems-epoll
* kselftest-firmware
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mm
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-net-forwarding
* kselftest-net-mptcp
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-user_events
* kselftest-vDSO
* kselftest-watchdog
* kselftest-x86
* kselftest-zram
* kunit
* kvm-unit-tests
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-test
* ltp-cap_bounds
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-filecaps
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-hugetlb
* ltp-io
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-securebits
* ltp-smoke
* ltp-smoketest
* ltp-syscalls
* ltp-tracing
* perf
* rcutorture
--
Linaro LKFT
https://lkft.linaro.org
Quoted 8 lines · On Tue, 30 Apr 2024 12:37:32 +0200 Greg Kroah-Hartman wrote:
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 02 May 2024 10:30:27 +0000. Anything received after that time might be too late.
Boot-tested under QEMU for Rust:
Thanks!
Cheers,
Miguel
Hi Greg
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 02 May 2024 10:30:27 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.30-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
6.6.30-rc1 tested.
Build successfully completed.
Boot successfully completed.
No dmesg regressions.
Video output normal.
Sound output normal.
Lenovo ThinkPad X1 Carbon Gen10(Intel i7-1260P(x86_64) arch linux)
[ 0.000000] Linux version 6.6.30-rc1rv
(takeshi@ThinkPadX1Gen10J0764) (gcc (GCC) 13.2.1 20240417, GNU ld (GNU Binutils) 2.42.0) #1 SMP PREEMPT_DYNAMIC Wed May 1 20:29:45 JST 2024
Thanks
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 02 May 2024 10:30:27 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.30-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v6.6:
10 builds: 10 pass, 0 fail
26 boots: 26 pass, 0 fail
116 tests: 116 pass, 0 failLinux version: 6.6.30-rc1-gf679e6546f84
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Jon
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
CIP testing did not find any problems in these:
Linux 5.15.158-rc1 (d6b90d569cec)
Linux 5.4.275-rc2 (6c530794f59e)
Linux 6.6.30-rc1 (f679e6546f84)
Linux 6.8.9-rc1 (f9518a4bb35a)
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 02 May 2024 10:30:27 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.30-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
[2024-04-30 12:37] Greg Kroah-Hartman:
Quoted 7 lines
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 02 May 2024 10:30:27 +0000. Anything received after that time might be too late.
Hi, 6.6.30-rc1 is running fine on an x86_64 Haswell VM.
Note that I have *not* tested building the kernel documentation, and I suspect that building the documentation with docutils >= 0.21 would likely fail without the patch from
https://lore.kernel.org/all/[email protected]/
Regards
Pascal
Greg Kroah-Hartman
maintainerQuoted 9 lines · Pascal Ernster
[2024-04-30 12:37] Greg Kroah-Hartman:
Quoted 7 lines
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 02 May 2024 10:30:27 +0000. Anything received after that time might be too late.
Quoted 7 lines
Hi, 6.6.30-rc1 is running fine on an
x86_64Haswell VM.Note that I have *not* tested building the kernel documentation, and I suspect that building the documentation with docutils >= 0.21 would likely fail without the patch from
What is the git id of this in Linus's tree?
thanks,
greg k-h
[2024-05-02 08:50] Greg Kroah-Hartman:
Quoted 12 lines · Pascal Ernster
Quoted 11 lines
[2024-04-30 12:37] Greg Kroah-Hartman:
Quoted 7 lines
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 02 May 2024 10:30:27 +0000. Anything received after that time might be too late.
Hi, 6.6.30-rc1 is running fine on an
x86_64Haswell VM.
Quoted 7 lines
Quoted 5 lines
Note that I have *not* tested building the kernel documentation, and I suspect that building the documentation with docutils >= 0.21 would likely fail without the patch from
What is the git id of this in Linus's tree?
Hi,
AFAICT this has not been merged into either Linus' tree nor into linux-next nor into docs-next.
I've added Jonathan Corbet because he seems to be the most likely maintainer for Documentation/sphinx/kernel_include.py if I understand/interpret the MAINTAINERS file correctly.
Regards
Pascal
Quoted 25 lines · Pascal Ernster
[2024-05-02 08:50] Greg Kroah-Hartman:
Quoted 12 lines · Pascal Ernster
Quoted 11 lines
[2024-04-30 12:37] Greg Kroah-Hartman:
Quoted 7 lines
This is the start of the stable review cycle for the 6.6.30 release. There are 186 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 02 May 2024 10:30:27 +0000. Anything received after that time might be too late.
Hi, 6.6.30-rc1 is running fine on an
x86_64Haswell VM.Quoted 7 lines
Quoted 5 lines
Note that I have *not* tested building the kernel documentation, and I suspect that building the documentation with docutils >= 0.21 would likely fail without the patch from
What is the git id of this in Linus's tree?
Hi,
Quoted 6 lines
AFAICT this has not been merged into either Linus' tree nor into linux-next nor into docs-next.
I've added Jonathan Corbet because he seems to be the most likely maintainer for
Documentation/sphinx/kernel_include.pyif I understand/interpret theMAINTAINERSfile correctly.
The patch was sent yesterday, so I've not had time to apply it yet. That may happen today.
Thanks,
jon