-
Notifications
You must be signed in to change notification settings - Fork 3
alert_L module for handling oob alerts #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev-a1
Are you sure you want to change the base?
Conversation
status = "okay"; | ||
gpios = <<pi0_gpio 20 GPIO_ACTIVE_LOW>; | ||
sbrmi = <&sbrmi_p0_iod0>; | ||
sbtsi = <&sbtsi_p0_iod0>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is &sbtsi_p0_iod1 missing for Congo platforms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated &sbtsi_p0_iod1 for Congo platform
include/uapi/linux/amd-apml.h
Outdated
#define BIT(n) (1U << (n)) | ||
#endif | ||
|
||
enum apml_ras_alert_src { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we calling this ras alert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to apml_alert_src
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add apml_alert dts changes in Kenya and Nigeria device trees as well.
Also, change congo to Congo, morcco to Morocco in one of the commit message.
drivers/misc/amd-apml/apml_alertl.c
Outdated
.of_match_table = of_match_ptr(apml_alertl_dt_ids), | ||
}, | ||
.probe = apml_alertl_probe, | ||
.remove = alert_remove, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for uniformity, change alret_remove to apml_alaertl_remove()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
drivers/misc/amd-apml/apml_alertl.c
Outdated
return 0; | ||
} | ||
|
||
static int alert_remove(struct platform_device *pdev) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change name to apml_alertl_remove()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
drivers/misc/amd-apml/apml_alertl.c
Outdated
|
||
snprintf(sock, sizeof(sock), "Socket=0x%x", soc_die_num); | ||
snprintf(src, sizeof(src), "Source=0x%x", alert_src); | ||
pr_err("apml_alertl:Sock:0x%x Src:0x%x\n", soc_die_num, alert_src); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean to have pr_err() here? should it be pr_dbg()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that's correct.
moved all the logging to dev_dbg/dev_err
drivers/misc/amd-apml/apml_alertl.c
Outdated
* 0x3c, 0x4c -> Socket 0, die 0, | ||
* 0x44 -> Socket 0, die 1, | ||
* 0x38, 0x48 -> Socket 1, die 0, | ||
* 0x4c -> Socket 1, die 1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo ? 0x45?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, corrected
return ret; | ||
} | ||
|
||
static u8 static_addr_to_socket(u8 static_addr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this rule is valid incase 2X1P configuration boot .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per my understanding
2X1P and 2P can be used interchangeably.
As the PID and static address are related to Socket and Die ID which are stored in CSR registers(RO)
This should be valid.
drivers/misc/amd-apml/apml_alertl.c
Outdated
return 0; | ||
} | ||
|
||
static irqreturn_t alert_l_irq_thread_handler(int irq, void *dev_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error Handling , general: Since this is alert handling, it's better to follow a best-effort approach for error handling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the input.
Update the same
@@ -894,6 +894,17 @@ | |||
#endif | |||
}; | |||
|
|||
/ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message : start with ARM64:dts:aspeed:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -0,0 +1,50 @@ | |||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message Please align with upstream style : dt-bindings: misc: apml-alert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Please ensure your commit message style aligns with the conventions used in the relevant upstream directory |
gpio: | ||
maxItems: 1 | ||
description: | | ||
GPIO specifier for APML Alert_L line. Specify GPIO controller, GPIO pin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: white space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will update, thanks
drivers/misc/amd-apml/apml_alertl.c
Outdated
|
||
MODULE_ALIAS("apml_alertl:" DRIVER_NAME); | ||
|
||
/* Read TSI Status register to identify the RAS error */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: correct the comment
drivers/misc/amd-apml/apml_alertl.c
Outdated
snprintf(sock, sizeof(sock), "Socket=0x%x", soc_die_num); | ||
snprintf(src, sizeof(src), "Source=0x%x", alert_src); | ||
|
||
dev_err(dev, "Sending uevent: Sock:0x%x Src:0x%x\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dev_err will overwhelm the journalctl/dmesg. change it to dev_dbg(). should be able to enable it at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Udpated
drivers/misc/amd-apml/apml_alertl.c
Outdated
return IRQ_NONE; | ||
|
||
for (i = 0; i < oob_adata->num_of_tsi_devs; i++) { | ||
rt_src = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can be removed. no effect statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
drivers/misc/amd-apml/apml_alertl.c
Outdated
rt_src = 0; | ||
/* Check for NULL pointer */ | ||
if (IS_ERR_OR_NULL(oob_adata->tsi_dev[i])) { | ||
dev_err(dev, "TSI device does not exist\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add "i", and any other data to the log, will be more helpful during debug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, added
drivers/misc/amd-apml/apml_alertl.c
Outdated
msg.data_in.reg_in[REG_OFF_INDEX] = TSI_STATUS_REG; | ||
|
||
mutex_lock(&oob_adata->tsi_dev[soc_die_num]->lock); | ||
ret = regmap_read(oob_adata->tsi_dev[soc_die_num]->regmap, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the regmap_read() fails for any reason, does *temp_status set to zero?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temp_status is initialized to zero
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temp_status is initialized outside of the for loop(). In case of failures, we are checking the previously returned by the previous iteration.
drivers/misc/amd-apml/apml_alertl.c
Outdated
/* Check for TSI alert */ | ||
ret = tsi_alert_check(oob_adata, &temp_status, i); | ||
if (ret < 0) | ||
dev_err(dev, "Failed to read TSI status register\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional data in the error logging will be of great help during debugging. Add more context to the logging.
drivers/misc/amd-apml/apml_alertl.c
Outdated
if (ret < 0) | ||
dev_err(dev, "Failed to read TSI status register\n"); | ||
|
||
if (!temp_status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temp_status is not guaranteed to set to zero incase of failures. add this check to the previous check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temp_status initialized to zero. On failure, temp_status remains zero
drivers/misc/amd-apml/apml_alertl.c
Outdated
rt_src = (temp_status << 24); | ||
static_addr = oob_adata->tsi_dev[i]->dev_static_addr; | ||
|
||
ret = send_uevent(static_addr, rt_src, dev); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rt_src can be replaced with (temp_status << 24). rt_src is not used anywhere else. Same with the variable static_addr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
drivers/misc/amd-apml/apml_alertl.c
Outdated
|
||
ret = send_uevent(static_addr, rt_src, dev); | ||
if (ret) | ||
dev_err(dev, "Failed to send TSI uevent Err: %d\n", ret); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add (temp_status << 24), and oob_adata->tsi_dev[i]->dev_static_addr to logging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added more info
drivers/misc/amd-apml/apml_alertl.c
Outdated
struct device *dev = oob_adata->dev; | ||
unsigned int ras_status = 0; | ||
unsigned int temp_status = 0; | ||
u32 rt_src = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optimization: rt_src, and static_addr variables are not needed/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
drivers/misc/amd-apml/apml_alertl.c
Outdated
|
||
static irqreturn_t alert_l_irq_thread_handler(int irq, void *dev_id) | ||
{ | ||
struct apml_alertl_data *oob_adata = dev_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to cast?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessarily. i have updated. Thanks
drivers/misc/amd-apml/apml_alertl.c
Outdated
|
||
/* Check for TSI alert */ | ||
ret = tsi_alert_check(oob_adata, &temp_status, i); | ||
if (ret < 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsi_alrert_check() returns 0 if the input parameters are invalid. Change this condition to "<=" or change the tsi_alert_check() to return a negative integer incase of input error validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not required with new changes
drivers/misc/amd-apml/apml_alertl.c
Outdated
int ret; | ||
|
||
if (!oob_adata->rmi_dev[soc_die_num] || !oob_adata->rmi_dev[soc_die_num]->regmap) | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to a negative value. 0 return code is ==> success
drivers/misc/amd-apml/apml_alertl.c
Outdated
int ret; | ||
|
||
if (!oob_adata->tsi_dev[soc_die_num] || !oob_adata->tsi_dev[soc_die_num]->regmap) | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return negative integer in case of error.
drivers/misc/amd-apml/apml_alertl.c
Outdated
int ret, i; | ||
|
||
if (!oob_adata || atomic_read(&oob_adata->removed)) | ||
return IRQ_NONE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log the error message?
|
||
of_node_put(d_node); | ||
apml_dev = dev_get_drvdata(dev); | ||
if (IS_ERR_OR_NULL(apml_dev)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add an error log message.
drivers/misc/amd-apml/apml_alertl.c
Outdated
return 0; | ||
msg.data_in.reg_in[REG_OFF_INDEX] = TSI_STATUS_REG; | ||
|
||
mutex_lock(&oob_adata->tsi_dev[soc_die_num]->lock); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mutex_lock() can sleep. As far as I know it is not safe to use mutex_lock() in an irq context. check for any alternatives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lock is called inthe bottom half of the irq, mutex lock can be invoked in bottom half.
drivers/misc/amd-apml/apml_alertl.c
Outdated
struct apml_alertl_data *oob_alert; | ||
struct gpio_desc *alertl_gpiod; | ||
u32 irq_num; | ||
u32 num_dev = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to initialize to zero. num_dev can be eliminated.
drivers/misc/amd-apml/apml_alertl.c
Outdated
for (i = 0; i < oob_alert->num_of_rmi_devs; i++) { | ||
rmi_dev[i] = get_apml_dev_byphandle(pdev->dev.of_node, "sbrmi", i); | ||
if (!rmi_dev[i]) { | ||
dev_err(dev, "Error getting APML SBRMI device\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guideline suggests not to log any error to avoid spam. I am not sure though.
drivers/misc/amd-apml/apml_alertl.c
Outdated
rmi_dev[i] = get_apml_dev_byphandle(pdev->dev.of_node, "sbrmi", i); | ||
if (!rmi_dev[i]) { | ||
dev_err(dev, "Error getting APML SBRMI device\n"); | ||
return -EPROBE_DEFER; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we are expecting the probe to be deferred and return, TSI device could never get probed? Not sure. pls check. I dont know how to continue either..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Driver returns -ENODEV, as all the tsi/rmi for all the sockets need to be available before alert_l driver to function.
drivers/misc/amd-apml/apml_alertl.c
Outdated
struct gpio_desc *alertl_gpiod; | ||
u32 irq_num; | ||
u32 num_dev = 0; | ||
int ret = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to initialize to 0.
drivers/misc/amd-apml/apml_alertl.c
Outdated
u32 irq_num; | ||
u32 num_dev = 0; | ||
int ret = 0; | ||
int i = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to initialize to 0.
drivers/misc/amd-apml/apml_alertl.c
Outdated
irq_num = ret; | ||
dev_dbg(dev, "Register IRQ:%u\n", irq_num); | ||
/* | ||
* TODO: naming can be updated for the irq on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this still a TODO, or just a miss?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing out. Done!
* over I3C. We can add property in dts to identify the bus type | ||
*/ | ||
|
||
for (i = 0; i < oob_alert->num_of_rmi_devs; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are the mutex locks initialized for RMI and TSI devices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mutex locks are initialized in respective RMI and TSI drivers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check comments.
@@ -24,3 +24,14 @@ config APML_SBTSI | |||
|
|||
This driver can also be built as a module. If so, the module will | |||
be called apml_sbtsi. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: commit message "driver:amd-apml: Add Alert_L support for event monitoring"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
drivers/misc/amd-apml/Kconfig
Outdated
default n | ||
help | ||
If you say yes here you get support for emulated alertl | ||
interface on AMD SoCs with APML interface connected to a BMC device. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT:
Alert_L may be asserted for various conditions, including machine check
exceptions, system fatal errors, APML command completions, and thermal
alerts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, updated!
drivers/misc/amd-apml/apml_alertl.c
Outdated
@@ -0,0 +1,390 @@ | |||
// SPDX-License-Identifier: GPL-2.0-or-later | |||
/* | |||
* alert_l.c - Alert_l driver for AMD APML devices |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix file name apml_alertl.c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks
drivers/misc/amd-apml/apml_alertl.c
Outdated
/* | ||
* alert_l.c - Alert_l driver for AMD APML devices | ||
* | ||
* Copyright (C) 2022-2023 Advanced Micro Devices, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2025-2026?
drivers/misc/amd-apml/apml_alertl.c
Outdated
* Copyright (C) 2022-2023 Advanced Micro Devices, Inc. | ||
*/ | ||
|
||
#include <linux/debugfs.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: reorder based Kernel coding style
Ordering Logic:
Core kernel headers: module.h, init.h
Platform and device-related: platform_device.h, interrupt.h, regmap.h
Peripheral interfaces: gpio, debugfs, i3c
Device tree support: of.h, of_gpio.h
Local headers: "sbrmi-common.h" comes last
#include <linux/module.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/regmap.h>
#include <linux/gpio/consumer.h>
#include <linux/debugfs.h>
#include <linux/i3c/device.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the info. We have been following the alphabetical order of arranging headers.
drivers/misc/amd-apml/apml_alertl.c
Outdated
#define DRIVER_NAME "apml_alertl" | ||
|
||
#define RAS_STATUS_REG 0x4C | ||
#define STATUS_REG 0x2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT be constient on formating.
[AMD Official Use Only - AMD Internal Distribution Only]
Temp_status is initialized to zero outside of the loop. It will get modified in the for() loop. Imagine a case where in the first iteration of the loop is successful and the second iteration fails. Then we are checking on the temp_status updated in the last successful transaction.
From: sathyapk ***@***.***>
Sent: Wednesday, August 13, 2025 2:38 AM
To: AMDESE/linux-aspeed ***@***.***>
Cc: Kurapati, Mahesh ***@***.***>; Review requested ***@***.***>
Subject: Re: [AMDESE/linux-aspeed] alert_L module for handling oob alerts (PR #143)
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
@sathyapk commented on this pull request.
________________________________
In drivers/misc/amd-apml/apml_alertl.c<#143 (comment)>:
+ return IRQ_NONE;
+
+ for (i = 0; i < oob_adata->num_of_tsi_devs; i++) {
+ rt_src = 0;
+ /* Check for NULL pointer */
+ if (IS_ERR_OR_NULL(oob_adata->tsi_dev[i])) {
+ dev_err(dev, "TSI device does not exist\n");
+ return IRQ_NONE;
+ }
+
+ /* Check for TSI alert */
+ ret = tsi_alert_check(oob_adata, &temp_status, i);
+ if (ret < 0)
+ dev_err(dev, "Failed to read TSI status register\n");
+
+ if (!temp_status)
temp_status initialized to zero. On failure, temp_status remains zero
—
Reply to this email directly, view it on GitHub<#143 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BCUUIJVER2A6ERYLZVAJHCT3NLTMFAVCNFSM6AAAAAB7HM3CZ2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTCMJUGMYTKNBRGM>.
You are receiving this because your review was requested.Message ID: ***@***.******@***.***>>
|
[AMD Official Use Only - AMD Internal Distribution Only]
How does the apml_library know the structure of the event? Is there a header file defined for it? Imagine a case where in the user wants to use the events directly with out the library interface. Is it not possible? Library also runs in the user space.
From: sathyapk ***@***.***>
Sent: Wednesday, August 13, 2025 2:39 AM
To: AMDESE/linux-aspeed ***@***.***>
Cc: Kurapati, Mahesh ***@***.***>; Review requested ***@***.***>
Subject: Re: [AMDESE/linux-aspeed] alert_L module for handling oob alerts (PR #143)
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
@sathyapk commented on this pull request.
________________________________
In drivers/misc/amd-apml/apml_alertl.c<#143 (comment)>:
+ char sock[MAX_SOC_LEN];
+ char src[MAX_ERR_LEN];
+ char *alert_source[] = { sock, src, NULL };
+
+ soc_die_num = static_addr_to_socket(static_address);
+ if (soc_die_num == 0xFF) {
+ dev_err(dev, "Device static address not valid\n");
+ return -ENODEV;
+ }
+
+ snprintf(sock, sizeof(sock), "Socket=0x%x", soc_die_num);
+ snprintf(src, sizeof(src), "Source=0x%x", alert_src);
+
+ dev_err(dev, "Sending uevent: Sock:0x%x Src:0x%x\n",
+ soc_die_num, alert_src);
+ kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, alert_source);
apml_library is the interface to the alert_l driver. user space application should call apml library api's to interpret the data
—
Reply to this email directly, view it on GitHub<#143 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BCUUIJVI6KJ4DOPVIEDGKOT3NLTRPAVCNFSM6AAAAAB7HM3CZ2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTCMJUGMYTSNZXGM>.
You are receiving this because your review was requested.Message ID: ***@***.******@***.***>>
|
[AMD Official Use Only - AMD Internal Distribution Only]
Bottom halfs are called/handled as part of work queues as far as I remember. I could be wrong. Function tsi_alert_check() is called in “static irqreturn_t alert_l_irq_thread_handler(int irq, void *dev_id)” which is an irq handler.
From: sathyapk ***@***.***>
Sent: Wednesday, August 13, 2025 2:40 AM
To: AMDESE/linux-aspeed ***@***.***>
Cc: Kurapati, Mahesh ***@***.***>; Review requested ***@***.***>
Subject: Re: [AMDESE/linux-aspeed] alert_L module for handling oob alerts (PR #143)
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
@sathyapk commented on this pull request.
________________________________
In drivers/misc/amd-apml/apml_alertl.c<#143 (comment)>:
+#define MAX_SOC_LEN 11
+#define MAX_ERR_LEN 18
+
+MODULE_ALIAS("apml_alertl:" DRIVER_NAME);
+
+/* Read TSI Status register to identify the RAS error */
+static int tsi_alert_check(struct apml_alertl_data *oob_adata, int *temp_status, u8 soc_die_num)
+{
+ struct apml_message msg = { 0 };
+ int ret;
+
+ if (!oob_adata->tsi_dev[soc_die_num] || !oob_adata->tsi_dev[soc_die_num]->regmap)
+ return 0;
+ msg.data_in.reg_in[REG_OFF_INDEX] = TSI_STATUS_REG;
+
+ mutex_lock(&oob_adata->tsi_dev[soc_die_num]->lock);
Lock is called inthe bottom half of the irq, mutex lock can be invoked in bottom half.
—
Reply to this email directly, view it on GitHub<#143 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BCUUIJUEFFVKKDKFMC2L3CT3NLTVRAVCNFSM6AAAAAB7HM3CZ2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTCMJUGMZDEOBVGU>.
You are receiving this because your review was requested.Message ID: ***@***.******@***.***>>
|
[AMD Official Use Only - AMD Internal Distribution Only]
I need to understand more on how the mutexes initialized in a different driver can be accessed in this driver. Something new for me. How do you enforce the probe order()? First sbrmi, sbtsi and then apml_alertl?
From: sathyapk ***@***.***>
Sent: Wednesday, August 13, 2025 2:45 AM
To: AMDESE/linux-aspeed ***@***.***>
Cc: Kurapati, Mahesh ***@***.***>; Review requested ***@***.***>
Subject: Re: [AMDESE/linux-aspeed] alert_L module for handling oob alerts (PR #143)
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
@sathyapk commented on this pull request.
________________________________
In drivers/misc/amd-apml/apml_alertl.c<#143 (comment)>:
+ /* Allocate memory as per the number of TSI devices */
+ tsi_dev = devm_kzalloc(dev, oob_alert->num_of_tsi_devs * sizeof(struct apml_sbtsi_device),
+ GFP_KERNEL);
+ if (!tsi_dev)
+ return -ENOMEM;
+
+ oob_alert->tsi_dev = tsi_dev;
+ oob_alert->dev = dev;
+
+ /*
+ * For each of the Alerts get the device associated
+ * Currently the ALert_L driver identification is only supported
+ * over I3C. We can add property in dts to identify the bus type
+ */
+
+ for (i = 0; i < oob_alert->num_of_rmi_devs; i++) {
The mutex locks are initialized in respective RMI and TSI drivers.
—
Reply to this email directly, view it on GitHub<#143 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BCUUIJTJHUOSPXIDWSXSLEL3NLUI5AVCNFSM6AAAAAB7HM3CZ2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTCMJUGM2DCNRTHA>.
You are receiving this because your review was requested.Message ID: ***@***.******@***.***>>
|
This is a miss, thanks for pointing it out. I will fix this. |
There are multiple ways to implement bottom half, like softirqs, tasklets, workqueue, threaded irq handler. |
Alert_l driver is dependent on rmi and tsi driver taken care in Kconfig |
Move out the sbtsi device structure to a common header file and add device matching helper function for I2C and I3C buses. This is required to add support for the APML Alert_L module which needs access to sbtsi device struct and device matching capability. Reviewed-by: Naveen Krishna Chatradhi <[email protected]> Signed-off-by: Akshay Gupta <[email protected]>
Processors from AMD provide APML ALERT_L for BMC users to monitor events. APML Alert_L is asserted in multiple events, - Machine Check Exception occurs within the system - The processor alerts the SBI on system fatal error event - Set by hardware as a result of a 0x71/0x72/0x73 command completion - Set by firmware to indicate the completion of a mailbox operation - High/Low Temperature Alert APML Alert_L module define uevents to notify registered userspace processes of the alert event. Reviewed-by: Naveen Krishna Chatradhi <[email protected]> Signed-off-by: Akshay Gupta <[email protected]> Signed-off-by: sathya priya kumar <[email protected]>
-Add alertl node for P1 and P2 host processor in Morocco platform. -Add alertl node for P1 host processor in Congo platform. Reviewed-by: Naveen Krishna Chatradhi <[email protected]> Signed-off-by: Akshay Gupta <[email protected]> Signed-off-by: sathya priya kumar <[email protected]>
-Add alertl node for P1 and P2 host processor in Nigeria platform. -Add alertl node for P1 host processor in Kenya platform. Reviewed-by: Naveen Krishna Chatradhi <[email protected]> Signed-off-by: Akshay Gupta <[email protected]> Signed-off-by: sathya priya kumar <[email protected]>
-Document device-tree bindings for APML Alert_L driver. Reviewed-by: Naveen Krishna Chatradhi <[email protected]> Signed-off-by: Akshay Gupta <[email protected]> Signed-off-by: sathya priya kumar <[email protected]> (cherry picked from commit 0f54429)
splitting the previous PR 135