Commit e17ced2c authored by Thor Thayer's avatar Thor Thayer Committed by Borislav Petkov

EDAC, altera: Extract error inject operations to a struct fops

In preparation for the Arria10 peripheral ECCs, extract the inject file
operations because the Arria10 IRQ trigger mechanism is different than
Cyclone5/Arria5 and Arria10 L2 cache.
Signed-off-by: default avatarThor Thayer <tthayer@opensource.altera.com>
Cc: devicetree@vger.kernel.org
Cc: dinguyen@opensource.altera.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux@arm.linux.org.uk
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/1459450087-24792-2-git-send-email-tthayer@opensource.altera.comSigned-off-by: default avatarBorislav Petkov <bp@suse.de>
parent ff6fd147
...@@ -668,7 +668,7 @@ static void altr_create_edacdev_dbgfs(struct edac_device_ctl_info *edac_dci, ...@@ -668,7 +668,7 @@ static void altr_create_edacdev_dbgfs(struct edac_device_ctl_info *edac_dci,
if (!edac_debugfs_create_file(priv->dbgfs_name, S_IWUSR, if (!edac_debugfs_create_file(priv->dbgfs_name, S_IWUSR,
drvdata->debugfs_dir, edac_dci, drvdata->debugfs_dir, edac_dci,
&altr_edac_device_inject_fops)) priv->inject_fops))
debugfs_remove_recursive(drvdata->debugfs_dir); debugfs_remove_recursive(drvdata->debugfs_dir);
} }
...@@ -886,6 +886,7 @@ const struct edac_device_prv_data ocramecc_data = { ...@@ -886,6 +886,7 @@ const struct edac_device_prv_data ocramecc_data = {
.ue_set_mask = (ALTR_OCR_ECC_EN | ALTR_OCR_ECC_INJD), .ue_set_mask = (ALTR_OCR_ECC_EN | ALTR_OCR_ECC_INJD),
.set_err_ofst = ALTR_OCR_ECC_REG_OFFSET, .set_err_ofst = ALTR_OCR_ECC_REG_OFFSET,
.trig_alloc_sz = ALTR_TRIG_OCRAM_BYTE_SIZE, .trig_alloc_sz = ALTR_TRIG_OCRAM_BYTE_SIZE,
.inject_fops = &altr_edac_device_inject_fops,
}; };
#endif /* CONFIG_EDAC_ALTERA_OCRAM */ #endif /* CONFIG_EDAC_ALTERA_OCRAM */
...@@ -975,6 +976,7 @@ const struct edac_device_prv_data l2ecc_data = { ...@@ -975,6 +976,7 @@ const struct edac_device_prv_data l2ecc_data = {
.ue_set_mask = (ALTR_L2_ECC_EN | ALTR_L2_ECC_INJD), .ue_set_mask = (ALTR_L2_ECC_EN | ALTR_L2_ECC_INJD),
.set_err_ofst = ALTR_L2_ECC_REG_OFFSET, .set_err_ofst = ALTR_L2_ECC_REG_OFFSET,
.trig_alloc_sz = ALTR_TRIG_L2C_BYTE_SIZE, .trig_alloc_sz = ALTR_TRIG_L2C_BYTE_SIZE,
.inject_fops = &altr_edac_device_inject_fops,
}; };
const struct edac_device_prv_data a10_l2ecc_data = { const struct edac_device_prv_data a10_l2ecc_data = {
...@@ -991,6 +993,7 @@ const struct edac_device_prv_data a10_l2ecc_data = { ...@@ -991,6 +993,7 @@ const struct edac_device_prv_data a10_l2ecc_data = {
.set_err_ofst = ALTR_A10_L2_ECC_INJ_OFST, .set_err_ofst = ALTR_A10_L2_ECC_INJ_OFST,
.ecc_irq_handler = altr_edac_a10_l2_irq, .ecc_irq_handler = altr_edac_a10_l2_irq,
.trig_alloc_sz = ALTR_TRIG_L2C_BYTE_SIZE, .trig_alloc_sz = ALTR_TRIG_L2C_BYTE_SIZE,
.inject_fops = &altr_edac_device_inject_fops,
}; };
#endif /* CONFIG_EDAC_ALTERA_L2C */ #endif /* CONFIG_EDAC_ALTERA_L2C */
......
...@@ -262,6 +262,7 @@ struct edac_device_prv_data { ...@@ -262,6 +262,7 @@ struct edac_device_prv_data {
irqreturn_t (*ecc_irq_handler)(struct altr_edac_device_dev *dci, irqreturn_t (*ecc_irq_handler)(struct altr_edac_device_dev *dci,
bool sb); bool sb);
int trig_alloc_sz; int trig_alloc_sz;
const struct file_operations *inject_fops;
}; };
struct altr_edac_device_dev { struct altr_edac_device_dev {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment