[Deepin-Kernel-SIG] [linux 6.18-y] [AOSC] sync patches from aosc v6.18.16#1553
[Deepin-Kernel-SIG] [linux 6.18-y] [AOSC] sync patches from aosc v6.18.16#1553opsiff wants to merge 82 commits intodeepin-community:linux-6.18.yfrom
Conversation
Now we only enable the remote wakeup function for the USB wakeup source itself at usb_port_suspend(). But on pre-XHCI controllers this is not enough to enable the S3 wakeup function for USB keyboards, so we also enable the root_hub's remote wakeup (and disable it on error). Frankly this is unnecessary for XHCI, but enable it unconditionally make code simple and seems harmless. Cc: stable@vger.kernel.org Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Link: https://lore.kernel.org/all/20250131100630.342995-1-chenhuacai@loongson.cn/ Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit a1c0d528a734fceb7283607e33cfe26c8a00e5f2) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
When the best selected CPU is offline, work_on_cpu() will stuck forever. This can be happen if a node is online while all its CPUs are offline (we can use "maxcpus=1" without "nr_cpus=1" to reproduce it), Therefore, in this case, we should call local_pci_probe() instead of work_on_cpu(). Cc: stable@vger.kernel.org Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Hongchen Zhang <zhanghongchen@loongson.cn> Link: https://lore.kernel.org/all/20250511083413.3326421-2-chenhuacai@loongson.cn/ Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 65fc9d4103e7626442c8d4707b552ec6b21bbd8f) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
This is similar to commit 62b6dee ("PCI/portdrv: Prevent LS7A Bus Master clearing on shutdown"), which prevents LS7A Bus Master clearing on kexec. The key point of this is to work around the LS7A defect that clearing PCI_COMMAND_MASTER prevents MMIO requests from going downstream, and we may need to do that even after .shutdown(), e.g., to print console messages. And in this case we rely on .shutdown() for the downstream devices to disable interrupts and DMA. Only skip Bus Master clearing on bridges because endpoint devices still need it. Cc: stable@vger.kernel.org Signed-off-by: Ming Wang <wangming01@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Link: https://lore.kernel.org/all/20250511083413.3326421-3-chenhuacai@loongson.cn/ Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 9f49f0fadc057eacb2902931090e8e373b641307) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
This reverts commit 022906a. Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit f7113b37a54fe540832b0e038fd663e98cc11ecf) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…sizes The bo/ttm interfaces with kernel memory mapping from dedicated GPU memory. It is not correct to assume that SZ_4K would suffice for page alignment as there are a few hardware platforms that commonly uses non-4K pages - for instance, currently, Loongson 3A5000/6000 devices (of the LoongArch architecture) commonly uses 16K kernel pages. Per my testing Intel Xe/Arc families of GPUs works on at least Loongson 3A6000 platforms so long as "Above 4G Decoding" and "Resizable BAR" were enabled in the EFI firmware settings. I tested this patch series on my Loongson XA61200 (3A6000) motherboard with an Intel Arc A750 GPU. Without this fix, the kernel will hang at a kernel BUG(): [ 7.425445] ------------[ cut here ]------------ [ 7.430032] kernel BUG at drivers/gpu/drm/drm_gem.c:181! [ 7.435330] Oops - BUG[#1]: [ 7.438099] CPU: 0 UID: 0 PID: 102 Comm: kworker/0:4 Tainted: G E 6.13.3-aosc-main-00336-g60829239b300-dirty #3 [ 7.449511] Tainted: [E]=UNSIGNED_MODULE [ 7.453402] Hardware name: Loongson Loongson-3A6000-HV-7A2000-1w-V0.1-EVB/Loongson-3A6000-HV-7A2000-1w-EVB-V1.21, BIOS Loongson-UDK2018-V4.0.05756-prestab [ 7.467144] Workqueue: events work_for_cpu_fn [ 7.471472] pc 9000000001045fa4 ra ffff8000025331dc tp 90000001010c8000 sp 90000001010cb960 [ 7.479770] a0 900000012a3e8000 a1 900000010028c000 a2 000000000005d000 a3 0000000000000000 [ 7.488069] a4 0000000000000000 a5 0000000000000000 a6 0000000000000000 a7 0000000000000001 [ 7.496367] t0 0000000000001000 t1 9000000001045000 t2 0000000000000000 t3 0000000000000000 [ 7.504665] t4 0000000000000000 t5 0000000000000000 t6 0000000000000000 t7 0000000000000000 [ 7.504667] t8 0000000000000000 u0 90000000029ea7d8 s9 900000012a3e9360 s0 900000010028c000 [ 7.504668] s1 ffff800002744000 s2 0000000000000000 s3 0000000000000000 s4 0000000000000001 [ 7.504669] s5 900000012a3e8000 s6 0000000000000001 s7 0000000000022022 s8 0000000000000000 [ 7.537855] ra: ffff8000025331dc ___xe_bo_create_locked+0x158/0x3b0 [xe] [ 7.544893] ERA: 9000000001045fa4 drm_gem_private_object_init+0xcc/0xd0 [ 7.551639] CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE) [ 7.557785] PRMD: 00000004 (PPLV0 +PIE -PWE) [ 7.562111] EUEN: 00000000 (-FPE -SXE -ASXE -BTE) [ 7.566870] ECFG: 00071c1d (LIE=0,2-4,10-12 VS=7) [ 7.571628] ESTAT: 000c0000 [BRK] (IS= ECode=12 EsubCode=0) [ 7.577163] PRID: 0014d000 (Loongson-64bit, Loongson-3A6000-HV) [ 7.583128] Modules linked in: xe(E+) drm_gpuvm(E) drm_exec(E) drm_buddy(E) gpu_sched(E) drm_suballoc_helper(E) drm_display_helper(E) loongson(E) r8169(E) cec(E) rc_core(E) realtek(E) i2c_algo_bit(E) tpm_tis_spi(E) led_class(E) hid_generic(E) drm_ttm_helper(E) ttm(E) drm_client_lib(E) drm_kms_helper(E) sunrpc(E) la_ow_syscall(E) i2c_dev(E) [ 7.613049] Process kworker/0:4 (pid: 102, threadinfo=00000000bc26ebd1, task=0000000055480707) [ 7.621606] Stack : 0000000000000000 3030303a6963702b 000000000005d000 0000000000000000 [ 7.629563] 0000000000000001 0000000000000000 0000000000000000 8e1bfae42b2f7877 [ 7.637519] 000000000005d000 900000012a3e8000 900000012a3e9360 0000000000000000 [ 7.645475] ffffffffffffffff 0000000000000000 0000000000022022 0000000000000000 [ 7.653431] 0000000000000001 ffff800002533660 0000000000022022 9000000000234470 [ 7.661386] 90000001010cba28 0000000000001000 0000000000000000 000000000005c300 [ 7.669342] 900000012a3e8000 0000000000000000 0000000000000001 900000012a3e8000 [ 7.677298] ffffffffffffffff 0000000000022022 900000012a3e9498 ffff800002533a14 [ 7.685254] 0000000000022022 0000000000000000 900000000209c000 90000000010589e0 [ 7.693209] 90000001010cbab8 ffff8000027c78c0 fffffffffffff000 900000012a3e8000 [ 7.701165] ... [ 7.703588] Call Trace: [ 7.703590] [<9000000001045fa4>] drm_gem_private_object_init+0xcc/0xd0 [ 7.712496] [<ffff8000025331d8>] ___xe_bo_create_locked+0x154/0x3b0 [xe] [ 7.719268] [<ffff80000253365c>] __xe_bo_create_locked+0x228/0x304 [xe] [ 7.725951] [<ffff800002533a10>] xe_bo_create_pin_map_at_aligned+0x70/0x1b0 [xe] [ 7.733410] [<ffff800002533c7c>] xe_managed_bo_create_pin_map+0x34/0xcc [xe] [ 7.740522] [<ffff800002533d58>] xe_managed_bo_create_from_data+0x44/0xb0 [xe] [ 7.747807] [<ffff80000258d19c>] xe_uc_fw_init+0x3ec/0x904 [xe] [ 7.753814] [<ffff80000254a478>] xe_guc_init+0x30/0x3dc [xe] [ 7.759553] [<ffff80000258bc04>] xe_uc_init+0x20/0xf0 [xe] [ 7.765121] [<ffff800002542abc>] xe_gt_init_hwconfig+0x5c/0xd0 [xe] [ 7.771461] [<ffff800002537204>] xe_device_probe+0x240/0x588 [xe] [ 7.777627] [<ffff800002575448>] xe_pci_probe+0x6c0/0xa6c [xe] [ 7.783540] [<9000000000e9828c>] local_pci_probe+0x4c/0xb4 [ 7.788989] [<90000000002aa578>] work_for_cpu_fn+0x20/0x40 [ 7.794436] [<90000000002aeb50>] process_one_work+0x1a4/0x458 [ 7.800143] [<90000000002af5a0>] worker_thread+0x304/0x3fc [ 7.805591] [<90000000002bacac>] kthread+0x114/0x138 [ 7.810520] [<9000000000241f64>] ret_from_kernel_thread+0x8/0xa4 [ 7.816489] [ 7.817961] Code: 4c000020 29c3e2f9 53ff93ff <002a0001> 0015002c 03400000 02ff8063 29c04077 001500f7 [ 7.827651] [ 7.829140] ---[ end trace 0000000000000000 ]--- Revise all instances of `SZ_4K' with `PAGE_SIZE' and revise the call to `drm_gem_private_object_init()' in `*___xe_bo_create_locked()' (last call before BUG()) to use `size_t aligned_size' calculated from `PAGE_SIZE' to fix the above error. Cc: <stable@vger.kernel.org> Fixes: 4e03b58 ("drm/xe/uapi: Reject bo creation of unaligned size") Fixes: dd08ebf ("drm/xe: Introduce a new DRM driver for Intel GPUs") Tested-by: Mingcong Bai <jeffbai@aosc.io> Tested-by: Haien Liang <27873200@qq.com> Tested-by: Shirong Liu <lsr1024@qq.com> Tested-by: Haofeng Wu <s2600cw2@126.com> Link: FanFansfan/loongson-linux@22c55ab Co-developed-by: Shang Yatsen <429839446@qq.com> Signed-off-by: Shang Yatsen <429839446@qq.com> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> [Mingcong Bai: Resolved a minor merge conflict post-6.16 in drivers/gpu/drm/xe/xe_bo.c] Link: https://lore.kernel.org/all/20250613-upstream-xe-non-4k-v2-v2-1-934f82249f8a@aosc.io/ Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 1d94e0f218c3986c57c191949dcaa149a880b97f) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Per the "Firmware" chapter in "drm/xe Intel GFX Driver", as well as
"Volume 8: Command Stream Programming" in "Intel® Arc™ A-Series Graphics
and Intel Data Center GPU Flex Series Open-Source Programmer's Reference
Manual For the discrete GPUs code named "Alchemist" and "Arctic Sound-M""
and "Intel® Iris® Xe MAX Graphics Open Source Programmer's Reference
Manual For the 2020 Discrete GPU formerly named "DG1"":
"The RINGBUF register sets (defined in Memory Interface Registers) are
used to specify the ring buffer memory areas. The ring buffer must start
on a 4KB boundary and be allocated in linear memory. The length of any
one ring buffer is limited to 2MB."
The Graphics micro (μ) Controller (GuC) really expects command buffers
aligned to 4K boundaries.
Current code uses `PAGE_SIZE' as an assumed alignment reference but 4K
kernel page sizes is by no means a guarantee. On 16K-paged kernels, this
causes driver failures after loading the GuC firmware:
[ 7.398317] xe 0000:09:00.0: [drm] Found dg2/g10 (device ID 56a1) display version 13.00 stepping C0
[ 7.410429] xe 0000:09:00.0: [drm] Using GuC firmware from i915/dg2_guc_70.bin version 70.36.0
[ 10.719989] xe 0000:09:00.0: [drm] *ERROR* GT0: load failed: status = 0x800001EC, time = 3297ms, freq = 2400MHz (req 2400MHz), done = 0
[ 10.732106] xe 0000:09:00.0: [drm] *ERROR* GT0: load failed: status: Reset = 0, BootROM = 0x76, UKernel = 0x01, MIA = 0x00, Auth = 0x02
[ 10.744214] xe 0000:09:00.0: [drm] *ERROR* CRITICAL: Xe has declared device 0000:09:00.0 as wedged.
Please file a _new_ bug report at https://gitlab.freedesktop.org/drm/xe/kernel/issues/new
[ 10.828908] xe 0000:09:00.0: [drm] *ERROR* GT0: GuC mmio request 0x4100: no reply 0x4100
Correct this by revising all instances of `PAGE_SIZE' to `SZ_4K' and
revise `PAGE_ALIGN()' calls to `ALIGN()' with `SZ_4K' as the second
argument (overriding `PAGE_SIZE').
Cc: stable@vger.kernel.org
Fixes: 84d15f4 ("drm/xe/guc: Add capture size check in GuC log buffer")
Fixes: 9c8c7a7 ("drm/xe/guc: Prepare GuC register list and update ADS size for error capture")
Fixes: dd08ebf ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Tested-by: Mingcong Bai <jeffbai@aosc.io>
Tested-by: Haien Liang <27873200@qq.com>
Tested-by: Shirong Liu <lsr1024@qq.com>
Tested-by: Haofeng Wu <s2600cw2@126.com>
Link: FanFansfan/loongson-linux@22c55ab
Co-developed-by: Shang Yatsen <429839446@qq.com>
Signed-off-by: Shang Yatsen <429839446@qq.com>
Co-developed-by: Kexy Biscuit <kexybiscuit@aosc.io>
Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io>
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
[Mingcong Bai: Resolved a minor merge conflict post-6.16 in
drivers/gpu/drm/xe/xe_guc_ads.c]
[Mingcong Bai: Resolved a minor merge conflict since 6.18 in
drivers/gpu/drm/xe/xe_guc.c.]
Link: https://lore.kernel.org/all/20250613-upstream-xe-non-4k-v2-v2-1-934f82249f8a@aosc.io/
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
(cherry picked from commit 6fb386d83f4424914e35ff5c7a2f86a52660ec75)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Similar to the preceding patch for GuC (and with the same references), Intel DG1 and DG2 GPUs expects command buffers to align to 4K boundaries. Current code uses `PAGE_SIZE' as an assumed alignment reference but 4K kernel page sizes is by no means a guarantee. On 16K-paged kernels, this causes driver failures during boot up: [ 14.018975] ------------[ cut here ]------------ [ 14.023562] xe 0000:09:00.0: [drm] GT0: Kernel-submitted job timed out [ 14.030084] WARNING: CPU: 3 PID: 564 at drivers/gpu/drm/xe/xe_guc_submit.c:1181 guc_exec_queue_timedout_job+0x1c0/0xacc [xe] [ 14.041300] Modules linked in: nf_conntrack_netbios_ns(E) nf_conntrack_broadcast(E) nft_fib_inet(E) nft_fib_ipv4(E) nft_fib_ipv6(E) nft_fib(E) nft_reject_inet(E) nf_reject_ipv4(E) nf_reject_ipv6(E) nft_reject(E) nft_ct(E) nft_chain_nat(E) ip6table_nat(E) ip6table_mangle(E) ip6table_raw(E) ip6table_security(E) iptable_nat(E) nf_nat(E) nf_conntrack(E) nf_defrag_ipv6(E) nf_defrag_ipv4(E) rfkill(E) iptable_mangle(E) iptable_raw(E) iptable_security(E) ip_set(E) nf_tables(E) ip6table_filter(E) ip6_tables(E) iptable_filter(E) snd_hda_codec_conexant(E) snd_hda_codec_generic(E) snd_hda_codec_hdmi(E) nls_iso8859_1(E) snd_hda_intel(E) snd_intel_dspcfg(E) qrtr(E) nls_cp437(E) snd_hda_codec(E) spi_loongson_pci(E) rtc_efi(E) snd_hda_core(E) loongson3_cpufreq(E) spi_loongson_core(E) snd_hwdep(E) snd_pcm(E) snd_timer(E) snd(E) soundcore(E) gpio_loongson_64bit(E) input_leds(E) rtc_loongson(E) i2c_ls2x(E) mousedev(E) sch_fq_codel(E) fuse(E) nfnetlink(E) dmi_sysfs(E) ip_tables(E) x_tables(E) xe(E) d rm_gpuvm(E) drm_buddy(E) gpu_sched(E) [ 14.041369] drm_exec(E) drm_suballoc_helper(E) drm_display_helper(E) cec(E) rc_core(E) hid_generic(E) tpm_tis_spi(E) r8169(E) realtek(E) led_class(E) loongson(E) i2c_algo_bit(E) drm_ttm_helper(E) ttm(E) drm_client_lib(E) drm_kms_helper(E) sunrpc(E) i2c_dev(E) [ 14.153910] CPU: 3 UID: 0 PID: 564 Comm: kworker/u32:2 Tainted: G E 6.14.0-rc4-aosc-main-gbad70b1cd8b0-dirty deepin-community#7 [ 14.165325] Tainted: [E]=UNSIGNED_MODULE [ 14.169220] Hardware name: Loongson Loongson-3A6000-HV-7A2000-1w-V0.1-EVB/Loongson-3A6000-HV-7A2000-1w-EVB-V1.21, BIOS Loongson-UDK2018-V4.0.05756-prestab [ 14.182970] Workqueue: gt-ordered-wq drm_sched_job_timedout [gpu_sched] [ 14.189549] pc ffff8000024f3760 ra ffff8000024f3760 tp 900000012f150000 sp 900000012f153ca0 [ 14.197853] a0 0000000000000000 a1 0000000000000000 a2 0000000000000000 a3 0000000000000000 [ 14.206156] a4 0000000000000000 a5 0000000000000000 a6 0000000000000000 a7 0000000000000000 [ 14.214458] t0 0000000000000000 t1 0000000000000000 t2 0000000000000000 t3 0000000000000000 [ 14.222761] t4 0000000000000000 t5 0000000000000000 t6 0000000000000000 t7 0000000000000000 [ 14.231064] t8 0000000000000000 u0 900000000195c0c8 s9 900000012e4dcf48 s0 90000001285f3640 [ 14.239368] s1 90000001004f8000 s2 ffff8000026ec000 s3 0000000000000000 s4 900000012e4dc028 [ 14.247672] s5 90000001009f5e00 s6 000000000000137e s7 0000000000000001 s8 900000012f153ce8 [ 14.255975] ra: ffff8000024f3760 guc_exec_queue_timedout_job+0x1c0/0xacc [xe] [ 14.263379] ERA: ffff8000024f3760 guc_exec_queue_timedout_job+0x1c0/0xacc [xe] [ 14.270777] CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE) [ 14.276927] PRMD: 00000004 (PPLV0 +PIE -PWE) [ 14.281258] EUEN: 00000000 (-FPE -SXE -ASXE -BTE) [ 14.286024] ECFG: 00071c1d (LIE=0,2-4,10-12 VS=7) [ 14.290790] ESTAT: 000c0000 [BRK] (IS= ECode=12 EsubCode=0) [ 14.296329] PRID: 0014d000 (Loongson-64bit, Loongson-3A6000-HV) [ 14.302299] CPU: 3 UID: 0 PID: 564 Comm: kworker/u32:2 Tainted: G E 6.14.0-rc4-aosc-main-gbad70b1cd8b0-dirty deepin-community#7 [ 14.302302] Tainted: [E]=UNSIGNED_MODULE [ 14.302302] Hardware name: Loongson Loongson-3A6000-HV-7A2000-1w-V0.1-EVB/Loongson-3A6000-HV-7A2000-1w-EVB-V1.21, BIOS Loongson-UDK2018-V4.0.05756-prestab [ 14.302304] Workqueue: gt-ordered-wq drm_sched_job_timedout [gpu_sched] [ 14.302307] Stack : 900000012f153928 d84a6232d48f1ac7 900000000023eb34 900000012f150000 [ 14.302310] 900000012f153900 0000000000000000 900000012f153908 9000000001c31c70 [ 14.302313] 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 14.302315] 0000000000000000 d84a6232d48f1ac7 0000000000000000 0000000000000000 [ 14.302318] 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 14.302320] 0000000000000000 0000000000000000 00000000072b4000 900000012e4dcf48 [ 14.302323] 9000000001eb8000 0000000000000000 9000000001c31c70 0000000000000004 [ 14.302325] 0000000000000004 0000000000000000 000000000000137e 0000000000000001 [ 14.302328] 900000012f153ce8 9000000001c31c70 9000000000244174 0000555581840b98 [ 14.302331] 00000000000000b0 0000000000000004 0000000000000000 0000000000071c1d [ 14.302333] ... [ 14.302335] Call Trace: [ 14.302336] [<9000000000244174>] show_stack+0x3c/0x16c [ 14.302341] [<900000000023eb30>] dump_stack_lvl+0x84/0xe0 [ 14.302346] [<9000000000288208>] __warn+0x8c/0x174 [ 14.302350] [<90000000017c1918>] report_bug+0x1c0/0x22c [ 14.302354] [<90000000017f66e8>] do_bp+0x280/0x344 [ 14.302359] [ 14.302360] ---[ end trace 0000000000000000 ]--- Revise calculation of `RING_CTL_SIZE(size)' to use `SZ_4K' to fix the aforementioned issue. Cc: stable@vger.kernel.org Fixes: b79e8fd ("drm/xe: Remove dependency on intel_engine_regs.h") Tested-by: Mingcong Bai <jeffbai@aosc.io> Tested-by: Haien Liang <27873200@qq.com> Tested-by: Shirong Liu <lsr1024@qq.com> Tested-by: Haofeng Wu <s2600cw2@126.com> Link: FanFansfan/loongson-linux@22c55ab Co-developed-by: Shang Yatsen <429839446@qq.com> Signed-off-by: Shang Yatsen <429839446@qq.com> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Reviewed-by: Matthew Brost <matthew.brost@intel.com> [Mingcong Bai: Resolved a minor merge conflict post-6.16 in drivers/gpu/drm/xe/regs/xe_engine_regs.h] Link: https://lore.kernel.org/all/20250613-upstream-xe-non-4k-v2-v2-1-934f82249f8a@aosc.io/ Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit f5885f2c98a81c005b04369d0f1571c314bfaac1) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
It appears that the xe_res_cursor also assumes 4K alignment. Current code uses `PAGE_SIZE' as an assumed alignment reference but 4K kernel page sizes is by no means a guarantee. On 16K-paged kernels, this causes driver failures during boot up: [ 23.242757] ------------[ cut here ]------------ [ 23.247363] WARNING: CPU: 0 PID: 2036 at drivers/gpu/drm/xe/xe_res_cursor.h:182 emit_pte+0x394/0x3b0 [xe] [ 23.256962] Modules linked in: nf_conntrack_netbios_ns(E) nf_conntrack_broadcast(E) nft_fib_inet(E) nft_fib_ipv4(E) nft_fib_ipv6(E) nft_fib(E) nft_reject_inet(E) nf_reject_ipv4(E) nf_reject_ipv6(E) nft_reject(E) nft_ct(E) rfkill(E) nft_chain_nat(E) ip6table_nat(E) ip6table_mangle(E) ip6table_raw(E) ip6table_security(E) iptable_nat(E) nf_nat(E) nf_conntrack(E) nf_defrag_ipv6(E) nf_defrag_ipv4(E) iptable_mangle(E) iptable_raw(E) iptable_security(E) ip_set(E) nf_tables(E) ip6table_filter(E) ip6_tables(E) iptable_filter(E) snd_hda_codec_conexant(E) snd_hda_codec_generic(E) snd_hda_codec_hdmi(E) snd_hda_intel(E) snd_intel_dspcfg(E) snd_hda_codec(E) nls_iso8859_1(E) qrtr(E) nls_cp437(E) snd_hda_core(E) loongson3_cpufreq(E) rtc_efi(E) snd_hwdep(E) snd_pcm(E) spi_loongson_pci(E) snd_timer(E) snd(E) spi_loongson_core(E) soundcore(E) gpio_loongson_64bit(E) rtc_loongson(E) i2c_ls2x(E) mousedev(E) input_leds(E) sch_fq_codel(E) fuse(E) nfnetlink(E) dmi_sysfs(E) ip_tables(E) x_tables(E) xe(E) d rm_gpuvm(E) drm_buddy(E) gpu_sched(E) [ 23.257034] drm_exec(E) drm_suballoc_helper(E) drm_display_helper(E) cec(E) rc_core(E) hid_generic(E) tpm_tis_spi(E) r8169(E) loongson(E) i2c_algo_bit(E) realtek(E) drm_ttm_helper(E) led_class(E) ttm(E) drm_client_lib(E) drm_kms_helper(E) sunrpc(E) i2c_dev(E) [ 23.369697] CPU: 0 UID: 1000 PID: 2036 Comm: QSGRenderThread Tainted: G E 6.14.0-rc4-aosc-main-g7cc07e6e50b0-dirty deepin-community#8 [ 23.381640] Tainted: [E]=UNSIGNED_MODULE [ 23.385534] Hardware name: Loongson Loongson-3A6000-HV-7A2000-1w-V0.1-EVB/Loongson-3A6000-HV-7A2000-1w-EVB-V1.21, BIOS Loongson-UDK2018-V4.0.05756-prestab [ 23.399319] pc ffff80000251efc0 ra ffff80000251eddc tp 900000011fe3c000 sp 900000011fe3f7e0 [ 23.407632] a0 0000000000000001 a1 0000000000000000 a2 0000000000000000 a3 0000000000000000 [ 23.415938] a4 0000000000000000 a5 0000000000000000 a6 0000000000060000 a7 900000010c947b00 [ 23.424240] t0 0000000000000000 t1 0000000000000000 t2 0000000000000000 t3 900000012e456230 [ 23.432543] t4 0000000000000035 t5 0000000000004000 t6 00000001fbc40403 t7 0000000000004000 [ 23.440845] t8 9000000100e688a8 u0 5cc06cee8ef0edee s9 9000000100024420 s0 0000000000000047 [ 23.449147] s1 0000000000004000 s2 0000000000000001 s3 900000012adba000 s4 ffffffffffffc000 [ 23.457450] s5 9000000108939428 s6 0000000000000000 s7 0000000000000000 s8 900000011fe3f8e0 [ 23.465851] ra: ffff80000251eddc emit_pte+0x1b0/0x3b0 [xe] [ 23.471761] ERA: ffff80000251efc0 emit_pte+0x394/0x3b0 [xe] [ 23.477557] CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE) [ 23.483732] PRMD: 00000004 (PPLV0 +PIE -PWE) [ 23.488068] EUEN: 00000003 (+FPE +SXE -ASXE -BTE) [ 23.492832] ECFG: 00071c1d (LIE=0,2-4,10-12 VS=7) [ 23.497594] ESTAT: 000c0000 [BRK] (IS= ECode=12 EsubCode=0) [ 23.503133] PRID: 0014d000 (Loongson-64bit, Loongson-3A6000-HV) [ 23.509164] CPU: 0 UID: 1000 PID: 2036 Comm: QSGRenderThread Tainted: G E 6.14.0-rc4-aosc-main-g7cc07e6e50b0-dirty deepin-community#8 [ 23.509168] Tainted: [E]=UNSIGNED_MODULE [ 23.509168] Hardware name: Loongson Loongson-3A6000-HV-7A2000-1w-V0.1-EVB/Loongson-3A6000-HV-7A2000-1w-EVB-V1.21, BIOS Loongson-UDK2018-V4.0.05756-prestab [ 23.509170] Stack : ffffffffffffffff ffffffffffffffff 900000000023eb34 900000011fe3c000 [ 23.509176] 900000011fe3f440 0000000000000000 900000011fe3f448 9000000001c31c70 [ 23.509181] 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 23.509185] 0000000000000000 5cc06cee8ef0edee 0000000000000000 0000000000000000 [ 23.509190] 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 23.509193] 0000000000000000 0000000000000000 00000000066b4000 9000000100024420 [ 23.509197] 9000000001eb8000 0000000000000000 9000000001c31c70 0000000000000004 [ 23.509202] 0000000000000004 0000000000000000 0000000000000000 0000000000000000 [ 23.509206] 900000011fe3f8e0 9000000001c31c70 9000000000244174 00007fffac097534 [ 23.509211] 00000000000000b0 0000000000000004 0000000000000003 0000000000071c1d [ 23.509216] ... [ 23.509218] Call Trace: [ 23.509220] [<9000000000244174>] show_stack+0x3c/0x16c [ 23.509226] [<900000000023eb30>] dump_stack_lvl+0x84/0xe0 [ 23.509230] [<9000000000288208>] __warn+0x8c/0x174 [ 23.509234] [<90000000017c1918>] report_bug+0x1c0/0x22c [ 23.509238] [<90000000017f66e8>] do_bp+0x280/0x344 [ 23.509243] [<90000000002428a0>] handle_bp+0x120/0x1c0 [ 23.509247] [<ffff80000251efc0>] emit_pte+0x394/0x3b0 [xe] [ 23.509295] [<ffff800002520d38>] xe_migrate_clear+0x2d8/0xa54 [xe] [ 23.509341] [<ffff8000024e6c38>] xe_bo_move+0x324/0x930 [xe] [ 23.509387] [<ffff800002209468>] ttm_bo_handle_move_mem+0xd0/0x194 [ttm] [ 23.509392] [<ffff800002209ebc>] ttm_bo_validate+0xd4/0x1cc [ttm] [ 23.509396] [<ffff80000220a138>] ttm_bo_init_reserved+0x184/0x1dc [ttm] [ 23.509399] [<ffff8000024e7840>] ___xe_bo_create_locked+0x1e8/0x3d4 [xe] [ 23.509445] [<ffff8000024e7cf8>] __xe_bo_create_locked+0x2cc/0x390 [xe] [ 23.509489] [<ffff8000024e7e98>] xe_bo_create_user+0x34/0xe4 [xe] [ 23.509533] [<ffff8000024e875c>] xe_gem_create_ioctl+0x154/0x4d8 [xe] [ 23.509578] [<9000000001062784>] drm_ioctl_kernel+0xe0/0x14c [ 23.509582] [<9000000001062c10>] drm_ioctl+0x420/0x5f4 [ 23.509585] [<ffff8000024ea778>] xe_drm_ioctl+0x64/0xac [xe] [ 23.509630] [<9000000000653504>] sys_ioctl+0x2b8/0xf98 [ 23.509634] [<90000000017f684c>] do_syscall+0xa0/0x140 [ 23.509637] [<9000000000241e38>] handle_syscall+0xb8/0x158 [ 23.509640] [ 23.509644] ---[ end trace 0000000000000000 ]--- Revise calls to `xe_res_dma()' and `xe_res_cursor()' to use `XE_PTE_MASK' (12) and `SZ_4K' to fix this potentially confused use of `PAGE_SIZE' in relevant code. Cc: stable@vger.kernel.org Fixes: e89b384 ("drm/xe/migrate: Update emit_pte to cope with a size level than 4k") Tested-by: Mingcong Bai <jeffbai@aosc.io> Tested-by: Haien Liang <27873200@qq.com> Tested-by: Shirong Liu <lsr1024@qq.com> Tested-by: Haofeng Wu <s2600cw2@126.com> Link: FanFansfan/loongson-linux@22c55ab Co-developed-by: Shang Yatsen <429839446@qq.com> Signed-off-by: Shang Yatsen <429839446@qq.com> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Link: https://lore.kernel.org/all/20250613-upstream-xe-non-4k-v2-v2-1-934f82249f8a@aosc.io/ Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit d68f49d9e1d436aecd9593281da1bd2a0d798125) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
As this component hooks into userspace API, it should be assumed that it will play well with non-4K/64K pages. Use `PAGE_SIZE' as the final reference for page alignment instead. Cc: stable@vger.kernel.org Fixes: dd08ebf ("drm/xe: Introduce a new DRM driver for Intel GPUs") Fixes: 801989b ("drm/xe/uapi: Make constant comments visible in kernel doc") Tested-by: Mingcong Bai <jeffbai@aosc.io> Tested-by: Haien Liang <27873200@qq.com> Tested-by: Shirong Liu <lsr1024@qq.com> Tested-by: Haofeng Wu <s2600cw2@126.com> Link: FanFansfan/loongson-linux@22c55ab Co-developed-by: Shang Yatsen <429839446@qq.com> Signed-off-by: Shang Yatsen <429839446@qq.com> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Link: https://lore.kernel.org/all/20250613-upstream-xe-non-4k-v2-v2-1-934f82249f8a@aosc.io/ Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit ac7d3b7a639f521db34dd43e0601ce7f4ae02c7f) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
While testing my ROCm port for LoongArch and AArch64 (patches pending) on the following platforms: - LoongArch ... - Loongson AC612A0_V1.1 (Loongson 3C6000/S) + AMD Radeon RX 6800 - AArch64 ... - FD30M51 (Phytium FT-D3000) + AMD Radeon RX 7600 - Huawei D920S10 (Huawei Kunpeng 920) + AMD Radeon RX 7600 When HSA_AMD_SVM is enabled, amdgpu would fail to initialise at all on LoongArch (no output): amdgpu 0000:0d:00.0: amdgpu: kiq ring mec 2 pipe 1 q 0 CPU 0 Unable to handle kernel paging request at virtual address ffffffffff800034, era == 9000000001058044, ra == 9000000001058660 Oops[#1]: CPU: 0 UID: 0 PID: 202 Comm: kworker/0:3 Not tainted 6.16.0+ deepin-community#103 PREEMPT(full) Hardware name: To be filled by O.E.M.To be fill To be filled by O.E.M.To be fill/To be filled by O.E.M.To be fill, BIOS Loongson-UDK2018-V4.0. Workqueue: events work_for_cpu_fn pc 9000000001058044 ra 9000000001058660 tp 9000000101500000 sp 9000000101503aa0 a0 ffffffffff800000 a1 0000000ffffe0000 a2 0000000000000000 a3 90000001207c58e0 a4 9000000001a4c310 a5 0000000000000001 a6 0000000000000000 a7 0000000000000001 t0 000003ffff800000 t1 0000000000000001 t2 0000040000000000 t3 03ffff0000002000 t4 0000000000000000 t5 0001010101010101 t6 ffff800000000000 t7 0001000000000000 t8 000000000000002f u0 0000000000800000 s9 9000000002026000 s0 90000001207c58e0 s1 0000000000000001 s2 9000000001935c40 s3 0000001000000000 s4 0000000000000001 s5 0000000ffffe0000 s6 0000000000000040 s7 0001000000000001 s8 0001000000000000 ra: 9000000001058660 memmap_init_zone_device+0x120/0x1b0 ERA: 9000000001058044 __init_zone_device_page.constprop.0+0x4/0x1a0 CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE) PRMD: 00000004 (PPLV0 +PIE -PWE) EUEN: 00000000 (-FPE -SXE -ASXE -BTE) ECFG: 00071c1d (LIE=0,2-4,10-12 VS=7) ESTAT: 00020000 [PIS] (IS= ECode=2 EsubCode=0) BADV: ffffffffff800034 PRID: 0014d010 (Loongson-64bit, Loongson-3C6000/S) Modules linked in: amdgpu(+) vfat fat cfg80211 rfkill 8021q garp stp mrp llc snd_hda_codec_atihdmi snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_codec_generic drm_client_lib drm_ttm_helper syscopyarea ttm sysfillrect sysimgblt fb_sys_fops drm_panel_backlight_quirks video drm_exec drm_suballoc_helper amdxcp mfd_core drm_buddy gpu_sched drm_display_helper drm_kms_helper cec snd_hda_intel ipmi_ssif snd_intel_dspcfg snd_hda_codec snd_hda_core acpi_ipmi snd_hwdep snd_pcm fb loongson3_cpufreq lcd igc snd_timer ipmi_si spi_loongson_pci spi_loongson_core snd ipmi_devintf soundcore ipmi_msghandler binfmt_misc fuse drm drm_panel_orientation_quirks backlight dm_mod dax nfnetlink Process kworker/0:3 (pid: 202, threadinfo=00000000eb7cd5d6, task=000000004ca22b1b) Stack : 0000000000001440 0000000000000000 ffffffffff800000 0000000000000001 90000000020b5978 9000000101503b38 0000000000000001 0000000000000001 0000000000000000 90000000020b5978 90000000020b3f48 0000000000001440 0000000000000000 90000001207c58e0 90000001207c5970 9000000000575e20 90000000010e2e00 90000000020b3f48 900000000205c238 0000000000000000 00000000000001d3 90000001207c58e0 9000000001958f28 9000000120790848 90000001207b3510 0000000000000000 9000000120780000 9000000120780010 90000001207d6000 90000001207c58e0 90000001015660c8 9000000120780000 0000000000000000 90000000005763a8 90000001207c58e0 00000003ff000000 9000000120780000 ffff80000296b820 900000012078f968 90000001207c6000 ... Call Trace: [<9000000001058044>] __init_zone_device_page.constprop.0+0x4/0x1a0 [<900000000105865c>] memmap_init_zone_device+0x11c/0x1b0 [<9000000000575e1c>] memremap_pages+0x24c/0x7b0 [<90000000005763a4>] devm_memremap_pages+0x24/0x80 [<ffff80000296b81c>] kgd2kfd_init_zone_device+0x11c/0x220 [amdgpu] [<ffff80000265d09c>] amdgpu_device_init+0x27dc/0x2bf0 [amdgpu] [<ffff80000265ece8>] amdgpu_driver_load_kms+0x18/0x90 [amdgpu] [<ffff800002651fbc>] amdgpu_pci_probe+0x22c/0x890 [amdgpu] [<9000000000916adc>] local_pci_probe+0x3c/0xb0 [<90000000002976c8>] work_for_cpu_fn+0x18/0x30 [<900000000029aeb4>] process_one_work+0x164/0x320 [<900000000029b96c>] worker_thread+0x37c/0x4a0 [<90000000002a695c>] kthread+0x12c/0x220 [<9000000001055b64>] ret_from_kernel_thread+0x24/0xc0 [<9000000000237524>] ret_from_kernel_thread_asm+0xc/0x88 Code: 00000000 00000000 0280040d <2980d08d> 02bffc0e 2980c08e 02c0208d 29c0208d 1400004f ---[ end trace 0000000000000000 ]--- Or lock up and/or driver reset during computate tasks, such as when running llama.cpp over ROCm, at which point the compute process must be killed before the reset could complete: amdgpu 0000:0a:00.0: amdgpu: MES failed to respond to msg=REMOVE_QUEUE amdgpu 0000:0a:00.0: amdgpu: failed to remove hardware queue from MES, doorbell=0x1202 amdgpu 0000:0a:00.0: amdgpu: MES might be in unrecoverable state, issue a GPU reset amdgpu 0000:0a:00.0: amdgpu: Failed to evict queue 3 amdgpu 0000:0a:00.0: amdgpu: GPU reset begin! amdgpu 0000:0a:00.0: amdgpu: MES failed to respond to msg=REMOVE_QUEUE amdgpu 0000:0a:00.0: amdgpu: failed to remove hardware queue from MES, doorbell=0x1004 amdgpu 0000:0a:00.0: amdgpu: MES might be in unrecoverable state, issue a GPU reset amdgpu 0000:0a:00.0: amdgpu: Failed to evict queue 2 amdgpu 0000:0a:00.0: amdgpu: Failed to evict queue 1 amdgpu 0000:0a:00.0: amdgpu: Failed to evict queue 0 amdgpu: Failed to quiesce KFD amdgpu 0000:0a:00.0: amdgpu: Dumping IP State amdgpu 0000:0a:00.0: amdgpu: Dumping IP State Completed amdgpu 0000:0a:00.0: amdgpu: MES failed to respond to msg=REMOVE_QUEUE [drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue amdgpu 0000:0a:00.0: amdgpu: MES failed to respond to msg=REMOVE_QUEUE [drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue amdgpu 0000:0a:00.0: amdgpu: MES failed to respond to msg=REMOVE_QUEUE [drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue amdgpu 0000:0a:00.0: amdgpu: MES failed to respond to msg=REMOVE_QUEUE [drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue amdgpu 0000:0a:00.0: amdgpu: MES failed to respond to msg=REMOVE_QUEUE [drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue amdgpu 0000:0a:00.0: amdgpu: MES failed to respond to msg=REMOVE_QUEUE [drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue amdgpu 0000:0a:00.0: amdgpu: MES failed to respond to msg=REMOVE_QUEUE [drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue amdgpu 0000:0a:00.0: amdgpu: MES failed to respond to msg=REMOVE_QUEUE [drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue amdgpu 0000:0a:00.0: amdgpu: MES failed to respond to msg=REMOVE_QUEUE [drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue amdgpu 0000:0a:00.0: amdgpu: MODE1 reset amdgpu 0000:0a:00.0: amdgpu: GPU mode1 reset amdgpu 0000:0a:00.0: amdgpu: GPU smu mode1 reset amdgpu 0000:0a:00.0: amdgpu: GPU reset succeeded, trying to resume Disabling the aforementioned option makes the issue go away, though it is unclear whether this is a platform-specific issue or one that lies within the amdkfd code. This patch has been tested on all the aforementioned platform combinations, and sent as an RFC to encourage discussion. Signed-off-by: Zhang Yuhao <xinmu@xinmu.moe> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Tested-by: Mingcong Bai <jeffbai@aosc.io> Link: https://lore.kernel.org/all/20250814032153.227285-1-jeffbai@aosc.io/ Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 7f2bd85e5436a36b04a706fa90e2802bb717cfd4) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…n ttm_device Currently TTM utilizes cached memory regardless of whether the device have full DMA coherency (can snoop CPU cache). Save the device's DMA coherency status in struct ttm_device, to allow further support of devices w/o snooping capability (the capability missing on at least one part of the transmission between the CPU and the device). Signed-off-by: Icenowy Zheng <uwu@icenowy.me> Link: https://lore.kernel.org/r/20240629052247.2653363-2-uwu@icenowy.me [ Han Gao: add conditional compilation for dma_coherent ] Signed-off-by: Han Gao <rabenda.cn@gmail.com> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 0fdadc3f08f3f3c5140d5c4201cd7e7cc9601bc2) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…snooping not available As we can now acquire the presence of the full DMA coherency (snooping capability) from ttm_device, we can now map the CPU side memory as write-combined when cached is requested and snooping is not avilable. Signed-off-by: Icenowy Zheng <uwu@icenowy.me> Link: https://lore.kernel.org/r/20240629052247.2653363-3-uwu@icenowy.me [ Han Gao: add conditional compilation for dma coherent operations ] Signed-off-by: Han Gao <rabenda.cn@gmail.com> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit c2552bc229facfe6e3d66c62bb49d697967e2f5b) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Now VM PMU capability comes from host PMU capability directly, instead bit 23 of HW GCFG CSR register also show PMU capability for VM. It will be better if it comes from HW GCFG CSR register rather than host PMU capability, especially when LVZ function is emulated in TCG mode, however without PMU capability. Signed-off-by: Bibo Mao <maobibo@loongson.cn> Link: https://lore.kernel.org/loongarch/20250930093741.2734974-1-maobibo@loongson.cn/ Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit c3d0a4af835249c7eb63378617d6509dd0165da1) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…eyboard After commit 9cf6e24 ("Input: atkbd - do not skip atkbd_deactivate() when skipping ATKBD_CMD_GETID"), HONOR FMB-P, aka HONOR MagicBook Pro 14 2025's internal keyboard stops working. Adding the atkbd_deactivate_fixup quirk fixes it. DMI: HONOR FMB-P/FMB-P-PCB, BIOS 1.13 05/08/2025 Fixes: 9cf6e24 ("Input: atkbd - do not skip atkbd_deactivate() when skipping ATKBD_CMD_GETID") Reported-by: Mikura Kyouka <mikurakyouka@aosc.io> Link: https://www.xiaohongshu.com/explore/68738d0a0000000012015a79 Link: https://club.honor.com/cn/thread-29463529-1-1.html Link: https://club.honor.com/cn/thread-29490444-1-1.html Reported-by: foad.elkhattabi <foad.elkhattabi@gmail.com> Link: https://bugzilla.kernel.org/show_bug.cgi?id=220384 Signed-off-by: Cryolitia PukNgae <cryolitia.pukngae@linux.dev> Link: https://lore.kernel.org/all/20251022-honor-v1-1-ff894ed271a9@linux.dev/ Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 2c52cbc66d3b988b04d59caf71c33ab1e2b92a1a) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…in byte mode gpiolib want to get completely rid of static gpiobase allocation, so switch to dynamic allocate GPIO base in byte mode, also can avoid warning message: [1.529974] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation. Reported-by: Hongliang Wang <wanghongliang@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> Link: https://lore.kernel.org/loongarch/20251023090346.1995894-1-zhoubinbin@loongson.cn/ Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 6b4e80321278460fa2d13582663f7bb4a7ed42bb) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…d controllers Most glue driver for PCI-based DWMAC controllers utilize similar platform suspend/resume routines. Add a generic implementation to reduce duplicated code. Signed-off-by: Yao Zi <ziyao@disroot.org> Link: https://lore.kernel.org/netdev/20251124160417.51514-1-ziyao@disroot.org/ Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 68147a454238d58419ee1b8d277e040ec18c4878) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Convert glue driver for Loongson DWMAC controller to use the generic platform suspend/resume routines for PCI controllers, instead of implementing its own one. Signed-off-by: Yao Zi <ziyao@disroot.org> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Acked-by: Yanteng Si <siyanteng@cqsoftware.com.cn> Link: https://lore.kernel.org/netdev/20251124160417.51514-1-ziyao@disroot.org/ Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit dcf348689ac2503f8bf17678e920415c8880223c) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Convert STMMAC PCI glue driver to use the generic platform suspend/resume routines for PCI controllers, instead of implementing its own one. Signed-off-by: Yao Zi <ziyao@disroot.org> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Yanteng Si <siyanteng@cqsoftware.com.cn> Link: https://lore.kernel.org/netdev/20251124160417.51514-1-ziyao@disroot.org/ Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit fa960ccc1e8131791d106c04d6699f269e8cacb8) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
This patch introduces a driver for the PixArt PS/2 touchpad, which supports both clickpad and touchpad types. At the same time, we extended the single data packet length to 16, because according to the current PixArt hardware and FW design, we need 11 bytes/15 bytes to represent the complete three-finger/four-finger data. Co-developed-by: Jon Xie <jon_xie@pixart.com> Signed-off-by: Jon Xie <jon_xie@pixart.com> Co-developed-by: Jay Lee <jay_lee@pixart.com> Signed-off-by: Jay Lee <jay_lee@pixart.com> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> Tested-by: Kexy Biscuit <kexybiscuit@aosc.io> Link: https://lore.kernel.org/loongarch/20251127080203.3218018-1-zhoubinbin@loongson.cn/ Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit cf6278598eb66abb5885f74f14c1d9a9b45b0099) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Currently, the LoongArch CPU topology initialization code calculates
each core's package ID by dividing its physical ID by
loongson_sysconf.cores_per_package. This relies on the assumption that
cores_per_package counts in the same domain as physical IDs.
On Loongson 3B6000 (XB612B0V_1.2), cores_per_package matches the visible
core count -- 24 in this case. However, the physical IDs range from 0 to
31 in a noncontiguous fashion:
$ cat /proc/cpuinfo | grep -i -F 'global_id'
global_id : 0
global_id : 1
global_id : 4
global_id : 5
global_id : 6
global_id : 7
global_id : 8
global_id : 9
global_id : 10
global_id : 11
global_id : 14
global_id : 15
global_id : 16
global_id : 17
global_id : 20
global_id : 21
global_id : 22
global_id : 23
global_id : 26
global_id : 27
global_id : 28
global_id : 29
global_id : 30
global_id : 31
Retrieve the exact package ID from ACPI PPTT when available, in the same
style as retrieving the core ID and thread ID in parse_acpi_topology().
Use this information in loongson_init_secondary() when PPTT readout is
successful. The original division logic is kept as a fallback.
Cc: stable@vger.kernel.org
Signed-off-by: Rong Bao <rong.bao@csmantle.top>
Link: https://lore.kernel.org/loongarch/e18efdbb.AXMAAIuqLC8AAAAAAAAAA-ma1qEAAYKJPtkAAAAAADNVAQBpc5ot@mailjet.com/
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
(cherry picked from commit e823a4c998fad1cad5f7a875581745f2c7450838)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…gned When the IO resource given by _CRS method is not page aligned, especially when the page size is larger than 4KB, serious problems will happen because the misaligned address is passed down to pci_remap_iospace(), then to vmap_page_range(), and finally to vmap_pte_range(), where the length between addr and end is expected to be divisible by PAGE_SIZE, or the loop will overrun till the pfn_none check fails. Signed-off-by: Miao Wang <shankerwangmiao@gmail.com> Link: https://lore.kernel.org/linux-acpi/20240814-check_pci_probe_res-v3-1-b6eaa6f99032@gmail.com/ [Mingcong Bai: Fixed a minor merge conflict in drivers/acpi/pci_root.c.] Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit d8d17a65525f9737984599e4370fa38fdc896c90) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…dr_mask Some PCI devices have PCI_MSI_FLAGS_64BIT in the MSI capability, but implement less than 64 address bits. This breaks on platforms where such a device is assigned an MSI address higher than what's reachable. Currently, we deal with this with a single no_64bit_msi flag, and (notably on powerpc) forces 32-bit MSI address for these devices. However, on some platforms the MSI doorbell address is above 32-bit but within device ability. As a first step to enabling MSI on those combinations of devices and platforms, conservatively generalize the single-bit flag no_64bit_msi into msi_addr_mask. (The name msi_addr_mask is chosen to avoid confusion with msi_mask.) The translation is essentially: - no_64bit_msi = 1 -> msi_addr_mask = DMA_BIT_MASK(32) - no_64bit_msi = 0 -> msi_addr_mask = DMA_BIT_MASK(64) - if (no_64bit_msi) -> if (msi_addr_mask < DMA_BIT_MASK(64)) Since no values other than DMA_BIT_MASK(32) and DMA_BIT_MASK(64) is used, no functional change is intended. Future patches that make use of intermediate values of msi_addr_mask will follow, allowing devices that cannot use full 64-bit addresses for MSI to work on platforms with MSI doorbell above 32-bit address space. Acked-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn> Link: https://lore.kernel.org/r/20260123-pci-msi-addr-mask-v3-1-9f9baa048524@iscas.ac.cn Signed-off-by: Han Gao <gaohan@iscas.ac.cn> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 889425bfad0c46d336f75e416a10e4e195b8e283) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Instead of a 32-bit/64-bit dichotomy, check the MSI address against msi_addr_mask. This allows platforms with MSI doorbell above 32-bit address space to work with devices without full 64-bit MSI address support, as long as the doorbell is within addressable range of MSI of the device. Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn> Link: https://lore.kernel.org/r/20260123-pci-msi-addr-mask-v3-2-9f9baa048524@iscas.ac.cn Signed-off-by: Han Gao <gaohan@iscas.ac.cn> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 8f3730a4dd913859ed8cf531b554217b1d6e5a9a) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
The code was originally written using no_64bit_msi, which restricts the device to 32-bit MSI addresses. Since msi_addr_mask is introduced, use DMA_BIT_MASK(dma_bits) instead of DMA_BIT_MASK(32) here for msi_addr_mask, describing the restriction more precisely and allowing these devices to work on platforms with MSI doorbell address above 32-bit space, as long as it is within the hardware's addressable space. Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn> Link: https://lore.kernel.org/r/20260123-pci-msi-addr-mask-v3-3-9f9baa048524@iscas.ac.cn Signed-off-by: Han Gao <gaohan@iscas.ac.cn> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 2a691419388ac2a0d7baa6905c6021d9ce935c25) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
The code was originally written using no_64bit_msi, which restricts the device to 32-bit MSI addresses. Since msi_addr_mask is introduced, use DMA_BIT_MASK(dma_bits) instead of DMA_BIT_MASK(32) here for msi_addr_mask, describing the restriction more precisely and allowing these devices to work on platforms with MSI doorbell address above 32-bit space, as long as it is within the hardware's addressable space. Acked-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn> Link: https://lore.kernel.org/r/20260123-pci-msi-addr-mask-v3-4-9f9baa048524@iscas.ac.cn Signed-off-by: Han Gao <gaohan@iscas.ac.cn> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 1e592fbc7c821efb437ffbdc64213696f12bb1ab) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…_FP_{START,END}
[Why]
The dcn32_override_min_req_memclk function is in dcn32_fpu.c, which is
compiled with CC_FLAGS_FPU into FP instructions. So when we call it we
must use DC_FP_{START,END} to save and restore the FP context, and
prepare the FP unit on architectures like LoongArch where the FP unit
isn't always on.
Reported-by: LiarOnce <liaronce@hotmail.com>
Fixes: ee7be8f ("drm/amd/display: Limit DCN32 8 channel or less parts to DPM1 for FPO")
Cc: stable@vger.kernel.org
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Link: https://lore.kernel.org/all/20260306062805.1464383-2-xry111@xry111.site/
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
(cherry picked from commit c2f68795b759d998f764d2265235e7fceda5710a)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
On multiple bridge platform, a MSIX vector is often affinitive with only one cpu, and the count of MSIX is determined as the count of cpus in the system. Unfortunately, the cpu group related to a brigde is only allowed to handle interrupts from devices behind the bridge, which breaks the normal affinity setting for multiple MSIX vectors, and causing following affinity setting: IRQ: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 CPU: 0, 1, 2, 3, 4, 0, 0, 0, 0, 0 To balance the affinity, we improve the setting to assign cpu for IRQ as following: IRQ: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 CPU: 0, 1, 2, 3, 4, 0, 1, 2, 3, 4 Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Link: chenhuacai/linux@0e32ff9 Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit ae08d68869165be8d73c43151a2ff65fe68bd88d) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
This add CPU HWMon (temperature sensor) platform driver for Loongson-3. Tested-by: Xi Ruoyao <xry111@xry111.site> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Link: chenhuacai/linux@2a6c1c7 Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 832c8e683f568d10c02697981a29d0cbea79b15d) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
… fs_initcall Consider a configuration like this: 1, efifb (or simpledrm) is built-in; 2, a native display driver (such as radeon) is also built-in. As Javier said, this is not a common configuration (the native display driver is usually built as a module), but it can happen and cause some trouble. In this case, since efifb, radeon and sysfb are all in device_initcall() level, the order in practise is like this: efifb registered at first, but no "efi-framebuffer" device yet. radeon registered later, and /dev/fb0 created. sysfb_init() comes at last, it registers "efi-framebuffer" and then causes an error message "efifb: a framebuffer is already registered". Make sysfb_init() to be subsys_ initcall_sync() can avoid this. And Javier Martinez Canillas is trying to make a more general solution in commit 873eb3b ("fbdev: Disable sysfb device registration when removing conflicting FBs"). However, this patch still makes sense because it can make the screen display as early as possible (We cannot move to subsys_initcall, since sysfb_init() should be executed after PCI enumeration). This is a better version of commit 60aebc9 ("drivers/firmware: Move sysfb_init() from device_initcall to subsys_initcall_sync") since the previous commit leads to blank displays on some systems. The reason is that vgaarb initialization is also a subsys_initcall_sync function so sysfb_disable() is sometimes missed. So here we move sysfb_init() to an fs_initcall function which is ensured after vgaarb initialization. Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Link: chenhuacai/linux@8bea46f Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 4f21230c07c14d51d46112d189ed85eeac143dd2) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Revert "drm/ast: Remove vaddr field from struct ast_plane". This reverts commit 23fd03a. Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Link: chenhuacai/linux@b78ebca Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit c33c915f988f39156525006ed42e59b662dcea11) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…_subdev() The current call to v4l2_subdev_get_privacy_led() is contained in v4l2_async_register_subdev_sensor(), but that function isn't used by all the sensor drivers. Move the acquisition of the privacy led to v4l2_async_register_subdev() instead. Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Patchset: cameras Link: linux-surface/linux-surface@91786c3 Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 99e8efdef65492e79854d86924677d60557a7e3c) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Add MFD cell for tps68470-led. Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kate Hsuan <hpa@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Patchset: cameras Link: linux-surface/linux-surface@91786c3 Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 0ef6f1d99a19b1e6c70831028cf68c2e7417f5d9) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Add flags for both LEDA(TPS68470_ILEDCTL_ENA), LEDB (TPS68470_ILEDCTL_ENB), and current control mask for LEDB (TPS68470_ILEDCTL_CTRLB) Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kate Hsuan <hpa@redhat.com> Patchset: cameras Link: linux-surface/linux-surface@91786c3 Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 0d7b9b3d3827e79fe53d798375ff98237e36792b) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
There are two LED controllers, LEDA indicator LED and LEDB flash LED for tps68470. LEDA can be enabled by setting TPS68470_ILEDCTL_ENA. Moreover, tps68470 provides four levels of power status for LEDB. If the properties called "ti,ledb-current" can be found, the current will be set according to the property values. These two LEDs can be controlled through the LED class of sysfs (tps68470-leda and tps68470-ledb). Signed-off-by: Kate Hsuan <hpa@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Patchset: cameras Link: linux-surface/linux-surface@91786c3 Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 36f2d3f1b3d76a110a136bb5869bfff64163eadd) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
On surface go 2, sometimes probing dw9719 fails with "dw9719: probe of i2c-INT347A:00-VCM failed with error -121". The -121(-EREMOTEIO) is came from drivers/i2c/busses/i2c-designware-common.c:575, and indicates the initialize occurs too early. So just add some delay. There is no exact reason for this 10000us, but 100us failed. Patchset: cameras Link: linux-surface/linux-surface@91786c3 Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 6d3ac4de40d057d6471d6cd701fb9cf3359ef496) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
This patch is the work of Thomas Gleixner <tglx@linutronix.de> and is copied from: https://lore.kernel.org/lkml/87lf8ddjqx.ffs@nanos.tec.linutronix.de/ This patch adds a quirk to the ACPI setup to patch in the the irq 7 pin setup that is missing in the laptops ACPI table. This patch was used for validation of the issue, and is not a proper fix, but is probably a better temporary hack than continuing to probe the Legacy PIC and run with the PIC in an unknown state. Patchset: amd-gpio Link: linux-surface/linux-surface@91786c3 Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 0ef2abe9b2779b8f2f4f27325246bd23d7cd67e0) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…uirk The 13" version of the Surface Laptop 4 has the same problem as the 15" version, but uses a different SKU. Add that SKU to the quirk as well. Patchset: amd-gpio Link: linux-surface/linux-surface@91786c3 Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 5a5c235bac8d7ec6c6981994fea02acd345a1fe5) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
The specification [1] allows so-called HW-reduced platforms, which do not implement everything, especially the wakeup related stuff. In that case, it is still usable as a RTC. This is helpful for [2] and [3], which is about a device with no other working RTC, but it does have an HW-reduced TAD, which can be used as a RTC instead. [1]: https://uefi.org/specs/ACPI/6.5/09_ACPI_Defined_Devices_and_Device_Specific_Objects.html#time-and-alarm-device [2]: https://bugzilla.kernel.org/show_bug.cgi?id=212313 [3]: linux-surface/linux-surface#415 Signed-off-by: Bart Groeneveld | GPX Solutions B.V. <bart@gpxbv.nl> Patchset: rtc [Mingcong Bai: Resolved a minor merge conflict since 6.18 in drivers/acpi/acpi_tad.c.] Link: linux-surface/linux-surface@91786c3 Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit fedbb34be9e93cf7832de4c4659f728aafad28bd) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
On LoongArch, radeon causes a memory read violation that crashes radeonsi_dri.so (and all processes that loaded this module). When using amdgpu, this issue does not occur. The upstream maintainers are likely not going to accept this change as the default drivers were set since long ago, and we do not have enough proof to show that this change is worth merging. Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Link: https://t.me/c/1109254909/477558 Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit f7082f60edff70614e0cad6b4de3299290bb09da) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…ocation"
When this change was introduced between v6.10.4 and v6.10.5, the Broadcom
Tigon3 Ethernet interface (tg3) found on Apple MacBook Pro (15'',
Mid 2010) would throw many rcu stall errors during boot up, causing
peripherals such as the wireless card to misbehave.
[ 24.153855] rcu: INFO: rcu_preempt detected expedited stalls on CPUs/tasks: { 2-.... } 21 jiffies s: 973 root: 0x4/.
[ 24.166938] rcu: blocking rcu_node structures (internal RCU debug):
[ 24.177800] Sending NMI from CPU 3 to CPUs 2:
[ 24.183113] NMI backtrace for cpu 2
[ 24.183119] CPU: 2 PID: 1049 Comm: NetworkManager Not tainted 6.10.5-aosc-main #1
[ 24.183123] Hardware name: Apple Inc. MacBookPro6,2/Mac-F22586C8, BIOS MBP61.88Z.005D.B00.1804100943 04/10/18
[ 24.183125] RIP: 0010:__this_module+0x2d3d1/0x4f310 [tg3]
[ 24.183135] Code: c3 cc cc cc cc 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 0f 1f 44 00 00 89 f6 48 03 77 30 8b 06 <31> f6 31 ff c3 cc cc cc cc 66 0f 1f 44 00 00 90 90 90 90 90 90 90
[ 24.183138] RSP: 0018:ffffbf1a011d75e8 EFLAGS: 00000082
[ 24.183141] RAX: 0000000000000000 RBX: ffffa04ec78f8a00 RCX: 0000000000000000
[ 24.183143] RDX: 0000000000000000 RSI: ffffbf1a00fb007c RDI: ffffa04ec78f8a00
[ 24.183145] RBP: 0000000000000b50 R08: 0000000000000000 R09: 0000000000000000
[ 24.183147] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000216
[ 24.183148] R13: ffffbf1a011d7624 R14: ffffa04ec78f8a08 R15: ffffa04ec78f8b40
[ 24.183151] FS: 00007f4c524b2140(0000) GS:ffffa05007d00000(0000) knlGS:0000000000000000
[ 24.183153] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 24.183155] CR2: 00007f7025eae3e8 CR3: 00000001040f8000 CR4: 00000000000006f0
[ 24.183157] Call Trace:
[ 24.183162] <NMI>
[ 24.183167] ? nmi_cpu_backtrace+0xbf/0x140
[ 24.183175] ? nmi_cpu_backtrace_handler+0x11/0x20
[ 24.183181] ? nmi_handle+0x61/0x160
[ 24.183186] ? default_do_nmi+0x42/0x110
[ 24.183191] ? exc_nmi+0x1bd/0x290
[ 24.183194] ? end_repeat_nmi+0xf/0x53
[ 24.183203] ? __this_module+0x2d3d1/0x4f310 [tg3]
[ 24.183207] ? __this_module+0x2d3d1/0x4f310 [tg3]
[ 24.183210] ? __this_module+0x2d3d1/0x4f310 [tg3]
[ 24.183213] </NMI>
[ 24.183214] <TASK>
[ 24.183215] __this_module+0x31828/0x4f310 [tg3]
[ 24.183218] ? __this_module+0x2d390/0x4f310 [tg3]
[ 24.183221] __this_module+0x398e6/0x4f310 [tg3]
[ 24.183225] __this_module+0x3baf8/0x4f310 [tg3]
[ 24.183229] __this_module+0x4733f/0x4f310 [tg3]
[ 24.183233] ? _raw_spin_unlock_irqrestore+0x25/0x70
[ 24.183237] ? __this_module+0x398e6/0x4f310 [tg3]
[ 24.183241] __this_module+0x4b943/0x4f310 [tg3]
[ 24.183244] ? delay_tsc+0x89/0xf0
[ 24.183249] ? preempt_count_sub+0x51/0x60
[ 24.183254] __this_module+0x4be4b/0x4f310 [tg3]
[ 24.183258] __dev_open+0x103/0x1c0
[ 24.183265] __dev_change_flags+0x1bd/0x230
[ 24.183269] ? rtnl_getlink+0x362/0x400
[ 24.183276] dev_change_flags+0x26/0x70
[ 24.183280] do_setlink+0xe16/0x11f0
[ 24.183286] ? __nla_validate_parse+0x61/0xd40
[ 24.183295] __rtnl_newlink+0x63d/0x9f0
[ 24.183301] ? kmem_cache_alloc_node_noprof+0x12b/0x360
[ 24.183308] ? kmalloc_trace_noprof+0x11e/0x350
[ 24.183312] ? rtnl_newlink+0x2e/0x70
[ 24.183316] rtnl_newlink+0x47/0x70
[ 24.183320] rtnetlink_rcv_msg+0x152/0x400
[ 24.183324] ? __netlink_sendskb+0x68/0x90
[ 24.183329] ? netlink_unicast+0x237/0x290
[ 24.183333] ? __pfx_rtnetlink_rcv_msg+0x10/0x10
[ 24.183336] netlink_rcv_skb+0x5b/0x110
[ 24.183343] netlink_unicast+0x1a4/0x290
[ 24.183347] netlink_sendmsg+0x222/0x4a0
[ 24.183350] ? proc_get_long.constprop.0+0x116/0x210
[ 24.183358] ____sys_sendmsg+0x379/0x3b0
[ 24.183363] ? copy_msghdr_from_user+0x6d/0xb0
[ 24.183368] ___sys_sendmsg+0x86/0xe0
[ 24.183372] ? addrconf_sysctl_forward+0xf3/0x270
[ 24.183378] ? _copy_from_iter+0x8b/0x570
[ 24.183384] ? __pfx_addrconf_sysctl_forward+0x10/0x10
[ 24.183388] ? _raw_spin_unlock+0x19/0x50
[ 24.183392] ? proc_sys_call_handler+0xf3/0x2f0
[ 24.183397] ? trace_hardirqs_on+0x29/0x90
[ 24.183401] ? __fdget+0xc2/0xf0
[ 24.183405] __sys_sendmsg+0x5b/0xc0
[ 24.183410] ? syscall_trace_enter+0x110/0x1b0
[ 24.183416] do_syscall_64+0x64/0x150
[ 24.183423] entry_SYSCALL_64_after_hwframe+0x76/0x7e
I have bisected the error to this commit. Reverting it caused no new or
perceivable issues on both the MacBook and a Zen4-based laptop. Revert
this commit as a workaround.
This reverts commit aa162aa4aa383a0a714b1c36e8fcc77612ddd1a2.
Upstream report: https://bugzilla.kernel.org/show_bug.cgi?id=219390
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Bug: https://lore.kernel.org/all/b8da4aec-4cca-4eb0-ba87-5f8641aa2ca9@leemhuis.info/
Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io>
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
(cherry picked from commit 7f25237f15da1e0a469fcf3e27be202dc74444aa)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
The loongson DRM driver is known to cause boot failure or hang on certain LS7A1000-based hardware. Add a switch (`loongson.ls7a1000_support', disabled by default to help users of LS7A2000/2K2000-based hardware leverage the loongson DRM driver. For those who feel adventurous, use the `loongson.ls7a1000_support=1' parameter to enable this driver. Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Link: https://t.me/c/1109254909/605851 Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit d1503d83a088a0a2c78bbfab85a07ccfd606a5db) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Similar to 3a057bf ("platform/x86: hp-wmi: Add thermal profile support for 8BAD boards"), the HP OMEN 9 2023 (8BAB) board (China-specific model) should also be added to the list of boards handled by the OMEN thermal profiles. Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Link: https://t.me/c/1109254909/613200 Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 0330de200f255990eafb4c6d548cf3e09d622b0c) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…efault Per report from a contributor, since v6.9, ABM was set to be automatically enabled/disabled. It may have seemed like a good idea for brighter screens, but the brightness adjustment is quite abrupt, which is quite bothersome. Disable this feature by default for now. Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Link: https://t.me/c/1109254909/594612 Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 3537da5b0e0938ac2dee9b71c84510b80dd86ddb) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
The loongson DRM driver does not implement userspace acceleration, resulting in a lack of OpenGL/3D acceleration support. Loongson Technology supplies a LoongGPU driver package which ships with a more complete feature set. Users of 7A2000-based graphics are likely to get a better experience out of this driver package instead. Disable loongson driver probing by default for LS7A2000/2K2000 devices. For those who feel adventurous, use the `loongson.ls7a2000_support=1' parameter to enable this driver. Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Link: https://t.me/c/1109254909/723685 Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 319c6058c3b072ba98228d5c3a9716d3d9a9b66e) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Commit fb24ea5 ("drivers: Remove explicit invocations of mmiowb()") remove all mmiowb() in drivers, but it says: "NOTE: mmiowb() has only ever guaranteed ordering in conjunction with spin_unlock(). However, pairing each mmiowb() removal in this patch with the corresponding call to spin_unlock() is not at all trivial, so there is a small chance that this change may regress any drivers incorrectly relying on mmiowb() to order MMIO writes between CPUs using lock-free synchronisation." The mmio in radeon_ring_commit() is protected by a mutex rather than a spinlock, but in the mutex fastpath it behaves similar to spinlock and need a mmiowb() to make sure the wptr is up-to-date for hardware. Without this, we get such an error when run 'glxgears' on weak ordering architectures such as LoongArch: radeon 0000:04:00.0: ring 0 stalled for more than 10324msec radeon 0000:04:00.0: ring 3 stalled for more than 10240msec radeon 0000:04:00.0: GPU lockup (current fence id 0x000000000001f412 last fence id 0x000000000001f414 on ring 3) radeon 0000:04:00.0: GPU lockup (current fence id 0x000000000000f940 last fence id 0x000000000000f941 on ring 0) radeon 0000:04:00.0: scheduling IB failed (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn't update BO_VA (-35) radeon 0000:04:00.0: scheduling IB failed (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn't update BO_VA (-35) radeon 0000:04:00.0: scheduling IB failed (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn't update BO_VA (-35) radeon 0000:04:00.0: scheduling IB failed (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn't update BO_VA (-35) radeon 0000:04:00.0: scheduling IB failed (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn't update BO_VA (-35) radeon 0000:04:00.0: scheduling IB failed (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn't update BO_VA (-35) radeon 0000:04:00.0: scheduling IB failed (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn't update BO_VA (-35) Cc: stable@vger.kernel.org Signed-off-by: Tianyang Zhang <zhangtianyang@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Link: https://lore.kernel.org/all/20240220074958.3288170-1-chenhuacai@loongson.cn/ Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit d831ec2a8deb716bbf893e08dc172f2a7e5ea0c4) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…ACH_LOONGSON64
As mentioned in the previous patch ("LOONGARCH64: FROMLIST: drm/radeon:
Call mmiowb() at the end of radeon_ring_commit()") that attempts to fix
improper removal of all `mmiowb()' calls in commit fb24ea5 ("drivers:
Remove explicit invocations of mmiowb()"), the the wptr needs to be more
effectively updated on weak ordering architectures such as LoongArch, as
the `radeon_ring_commit()' was protected by a mutex.
To quote Huacai Chen:
"The mmio in radeon_ring_commit() is protected by a mutex rather than a
spinlock, but in the mutex fastpath it behaves similar to spinlock and
need a mmiowb() to make sure the wptr is up-to-date for hardware."
From what could be seen in arch/, `mmiowb()' is only implemented for
loongarch, mips, powerpc, riscv64, s390, and sh. With regards to the
analysis above, this hack should technically be enabled for all the
aforementioned architecture/machine with PCI support.
However, according to our testing, this hack is only needed for LoongArch
and Loongson 3 (MIPS) platforms based on the 7A bridge chip.
Limit this hack to MACH_LOONGSON64 which matches this description to
free the previous patch from a .loongarch64 suffix in AOSC OS, easing
patchset maintenance.
Fixes: "FROMLIST: drm/radeon: Call mmiowb() at the end of radeon_ring_commit()"
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Link: https://t.me/c/1109254909/768003
Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io>
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
(cherry picked from commit d7ad39a261a74fcaecc9d666a50a151a04616e82)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
The previous attempt to fix USB remote wake on Loongson 7A platforms broke S3 suspend on at least the following device(s): - Lenovo ThinkPad P14s Gen 1 (20Y1CTO1WW) Where the device would wake up immediately after entering S3 suspend. Since this fix was really only intended as a quirk for Loongson 7A platforms, guard the additional calls to `usb_enable_remote_wakeup()' and `usb_disable_remote_wakeup()' within `CONFIG_MACH_LOONGSON64', corresponding to all 64-bit Loongson platforms (unless this also breaks non-7A devices, in which case we will tighten the conditions further). Fixes: "FROMLIST: USB: core: Enable root_hub's remote wakeup for wakeup sources" Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Link: https://t.me/c/1109254909/816220 Link: https://t.me/c/1109254909/820298 Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 13be9f09b7e9ebd98c434b5b73c6237da03efff7) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
On IPASON NL38-N11 laptops, the touchpad device (a HID multitouch device
connected via I2C) uses GPIO 50 to send interrupts. Unfortunately,
gpio-loongson-64bit does not support interrupt for LS7A yet, causing the
touchpad fail to be probed with:
i2c_hid_acpi i2c-PNP0C50:00: HID over i2c has not been provided an Int IRQ
Add the offset of the GPIO_INT_EN controlling register to
loongson_gpio_ls7a_data to support the interrupt.
And, in LS7A the GPIO 4 ... 56 share the same interrupt pin, we need to
take this fact into account when calling platform_get_irq or we'd fail
with "IRQ index 50 not found."
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io>
[Mingcong Bai: Resolved a minor merge conflict since 6.18 in
drivers/gpio/gpio-loongson-64bit.c.]
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
(cherry picked from commit 431f520c70f0dc3635d5037e33b21eb1e2e28110)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
On LoongArch laptops using LG110 GPU for display, LS7A PWM3 is used for backlight brightness control. Thus we need to call pwm_add_table() so that the loonggpu driver can find the PWM for controlling the backlight. Signed-off-by: Xi Ruoyao <xry111@xry111.site> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit f493aea6884ba2368395d75d686d5f78ac8d6868) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…eads
There are certain read operations performed in this code which doesn't
really don't need its return value. Those read operations either clears
the FIFO buffer, or clears the interruption status. However, unused read
triggers compiler warnings. With CONFIG_WERROR on, these warnings get
converted into errors:
drivers/scsi/dc395x.c: In function ‘__dc395x_eh_bus_reset’:
drivers/scsi/dc395x.c:97:49: error: value computed is not used [-Werror=unused-value]
97 | #define DC395x_read8(acb,address) (u8)(inb(acb->io_port_base + (address)))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/dc395x.c:1003:9: note: in expansion of macro ‘DC395x_read8’
1003 | DC395x_read8(acb, TRM_S1040_SCSI_INTSTATUS);
| ^~~~~~~~~~~~
drivers/scsi/dc395x.c: In function ‘data_io_transfer’:
drivers/scsi/dc395x.c:97:49: error: value computed is not used [-Werror=unused-value]
97 | #define DC395x_read8(acb,address) (u8)(inb(acb->io_port_base + (address)))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/dc395x.c:2032:33: note: in expansion of macro ‘DC395x_read8’
2032 | DC395x_read8(acb, TRM_S1040_SCSI_FIFO);
Create a new macro DC395x_peek8() to deliberately cast the return value
to void, which tells the compiler we really don't need the return value
of such read operations.
Signed-off-by: Xinhui Yang <cyan@cyano.uk>
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
(cherry picked from commit ff2493fa584d247df75026d6842f5f60027a42eb)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…0/6000G On Zhaoxin KaiXian KX-6000/6000G series of processors, this crypto module causes a null pointer dereference. Zhaoxin submitted upstream an implementation update but does not specify a fix. Per our testing, blacklisting this module causes the null pointer dereference to go away. Block x86 Family 7 Model 59 for now. Link: https://lore.kernel.org/all/20250114121301.156359-1-TonyWWang-oc%40zhaoxin.com/ */ Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 2eab5747c68dff5b3f7e7f70740887b8eda51abe) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
There was a problem hiding this comment.
Sorry @opsiff, your pull request is larger than the review limit of 150000 diff characters
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Note: some of these patches are also required in the linux-6.6.y branch. |
There was a problem hiding this comment.
Pull request overview
This PR syncs a large set of downstream/stable patches (from AOSC v6.18.16) into the Deepin kernel tree, spanning platform enablement/quirks (Surface/Loongson), PCI/MSI plumbing, and multiple driver updates/new drivers.
Changes:
- Add/extend hardware support and quirks for Microsoft Surface and Loongson platforms (USB, PCI, ACPI, input, rtc, hwmon, etc.).
- Rework PCI MSI handling from a boolean
no_64bit_msito an address mask (msi_addr_mask) and add a “no shutdown” quirk path. - Update DRM/graphics subsystems (xe/ttm/ast/radeon/amdgpu) and introduce new HID drivers (IPTS/ITHC).
Reviewed changes
Copilot reviewed 159 out of 159 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| sound/soc/intel/common/soc-acpi-intel-cht-match.c | Add DMI match entry for Surface-related quirk callback. |
| sound/soc/codecs/rt5645.c | Add DMI match for OEMB Surface 3 variant platform data. |
| sound/hda/controllers/intel.c | Switch MSI restriction logic to msi_addr_mask. |
| kernel/rcu/tree.c | Simplify callback migration early-return conditions. |
| include/uapi/drm/xe_drm.h | Update query config min-alignment documentation. |
| include/linux/pci.h | Add msi_addr_mask, new dev flags, and no_shutdown; remove no_64bit_msi. |
| include/linux/mfd/tps68470.h | Add LED control register/bit definitions. |
| include/drm/ttm/ttm_device.h | Add optional dma_coherent tracking to ttm_device. |
| include/drm/ttm/ttm_caching.h | Clarify cached mapping behavior (contains a typo). |
| drivers/usb/core/quirks.c | Add Surface Go 3 Type Cover delay-init quirk. |
| drivers/usb/core/hub.c | Loongson-specific remote-wakeup handling around port suspend. |
| drivers/scsi/dc395x.c | Add “peek” reads for side-effect reads whose values are unused. |
| drivers/rtc/rtc-surface.c | New SSAM-based Surface RTC driver. |
| drivers/rtc/Makefile | Build rule for the new Surface RTC driver. |
| drivers/rtc/Kconfig | New RTC_DRV_SURFACE option (help text currently TODO). |
| drivers/platform/x86/intel/int3472/tps68470.c | Enable I2C daisy-chain + add LED cell to TPS68470 MFD. |
| drivers/platform/x86/hp/hp-wmi.c | Add/adjust board IDs for Omen thermal-profile handling. |
| drivers/platform/surface/surfacepro3_button.c | Use acpi_check_dsm() for MSHW0040 detection. |
| drivers/platform/surface/surfacebook1_dgpu_switch.c | New sysfs-based dGPU power switch driver for Surface Book 1. |
| drivers/platform/surface/surface_gpe.c | Add Surface Pro 9 (SKU match) lid GPE property mapping. |
| drivers/platform/surface/surface_aggregator_registry.c | Add Surface Laptop 7 hub ACPI ID mapping. |
| drivers/platform/surface/surface3-wmi.c | Add OEMB DMI match for Surface 3 WMI driver. |
| drivers/platform/surface/Makefile | Build rule for Surface Book 1 dGPU switch driver. |
| drivers/platform/surface/Kconfig | New SURFACE_BOOK1_DGPU_SWITCH option. |
| drivers/platform/loongarch/cpu_hwmon.c | New Loongson CPU temperature hwmon driver (sensor indices appear incorrect). |
| drivers/platform/loongarch/Makefile | Build rule for Loongson CPU hwmon driver. |
| drivers/platform/loongarch/Kconfig | New CPU_HWMON option for Loongson. |
| drivers/pci/quirks.c | Add Loongson D3/link quirk + Surface “no shutdown” DMI gating. |
| drivers/pci/probe.c | Initialize msi_addr_mask default to 64-bit. |
| drivers/pci/pci-driver.c | Add no_shutdown handling; refine probe CPU selection and kexec clear-master behavior. |
| drivers/pci/msi/pcidev_msi.c | Set MSI mask to 32-bit when device lacks 64-bit MSI capability. |
| drivers/pci/msi/msi.c | Verify MSI address fits device msi_addr_mask (instead of no_64bit_msi). |
| drivers/net/wireless/marvell/mwifiex/pcie_quirks.h | Add new quirk bits for bridge FLR / bridge D3 handling. |
| drivers/net/wireless/marvell/mwifiex/pcie_quirks.c | Enable new quirks for Surface gen4+ and add log messages (one typo). |
| drivers/net/wireless/marvell/mwifiex/pcie.c | Apply bridge D3 disable + bridge FLR (currently missing NULL checks). |
| drivers/net/wireless/ath/ath10k/core.c | Add module parameters to override board firmware files. |
| drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | Use shared PCI suspend/resume helpers. |
| drivers/net/ethernet/stmicro/stmmac/stmmac_libpci.h | New header for shared stmmac PCI helpers. |
| drivers/net/ethernet/stmicro/stmmac/stmmac_libpci.c | New shared stmmac PCI suspend/resume implementation. |
| drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | Use shared stmmac PCI helpers. |
| drivers/net/ethernet/stmicro/stmmac/Makefile | Build rule for new stmmac libpci object. |
| drivers/net/ethernet/stmicro/stmmac/Kconfig | Add STMMAC_LIBPCI and select it from PCI variants. |
| drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | Use msi_addr_mask instead of no_64bit_msi. |
| drivers/misc/mei/pci-me.c | Add ICP LP iTouch MEI device ID. |
| drivers/misc/mei/hw-me-regs.h | Define the new ICP LP iTouch device ID. |
| drivers/media/v4l2-core/v4l2-fwnode.c | Move privacy LED retrieval out of async sensor register path. |
| drivers/media/v4l2-core/v4l2-async.c | Ensure privacy LED is fetched during subdev async registration. |
| drivers/media/i2c/ov7251.c | Use V4L2_CID_ANALOGUE_GAIN instead of V4L2_CID_GAIN. |
| drivers/media/i2c/dw9719.c | Add delay after power-up to wait for device ACK. |
| drivers/leds/leds-tps68470.c | New TPS68470 LED driver (has API misuse in brightness_get and cleanup warnings). |
| drivers/leds/Makefile | Build rule for TPS68470 LED driver. |
| drivers/leds/Kconfig | Kconfig entry for TPS68470 LED driver. |
| drivers/irqchip/irq-loongson-eiointc.c | Improve IRQ affinity selection when requested CPUs aren’t in cpuspan. |
| drivers/iommu/intel/irq_remapping.c | Workaround: disable SID verification for certain Intel Touch devices (FIXME in code). |
| drivers/input/touchscreen/surface3_spi.c | Add module param + can_dma override (overwrites controller callback). |
| drivers/input/mouse/psmouse.h | Increase packet buffer size; add PixArt protocol enum. |
| drivers/input/mouse/psmouse-base.c | Add PixArt PS/2 touchpad protocol support hookup. |
| drivers/input/mouse/pixart_ps2.h | New PixArt PS/2 touchpad header. |
| drivers/input/mouse/pixart_ps2.c | New PixArt PS/2 touchpad implementation. |
| drivers/input/mouse/Makefile | Build PixArt PS/2 module object. |
| drivers/input/mouse/Kconfig | Kconfig option for PixArt PS/2 protocol extension. |
| drivers/input/misc/soc_button_array.c | Switch MSHW0040 detection to acpi_check_dsm() existence check. |
| drivers/input/keyboard/atkbd.c | Add DMI quirk match for HONOR FMB-P. |
| drivers/i2c/i2c-core-acpi.c | Add RAW_BYTES write support for ACPI GSB I2C accessor. |
| drivers/hid/ithc/ithc.h | New Intel Touch Host Controller driver header. |
| drivers/hid/ithc/ithc-regs.c | ITHC register helper implementation. |
| drivers/hid/ithc/ithc-quickspi.h | ITHC quickspi ACPI config structures/prototypes. |
| drivers/hid/ithc/ithc-legacy.h | ITHC legacy interface prototypes. |
| drivers/hid/ithc/ithc-hid.h | ITHC HID-facing data structures/prototypes. |
| drivers/hid/ithc/ithc-hid.c | ITHC HID low-level driver implementation. |
| drivers/hid/ithc/ithc-dma.h | ITHC DMA structures/prototypes. |
| drivers/hid/ithc/ithc-debug.h | ITHC debug support prototypes. |
| drivers/hid/ithc/ithc-debug.c | ITHC debugfs command interface. |
| drivers/hid/ithc/Kconfig | Kconfig entry for ITHC driver. |
| drivers/hid/ithc/Kbuild | Build rules for ITHC objects. |
| drivers/hid/ipts/thread.h | New IPTS kthread wrapper interface. |
| drivers/hid/ipts/thread.c | IPTS kthread wrapper implementation. |
| drivers/hid/ipts/spec-hid.h | IPTS HID framing definitions. |
| drivers/hid/ipts/spec-data.h | IPTS data/feedback protocol definitions. |
| drivers/hid/ipts/resources.h | IPTS DMA resource allocation interface. |
| drivers/hid/ipts/resources.c | IPTS DMA resource allocation implementation. |
| drivers/hid/ipts/receiver.h | IPTS receiver loop interface. |
| drivers/hid/ipts/receiver.c | IPTS receiver (event/poll) loops. |
| drivers/hid/ipts/mei.h | IPTS MEI transport interface. |
| drivers/hid/ipts/mei.c | IPTS MEI transport implementation. |
| drivers/hid/ipts/main.c | IPTS MEI client driver entry points. |
| drivers/hid/ipts/hid.h | IPTS HID low-level interface. |
| drivers/hid/ipts/hid.c | IPTS HID device implementation. |
| drivers/hid/ipts/eds2.h | IPTS EDS2 interface. |
| drivers/hid/ipts/eds2.c | IPTS EDS2 implementation. |
| drivers/hid/ipts/eds1.h | IPTS EDS1 interface. |
| drivers/hid/ipts/eds1.c | IPTS EDS1 implementation. |
| drivers/hid/ipts/desc.h | IPTS HID descriptors and constants. |
| drivers/hid/ipts/control.h | IPTS control path interface. |
| drivers/hid/ipts/context.h | IPTS context structure definition. |
| drivers/hid/ipts/cmd.h | IPTS command send/receive interface. |
| drivers/hid/ipts/cmd.c | IPTS command send/receive implementation. |
| drivers/hid/ipts/Makefile | Build rules for IPTS driver. |
| drivers/hid/ipts/Kconfig | Kconfig entry for IPTS driver. |
| drivers/hid/Makefile | Hook IPTS/ITHC into HID build. |
| drivers/hid/Kconfig | Hook IPTS/ITHC into HID Kconfig. |
| drivers/gpu/drm/xe/xe_query.c | Use PAGE_SIZE/SZ_4K logic for min alignment reporting. |
| drivers/gpu/drm/xe/xe_migrate.c | Use XE PTE mask/4K stepping to support non-4K PAGE_SIZE. |
| drivers/gpu/drm/xe/xe_guc_pc.c | Replace PAGE_ALIGN with 4K ALIGN in GuC PC allocations. |
| drivers/gpu/drm/xe/xe_guc_log.c | Replace PAGE_SIZE usage with SZ_4K in GuC log sizing/offsets. |
| drivers/gpu/drm/xe/xe_guc_ct.c | Assert GuC CT size aligned to SZ_4K. |
| drivers/gpu/drm/xe/xe_guc_capture.c | Replace PAGE_ALIGN/PAGE_SIZE with 4K ALIGN/SZ_4K in capture sizing. |
| drivers/gpu/drm/xe/xe_guc_ads.c | Replace PAGE_ALIGN/PAGE_SIZE with 4K ALIGN/SZ_4K across ADS layout. |
| drivers/gpu/drm/xe/xe_guc.c | Use XE_PTE_SHIFT instead of PAGE_SHIFT for GGTT addresses. |
| drivers/gpu/drm/xe/xe_bo.c | Align GEM size to aligned_size for consistency. |
| drivers/gpu/drm/xe/regs/xe_engine_regs.h | Use SZ_4K for ring size encoding. |
| drivers/gpu/drm/xe/Kconfig | Drop PAGE_SIZE_4KB dependency. |
| drivers/gpu/drm/ttm/ttm_tt.c | Downgrade cached mapping for non-snooping devices when needed. |
| drivers/gpu/drm/ttm/ttm_device.c | Propagate dev->dma_coherent into ttm_device (when supported). |
| drivers/gpu/drm/ttm/ttm_bo_util.c | Downgrade cached mapping for non-snooping devices in io prot. |
| drivers/gpu/drm/radeon/radeon_ring.c | Add Loongson-specific mmiowb() after ring wptr write. |
| drivers/gpu/drm/radeon/radeon_irq_kms.c | Remove old 32-bit MSI limiting; now uses msi addr mask elsewhere. |
| drivers/gpu/drm/radeon/radeon_drv.c | Change SI/CIK default support toggles and descriptions. |
| drivers/gpu/drm/radeon/radeon_device.c | Set msi_addr_mask based on dma_bits. |
| drivers/gpu/drm/loongson/lsdc_drv.c | Gate LS7A1000/LS7A2000 support behind module params. |
| drivers/gpu/drm/loongson/loongson_module.h | Export new Loongson support toggles. |
| drivers/gpu/drm/loongson/loongson_module.c | Add module params to enable LS7A1000/LS7A2000 support. |
| drivers/gpu/drm/ast/ast_mode.c | Add VRAM helper path vs SHMEM path; adjust plane behavior. |
| drivers/gpu/drm/ast/ast_mm.c | Use VRAM helper init when not using shmem. |
| drivers/gpu/drm/ast/ast_drv.h | Add iosys_map/VRAM object fields + shmem selector. |
| drivers/gpu/drm/ast/ast_drv.c | Add shmem module param and switch driver ops accordingly. |
| drivers/gpu/drm/ast/ast_cursor.c | Cursor allocation/mapping changes for VRAM helper mode. |
| drivers/gpu/drm/ast/Kconfig | Select TTM/VRAM helper dependencies. |
| drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c | Wrap override call with DC_FP_START/END. |
| drivers/gpu/drm/amd/amdkfd/Kconfig | Disable SVM on LOONGARCH/ARM64. |
| drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | Adjust SI/CIK support param defaults + ABM default. |
| drivers/gpio/gpio-loongson-64bit.c | LS7A GPIO handling tweaks and set gc.base = -1. |
| drivers/firmware/sysfb.c | Change initcall level to fs_initcall. |
| drivers/crypto/padlock-sha.c | Blacklist module on specific Zhaoxin CPU model. |
| drivers/bluetooth/btusb.c | Add quirk to lower LE scan interval/window for Marvell device. |
| drivers/acpi/scan.c | Skip enumeration when device not ready; call new LS7A PWM init hook. |
| drivers/acpi/pci_root.c | Add alignment checks for IO remap ranges and improve error reporting. |
| drivers/acpi/loongarch/acpi-ls7a-backlight.c | New LS7A PWM lookup handler for Loongson backlight. |
| drivers/acpi/loongarch/Makefile | Build rule for Loongarch ACPI additions. |
| drivers/acpi/internal.h | Add acpi_ls7a_pwm_init() declaration/stub. |
| drivers/acpi/acpi_tad.c | Split sysfs groups and gate AC wake attrs by capability. |
| drivers/acpi/Makefile | Add loongarch/ ACPI directory. |
| arch/x86/kernel/acpi/boot.c | Add Surface Laptop 4 IRQ override quirk. |
| arch/powerpc/platforms/pseries/msi.c | Switch to msi_addr_mask for 32-bit MSI selection. |
| arch/powerpc/platforms/powernv/pci-ioda.c | Switch to msi_addr_mask for 32-bit MSI selection. |
| arch/loongarch/kvm/vm.c | Add support_features handling and init helper. |
| arch/loongarch/kernel/smp.c | Fix package assignment when PPTT enabled. |
| arch/loongarch/kernel/acpi.c | Add package topology parsing from PPTT. |
| arch/loongarch/include/asm/loongarch.h | Add CSR_GCFG GPMP bit definition. |
| arch/loongarch/include/asm/kvm_host.h | Add support_features + helper kvm_vm_support(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * devices snoop the CPU cache on accesses. Downgraded to | ||
| * ttm_write_combined when the snooping capaiblity is missing. |
There was a problem hiding this comment.
Typo in the comment: "capaiblity" should be "capability".
| static SENSOR_DEVICE_ATTR(temp5_input, 0444, get_cpu_temp, NULL, 4); | ||
| static SENSOR_DEVICE_ATTR(temp5_label, 0444, cpu_temp_label, NULL, 4); | ||
| static SENSOR_DEVICE_ATTR(temp6_input, 0444, get_cpu_temp, NULL, 4); | ||
| static SENSOR_DEVICE_ATTR(temp6_label, 0444, cpu_temp_label, NULL, 4); | ||
| static SENSOR_DEVICE_ATTR(temp7_input, 0444, get_cpu_temp, NULL, 4); | ||
| static SENSOR_DEVICE_ATTR(temp7_label, 0444, cpu_temp_label, NULL, 4); | ||
| static SENSOR_DEVICE_ATTR(temp8_input, 0444, get_cpu_temp, NULL, 4); | ||
| static SENSOR_DEVICE_ATTR(temp8_label, 0444, cpu_temp_label, NULL, 4); |
There was a problem hiding this comment.
Several SENSOR_DEVICE_ATTR() definitions use the same index value (4) for temp5..temp16, so reads will all map to the same CPU/package and labels will be wrong. Each tempN_* attribute should use a matching index N so get_cpu_temp()/cpu_temp_label() pick the right sensor.
| ret = regmap_read(regmap, TPS68470_REG_ILEDCTL, &value); | ||
| if (ret) | ||
| return dev_err_probe(led_cdev->dev, -EINVAL, "failed on reading register\n"); | ||
|
|
||
| switch (led->led_id) { |
There was a problem hiding this comment.
tps68470_brightness_get() returns dev_err_probe(...) on regmap_read failure, but the callback return type is enum led_brightness. Returning a negative errno here will be interpreted as a brightness value. Please log the error and return a valid brightness (e.g., LED_OFF) or change error handling to fit the LED API expectations.
| err_exit: | ||
| if (ret) { | ||
| for (i = 0; i < TPS68470_NUM_LEDS; i++) { | ||
| if (tps68470->leds[i].lcdev.name) | ||
| devm_led_classdev_unregister(&pdev->dev, | ||
| &tps68470->leds[i].lcdev); | ||
| } | ||
| } |
There was a problem hiding this comment.
The error cleanup calls devm_led_classdev_unregister() for any LED with lcdev.name set, but that doesn't guarantee the classdev was successfully registered. This can trigger warnings via devres_release() when unregistering an unregistered LED. Track how many LEDs were actually registered (or rely on devm cleanup) and only unregister those.
| config RTC_DRV_SURFACE | ||
| tristate "Microsoft Surface Aggregator RTC" | ||
| depends on SURFACE_AGGREGATOR | ||
| depends on SURFACE_AGGREGATOR_BUS | ||
| help | ||
| TODO | ||
|
|
There was a problem hiding this comment.
Kconfig help text is left as "TODO". This should describe what hardware this RTC driver supports and any important behavior/limitations, consistent with other RTC driver entries.
| struct pci_dev *pdev = card->dev; | ||
| struct pci_dev *parent_pdev = pci_upstream_bridge(pdev); | ||
| const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; | ||
| int tx_wrap = card->txbd_wrptr & reg->tx_wrap_mask; | ||
|
|
||
| /* Trigger a function level reset of the PCI bridge device, this makes | ||
| * the firmware of PCIe 88W8897 cards stop reporting a fixed LTR value | ||
| * that prevents the system from entering package C10 and S0ix powersaving | ||
| * states. | ||
| * We need to do it here because it must happen after firmware | ||
| * initialization and this function is called after that is done. | ||
| */ | ||
| if (card->quirks & QUIRK_DO_FLR_ON_BRIDGE) | ||
| pci_reset_function(parent_pdev); | ||
|
|
There was a problem hiding this comment.
pci_upstream_bridge(pdev) may return NULL; calling pci_reset_function(parent_pdev) without checking can dereference NULL. Also, pci_reset_function() returns an error code that should be handled/logged so failures don't silently change behavior.
| bool use_dma = false; | ||
| module_param(use_dma, bool, 0644); | ||
| MODULE_PARM_DESC(use_dma, | ||
| "Disable DMA mode if you encounter touch input crash. " | ||
| "(default: false, disabled to avoid crash)"); | ||
|
|
There was a problem hiding this comment.
The module parameter use_dma should be static to avoid exporting a global symbol, and the parameter description is misleading: it says "Disable DMA mode" while the variable name/behavior is "use_dma" and defaults to false (DMA already disabled). Please make the symbol static and reword the description to match the actual semantics (e.g., "Enable DMA mode...").
| /* | ||
| * Set up DMA | ||
| * | ||
| * TODO: Currently, touch input with DMA seems to be broken. | ||
| * On 4.19 LTS, touch input will crash after suspend. | ||
| * On recent stable kernel (at least after 5.1), touch input will crash after | ||
| * the first touch. No problem with PIO on those kernels. | ||
| * Maybe we need to configure DMA here. | ||
| * | ||
| * Link to issue: https://github.com/jakeday/linux-surface/issues/596 | ||
| */ | ||
| spi->controller->can_dma = surface3_spi_can_dma; | ||
|
|
There was a problem hiding this comment.
Assigning spi->controller->can_dma in this device driver's probe mutates the controller for all devices on that SPI controller and can break other SPI clients. This should be handled in the SPI controller driver (or, at minimum, avoid overwriting an existing can_dma implementation and restore it on remove).
| if (!value) | ||
| return 0; | ||
|
|
||
| status = sb1_dgpu_sw_dsmcall(); | ||
|
|
||
| return status < 0 ? status : len; | ||
| } |
There was a problem hiding this comment.
Sysfs .store callbacks are expected to return the number of bytes consumed (len) on success. Returning 0 when the user writes "0" will look like a short write. Consider returning len for the no-op case as well.
| /* | ||
| * AC driver for 7th-generation Microsoft Surface devices via Surface System | ||
| * Aggregator Module (SSAM). | ||
| * |
There was a problem hiding this comment.
The file header comment says "AC driver" but this is an RTC driver. Please update the comment to match the actual driver purpose to avoid confusion in reviews/bug reports.
No description provided.