Commit 6c0a60ec authored by Brian King's avatar Brian King Committed by James Bottomley

[SCSI] ibmvscsi: Enhanced error logging

Converts ibmvscsi to use dev_printk and friends to simplify
debugging. ibmvscsi adapter initialization now looks like this:

ibmvscsi 30000005: SRP_VERSION: 16.a
ibmvscsi 30000005: partner initialization complete
ibmvscsi 30000005: sent SRP login
ibmvscsi 30000005: SRP_LOGIN succeeded

Additionally, this patch adds the logging of a couple return codes in
a couple logs.
Signed-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 2a730937
This diff is collapsed.
...@@ -177,7 +177,7 @@ static void set_adapter_info(struct ibmvscsi_host_data *hostdata) ...@@ -177,7 +177,7 @@ static void set_adapter_info(struct ibmvscsi_host_data *hostdata)
memset(&hostdata->madapter_info, 0x00, memset(&hostdata->madapter_info, 0x00,
sizeof(hostdata->madapter_info)); sizeof(hostdata->madapter_info));
printk(KERN_INFO "rpa_vscsi: SPR_VERSION: %s\n", SRP_VERSION); dev_info(hostdata->dev, "SRP_VERSION: %s\n", SRP_VERSION);
strcpy(hostdata->madapter_info.srp_version, SRP_VERSION); strcpy(hostdata->madapter_info.srp_version, SRP_VERSION);
strncpy(hostdata->madapter_info.partition_name, partition_name, strncpy(hostdata->madapter_info.partition_name, partition_name,
...@@ -232,25 +232,24 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue, ...@@ -232,25 +232,24 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
if (rc == 2) { if (rc == 2) {
/* Adapter is good, but other end is not ready */ /* Adapter is good, but other end is not ready */
printk(KERN_WARNING "ibmvscsi: Partner adapter not ready\n"); dev_warn(hostdata->dev, "Partner adapter not ready\n");
retrc = 0; retrc = 0;
} else if (rc != 0) { } else if (rc != 0) {
printk(KERN_WARNING "ibmvscsi: Error %d opening adapter\n", rc); dev_warn(hostdata->dev, "Error %d opening adapter\n", rc);
goto reg_crq_failed; goto reg_crq_failed;
} }
if (request_irq(vdev->irq, if (request_irq(vdev->irq,
ibmvscsi_handle_event, ibmvscsi_handle_event,
0, "ibmvscsi", (void *)hostdata) != 0) { 0, "ibmvscsi", (void *)hostdata) != 0) {
printk(KERN_ERR "ibmvscsi: couldn't register irq 0x%x\n", dev_err(hostdata->dev, "couldn't register irq 0x%x\n",
vdev->irq); vdev->irq);
goto req_irq_failed; goto req_irq_failed;
} }
rc = vio_enable_interrupts(vdev); rc = vio_enable_interrupts(vdev);
if (rc != 0) { if (rc != 0) {
printk(KERN_ERR "ibmvscsi: Error %d enabling interrupts!!!\n", dev_err(hostdata->dev, "Error %d enabling interrupts!!!\n", rc);
rc);
goto req_irq_failed; goto req_irq_failed;
} }
...@@ -294,7 +293,7 @@ int ibmvscsi_reenable_crq_queue(struct crq_queue *queue, ...@@ -294,7 +293,7 @@ int ibmvscsi_reenable_crq_queue(struct crq_queue *queue,
} while ((rc == H_IN_PROGRESS) || (rc == H_BUSY) || (H_IS_LONG_BUSY(rc))); } while ((rc == H_IN_PROGRESS) || (rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
if (rc) if (rc)
printk(KERN_ERR "ibmvscsi: Error %d enabling adapter\n", rc); dev_err(hostdata->dev, "Error %d enabling adapter\n", rc);
return rc; return rc;
} }
...@@ -327,10 +326,9 @@ int ibmvscsi_reset_crq_queue(struct crq_queue *queue, ...@@ -327,10 +326,9 @@ int ibmvscsi_reset_crq_queue(struct crq_queue *queue,
queue->msg_token, PAGE_SIZE); queue->msg_token, PAGE_SIZE);
if (rc == 2) { if (rc == 2) {
/* Adapter is good, but other end is not ready */ /* Adapter is good, but other end is not ready */
printk(KERN_WARNING "ibmvscsi: Partner adapter not ready\n"); dev_warn(hostdata->dev, "Partner adapter not ready\n");
} else if (rc != 0) { } else if (rc != 0) {
printk(KERN_WARNING dev_warn(hostdata->dev, "couldn't register crq--rc 0x%x\n", rc);
"ibmvscsi: couldn't register crq--rc 0x%x\n", rc);
} }
return rc; return rc;
} }
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