scsi: pm8001: Neaten debug logging macros and uses

Every PM8001_<FOO>_DBG macro uses an internal call to pm8001_printk.

Convert all uses of:

	PM8001_<FOO>_DBG(hba, pm8001_printk(fmt, ...))
to
	pm8001_dbg(hba, <FOO>, fmt, ...)

so the visual complexity of each macro is reduced.

The repetitive macro definitions are converted to a single pm8001_dbg and
the level is concatenated using PM8001_##level##_LOGGING for the specific
level test.

Done with coccinelle, checkpatch and a little typing of the new macro
definition.

Miscellanea:

 - Coalesce formats

 - Realign arguments

 - Add missing terminating newlines to formats

 - Remove trailing spaces from formats

 - Change defective loop with printk(KERN_INFO... to emit a 16 byte hex
   block to %p16h

Link: https://lore.kernel.org/r/49f36a93af7752b613d03c89a87078243567fd9a.1605914030.git.joe@perches.com
Reported-by: kernel test robot <lkp@intel.com>
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Joe Perches 2020-11-20 15:16:09 -08:00 committed by Martin K. Petersen
parent 27a34943bd
commit 1b5d279328
6 changed files with 1352 additions and 1885 deletions

View File

@ -841,10 +841,9 @@ static ssize_t pm8001_store_update_fw(struct device *cdev,
pm8001_ha->dev);
if (ret) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk(
"Failed to load firmware image file %s, error %d\n",
filename_ptr, ret));
pm8001_dbg(pm8001_ha, FAIL,
"Failed to load firmware image file %s, error %d\n",
filename_ptr, ret);
pm8001_ha->fw_status = FAIL_OPEN_BIOS_FILE;
goto out;
}

File diff suppressed because it is too large Load Diff

View File

@ -271,15 +271,14 @@ static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha,
spin_lock_init(&pm8001_ha->lock);
spin_lock_init(&pm8001_ha->bitmap_lock);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("pm8001_alloc: PHY:%x\n",
pm8001_ha->chip->n_phy));
pm8001_dbg(pm8001_ha, INIT, "pm8001_alloc: PHY:%x\n",
pm8001_ha->chip->n_phy);
/* Setup Interrupt */
rc = pm8001_setup_irq(pm8001_ha);
if (rc) {
PM8001_FAIL_DBG(pm8001_ha, pm8001_printk(
"pm8001_setup_irq failed [ret: %d]\n", rc));
pm8001_dbg(pm8001_ha, FAIL,
"pm8001_setup_irq failed [ret: %d]\n", rc);
goto err_out_shost;
}
/* Request Interrupt */
@ -394,9 +393,9 @@ static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha,
&pm8001_ha->memoryMap.region[i].phys_addr_lo,
pm8001_ha->memoryMap.region[i].total_len,
pm8001_ha->memoryMap.region[i].alignment) != 0) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Mem%d alloc failed\n",
i));
pm8001_dbg(pm8001_ha, FAIL,
"Mem%d alloc failed\n",
i);
goto err_out;
}
}
@ -467,15 +466,15 @@ static int pm8001_ioremap(struct pm8001_hba_info *pm8001_ha)
pm8001_ha->io_mem[logicalBar].memvirtaddr =
ioremap(pm8001_ha->io_mem[logicalBar].membase,
pm8001_ha->io_mem[logicalBar].memsize);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("PCI: bar %d, logicalBar %d ",
bar, logicalBar));
PM8001_INIT_DBG(pm8001_ha, pm8001_printk(
"base addr %llx virt_addr=%llx len=%d\n",
(u64)pm8001_ha->io_mem[logicalBar].membase,
(u64)(unsigned long)
pm8001_ha->io_mem[logicalBar].memvirtaddr,
pm8001_ha->io_mem[logicalBar].memsize));
pm8001_dbg(pm8001_ha, INIT,
"PCI: bar %d, logicalBar %d\n",
bar, logicalBar);
pm8001_dbg(pm8001_ha, INIT,
"base addr %llx virt_addr=%llx len=%d\n",
(u64)pm8001_ha->io_mem[logicalBar].membase,
(u64)(unsigned long)
pm8001_ha->io_mem[logicalBar].memvirtaddr,
pm8001_ha->io_mem[logicalBar].memsize);
} else {
pm8001_ha->io_mem[logicalBar].membase = 0;
pm8001_ha->io_mem[logicalBar].memsize = 0;
@ -520,8 +519,8 @@ static struct pm8001_hba_info *pm8001_pci_alloc(struct pci_dev *pdev,
else {
pm8001_ha->link_rate = LINKRATE_15 | LINKRATE_30 |
LINKRATE_60 | LINKRATE_120;
PM8001_FAIL_DBG(pm8001_ha, pm8001_printk(
"Setting link rate to default value\n"));
pm8001_dbg(pm8001_ha, FAIL,
"Setting link rate to default value\n");
}
sprintf(pm8001_ha->name, "%s%d", DRV_NAME, pm8001_ha->id);
/* IOMB size is 128 for 8088/89 controllers */
@ -684,13 +683,13 @@ static void pm8001_init_sas_add(struct pm8001_hba_info *pm8001_ha)
payload.offset = 0;
payload.func_specific = kzalloc(payload.rd_length, GFP_KERNEL);
if (!payload.func_specific) {
PM8001_INIT_DBG(pm8001_ha, pm8001_printk("mem alloc fail\n"));
pm8001_dbg(pm8001_ha, INIT, "mem alloc fail\n");
return;
}
rc = PM8001_CHIP_DISP->get_nvmd_req(pm8001_ha, &payload);
if (rc) {
kfree(payload.func_specific);
PM8001_INIT_DBG(pm8001_ha, pm8001_printk("nvmd failed\n"));
pm8001_dbg(pm8001_ha, INIT, "nvmd failed\n");
return;
}
wait_for_completion(&completion);
@ -718,9 +717,8 @@ static void pm8001_init_sas_add(struct pm8001_hba_info *pm8001_ha)
sas_add[7] = sas_add[7] + 4;
memcpy(&pm8001_ha->phy[i].dev_sas_addr,
sas_add, SAS_ADDR_SIZE);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("phy %d sas_addr = %016llx\n", i,
pm8001_ha->phy[i].dev_sas_addr));
pm8001_dbg(pm8001_ha, INIT, "phy %d sas_addr = %016llx\n", i,
pm8001_ha->phy[i].dev_sas_addr);
}
kfree(payload.func_specific);
#else
@ -760,7 +758,7 @@ static int pm8001_get_phy_settings_info(struct pm8001_hba_info *pm8001_ha)
rc = PM8001_CHIP_DISP->get_nvmd_req(pm8001_ha, &payload);
if (rc) {
kfree(payload.func_specific);
PM8001_INIT_DBG(pm8001_ha, pm8001_printk("nvmd failed\n"));
pm8001_dbg(pm8001_ha, INIT, "nvmd failed\n");
return -ENOMEM;
}
wait_for_completion(&completion);
@ -854,9 +852,9 @@ void pm8001_get_phy_mask(struct pm8001_hba_info *pm8001_ha, int *phymask)
break;
default:
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("Unknown subsystem device=0x%.04x",
pm8001_ha->pdev->subsystem_device));
pm8001_dbg(pm8001_ha, INIT,
"Unknown subsystem device=0x%.04x\n",
pm8001_ha->pdev->subsystem_device);
}
}
@ -950,9 +948,9 @@ static u32 pm8001_setup_msix(struct pm8001_hba_info *pm8001_ha)
/* Maximum queue number updating in HBA structure */
pm8001_ha->max_q_num = number_of_intr;
PM8001_INIT_DBG(pm8001_ha, pm8001_printk(
"pci_alloc_irq_vectors request ret:%d no of intr %d\n",
rc, pm8001_ha->number_of_intr));
pm8001_dbg(pm8001_ha, INIT,
"pci_alloc_irq_vectors request ret:%d no of intr %d\n",
rc, pm8001_ha->number_of_intr);
return 0;
}
@ -964,9 +962,9 @@ static u32 pm8001_request_msix(struct pm8001_hba_info *pm8001_ha)
if (pm8001_ha->chip_id != chip_8001)
flag &= ~IRQF_SHARED;
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("pci_enable_msix request number of intr %d\n",
pm8001_ha->number_of_intr));
pm8001_dbg(pm8001_ha, INIT,
"pci_enable_msix request number of intr %d\n",
pm8001_ha->number_of_intr);
for (i = 0; i < pm8001_ha->number_of_intr; i++) {
snprintf(pm8001_ha->intr_drvname[i],
@ -1002,8 +1000,7 @@ static u32 pm8001_setup_irq(struct pm8001_hba_info *pm8001_ha)
#ifdef PM8001_USE_MSIX
if (pci_find_capability(pdev, PCI_CAP_ID_MSIX))
return pm8001_setup_msix(pm8001_ha);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("MSIX not supported!!!\n"));
pm8001_dbg(pm8001_ha, INIT, "MSIX not supported!!!\n");
#endif
return 0;
}
@ -1023,8 +1020,7 @@ static u32 pm8001_request_irq(struct pm8001_hba_info *pm8001_ha)
if (pdev->msix_cap && pci_msi_enabled())
return pm8001_request_msix(pm8001_ha);
else {
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("MSIX not supported!!!\n"));
pm8001_dbg(pm8001_ha, INIT, "MSIX not supported!!!\n");
goto intx;
}
#endif
@ -1108,8 +1104,8 @@ static int pm8001_pci_probe(struct pci_dev *pdev,
PM8001_CHIP_DISP->chip_soft_rst(pm8001_ha);
rc = PM8001_CHIP_DISP->chip_init(pm8001_ha);
if (rc) {
PM8001_FAIL_DBG(pm8001_ha, pm8001_printk(
"chip_init failed [ret: %d]\n", rc));
pm8001_dbg(pm8001_ha, FAIL,
"chip_init failed [ret: %d]\n", rc);
goto err_out_ha_free;
}
@ -1137,8 +1133,8 @@ static int pm8001_pci_probe(struct pci_dev *pdev,
pm8001_post_sas_ha_init(shost, chip);
rc = sas_register_ha(SHOST_TO_SAS_HA(shost));
if (rc) {
PM8001_FAIL_DBG(pm8001_ha, pm8001_printk(
"sas_register_ha failed [ret: %d]\n", rc));
pm8001_dbg(pm8001_ha, FAIL,
"sas_register_ha failed [ret: %d]\n", rc);
goto err_out_shost;
}
list_add_tail(&pm8001_ha->list, &hba_list);
@ -1190,8 +1186,8 @@ pm8001_init_ccb_tag(struct pm8001_hba_info *pm8001_ha, struct Scsi_Host *shost,
pm8001_ha->ccb_info =
kcalloc(ccb_count, sizeof(struct pm8001_ccb_info), GFP_KERNEL);
if (!pm8001_ha->ccb_info) {
PM8001_FAIL_DBG(pm8001_ha, pm8001_printk
("Unable to allocate memory for ccb\n"));
pm8001_dbg(pm8001_ha, FAIL,
"Unable to allocate memory for ccb\n");
goto err_out_noccb;
}
for (i = 0; i < ccb_count; i++) {
@ -1199,8 +1195,8 @@ pm8001_init_ccb_tag(struct pm8001_hba_info *pm8001_ha, struct Scsi_Host *shost,
sizeof(struct pm8001_prd) * PM8001_MAX_DMA_SG,
&pm8001_ha->ccb_info[i].ccb_dma_handle);
if (!pm8001_ha->ccb_info[i].buf_prd) {
PM8001_FAIL_DBG(pm8001_ha, pm8001_printk
("pm80xx: ccb prd memory allocation error\n"));
pm8001_dbg(pm8001_ha, FAIL,
"pm80xx: ccb prd memory allocation error\n");
goto err_out;
}
pm8001_ha->ccb_info[i].task = NULL;
@ -1344,8 +1340,7 @@ static int pm8001_pci_resume(struct pci_dev *pdev)
/* chip soft rst only for spc */
if (pm8001_ha->chip_id == chip_8001) {
PM8001_CHIP_DISP->chip_soft_rst(pm8001_ha);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("chip soft reset successful\n"));
pm8001_dbg(pm8001_ha, INIT, "chip soft reset successful\n");
}
rc = PM8001_CHIP_DISP->chip_init(pm8001_ha);
if (rc)

View File

@ -250,8 +250,7 @@ int pm8001_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func,
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
return 0;
default:
PM8001_DEVIO_DBG(pm8001_ha,
pm8001_printk("func 0x%x\n", func));
pm8001_dbg(pm8001_ha, DEVIO, "func 0x%x\n", func);
rc = -EOPNOTSUPP;
}
msleep(300);
@ -405,7 +404,7 @@ static int pm8001_task_exec(struct sas_task *task,
t->task_done(t);
return 0;
}
PM8001_IO_DBG(pm8001_ha, pm8001_printk("pm8001_task_exec device \n "));
pm8001_dbg(pm8001_ha, IO, "pm8001_task_exec device\n");
spin_lock_irqsave(&pm8001_ha->lock, flags);
do {
dev = t->dev;
@ -480,8 +479,7 @@ static int pm8001_task_exec(struct sas_task *task,
}
if (rc) {
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("rc is %x\n", rc));
pm8001_dbg(pm8001_ha, IO, "rc is %x\n", rc);
atomic_dec(&pm8001_dev->running_req);
goto err_out_tag;
}
@ -570,9 +568,9 @@ static struct pm8001_device *pm8001_alloc_dev(struct pm8001_hba_info *pm8001_ha)
}
}
if (dev == PM8001_MAX_DEVICES) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("max support %d devices, ignore ..\n",
PM8001_MAX_DEVICES));
pm8001_dbg(pm8001_ha, FAIL,
"max support %d devices, ignore ..\n",
PM8001_MAX_DEVICES);
}
return NULL;
}
@ -590,8 +588,7 @@ struct pm8001_device *pm8001_find_dev(struct pm8001_hba_info *pm8001_ha,
return &pm8001_ha->devices[dev];
}
if (dev == PM8001_MAX_DEVICES) {
PM8001_FAIL_DBG(pm8001_ha, pm8001_printk("NO MATCHING "
"DEVICE FOUND !!!\n"));
pm8001_dbg(pm8001_ha, FAIL, "NO MATCHING DEVICE FOUND !!!\n");
}
return NULL;
}
@ -652,10 +649,10 @@ static int pm8001_dev_found_notify(struct domain_device *dev)
}
}
if (phy_id == parent_dev->ex_dev.num_phys) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Error: no attached dev:%016llx"
" at ex:%016llx.\n", SAS_ADDR(dev->sas_addr),
SAS_ADDR(parent_dev->sas_addr)));
pm8001_dbg(pm8001_ha, FAIL,
"Error: no attached dev:%016llx at ex:%016llx.\n",
SAS_ADDR(dev->sas_addr),
SAS_ADDR(parent_dev->sas_addr));
res = -1;
}
} else {
@ -665,7 +662,7 @@ static int pm8001_dev_found_notify(struct domain_device *dev)
flag = 1; /* directly sata */
}
} /*register this device to HBA*/
PM8001_DISC_DBG(pm8001_ha, pm8001_printk("Found device\n"));
pm8001_dbg(pm8001_ha, DISC, "Found device\n");
PM8001_CHIP_DISP->reg_dev_req(pm8001_ha, pm8001_device, flag);
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
wait_for_completion(&completion);
@ -737,9 +734,7 @@ static int pm8001_exec_internal_tmf_task(struct domain_device *dev,
if (res) {
del_timer(&task->slow_task->timer);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Executing internal task "
"failed\n"));
pm8001_dbg(pm8001_ha, FAIL, "Executing internal task failed\n");
goto ex_err;
}
wait_for_completion(&task->slow_task->completion);
@ -753,9 +748,9 @@ static int pm8001_exec_internal_tmf_task(struct domain_device *dev,
/* Even TMF timed out, return direct. */
if ((task->task_state_flags & SAS_TASK_STATE_ABORTED)) {
if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("TMF task[%x]timeout.\n",
tmf->tmf));
pm8001_dbg(pm8001_ha, FAIL,
"TMF task[%x]timeout.\n",
tmf->tmf);
goto ex_err;
}
}
@ -776,17 +771,15 @@ static int pm8001_exec_internal_tmf_task(struct domain_device *dev,
if (task->task_status.resp == SAS_TASK_COMPLETE &&
task->task_status.stat == SAS_DATA_OVERRUN) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Blocked task error.\n"));
pm8001_dbg(pm8001_ha, FAIL, "Blocked task error.\n");
res = -EMSGSIZE;
break;
} else {
PM8001_EH_DBG(pm8001_ha,
pm8001_printk(" Task to dev %016llx response:"
"0x%x status 0x%x\n",
SAS_ADDR(dev->sas_addr),
task->task_status.resp,
task->task_status.stat));
pm8001_dbg(pm8001_ha, EH,
" Task to dev %016llx response:0x%x status 0x%x\n",
SAS_ADDR(dev->sas_addr),
task->task_status.resp,
task->task_status.stat);
sas_free_task(task);
task = NULL;
}
@ -833,9 +826,7 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha,
if (res) {
del_timer(&task->slow_task->timer);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Executing internal task "
"failed\n"));
pm8001_dbg(pm8001_ha, FAIL, "Executing internal task failed\n");
goto ex_err;
}
wait_for_completion(&task->slow_task->completion);
@ -843,8 +834,8 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha,
/* Even TMF timed out, return direct. */
if ((task->task_state_flags & SAS_TASK_STATE_ABORTED)) {
if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("TMF task timeout.\n"));
pm8001_dbg(pm8001_ha, FAIL,
"TMF task timeout.\n");
goto ex_err;
}
}
@ -855,12 +846,11 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha,
break;
} else {
PM8001_EH_DBG(pm8001_ha,
pm8001_printk(" Task to dev %016llx response: "
"0x%x status 0x%x\n",
SAS_ADDR(dev->sas_addr),
task->task_status.resp,
task->task_status.stat));
pm8001_dbg(pm8001_ha, EH,
" Task to dev %016llx response: 0x%x status 0x%x\n",
SAS_ADDR(dev->sas_addr),
task->task_status.resp,
task->task_status.stat);
sas_free_task(task);
task = NULL;
}
@ -886,9 +876,8 @@ static void pm8001_dev_gone_notify(struct domain_device *dev)
if (pm8001_dev) {
u32 device_id = pm8001_dev->device_id;
PM8001_DISC_DBG(pm8001_ha,
pm8001_printk("found dev[%d:%x] is gone.\n",
pm8001_dev->device_id, pm8001_dev->dev_type));
pm8001_dbg(pm8001_ha, DISC, "found dev[%d:%x] is gone.\n",
pm8001_dev->device_id, pm8001_dev->dev_type);
if (atomic_read(&pm8001_dev->running_req)) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
pm8001_exec_internal_task_abort(pm8001_ha, pm8001_dev ,
@ -900,8 +889,7 @@ static void pm8001_dev_gone_notify(struct domain_device *dev)
PM8001_CHIP_DISP->dereg_dev_req(pm8001_ha, device_id);
pm8001_free_dev(pm8001_dev);
} else {
PM8001_DISC_DBG(pm8001_ha,
pm8001_printk("Found dev has gone.\n"));
pm8001_dbg(pm8001_ha, DISC, "Found dev has gone.\n");
}
dev->lldd_dev = NULL;
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
@ -1021,9 +1009,9 @@ int pm8001_I_T_nexus_reset(struct domain_device *dev)
}
rc = sas_phy_reset(phy, 1);
if (rc) {
PM8001_EH_DBG(pm8001_ha,
pm8001_printk("phy reset failed for device %x\n"
"with rc %d\n", pm8001_dev->device_id, rc));
pm8001_dbg(pm8001_ha, EH,
"phy reset failed for device %x\n"
"with rc %d\n", pm8001_dev->device_id, rc);
rc = TMF_RESP_FUNC_FAILED;
goto out;
}
@ -1031,17 +1019,16 @@ int pm8001_I_T_nexus_reset(struct domain_device *dev)
rc = pm8001_exec_internal_task_abort(pm8001_ha, pm8001_dev ,
dev, 1, 0);
if (rc) {
PM8001_EH_DBG(pm8001_ha,
pm8001_printk("task abort failed %x\n"
"with rc %d\n", pm8001_dev->device_id, rc));
pm8001_dbg(pm8001_ha, EH, "task abort failed %x\n"
"with rc %d\n", pm8001_dev->device_id, rc);
rc = TMF_RESP_FUNC_FAILED;
}
} else {
rc = sas_phy_reset(phy, 1);
msleep(2000);
}
PM8001_EH_DBG(pm8001_ha, pm8001_printk(" for device[%x]:rc=%d\n",
pm8001_dev->device_id, rc));
pm8001_dbg(pm8001_ha, EH, " for device[%x]:rc=%d\n",
pm8001_dev->device_id, rc);
out:
sas_put_local_phy(phy);
return rc;
@ -1064,8 +1051,7 @@ int pm8001_I_T_nexus_event_handler(struct domain_device *dev)
pm8001_dev = dev->lldd_dev;
pm8001_ha = pm8001_find_ha_by_dev(dev);
PM8001_EH_DBG(pm8001_ha,
pm8001_printk("I_T_Nexus handler invoked !!"));
pm8001_dbg(pm8001_ha, EH, "I_T_Nexus handler invoked !!\n");
phy = sas_get_local_phy(dev);
@ -1104,8 +1090,8 @@ int pm8001_I_T_nexus_event_handler(struct domain_device *dev)
rc = sas_phy_reset(phy, 1);
msleep(2000);
}
PM8001_EH_DBG(pm8001_ha, pm8001_printk(" for device[%x]:rc=%d\n",
pm8001_dev->device_id, rc));
pm8001_dbg(pm8001_ha, EH, " for device[%x]:rc=%d\n",
pm8001_dev->device_id, rc);
out:
sas_put_local_phy(phy);
@ -1134,8 +1120,8 @@ int pm8001_lu_reset(struct domain_device *dev, u8 *lun)
rc = pm8001_issue_ssp_tmf(dev, lun, &tmf_task);
}
/* If failed, fall-through I_T_Nexus reset */
PM8001_EH_DBG(pm8001_ha, pm8001_printk("for device[%x]:rc=%d\n",
pm8001_dev->device_id, rc));
pm8001_dbg(pm8001_ha, EH, "for device[%x]:rc=%d\n",
pm8001_dev->device_id, rc);
return rc;
}
@ -1143,7 +1129,6 @@ int pm8001_lu_reset(struct domain_device *dev, u8 *lun)
int pm8001_query_task(struct sas_task *task)
{
u32 tag = 0xdeadbeef;
int i = 0;
struct scsi_lun lun;
struct pm8001_tmf_task tmf_task;
int rc = TMF_RESP_FUNC_FAILED;
@ -1162,10 +1147,7 @@ int pm8001_query_task(struct sas_task *task)
rc = TMF_RESP_FUNC_FAILED;
return rc;
}
PM8001_EH_DBG(pm8001_ha, pm8001_printk("Query:["));
for (i = 0; i < 16; i++)
printk(KERN_INFO "%02x ", cmnd->cmnd[i]);
printk(KERN_INFO "]\n");
pm8001_dbg(pm8001_ha, EH, "Query:[%16ph]\n", cmnd->cmnd);
tmf_task.tmf = TMF_QUERY_TASK;
tmf_task.tag_of_task_to_be_managed = tag;
@ -1173,15 +1155,14 @@ int pm8001_query_task(struct sas_task *task)
switch (rc) {
/* The task is still in Lun, release it then */
case TMF_RESP_FUNC_SUCC:
PM8001_EH_DBG(pm8001_ha,
pm8001_printk("The task is still in Lun\n"));
pm8001_dbg(pm8001_ha, EH,
"The task is still in Lun\n");
break;
/* The task is not in Lun or failed, reset the phy */
case TMF_RESP_FUNC_FAILED:
case TMF_RESP_FUNC_COMPLETE:
PM8001_EH_DBG(pm8001_ha,
pm8001_printk("The task is not in Lun or failed,"
" reset the phy\n"));
pm8001_dbg(pm8001_ha, EH,
"The task is not in Lun or failed, reset the phy\n");
break;
}
}
@ -1267,8 +1248,8 @@ int pm8001_abort_task(struct sas_task *task)
* leaking the task in libsas or losing the race and
* getting a double free.
*/
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("Waiting for local phy ctl\n"));
pm8001_dbg(pm8001_ha, MSG,
"Waiting for local phy ctl\n");
ret = wait_for_completion_timeout(&completion,
PM8001_TASK_TIMEOUT * HZ);
if (!ret || !phy->reset_success) {
@ -1278,8 +1259,8 @@ int pm8001_abort_task(struct sas_task *task)
/* 3. Wait for Port Reset complete or
* Port reset TMO
*/
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("Waiting for Port reset\n"));
pm8001_dbg(pm8001_ha, MSG,
"Waiting for Port reset\n");
ret = wait_for_completion_timeout(
&completion_reset,
PM8001_TASK_TIMEOUT * HZ);
@ -1358,9 +1339,8 @@ int pm8001_clear_task_set(struct domain_device *dev, u8 *lun)
struct pm8001_device *pm8001_dev = dev->lldd_dev;
struct pm8001_hba_info *pm8001_ha = pm8001_find_ha_by_dev(dev);
PM8001_EH_DBG(pm8001_ha,
pm8001_printk("I_T_L_Q clear task set[%x]\n",
pm8001_dev->device_id));
pm8001_dbg(pm8001_ha, EH, "I_T_L_Q clear task set[%x]\n",
pm8001_dev->device_id);
tmf_task.tmf = TMF_CLEAR_TASK_SET;
return pm8001_issue_ssp_tmf(dev, lun, &tmf_task);
}

