ras: phytium: update phytium ras controller driver support to 6.6.0.4#1726
ras: phytium: update phytium ras controller driver support to 6.6.0.4#1726wangchenlu2236 wants to merge 2 commits into
Conversation
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>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideExtends 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 flowsequenceDiagram
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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
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 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. |
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In
ghes_do_proc(), consider using the already-derivedsevvalue when populatingstruct ghes_mem_errinstead ofgdata->error_severityto keep severity handling consistent with the existingghes_report_chaininvocation. - If
ghes_mem_erris meant only to expose data to notifiers, you might want to make themem_errpointerconst 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>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| mem.severity = gdata->error_severity; | ||
| mem.mem_err = mem_err; |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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_errand declare newghes_mem_err_chainnotifier ininclude/acpi/ghes.h. - Define and export
ghes_mem_err_chainand invoke it fromghes_do_proc()alongside the existingghes_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.
|
/approve |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
I think that there are them from ... |
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:
Enhancements: