diff options
author | scameron@beardog.cca.cpqcorp.net <scameron@beardog.cca.cpqcorp.net> | 2009-06-08 17:07:45 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-06-08 23:47:43 -0400 |
commit | 85cc61ae41084cb6d8ecc6c9e01ac4563005c8ac (patch) | |
tree | 46cdea00cdac692292f5997fdce2c8b4cac983f9 /drivers/block/cciss_scsi.c | |
parent | 789a424ad1352b335960e7c56494d0410577fa61 (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/cciss_scsi.c')
-rw-r--r-- | drivers/block/cciss_scsi.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index 007ab8aea85b..d2eb48977410 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 | ||
52 | static int sendcmd_core(ctlr_info_t *h, CommandList_struct *c); | ||
53 | |||
54 | static CommandList_struct *cmd_alloc(ctlr_info_t *h, int get_from_pool); | 52 | static CommandList_struct *cmd_alloc(ctlr_info_t *h, int get_from_pool); |
55 | static void cmd_free(ctlr_info_t *h, CommandList_struct *c, int got_from_pool); | 53 | static 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; |