Skip to content

ras: phytium: update phytium ras controller driver support to 6.6.0.4#1726

Open
wangchenlu2236 wants to merge 2 commits into
deepin-community:linux-6.6.yfrom
wangchenlu2236:ras-6.6.y
Open

ras: phytium: update phytium ras controller driver support to 6.6.0.4#1726
wangchenlu2236 wants to merge 2 commits into
deepin-community:linux-6.6.yfrom
wangchenlu2236:ras-6.6.y

Conversation

@wangchenlu2236
Copy link
Copy Markdown

@wangchenlu2236 wangchenlu2236 commented May 15, 2026

This patches updates the support for phytium ras controller driver.

1.GHES: Add a notify chain for process memory section.
2.GHES: Add ghes_mem_err_chain notify chain for process memory section

Summary by Sourcery

Extend GHES memory error handling to expose richer contextual information via a new notifier chain for platform memory error sections.

New Features:

  • Introduce a dedicated atomic notifier chain for GHES platform memory errors to allow external consumers to subscribe to memory error events.

Enhancements:

  • Include notification type and severity alongside CPER memory error records when invoking the new memory error notifier chain.

Xie XiuQi and others added 2 commits May 15, 2026 17:06
Add a notify chain for process memory section, with which
other modules might do error recovery.

Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
Tested-by: Wang Xiongfeng <wangxiongfeng2@huawei.com>
Tested-by: Tyler Baicar <tbaicar@codeaurora.org>
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Tested-by: Peng Min <pengmin1540@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Signed-off-by: Wang Chenlu <wangchenlu2236@phytium.com.cn>
In some scenarios where memory errors occur, we need to invoke the
callback function of the ghes_mem_err_chain to trigger SEA.

Mainline: NA
Signed-off-by: Peng Min <pengmin1540@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Signed-off-by: Wang Chenlu <wangchenlu2236@phytium.com.cn>
@deepin-ci-robot deepin-ci-robot requested review from BLumia and myml May 15, 2026 09:14
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 15, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Extends GHES memory error handling by introducing a new atomic notifier chain dedicated to memory error sections, including a new context struct and wiring it into existing platform memory error processing.

Sequence diagram for updated GHES memory error notification flow

sequenceDiagram
    participant GHES
    participant ghes_mem_err_chain
    participant ghes_report_chain
    participant arch_apei

    GHES->>GHES: ghes_do_proc
    GHES->>GHES: acpi_hest_get_payload
    GHES->>ghes_mem_err_chain: atomic_notifier_call_chain
    GHES->>ghes_report_chain: atomic_notifier_call_chain
    GHES->>arch_apei: arch_apei_report_mem_error
Loading

File-Level Changes

Change Details Files
Add a dedicated atomic notifier chain for GHES memory error sections and expose it to other subsystems.
  • Declare and initialize a new atomic notifier head for memory errors using ATOMIC_NOTIFIER_HEAD
  • Export the new notifier chain symbol for use by external modules
drivers/acpi/apei/ghes.c
Provide richer context for memory error notifications and integrate the new chain into GHES memory error processing.
  • Define a ghes_mem_err struct carrying notifier type, severity, and the underlying cper_sec_mem_err pointer
  • Declare the new ghes_mem_err_chain in the public GHES header for consumers
  • In ghes_do_proc, when handling CPER_SEC_PLATFORM_MEM, populate a ghes_mem_err instance and invoke the new atomic notifier chain before the existing ghes_report_chain
drivers/acpi/apei/ghes.c
include/acpi/ghes.h

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.

Copy link
Copy Markdown

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

Hey - I've found 1 issue, and left some high level feedback:

  • In ghes_do_proc(), consider using the already-derived sev value when populating struct ghes_mem_err instead of gdata->error_severity to keep severity handling consistent with the existing ghes_report_chain invocation.
  • If ghes_mem_err is meant only to expose data to notifiers, you might want to make the mem_err pointer const struct cper_sec_mem_err * and propagate const-correctness to consumers to prevent accidental modification of the CPER payload.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `ghes_do_proc()`, consider using the already-derived `sev` value when populating `struct ghes_mem_err` instead of `gdata->error_severity` to keep severity handling consistent with the existing `ghes_report_chain` invocation.
- If `ghes_mem_err` is meant only to expose data to notifiers, you might want to make the `mem_err` pointer `const struct cper_sec_mem_err *` and propagate const-correctness to consumers to prevent accidental modification of the CPER payload.

## Individual Comments

### Comment 1
<location path="drivers/acpi/apei/ghes.c" line_range="711-712" />
<code_context>
+			struct ghes_mem_err mem;
+
+			mem.notify_type = ghes->generic->notify.type;
+			mem.severity = gdata->error_severity;
+			mem.mem_err = mem_err;

+			atomic_notifier_call_chain(&ghes_mem_err_chain, 0, &mem);
</code_context>
<issue_to_address>
**issue:** Consider using the normalized `sev` value instead of raw `gdata->error_severity` for the notifier payload.

`ghes_report_chain` uses the normalized `sev` (derived from `gdata->error_severity`), but `ghes_mem_err_chain` embeds the raw `gdata->error_severity` in `mem.severity`. This means consumers of the two chains will see different severity scales. To keep semantics consistent, either store `sev` in `mem.severity` as well, or clearly distinguish the raw value via naming (e.g. `raw_severity`).
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread drivers/acpi/apei/ghes.c
Comment on lines +711 to +712
mem.severity = gdata->error_severity;
mem.mem_err = mem_err;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue: Consider using the normalized sev value instead of raw gdata->error_severity for the notifier payload.

ghes_report_chain uses the normalized sev (derived from gdata->error_severity), but ghes_mem_err_chain embeds the raw gdata->error_severity in mem.severity. This means consumers of the two chains will see different severity scales. To keep semantics consistent, either store sev in mem.severity as well, or clearly distinguish the raw value via naming (e.g. raw_severity).

Copy link
Copy Markdown

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

Adds a new atomic notifier chain ghes_mem_err_chain for GHES platform memory error sections, passing notify type, severity, and the CPER memory error record together so external consumers (Phytium RAS controller driver) can react with richer context.

Changes:

  • Define struct ghes_mem_err and declare new ghes_mem_err_chain notifier in include/acpi/ghes.h.
  • Define and export ghes_mem_err_chain and invoke it from ghes_do_proc() alongside the existing ghes_report_chain.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
include/acpi/ghes.h Adds struct ghes_mem_err and declares new atomic notifier chain.
drivers/acpi/apei/ghes.c Defines/exports the chain and calls it for each CPER memory error section.

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

@Avenger-285714
Copy link
Copy Markdown
Member

/approve

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Avenger-285714

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

opsiff commented May 15, 2026

I think that there are them from ...
https://lore.kernel.org/all/1516969885-150532-1-git-send-email-xiexiuqi@huawei.com/
Is it suitable for kernel v6.6???

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.

5 participants