Skip to content

Commit 06b30be

Browse files
Ahsan-Attagregkh
authored andcommitted
crypto: qat - disable 420xx AE cluster when lead engine is fused off
[ Upstream commit f216e0f ] 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: fcf60f4 ("crypto: qat - add support for 420xx devices") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6aef8e6 commit 06b30be

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,25 @@ static struct adf_hw_device_class adf_420xx_class = {
9696

9797
static u32 get_ae_mask(struct adf_hw_device_data *self)
9898
{
99-
u32 me_disable = self->fuses[ADF_FUSECTL4];
99+
unsigned long fuses = self->fuses[ADF_FUSECTL4];
100+
u32 mask = ADF_420XX_ACCELENGINES_MASK;
100101

101-
return ~me_disable & ADF_420XX_ACCELENGINES_MASK;
102+
if (test_bit(0, &fuses))
103+
mask &= ~ADF_AE_GROUP_0;
104+
105+
if (test_bit(4, &fuses))
106+
mask &= ~ADF_AE_GROUP_1;
107+
108+
if (test_bit(8, &fuses))
109+
mask &= ~ADF_AE_GROUP_2;
110+
111+
if (test_bit(12, &fuses))
112+
mask &= ~ADF_AE_GROUP_3;
113+
114+
if (test_bit(16, &fuses))
115+
mask &= ~ADF_AE_GROUP_4;
116+
117+
return mask;
102118
}
103119

104120
static u32 uof_get_num_objs(struct adf_accel_dev *accel_dev)

0 commit comments

Comments
 (0)