Skip to content

Conversation

@WangJia-UR
Copy link
Contributor

@WangJia-UR WangJia-UR commented Dec 19, 2025

  1. Backport subject "PCI: Silence set affinity failed warning"
  2. Backport PLIC driver to support plic driver early
  3. Add MilkV-Titan support.

Summary by Sourcery

Add MilkV Titan platform support and enhance RISC-V interrupt/PCIe handling, while cleaning up MSI affinity handling across multiple PCI host controllers.

New Features:

  • Support UltraRISC DP1000 Titan board via new device trees and pinctrl configuration.
  • Enable early initialization of the RISC-V PLIC for compatible SoCs using fwnode-based probing.
  • Add RISC-V interrupt controller handling for AIA-style local interrupts and extended interrupt masking on 32-bit systems.
  • Preserve and restore MSI interrupt masks across suspend/resume for the UltraRISC DesignWare PCIe host controller.

Bug Fixes:

  • Fix PLIC enable register access races by using IRQ-safe spin locking in interrupt enable/disable paths and suspend/resume.
  • Correct RISC-V local interrupt masking to handle high interrupt IDs via IEH on 32-bit systems.
  • Fix irq matrix sizing by dynamically allocating per-CPU and global bitmaps instead of relying on architecture-specific IRQ_MATRIX_BITS.
  • Avoid spurious warnings and unsupported operations from PCI/MSI irq_set_affinity by marking domains that do not support affinity steering and dropping dead set_affinity implementations.
  • Make UltraRISC pinctrl configuration robust by deriving port/pin from pin numbers and properly translating generic pinconf options into hardware bias settings.

Enhancements:

  • Refactor the RISC-V PLIC driver to be fwnode-centric, improve error reporting with fwnode tags, and centralize parsing of contexts and parent interrupts.
  • Improve RISC-V core interrupt mapping logs to reflect AIA-capable systems and report custom local interrupts more clearly.
  • Tighten UltraRISC pinctrl and DT bindings, including updated pinmux/bias macros and debugging output, and track port metadata via match data.

avpatel and others added 20 commits December 18, 2025 15:44
Use dev_info(), dev_warn(), and dev_err() in-place of pr_info(),
pr_warn(), and pr_err().

Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jia Wang <[email protected]>
Use devm_xyz() for allocations and mappings managed by the
Linux device driver framework.

Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jia Wang <[email protected]>
The RISC-V INTC irqdomain is always the parent irqdomain of SiFive PLIC
so use riscv_get_intc_hwnode() to get the parent fwnode similar to other
RISC-V drivers which use local interrupts.

Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jia Wang <[email protected]>
…ilure

The SiFive PLIC contexts should not be left dangling if irqdomain creation
fails because plic_starting_cpu() can crash accessing unmapped registers.

Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jia Wang <[email protected]>
… plic_probe()

The SiFive PLIC driver needs to know the number of interrupts and contexts
to complete initialization. Parse these details early in plic_probe() to
avoid unnecessary memory allocations and register mappings if these details
are not available.

Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jia Wang <[email protected]>
Now that PLIC driver is probed as a regular platform driver, the lock
dependency validator complains about the safety of handler->enable_lock
usage:

[    0.956775]  Possible interrupt unsafe locking scenario:

[    0.956998]        CPU0                    CPU1
[    0.957247]        ----                    ----
[    0.957439]   lock(&handler->enable_lock);
[    0.957607]                                local_irq_disable();
[    0.957793]                                lock(&irq_desc_lock_class);
[    0.958021]                                lock(&handler->enable_lock);
[    0.958246]   <Interrupt>
[    0.958342]     lock(&irq_desc_lock_class);
[    0.958501]
                *** DEADLOCK ***

To address above, use raw_spin_lock_irqsave/unlock_irqrestore() instead
of raw_spin_lock/unlock().

Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jia Wang <[email protected]>
The RISC-V advanced interrupt architecture (AIA) extends the per-HART
local interrupts in following ways:
1. Minimum 64 local interrupts for both RV32 and RV64
2. Ability to process multiple pending local interrupts in same
   interrupt handler
3. Priority configuration for each local interrupts
4. Special CSRs to configure/access the per-HART MSI controller

Add support for deepin-community#1 and deepin-community#2 described above in the RISC-V intc driver.

Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jia Wang <[email protected]>
A future user of the matrix allocator, does not know the size of the matrix
bitmaps at compile time.

To avoid wasting memory on unnecessary large bitmaps, size the bitmap at
matrix allocation time.

Signed-off-by: Björn Töpel <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jia Wang <[email protected]>
Now that the PLIC uses a platform driver, the driver is probed later in the
boot process, where interrupts from peripherals might already be pending.

As a result, plic_handle_irq() may be called as early as the call to
irq_set_chained_handler() completes. But this call happens before the
per-context handler is completely set up, so there is a window where
plic_handle_irq() can see incomplete per-context state and crash.

Avoid this by delaying the call to irq_set_chained_handler() until all
handlers from all PLICs are initialized.

