[linux-6.6.y] LoongArch Stage Patch Synchronization 260611#1846
[linux-6.6.y] LoongArch Stage Patch Synchronization 260611#1846AaronDot wants to merge 23 commits into
Conversation
Reviewer's GuideLoongArch-focused patchset that adds a new LS2K BMC core and IPMI backend, refines LoongArch CPU feature probing, fixes several platform-specific power-management and device issues (ACPI GPE after S3, USB wake, amdgpu timeouts, rtlwifi stall, cdrom panic, SCSI error handling), and updates configs/Makefiles/Kconfig to enable the new hardware and defaults. Sequence diagram for LS2K BMC reset recovery flowsequenceDiagram
participant GPIO as GPIO_IRQ
participant Work as bmc_reset_work
participant SM as stop_machine
participant Rec as ls2k_bmc_recover_pci_data
participant PBridge as LS7A_bridge_pci
participant PBMC as LS2K_BMC_pci
GPIO->>Work: ls2k_bmc_interrupt (schedule_work)
Work->>SM: stop_machine(ls2k_bmc_recover_pci_data)
SM->>Rec: run on isolated CPU
Rec->>PBridge: pci_write_config_dword(PCI_BASE_ADDRESS_2..4, 0)
Rec->>PBridge: ls2k_bmc_bar0_addr_is_set()
Rec->>PBridge: ls2k_bmc_restore_bridge_pci_data()
Rec->>PBridge: ls2k_bmc_pcie_is_connected()
Rec->>PBMC: pci_write_config_dword(PCI_COMMAND, base_address0, interrupt_line)
SM-->>Work: return
Work->>Work: vt_move_to_console / set_console (if CONFIG_VT)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
- The new LoongArch ACPI GPE handling reaches into ACPICA internals (aclocal.h, acpi_ev_get_gpe_event_info, direct readl/writel on enable_address) and shares a global gpe_info across translation units; consider restructuring this to use exported ACPI APIs and avoid cross-file globals and direct MMIO on ACPICA-managed registers to reduce layering violations and potential race issues.
- In ls2k_bmc_recover_pci_data() you perform multiple mdelay() calls (including a fixed 10s wait) inside stop_machine(), which will stall all CPUs for a long period during BMC reset; it would be safer to redesign this recovery path to avoid long busy-waits under stop_machine (e.g. shorter polling windows, asynchronous completion, or a different synchronization primitive).
- Several changes introduce CONFIG_LOONGARCH ifdefs directly into generic drivers (e.g., amdgpu ring sizes and extra fence packets, PM hooks), which makes the code harder to maintain; consider expressing these differences via existing ASIC/feature hooks or driver-specific conditionals instead of arch ifdefs so the LoongArch behavior remains encapsulated within the driver’s abstraction layers.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new LoongArch ACPI GPE handling reaches into ACPICA internals (aclocal.h, acpi_ev_get_gpe_event_info, direct readl/writel on enable_address) and shares a global gpe_info across translation units; consider restructuring this to use exported ACPI APIs and avoid cross-file globals and direct MMIO on ACPICA-managed registers to reduce layering violations and potential race issues.
- In ls2k_bmc_recover_pci_data() you perform multiple mdelay() calls (including a fixed 10s wait) inside stop_machine(), which will stall all CPUs for a long period during BMC reset; it would be safer to redesign this recovery path to avoid long busy-waits under stop_machine (e.g. shorter polling windows, asynchronous completion, or a different synchronization primitive).
- Several changes introduce CONFIG_LOONGARCH ifdefs directly into generic drivers (e.g., amdgpu ring sizes and extra fence packets, PM hooks), which makes the code harder to maintain; consider expressing these differences via existing ASIC/feature hooks or driver-specific conditionals instead of arch ifdefs so the LoongArch behavior remains encapsulated within the driver’s abstraction layers.
## Individual Comments
### Comment 1
<location path="drivers/mfd/ls2k-bmc-core.c" line_range="410-419" />
<code_context>
+ * acpi_register_gsi() is used to obtain the GPIO IRQ. The GPIO interrupt is a
+ * watchdog interrupt that is triggered when the BMC resets.
+ */
+ gpio_irq = acpi_register_gsi(NULL, LS2K_BMC_RESET_GPIO_GSI, ACPI_EDGE_SENSITIVE,
+ ACPI_ACTIVE_LOW);
+ if (gpio_irq < 0)
+ return gpio_irq;
+
+ ret = devm_request_irq(ddata->dev, gpio_irq, ls2k_bmc_interrupt,
+ IRQF_SHARED | IRQF_TRIGGER_FALLING, "ls2kbmc gpio", ddata);
+ if (ret)
+ dev_err(ddata->dev, "Failed to request LS2KBMC GPIO IRQ %d.\n", gpio_irq);
+
+ acpi_unregister_gsi(LS2K_BMC_RESET_GPIO_GSI);
+ return ret;
+}
</code_context>
<issue_to_address>
**issue (bug_risk):** Avoid calling acpi_unregister_gsi() while the IRQ is still in use
Here the GSI is registered, an IRQ is requested on the resulting Linux IRQ, and then the GSI is immediately unregistered while the IRQ remains active. acpi_unregister_gsi() is normally part of teardown, not paired directly after registration, and doing so risks corrupting ACPI’s GSI-to-IRQ mapping for this line. Please move acpi_unregister_gsi() to the IRQ shutdown/cleanup path, or drop it if the GSI does not need explicit unmapping.
</issue_to_address>
### Comment 2
<location path="drivers/mfd/ls2k-bmc-core.c" line_range="434-438" />
<code_context>
+ int depth, ret;
+
+ /* The last 16M of PCI BAR0 is used to store the resolution string. */
+ mode = devm_ioremap(&pdev->dev, pci_resource_start(pdev, 0) + SZ_16M, SZ_16M);
+ if (!mode)
+ return -ENOMEM;
+
+ /* The resolution field starts with the flag "video=". */
+ if (!strncmp(mode, "video=", 6))
+ mode = mode + 6;
</code_context>
<issue_to_address>
**issue (bug_risk):** Validate BAR size before mapping a fixed 16M offset for the mode string
`ls2k_bmc_parse_mode` always maps `pci_resource_start(pdev, 0) + SZ_16M` with size `SZ_16M`. If BAR0 is < 32M, this accesses beyond the MMIO region, which is undefined and may fault on some platforms. Please check `pci_resource_len(pdev, 0)` is at least `SZ_16M * 2` (or the required layout) before mapping, and abort if the BAR is too small.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| gpio_irq = acpi_register_gsi(NULL, LS2K_BMC_RESET_GPIO_GSI, ACPI_EDGE_SENSITIVE, | ||
| ACPI_ACTIVE_LOW); | ||
| if (gpio_irq < 0) | ||
| return gpio_irq; | ||
|
|
||
| ret = devm_request_irq(ddata->dev, gpio_irq, ls2k_bmc_interrupt, | ||
| IRQF_SHARED | IRQF_TRIGGER_FALLING, "ls2kbmc gpio", ddata); | ||
| if (ret) | ||
| dev_err(ddata->dev, "Failed to request LS2KBMC GPIO IRQ %d.\n", gpio_irq); | ||
|
|
There was a problem hiding this comment.
issue (bug_risk): Avoid calling acpi_unregister_gsi() while the IRQ is still in use
Here the GSI is registered, an IRQ is requested on the resulting Linux IRQ, and then the GSI is immediately unregistered while the IRQ remains active. acpi_unregister_gsi() is normally part of teardown, not paired directly after registration, and doing so risks corrupting ACPI’s GSI-to-IRQ mapping for this line. Please move acpi_unregister_gsi() to the IRQ shutdown/cleanup path, or drop it if the GSI does not need explicit unmapping.
| mode = devm_ioremap(&pdev->dev, pci_resource_start(pdev, 0) + SZ_16M, SZ_16M); | ||
| if (!mode) | ||
| return -ENOMEM; | ||
|
|
||
| /* The resolution field starts with the flag "video=". */ |
There was a problem hiding this comment.
issue (bug_risk): Validate BAR size before mapping a fixed 16M offset for the mode string
ls2k_bmc_parse_mode always maps pci_resource_start(pdev, 0) + SZ_16M with size SZ_16M. If BAR0 is < 32M, this accesses beyond the MMIO region, which is undefined and may fault on some platforms. Please check pci_resource_len(pdev, 0) is at least SZ_16M * 2 (or the required layout) before mapping, and abort if the BAR is too small.
There was a problem hiding this comment.
Pull request overview
This patchset synchronizes LoongArch-specific support with upstream and includes multiple platform/device stability fixes plus new Loongson-2K BMC/IPMI enablement. It removes obsolete LS2K500 framebuffer/IPMI glue, wires in a new LS2K BMC MFD core + LS2K IPMI SI backend, and adjusts several core subsystems (USB suspend wake, SCSI EH, rtlwifi IRQ enabling, amdgpu LoongArch workarounds), along with defconfig updates.
Changes:
- Add Loongson-2K BMC core MFD driver and LS2K IPMI SI platform backend; update Kconfig/Makefile wiring and MAINTAINERS; remove old LS2K500 fb/IPMI bits.
- LoongArch power-management updates around ACPI GPE wakeup handling and late PM notifier registration.
- Targeted fixes in USB suspend wake, SCSI error handling null-guard, rtl8723be IRQ enable ordering, amdgpu LoongArch-specific ring/fence/DPM behavior, plus config updates.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| MAINTAINERS | Add maintainers entry for LS2K BMC core driver. |
| fs/crypto/Kconfig | Switch fscrypt algorithm deps from imply to select. |
| drivers/video/fbdev/Makefile | Stop building LS2K500 framebuffer driver. |
| drivers/video/fbdev/ls2k500sfb.c | Remove obsolete LS2K500 framebuffer driver implementation. |
| drivers/video/fbdev/Kconfig | Remove FB_LS2K500 Kconfig option. |
| drivers/usb/core/hub.c | Enable/disable root-hub remote wake during port suspend error paths. |
| drivers/scsi/scsi_error.c | Guard against NULL sdev / sdev->host in EH blocking helper. |
| drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c | Set irq_enabled before programming HIMR/HIMRE. |
| drivers/mfd/Makefile | Build LS2K BMC core driver when enabled. |
| drivers/mfd/ls2k-bmc-core.c | New LS2K BMC core MFD driver (display + multi-channel IPMI + reset recovery). |
| drivers/mfd/Kconfig | New MFD_LS2K_BMC_CORE Kconfig option. |
| drivers/gpu/drm/amd/pm/inc/amdgpu_pm.h | Add LoongArch-only helper prototype for forcing high DPM. |
| drivers/gpu/drm/amd/pm/amdgpu_pm.c | Add LoongArch-only helper implementation for forcing high DPM. |
| drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | LoongArch ring-size adjustments + extra fence/EOP emission for cache flush workaround. |
| drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | Call LoongArch DPM “high” helper during device init. |
| drivers/char/ipmi/Makefile | Restructure IPMI SI object selection; add LS2K backend; gate port I/O by HAS_IOPORT. |
| drivers/char/ipmi/kcs_bmc_ls2k500.h | Remove LS2K500 KCS header. |
| drivers/char/ipmi/Kconfig | Add IPMI_LS2K option. |
| drivers/char/ipmi/ipmi_si.h | Replace LS2K500 hooks with LS2K hooks. |
| drivers/char/ipmi/ipmi_si_pci.c | Guard IORESOURCE_IO path when CONFIG_HAS_IOPORT=n. |
| drivers/char/ipmi/ipmi_si_ls2k500.c | Remove LS2K500 IPMI SI implementation. |
| drivers/char/ipmi/ipmi_si_ls2k.c | New LS2K memory-mapped KCS transport backend. |
| drivers/char/ipmi/ipmi_si_intf.c | Use HAS_IOPORT guard; init/shutdown LS2K backend. |
| drivers/char/ipmi/btlock.h | Remove LS2K500 btlock helper header. |
| drivers/cdrom/cdrom.c | Move cdi->exit() from unregister to release. |
| arch/loongarch/power/suspend.c | Add GPE enable-state restore handling via PM notifier (LoongArch ACPI S3). |
| arch/loongarch/power/platform.c | Refine GPE wake enable logic for wake-capable ACPI devices. |
| arch/loongarch/kernel/cpu-probe.c | Detect/report MSGINT and redirect interrupt capabilities. |
| arch/loongarch/include/asm/loongarch.h | Add IOCSRF_REDIRECT bit definition. |
| arch/loongarch/include/asm/cpu.h | Add CPU feature bits for MSGINT and redirect interrupts. |
| arch/loongarch/include/asm/cpu-features.h | Add cpu_has_msgint / cpu_has_redirectint helpers. |
| arch/loongarch/configs/loongson3_defconfig | Enable LS2K BMC/IPMI, SIMPLEDRM, fscrypt, adjust EFI RTC module setting, etc. |
| arch/loongarch/configs/deepin_loongarch_desktop_defconfig | Enable LS2K BMC/IPMI, adjust EFI RTC module setting, remove LS2K500 fb config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #include <asm/time.h> | ||
| #include <asm/tlbflush.h> | ||
|
|
||
| #include "../drivers/acpi/acpica/aclocal.h" |
| #include <asm/bootinfo.h> | ||
| #include <asm/loongson.h> | ||
|
|
||
| #include "../drivers/acpi/acpica/aclocal.h" |
| #include <linux/aperture.h> | ||
| #include <linux/bitfield.h> | ||
| #include <linux/delay.h> | ||
| #include <linux/errno.h> | ||
| #include <linux/init.h> | ||
| #include <linux/iopoll.h> | ||
| #include <linux/kbd_kern.h> | ||
| #include <linux/kernel.h> | ||
| #include <linux/mfd/core.h> | ||
| #include <linux/module.h> | ||
| #include <linux/pci.h> | ||
| #include <linux/pci_ids.h> |
| ls2k_bmc_cells[LS2K_BMC_DISPLAY].platform_data = &pd; | ||
| ls2k_bmc_cells[LS2K_BMC_DISPLAY].pdata_size = sizeof(pd); | ||
| base = pci_resource_start(dev, 0) + LS2K_DISPLAY_RES_START; | ||
|
|
||
| /* Remove conflicting efifb device */ | ||
| ret = aperture_remove_conflicting_devices(base, SZ_4M, "simple-framebuffer"); | ||
| if (ret) | ||
| return dev_err_probe(&dev->dev, ret, "Failed to removed firmware framebuffers\n"); | ||
|
|
||
| return devm_mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO, | ||
| ls2k_bmc_cells, ARRAY_SIZE(ls2k_bmc_cells), | ||
| pci_resource_n(dev, 0), 0, NULL); |
| /* Skip interrupt in LS2K_BMC_INT_INTERVAL */ | ||
| if (time_after(jiffies, last_jiffies + LS2K_BMC_INT_INTERVAL)) { | ||
| schedule_work(&ddata->bmc_reset_work); | ||
| last_jiffies = jiffies; | ||
| } |
| void ipmi_si_ls2k_init(void) | ||
| { | ||
| platform_driver_register(&ipmi_ls2k_platform_driver); | ||
| ls2k_registered = true; | ||
| } |
| ssize_t amdgpu_set_high_power_dpm_force_performance_level(struct amdgpu_device *adev) | ||
| { | ||
| if (adev->pm.sysfs_initialized) | ||
| return amdgpu_set_power_dpm_force_performance_level(adev->dev, NULL, "high", 0); | ||
|
|
||
| DRM_INFO("Failed to config dpm to high performance level\n"); | ||
| return -EINVAL; |
| /* The last 16M of PCI BAR0 is used to store the resolution string. */ | ||
| mode = devm_ioremap(&pdev->dev, pci_resource_start(pdev, 0) + SZ_16M, SZ_16M); | ||
| if (!mode) | ||
| return -ENOMEM; | ||
|
|
||
| /* The resolution field starts with the flag "video=". */ | ||
| if (!strncmp(mode, "video=", 6)) | ||
| mode = mode + 6; | ||
|
|
||
| ret = kstrtoint(strsep(&mode, "x"), 10, &pd->width); | ||
| if (ret) | ||
| return ret; | ||
|
|
||
| ret = kstrtoint(strsep(&mode, "-"), 10, &pd->height); | ||
| if (ret) | ||
| return ret; | ||
|
|
||
| ret = kstrtoint(strsep(&mode, "@"), 10, &depth); | ||
| if (ret) | ||
| return ret; | ||
|
|
||
| pd->stride = pd->width * depth / 8; | ||
| pd->format = depth == 32 ? "a8r8g8b8" : "r5g6b5"; |
| pci_read_config_dword(parent, parent->msi_cap + PCI_MSI_ADDRESS_LO, | ||
| &ddata->bridge_pci_data.msi_lo); | ||
| pci_read_config_dword(parent, parent->msi_cap + PCI_MSI_ADDRESS_HI, | ||
| &ddata->bridge_pci_data.msi_hi); | ||
|
|
||
| pci_read_config_dword(parent, parent->pcie_cap + PCI_EXP_DEVCTL, | ||
| &ddata->bridge_pci_data.devctl); | ||
| pci_read_config_dword(parent, parent->pcie_cap + PCI_EXP_LNKCAP, | ||
| &ddata->bridge_pci_data.linkcap); | ||
| pci_read_config_dword(parent, parent->pcie_cap + PCI_EXP_LNKCTL, | ||
| &ddata->bridge_pci_data.linkctl_sts); |
| DATA_SEL(write64bit ? 2 : 1) | INT_SEL(0)); | ||
| amdgpu_ring_write(ring, lower_32_bits(seq)); | ||
| amdgpu_ring_write(ring, upper_32_bits(seq)); | ||
| int i; |
f18c13b to
49d7007
Compare
|
Hi @AaronDot. Thanks for your PR. I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
[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 |
1 similar comment
|
[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 |
49d7007 to
0e8e183
Compare
commit 75eb8b9 upstream. This mostly reverts commit a0fc203. Keep the relevant parts of the comment added by that commit. The problem with that commit is that it allowed people to create broken configurations that enabled FS_ENCRYPTION but not the mandatory algorithms. An example of this can be found here: https://lore.kernel.org/r/1207325.1737387826@warthog.procyon.org.uk/ The commit did allow people to disable specific generic algorithm implementations that aren't needed. But that at best allowed saving a bit of code. In the real world people are unlikely to intentionally and correctly make such a tweak anyway, as they tend to just be confused by what all the different crypto kconfig options mean. Of course we really need the crypto API to enable the correct implementations automatically, but that's for a later fix. Acked-by: Ard Biesheuvel <ardb@kernel.org> Cc: David Howells <dhowells@redhat.com> Cc: Herbert Xu <herbert@gondor.apana.org.au> Link: https://lore.kernel.org/r/20250217185314.27345-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
commit f28abb9 upstream. LoongArch's MSG interrupt features are used across multiple subsystems. Clarify these features to avoid misuse, existing users will be adjusted if necessary. MSGINT: Infrastructure, means the CPU core supports message interrupts. Indicated by CPUCFG1.MSGINT. AVECINT: AVEC interrupt controller based on MSGINT, means the CPU chip supports direct message interrupts. Indicated by IOCSR.FEATURES.DMSI. REDIRECTINT: REDIRECT interrupt controller based on MSGINT and AVECINT, means the CPU chip supports redirect message interrupts. Indicated by IOCSR.FEATURES.RMSI. For example: Loongson-3A5000/3C5000 doesn't support MSGINT/AVECINT/REDIRECTINT; Loongson-3A6000 supports MSGINT but doesn't support AVECINT/REDIRECTINT; Loongson-3C6000 supports MSGINT/AVECINT/REDIRECTINT. Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Xianglai Li <lixianglai@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
7A1000 ACPI GPE register 8 bit write is not supported, so that it cannot be recovered correctly when resume, it need to recover the GPE enable bit after S3. Signed-off-by: Qunqin Zhao <zhaoqunqin@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
To solve "rx550 gfx timeout error" because of pcie order dislocation in loongson platform, the old fence may cover new fence when gpu write on fence when gpu write on fence mem, it will cause cpu get the ge the wrong fence number. Signed-off-by: zhaotianrui <zhaotianrui@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
In our platform, there will be some problems such as 'amdgpu timeout' when amdgpu switch high-performance and low-performance mode. Signed-off-by: Tianrui Zhao <zhaotianrui@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
…enablement Move the setting of the software flag `rtlpci->irq_enabled = true` (this flag is checked in interrupt handler) to before enabling hardware interrupts to prevent a race condition that can cause CPU stall. Signed-off-by: tangyulong <tangyulong@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
When a USB optical drive is unplugged while in use (e.g. during burning), the driver teardown process triggers a NULL pointer dereference in scsi_block_when_processing_errors(). This happens because unregister_cdrom() attempts to send SCSI commands (to exit MRW mode) when the underlying scsi_device and its host are already being destroyed. This patch fixes the issue via two approaches to ensure both stability and kABI compatibility: 1. cdrom: Move the cdi->exit(cdi) call out of unregister_cdrom() and into cdrom_release(). This avoids sending block commands to a disconnected device during driver unloading, performing the cleanup safely when the file is closed. 2. scsi_error: Add a defensive NULL check for sdev and sdev->host in scsi_block_when_processing_errors() to prevent any potential panics during device teardown. Note: Unlike the upstream commit 5ec9d26 ("cdrom: Call cdrom_mrw_exit from cdrom_release function"), this patch retains the exit function pointer in 'struct cdrom_device_info' to preserve kABI compatibility. Signed-off-by: Ming Wang <wangming01@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
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> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
This reverts commit e020f90. Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
This reverts commit 0d6b46e. Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
commit 0d64f6d upstream. The Loongson-2K Board Management Controller provides an PCIe interface to the host to access the feature implemented in the BMC. The BMC is assembled on a server similar to the server machine with Loongson-3 CPU. It supports multiple sub-devices like DRM and IPMI. Co-developed-by: Chong Qiao <qiaochong@loongson.cn> Signed-off-by: Chong Qiao <qiaochong@loongson.cn> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> Acked-by: Corey Minyard <corey@minyard.net> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> Link: https://lore.kernel.org/r/0dc1fd53020ce2562453961ffed2cd9eb8f359e1.1756987761.git.zhoubinbin@loongson.cn Signed-off-by: Lee Jones <lee@kernel.org> (cherry picked from commit 0d64f6d) Signed-off-by: zhuyunfei <zhuyunfei@loongson.cn>
commit d952bba upstream. Since the display is a sub-function of the Loongson-2K BMC, when the BMC reset, the entire BMC PCIe is disconnected, including the display which is interrupted. Quick overview of the entire LS2K BMC reset process: There are two types of reset methods: soft reset (BMC-initiated reboot of IPMI reset command) and BMC watchdog reset (watchdog timeout). First, regardless of the method, an interrupt is generated (PCIe interrupt for soft reset/GPIO interrupt for watchdog reset); Second, during the interrupt process, the system enters bmc_reset_work, clears the bus/IO/mem resources of the LS7A PCI-E bridge, waits for the BMC reset to begin, then restores the parent device's PCI configuration space, waits for the BMC reset to complete, and finally restores the BMC PCI configuration space. Display restoration occurs last. Co-developed-by: Chong Qiao <qiaochong@loongson.cn> Signed-off-by: Chong Qiao <qiaochong@loongson.cn> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> Acked-by: Corey Minyard <corey@minyard.net> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> Link: https://lore.kernel.org/r/de4e04b42ff9ee282f86f9bb9efbf959a9848205.1756987761.git.zhoubinbin@loongson.cn Signed-off-by: Lee Jones <lee@kernel.org> (cherry picked from commit d952bba) Signed-off-by: zhuyunfei <zhuyunfei@loongson-pc>
commit c5c76d8 upstream. In a future patch HAS_IOPORT=n will disable inb()/outb() and friends at compile time. We thus need to add this dependency and ifdef sections of code using inb()/outb() as alternative access methods. Acked-by: Corey Minyard <cminyard@mvista.com> Co-developed-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Message-Id: <20240404104506.3352637-2-schnelle@linux.ibm.com> Signed-off-by: Corey Minyard <minyard@acm.org> (cherry picked from commit c5c76d8) Signed-off-by: zhuyunfei <zhuyunfei@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
commit d46651d upstream. This patch adds Loongson-2K BMC IPMI support. According to the existing design, we use software simulation to implement the KCS interface registers: Stauts/Command/Data_Out/Data_In. Also since both host side and BMC side read and write kcs status, fifo flag is used to ensure data consistency. The single KCS message block is as follows: +-------------------------------------------------------------------------+ |FIFO flags| KCS register data | CMD data | KCS version | WR REQ | WR ACK | +-------------------------------------------------------------------------+ Co-developed-by: Chong Qiao <qiaochong@loongson.cn> Signed-off-by: Chong Qiao <qiaochong@loongson.cn> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> Acked-by: Corey Minyard <corey@minyard.net> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> Message-ID: <8f9ffb6f0405345af8f04193ce1510aacd075e72.1756987761.git.zhoubinbin@loongson.cn> Signed-off-by: Corey Minyard <corey@minyard.net> (cherry picked from commit d46651d) Signed-off-by: zhuyunfei <zhuyunfei@loongson.cn>
commit 6b157b4 upstream. No need for it to be global. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202601170753.3zDBerGP-lkp@intel.com/ Signed-off-by: Corey Minyard <corey@minyard.net> (cherry picked from commit 6b157b4) Signed-off-by: zhuyunfei <zhuyunfei@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
commit 0892507 stream. The devm_kzalloc() function returns NULL on error so check for that instead of error pointers. Fixes: d952bba ("mfd: ls2kbmc: Add Loongson-2K BMC reset function support") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Message-ID: <df80c6d61229eb8f877c3694525c0f97e64a43e8.1759478975.git.dan.carpenter@linaro.org> Signed-off-by: Corey Minyard <corey@minyard.net> (cherry picked from commit 0892507) Signed-off-by: zhuyunfei <zhuyunfei@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
commit 4af66c2 upstream. Call pci_disable_device() if devm_mfd_add_devices() fails. Fixes: 0d64f6d ("mfd: ls2kbmc: Introduce Loongson-2K BMC core driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Message-ID: <e3e7cf2cfded48c9fca8bc981c54bbcb7edb9580.1759478975.git.dan.carpenter@linaro.org> Signed-off-by: Corey Minyard <corey@minyard.net> (cherry picked from commit 4af66c2) Signed-off-by: zhuyunfei <zhuyunfei@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
commit 3696ac1 upstream. Remove unnecessary semicolons reported by Coccinelle/coccicheck and the semantic patch at scripts/coccinelle/misc/semicolon.cocci. Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Link: https://patch.msgid.link/20251111052451.3687740-1-nichen@iscas.ac.cn Signed-off-by: Lee Jones <lee@kernel.org> (cherry picked from commit 3696ac1) Signed-off-by: zhuyunfei <zhuyunfei@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
commit e11a9ad upstream. The mixing of managed and non-managed resources may lead to possible use-after-free bugs. In this driver the problematic part is the device functionality that may just have gone behind the functions back, e.g., when interrupt is being served. Fix this by switching to managed resources for PCI. Fixes: 91a3e1f5453a ("mfd: ls2kbmc: Check for devm_mfd_add_devices() failure") Fixes: d952bba ("mfd: ls2kbmc: Add Loongson-2K BMC reset function support") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Binbin Zhou <zhoubinbin@loongson.cn> Link: https://patch.msgid.link/20251030113735.3741913-2-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones <lee@kernel.org> (cherry picked from commit e11a9ad) Signed-off-by: zhuyunfei <zhuyunfei@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
commit 9e87c8b upstream. There is a PCI API to access device resources. Use it instead of direct accesses. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Binbin Zhou <zhoubinbin@loongson.cn> Link: https://patch.msgid.link/20251030113735.3741913-3-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones <lee@kernel.org> (cherry picked from commit 9e87c8b) Signed-off-by: zhuyunfei <zhuyunfei@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Enable Loongson-2K0500 BMC with simpledrm. Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Fix the issue of below: sudo cryptsetup open /dev/sda mydata device-mapper: ioctl: error adding target to table device-mapper: table: 253:0: crypt: Error allocating crypto tfm (-ENOENT) device-mapper: ioctl: error adding target to table The error is due to the lack of CONFIG_CRYPTO_XTS. Enable CONFIG_FS_ENCRYPTION can select FS_ENCRYPTION_ALGS in config EXT4_FS, then select CONFIG_CRYPTO_XTS in config FS_ENCRYPTION_ALGS. Signed-off-by: wanghongliang <wanghongliang@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Enable CONFIG_SCSI_LPFC as module Signed-off-by: zhangtianyang <zhangtianyang@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
9271c60 to
997838c
Compare
Introduction to the patchset:
Patch 1-2: backported from upstream;
Patch 3: fix acpi gpe error after S3;
Patch 4-5: fix amdgpu timeout issues;
Patch 6: fix rtlwifi cpu stall;
Patch 7: fix cdrom kernel panic;
Patch 8: enable usb wakeup;
Patch 9-20: backport Loongson-2K0500 BMC from upstream;
Patch 21-24: Default config enabled.
Summary by Sourcery
Synchronize LoongArch-specific kernel support with upstream, including new BMC/IPMI support, refinements to CPU and interrupt capabilities, and multiple platform power-management and device-stability fixes.
New Features:
Bug Fixes:
Enhancements:
Build:
Chores: