aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pmcraid.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/pmcraid.c')
-rw-r--r--drivers/scsi/pmcraid.c68
1 files changed, 36 insertions, 32 deletions
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 4302f06e4ec9..0a97bc9074bb 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -46,6 +46,7 @@
46#include <linux/mutex.h> 46#include <linux/mutex.h>
47#include <scsi/scsi.h> 47#include <scsi/scsi.h>
48#include <scsi/scsi_host.h> 48#include <scsi/scsi_host.h>
49#include <scsi/scsi_device.h>
49#include <scsi/scsi_tcq.h> 50#include <scsi/scsi_tcq.h>
50#include <scsi/scsi_eh.h> 51#include <scsi/scsi_eh.h>
51#include <scsi/scsi_cmnd.h> 52#include <scsi/scsi_cmnd.h>
@@ -684,7 +685,7 @@ static void pmcraid_timeout_handler(struct pmcraid_cmd *cmd)
684 struct pmcraid_instance *pinstance = cmd->drv_inst; 685 struct pmcraid_instance *pinstance = cmd->drv_inst;
685 unsigned long lock_flags; 686 unsigned long lock_flags;
686 687
687 dev_err(&pinstance->pdev->dev, 688 dev_info(&pinstance->pdev->dev,
688 "Adapter being reset due to command timeout.\n"); 689 "Adapter being reset due to command timeout.\n");
689 690
690 /* Command timeouts result in hard reset sequence. The command that got 691 /* Command timeouts result in hard reset sequence. The command that got
@@ -815,8 +816,9 @@ static void pmcraid_erp_done(struct pmcraid_cmd *cmd)
815 816
816 if (PMCRAID_IOASC_SENSE_KEY(ioasc) > 0) { 817 if (PMCRAID_IOASC_SENSE_KEY(ioasc) > 0) {
817 scsi_cmd->result |= (DID_ERROR << 16); 818 scsi_cmd->result |= (DID_ERROR << 16);
818 pmcraid_err("command CDB[0] = %x failed with IOASC: 0x%08X\n", 819 scmd_printk(KERN_INFO, scsi_cmd,
819 cmd->ioa_cb->ioarcb.cdb[0], ioasc); 820 "command CDB[0] = %x failed with IOASC: 0x%08X\n",
821 cmd->ioa_cb->ioarcb.cdb[0], ioasc);
820 } 822 }
821 823
822 /* if we had allocated sense buffers for request sense, copy the sense 824 /* if we had allocated sense buffers for request sense, copy the sense
@@ -1069,7 +1071,7 @@ static struct pmcraid_cmd *pmcraid_init_hcam
1069 1071
1070 ioarcb->data_transfer_length = cpu_to_le32(rcb_size); 1072 ioarcb->data_transfer_length = cpu_to_le32(rcb_size);
1071 1073
1072 ioadl[0].flags |= cpu_to_le32(IOADL_FLAGS_READ_LAST); 1074 ioadl[0].flags |= IOADL_FLAGS_READ_LAST;
1073 ioadl[0].data_len = cpu_to_le32(rcb_size); 1075 ioadl[0].data_len = cpu_to_le32(rcb_size);
1074 ioadl[0].address = cpu_to_le32(dma); 1076 ioadl[0].address = cpu_to_le32(dma);
1075 1077
@@ -1541,13 +1543,13 @@ static void pmcraid_handle_error_log(struct pmcraid_instance *pinstance)
1541 1543
1542 if (pinstance->ldn.hcam->notification_lost == 1544 if (pinstance->ldn.hcam->notification_lost ==
1543 HOSTRCB_NOTIFICATIONS_LOST) 1545 HOSTRCB_NOTIFICATIONS_LOST)
1544 dev_err(&pinstance->pdev->dev, "Error notifications lost\n"); 1546 dev_info(&pinstance->pdev->dev, "Error notifications lost\n");
1545 1547
1546 ioasc = le32_to_cpu(hcam_ldn->error_log.fd_ioasc); 1548 ioasc = le32_to_cpu(hcam_ldn->error_log.fd_ioasc);
1547 1549
1548 if (ioasc == PMCRAID_IOASC_UA_BUS_WAS_RESET || 1550 if (ioasc == PMCRAID_IOASC_UA_BUS_WAS_RESET ||
1549 ioasc == PMCRAID_IOASC_UA_BUS_WAS_RESET_BY_OTHER) { 1551 ioasc == PMCRAID_IOASC_UA_BUS_WAS_RESET_BY_OTHER) {
1550 dev_err(&pinstance->pdev->dev, 1552 dev_info(&pinstance->pdev->dev,
1551 "UnitAttention due to IOA Bus Reset\n"); 1553 "UnitAttention due to IOA Bus Reset\n");
1552 scsi_report_bus_reset( 1554 scsi_report_bus_reset(
1553 pinstance->host, 1555 pinstance->host,
@@ -1584,7 +1586,7 @@ static void pmcraid_process_ccn(struct pmcraid_cmd *cmd)
1584 atomic_read(&pinstance->ccn.ignore) == 1) { 1586 atomic_read(&pinstance->ccn.ignore) == 1) {
1585 return; 1587 return;
1586 } else if (ioasc) { 1588 } else if (ioasc) {
1587 dev_err(&pinstance->pdev->dev, 1589 dev_info(&pinstance->pdev->dev,
1588 "Host RCB (CCN) failed with IOASC: 0x%08X\n", ioasc); 1590 "Host RCB (CCN) failed with IOASC: 0x%08X\n", ioasc);
1589 spin_lock_irqsave(pinstance->host->host_lock, lock_flags); 1591 spin_lock_irqsave(pinstance->host->host_lock, lock_flags);
1590 pmcraid_send_hcam(pinstance, PMCRAID_HCAM_CODE_CONFIG_CHANGE); 1592 pmcraid_send_hcam(pinstance, PMCRAID_HCAM_CODE_CONFIG_CHANGE);
@@ -1634,7 +1636,7 @@ static void pmcraid_process_ldn(struct pmcraid_cmd *cmd)
1634 return; 1636 return;
1635 } 1637 }
1636 } else { 1638 } else {
1637 dev_err(&pinstance->pdev->dev, 1639 dev_info(&pinstance->pdev->dev,
1638 "Host RCB(LDN) failed with IOASC: 0x%08X\n", ioasc); 1640 "Host RCB(LDN) failed with IOASC: 0x%08X\n", ioasc);
1639 } 1641 }
1640 /* send netlink message for HCAM notification if enabled */ 1642 /* send netlink message for HCAM notification if enabled */
@@ -1822,7 +1824,6 @@ static void pmcraid_fail_outstanding_cmds(struct pmcraid_instance *pinstance)
1822 scsi_dma_unmap(scsi_cmd); 1824 scsi_dma_unmap(scsi_cmd);
1823 pmcraid_return_cmd(cmd); 1825 pmcraid_return_cmd(cmd);
1824 1826
1825
1826 pmcraid_info("failing(%d) CDB[0] = %x result: %x\n", 1827 pmcraid_info("failing(%d) CDB[0] = %x result: %x\n",
1827 le32_to_cpu(resp) >> 2, 1828 le32_to_cpu(resp) >> 2,
1828 cmd->ioa_cb->ioarcb.cdb[0], 1829 cmd->ioa_cb->ioarcb.cdb[0],
@@ -2250,7 +2251,7 @@ static void pmcraid_request_sense(struct pmcraid_cmd *cmd)
2250 2251
2251 ioadl->address = cpu_to_le64(cmd->sense_buffer_dma); 2252 ioadl->address = cpu_to_le64(cmd->sense_buffer_dma);
2252 ioadl->data_len = cpu_to_le32(SCSI_SENSE_BUFFERSIZE); 2253 ioadl->data_len = cpu_to_le32(SCSI_SENSE_BUFFERSIZE);
2253 ioadl->flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC); 2254 ioadl->flags = IOADL_FLAGS_LAST_DESC;
2254 2255
2255 /* request sense might be called as part of error response processing 2256 /* request sense might be called as part of error response processing
2256 * which runs in tasklets context. It is possible that mid-layer might 2257 * which runs in tasklets context. It is possible that mid-layer might
@@ -2514,7 +2515,8 @@ static int pmcraid_reset_device(
2514 res = scsi_cmd->device->hostdata; 2515 res = scsi_cmd->device->hostdata;
2515 2516
2516 if (!res) { 2517 if (!res) {
2517 pmcraid_err("reset_device: NULL resource pointer\n"); 2518 sdev_printk(KERN_ERR, scsi_cmd->device,
2519 "reset_device: NULL resource pointer\n");
2518 return FAILED; 2520 return FAILED;
2519 } 2521 }
2520 2522
@@ -2752,8 +2754,8 @@ static int pmcraid_eh_abort_handler(struct scsi_cmnd *scsi_cmd)
2752 pinstance = 2754 pinstance =
2753 (struct pmcraid_instance *)scsi_cmd->device->host->hostdata; 2755 (struct pmcraid_instance *)scsi_cmd->device->host->hostdata;
2754 2756
2755 dev_err(&pinstance->pdev->dev, 2757 scmd_printk(KERN_INFO, scsi_cmd,
2756 "I/O command timed out, aborting it.\n"); 2758 "I/O command timed out, aborting it.\n");
2757 2759
2758 res = scsi_cmd->device->hostdata; 2760 res = scsi_cmd->device->hostdata;
2759 2761
@@ -2824,7 +2826,8 @@ static int pmcraid_eh_abort_handler(struct scsi_cmnd *scsi_cmd)
2824 */ 2826 */
2825static int pmcraid_eh_device_reset_handler(struct scsi_cmnd *scmd) 2827static int pmcraid_eh_device_reset_handler(struct scsi_cmnd *scmd)
2826{ 2828{
2827 pmcraid_err("Doing device reset due to an I/O command timeout.\n"); 2829 scmd_printk(KERN_INFO, scmd,
2830 "resetting device due to an I/O command timeout.\n");
2828 return pmcraid_reset_device(scmd, 2831 return pmcraid_reset_device(scmd,
2829 PMCRAID_INTERNAL_TIMEOUT, 2832 PMCRAID_INTERNAL_TIMEOUT,
2830 RESET_DEVICE_LUN); 2833 RESET_DEVICE_LUN);
@@ -2832,7 +2835,8 @@ static int pmcraid_eh_device_reset_handler(struct scsi_cmnd *scmd)
2832 2835
2833static int pmcraid_eh_bus_reset_handler(struct scsi_cmnd *scmd) 2836static int pmcraid_eh_bus_reset_handler(struct scsi_cmnd *scmd)
2834{ 2837{
2835 pmcraid_err("Doing bus reset due to an I/O command timeout.\n"); 2838 scmd_printk(KERN_INFO, scmd,
2839 "Doing bus reset due to an I/O command timeout.\n");
2836 return pmcraid_reset_device(scmd, 2840 return pmcraid_reset_device(scmd,
2837 PMCRAID_RESET_BUS_TIMEOUT, 2841 PMCRAID_RESET_BUS_TIMEOUT,
2838 RESET_DEVICE_BUS); 2842 RESET_DEVICE_BUS);
@@ -2840,7 +2844,8 @@ static int pmcraid_eh_bus_reset_handler(struct scsi_cmnd *scmd)
2840 2844
2841static int pmcraid_eh_target_reset_handler(struct scsi_cmnd *scmd) 2845static int pmcraid_eh_target_reset_handler(struct scsi_cmnd *scmd)
2842{ 2846{
2843 pmcraid_err("Doing target reset due to an I/O command timeout.\n"); 2847 scmd_printk(KERN_INFO, scmd,
2848 "Doing target reset due to an I/O command timeout.\n");
2844 return pmcraid_reset_device(scmd, 2849 return pmcraid_reset_device(scmd,
2845 PMCRAID_INTERNAL_TIMEOUT, 2850 PMCRAID_INTERNAL_TIMEOUT,
2846 RESET_DEVICE_TARGET); 2851 RESET_DEVICE_TARGET);
@@ -2988,11 +2993,11 @@ static int pmcraid_build_ioadl(
2988 nseg = scsi_dma_map(scsi_cmd); 2993 nseg = scsi_dma_map(scsi_cmd);
2989 2994
2990 if (nseg < 0) { 2995 if (nseg < 0) {
2991 dev_err(&pinstance->pdev->dev, "scsi_map_dma failed!\n"); 2996 scmd_printk(KERN_ERR, scsi_cmd, "scsi_map_dma failed!\n");
2992 return -1; 2997 return -1;
2993 } else if (nseg > PMCRAID_MAX_IOADLS) { 2998 } else if (nseg > PMCRAID_MAX_IOADLS) {
2994 scsi_dma_unmap(scsi_cmd); 2999 scsi_dma_unmap(scsi_cmd);
2995 dev_err(&pinstance->pdev->dev, 3000 scmd_printk(KERN_ERR, scsi_cmd,
2996 "sg count is (%d) more than allowed!\n", nseg); 3001 "sg count is (%d) more than allowed!\n", nseg);
2997 return -1; 3002 return -1;
2998 } 3003 }
@@ -3012,7 +3017,7 @@ static int pmcraid_build_ioadl(
3012 ioadl[i].flags = 0; 3017 ioadl[i].flags = 0;
3013 } 3018 }
3014 /* setup last descriptor */ 3019 /* setup last descriptor */
3015 ioadl[i - 1].flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC); 3020 ioadl[i - 1].flags = IOADL_FLAGS_LAST_DESC;
3016 3021
3017 return 0; 3022 return 0;
3018} 3023}
@@ -3382,7 +3387,7 @@ static int pmcraid_build_passthrough_ioadls(
3382 } 3387 }
3383 3388
3384 /* setup the last descriptor */ 3389 /* setup the last descriptor */
3385 ioadl[i - 1].flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC); 3390 ioadl[i - 1].flags = IOADL_FLAGS_LAST_DESC;
3386 3391
3387 return 0; 3392 return 0;
3388} 3393}
@@ -5040,7 +5045,7 @@ static int pmcraid_resume(struct pci_dev *pdev)
5040 rc = pci_enable_device(pdev); 5045 rc = pci_enable_device(pdev);
5041 5046
5042 if (rc) { 5047 if (rc) {
5043 pmcraid_err("pmcraid: Enable device failed\n"); 5048 dev_err(&pdev->dev, "resume: Enable device failed\n");
5044 return rc; 5049 return rc;
5045 } 5050 }
5046 5051
@@ -5054,7 +5059,7 @@ static int pmcraid_resume(struct pci_dev *pdev)
5054 rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); 5059 rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
5055 5060
5056 if (rc != 0) { 5061 if (rc != 0) {
5057 dev_err(&pdev->dev, "Failed to set PCI DMA mask\n"); 5062 dev_err(&pdev->dev, "resume: Failed to set PCI DMA mask\n");
5058 goto disable_device; 5063 goto disable_device;
5059 } 5064 }
5060 5065
@@ -5063,7 +5068,8 @@ static int pmcraid_resume(struct pci_dev *pdev)
5063 rc = pmcraid_register_interrupt_handler(pinstance); 5068 rc = pmcraid_register_interrupt_handler(pinstance);
5064 5069
5065 if (rc) { 5070 if (rc) {
5066 pmcraid_err("resume: couldn't register interrupt handlers\n"); 5071 dev_err(&pdev->dev,
5072 "resume: couldn't register interrupt handlers\n");
5067 rc = -ENODEV; 5073 rc = -ENODEV;
5068 goto release_host; 5074 goto release_host;
5069 } 5075 }
@@ -5080,7 +5086,7 @@ static int pmcraid_resume(struct pci_dev *pdev)
5080 * state. 5086 * state.
5081 */ 5087 */
5082 if (pmcraid_reset_bringup(pinstance)) { 5088 if (pmcraid_reset_bringup(pinstance)) {
5083 pmcraid_err("couldn't initialize IOA \n"); 5089 dev_err(&pdev->dev, "couldn't initialize IOA \n");
5084 rc = -ENODEV; 5090 rc = -ENODEV;
5085 goto release_tasklets; 5091 goto release_tasklets;
5086 } 5092 }
@@ -5187,7 +5193,7 @@ static void pmcraid_init_res_table(struct pmcraid_cmd *cmd)
5187 LIST_HEAD(old_res); 5193 LIST_HEAD(old_res);
5188 5194
5189 if (pinstance->cfg_table->flags & MICROCODE_UPDATE_REQUIRED) 5195 if (pinstance->cfg_table->flags & MICROCODE_UPDATE_REQUIRED)
5190 dev_err(&pinstance->pdev->dev, "Require microcode download\n"); 5196 pmcraid_err("IOA requires microcode download\n");
5191 5197
5192 /* resource list is protected by pinstance->resource_lock. 5198 /* resource list is protected by pinstance->resource_lock.
5193 * init_res_table can be called from probe (user-thread) or runtime 5199 * init_res_table can be called from probe (user-thread) or runtime
@@ -5224,8 +5230,7 @@ static void pmcraid_init_res_table(struct pmcraid_cmd *cmd)
5224 if (!found) { 5230 if (!found) {
5225 5231
5226 if (list_empty(&pinstance->free_res_q)) { 5232 if (list_empty(&pinstance->free_res_q)) {
5227 dev_err(&pinstance->pdev->dev, 5233 pmcraid_err("Too many devices attached\n");
5228 "Too many devices attached\n");
5229 break; 5234 break;
5230 } 5235 }
5231 5236
@@ -5309,7 +5314,7 @@ static void pmcraid_querycfg(struct pmcraid_cmd *cmd)
5309 cpu_to_le32(sizeof(struct pmcraid_config_table)); 5314 cpu_to_le32(sizeof(struct pmcraid_config_table));
5310 5315
5311 ioadl = &(ioarcb->add_data.u.ioadl[0]); 5316 ioadl = &(ioarcb->add_data.u.ioadl[0]);
5312 ioadl->flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC); 5317 ioadl->flags = IOADL_FLAGS_LAST_DESC;
5313 ioadl->address = cpu_to_le64(pinstance->cfg_table_bus_addr); 5318 ioadl->address = cpu_to_le64(pinstance->cfg_table_bus_addr);
5314 ioadl->data_len = cpu_to_le32(sizeof(struct pmcraid_config_table)); 5319 ioadl->data_len = cpu_to_le32(sizeof(struct pmcraid_config_table));
5315 5320
@@ -5442,7 +5447,7 @@ static int __devinit pmcraid_probe(
5442 rc = pmcraid_register_interrupt_handler(pinstance); 5447 rc = pmcraid_register_interrupt_handler(pinstance);
5443 5448
5444 if (rc) { 5449 if (rc) {
5445 pmcraid_err("couldn't register interrupt handler\n"); 5450 dev_err(&pdev->dev, "couldn't register interrupt handler\n");
5446 goto out_scsi_host_put; 5451 goto out_scsi_host_put;
5447 } 5452 }
5448 5453
@@ -5466,7 +5471,7 @@ static int __devinit pmcraid_probe(
5466 */ 5471 */
5467 pmcraid_info("starting IOA initialization sequence\n"); 5472 pmcraid_info("starting IOA initialization sequence\n");
5468 if (pmcraid_reset_bringup(pinstance)) { 5473 if (pmcraid_reset_bringup(pinstance)) {
5469 pmcraid_err("couldn't initialize IOA \n"); 5474 dev_err(&pdev->dev, "couldn't initialize IOA \n");
5470 rc = 1; 5475 rc = 1;
5471 goto out_release_bufs; 5476 goto out_release_bufs;
5472 } 5477 }
@@ -5534,7 +5539,6 @@ static struct pci_driver pmcraid_driver = {
5534 .shutdown = pmcraid_shutdown 5539 .shutdown = pmcraid_shutdown
5535}; 5540};
5536 5541
5537
5538/** 5542/**
5539 * pmcraid_init - module load entry point 5543 * pmcraid_init - module load entry point
5540 */ 5544 */
@@ -5566,7 +5570,6 @@ static int __init pmcraid_init(void)
5566 goto out_unreg_chrdev; 5570 goto out_unreg_chrdev;
5567 } 5571 }
5568 5572
5569
5570 error = pmcraid_netlink_init(); 5573 error = pmcraid_netlink_init();
5571 5574
5572 if (error) 5575 if (error)
@@ -5584,6 +5587,7 @@ static int __init pmcraid_init(void)
5584 5587
5585out_unreg_chrdev: 5588out_unreg_chrdev:
5586 unregister_chrdev_region(MKDEV(pmcraid_major, 0), PMCRAID_MAX_ADAPTERS); 5589 unregister_chrdev_region(MKDEV(pmcraid_major, 0), PMCRAID_MAX_ADAPTERS);
5590
5587out_init: 5591out_init:
5588 return error; 5592 return error;
5589} 5593}