Skip to content

Commit c081f30

Browse files
Venkata Narendra Kumar GuttaAndy Gross
authored andcommitted
soc: qcom: Add support to register LLCC EDAC driver
Cache error reporting controller detects and reports single and double bit errors on Last Level Cache Controller (LLCC) cache. Add required support to register LLCC EDAC driver as platform driver, from LLCC driver. Signed-off-by: Venkata Narendra Kumar Gutta <[email protected]> Reviewed-by: Evan Green <[email protected]> Signed-off-by: Andy Gross <[email protected]>
1 parent 7f9c136 commit c081f30

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

drivers/soc/qcom/llcc-slice.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static int qcom_llcc_cfg_program(struct platform_device *pdev)
225225
u32 attr0_val;
226226
u32 max_cap_cacheline;
227227
u32 sz;
228-
int ret;
228+
int ret = 0;
229229
const struct llcc_slice_config *llcc_table;
230230
struct llcc_slice_desc desc;
231231

@@ -283,6 +283,7 @@ int qcom_llcc_probe(struct platform_device *pdev,
283283
struct resource *llcc_banks_res, *llcc_bcast_res;
284284
void __iomem *llcc_banks_base, *llcc_bcast_base;
285285
int ret, i;
286+
struct platform_device *llcc_edac;
286287

287288
drv_data = devm_kzalloc(dev, sizeof(*drv_data), GFP_KERNEL);
288289
if (!drv_data)
@@ -342,7 +343,20 @@ int qcom_llcc_probe(struct platform_device *pdev,
342343
mutex_init(&drv_data->lock);
343344
platform_set_drvdata(pdev, drv_data);
344345

345-
return qcom_llcc_cfg_program(pdev);
346+
ret = qcom_llcc_cfg_program(pdev);
347+
if (ret)
348+
return ret;
349+
350+
drv_data->ecc_irq = platform_get_irq(pdev, 0);
351+
if (drv_data->ecc_irq >= 0) {
352+
llcc_edac = platform_device_register_data(&pdev->dev,
353+
"qcom_llcc_edac", -1, drv_data,
354+
sizeof(*drv_data));
355+
if (IS_ERR(llcc_edac))
356+
dev_err(dev, "Failed to register llcc edac driver\n");
357+
}
358+
359+
return ret;
346360
}
347361
EXPORT_SYMBOL_GPL(qcom_llcc_probe);
348362

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ struct llcc_slice_config {
7878
* @num_banks: Number of llcc banks
7979
* @bitmap: Bit map to track the active slice ids
8080
* @offsets: Pointer to the bank offsets array
81+
* @ecc_irq: interrupt for llcc cache error detection and reporting
8182
*/
8283
struct llcc_drv_data {
8384
struct regmap *regmap;
@@ -89,6 +90,7 @@ struct llcc_drv_data {
8990
u32 num_banks;
9091
unsigned long *bitmap;
9192
u32 *offsets;
93+
int ecc_irq;
9294
};
9395

9496
#if IS_ENABLED(CONFIG_QCOM_LLCC)

0 commit comments

Comments
 (0)