Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: qat - fix bar discovery for c62x

Some accelerators of the c62x series have only two bars.
This patch skips BAR0 if the accelerator does not have it.

Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Giovanni Cabiddu and committed by
Herbert Xu
4f78ce87 ac6d9a2c

+2 -1
+1 -1
drivers/crypto/qat/qat_c62x/adf_drv.c
··· 233 233 &hw_data->accel_capabilities_mask); 234 234 235 235 /* Find and map all the device's BARS */ 236 - i = 0; 236 + i = (hw_data->fuses & ADF_DEVICE_FUSECTL_MASK) ? 1 : 0; 237 237 bar_mask = pci_select_bars(pdev, IORESOURCE_MEM); 238 238 for_each_set_bit(bar_nr, (const unsigned long *)&bar_mask, 239 239 ADF_PCI_MAX_BARS * 2) {
+1
drivers/crypto/qat/qat_common/adf_accel_devices.h
··· 69 69 #define ADF_ERRSOU5 (0x3A000 + 0xD8) 70 70 #define ADF_DEVICE_FUSECTL_OFFSET 0x40 71 71 #define ADF_DEVICE_LEGFUSE_OFFSET 0x4C 72 + #define ADF_DEVICE_FUSECTL_MASK 0x80000000 72 73 #define ADF_PCI_MAX_BARS 3 73 74 #define ADF_DEVICE_NAME_LENGTH 32 74 75 #define ADF_ETR_MAX_RINGS_PER_BANK 16