Skip to content

Irq 6.6.y: phytium: update phytium Irq controller driver support to 6.6.0.4 - #2220

Merged
opsiff merged 3 commits into
deepin-community:linux-6.6.yfrom
wangchenlu2236:irq-6.6.y
Oct 22, 2026
Merged

opsiff merged 3 commits into
deepin-community:linux-6.6.yfrom
wangchenlu2236:irq-6.6.y

Conversation

@wangchenlu2236

@wangchenlu2236 wangchenlu2236 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

This patches updates the support for phytium Irq controller driver.

  1. Add SMMU workaround for Phytium Ps17064
    2.Phytium: Slove the error on aarch32 compiler
  2. Phytium: Fix incorrect MSI compose logic on Phytium PS17064 SoCs

Summary by Sourcery

Improve Phytium PS17064 IOMMU and interrupt-controller compatibility for the 6.6 kernel.

Bug Fixes:

  • Fix MSI message composition for Phytium PS17064 SoCs.
  • Resolve Phytium-specific ARM SMMU issues on PS17064 systems.

Enhancements:

  • Set Phytium PS17064 systems to use the identity IOMMU domain by default when required by the SMMU workaround.
  • Add Phytium-specific compatibility support for AArch32 builds.

There are two hacks needed for IOMMU enablement on Phytium
Ps17064 SoC. One is the MSI hack, the other is the SMMU hack.

When using this enablement, we assumes that users would set
CONIFIG_IOMMU_DEFAULT_PASSTHROUGH=y or pass 'iommu.passthrough=on'
or 'iommu.pt' as the kernel command-line parameters. Therefore,
we also force default iommu domain type to IOMMU_DOMAIN_IDENTITY
on Ps17064 to avoid unnecessary troubles.

Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Wang Chenlu <wangchenlu2236@phytium.com.cn>
When compiling with the aarch32 compiler, the arm64-specific macros were
not defined. Add restriction to bring these macros only into effect
on arm64 architecture.

Mainline: NA
Signed-off-by: Li Mingzhe <limingzhe1839@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Signed-off-by: Wang Chenlu <wangchenlu2236@phytium.com.cn>
Fix the logic in its_irq_compose_msi() where CONFIG_ARCH_PHYTIUM
filtering accidentally changed the original behavior.
Now iommu_dma_compose_msi_msg() is skipped only on PS17064 SoCs,
and executed on all other platforms as intended.

Mainline: NA
Signed-off-by: Li Mingzhe <limingzhe1839@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Signed-off-by: Wang Chenlu <wangchenlu2236@phytium.com.cn>
@sourcery-ai

sourcery-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Updates Phytium IRQ/IOMMU support for PS17064 by applying a CPU-specific SMMU firmware-ID workaround, forcing identity/passthrough IOMMU defaults, and skipping generic IOMMU MSI composition to preserve correct ITS MSI routing.

Sequence diagram for Phytium PS17064 IRQ and IOMMU handling

sequenceDiagram
    participant Device
    participant SMMU as ARM_SMMU
    participant IOMMU as IOMMU_Core
    participant ITS as GICv3_ITS

    Note over IOMMU,SMMU: PS17064 selects identity/passthrough IOMMU domains
    Device->>SMMU: arm_smmu_probe_device()
    SMMU->>SMMU: iommu_fwspec_add_ids()
    SMMU-->>Device: Register with corrected firmware IDs

    Device->>ITS: its_irq_compose_msi_msg()
    ITS->>ITS: its_get_event_id()
    ITS-->>Device: Return ITS MSI message without iommu_dma_compose_msi_msg()
Loading

File-Level Changes

Change Details Files
Adds a Phytium PS17064-specific SMMU stream-ID workaround and forces identity/default passthrough behavior on that SoC.
  • Detects PS17064 CPUs and duplicates firmware IDs using the required transformed format before SMMU probing.
  • Defines the firmware-ID conversion helper and CPU-type dependencies under CONFIG_ARCH_PHYTIUM.
  • Forces the IOMMU default domain to identity/passthrough for PS17064, including when configured through the domain-type parameter.
drivers/iommu/arm/arm-smmu/arm-smmu.c
drivers/iommu/arm/arm-smmu/arm-smmu.h
drivers/iommu/iommu.c
Corrects MSI composition for Phytium PS17064 by bypassing generic IOMMU MSI address translation.
  • Returns after composing the ITS MSI address and event ID on PS17064 instead of calling iommu_dma_compose_msi_msg().
drivers/irqchip/irq-gic-v3-its.c

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
Copy Markdown

Hi @wangchenlu2236. 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.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign dongert for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved issues affect firmware-spec memory safety, stream mapping correctness, non-Arm compilation, and MSI delivery in translated domains.

5 open issues
What changed in this PR

This PR updates Phytium PS17064 support in the kernel’s IOMMU and interrupt-controller code, adding an SMMU workaround and changing MSI address handling.

Changes:

  • Append read-side stream-ID aliases for the PS17064 SMMU workaround.
  • Force identity-domain defaults on PS17064 systems.
  • Bypass IOMMU MSI address composition on PS17064 CPUs.
File Description
drivers/​irqchip/​irq-gic-v3-its.c Adds the PS17064 MSI composition bypass.
drivers/​iommu/​iommu.c Selects identity domains for PS17064 systems.
drivers/​iommu/​arm/​arm-smmu/​arm-smmu.h Adds the CPU header and stream-ID alias macro.
drivers/​iommu/​arm/​arm-smmu/​arm-smmu.c Appends PS17064 stream aliases during device probing.

Review effort: Balanced

for (i = 0; i < num; i++) {
u32 fwid = FWID_READ(fwspec->ids[i]);

iommu_fwspec_add_ids(dev, &fwid, 1);
#ifndef _ARM_SMMU_H
#define _ARM_SMMU_H

#include <asm/cputype.h>
Comment on lines +1739 to 1743
#ifdef CONFIG_ARCH_PHYTIUM
if ((read_cpuid_id() & MIDR_CPU_MODEL_MASK) == MIDR_PHYTIUM_PS17064)
return;
#endif
iommu_dma_compose_msi_msg(irq_data_get_msi_desc(d), msg);
int num = fwspec->num_ids;

for (i = 0; i < num; i++) {
u32 fwid = FWID_READ(fwspec->ids[i]);
#include <linux/types.h>

#ifdef CONFIG_ARCH_PHYTIUM
#define FWID_READ(id) (((u16)(id) >> 3) | (((id) >> 16 | 0x7000) << 16))
@opsiff
opsiff merged commit e793c1a into deepin-community:linux-6.6.y Oct 22, 2026
13 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.

4 participants