View File

@ -69,45 +69,16 @@
#define PM8001_DEV_LOGGING 0x80 /* development message logging */
#define PM8001_DEVIO_LOGGING 0x100 /* development io message logging */
#define PM8001_IOERR_LOGGING 0x200 /* development io err message logging */
#define pm8001_printk(format, arg...) pr_info("%s:: %s %d:" \
format, pm8001_ha->name, __func__, __LINE__, ## arg)
#define PM8001_CHECK_LOGGING(HBA, LEVEL, CMD) \
do { \
if (unlikely(HBA->logging_level & LEVEL)) \
do { \
CMD; \
} while (0); \
} while (0);
#define PM8001_EH_DBG(HBA, CMD) \
PM8001_CHECK_LOGGING(HBA, PM8001_EH_LOGGING, CMD)
#define pm8001_printk(fmt, ...) \
pr_info("%s:: %s %d:" fmt, \
pm8001_ha->name, __func__, __LINE__, ##__VA_ARGS__)
#define PM8001_INIT_DBG(HBA, CMD) \
PM8001_CHECK_LOGGING(HBA, PM8001_INIT_LOGGING, CMD)
#define PM8001_DISC_DBG(HBA, CMD) \
PM8001_CHECK_LOGGING(HBA, PM8001_DISC_LOGGING, CMD)
#define PM8001_IO_DBG(HBA, CMD) \
PM8001_CHECK_LOGGING(HBA, PM8001_IO_LOGGING, CMD)
#define PM8001_FAIL_DBG(HBA, CMD) \
PM8001_CHECK_LOGGING(HBA, PM8001_FAIL_LOGGING, CMD)
#define PM8001_IOCTL_DBG(HBA, CMD) \
PM8001_CHECK_LOGGING(HBA, PM8001_IOCTL_LOGGING, CMD)
#define PM8001_MSG_DBG(HBA, CMD) \
PM8001_CHECK_LOGGING(HBA, PM8001_MSG_LOGGING, CMD)
#define PM8001_DEV_DBG(HBA, CMD) \
PM8001_CHECK_LOGGING(HBA, PM8001_DEV_LOGGING, CMD)
#define PM8001_DEVIO_DBG(HBA, CMD) \
PM8001_CHECK_LOGGING(HBA, PM8001_DEVIO_LOGGING, CMD)
#define PM8001_IOERR_DBG(HBA, CMD) \
PM8001_CHECK_LOGGING(HBA, PM8001_IOERR_LOGGING, CMD)
#define pm8001_dbg(HBA, level, fmt, ...) \
do { \
if (unlikely((HBA)->logging_level & PM8001_##level##_LOGGING)) \
pm8001_printk(fmt, ##__VA_ARGS__); \
} while (0)
#define PM8001_USE_TASKLET
#define PM8001_USE_MSIX

File diff suppressed because it is too large Load Diff