Skip to content

Commit 3875d0c

Browse files
Ahsan-Attagregkh
authored andcommitted
crypto: qat - disable 4xxx AE cluster when lead engine is fused off
[ Upstream commit b260d53 ] The get_ae_mask() function only disables individual engines based on the fuse register, but engines are organized in clusters of 4. If the lead engine of a cluster is fused off, the entire cluster must be disabled. Replace the single bitmask inversion with explicit test_bit() checks on the lead engine of each group, disabling the full ADF_AE_GROUP when the lead bit is set. Signed-off-by: Ahsan Atta <ahsan.atta@intel.com> Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Fixes: 8c82681 ("crypto: qat - add qat_4xxx driver") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 314dff6 commit 3875d0c

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,19 @@ static struct adf_hw_device_class adf_4xxx_class = {
101101

102102
static u32 get_ae_mask(struct adf_hw_device_data *self)
103103
{
104-
u32 me_disable = self->fuses[ADF_FUSECTL4];
104+
unsigned long fuses = self->fuses[ADF_FUSECTL4];
105+
u32 mask = ADF_4XXX_ACCELENGINES_MASK;
105106

106-
return ~me_disable & ADF_4XXX_ACCELENGINES_MASK;
107+
if (test_bit(0, &fuses))
108+
mask &= ~ADF_AE_GROUP_0;
109+
110+
if (test_bit(4, &fuses))
111+
mask &= ~ADF_AE_GROUP_1;
112+
113+
if (test_bit(8, &fuses))
114+
mask &= ~ADF_AE_GROUP_2;
115+
116+
return mask;
107117
}
108118

109119
static u32 get_accel_cap(struct adf_accel_dev *accel_dev)

0 commit comments

Comments
 (0)