Skip to content

Commit 0a97195

Browse files
Rajendra Nayakandersson
authored andcommitted
EDAC/qcom: Make irq configuration optional
On most modern qualcomm SoCs, the configuration necessary to enable the Tag/Data RAM related irqs being propagated to the SoC irq controller is already done in firmware (in DSF or 'DDR System Firmware') On some like the x1e80100, these registers aren't even accesible to the kernel causing a crash when edac device is probed. Hence, make the irq configuration optional in the driver and mark x1e80100 as the SoC on which this should be avoided. Fixes: af16b00 ("arm64: dts: qcom: Add base X1E80100 dtsi and the QCP dts") Reported-by: Bjorn Andersson <[email protected]> Signed-off-by: Rajendra Nayak <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Abel Vesa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent ca61d68 commit 0a97195

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

drivers/edac/qcom_edac.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,11 @@ static int qcom_llcc_edac_probe(struct platform_device *pdev)
342342
int ecc_irq;
343343
int rc;
344344

345-
rc = qcom_llcc_core_setup(llcc_driv_data, llcc_driv_data->bcast_regmap);
346-
if (rc)
347-
return rc;
345+
if (!llcc_driv_data->ecc_irq_configured) {
346+
rc = qcom_llcc_core_setup(llcc_driv_data, llcc_driv_data->bcast_regmap);
347+
if (rc)
348+
return rc;
349+
}
348350

349351
/* Allocate edac control info */
350352
edev_ctl = edac_device_alloc_ctl_info(0, "qcom-llcc", 1, "bank",

drivers/soc/qcom/llcc-qcom.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ struct qcom_llcc_config {
139139
int size;
140140
bool need_llcc_cfg;
141141
bool no_edac;
142+
bool irq_configured;
142143
};
143144

144145
struct qcom_sct_config {
@@ -718,6 +719,7 @@ static const struct qcom_llcc_config x1e80100_cfg[] = {
718719
.need_llcc_cfg = true,
719720
.reg_offset = llcc_v2_1_reg_offset,
720721
.edac_reg_offset = &llcc_v2_1_edac_reg_offset,
722+
.irq_configured = true,
721723
},
722724
};
723725

@@ -1345,6 +1347,7 @@ static int qcom_llcc_probe(struct platform_device *pdev)
13451347
drv_data->cfg = llcc_cfg;
13461348
drv_data->cfg_size = sz;
13471349
drv_data->edac_reg_offset = cfg->edac_reg_offset;
1350+
drv_data->ecc_irq_configured = cfg->irq_configured;
13481351
mutex_init(&drv_data->lock);
13491352
platform_set_drvdata(pdev, drv_data);
13501353

include/linux/soc/qcom/llcc-qcom.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ struct llcc_edac_reg_offset {
125125
* @num_banks: Number of llcc banks
126126
* @bitmap: Bit map to track the active slice ids
127127
* @ecc_irq: interrupt for llcc cache error detection and reporting
128+
* @ecc_irq_configured: 'True' if firmware has already configured the irq propagation
128129
* @version: Indicates the LLCC version
129130
*/
130131
struct llcc_drv_data {
@@ -139,6 +140,7 @@ struct llcc_drv_data {
139140
u32 num_banks;
140141
unsigned long *bitmap;
141142
int ecc_irq;
143+
bool ecc_irq_configured;
142144
u32 version;
143145
};
144146

0 commit comments

Comments
 (0)