sync: SG204X/TH1520/K1/K3 v7.0.y patchset#29
Open
RevySR wants to merge 521 commits into
Open
Conversation
…ctor and i2s1_sysclk_src IDs Add three new clock IDs to expose clocks introduced by the topology fix: - CLK_MPMU_I2S_SYSCLK (51): the common i2s sysclk DDN at MPMU_ISCCR1 - CLK_MPMU_I2S_BCLK_FACTOR (52): the implicit /2 factor feeding i2s_bclk - CLK_MPMU_I2S1_SYSCLK_SRC (53): the dedicated i2s1 sysclk source mux CLK_MPMU_I2S1_SYSCLK keeps its existing ID (47) but will be repointed to the real per-instance i2s1 clock in a subsequent patch. No in-tree user references this ID so the semantic change is contained. Fixes: efe897b ("dt-bindings: soc: spacemit: k3: add clock support") Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Link: https://lore.kernel.org/r/20260717-k3-clk-fix-i2s-v1-1-e95001a692ee@linux.spacemit.com Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
The K3 i2s clocks were modelled as a single path behind one MPMU
register:
pll1_d96_25p6 / i2s_153p6_base
`-- i2s_sysclk_src (mux+gate, MPMU_ISCCR)
`-- i2s1_sysclk (DDN, MPMU_ISCCR)
|-- i2s_bclk (div+gate, MPMU_ISCCR)
`-- i2s2_sysclk (mux, parent 0)
The hardware actually has two i2s clock control registers, ISCCR0
(0x0040) and ISCCR1 (0x0044): ISCCR1 drives the common sysclk shared
by i2s0/2/3/4/5 and the common bclk, whose divider always implies a
fixed 1/2 factor in front, while ISCCR0 drives a dedicated path for
i2s1:
pll1_d96_25p6 / i2s_153p6_base
|-- i2s_sysclk_src (mux+gate, MPMU_ISCCR1)
| `-- i2s_sysclk (DDN, MPMU_ISCCR1)
| |-- i2s_bclk_factor (fixed factor, /2)
| | `-- i2s_bclk (div+gate, MPMU_ISCCR1)
| `-- i2s2_sysclk (mux, parent 0)
`-- i2s1_sysclk_src (mux+gate, MPMU_ISCCR0)
`-- i2s1_sysclk (DDN, MPMU_ISCCR0)
Because of this mismatch, i2s_bclk reported twice the real rate, and
the dedicated i2s1 clock path could not be described in DT at all.
Model the tree as above: split the MPMU_ISCCR register macro into
MPMU_ISCCR0 and MPMU_ISCCR1 to match the hardware register names,
rename the common DDN to i2s_sysclk, insert the fixed 1/2 factor
i2s_bclk_factor in front of i2s_bclk, and add the i2s1_sysclk_src mux
and i2s1_sysclk DDN backed by MPMU_ISCCR0. CLK_MPMU_I2S1_SYSCLK now
refers to the dedicated i2s1 clock; no in-tree user references this
ID, so nothing is affected by the change of meaning.
Fixes: e371a77 ("clk: spacemit: k3: add the clock tree")
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Link: https://lore.kernel.org/r/20260717-k3-clk-fix-i2s-v1-2-e95001a692ee@linux.spacemit.com
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
…ders
The i2s{0,2,3,4,5}_sysclk_div DDNs have an additional fixed 1/2
divider in the hardware IP after the configurable divider, so the
real output rate is:
rate = parent_rate * num / (den * 2)
Set pre_div to 2 to account for it.
Fixes: e371a77 ("clk: spacemit: k3: add the clock tree")
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Link: https://lore.kernel.org/r/20260717-k3-clk-fix-i2s-v1-3-e95001a692ee@linux.spacemit.com
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
The SpacemiT K3 Pico-ITX requires RFKILL_GPIO to enable Bluetooth and WLAN. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Link: https://lore.kernel.org/r/20260716213314.3027969-2-aurelien@aurel32.net Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
…Pico-ITX board On the K3 PICO-ITX board, by default the GPIO pin that connects to the RTL8852BE Bluetooth enable signal is driven low, resulting in impossibility to use Bluetooth. Add a DT node to expose it as an RFKILL device, which lets the Bluetooth driver or userspace toggle it as required. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Link: https://lore.kernel.org/r/20260716213314.3027969-3-aurelien@aurel32.net Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
…Pico-ITX board The SpacemiT K3 has 4 USB3 controllers labelled A to D. On the K3 Pico-ITX board, the controllers B and C are used in USB 2 mode only respectively for the M.2 B-Key slot and for the RTL8852BE Bluetooth controller. Add the two controller nodes and the two corresponding USB2 PHY nodes (the PCIe/USB3 combo PHY driver is not yet merged) and enable them on the K3 Pico-ITX board. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Link: https://lore.kernel.org/r/20260716213314.3027969-4-aurelien@aurel32.net Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
…ITX board By default the GPIO pin that connects to the RTL8852BE WLAN enable signal is driven low, resulting in impossibility to connect to any network. Add a DT node to expose it as an RFKILL device, which lets the WiFi driver or userspace toggle it as required. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Link: https://lore.kernel.org/r/20260716213314.3027969-5-aurelien@aurel32.net Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
RISC-V randconfig can enable NUMA balancing while selecting SPARSEMEM_EXTREME without SPARSEMEM_VMEMMAP. In that layout, the section and node fields can consume enough page flag bits that LAST_CPUPID cannot fit in page->flags. The generic MM code then stores last_cpupid in struct page and emits the "Unfortunate NUMA and NUMA Balancing config" warning from mm/memory.c. NUMA balancing needs LAST_CPUPID storage, but this fallback grows struct page for a configuration that randconfig can select accidentally. Keep NUMA support available, but advertise RISC-V NUMA balancing support only when SPARSEMEM_VMEMMAP is enabled, where the page flag layout leaves room for LAST_CPUPID. This was originally seen with a RISC-V randconfig generated from KCONFIG_SEED=550012. Signed-off-by: Jia Wang <wangjia@ultrarisc.com> Link: https://lore.kernel.org/r/20260716-numa_kconfig-v1-1-b0cd6d29accb@ultrarisc.com Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
…cles_hi() __iomem is missing while calling readl_relaxed() in get_cycles() and get_cycles_hi() and sparse complains. Add __iomem to silence the sparse warnings. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202607160619.14G8GHp5-lkp@intel.com/ Signed-off-by: Nam Cao <namcao@linutronix.de> Link: https://lore.kernel.org/r/20260716053319.2178937-1-namcao@linutronix.de Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
Move the vendor and device ID for the existing Spacemit K1 PCIe Root Complex to include/linux/pci_ids.h. Also add K3's Root Complex device ID to this header. This is done so that these values can be referenced in the rtw89 driver to enable 36-bit DMA ability in it for WiFi to function on the K3 Pico ITX board. Acked-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com> Link: https://lore.kernel.org/r/20260716-rtw89-spacemit-k3-v2-1-392b577ebf75@oss.tenstorrent.com Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
The Spacemit K3 Pico ITX Board has a RTL8852BE pcie card behind a PCIe root port, but the SoC doesn't have any 32 bit DMA addreseses which the rtw89 seems to use by default. Enable 36 bit DMA ability that the driver has when this particular root port is detected so that the driver can probe on this SoC. Tested-by: Aurelien Jarno <aurelien@aurel32.net> Acked-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com> Link: https://lore.kernel.org/r/20260716-rtw89-spacemit-k3-v2-2-392b577ebf75@oss.tenstorrent.com Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
Instead of adding these to -march globally, use .option arch to use
instructions from these extensions only in code paths where we know they
are available, like how it is done for most other extensions.
TOOLCHAIN_HAS_{ZACAS,ZABHA} already depend on AS_HAS_OPTION_ARCH, so
this is not a functionality regression even on older assemblers.
Although the compiler is unlikely to generate atomics on its own accord,
this aligns handling of Zacas and Zabha with most other extensions and
improves consistency on how assembly code requiring extra extensions is
written in kernel code.
This is analogous to the use of __LSE_PREAMBLE or .arch_extension lse in
arm64 code.
Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
Link: https://lore.kernel.org/r/20260717-riscv-no-zacas-zabha-in-march-v1-1-82b5b0799fb6@iscas.ac.cn
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
The hwprobe vDSO data is populated by the first riscv_hwprobe syscall. Some values, such as MISALIGNED_VECTOR_PERF, may depend on the async vector unaligned access speed probe registered by check_unaligned_access_all_cpus(). That initcall currently runs at late_initcall level. However, rootfs_initcall enables usermode helpers before late initcalls run, so an early helper can execute userspace and call riscv_hwprobe first. In that case complete_hwprobe_vdso_data() consumes the initial pending_boot_probes reference, populates the vDSO cache, and marks it ready before the later async probe is registered. The eventual probe result then cannot update the already-ready cache. Move check_unaligned_access_all_cpus() to fs_initcall_sync. This still runs after clocksource_done_booting(), so the ktime_get_mono_fast_ns() benchmark uses a stable clocksource, but it runs before rootfs_initcall enables usermode helpers. Any async hwprobe probe is therefore registered before userspace can trigger the one-time vDSO cache population. Fixes: 6455c6c ("riscv: Clean up & optimize unaligned scalar access probe") Signed-off-by: Rui Qi <qirui.001@bytedance.com> Link: https://lore.kernel.org/r/20260721150511.1607105-1-qirui.001@bytedance.com Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
This patch improves the RISC-V strnlen implementation: - Add explicit fallback to generic path when count == SIZE_MAX, avoiding minu instruction misbehavior. - Add overflow check for (s + count), ensuring safe fallback when address addition wraps around. - Refactor aligned boundary calculation to use (s + count - 1), preventing word loads beyond the valid range. - Add fast exit when all remaining bytes are within the first word. - Simplify generic path loop with clearer pointer/count handling. These changes fix potential off-by-one, overflow, and extreme input bugs, while keeping ZBB optimization for normal cases. Fixes: 5ba15d4 ("riscv: lib: add strnlen() implementation") Signed-off-by: Gao Rui <gao.rui@zte.com.cn> Link: https://lore.kernel.org/r/20260722064037.1111467-2-gao.rui@zte.com.cn Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
Extend string_test_strnlen to validate strnlen behavior with SIZE_MAX input: - Add explicit test case for strnlen(s, SIZE_MAX). - Ensure fallback to generic path returns correct length when string has no NUL terminator. - Complements existing tests for non-terminated strings and boundary conditions. This improves KUnit coverage for extreme inputs and verifies the correctness of the new fallback logic in strnlen.S. Signed-off-by: Gao Rui <gao.rui@zte.com.cn> Link: https://lore.kernel.org/r/20260722064037.1111467-3-gao.rui@zte.com.cn Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
In commit bc73905 ("[SCSI] lpfc 8.3.16: SLI Additions, updates, and code cleanup"), lpfc_memcpy_to_slim() have switched memcpy_toio() to __write32_copy() in order to prevent unaligned 64 bit copy. Recently, we found that lpfc_memcpy_from_slim() have similar issues, so let it switch memcpy_fromio() to __read32_copy(). As maintainer says, it seems that we can hardly see a real "unaligned 64 bit copy", but this patch is still useful. Because in our tests we found that lpfc doesn't support 128 bit access, but some optimized memcpy() use 128 bit access (at lease on Loongson). Cc: stable@vger.kernel.org Signed-off-by: Huacai Chen <chenhc@lemote.com> Signed-off-by: James Smart <james.smart@broadcom.com> Link: https://lore.kernel.org/all/1545208274-13736-1-git-send-email-chenhc@lemote.com/ Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
…ngson-3 Add madd.s/madd.d/msub.s/msub.d/nmadd.s/nmadd.d/nmsub.s/nmsub.d emulation for Loongson-3. MIPS R2 suggest these instructions be unfused, but Loongson-3 suggest these instructions be fused, which is similar to maddf/msubf in MIPS R6. Signed-off-by: Huacai Chen <chenhc@lemote.com> Signed-off-by: Pei Huang <huangpei@loongson.cn> Link: https://lore.kernel.org/all/1549454594-9056-1-git-send-email-chenhc@lemote.com/ Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
…e human-readable In /proc/cpuinfo, we keep "cpu model" as is, since GCC should use it for -march=native. Besides, we add __cpu_full_name[] to describe the processor in a more human-readable manner. The full name is displayed as "model name" in cpuinfo, which is needed by some userspace tools such as "lscpu" and "gnome-system-monitor". The CPU frequency in "model name" is the default value (highest), and there is also a "CPU MHz" whose value can be changed by cpufreq. This is only used by Loongson now (ICT is dropped in cpu name, and cpu name can be overwritten by BIOS). Why drop ICT? At the beginning, Loongson is designed by ICT, but now all Loongson processors is designed by "Loongson Technology Corporation Limited" which is independent from ICT. We have search the code in https://codesearch.debian.net/, and the result is: 1, GCC searches the "cpu model" in cpuinfo, but it only matches "Loongson-2 V0.2" and so on, so drop "ICT" is comfortable; 2, Debian Installer searches the "cpu model" in cpuinfo and matches "ICT Loongson", but Yunqiang Su is modifying the code; 3, Valgrind searches the "cpu model" in cpuinfo and matches "ICT Loongson", and we are planning to fix it up. Signed-off-by: Huacai Chen <chenhc@lemote.com> Link: https://lore.kernel.org/all/1584006053-28887-1-git-send-email-chenhc@lemote.com/ [Kexy: Resolved minor conflicts in arch/mips/kernel/cpu-probe.c, arch/mips/loongson64/env.c, and arch/mips/loongson64/smp.c] Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
The EBase registers of old Loongson processor models before 3A2000 are 32bit and have no WG bit; those of newer models are 64bit and do have the WG bit. Unfortunately, dynamically allocated EBase addresses do not work well for the Loongson platform, because Loongson's memory layout is very limited below 0x20000000. The dynamically allocated EBase address above 0x20000000 is thus unmappable to a KSEG0/KSEG1 virtual address, but the cache error handler MUST be in KSEG1 (please see set_uncached_handler() in traps.c). Some might suggest that the cache error handler is hardly used so this is not a problem, but Loongson's MMIO configuration registers might be corrupted by set_uncached_handler(). To make Linux kernel on Loongson more robust, a board_ebase_setup() hook is added to ensure CKSEG0 is always used for EBase. This is also useful for configurations where firmware-provided EBase is not sane. Maybe this problem is present for all MIPSr2 processors, but it seems not all platforms have memory at physical address 0. So this patch only touches Loongson. Signed-off-by: Huacai Chen <chenhc@lemote.com> Link: https://lore.kernel.org/all/1584006117-28985-1-git-send-email-chenhc@lemote.com/ Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
NUMA node distances affect the NUMA balancing behaviors. The cost of cross-package memory access is very high, and our benchmarks show that 200 is a more appropriate value than 100 (for cross-package numa node distance) on Loongson64 platforms, so enlarge it. Signed-off-by: Huacai Chen <chenhc@lemote.com> Link: https://lore.kernel.org/all/1604201638-4001-3-git-send-email-chenhc@lemote.com/ Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
…d is modifying
When user-space program accessing a virtual address and falls into TLB invalid
exception handling. at almost the same time, if the pmd which that contains this
virtual address is hit by THP scanning, and then a invalid address access may
occurs in the tlb handler:
CPU 0: (userspace) | CPU 1: (khugepaged)
1: | scan hit: set pmde to invalid_pmd_table
| (by pmd_clear)
2: handle_tlbl(tlb invalid): |
load pmde for huge page testing, |
pmde doesn't contains _PAGE_HUGE |
bit |
3: | collapsed: set pmde to huge page format
4: handle_tlbl(normal page case): |
load pmde again as base address, |
pmde doesn't contains an address, |
access invalid address |
This patch avoids the inconsistency of two memory loads by reusing the result
of one load.
Signed-off-by: wangrui <wangrui@loongson.cn>
Link: https://lore.kernel.org/all/20210212082058.40792-1-wangrui@loongson.cn/
Link: https://lore.kernel.org/all/CAAhV-H5a6f7SSaMfOJudFuqtzLqkDks_NkjsPe15gN3mJTGBDw@mail.gmail.com/
[Kexy: Resolved minor conflict in arch/mips/mm/tlbex.c]
Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io>
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
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>
… 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>
Radeon driver can not handle the interrupt is faster than DMA data, so irq handler must update an old ih.rptr value in IH_RB_RPTR register to enable interrupt again when interrupt is faster than DMA data. Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Zhijie Zhang <zhangzhijie@loongson.cn> Link: chenhuacai/linux@6266d00 Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
As instructed for testing. Upstreamable patch pending. Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
This patch adds supoort for the Phytium SoC family. Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn> Change-Id: Ibe06dc2e54a413a8c1257fef3aade99e6ca6480f Link: https://gitee.com/phytium_embedded/phytium-linux-kernel/commit/154f8e5d365d57d38ad6fabc230861c9643db154 [Kexy: Resolved minor conflict in arch/arm64/Kconfig.platforms] Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Update pci_ids.h with the vendor ID for Phytium. Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn> Change-Id: Ie0ea6afa71a8ba2f66f8426c1db063cd734d985c Link: https://gitee.com/phytium_embedded/phytium-linux-kernel/commit/b570810d41c9cb46f05c31b51d156c6b4441486a Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
This patch adds support for Phytium GMAC controller which derived from Synopsys Designware MAC 10/100/1000 Universal. As required by SBBR, ACPI DSDT is supported as well as device tree. Signed-off-by: Li Wencheng <liwencheng@phytium.com.cn> Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn> Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn> Change-Id: Id72b75c7a398c98b94df07ae92d7aa72bdc4d8ad Link: https://gitee.com/phytium_embedded/phytium-linux-kernel/commit/bf64fd4ae38b9dee89dfe8b17b79a50eec56961e [Kexy: Resolved minor conflict in MAINTAINERS] Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> [Icenowy: Remove lpi_irq reference] Signed-off-by: Icenowy Zheng <uwu@icenowy.me> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> [ Mingcong Bai: Resolved a minor post-7.0 merge conflict in drivers/net/ethernet/stmicro/stmmac/Kconfig drivers/net/ethernet/stmicro/stmmac/Makefile ] Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
LS2K/LS7A chipsets are also found on some MIPS-based Loongson hardware, allow building for 32-bit (2K) and 64-bit (3A/B) hardware. Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Optimize this driver conditionally for MIPS-based Loongson 3 (CPU_LOONGSON64): - Reduce queue depth of SAS disks for MIPS-based Loongson 3. - Reduce granularity and timeout value of interrupt coalescing for MIPS- based Loongson 3. Also include an optimisation: - Use bidirectional DMA for SMP request/response. This is a partial patch from the Lemote v5.4 tree, "mvsas: Optimise performance and stability", stripping out the part about "Use cyclic searching to alloc command slot" as SCSI command tag allocation for this driver was extensively revised with commit 2acf97f ("scsi: mvsas: Use sas_task_find_rq() for tagging"). Not sure if this optimization would still be worthwhile to port over. Also, since CPU_LOONGSON64 is also defined for LoongArch processors, add additionally an ifdef condition for CONFIG_MIPS to ensure that quirk code only applied to MIPS && CPU_LOONGSON64 targets. As a side note, `sas_slave_configure()' was renamed to `sas_device_configure()' in commit a25a9c8 ("scsi: libata: Switch to using ->device_configure"), so I revised the invocations and function namings from the original patch accordingly (`mvs_slave_configure()' => `mvs_device_configure()'). This commit also introduces and additional argument for queue limits to the `sas_device_configure()' function, so revise accordingly. Signed-off-by: Huacai Chen <chenhc@lemote.com> Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Following upstream name changes; Also move the struct domain_device inside the ifdef to avoid unused variables. Fixes: 47c2e30 ("scsi: Rename .device_configure() into .sdev_configure()") Fixes: "AOSCOS: mvsas: Optimise performance and stability on CPU_LOONGSON64" Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Xinhui Yang <cyan@cyano.uk> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
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>
…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>
…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>
…GET is undefined" This reverts "FROMLIST: rust: generate a fatal error if BINDGEN_TARGET is undefined" as it breaks build on architectures that do not HAVE_RUST. Link: https://lore.kernel.org/all/6bd26802-e3ce-43e2-b28d-f23e13492458@aosc.io/ Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
HWR $30 (Loongson64 constant timer) is 64 bits wide. However, vDSO uses `unsigned long' to read the timer count, which leads to frozen time (delta ~= 3s) when O32/N32 userspace programs request HRES time. For N32, using `u64' instead of `unsigned long' fixes the issue. The issue becomes trickier on O32. RDHWR never sign-extends the timer count before copying it into a GPR, as the kernel always sets Status.UX=1 even in O32 userspace. Aside from the frozen time, the "shadow" on the upper half also breaks subsequent logical/branch instructions relying on the GPR. Thankfully, Status.UX==1 also means that we have the full timer count available and can use 64-bit instructions to salvage it into a pair of GPR to comply with O32 ABI. Utilize (abuse?) this fact to salvage the full timer count in O32 vDSO. Fixes: "AOSCOS: MIPS: Loongson: Add constant timer support" Signed-off-by: Rong Zhang <i@rong.moe> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Add gpio hogs subnode rules to the MT8188 pinctrl binding. Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn> Signed-off-by: Icenowy Zheng <uwu@icenowy.me> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
The mainline pcie-mediatek-gen3 driver does not have code managing downstream device power / reset. As the Wi-Fi card on ciri is a fixed device, set the related regulator to always-on and use GPIO hog to set the status of its reset pin. Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn> Signed-off-by: Icenowy Zheng <uwu@icenowy.me> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Despite the Ciri device's touchpad is on the detachable keyboard, the I2C HID device seen by Linux is emulated by ChromeOS EC and always present regardless of the presence of physical touchpad. Enable the device in the device tree. Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn> Signed-off-by: Icenowy Zheng <uwu@icenowy.me> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
The following functions were never declared nor used by anything other than the Device Tree Overlay's ConfigFS interface. Mark them as static to resolve a few `-Werror=missing-prototypes' errors (CONFIG_WERROR). - fdt_translate_address() - ssize_t cfs_overlay_item_dtbo_read() - ssize_t cfs_overlay_item_dtbo_write() Fixes: "ARMBIAN: drv:of: Device Tree Overlay ConfigFS interface" Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
…pecification
When building with CONFIG_WERROR:
drivers/platform/x86/intel/int3472/discrete.c:385:44: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Werror=format=]
385 | dev_info(int3472->dev, " con_id=%s, flags=0x%x\n", con_id, gpio_flags);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Correct the number conversation specification as `%lx'.
Fixes: "BACKPORT: SURFACE: Add camera support for Surface Pro 9"
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
When building with CONFIG_WERROR:
drivers/platform/x86/intel/int3472/discrete.c:391:47: error: too many arguments for format [-Werror=format-extra-args]
391 | dev_err(int3472->dev, "Failed to register type 0x02x: %d\n", type, ret);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove the unused `type' argument to fix build.
Fixes: "BACKPORT: SURFACE: Add camera support for Surface Pro 9"
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
…nd Panel Replay There has been a lot of report about freezing displays on laptops, especially on those based on RDNA 2/3/4 architectures. These features are probably more trouble than they are worth, so disable them by default. Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
With commit 09033be ("mei: me: use PCI_DEVICE_DATA macro"), calls to the `MEI_PCI_DEVICE' macro were replaced with `PCI_DEVICE_DATA'. Convert entries added by linux-surface patches to fix build. Fixes: "BACKPORT: SURFACE: mei: me: Add Icelake device ID for iTouch" Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Similar to commit b929926 ("sh: define __BIG_ENDIAN for math-emu"), define __LITTLE_ENDIAN and __BIG_ENDIAN as 0 to mitigate build-time warnings: ./include/math-emu/double.h:59:21: error: ‘__BIG_ENDIAN’ is not defined, evaluates to ‘0’ [-Werror=undef] 59 | #if __BYTE_ORDER == __BIG_ENDIAN | Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202507301656.7FEX6J5W-lkp@intel.com/ Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
This flag was introduced with commit eec3796 ("powerpc64/ftrace: Move ftrace sequence out of line") to workaround an issue with ftrace. However, this flag was passed to bindgen and caused the following error: Unable to generate bindings: clang diagnosed error: error: unsupported option '-fpatchable-function-entry=1' for target 'powerpc64le-unknown-linux-gnu' Add this flag to bindgen_skip_c_flags to fix build. Fixes: "BACKPORT: FROMLIST: powerpc: Enable Rust for ppc64le" Tested-by: Mingcong Bai <jeffbai@aosc.io>
…selected This should suppress an assertion failure during build. Further investigation should be conducted when possible. Fixes: "BACKPORT: FROMLIST: mips/mm: Add NUMA balancing support" Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
This should suppress an assertion failure during build. Further investigation should be conducted when possible. Fixes: "BACKPORT: FROMLIST: mips/mm: Add NUMA balancing support" Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
…yscall_*()
Functions `audit_classify_syscall_n32()', `audit_classify_syscall_o32()`
were never declared in the previous code and causes build errors due to
`-Werror=missing-prototype'.
Create function prototype declarations in `audit-{n,o}32.h' and reference
them in each of the respective sources. Also remove the extern references
as they are no longer needed.
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io>
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
…acros Follow commit 42f355e ("audit: replace magic audit syscall class numbers with macros") and replace all magic numbers in MIPS audit code. Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Follow commit 42f355e ("audit: replace magic audit syscall class numbers with macros") and replace all magic numbers in MIPS audit code. Signed-off-by: Mingcong Bai <jeffbai@aosc.io> Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
audit_classify_arch() and audit_classify_syscall() are already defined in arch/mips/kernel/audit-native.c, adding preprocessor directives to remove them from lib/audit.c on MIPS. Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
…OS patch The ttm_mem_io_reserve() function calls a driver-defined callback to set mem->bus.caching. Thus we cannot use the value read before calling ttm_mem_io_reserve(), or we'd effectively erase the set from driver. Instead we should only downgrade cached to write_combined if the driver says to use cached. Fixes: eb4186e ("BACKPORT: FROMLIST: drm/ttm: downgrade cached to write_combined when snooping not available") Signed-off-by: Xi Ruoyao <xry111@xry111.site>
…OMPILE_TEST Also add a guard for dma_ops assignment as it only exists on the architectures selecting CONFIG_ARCH_HAS_DMA_OPS. It makes hacking the driver without an aarch64 machine easier. Signed-off-by: Xi Ruoyao <xry111@xry111.site>
This seems used nowhere and the header is removed in Linux 7.1. Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Link: https://git.kernel.org/torvalds/c/44a2ec96d374 Signed-off-by: Xi Ruoyao <xry111@xry111.site>
…G_OF The of_match_node macro is no-op if !CONFIG_OF, so with CONFIG_WERROR the build would fail as nothing uses the "np" variable. Signed-off-by: Xi Ruoyao <xry111@xry111.site>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.