crypto: qat - change admin sequence
authorGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Mon, 12 Oct 2020 20:38:26 +0000 (21:38 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 30 Oct 2020 06:34:49 +0000 (17:34 +1100)
Call adf_set_fw_constants() before adf_init_ae().

This is required by QAT GEN4 devices, which expect that the
FW_CONSTANTS_CFG command is sent to the admin AEs before the FW_INIT_AE
command.

Swapping the order of the two commands (FW_INIT_AE and FW_CONSTANTS_CFG)
is allowed in QAT GEN2 devices as the firmware can handle those in any
order.

Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com>
Reviewed-by: Wojciech Ziemba <wojciech.ziemba@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qat/qat_common/adf_admin.c

index 13a5e8659682a63d8ad72727a86cb92e5ec19b84..6d94746d266f83f43d9cd2c0e37f0ed7b70a331d 100644 (file)
@@ -206,11 +206,11 @@ int adf_send_admin_init(struct adf_accel_dev *accel_dev)
 {
        int ret;
 
-       ret = adf_init_ae(accel_dev);
+       ret = adf_set_fw_constants(accel_dev);
        if (ret)
                return ret;
 
-       return adf_set_fw_constants(accel_dev);
+       return adf_init_ae(accel_dev);
 }
 EXPORT_SYMBOL_GPL(adf_send_admin_init);