crypto: qat - enable VF irq after guest exits ungracefully
authorZeng Xin <xin.zeng@intel.com>
Thu, 10 Dec 2015 05:38:30 +0000 (21:38 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 14 Dec 2015 13:03:36 +0000 (21:03 +0800)
The VF bundle interrupt is not triggered any more in
the case when guest is shut down with sample app running.
Need to clear the flag interrupt bit when restarting to fix
this irrecoverable state.

Signed-off-by: Zeng Xin <xin.zeng@intel.com>
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qat/qat_common/adf_transport.c
drivers/crypto/qat/qat_common/adf_transport_access_macros.h

index a6f3766a74f024b4820022b9a2ef124126f2989f..57d2622728a57c638c080d5b1c613450081978bb 100644 (file)
@@ -345,7 +345,7 @@ void adf_response_handler(uintptr_t bank_addr)
 {
        struct adf_etr_bank_data *bank = (void *)bank_addr;
 
-       /* Handle all the responses nad reenable IRQs */
+       /* Handle all the responses and reenable IRQs */
        adf_ring_response_handler(bank);
        WRITE_CSR_INT_FLAG_AND_COL(bank->csr_addr, bank->bank_number,
                                   bank->irq_mask);
@@ -434,6 +434,7 @@ static int adf_init_bank(struct adf_accel_dev *accel_dev,
                goto err;
        }
 
+       WRITE_CSR_INT_FLAG(csr_addr, bank_num, ADF_BANK_INT_FLAG_CLEAR_MASK);
        WRITE_CSR_INT_SRCSEL(csr_addr, bank_num);
        return 0;
 err:
index 6ad7e4e1edcadd2a839ed866791b0dfb0d60cb47..80e02a2a0a0902a05e65a1c0e5461350b4453a87 100644 (file)
 #include "adf_accel_devices.h"
 #define ADF_BANK_INT_SRC_SEL_MASK_0 0x4444444CUL
 #define ADF_BANK_INT_SRC_SEL_MASK_X 0x44444444UL
+#define ADF_BANK_INT_FLAG_CLEAR_MASK 0xFFFF
 #define ADF_RING_CSR_RING_CONFIG 0x000
 #define ADF_RING_CSR_RING_LBASE 0x040
 #define ADF_RING_CSR_RING_UBASE 0x080
 #define ADF_RING_CSR_RING_HEAD 0x0C0
 #define ADF_RING_CSR_RING_TAIL 0x100
 #define ADF_RING_CSR_E_STAT 0x14C
+#define ADF_RING_CSR_INT_FLAG  0x170
 #define ADF_RING_CSR_INT_SRCSEL 0x174
 #define ADF_RING_CSR_INT_SRCSEL_2 0x178
 #define ADF_RING_CSR_INT_COL_EN 0x17C
@@ -144,6 +146,9 @@ do { \
 #define WRITE_CSR_RING_TAIL(csr_base_addr, bank, ring, value) \
        ADF_CSR_WR(csr_base_addr, (ADF_RING_BUNDLE_SIZE * bank) + \
                ADF_RING_CSR_RING_TAIL + (ring << 2), value)
+#define WRITE_CSR_INT_FLAG(csr_base_addr, bank, value) \
+       ADF_CSR_WR(csr_base_addr, (ADF_RING_BUNDLE_SIZE * (bank)) + \
+                       ADF_RING_CSR_INT_FLAG, value)
 #define WRITE_CSR_INT_SRCSEL(csr_base_addr, bank) \
 do { \
        ADF_CSR_WR(csr_base_addr, (ADF_RING_BUNDLE_SIZE * bank) + \