Skip to content

Commit c3cbdf3

Browse files
author
CKI KWF Bot
committed
Merge: crypto: qat: update Intel QAT crypto driver to v6.15-rc1
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/783 ``` JIRA: https://issues.redhat.com/browse/RHEL-72768 JIRA: https://issues.redhat.com/browse/RHEL-84366 Upstream Status: all 24 commits are merged into the linux.git Bring in the latest Intel QAT driver bugfixes and updates. One partial tree-wide commit limited to QAT driver scope. Signed-off-by: Vladis Dronov <vdronov@redhat.com> ``` Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: Herbert Xu <zxu@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 52c8322 + b4ac79c commit c3cbdf3

36 files changed

+437
-345
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
ccflags-y := -I $(src)/../qat_common
33
obj-$(CONFIG_CRYPTO_DEV_QAT_420XX) += qat_420xx.o
4-
qat_420xx-objs := adf_drv.o adf_420xx_hw_data.o
4+
qat_420xx-y := adf_drv.o adf_420xx_hw_data.o

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

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,19 @@ static const struct adf_fw_config adf_fw_dcc_config[] = {
9393
static struct adf_hw_device_class adf_420xx_class = {
9494
.name = ADF_420XX_DEVICE_NAME,
9595
.type = DEV_420XX,
96-
.instances = 0,
9796
};
9897

9998
static u32 get_ae_mask(struct adf_hw_device_data *self)
10099
{
101-
u32 me_disable = self->fuses;
100+
u32 me_disable = self->fuses[ADF_FUSECTL4];
102101

103102
return ~me_disable & ADF_420XX_ACCELENGINES_MASK;
104103
}
105104

106105
static u32 uof_get_num_objs(struct adf_accel_dev *accel_dev)
107106
{
108107
switch (adf_get_service_enabled(accel_dev)) {
109-
case SVC_CY:
110-
case SVC_CY2:
108+
case SVC_SYM_ASYM:
111109
return ARRAY_SIZE(adf_fw_cy_config);
112110
case SVC_DC:
113111
return ARRAY_SIZE(adf_fw_dc_config);
@@ -118,10 +116,8 @@ static u32 uof_get_num_objs(struct adf_accel_dev *accel_dev)
118116
case SVC_ASYM:
119117
return ARRAY_SIZE(adf_fw_asym_config);
120118
case SVC_ASYM_DC:
121-
case SVC_DC_ASYM:
122119
return ARRAY_SIZE(adf_fw_asym_dc_config);
123120
case SVC_SYM_DC:
124-
case SVC_DC_SYM:
125121
return ARRAY_SIZE(adf_fw_sym_dc_config);
126122
default:
127123
return 0;
@@ -131,8 +127,7 @@ static u32 uof_get_num_objs(struct adf_accel_dev *accel_dev)
131127
static const struct adf_fw_config *get_fw_config(struct adf_accel_dev *accel_dev)
132128
{
133129
switch (adf_get_service_enabled(accel_dev)) {
134-
case SVC_CY:
135-
case SVC_CY2:
130+
case SVC_SYM_ASYM:
136131
return adf_fw_cy_config;
137132
case SVC_DC:
138133
return adf_fw_dc_config;
@@ -143,10 +138,8 @@ static const struct adf_fw_config *get_fw_config(struct adf_accel_dev *accel_dev
143138
case SVC_ASYM:
144139
return adf_fw_asym_config;
145140
case SVC_ASYM_DC:
146-
case SVC_DC_ASYM:
147141
return adf_fw_asym_dc_config;
148142
case SVC_SYM_DC:
149-
case SVC_DC_SYM:
150143
return adf_fw_sym_dc_config;
151144
default:
152145
return NULL;
@@ -266,8 +259,7 @@ static u32 get_accel_cap(struct adf_accel_dev *accel_dev)
266259
}
267260

268261
switch (adf_get_service_enabled(accel_dev)) {
269-
case SVC_CY:
270-
case SVC_CY2:
262+
case SVC_SYM_ASYM:
271263
return capabilities_sym | capabilities_asym;
272264
case SVC_DC:
273265
return capabilities_dc;
@@ -284,10 +276,8 @@ static u32 get_accel_cap(struct adf_accel_dev *accel_dev)
284276
case SVC_ASYM:
285277
return capabilities_asym;
286278
case SVC_ASYM_DC:
287-
case SVC_DC_ASYM:
288279
return capabilities_asym | capabilities_dc;
289280
case SVC_SYM_DC:
290-
case SVC_DC_SYM:
291281
return capabilities_sym | capabilities_dc;
292282
default:
293283
return 0;
@@ -420,6 +410,7 @@ static void adf_gen4_set_err_mask(struct adf_dev_err_mask *dev_err_mask)
420410
dev_err_mask->parerr_cpr_xlt_mask = ADF_420XX_PARITYERRORMASK_CPR_XLT_MASK;
421411
dev_err_mask->parerr_dcpr_ucs_mask = ADF_420XX_PARITYERRORMASK_DCPR_UCS_MASK;
422412
dev_err_mask->parerr_pke_mask = ADF_420XX_PARITYERRORMASK_PKE_MASK;
413+
dev_err_mask->parerr_wat_wcp_mask = ADF_420XX_PARITYERRORMASK_WAT_WCP_MASK;
423414
dev_err_mask->ssmfeatren_mask = ADF_420XX_SSMFEATREN_MASK;
424415
}
425416

@@ -482,6 +473,7 @@ void adf_init_hw_data_420xx(struct adf_hw_device_data *hw_data, u32 dev_id)
482473
hw_data->get_hb_clock = adf_gen4_get_heartbeat_clock;
483474
hw_data->num_hb_ctrs = ADF_NUM_HB_CNT_PER_AE;
484475
hw_data->clock_frequency = ADF_420XX_AE_FREQ;
476+
hw_data->services_supported = adf_gen4_services_supported;
485477

486478
adf_gen4_set_err_mask(&hw_data->dev_err_mask);
487479
adf_gen4_init_hw_csr_ops(&hw_data->csr_ops);

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "adf_420xx_hw_data.h"
1515

1616
static const struct pci_device_id adf_pci_tbl[] = {
17-
{ PCI_VDEVICE(INTEL, ADF_420XX_PCI_DEVICE_ID), },
17+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_QAT_420XX) },
1818
{ }
1919
};
2020
MODULE_DEVICE_TABLE(pci, adf_pci_tbl);
@@ -79,7 +79,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
7979
adf_init_hw_data_420xx(accel_dev->hw_device, ent->device);
8080

8181
pci_read_config_byte(pdev, PCI_REVISION_ID, &accel_pci_dev->revid);
82-
pci_read_config_dword(pdev, ADF_GEN4_FUSECTL4_OFFSET, &hw_data->fuses);
82+
pci_read_config_dword(pdev, ADF_GEN4_FUSECTL4_OFFSET, &hw_data->fuses[ADF_FUSECTL4]);
8383

8484
/* Get Accelerators and Accelerators Engines masks */
8585
hw_data->accel_mask = hw_data->get_accel_mask(hw_data);
@@ -186,11 +186,19 @@ static void adf_remove(struct pci_dev *pdev)
186186
adf_cleanup_accel(accel_dev);
187187
}
188188

189+
static void adf_shutdown(struct pci_dev *pdev)
190+
{
191+
struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev);
192+
193+
adf_dev_down(accel_dev);
194+
}
195+
189196
static struct pci_driver adf_driver = {
190197
.id_table = adf_pci_tbl,
191198
.name = ADF_420XX_DEVICE_NAME,
192199
.probe = adf_probe,
193200
.remove = adf_remove,
201+
.shutdown = adf_shutdown,
194202
.sriov_configure = adf_sriov_configure,
195203
.err_handler = &adf_err_handler,
196204
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
22
ccflags-y := -I $(src)/../qat_common
33
obj-$(CONFIG_CRYPTO_DEV_QAT_4XXX) += qat_4xxx.o
4-
qat_4xxx-objs := adf_drv.o adf_4xxx_hw_data.o
4+
qat_4xxx-y := adf_drv.o adf_4xxx_hw_data.o

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,11 @@ static_assert(ARRAY_SIZE(adf_fw_cy_config) == ARRAY_SIZE(adf_fw_dcc_config));
9696
static struct adf_hw_device_class adf_4xxx_class = {
9797
.name = ADF_4XXX_DEVICE_NAME,
9898
.type = DEV_4XXX,
99-
.instances = 0,
10099
};
101100

102101
static u32 get_ae_mask(struct adf_hw_device_data *self)
103102
{
104-
u32 me_disable = self->fuses;
103+
u32 me_disable = self->fuses[ADF_FUSECTL4];
105104

106105
return ~me_disable & ADF_4XXX_ACCELENGINES_MASK;
107106
}
@@ -178,8 +177,7 @@ static u32 get_accel_cap(struct adf_accel_dev *accel_dev)
178177
}
179178

180179
switch (adf_get_service_enabled(accel_dev)) {
181-
case SVC_CY:
182-
case SVC_CY2:
180+
case SVC_SYM_ASYM:
183181
return capabilities_sym | capabilities_asym;
184182
case SVC_DC:
185183
return capabilities_dc;
@@ -196,10 +194,8 @@ static u32 get_accel_cap(struct adf_accel_dev *accel_dev)
196194
case SVC_ASYM:
197195
return capabilities_asym;
198196
case SVC_ASYM_DC:
199-
case SVC_DC_ASYM:
200197
return capabilities_asym | capabilities_dc;
201198
case SVC_SYM_DC:
202-
case SVC_DC_SYM:
203199
return capabilities_sym | capabilities_dc;
204200
default:
205201
return 0;
@@ -241,8 +237,7 @@ static u32 uof_get_num_objs(struct adf_accel_dev *accel_dev)
241237
static const struct adf_fw_config *get_fw_config(struct adf_accel_dev *accel_dev)
242238
{
243239
switch (adf_get_service_enabled(accel_dev)) {
244-
case SVC_CY:
245-
case SVC_CY2:
240+
case SVC_SYM_ASYM:
246241
return adf_fw_cy_config;
247242
case SVC_DC:
248243
return adf_fw_dc_config;
@@ -253,10 +248,8 @@ static const struct adf_fw_config *get_fw_config(struct adf_accel_dev *accel_dev
253248
case SVC_ASYM:
254249
return adf_fw_asym_config;
255250
case SVC_ASYM_DC:
256-
case SVC_DC_ASYM:
257251
return adf_fw_asym_dc_config;
258252
case SVC_SYM_DC:
259-
case SVC_DC_SYM:
260253
return adf_fw_sym_dc_config;
261254
default:
262255
return NULL;
@@ -428,13 +421,13 @@ void adf_init_hw_data_4xxx(struct adf_hw_device_data *hw_data, u32 dev_id)
428421
hw_data->admin_ae_mask = ADF_4XXX_ADMIN_AE_MASK;
429422
hw_data->num_rps = ADF_GEN4_MAX_RPS;
430423
switch (dev_id) {
431-
case ADF_402XX_PCI_DEVICE_ID:
424+
case PCI_DEVICE_ID_INTEL_QAT_402XX:
432425
hw_data->fw_name = ADF_402XX_FW;
433426
hw_data->fw_mmp_name = ADF_402XX_MMP;
434427
hw_data->uof_get_name = uof_get_name_402xx;
435428
hw_data->get_ena_thd_mask = get_ena_thd_mask;
436429
break;
437-
case ADF_401XX_PCI_DEVICE_ID:
430+
case PCI_DEVICE_ID_INTEL_QAT_401XX:
438431
hw_data->fw_name = ADF_4XXX_FW;
439432
hw_data->fw_mmp_name = ADF_4XXX_MMP;
440433
hw_data->uof_get_name = uof_get_name_4xxx;
@@ -466,6 +459,7 @@ void adf_init_hw_data_4xxx(struct adf_hw_device_data *hw_data, u32 dev_id)
466459
hw_data->get_hb_clock = adf_gen4_get_heartbeat_clock;
467460
hw_data->num_hb_ctrs = ADF_NUM_HB_CNT_PER_AE;
468461
hw_data->clock_frequency = ADF_4XXX_AE_FREQ;
462+
hw_data->services_supported = adf_gen4_services_supported;
469463

470464
adf_gen4_set_err_mask(&hw_data->dev_err_mask);
471465
adf_gen4_init_hw_csr_ops(&hw_data->csr_ops);

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
#include "adf_4xxx_hw_data.h"
1515

1616
static const struct pci_device_id adf_pci_tbl[] = {
17-
{ PCI_VDEVICE(INTEL, ADF_4XXX_PCI_DEVICE_ID), },
18-
{ PCI_VDEVICE(INTEL, ADF_401XX_PCI_DEVICE_ID), },
19-
{ PCI_VDEVICE(INTEL, ADF_402XX_PCI_DEVICE_ID), },
17+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_QAT_4XXX) },
18+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_QAT_401XX) },
19+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_QAT_402XX) },
2020
{ }
2121
};
2222
MODULE_DEVICE_TABLE(pci, adf_pci_tbl);
@@ -81,7 +81,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
8181
adf_init_hw_data_4xxx(accel_dev->hw_device, ent->device);
8282

8383
pci_read_config_byte(pdev, PCI_REVISION_ID, &accel_pci_dev->revid);
84-
pci_read_config_dword(pdev, ADF_GEN4_FUSECTL4_OFFSET, &hw_data->fuses);
84+
pci_read_config_dword(pdev, ADF_GEN4_FUSECTL4_OFFSET, &hw_data->fuses[ADF_FUSECTL4]);
8585

8686
/* Get Accelerators and Accelerators Engines masks */
8787
hw_data->accel_mask = hw_data->get_accel_mask(hw_data);
@@ -188,11 +188,19 @@ static void adf_remove(struct pci_dev *pdev)
188188
adf_cleanup_accel(accel_dev);
189189
}
190190

191+
static void adf_shutdown(struct pci_dev *pdev)
192+
{
193+
struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev);
194+
195+
adf_dev_down(accel_dev);
196+
}
197+
191198
static struct pci_driver adf_driver = {
192199
.id_table = adf_pci_tbl,
193200
.name = ADF_4XXX_DEVICE_NAME,
194201
.probe = adf_probe,
195202
.remove = adf_remove,
203+
.shutdown = adf_shutdown,
196204
.sriov_configure = adf_sriov_configure,
197205
.err_handler = &adf_err_handler,
198206
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
ccflags-y := -I $(src)/../qat_common
33
obj-$(CONFIG_CRYPTO_DEV_QAT_C3XXX) += qat_c3xxx.o
4-
qat_c3xxx-objs := adf_drv.o adf_c3xxx_hw_data.o
4+
qat_c3xxx-y := adf_drv.o adf_c3xxx_hw_data.o

drivers/crypto/intel/qat/qat_c3xxx/adf_c3xxx_hw_data.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ static const u32 thrd_to_arb_map[ADF_C3XXX_MAX_ACCELENGINES] = {
2222
static struct adf_hw_device_class c3xxx_class = {
2323
.name = ADF_C3XXX_DEVICE_NAME,
2424
.type = DEV_C3XXX,
25-
.instances = 0
2625
};
2726

2827
static u32 get_accel_mask(struct adf_hw_device_data *self)
2928
{
29+
u32 fuses = self->fuses[ADF_FUSECTL0];
3030
u32 straps = self->straps;
31-
u32 fuses = self->fuses;
3231
u32 accel;
3332

3433
accel = ~(fuses | straps) >> ADF_C3XXX_ACCELERATORS_REG_OFFSET;
@@ -39,8 +38,8 @@ static u32 get_accel_mask(struct adf_hw_device_data *self)
3938

4039
static u32 get_ae_mask(struct adf_hw_device_data *self)
4140
{
41+
u32 fuses = self->fuses[ADF_FUSECTL0];
4242
u32 straps = self->straps;
43-
u32 fuses = self->fuses;
4443
unsigned long disabled;
4544
u32 ae_disable;
4645
int accel;

drivers/crypto/intel/qat/qat_c3xxx/adf_drv.c

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,6 @@
1919
#include <adf_dbgfs.h>
2020
#include "adf_c3xxx_hw_data.h"
2121

22-
static const struct pci_device_id adf_pci_tbl[] = {
23-
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_QAT_C3XXX), },
24-
{ }
25-
};
26-
MODULE_DEVICE_TABLE(pci, adf_pci_tbl);
27-
28-
static int adf_probe(struct pci_dev *dev, const struct pci_device_id *ent);
29-
static void adf_remove(struct pci_dev *dev);
30-
31-
static struct pci_driver adf_driver = {
32-
.id_table = adf_pci_tbl,
33-
.name = ADF_C3XXX_DEVICE_NAME,
34-
.probe = adf_probe,
35-
.remove = adf_remove,
36-
.sriov_configure = adf_sriov_configure,
37-
.err_handler = &adf_err_handler,
38-
};
39-
4022
static void adf_cleanup_pci_dev(struct adf_accel_dev *accel_dev)
4123
{
4224
pci_release_regions(accel_dev->accel_pci_dev.pci_dev);
@@ -126,7 +108,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
126108
adf_init_hw_data_c3xxx(accel_dev->hw_device);
127109
pci_read_config_byte(pdev, PCI_REVISION_ID, &accel_pci_dev->revid);
128110
pci_read_config_dword(pdev, ADF_DEVICE_FUSECTL_OFFSET,
129-
&hw_data->fuses);
111+
&hw_data->fuses[ADF_FUSECTL0]);
130112
pci_read_config_dword(pdev, ADF_C3XXX_SOFTSTRAP_CSR_OFFSET,
131113
&hw_data->straps);
132114

@@ -227,6 +209,29 @@ static void adf_remove(struct pci_dev *pdev)
227209
kfree(accel_dev);
228210
}
229211

212+
static void adf_shutdown(struct pci_dev *pdev)
213+
{
214+
struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev);
215+
216+
adf_dev_down(accel_dev);
217+
}
218+
219+
static const struct pci_device_id adf_pci_tbl[] = {
220+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_QAT_C3XXX) },
221+
{ }
222+
};
223+
MODULE_DEVICE_TABLE(pci, adf_pci_tbl);
224+
225+
static struct pci_driver adf_driver = {
226+
.id_table = adf_pci_tbl,
227+
.name = ADF_C3XXX_DEVICE_NAME,
228+
.probe = adf_probe,
229+
.remove = adf_remove,
230+
.shutdown = adf_shutdown,
231+
.sriov_configure = adf_sriov_configure,
232+
.err_handler = &adf_err_handler,
233+
};
234+
230235
static int __init adfdrv_init(void)
231236
{
232237
request_module("intel_qat");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
ccflags-y := -I $(src)/../qat_common
33
obj-$(CONFIG_CRYPTO_DEV_QAT_C3XXXVF) += qat_c3xxxvf.o
4-
qat_c3xxxvf-objs := adf_drv.o adf_c3xxxvf_hw_data.o
4+
qat_c3xxxvf-y := adf_drv.o adf_c3xxxvf_hw_data.o

0 commit comments

Comments
 (0)