Commit 66550304 authored by Allan, Bruce W's avatar Allan, Bruce W Committed by Herbert Xu

crypto: qat - make error and info log messages more descriptive

Convert pr_info() and pr_err() log messages to dev_info() and dev_err(),
respectively, where able.  This adds the module name and PCI B:D:F to
indicate which QAT device generated the log message.  The "QAT:" is removed
from these log messages as that is now unnecessary.  A few of these log
messages have additional spelling/contextual fixes.
Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 92dd5be5
...@@ -60,18 +60,19 @@ int adf_ae_fw_load(struct adf_accel_dev *accel_dev) ...@@ -60,18 +60,19 @@ int adf_ae_fw_load(struct adf_accel_dev *accel_dev)
if (request_firmware(&loader_data->uof_fw, hw_device->fw_name, if (request_firmware(&loader_data->uof_fw, hw_device->fw_name,
&accel_dev->accel_pci_dev.pci_dev->dev)) { &accel_dev->accel_pci_dev.pci_dev->dev)) {
pr_err("QAT: Failed to load firmware %s\n", hw_device->fw_name); dev_err(&GET_DEV(accel_dev), "Failed to load firmware %s\n",
hw_device->fw_name);
return -EFAULT; return -EFAULT;
} }
uof_size = loader_data->uof_fw->size; uof_size = loader_data->uof_fw->size;
uof_addr = (void *)loader_data->uof_fw->data; uof_addr = (void *)loader_data->uof_fw->data;
if (qat_uclo_map_uof_obj(loader_data->fw_loader, uof_addr, uof_size)) { if (qat_uclo_map_uof_obj(loader_data->fw_loader, uof_addr, uof_size)) {
pr_err("QAT: Failed to map UOF\n"); dev_err(&GET_DEV(accel_dev), "Failed to map UOF\n");
goto out_err; goto out_err;
} }
if (qat_uclo_wr_all_uimage(loader_data->fw_loader)) { if (qat_uclo_wr_all_uimage(loader_data->fw_loader)) {
pr_err("QAT: Failed to map UOF\n"); dev_err(&GET_DEV(accel_dev), "Failed to map UOF\n");
goto out_err; goto out_err;
} }
return 0; return 0;
...@@ -104,8 +105,9 @@ int adf_ae_start(struct adf_accel_dev *accel_dev) ...@@ -104,8 +105,9 @@ int adf_ae_start(struct adf_accel_dev *accel_dev)
ae_ctr++; ae_ctr++;
} }
} }
pr_info("QAT: qat_dev%d started %d acceleration engines\n", dev_info(&GET_DEV(accel_dev),
accel_dev->accel_id, ae_ctr); "qat_dev%d started %d acceleration engines\n",
accel_dev->accel_id, ae_ctr);
return 0; return 0;
} }
...@@ -121,8 +123,9 @@ int adf_ae_stop(struct adf_accel_dev *accel_dev) ...@@ -121,8 +123,9 @@ int adf_ae_stop(struct adf_accel_dev *accel_dev)
ae_ctr++; ae_ctr++;
} }
} }
pr_info("QAT: qat_dev%d stopped %d acceleration engines\n", dev_info(&GET_DEV(accel_dev),
accel_dev->accel_id, ae_ctr); "qat_dev%d stopped %d acceleration engines\n",
accel_dev->accel_id, ae_ctr);
return 0; return 0;
} }
...@@ -147,12 +150,12 @@ int adf_ae_init(struct adf_accel_dev *accel_dev) ...@@ -147,12 +150,12 @@ int adf_ae_init(struct adf_accel_dev *accel_dev)
accel_dev->fw_loader = loader_data; accel_dev->fw_loader = loader_data;
if (qat_hal_init(accel_dev)) { if (qat_hal_init(accel_dev)) {
pr_err("QAT: Failed to init the AEs\n"); dev_err(&GET_DEV(accel_dev), "Failed to init the AEs\n");
kfree(loader_data); kfree(loader_data);
return -EFAULT; return -EFAULT;
} }
if (adf_ae_reset(accel_dev, 0)) { if (adf_ae_reset(accel_dev, 0)) {
pr_err("QAT: Failed to reset the AEs\n"); dev_err(&GET_DEV(accel_dev), "Failed to reset the AEs\n");
qat_hal_deinit(loader_data->fw_loader); qat_hal_deinit(loader_data->fw_loader);
kfree(loader_data); kfree(loader_data);
return -EFAULT; return -EFAULT;
......
...@@ -60,14 +60,14 @@ static pci_ers_result_t adf_error_detected(struct pci_dev *pdev, ...@@ -60,14 +60,14 @@ static pci_ers_result_t adf_error_detected(struct pci_dev *pdev,
{ {
struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev); struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev);
pr_info("QAT: Acceleration driver hardware error detected.\n"); dev_info(&pdev->dev, "Acceleration driver hardware error detected.\n");
if (!accel_dev) { if (!accel_dev) {
pr_err("QAT: Can't find acceleration device\n"); dev_err(&pdev->dev, "Can't find acceleration device\n");
return PCI_ERS_RESULT_DISCONNECT; return PCI_ERS_RESULT_DISCONNECT;
} }
if (state == pci_channel_io_perm_failure) { if (state == pci_channel_io_perm_failure) {
pr_err("QAT: Can't recover from device error\n"); dev_err(&pdev->dev, "Can't recover from device error\n");
return PCI_ERS_RESULT_DISCONNECT; return PCI_ERS_RESULT_DISCONNECT;
} }
...@@ -88,10 +88,12 @@ static void adf_dev_restore(struct adf_accel_dev *accel_dev) ...@@ -88,10 +88,12 @@ static void adf_dev_restore(struct adf_accel_dev *accel_dev)
struct pci_dev *parent = pdev->bus->self; struct pci_dev *parent = pdev->bus->self;
uint16_t bridge_ctl = 0; uint16_t bridge_ctl = 0;
pr_info("QAT: Resetting device qat_dev%d\n", accel_dev->accel_id); dev_info(&GET_DEV(accel_dev), "Resetting device qat_dev%d\n",
accel_dev->accel_id);
if (!pci_wait_for_pending_transaction(pdev)) if (!pci_wait_for_pending_transaction(pdev))
pr_info("QAT: Transaction still in progress. Proceeding\n"); dev_info(&GET_DEV(accel_dev),
"Transaction still in progress. Proceeding\n");
pci_read_config_word(parent, PCI_BRIDGE_CONTROL, &bridge_ctl); pci_read_config_word(parent, PCI_BRIDGE_CONTROL, &bridge_ctl);
bridge_ctl |= PCI_BRIDGE_CTL_BUS_RESET; bridge_ctl |= PCI_BRIDGE_CTL_BUS_RESET;
...@@ -158,7 +160,8 @@ static int adf_dev_aer_schedule_reset(struct adf_accel_dev *accel_dev, ...@@ -158,7 +160,8 @@ static int adf_dev_aer_schedule_reset(struct adf_accel_dev *accel_dev,
unsigned long timeout = wait_for_completion_timeout( unsigned long timeout = wait_for_completion_timeout(
&reset_data->compl, wait_jiffies); &reset_data->compl, wait_jiffies);
if (!timeout) { if (!timeout) {
pr_err("QAT: Reset device timeout expired\n"); dev_err(&GET_DEV(accel_dev),
"Reset device timeout expired\n");
ret = -EFAULT; ret = -EFAULT;
} }
kfree(reset_data); kfree(reset_data);
...@@ -184,8 +187,8 @@ static pci_ers_result_t adf_slot_reset(struct pci_dev *pdev) ...@@ -184,8 +187,8 @@ static pci_ers_result_t adf_slot_reset(struct pci_dev *pdev)
static void adf_resume(struct pci_dev *pdev) static void adf_resume(struct pci_dev *pdev)
{ {
pr_info("QAT: Acceleration driver reset completed\n"); dev_info(&pdev->dev, "Acceleration driver reset completed\n");
pr_info("QAT: Device is up and runnig\n"); dev_info(&pdev->dev, "Device is up and runnig\n");
} }
static struct pci_error_handlers adf_err_handler = { static struct pci_error_handlers adf_err_handler = {
......
...@@ -142,7 +142,8 @@ int adf_cfg_dev_add(struct adf_accel_dev *accel_dev) ...@@ -142,7 +142,8 @@ int adf_cfg_dev_add(struct adf_accel_dev *accel_dev)
dev_cfg_data, dev_cfg_data,
&qat_dev_cfg_fops); &qat_dev_cfg_fops);
if (!dev_cfg_data->debug) { if (!dev_cfg_data->debug) {
pr_err("QAT: Failed to create qat cfg debugfs entry.\n"); dev_err(&GET_DEV(accel_dev),
"Failed to create qat cfg debugfs entry.\n");
kfree(dev_cfg_data); kfree(dev_cfg_data);
accel_dev->cfg = NULL; accel_dev->cfg = NULL;
return -EFAULT; return -EFAULT;
...@@ -305,7 +306,7 @@ int adf_cfg_add_key_value_param(struct adf_accel_dev *accel_dev, ...@@ -305,7 +306,7 @@ int adf_cfg_add_key_value_param(struct adf_accel_dev *accel_dev,
snprintf(key_val->val, ADF_CFG_MAX_VAL_LEN_IN_BYTES, snprintf(key_val->val, ADF_CFG_MAX_VAL_LEN_IN_BYTES,
"0x%lx", (unsigned long)val); "0x%lx", (unsigned long)val);
} else { } else {
pr_err("QAT: Unknown type given.\n"); dev_err(&GET_DEV(accel_dev), "Unknown type given.\n");
kfree(key_val); kfree(key_val);
return -1; return -1;
} }
......
...@@ -159,14 +159,16 @@ static int adf_add_key_value_data(struct adf_accel_dev *accel_dev, ...@@ -159,14 +159,16 @@ static int adf_add_key_value_data(struct adf_accel_dev *accel_dev,
if (adf_cfg_add_key_value_param(accel_dev, section, if (adf_cfg_add_key_value_param(accel_dev, section,
key_val->key, (void *)val, key_val->key, (void *)val,
key_val->type)) { key_val->type)) {
pr_err("QAT: failed to add keyvalue.\n"); dev_err(&GET_DEV(accel_dev),
"failed to add hex keyvalue.\n");
return -EFAULT; return -EFAULT;
} }
} else { } else {
if (adf_cfg_add_key_value_param(accel_dev, section, if (adf_cfg_add_key_value_param(accel_dev, section,
key_val->key, key_val->val, key_val->key, key_val->val,
key_val->type)) { key_val->type)) {
pr_err("QAT: failed to add keyvalue.\n"); dev_err(&GET_DEV(accel_dev),
"failed to add keyvalue.\n");
return -EFAULT; return -EFAULT;
} }
} }
...@@ -185,12 +187,14 @@ static int adf_copy_key_value_data(struct adf_accel_dev *accel_dev, ...@@ -185,12 +187,14 @@ static int adf_copy_key_value_data(struct adf_accel_dev *accel_dev,
while (section_head) { while (section_head) {
if (copy_from_user(&section, (void __user *)section_head, if (copy_from_user(&section, (void __user *)section_head,
sizeof(*section_head))) { sizeof(*section_head))) {
pr_err("QAT: failed to copy section info\n"); dev_err(&GET_DEV(accel_dev),
"failed to copy section info\n");
goto out_err; goto out_err;
} }
if (adf_cfg_section_add(accel_dev, section.name)) { if (adf_cfg_section_add(accel_dev, section.name)) {
pr_err("QAT: failed to add section.\n"); dev_err(&GET_DEV(accel_dev),
"failed to add section.\n");
goto out_err; goto out_err;
} }
...@@ -199,7 +203,8 @@ static int adf_copy_key_value_data(struct adf_accel_dev *accel_dev, ...@@ -199,7 +203,8 @@ static int adf_copy_key_value_data(struct adf_accel_dev *accel_dev,
while (params_head) { while (params_head) {
if (copy_from_user(&key_val, (void __user *)params_head, if (copy_from_user(&key_val, (void __user *)params_head,
sizeof(key_val))) { sizeof(key_val))) {
pr_err("QAT: Failed to copy keyvalue.\n"); dev_err(&GET_DEV(accel_dev),
"Failed to copy keyvalue.\n");
goto out_err; goto out_err;
} }
if (adf_add_key_value_data(accel_dev, section.name, if (adf_add_key_value_data(accel_dev, section.name,
...@@ -258,8 +263,9 @@ static int adf_ctl_is_device_in_use(int id) ...@@ -258,8 +263,9 @@ static int adf_ctl_is_device_in_use(int id)
if (id == dev->accel_id || id == ADF_CFG_ALL_DEVICES) { if (id == dev->accel_id || id == ADF_CFG_ALL_DEVICES) {
if (adf_devmgr_in_reset(dev) || adf_dev_in_use(dev)) { if (adf_devmgr_in_reset(dev) || adf_dev_in_use(dev)) {
pr_info("QAT: device qat_dev%d is busy\n", dev_info(&GET_DEV(dev),
dev->accel_id); "device qat_dev%d is busy\n",
dev->accel_id);
return -EBUSY; return -EBUSY;
} }
} }
...@@ -280,7 +286,8 @@ static int adf_ctl_stop_devices(uint32_t id) ...@@ -280,7 +286,8 @@ static int adf_ctl_stop_devices(uint32_t id)
continue; continue;
if (adf_dev_stop(accel_dev)) { if (adf_dev_stop(accel_dev)) {
pr_err("QAT: Failed to stop qat_dev%d\n", id); dev_err(&GET_DEV(accel_dev),
"Failed to stop qat_dev%d\n", id);
ret = -EFAULT; ret = -EFAULT;
} else { } else {
adf_dev_shutdown(accel_dev); adf_dev_shutdown(accel_dev);
...@@ -343,17 +350,20 @@ static int adf_ctl_ioctl_dev_start(struct file *fp, unsigned int cmd, ...@@ -343,17 +350,20 @@ static int adf_ctl_ioctl_dev_start(struct file *fp, unsigned int cmd,
} }
if (!adf_dev_started(accel_dev)) { if (!adf_dev_started(accel_dev)) {
pr_info("QAT: Starting acceleration device qat_dev%d.\n", dev_info(&GET_DEV(accel_dev),
ctl_data->device_id); "Starting acceleration device qat_dev%d.\n",
ctl_data->device_id);
ret = adf_dev_init(accel_dev); ret = adf_dev_init(accel_dev);
if (!ret) if (!ret)
ret = adf_dev_start(accel_dev); ret = adf_dev_start(accel_dev);
} else { } else {
pr_info("QAT: Acceleration device qat_dev%d already started.\n", dev_info(&GET_DEV(accel_dev),
ctl_data->device_id); "Acceleration device qat_dev%d already started.\n",
ctl_data->device_id);
} }
if (ret) { if (ret) {
pr_err("QAT: Failed to start qat_dev%d\n", ctl_data->device_id); dev_err(&GET_DEV(accel_dev), "Failed to start qat_dev%d\n",
ctl_data->device_id);
adf_dev_stop(accel_dev); adf_dev_stop(accel_dev);
adf_dev_shutdown(accel_dev); adf_dev_shutdown(accel_dev);
} }
...@@ -408,7 +418,7 @@ static int adf_ctl_ioctl_get_status(struct file *fp, unsigned int cmd, ...@@ -408,7 +418,7 @@ static int adf_ctl_ioctl_get_status(struct file *fp, unsigned int cmd,
if (copy_to_user((void __user *)arg, &dev_info, if (copy_to_user((void __user *)arg, &dev_info,
sizeof(struct adf_dev_status_info))) { sizeof(struct adf_dev_status_info))) {
pr_err("QAT: failed to copy status.\n"); dev_err(&GET_DEV(accel_dev), "failed to copy status.\n");
return -EFAULT; return -EFAULT;
} }
return 0; return 0;
......
...@@ -67,7 +67,8 @@ int adf_devmgr_add_dev(struct adf_accel_dev *accel_dev) ...@@ -67,7 +67,8 @@ int adf_devmgr_add_dev(struct adf_accel_dev *accel_dev)
struct list_head *itr; struct list_head *itr;
if (num_devices == ADF_MAX_DEVICES) { if (num_devices == ADF_MAX_DEVICES) {
pr_err("QAT: Only support up to %d devices\n", ADF_MAX_DEVICES); dev_err(&GET_DEV(accel_dev), "Only support up to %d devices\n",
ADF_MAX_DEVICES);
return -EFAULT; return -EFAULT;
} }
......
...@@ -124,12 +124,12 @@ int adf_dev_init(struct adf_accel_dev *accel_dev) ...@@ -124,12 +124,12 @@ int adf_dev_init(struct adf_accel_dev *accel_dev)
if (!hw_data) { if (!hw_data) {
dev_err(&GET_DEV(accel_dev), dev_err(&GET_DEV(accel_dev),
"QAT: Failed to init device - hw_data not set\n"); "Failed to init device - hw_data not set\n");
return -EFAULT; return -EFAULT;
} }
if (!test_bit(ADF_STATUS_CONFIGURED, &accel_dev->status)) { if (!test_bit(ADF_STATUS_CONFIGURED, &accel_dev->status)) {
pr_info("QAT: Device not configured\n"); dev_err(&GET_DEV(accel_dev), "Device not configured\n");
return -EFAULT; return -EFAULT;
} }
...@@ -151,20 +151,22 @@ int adf_dev_init(struct adf_accel_dev *accel_dev) ...@@ -151,20 +151,22 @@ int adf_dev_init(struct adf_accel_dev *accel_dev)
hw_data->enable_ints(accel_dev); hw_data->enable_ints(accel_dev);
if (adf_ae_init(accel_dev)) { if (adf_ae_init(accel_dev)) {
pr_err("QAT: Failed to initialise Acceleration Engine\n"); dev_err(&GET_DEV(accel_dev),
"Failed to initialise Acceleration Engine\n");
return -EFAULT; return -EFAULT;
} }
set_bit(ADF_STATUS_AE_INITIALISED, &accel_dev->status); set_bit(ADF_STATUS_AE_INITIALISED, &accel_dev->status);
if (adf_ae_fw_load(accel_dev)) { if (adf_ae_fw_load(accel_dev)) {
pr_err("QAT: Failed to load acceleration FW\n"); dev_err(&GET_DEV(accel_dev),
"Failed to load acceleration FW\n");
adf_ae_fw_release(accel_dev); adf_ae_fw_release(accel_dev);
return -EFAULT; return -EFAULT;
} }
set_bit(ADF_STATUS_AE_UCODE_LOADED, &accel_dev->status); set_bit(ADF_STATUS_AE_UCODE_LOADED, &accel_dev->status);
if (hw_data->alloc_irq(accel_dev)) { if (hw_data->alloc_irq(accel_dev)) {
pr_err("QAT: Failed to allocate interrupts\n"); dev_err(&GET_DEV(accel_dev), "Failed to allocate interrupts\n");
return -EFAULT; return -EFAULT;
} }
set_bit(ADF_STATUS_IRQ_ALLOCATED, &accel_dev->status); set_bit(ADF_STATUS_IRQ_ALLOCATED, &accel_dev->status);
...@@ -179,8 +181,9 @@ int adf_dev_init(struct adf_accel_dev *accel_dev) ...@@ -179,8 +181,9 @@ int adf_dev_init(struct adf_accel_dev *accel_dev)
if (!service->admin) if (!service->admin)
continue; continue;
if (service->event_hld(accel_dev, ADF_EVENT_INIT)) { if (service->event_hld(accel_dev, ADF_EVENT_INIT)) {
pr_err("QAT: Failed to initialise service %s\n", dev_err(&GET_DEV(accel_dev),
service->name); "Failed to initialise service %s\n",
service->name);
return -EFAULT; return -EFAULT;
} }
set_bit(accel_dev->accel_id, &service->init_status); set_bit(accel_dev->accel_id, &service->init_status);
...@@ -190,8 +193,9 @@ int adf_dev_init(struct adf_accel_dev *accel_dev) ...@@ -190,8 +193,9 @@ int adf_dev_init(struct adf_accel_dev *accel_dev)
if (service->admin) if (service->admin)
continue; continue;
if (service->event_hld(accel_dev, ADF_EVENT_INIT)) { if (service->event_hld(accel_dev, ADF_EVENT_INIT)) {
pr_err("QAT: Failed to initialise service %s\n", dev_err(&GET_DEV(accel_dev),
service->name); "Failed to initialise service %s\n",
service->name);
return -EFAULT; return -EFAULT;
} }
set_bit(accel_dev->accel_id, &service->init_status); set_bit(accel_dev->accel_id, &service->init_status);
...@@ -221,7 +225,7 @@ int adf_dev_start(struct adf_accel_dev *accel_dev) ...@@ -221,7 +225,7 @@ int adf_dev_start(struct adf_accel_dev *accel_dev)
set_bit(ADF_STATUS_STARTING, &accel_dev->status); set_bit(ADF_STATUS_STARTING, &accel_dev->status);
if (adf_ae_start(accel_dev)) { if (adf_ae_start(accel_dev)) {
pr_err("QAT: AE Start Failed\n"); dev_err(&GET_DEV(accel_dev), "AE Start Failed\n");
return -EFAULT; return -EFAULT;
} }
set_bit(ADF_STATUS_AE_STARTED, &accel_dev->status); set_bit(ADF_STATUS_AE_STARTED, &accel_dev->status);
...@@ -231,8 +235,9 @@ int adf_dev_start(struct adf_accel_dev *accel_dev) ...@@ -231,8 +235,9 @@ int adf_dev_start(struct adf_accel_dev *accel_dev)
if (!service->admin) if (!service->admin)
continue; continue;
if (service->event_hld(accel_dev, ADF_EVENT_START)) { if (service->event_hld(accel_dev, ADF_EVENT_START)) {
pr_err("QAT: Failed to start service %s\n", dev_err(&GET_DEV(accel_dev),
service->name); "Failed to start service %s\n",
service->name);
return -EFAULT; return -EFAULT;
} }
set_bit(accel_dev->accel_id, &service->start_status); set_bit(accel_dev->accel_id, &service->start_status);
...@@ -242,8 +247,9 @@ int adf_dev_start(struct adf_accel_dev *accel_dev) ...@@ -242,8 +247,9 @@ int adf_dev_start(struct adf_accel_dev *accel_dev)
if (service->admin) if (service->admin)
continue; continue;
if (service->event_hld(accel_dev, ADF_EVENT_START)) { if (service->event_hld(accel_dev, ADF_EVENT_START)) {
pr_err("QAT: Failed to start service %s\n", dev_err(&GET_DEV(accel_dev),
service->name); "Failed to start service %s\n",
service->name);
return -EFAULT; return -EFAULT;
} }
set_bit(accel_dev->accel_id, &service->start_status); set_bit(accel_dev->accel_id, &service->start_status);
...@@ -253,7 +259,8 @@ int adf_dev_start(struct adf_accel_dev *accel_dev) ...@@ -253,7 +259,8 @@ int adf_dev_start(struct adf_accel_dev *accel_dev)
set_bit(ADF_STATUS_STARTED, &accel_dev->status); set_bit(ADF_STATUS_STARTED, &accel_dev->status);
if (qat_algs_register()) { if (qat_algs_register()) {
pr_err("QAT: Failed to register crypto algs\n"); dev_err(&GET_DEV(accel_dev),
"Failed to register crypto algs\n");
set_bit(ADF_STATUS_STARTING, &accel_dev->status); set_bit(ADF_STATUS_STARTING, &accel_dev->status);
clear_bit(ADF_STATUS_STARTED, &accel_dev->status); clear_bit(ADF_STATUS_STARTED, &accel_dev->status);
return -EFAULT; return -EFAULT;
...@@ -287,7 +294,8 @@ int adf_dev_stop(struct adf_accel_dev *accel_dev) ...@@ -287,7 +294,8 @@ int adf_dev_stop(struct adf_accel_dev *accel_dev)
clear_bit(ADF_STATUS_STARTED, &accel_dev->status); clear_bit(ADF_STATUS_STARTED, &accel_dev->status);
if (qat_algs_unregister()) if (qat_algs_unregister())
pr_err("QAT: Failed to unregister crypto algs\n"); dev_err(&GET_DEV(accel_dev),
"Failed to unregister crypto algs\n");
list_for_each(list_itr, &service_table) { list_for_each(list_itr, &service_table) {
service = list_entry(list_itr, struct service_hndl, list); service = list_entry(list_itr, struct service_hndl, list);
...@@ -310,8 +318,9 @@ int adf_dev_stop(struct adf_accel_dev *accel_dev) ...@@ -310,8 +318,9 @@ int adf_dev_stop(struct adf_accel_dev *accel_dev)
if (!test_bit(accel_dev->accel_id, &service->start_status)) if (!test_bit(accel_dev->accel_id, &service->start_status))
continue; continue;
if (service->event_hld(accel_dev, ADF_EVENT_STOP)) if (service->event_hld(accel_dev, ADF_EVENT_STOP))
pr_err("QAT: Failed to shutdown service %s\n", dev_err(&GET_DEV(accel_dev),
service->name); "Failed to shutdown service %s\n",
service->name);
else else
clear_bit(accel_dev->accel_id, &service->start_status); clear_bit(accel_dev->accel_id, &service->start_status);
} }
...@@ -321,7 +330,7 @@ int adf_dev_stop(struct adf_accel_dev *accel_dev) ...@@ -321,7 +330,7 @@ int adf_dev_stop(struct adf_accel_dev *accel_dev)
if (test_bit(ADF_STATUS_AE_STARTED, &accel_dev->status)) { if (test_bit(ADF_STATUS_AE_STARTED, &accel_dev->status)) {
if (adf_ae_stop(accel_dev)) if (adf_ae_stop(accel_dev))
pr_err("QAT: failed to stop AE\n"); dev_err(&GET_DEV(accel_dev), "failed to stop AE\n");
else else
clear_bit(ADF_STATUS_AE_STARTED, &accel_dev->status); clear_bit(ADF_STATUS_AE_STARTED, &accel_dev->status);
} }
...@@ -351,7 +360,8 @@ void adf_dev_shutdown(struct adf_accel_dev *accel_dev) ...@@ -351,7 +360,8 @@ void adf_dev_shutdown(struct adf_accel_dev *accel_dev)
if (test_bit(ADF_STATUS_AE_UCODE_LOADED, &accel_dev->status)) { if (test_bit(ADF_STATUS_AE_UCODE_LOADED, &accel_dev->status)) {
if (adf_ae_fw_release(accel_dev)) if (adf_ae_fw_release(accel_dev))
pr_err("QAT: Failed to release the ucode\n"); dev_err(&GET_DEV(accel_dev),
"Failed to release the ucode\n");
else else
clear_bit(ADF_STATUS_AE_UCODE_LOADED, clear_bit(ADF_STATUS_AE_UCODE_LOADED,
&accel_dev->status); &accel_dev->status);
...@@ -359,7 +369,8 @@ void adf_dev_shutdown(struct adf_accel_dev *accel_dev) ...@@ -359,7 +369,8 @@ void adf_dev_shutdown(struct adf_accel_dev *accel_dev)
if (test_bit(ADF_STATUS_AE_INITIALISED, &accel_dev->status)) { if (test_bit(ADF_STATUS_AE_INITIALISED, &accel_dev->status)) {
if (adf_ae_shutdown(accel_dev)) if (adf_ae_shutdown(accel_dev))
pr_err("QAT: Failed to shutdown Accel Engine\n"); dev_err(&GET_DEV(accel_dev),
"Failed to shutdown Accel Engine\n");
else else
clear_bit(ADF_STATUS_AE_INITIALISED, clear_bit(ADF_STATUS_AE_INITIALISED,
&accel_dev->status); &accel_dev->status);
...@@ -372,8 +383,9 @@ void adf_dev_shutdown(struct adf_accel_dev *accel_dev) ...@@ -372,8 +383,9 @@ void adf_dev_shutdown(struct adf_accel_dev *accel_dev)
if (!test_bit(accel_dev->accel_id, &service->init_status)) if (!test_bit(accel_dev->accel_id, &service->init_status))
continue; continue;
if (service->event_hld(accel_dev, ADF_EVENT_SHUTDOWN)) if (service->event_hld(accel_dev, ADF_EVENT_SHUTDOWN))
pr_err("QAT: Failed to shutdown service %s\n", dev_err(&GET_DEV(accel_dev),
service->name); "Failed to shutdown service %s\n",
service->name);
else else
clear_bit(accel_dev->accel_id, &service->init_status); clear_bit(accel_dev->accel_id, &service->init_status);
} }
...@@ -384,8 +396,9 @@ void adf_dev_shutdown(struct adf_accel_dev *accel_dev) ...@@ -384,8 +396,9 @@ void adf_dev_shutdown(struct adf_accel_dev *accel_dev)
if (!test_bit(accel_dev->accel_id, &service->init_status)) if (!test_bit(accel_dev->accel_id, &service->init_status))
continue; continue;
if (service->event_hld(accel_dev, ADF_EVENT_SHUTDOWN)) if (service->event_hld(accel_dev, ADF_EVENT_SHUTDOWN))
pr_err("QAT: Failed to shutdown service %s\n", dev_err(&GET_DEV(accel_dev),
service->name); "Failed to shutdown service %s\n",
service->name);
else else
clear_bit(accel_dev->accel_id, &service->init_status); clear_bit(accel_dev->accel_id, &service->init_status);
} }
...@@ -419,16 +432,18 @@ int adf_dev_restarting_notify(struct adf_accel_dev *accel_dev) ...@@ -419,16 +432,18 @@ int adf_dev_restarting_notify(struct adf_accel_dev *accel_dev)
if (service->admin) if (service->admin)
continue; continue;
if (service->event_hld(accel_dev, ADF_EVENT_RESTARTING)) if (service->event_hld(accel_dev, ADF_EVENT_RESTARTING))
pr_err("QAT: Failed to restart service %s.\n", dev_err(&GET_DEV(accel_dev),
service->name); "Failed to restart service %s.\n",
service->name);
} }
list_for_each(list_itr, &service_table) { list_for_each(list_itr, &service_table) {
service = list_entry(list_itr, struct service_hndl, list); service = list_entry(list_itr, struct service_hndl, list);
if (!service->admin) if (!service->admin)
continue; continue;
if (service->event_hld(accel_dev, ADF_EVENT_RESTARTING)) if (service->event_hld(accel_dev, ADF_EVENT_RESTARTING))
pr_err("QAT: Failed to restart service %s.\n", dev_err(&GET_DEV(accel_dev),
service->name); "Failed to restart service %s.\n",
service->name);
} }
return 0; return 0;
} }
...@@ -443,16 +458,18 @@ int adf_dev_restarted_notify(struct adf_accel_dev *accel_dev) ...@@ -443,16 +458,18 @@ int adf_dev_restarted_notify(struct adf_accel_dev *accel_dev)
if (service->admin) if (service->admin)
continue; continue;
if (service->event_hld(accel_dev, ADF_EVENT_RESTARTED)) if (service->event_hld(accel_dev, ADF_EVENT_RESTARTED))
pr_err("QAT: Failed to restart service %s.\n", dev_err(&GET_DEV(accel_dev),
service->name); "Failed to restart service %s.\n",
service->name);
} }
list_for_each(list_itr, &service_table) { list_for_each(list_itr, &service_table) {
service = list_entry(list_itr, struct service_hndl, list); service = list_entry(list_itr, struct service_hndl, list);
if (!service->admin) if (!service->admin)
continue; continue;
if (service->event_hld(accel_dev, ADF_EVENT_RESTARTED)) if (service->event_hld(accel_dev, ADF_EVENT_RESTARTED))
pr_err("QAT: Failed to restart service %s.\n", dev_err(&GET_DEV(accel_dev),
service->name); "Failed to restart service %s.\n",
service->name);
} }
return 0; return 0;
} }
...@@ -195,7 +195,7 @@ static int adf_init_ring(struct adf_etr_ring_data *ring) ...@@ -195,7 +195,7 @@ static int adf_init_ring(struct adf_etr_ring_data *ring)
memset(ring->base_addr, 0x7F, ring_size_bytes); memset(ring->base_addr, 0x7F, ring_size_bytes);
/* The base_addr has to be aligned to the size of the buffer */ /* The base_addr has to be aligned to the size of the buffer */
if (adf_check_ring_alignment(ring->dma_addr, ring_size_bytes)) { if (adf_check_ring_alignment(ring->dma_addr, ring_size_bytes)) {
pr_err("QAT: Ring address not aligned\n"); dev_err(&GET_DEV(accel_dev), "Ring address not aligned\n");
dma_free_coherent(&GET_DEV(accel_dev), ring_size_bytes, dma_free_coherent(&GET_DEV(accel_dev), ring_size_bytes,
ring->base_addr, ring->dma_addr); ring->base_addr, ring->dma_addr);
return -EFAULT; return -EFAULT;
...@@ -242,32 +242,33 @@ int adf_create_ring(struct adf_accel_dev *accel_dev, const char *section, ...@@ -242,32 +242,33 @@ int adf_create_ring(struct adf_accel_dev *accel_dev, const char *section,
int ret; int ret;
if (bank_num >= GET_MAX_BANKS(accel_dev)) { if (bank_num >= GET_MAX_BANKS(accel_dev)) {
pr_err("QAT: Invalid bank number\n"); dev_err(&GET_DEV(accel_dev), "Invalid bank number\n");
return -EFAULT; return -EFAULT;
} }
if (msg_size > ADF_MSG_SIZE_TO_BYTES(ADF_MAX_MSG_SIZE)) { if (msg_size > ADF_MSG_SIZE_TO_BYTES(ADF_MAX_MSG_SIZE)) {
pr_err("QAT: Invalid msg size\n"); dev_err(&GET_DEV(accel_dev), "Invalid msg size\n");
return -EFAULT; return -EFAULT;
} }
if (ADF_MAX_INFLIGHTS(adf_verify_ring_size(msg_size, num_msgs), if (ADF_MAX_INFLIGHTS(adf_verify_ring_size(msg_size, num_msgs),
ADF_BYTES_TO_MSG_SIZE(msg_size)) < 2) { ADF_BYTES_TO_MSG_SIZE(msg_size)) < 2) {
pr_err("QAT: Invalid ring size for given msg size\n"); dev_err(&GET_DEV(accel_dev),
"Invalid ring size for given msg size\n");
return -EFAULT; return -EFAULT;
} }
if (adf_cfg_get_param_value(accel_dev, section, ring_name, val)) { if (adf_cfg_get_param_value(accel_dev, section, ring_name, val)) {
pr_err("QAT: Section %s, no such entry : %s\n", dev_err(&GET_DEV(accel_dev), "Section %s, no such entry : %s\n",
section, ring_name); section, ring_name);
return -EFAULT; return -EFAULT;
} }
if (kstrtouint(val, 10, &ring_num)) { if (kstrtouint(val, 10, &ring_num)) {
pr_err("QAT: Can't get ring number\n"); dev_err(&GET_DEV(accel_dev), "Can't get ring number\n");
return -EFAULT; return -EFAULT;
} }
bank = &transport_data->banks[bank_num]; bank = &transport_data->banks[bank_num];
if (adf_reserve_ring(bank, ring_num)) { if (adf_reserve_ring(bank, ring_num)) {
pr_err("QAT: Ring %d, %s already exists.\n", dev_err(&GET_DEV(accel_dev), "Ring %d, %s already exists.\n",
ring_num, ring_name); ring_num, ring_name);
return -EFAULT; return -EFAULT;
} }
ring = &bank->rings[ring_num]; ring = &bank->rings[ring_num];
...@@ -287,7 +288,8 @@ int adf_create_ring(struct adf_accel_dev *accel_dev, const char *section, ...@@ -287,7 +288,8 @@ int adf_create_ring(struct adf_accel_dev *accel_dev, const char *section,
accel_dev->hw_device->hw_arb_ring_enable(ring); accel_dev->hw_device->hw_arb_ring_enable(ring);
if (adf_ring_debugfs_add(ring, ring_name)) { if (adf_ring_debugfs_add(ring, ring_name)) {
pr_err("QAT: Couldn't add ring debugfs entry\n"); dev_err(&GET_DEV(accel_dev),
"Couldn't add ring debugfs entry\n");
ret = -EFAULT; ret = -EFAULT;
goto err; goto err;
} }
...@@ -428,7 +430,8 @@ static int adf_init_bank(struct adf_accel_dev *accel_dev, ...@@ -428,7 +430,8 @@ static int adf_init_bank(struct adf_accel_dev *accel_dev,
goto err; goto err;
} else { } else {
if (i < hw_data->tx_rx_gap) { if (i < hw_data->tx_rx_gap) {
pr_err("QAT: Invalid tx rings mask config\n"); dev_err(&GET_DEV(accel_dev),
"Invalid tx rings mask config\n");
goto err; goto err;
} }
tx_ring = &bank->rings[i - hw_data->tx_rx_gap]; tx_ring = &bank->rings[i - hw_data->tx_rx_gap];
...@@ -436,7 +439,8 @@ static int adf_init_bank(struct adf_accel_dev *accel_dev, ...@@ -436,7 +439,8 @@ static int adf_init_bank(struct adf_accel_dev *accel_dev,
} }
} }
if (adf_bank_debugfs_add(bank)) { if (adf_bank_debugfs_add(bank)) {
pr_err("QAT: Failed to add bank debugfs entry\n"); dev_err(&GET_DEV(accel_dev),
"Failed to add bank debugfs entry\n");
goto err; goto err;
} }
...@@ -492,7 +496,8 @@ int adf_init_etr_data(struct adf_accel_dev *accel_dev) ...@@ -492,7 +496,8 @@ int adf_init_etr_data(struct adf_accel_dev *accel_dev)
etr_data->debug = debugfs_create_dir("transport", etr_data->debug = debugfs_create_dir("transport",
accel_dev->debugfs_dir); accel_dev->debugfs_dir);
if (!etr_data->debug) { if (!etr_data->debug) {
pr_err("QAT: Unable to create transport debugfs entry\n"); dev_err(&GET_DEV(accel_dev),
"Unable to create transport debugfs entry\n");
ret = -ENOENT; ret = -ENOENT;
goto err_bank_debug; goto err_bank_debug;
} }
......
...@@ -116,7 +116,7 @@ struct qat_crypto_instance *qat_crypto_get_instance_node(int node) ...@@ -116,7 +116,7 @@ struct qat_crypto_instance *qat_crypto_get_instance_node(int node)
accel_dev = NULL; accel_dev = NULL;
} }
if (!accel_dev) { if (!accel_dev) {
pr_err("QAT: Could not find device on node %d\n", node); pr_err("QAT: Could not find a device on node %d\n", node);
accel_dev = adf_devmgr_get_first(); accel_dev = adf_devmgr_get_first();
} }
if (!accel_dev || !adf_dev_started(accel_dev)) if (!accel_dev || !adf_dev_started(accel_dev))
...@@ -137,7 +137,8 @@ struct qat_crypto_instance *qat_crypto_get_instance_node(int node) ...@@ -137,7 +137,8 @@ struct qat_crypto_instance *qat_crypto_get_instance_node(int node)
if (atomic_add_return(1, &inst_best->refctr) == 1) { if (atomic_add_return(1, &inst_best->refctr) == 1) {
if (adf_dev_get(accel_dev)) { if (adf_dev_get(accel_dev)) {
atomic_dec(&inst_best->refctr); atomic_dec(&inst_best->refctr);
pr_err("QAT: Could increment dev refctr\n"); dev_err(&GET_DEV(accel_dev),
"Could not increment dev refctr\n");
return NULL; return NULL;
} }
} }
......
...@@ -718,7 +718,7 @@ int qat_hal_init(struct adf_accel_dev *accel_dev) ...@@ -718,7 +718,7 @@ int qat_hal_init(struct adf_accel_dev *accel_dev)
handle->hal_handle->ae_max_num = max_en_ae_id + 1; handle->hal_handle->ae_max_num = max_en_ae_id + 1;
/* take all AEs out of reset */ /* take all AEs out of reset */
if (qat_hal_clr_reset(handle)) { if (qat_hal_clr_reset(handle)) {
pr_err("QAT: qat_hal_clr_reset error\n"); dev_err(&GET_DEV(accel_dev), "qat_hal_clr_reset error\n");
goto out_err; goto out_err;
} }
if (qat_hal_clear_gpr(handle)) if (qat_hal_clear_gpr(handle))
......
...@@ -93,7 +93,8 @@ int adf_put_admin_msg_sync(struct adf_accel_dev *accel_dev, ...@@ -93,7 +93,8 @@ int adf_put_admin_msg_sync(struct adf_accel_dev *accel_dev,
memcpy(out, admin->virt_addr + offset + memcpy(out, admin->virt_addr + offset +
ADF_ADMINMSG_LEN, ADF_ADMINMSG_LEN); ADF_ADMINMSG_LEN, ADF_ADMINMSG_LEN);
else else
pr_err("QAT: Failed to send admin msg to accelerator\n"); dev_err(&GET_DEV(accel_dev),
"Failed to send admin msg to accelerator\n");
mutex_unlock(&admin->lock); mutex_unlock(&admin->lock);
return received ? 0 : -EFAULT; return received ? 0 : -EFAULT;
......
...@@ -150,7 +150,8 @@ void adf_get_arbiter_mapping(struct adf_accel_dev *accel_dev, ...@@ -150,7 +150,8 @@ void adf_get_arbiter_mapping(struct adf_accel_dev *accel_dev,
*arb_map_config = thrd_to_arb_map_sku6; *arb_map_config = thrd_to_arb_map_sku6;
break; break;
default: default:
pr_err("QAT: The configuration doesn't match any SKU"); dev_err(&GET_DEV(accel_dev),
"The configuration doesn't match any SKU");
*arb_map_config = NULL; *arb_map_config = NULL;
} }
} }
......
...@@ -73,7 +73,7 @@ static int adf_enable_msix(struct adf_accel_dev *accel_dev) ...@@ -73,7 +73,7 @@ static int adf_enable_msix(struct adf_accel_dev *accel_dev)
if (pci_enable_msix_exact(pci_dev_info->pci_dev, if (pci_enable_msix_exact(pci_dev_info->pci_dev,
pci_dev_info->msix_entries.entries, pci_dev_info->msix_entries.entries,
msix_num_entries)) { msix_num_entries)) {
pr_err("QAT: Failed to enable MSIX IRQ\n"); dev_err(&GET_DEV(accel_dev), "Failed to enable MSIX IRQ\n");
return -EFAULT; return -EFAULT;
} }
return 0; return 0;
...@@ -97,7 +97,8 @@ static irqreturn_t adf_msix_isr_ae(int irq, void *dev_ptr) ...@@ -97,7 +97,8 @@ static irqreturn_t adf_msix_isr_ae(int irq, void *dev_ptr)
{ {
struct adf_accel_dev *accel_dev = dev_ptr; struct adf_accel_dev *accel_dev = dev_ptr;
pr_info("QAT: qat_dev%d spurious AE interrupt\n", accel_dev->accel_id); dev_info(&GET_DEV(accel_dev), "qat_dev%d spurious AE interrupt\n",
accel_dev->accel_id);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -121,8 +122,9 @@ static int adf_request_irqs(struct adf_accel_dev *accel_dev) ...@@ -121,8 +122,9 @@ static int adf_request_irqs(struct adf_accel_dev *accel_dev)
ret = request_irq(msixe[i].vector, ret = request_irq(msixe[i].vector,
adf_msix_isr_bundle, 0, name, bank); adf_msix_isr_bundle, 0, name, bank);
if (ret) { if (ret) {
pr_err("QAT: failed to enable irq %d for %s\n", dev_err(&GET_DEV(accel_dev),
msixe[i].vector, name); "failed to enable irq %d for %s\n",
msixe[i].vector, name);
return ret; return ret;
} }
...@@ -136,8 +138,9 @@ static int adf_request_irqs(struct adf_accel_dev *accel_dev) ...@@ -136,8 +138,9 @@ static int adf_request_irqs(struct adf_accel_dev *accel_dev)
"qat%d-ae-cluster", accel_dev->accel_id); "qat%d-ae-cluster", accel_dev->accel_id);
ret = request_irq(msixe[i].vector, adf_msix_isr_ae, 0, name, accel_dev); ret = request_irq(msixe[i].vector, adf_msix_isr_ae, 0, name, accel_dev);
if (ret) { if (ret) {
pr_err("QAT: failed to enable irq %d, for %s\n", dev_err(&GET_DEV(accel_dev),
msixe[i].vector, name); "failed to enable irq %d, for %s\n",
msixe[i].vector, name);
return ret; return ret;
} }
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment