aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorscameron@beardog.cca.cpqcorp.net <scameron@beardog.cca.cpqcorp.net>2009-06-08 17:07:45 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-06-08 23:47:43 -0400
commit85cc61ae41084cb6d8ecc6c9e01ac4563005c8ac (patch)
tree46cdea00cdac692292f5997fdce2c8b4cac983f9 /drivers/block
parent789a424ad1352b335960e7c56494d0410577fa61 (diff)
cciss: change SCSI error handling routines to work with interrupts enabled.
Change cciss scsi error handling routines to work with interrupts enabled. Signed-off-by: Stephen M. Cameron <scameron@beardog.cca.cpqcorp.net> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/cciss.c3
-rw-r--r--drivers/block/cciss_scsi.c24
2 files changed, 12 insertions, 15 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 70017071106..9a9db6deefc 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -184,6 +184,9 @@ static int sendcmd(__u8 cmd, int ctlr, void *buff, size_t size,
184static int sendcmd_withirq(__u8 cmd, int ctlr, void *buff, size_t size, 184static int sendcmd_withirq(__u8 cmd, int ctlr, void *buff, size_t size,
185 __u8 page_code, unsigned char scsi3addr[], 185 __u8 page_code, unsigned char scsi3addr[],
186 int cmd_type); 186 int cmd_type);
187static int sendcmd_withirq_core(ctlr_info_t *h, CommandList_struct *c,
188 int attempt_retry);
189static int process_sendcmd_error(ctlr_info_t *h, CommandList_struct *c);
187 190
188static void fail_all_cmds(unsigned long ctlr); 191static void fail_all_cmds(unsigned long ctlr);
189static int scan_thread(void *data); 192static int scan_thread(void *data);
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
index 007ab8aea85..d2eb4897741 100644
--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_scsi.c
@@ -49,8 +49,6 @@ static int fill_cmd(CommandList_struct *c, __u8 cmd, int ctlr, void *buff,
49 __u8 page_code, unsigned char *scsi3addr, 49 __u8 page_code, unsigned char *scsi3addr,
50 int cmd_type); 50 int cmd_type);
51 51
52static int sendcmd_core(ctlr_info_t *h, CommandList_struct *c);
53
54static CommandList_struct *cmd_alloc(ctlr_info_t *h, int get_from_pool); 52static CommandList_struct *cmd_alloc(ctlr_info_t *h, int get_from_pool);
55static void cmd_free(ctlr_info_t *h, CommandList_struct *c, int got_from_pool); 53static void cmd_free(ctlr_info_t *h, CommandList_struct *c, int got_from_pool);
56 54
@@ -1601,11 +1599,10 @@ static int wait_for_device_to_become_ready(ctlr_info_t *h,
1601 /* Send the Test Unit Ready */ 1599 /* Send the Test Unit Ready */
1602 rc = fill_cmd(c, TEST_UNIT_READY, h->ctlr, NULL, 0, 0, 1600 rc = fill_cmd(c, TEST_UNIT_READY, h->ctlr, NULL, 0, 0,
1603 lunaddr, TYPE_CMD); 1601 lunaddr, TYPE_CMD);
1604 if (rc == 0) { 1602 if (rc == 0)
1605 rc = sendcmd_core(h, c); 1603 rc = sendcmd_withirq_core(h, c, 0);
1606 /* sendcmd turned off interrupts, turn 'em back on. */ 1604
1607 h->access.set_intr_mask(h, CCISS_INTR_ON); 1605 (void) process_sendcmd_error(h, c);
1608 }
1609 1606
1610 if (rc == 0 && c->err_info->CommandStatus == CMD_SUCCESS) 1607 if (rc == 0 && c->err_info->CommandStatus == CMD_SUCCESS)
1611 break; 1608 break;
@@ -1663,10 +1660,8 @@ static int cciss_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
1663 return FAILED; 1660 return FAILED;
1664 memcpy(lunaddr, &cmd_in_trouble->Header.LUN.LunAddrBytes[0], 8); 1661 memcpy(lunaddr, &cmd_in_trouble->Header.LUN.LunAddrBytes[0], 8);
1665 /* send a reset to the SCSI LUN which the command was sent to */ 1662 /* send a reset to the SCSI LUN which the command was sent to */
1666 rc = sendcmd(CCISS_RESET_MSG, ctlr, NULL, 0, 0, lunaddr, 1663 rc = sendcmd_withirq(CCISS_RESET_MSG, ctlr, NULL, 0, 0, lunaddr,
1667 TYPE_MSG); 1664 TYPE_MSG);
1668 /* sendcmd turned off interrupts on the board, turn 'em back on. */
1669 (*c)->access.set_intr_mask(*c, CCISS_INTR_ON);
1670 if (rc == 0 && wait_for_device_to_become_ready(*c, lunaddr) == 0) 1665 if (rc == 0 && wait_for_device_to_become_ready(*c, lunaddr) == 0)
1671 return SUCCESS; 1666 return SUCCESS;
1672 printk(KERN_WARNING "cciss%d: resetting device failed.\n", ctlr); 1667 printk(KERN_WARNING "cciss%d: resetting device failed.\n", ctlr);
@@ -1677,6 +1672,7 @@ static int cciss_eh_abort_handler(struct scsi_cmnd *scsicmd)
1677{ 1672{
1678 int rc; 1673 int rc;
1679 CommandList_struct *cmd_to_abort; 1674 CommandList_struct *cmd_to_abort;
1675 unsigned char lunaddr[8];
1680 ctlr_info_t **c; 1676 ctlr_info_t **c;
1681 int ctlr; 1677 int ctlr;
1682 1678
@@ -1691,11 +1687,9 @@ static int cciss_eh_abort_handler(struct scsi_cmnd *scsicmd)
1691 cmd_to_abort = (CommandList_struct *) scsicmd->host_scribble; 1687 cmd_to_abort = (CommandList_struct *) scsicmd->host_scribble;
1692 if (cmd_to_abort == NULL) /* paranoia */ 1688 if (cmd_to_abort == NULL) /* paranoia */
1693 return FAILED; 1689 return FAILED;
1694 rc = sendcmd(CCISS_ABORT_MSG, ctlr, &cmd_to_abort->Header.Tag, 0, 0, 1690 memcpy(lunaddr, &cmd_to_abort->Header.LUN.LunAddrBytes[0], 8);
1695 (unsigned char *) &cmd_to_abort->Header.LUN.LunAddrBytes[0], 1691 rc = sendcmd_withirq(CCISS_ABORT_MSG, ctlr, &cmd_to_abort->Header.Tag,
1696 TYPE_MSG); 1692 0, 0, lunaddr, TYPE_MSG);
1697 /* sendcmd turned off interrupts on the board, turn 'em back on. */
1698 (*c)->access.set_intr_mask(*c, CCISS_INTR_ON);
1699 if (rc == 0) 1693 if (rc == 0)
1700 return SUCCESS; 1694 return SUCCESS;
1701 return FAILED; 1695 return FAILED;