mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-21 04:53:46 -04:00
crypto: hisilicon/qm - adjust order of device error configuration
In order to avoid reporting an exception but the error type is not configured, the driver needs to configure the error type first, and then enable the error interrupt. Before executing the task, hardware error initialization is needed so that the hardware can detect the error in time. Signed-off-by: Weili Qian <qianweili@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -440,43 +440,39 @@ static void sec_hw_error_enable(struct hisi_qm *qm)
|
||||
return;
|
||||
}
|
||||
|
||||
val = readl(qm->io_base + SEC_CONTROL_REG);
|
||||
|
||||
/* clear SEC hw error source if having */
|
||||
writel(SEC_CORE_INT_CLEAR, qm->io_base + SEC_CORE_INT_SOURCE);
|
||||
|
||||
/* enable SEC hw error interrupts */
|
||||
writel(SEC_CORE_INT_ENABLE, qm->io_base + SEC_CORE_INT_MASK);
|
||||
|
||||
/* enable RAS int */
|
||||
writel(SEC_RAS_CE_ENB_MSK, qm->io_base + SEC_RAS_CE_REG);
|
||||
writel(SEC_RAS_FE_ENB_MSK, qm->io_base + SEC_RAS_FE_REG);
|
||||
writel(SEC_RAS_NFE_ENB_MSK, qm->io_base + SEC_RAS_NFE_REG);
|
||||
|
||||
/* enable SEC block master OOO when m-bit error occur */
|
||||
val = readl(qm->io_base + SEC_CONTROL_REG);
|
||||
val = val | SEC_AXI_SHUTDOWN_ENABLE;
|
||||
|
||||
writel(val, qm->io_base + SEC_CONTROL_REG);
|
||||
|
||||
/* enable SEC hw error interrupts */
|
||||
writel(SEC_CORE_INT_ENABLE, qm->io_base + SEC_CORE_INT_MASK);
|
||||
}
|
||||
|
||||
static void sec_hw_error_disable(struct hisi_qm *qm)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
/* disable SEC hw error interrupts */
|
||||
writel(SEC_CORE_INT_DISABLE, qm->io_base + SEC_CORE_INT_MASK);
|
||||
|
||||
/* disable SEC block master OOO when m-bit error occur */
|
||||
val = readl(qm->io_base + SEC_CONTROL_REG);
|
||||
val = val & SEC_AXI_SHUTDOWN_DISABLE;
|
||||
writel(val, qm->io_base + SEC_CONTROL_REG);
|
||||
|
||||
/* disable RAS int */
|
||||
writel(SEC_RAS_DISABLE, qm->io_base + SEC_RAS_CE_REG);
|
||||
writel(SEC_RAS_DISABLE, qm->io_base + SEC_RAS_FE_REG);
|
||||
writel(SEC_RAS_DISABLE, qm->io_base + SEC_RAS_NFE_REG);
|
||||
|
||||
/* disable SEC hw error interrupts */
|
||||
writel(SEC_CORE_INT_DISABLE, qm->io_base + SEC_CORE_INT_MASK);
|
||||
|
||||
/* disable SEC block master OOO when m-bit error occur */
|
||||
val = val & SEC_AXI_SHUTDOWN_DISABLE;
|
||||
|
||||
writel(val, qm->io_base + SEC_CONTROL_REG);
|
||||
}
|
||||
|
||||
static u32 sec_clear_enable_read(struct sec_debug_file *file)
|
||||
|
||||
Reference in New Issue
Block a user