Fixes: 8ec99b0 ("irqchip/sifive-plic: Convert PLIC driver into a platform driver")
Reported-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Samuel Holland <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Tested-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Closes: https://lore.kernel.org/r/CAMuHMdVYFFR7K5SbHBLY-JHhb7YpgGMS_hnRWm8H0KD-wBo+4A@mail.gmail.com/
Signed-off-by: Jia Wang <[email protected]>
The latest Linux RISC-V no longer boots on the Allwinner D1 platform
because the sun4i_timer driver fails to get an interrupt from PLIC due to
the recent conversion of the PLIC to a platform driver. Converting the
sun4i timer to a platform driver does not work either because the D1 does
not have a SBI timer available so early boot hangs. See the 'Closes:'
link for deeper analysis.

The real fix requires enabling the SBI time extension in the platform
firmware (OpenSBI) and convert sun4i_timer into platform driver.
Unfortunately, the real fix involves changing multiple places and can't be
achieved in a short duration and aside of that requires users to update
firmware.

As a work-around, retrofit PLIC probing such that the PLIC is probed early
only for the Allwinner D1 platform and probed as a regular platform driver
for rest of the RISC-V platforms. In the process, partially revert some of
the previous changes because the PLIC device pointer is not available in
all probing paths.

Fixes: e306a89 ("irqchip/sifive-plic: Chain to parent IRQ after handlers are ready")
Fixes: 8ec99b0 ("irqchip/sifive-plic: Convert PLIC driver into a platform driver")
Suggested-by: Thomas Gleixner <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Tested-by: Samuel Holland <[email protected]>
Tested-by: Emil Renner Berthing <[email protected]>
Tested-by: Charlie Jenkins <[email protected]>
Reviewed-by: Samuel Holland <[email protected]>
Reviewed-by: Charlie Jenkins <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/all/[email protected]
Closes: https://lore.kernel.org/lkml/[email protected]/
Signed-off-by: Jia Wang <[email protected]>
community inclusion
category: feature
bugzilla: RVCK-Project/rvck#71

-------------------------------------------------

Add PLIC early init supports and remove invalid
timer nodes in dp1000.dts.

Signed-off-by: Jia Wang <[email protected]>
community inclusion
category: feature
bugzilla: RVCK-Project/rvck#71

 --------------------------------

Add suspend and resume callbacks to the ultrarisc PCIe driver to
support system power management.

During suspend, save the current MSI interrupt mask state from the
hardware registers to driver private data. During resume, restore
the saved interrupt mask state back to the hardware registers.

This ensures MSI interrupt configuration is preserved across
suspend/resume cycles.

Signed-off-by: Xincheng Zhang <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
community inclusion
category: feature
bugzilla: RVCK-Project/rvck#71

--------------------------------

This commit moves the chosen node configuration from the
common dp1000.dts file to the respective board-specific
DTS files.

This change allows each board to specify its own console
configuration while keeping the common SoC definitions clean.

Signed-off-by: Jia Wang <[email protected]>
community inclusion
category: feature
bugzilla: RVCK-Project/rvck#71

--------------------------------

Add gpio-ranges property to all gpio/portX nodes.
This property maps GPIO lines to pin controller pins,
ensuring proper GPIO pin allocation and management.

Convert dp1000.dts to a common include file (dp1000.dtsi) and update
the board-specific DTS files to include it. This refactoring allows
for better code reuse across different DP1000-based boards (EVB, MO,
and Titan variants) while maintaining board-specific configurations.

The changes include:
- Renaming dp1000.dts to dp1000.dtsi
- Updating board-specific DTS files to include the common .dtsi
- Adjusting Makefile to reflect these changes
- Updating pinctrl files for all board variants

Signed-off-by: Jia Wang <[email protected]>
community inclusion
category: feature
bugzilla: RVCK-Project/rvck#71

--------------------------------

Update ur_pin_config_set() to use the new configuration handling logic.
This allows the driver to properly handle standard Linux kernel pin
configuration parameters such as PIN_CONFIG_BIAS_PULL_UP,
PIN_CONFIG_BIAS_PULL_DOWN, etc.

Signed-off-by: Jia Wang <[email protected]>
…aRISC DP1000 SoC

community inclusion
category: feature
bugzilla: RVCK-Project/rvck#71

--------------------------------

Add dp1000-titan-v1.dts and dp1000-titan-pinctrl.dtsi for the Milk-V Titan
board. The Titan board is designed by Milk-V and is based on the UltraRISC
DP1000 SoC. These device tree files provide the initial support for the
board, including pinctrl and basic peripheral configuration.

Signed-off-by: Jia Wang <[email protected]>
This reverts commit 6e284d9.

Backport the implementation from upstrem mainline.

Signed-off-by: Jia Wang <[email protected]>
@sourcery-ai
Copy link

sourcery-ai bot commented Dec 19, 2025

Reviewer's Guide

Backports and extends the RISC‑V interrupt and PCIe stack to support early PLIC init and MilkV Titan/UltraRISC DP1000 platforms, reworking irq matrix allocation, disabling MSI affinity steering for several host controllers, enhancing the UltraRISC pinctrl driver and DT bindings, and wiring up new DTS variants for the Titan board.

Sequence diagram for RISC‑V external interrupt handling via intc and PLIC

sequenceDiagram
    participant CPU
    participant riscv_intc as riscv_intc_irq
    participant riscv_intc_aia as riscv_intc_aia_irq
    participant intc_domain
    participant PLIC as plic_handle_irq
    participant plic_domain

    rect rgb(235,235,255)
        CPU->>riscv_intc: external interrupt entry
        alt AIA available (SxAIA)
            riscv_intc->>riscv_intc_aia: call when topi support present
            loop while CSR_TOPI nonzero
                riscv_intc_aia->>intc_domain: generic_handle_domain_irq(topi >> TOPI_IID_SHIFT)
            end
        else legacy
            riscv_intc->>intc_domain: generic_handle_domain_irq(cause)
        end
    end

    rect rgb(235,255,235)
        intc_domain->>PLIC: PLIC parent irq raised (RV_IRQ_EXT)
        activate PLIC
        PLIC->>PLIC: plic_get_hwirq() in loop
        loop while hwirq != 0
            PLIC->>plic_domain: generic_handle_domain_irq(hwirq)
            alt mapping not found
                PLIC->>PLIC: pr_warn_ratelimited(fwnode, hwirq)
            end
        end
        deactivate PLIC
    end
Loading

Sequence diagram for UltraRISC PCIe MSI mask save/restore on suspend/resume

sequenceDiagram
    participant PM as PM_core
    participant pdev as platform_device
    participant upcie as ultrarisc_pcie
    participant dw as dw_pcie
    participant pp as dw_pcie_rp

    rect rgb(235,235,255)
        PM->>pdev: suspend callback
        pdev->>upcie: ultrarisc_pcie_suspend(state)
        upcie->>dw: get pci = ultrarisc_pcie->pci
        dw->>pp: get pp = &pci->pp
        upcie->>pp: num_ctrls = pp->num_vectors / MAX_MSI_IRQS_PER_CTRL
        upcie->>pp: raw_spin_lock_irqsave(pp->lock)
        loop for each ctrl
            upcie->>upcie: irq_mask[ctrl] = pp->irq_mask[ctrl]
        end
        upcie->>pp: raw_spin_unlock_irqrestore(pp->lock)
        upcie-->>pdev: return 0
    end

    rect rgb(235,255,235)
        PM->>pdev: resume callback
        pdev->>upcie: ultrarisc_pcie_resume()
        upcie->>dw: get pci = ultrarisc_pcie->pci
        dw->>pp: get pp = &pci->pp
        upcie->>pp: num_ctrls = pp->num_vectors / MAX_MSI_IRQS_PER_CTRL
        upcie->>pp: raw_spin_lock_irqsave(pp->lock)
        loop for each ctrl
            upcie->>pp: pp->irq_mask[ctrl] = ultrarisc_pcie->irq_mask[ctrl]
            upcie->>dw: dw_pcie_writel_dbi(pci, PCIE_MSI_INTR0_MASK + ctrl * MSI_REG_CTRL_BLOCK_SIZE, pp->irq_mask[ctrl])
        end
        upcie->>pp: raw_spin_unlock_irqrestore(pp->lock)
        upcie-->>pdev: return 0
    end
Loading

Class diagram for updated RISC‑V PLIC driver structures and probe flow

classDiagram
    class plic_priv {
        +struct fwnode_handle *fwnode
        +struct cpumask lmask
        +struct irq_domain *irqdomain
        +void __iomem *regs
        +unsigned long plic_quirks
        +u32 nr_irqs
        +unsigned long *prio_save
    }

    class plic_handler {
        +bool present
        +void __iomem *hart_base
        +void __iomem *enable_base
        +u32 *enable_save
        +raw_spinlock_t enable_lock
        +struct plic_priv *priv
    }

    class plic_probe {
        +int plic_probe(struct fwnode_handle *fwnode)
        +int plic_platform_probe(struct platform_device *pdev)
        +int plic_early_probe(struct device_node *node, struct device_node *parent)
    }

    class plic_helpers {
        +int plic_parse_nr_irqs_and_contexts(struct fwnode_handle *fwnode, u32 *nr_irqs, u32 *nr_contexts)
        +int plic_parse_context_parent(struct fwnode_handle *fwnode, u32 context, u32 *parent_hwirq, int *parent_cpu)
        +void plic_toggle(struct plic_handler *handler, int hwirq, int enable)
        +int plic_irq_suspend(void)
        +void plic_irq_resume(void)
    }

    class plic_global_state {
        +int plic_parent_irq
        +bool plic_global_setup_done
        +struct plic_handler plic_handlers_per_cpu
    }

    class irqchip_registration {
        +struct platform_driver plic_driver
        +IRQCHIP_DECLARE(riscv, allwinner_sun20i_d1_plic, plic_early_probe)
        +IRQCHIP_DECLARE(ultrarisc_dp1000_plic, ultrarisc_dp1000_plic, plic_early_probe)
    }

    plic_handler --> plic_priv : priv
    plic_global_state --> plic_handler : manages per_cpu
    plic_probe --> plic_priv : allocates/initializes
    plic_probe --> plic_handler : initializes per_cpu handlers
    plic_probe --> plic_helpers : uses
    plic_helpers --> plic_priv : reads nr_irqs, regs
    plic_helpers --> plic_handler : toggles enable bits
    plic_global_state --> irqchip_registration : uses parent_irq mapping
    irqchip_registration --> plic_probe : calls from probe/early_probe
Loading

Class diagram for irq_matrix and cpumap rework

classDiagram
    class cpumap {
        +unsigned int available
        +unsigned int allocated
        +unsigned int managed
        +unsigned int managed_allocated
        +bool initialized
        +bool online
        +unsigned long *managed_map
        +unsigned long alloc_map[]
    }

    class irq_matrix {
        +raw_spinlock_t lock
        +unsigned int alloc_start
        +unsigned int alloc_end
        +unsigned int alloc_size
        +unsigned int matrix_bits
        +unsigned int total_allocated
        +unsigned int online_maps
        +struct cpumap __percpu *maps
        +unsigned long *system_map
        +unsigned long scratch_map[]
        +struct irq_matrix *irq_alloc_matrix(unsigned int matrix_bits, unsigned int alloc_start, unsigned int alloc_end)
    }

    irq_matrix --> cpumap : maps~per_cpu~
Loading

Class diagram for UltraRISC DP1000 pinctrl structures and helpers

classDiagram
    class ur_port_desc {
        +const char *name
        +u32 npins
        +u32 mux_offset
        +u32 conf_offset
    }

    class ur_pinctrl_match_data {
        +const struct pinctrl_pin_desc *pins
        +u32 npins
        +u32 offset
        +u32 num_ports
        +struct ur_port_desc ports[]
    }

    class ur_pin_val {
        +u32 port
        +u32 pin
        +u32 conf
    }

    class ur_pinctrl {
        +struct device *dev
        +void __iomem *base
        +struct pinctrl_desc *pctl_desc
        +struct pinctrl_dev *pctl_dev
        +const struct ur_pinctrl_match_data *match_data
        +raw_spinlock_t lock
        +struct mutex mutex
    }

    class ur_pinctrl_helpers {
        +int ur_pin_num_to_port_pin(const struct ur_pinctrl_match_data *match_data, struct ur_pin_val *pin_val, u32 pin_num)
        +int ur_config_to_pin_val(struct ur_pinctrl *pin_ctrl, struct ur_pin_val *pin_vals, unsigned long *config)
        +int ur_set_pin_conf(struct ur_pinctrl *pin_ctrl, struct ur_pin_val *pin_vals)
        +int ur_pin_config_set(struct pinctrl_dev *pctldev, unsigned int pin, unsigned long *configs, unsigned int num_configs)
        +int ur_pin_config_get(struct pinctrl_dev *pctldev, unsigned int pin, unsigned long *config)
        +int ur_pin_config_group_get(struct pinctrl_dev *pctldev, unsigned int selector, unsigned long *config)
    }

    ur_pinctrl --> ur_pinctrl_match_data : match_data
    ur_pinctrl_match_data --> ur_port_desc : ports
    ur_pinctrl_helpers --> ur_pinctrl : operates_on
    ur_pinctrl_helpers --> ur_pinctrl_match_data : scans ports
    ur_pinctrl_helpers --> ur_pin_val : builds_and_programs
Loading

File-Level Changes

Change Details Files
Refactor RISC-V PLIC driver to be fwnode-based, support early-IRQCHIP probing, and improve locking and logging semantics.
  • Change plic_priv to store an fwnode_handle instead of struct device and use it for logging and IRQ domain lookup.
  • Convert enable_lock users to raw_spin_lock_irqsave/irqrestore in the main toggle and suspend/resume paths.
  • Factor out helpers to parse PLIC IRQ counts and per-context parent info from fwnode/OF and use them in a rewritten plic_probe taking an fwnode_handle.
  • Delay creation of the irqdomain until after contexts/handlers are discovered, add proper cleanup paths for partial setup failures, and only do global cpuhp/syscore/parent-IRQ setup once all online handlers are present.
  • Add a platform wrapper probe, an early IRQCHIP_DECLARE-based probe for specific compatibles, adjust pr_fmt and log messages to include %pfwP, and update driver registration metadata.
drivers/irqchip/irq-sifive-plic.c
Enhance RISC-V local interrupt controller to support AIA and 32-bit extended interrupt enables, and improve init reporting.
  • Add AIA-specific interrupt handler that services CSR_TOPI in a loop and call into generic_handle_domain_irq.
  • Extend irq_mask/unmask to use CSR_IEH for hwirq >= BITS_PER_LONG on 32-bit builds.
  • Adjust init common path to log 64 mapped local interrupts when the SxAIA ISA extension is present and simplify printk formatting.
  • Include asm/hwcap.h for ISA extension checks.
drivers/irqchip/irq-riscv-intc.c
Rework irq matrix and IRQ_MATRIX_BITS handling to support variable-width matrices and decouple from NR_VECTORS.
  • Make struct cpumap and irq_matrix store their bitmaps as flexible arrays and pointers rather than fixed-size arrays, and allocate enough space dynamically based on matrix_bits.
  • Allocate per-CPU cpumap structures with room for both alloc_map and managed_map bitmaps and wire managed_map to the second half of the allocation.
  • Remove the global IRQ_MATRIX_BITS define from x86 hw_irq.h and the associated fixed-size arrays in irq/matrix.c.
kernel/irq/matrix.c
arch/x86/include/asm/hw_irq.h
Disable MSI IRQ affinity steering for a broad set of PCIe/MSI host controllers using a new MSI_FLAG_NO_AFFINITY flag and by removing custom irq_set_affinity stubs.
  • Introduce MSI_FLAG_NO_AFFINITY and shift MSI_FLAG_PCI_IMS to the next bit in include/linux/msi.h, and adjust the default chip-op wiring in kernel/irq/msi.c so msi_domain_set_affinity is only installed when NO_AFFINITY is clear.
  • Update multiple PCIe host controller MSI domain_info instances (DesignWare, Mediatek, VMD, Mobiveil, Altera, Broadcom STB, Xilinx NWL, Aardvark, Tegra, R-Car, Xilinx) to set MSI_FLAG_NO_AFFINITY.
  • Drop per-driver irq_set_affinity implementations or stubs from their MSI/INTx irq_chips, relying on the NO_AFFINITY behavior instead.
include/linux/msi.h
kernel/irq/msi.c
drivers/pci/controller/dwc/pcie-designware-host.c
drivers/pci/controller/pcie-mediatek-gen3.c
drivers/pci/controller/vmd.c
drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
drivers/pci/controller/pcie-altera-msi.c
drivers/pci/controller/pcie-brcmstb.c
drivers/pci/controller/pcie-mediatek.c
drivers/pci/controller/pcie-xilinx-nwl.c
drivers/pci/controller/pci-aardvark.c
drivers/pci/controller/pci-tegra.c
drivers/pci/controller/pcie-rcar-host.c
drivers/pci/controller/pcie-xilinx.c
drivers/pci/controller/dwc/pci-keystone.c
Add power-management support for UltraRISC DesignWare PCIe host and plumb it into the platform driver.
  • Extend ultrarisc_pcie struct to store per-MSI-controller irq_mask snapshots.
  • Implement ultrarisc_pcie_suspend to save pp->irq_mask[] under lock before suspend and ultrarisc_pcie_resume to restore them to software state and HW MSI mask registers.
  • Register these as .suspend and .resume callbacks in the ultrarisc_pcie platform_driver.
drivers/pci/controller/dwc/pcie-ultrarisc.c
Improve UltraRISC DP1000 pinctrl driver, its match data, and DT bindings to support per-pin pinconf via standard pinconf enums instead of custom macros.
  • Add num_ports to ur_pinctrl_match_data and initialize it for DP1000, enabling iteration over port descriptors.
  • Implement helpers to map a linear pin number to (port,pin) using the SoC port descriptors and to translate pinconf-generic configs into the driver’s ur_pin_val.conf bitfields.
  • Refactor ur_pin_config_set to use these helpers and apply configuration per pin, with better debug messages and error handling for invalid configs.
  • Adjust ur_set_pin_conf logging and minor allocations/cleanup patterns in the core driver for clarity; relax some unnecessary dev_err logging on alloc failure.
  • Update the DT binding schema to describe pinctrl-pins and pinconf-pins as PORT/PIN/FUNC or PORT/PIN/BIAS triplets rather than macro-expanded values, and rename/normalize UltraRISC naming.
  • Rework the ur-dp1000-pinctrl.h header to remove UR_DP1000_IOPAD and change UR_DP1000_BIAS to only encode pull/drive, matching the updated DT format.
drivers/pinctrl/ultrarisc/pinctrl-ultrarisc.c
drivers/pinctrl/ultrarisc/pinctrl-ultrarisc.h
drivers/pinctrl/ultrarisc/pinctrl-ultrarisc-dp1000.c
Documentation/devicetree/bindings/pinctrl/ultrarisc,dp1000-pinctrl.yaml
include/dt-bindings/pinctrl/ur-dp1000-pinctrl.h
Wire up new UltraRISC DP1000 "Titan" board support in the RISC-V device tree and enable its DTB build.
  • Add dp1000-titan-v1.dts and a Titan-specific pinctrl dtsi file, and convert the generic dp1000 .dts into a shared dp1000.dtsi include.
  • Update the ultrarisc DT Makefile to build the new dp1000-titan-v1.dtb alongside existing EVB and MO variants and stop building the old monolithic dp1000.dtb.
  • Introduce (or extend) board-specific pinctrl dtsi files for EVB and MO variants to align with the refactored base dp1000.dtsi layout (content not shown in diff).
arch/riscv/boot/dts/ultrarisc/Makefile
arch/riscv/boot/dts/ultrarisc/dp1000.dtsi
arch/riscv/boot/dts/ultrarisc/dp1000-evb-pinctrl.dtsi
arch/riscv/boot/dts/ultrarisc/dp1000-evb-v1.dts
arch/riscv/boot/dts/ultrarisc/dp1000-mo-pinctrl.dtsi
arch/riscv/boot/dts/ultrarisc/dp1000-mo-v1.dts
arch/riscv/boot/dts/ultrarisc/dp1000-titan-pinctrl.dtsi
arch/riscv/boot/dts/ultrarisc/dp1000-titan-v1.dts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link

Hi @WangJia-UR. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @WangJia-UR, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for the MilkV Titan board and backports PCIe MSI affinity handling and PLIC driver improvements for the UltraRISC DP1000 platform.

  • Introduces a new MSI_FLAG_NO_AFFINITY flag to handle PCI MSI controllers that don't support IRQ affinity steering
  • Refactors IRQ matrix allocation to use dynamic sizing instead of architecture-specific constants
  • Modernizes the RISC-V PLIC driver with fwnode support, improved locking, and early probe capability
  • Adds pinctrl driver improvements with proper pin-to-port/pin conversion and generic pinconf handling
  • Introduces device tree support for the MilkV Titan board

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
kernel/irq/msi.c Adds MSI_FLAG_NO_AFFINITY check to avoid setting affinity on unsupported controllers
kernel/irq/matrix.c Refactors to use dynamic allocation with struct_size for flexible matrix sizing
include/linux/msi.h Defines new MSI_FLAG_NO_AFFINITY flag and shifts MSI_FLAG_PCI_IMS
arch/x86/include/asm/hw_irq.h Removes architecture-specific IRQ_MATRIX_BITS constant
drivers/pci/controller/* Removes stub set_affinity implementations and adds MSI_FLAG_NO_AFFINITY across multiple controllers
drivers/pci/controller/dwc/pcie-ultrarisc.c Adds suspend/resume support with MSI mask state preservation
drivers/irqchip/irq-sifive-plic.c Major refactoring to use fwnode, improved error handling, IRQ-safe locking, and early probe support
drivers/irqchip/irq-riscv-intc.c Adds AIA interrupt handling and IEH support for 32-bit systems with extended interrupts
drivers/pinctrl/ultrarisc/* Refactors pinctrl driver with improved port/pin handling and generic pinconf translation
include/dt-bindings/pinctrl/ur-dp1000-pinctrl.h Updates pin configuration macros to remove port/pin from BIAS macro
arch/riscv/boot/dts/ultrarisc/* Adds Titan board DTS, updates EVB/MO board pinctrl, moves pinmux to dp1000.dtsi
Documentation/devicetree/bindings/pinctrl/* Updates binding documentation with new macro format
Comments suppressed due to low confidence (1)

drivers/pinctrl/ultrarisc/pinctrl-ultrarisc.c:514

  • The variable declaration for 'struct resource *res' should appear at the beginning of the function block, not in the middle after an if statement. This violates C89/C90 standards and may cause compilation issues with certain compilers. Move line 514 to the top of the function with other variable declarations.
	ur_pinctrl = devm_kzalloc(&pdev->dev, sizeof(*ur_pinctrl), GFP_KERNEL);
	if (!ur_pinctrl) {
		ret = -ENOMEM;
		goto free_pinctrl_desc;
	}
	struct resource *res;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{
const struct ur_port_desc *port_desc;

for (int i = 0; i < match_data->num_ports; i++) {
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loop variable 'i' is declared in the for loop initializer, which is a C99 feature. This may cause compilation issues with strict C89 compilers or certain kernel configurations. Declare 'i' at the beginning of the function instead.

Copilot uses AI. Check for mistakes.
dev_dbg(pctldev->dev, "%s(%d): pin=%d, num_configs=%d\n",
__func__, __LINE__, pin, num_configs);
pin_conf = (struct ur_pin_val *)configs;
for (int i = 0; i < num_configs; i++) {
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loop variable 'i' is declared in the for loop initializer, which is a C99 feature. This may cause compilation issues with strict C89 compilers or certain kernel configurations. Declare 'i' at the beginning of the function instead.

Copilot uses AI. Check for mistakes.
struct ultrarisc_pcie *ultrarisc_pcie = platform_get_drvdata(pdev);
struct dw_pcie *pci = ultrarisc_pcie->pci;
struct dw_pcie_rp *pp = &pci->pp;
int num_ctrls = pp->num_vectors / MAX_MSI_IRQS_PER_CTRL;
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential division by zero: if pp->num_vectors is less than MAX_MSI_IRQS_PER_CTRL (32), num_ctrls will be 0, causing the loop to be skipped but potentially leading to unexpected behavior. Consider adding a validation check or using DIV_ROUND_UP to ensure proper handling of edge cases.

Copilot uses AI. Check for mistakes.
struct ultrarisc_pcie *ultrarisc_pcie = platform_get_drvdata(pdev);
struct dw_pcie *pci = ultrarisc_pcie->pci;
struct dw_pcie_rp *pp = &pci->pp;
int num_ctrls = pp->num_vectors / MAX_MSI_IRQS_PER_CTRL;
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential division by zero: if pp->num_vectors is less than MAX_MSI_IRQS_PER_CTRL (32), num_ctrls will be 0, causing the loop to be skipped but potentially leading to unexpected behavior. Consider adding a validation check or using DIV_ROUND_UP to ensure proper handling of edge cases.

Copilot uses AI. Check for mistakes.
@opsiff
Copy link
Member

opsiff commented Dec 22, 2025

1.需要确认下以下fix是否需要
commit 678c607
Author: Anup Patel [email protected]
Date: Mon Feb 26 09:37:37 2024 +0530

irqchip/riscv-intc: Fix low-level interrupt handler setup for AIA

Use riscv_intc_aia_irq() as the low-level interrupt handler instead of the
existing riscv_intc_irq() default handler to make demultiplexing work
correctly.

Also print "using AIA" in the INTC boot banner when AIA is available.

Fixes: 3c46fc5b5507 ("irqchip/riscv-intc: Add support for RISC-V AIA")
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]

commit ca5b0b7
Author: Samuel Holland [email protected]
Date: Tue Mar 12 14:28:08 2024 -0700

irqchip/riscv-intc: Fix use of AIA interrupts 32-63 on riscv32

riscv_intc_custom_base is initialized to BITS_PER_LONG, so the second
check passes even though AIA provides 64 interrupts. Adjust the condition to
only check the custom range for interrupts outside the standard range, and
adjust the standard range when AIA is available.

Fixes: 3c46fc5b5507 ("irqchip/riscv-intc: Add support for RISC-V AIA")
Fixes: 678c607ecf8a ("irqchip/riscv-intc: Fix low-level interrupt handler setup for AIA")
Signed-off-by: Samuel Holland <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Link: https://lore.kernel.org/r/[email protected]

commit 6eabf65
Author: Charlie Jenkins [email protected]
Date: Tue Sep 3 16:36:19 2024 -0700

irqchip/sifive-plic: Return error code on failure

Set error to -ENOMEM if kcalloc() fails or if irq_domain_add_linear()
fails inside of plic_probe() instead of returning 0.

Fixes: 4d936f10ff80 ("irqchip/sifive-plic: Probe plic driver early for Allwinner D1 platform")
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Charlie Jenkins <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Reviewed-by: Alexandre Ghiti <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/all/20240903-correct_error_codes_sifive_plic-v1-1-d929b79663a2@rivosinc.com
Closes: https://lore.kernel.org/r/[email protected]/
  1. series 标题PCI: xxx : Silence 'set affinity failed' warning缺' '以及有缺失需要确认下下面补丁是否需要
    PCI: plda: Silence 'set affinity failed' warning

Marek Vasut and others added 17 commits December 22, 2025 16:29
mainline inclusion
from mainline-v6.12-rc1
commit 5297bba
category: feature
bugzilla: RVCK-Project/rvck#172

--------------------------------

Various PCIe controllers that mux MSIs onto single IRQ line produce these
"IRQ%d: set affinity failed" warnings when entering suspend. This has been
discussed before [1] [2] and an example test case is included at the end of
this commit message.

Controller drivers that create MSI IRQ domain with
MSI_FLAG_USE_DEF_CHIP_OPS and do not override the .irq_set_affinity()
irqchip callback get assigned the default msi_domain_set_affinity()
callback. That is not desired on controllers where it is not possible to
set affinity of each MSI IRQ line to a specific CPU core due to hardware
limitation.

Introduce flag MSI_FLAG_NO_AFFINITY, which keeps .irq_set_affinity() unset
if the controller driver did not assign it.  This way, migrate_one_irq()
can exit right away, without printing the warning. The .irq_set_affinity()
implementations which only return -EINVAL can be removed from multiple
controller drivers.

```
$ grep 25 /proc/interrupts
 25:   0 0 0 0 0 0 0 0   PCIe MSI   0   Edge   PCIe PME

$ echo core > /sys/power/pm_test ; echo mem > /sys/power/state
...
Disabling non-boot CPUs ...
IRQ25: set affinity failed(-22). <---------- This is being silenced here
psci: CPU7 killed (polled 4 ms)
...
```

[1] https://lore.kernel.org/all/[email protected]
[2] https://lore.kernel.org/all/[email protected]

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marek Vasut <[email protected]>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Damien Le Moal <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
mainline inclusion
from mainline-v6.12-rc1
commit 4dff9c3
category: feature
bugzilla: RVCK-Project/rvck#172

--------------------------------

Use MSI_FLAG_NO_AFFINITY, which keeps .irq_set_affinity() unset and allows
migrate_one_irq() to exit right away, without warnings like this:

  IRQ...: set affinity failed(-22)

Remove the .irq_set_affinity() implementation that is no longer needed.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marek Vasut <[email protected]>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
mainline inclusion
from mainline-v6.12-rc1
commit 114ca29
category: feature
bugzilla: RVCK-Project/rvck#172

--------------------------------

Use MSI_FLAG_NO_AFFINITY, which keeps .irq_set_affinity() unset and allows
migrate_one_irq() to exit right away, without warnings like this:

  IRQ...: set affinity failed(-22)

Remove the .irq_set_affinity() implementation that is no longer needed.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marek Vasut <[email protected]>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
mainline inclusion
from mainline-v6.12-rc1
commit c7b10ed
category: feature
bugzilla: RVCK-Project/rvck#172

--------------------------------

Use MSI_FLAG_NO_AFFINITY, which keeps .irq_set_affinity() unset and allows
migrate_one_irq() to exit right away, without warnings like this:

  IRQ...: set affinity failed(-22)

Remove the .irq_set_affinity() implementation that is no longer needed.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marek Vasut <[email protected]>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
mainline inclusion
from mainline-v6.12-rc1
commit 363d53a
category: feature
bugzilla: RVCK-Project/rvck#172

--------------------------------

Use MSI_FLAG_NO_AFFINITY, which keeps .irq_set_affinity() unset and allows
migrate_one_irq() to exit right away, without warnings like this:

  IRQ...: set affinity failed(-22)

Remove the .irq_set_affinity() implementation that is no longer needed.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marek Vasut <[email protected]>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Damien Le Moal <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
mainline inclusion
from mainline-v6.12-rc1
commit 425c075
category: feature
bugzilla: RVCK-Project/rvck#172

--------------------------------

Use MSI_FLAG_NO_AFFINITY, which keeps .irq_set_affinity() unset and allows
migrate_one_irq() to exit right away, without warnings like this:

  IRQ...: set affinity failed(-22)

Remove the .irq_set_affinity() implementation that is no longer needed.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marek Vasut <[email protected]>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Acked-by: Jianjun Wang <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
mainline inclusion
from mainline-v6.12-rc1
commit 63e4794
category: feature
bugzilla: RVCK-Project/rvck#172

--------------------------------

Use MSI_FLAG_NO_AFFINITY, which keeps .irq_set_affinity() unset and allows
migrate_one_irq() to exit right away, without warnings like this:

  IRQ...: set affinity failed(-22)

Remove the .irq_set_affinity() implementation that is no longer needed.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marek Vasut <[email protected]>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Acked-by: Jianjun Wang <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
mainline inclusion
from mainline-v6.12-rc1
commit 2a1297e
category: feature
bugzilla: RVCK-Project/rvck#172

--------------------------------

Use MSI_FLAG_NO_AFFINITY, which keeps .irq_set_affinity() unset and allows
migrate_one_irq() to exit right away, without warnings like this:

  IRQ...: set affinity failed(-22)

Remove the .irq_set_affinity() implementation that is no longer needed.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marek Vasut <[email protected]>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
mainline inclusion
from mainline-v6.12-rc1
commit 57d1992
category: feature
bugzilla: RVCK-Project/rvck#172

--------------------------------

Use MSI_FLAG_NO_AFFINITY, which keeps .irq_set_affinity() unset and allows
migrate_one_irq() to exit right away, without warnings like this:

  IRQ...: set affinity failed(-22)

Remove the .irq_set_affinity() implementation that is no longer needed.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marek Vasut <[email protected]>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
mainline inclusion
from mainline-v6.12-rc1
commit 7216311
category: feature
bugzilla: RVCK-Project/rvck#172

--------------------------------

Use MSI_FLAG_NO_AFFINITY, which keeps .irq_set_affinity() unset and allows
migrate_one_irq() to exit right away, without warnings like this:

  IRQ...: set affinity failed(-22)

Remove the .irq_set_affinity() implementation that is no longer needed.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marek Vasut <[email protected]>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
mainline inclusion
from mainline-v6.12-rc1
commit 647e965
category: feature
bugzilla: RVCK-Project/rvck#172

--------------------------------

Use MSI_FLAG_NO_AFFINITY, which keeps .irq_set_affinity() unset and allows
migrate_one_irq() to exit right away, without warnings like this:

  IRQ...: set affinity failed(-22)

Remove the .irq_set_affinity() implementation that is no longer needed.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marek Vasut <[email protected]>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Reviewed-by: Nirmal Patel <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
mainline inclusion
from mainline-v6.12-rc1
commit d5bba5b
category: feature
bugzilla: RVCK-Project/rvck#172

--------------------------------

Use MSI_FLAG_NO_AFFINITY, which keeps .irq_set_affinity() unset and allows
migrate_one_irq() to exit right away, without warnings like this:

  IRQ...: set affinity failed(-22)

Remove the .irq_set_affinity() implementation that is no longer needed.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marek Vasut <[email protected]>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
mainline inclusion
from mainline-v6.12-rc1
commit abd9b9d
category: feature
bugzilla: RVCK-Project/rvck#172

--------------------------------

Use MSI_FLAG_NO_AFFINITY, which keeps .irq_set_affinity() unset and allows
migrate_one_irq() to exit right away, without warnings like this:

  IRQ...: set affinity failed(-22)

Remove the .irq_set_affinity() implementation that is no longer needed.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marek Vasut <[email protected]>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
Set error to -ENOMEM if kcalloc() fails or if irq_domain_add_linear()
fails inside of plic_probe() instead of returning 0.

Fixes: 4d936f1 ("irqchip/sifive-plic: Probe plic driver early for Allwinner D1 platform")
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Charlie Jenkins <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Reviewed-by: Alexandre Ghiti <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/all/20240903-correct_error_codes_sifive_plic-v1-1-d929b79663a2@rivosinc.com
Closes: https://lore.kernel.org/r/[email protected]/
Signed-off-by: Jia Wang <[email protected]>
Use riscv_intc_aia_irq() as the low-level interrupt handler instead of the
existing riscv_intc_irq() default handler to make demultiplexing work
correctly.

Also print "using AIA" in the INTC boot banner when AIA is available.

Fixes: 3c46fc5 ("irqchip/riscv-intc: Add support for RISC-V AIA")
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jia Wang <[email protected]>
riscv_intc_custom_base is initialized to BITS_PER_LONG, so the second
check passes even though AIA provides 64 interrupts. Adjust the condition to
only check the custom range for interrupts outside the standard range, and
adjust the standard range when AIA is available.

Fixes: 3c46fc5 ("irqchip/riscv-intc: Add support for RISC-V AIA")
Fixes: 678c607 ("irqchip/riscv-intc: Fix low-level interrupt handler setup for AIA")
Signed-off-by: Samuel Holland <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jia Wang <[email protected]>
@WangJia-UR
Copy link
Contributor Author

commit 678c607

  1. 三个commit: 678c607, ca5b0b7, 6eabf65 已加入PR。
  2. commit msg丢失''问题已修复,6.6版本没有plda驱动,暂不需要合入对应的patch。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: opsiff

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@opsiff opsiff merged commit f80d6b2 into deepin-community:linux-6.6.y Dec 22, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants