diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-05-28 07:55:48 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-17 13:05:03 -0400 |
commit | 94d0e7b805961c44e4dc486ffc21075084bb7175 (patch) | |
tree | 1609752ea7a9adb28583147f0bea33a9f10877d7 /drivers/scsi | |
parent | 8fa728a26886f56a9ee10a44fea0ddda301d21c3 (diff) |
[SCSI] allow sleeping in ->eh_device_reset_handler()
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/aha152x.c | 2 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_osm.c | 8 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx_old.c | 14 | ||||
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 2 | ||||
-rw-r--r-- | drivers/scsi/ipr.c | 13 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 12 | ||||
-rw-r--r-- | drivers/scsi/megaraid.c | 14 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_mbox.c | 14 | ||||
-rw-r--r-- | drivers/scsi/qla1280.c | 8 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 8 | ||||
-rw-r--r-- | drivers/scsi/scsi_error.c | 7 | ||||
-rw-r--r-- | drivers/scsi/sym53c8xx_2/sym_glue.c | 8 |
12 files changed, 83 insertions, 27 deletions
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index 88d119f4b970..630b11575230 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c | |||
@@ -1225,8 +1225,6 @@ static int aha152x_device_reset(Scsi_Cmnd * SCpnt) | |||
1225 | } | 1225 | } |
1226 | 1226 | ||
1227 | DO_UNLOCK(flags); | 1227 | DO_UNLOCK(flags); |
1228 | |||
1229 | spin_lock_irq(shpnt->host_lock); | ||
1230 | return ret; | 1228 | return ret; |
1231 | } | 1229 | } |
1232 | 1230 | ||
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 7fc6c76e519b..31db0edc7cf9 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c | |||
@@ -1511,17 +1511,17 @@ ahd_linux_dev_reset(Scsi_Cmnd *cmd) | |||
1511 | ahd_name(ahd), cmd->device->channel, cmd->device->id, | 1511 | ahd_name(ahd), cmd->device->channel, cmd->device->id, |
1512 | cmd->device->lun, cmd); | 1512 | cmd->device->lun, cmd); |
1513 | #endif | 1513 | #endif |
1514 | ahd_midlayer_entrypoint_lock(ahd, &s); | 1514 | ahd_lock(ahd, &s); |
1515 | 1515 | ||
1516 | dev = ahd_linux_get_device(ahd, cmd->device->channel, cmd->device->id, | 1516 | dev = ahd_linux_get_device(ahd, cmd->device->channel, cmd->device->id, |
1517 | cmd->device->lun, /*alloc*/FALSE); | 1517 | cmd->device->lun, /*alloc*/FALSE); |
1518 | if (dev == NULL) { | 1518 | if (dev == NULL) { |
1519 | ahd_midlayer_entrypoint_unlock(ahd, &s); | 1519 | ahd_unlock(ahd, &s); |
1520 | kfree(recovery_cmd); | 1520 | kfree(recovery_cmd); |
1521 | return (FAILED); | 1521 | return (FAILED); |
1522 | } | 1522 | } |
1523 | if ((scb = ahd_get_scb(ahd, AHD_NEVER_COL_IDX)) == NULL) { | 1523 | if ((scb = ahd_get_scb(ahd, AHD_NEVER_COL_IDX)) == NULL) { |
1524 | ahd_midlayer_entrypoint_unlock(ahd, &s); | 1524 | ahd_unlock(ahd, &s); |
1525 | kfree(recovery_cmd); | 1525 | kfree(recovery_cmd); |
1526 | return (FAILED); | 1526 | return (FAILED); |
1527 | } | 1527 | } |
@@ -1570,7 +1570,7 @@ ahd_linux_dev_reset(Scsi_Cmnd *cmd) | |||
1570 | spin_lock_irq(&ahd->platform_data->spin_lock); | 1570 | spin_lock_irq(&ahd->platform_data->spin_lock); |
1571 | ahd_schedule_runq(ahd); | 1571 | ahd_schedule_runq(ahd); |
1572 | ahd_linux_run_complete_queue(ahd); | 1572 | ahd_linux_run_complete_queue(ahd); |
1573 | ahd_midlayer_entrypoint_unlock(ahd, &s); | 1573 | ahd_unlock(ahd, &s); |
1574 | printf("%s: Device reset returning 0x%x\n", ahd_name(ahd), retval); | 1574 | printf("%s: Device reset returning 0x%x\n", ahd_name(ahd), retval); |
1575 | return (retval); | 1575 | return (retval); |
1576 | } | 1576 | } |
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c index ee127e8aea55..1e83096bb911 100644 --- a/drivers/scsi/aic7xxx_old.c +++ b/drivers/scsi/aic7xxx_old.c | |||
@@ -10358,7 +10358,7 @@ aic7xxx_queue(Scsi_Cmnd *cmd, void (*fn)(Scsi_Cmnd *)) | |||
10358 | * Returns an enumerated type that indicates the status of the operation. | 10358 | * Returns an enumerated type that indicates the status of the operation. |
10359 | *-F*************************************************************************/ | 10359 | *-F*************************************************************************/ |
10360 | static int | 10360 | static int |
10361 | aic7xxx_bus_device_reset(Scsi_Cmnd *cmd) | 10361 | __aic7xxx_bus_device_reset(Scsi_Cmnd *cmd) |
10362 | { | 10362 | { |
10363 | struct aic7xxx_host *p; | 10363 | struct aic7xxx_host *p; |
10364 | struct aic7xxx_scb *scb; | 10364 | struct aic7xxx_scb *scb; |
@@ -10551,6 +10551,18 @@ aic7xxx_bus_device_reset(Scsi_Cmnd *cmd) | |||
10551 | return SUCCESS; | 10551 | return SUCCESS; |
10552 | } | 10552 | } |
10553 | 10553 | ||
10554 | static int | ||
10555 | aic7xxx_bus_device_reset(Scsi_Cmnd *cmd) | ||
10556 | { | ||
10557 | int rc; | ||
10558 | |||
10559 | spin_lock_irq(cmd->device->host->host_lock); | ||
10560 | rc = __aic7xxx_bus_device_reset(cmd); | ||
10561 | spin_unlock_irq(cmd->device->host->host_lock); | ||
10562 | |||
10563 | return rc; | ||
10564 | } | ||
10565 | |||
10554 | 10566 | ||
10555 | /*+F************************************************************************* | 10567 | /*+F************************************************************************* |
10556 | * Function: | 10568 | * Function: |
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index d857842bc45b..d89b8eb3cdf3 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -976,9 +976,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd) | |||
976 | return FAILED; | 976 | return FAILED; |
977 | } | 977 | } |
978 | 978 | ||
979 | spin_unlock_irq(hostdata->host->host_lock); | ||
980 | wait_for_completion(&evt->comp); | 979 | wait_for_completion(&evt->comp); |
981 | spin_lock_irq(hostdata->host->host_lock); | ||
982 | 980 | ||
983 | /* make sure we got a good response */ | 981 | /* make sure we got a good response */ |
984 | if (unlikely(srp_rsp.srp.generic.type != SRP_RSP_TYPE)) { | 982 | if (unlikely(srp_rsp.srp.generic.type != SRP_RSP_TYPE)) { |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index f9c01a13abef..fd8af643feac 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -2916,7 +2916,7 @@ static int ipr_eh_host_reset(struct scsi_cmnd * scsi_cmd) | |||
2916 | * Return value: | 2916 | * Return value: |
2917 | * SUCCESS / FAILED | 2917 | * SUCCESS / FAILED |
2918 | **/ | 2918 | **/ |
2919 | static int ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd) | 2919 | static int __ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd) |
2920 | { | 2920 | { |
2921 | struct ipr_cmnd *ipr_cmd; | 2921 | struct ipr_cmnd *ipr_cmd; |
2922 | struct ipr_ioa_cfg *ioa_cfg; | 2922 | struct ipr_ioa_cfg *ioa_cfg; |
@@ -2970,6 +2970,17 @@ static int ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd) | |||
2970 | return (IPR_IOASC_SENSE_KEY(ioasc) ? FAILED : SUCCESS); | 2970 | return (IPR_IOASC_SENSE_KEY(ioasc) ? FAILED : SUCCESS); |
2971 | } | 2971 | } |
2972 | 2972 | ||
2973 | static int ipr_eh_dev_reset(struct scsi_cmnd * cmd) | ||
2974 | { | ||
2975 | int rc; | ||
2976 | |||
2977 | spin_lock_irq(cmd->device->host->host_lock); | ||
2978 | rc = __ipr_eh_dev_reset(cmd); | ||
2979 | spin_unlock_irq(cmd->device->host->host_lock); | ||
2980 | |||
2981 | return rc; | ||
2982 | } | ||
2983 | |||
2973 | /** | 2984 | /** |
2974 | * ipr_bus_reset_done - Op done function for bus reset. | 2985 | * ipr_bus_reset_done - Op done function for bus reset. |
2975 | * @ipr_cmd: ipr command struct | 2986 | * @ipr_cmd: ipr command struct |
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index e9b84f9d8e81..13da26883da3 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -928,7 +928,7 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) | |||
928 | } | 928 | } |
929 | 929 | ||
930 | static int | 930 | static int |
931 | lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) | 931 | __lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) |
932 | { | 932 | { |
933 | struct Scsi_Host *shost = cmnd->device->host; | 933 | struct Scsi_Host *shost = cmnd->device->host; |
934 | struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; | 934 | struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; |
@@ -1040,6 +1040,16 @@ out: | |||
1040 | return ret; | 1040 | return ret; |
1041 | } | 1041 | } |
1042 | 1042 | ||
1043 | static int | ||
1044 | lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) | ||
1045 | { | ||
1046 | int rc; | ||
1047 | spin_lock_irq(cmnd->device->host->host_lock); | ||
1048 | rc = __lpfc_reset_lun_handler(cmnd); | ||
1049 | spin_unlock_irq(cmnd->device->host->host_lock); | ||
1050 | return rc; | ||
1051 | } | ||
1052 | |||
1043 | /* | 1053 | /* |
1044 | * Note: midlayer calls this function with the host_lock held | 1054 | * Note: midlayer calls this function with the host_lock held |
1045 | */ | 1055 | */ |
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 8d707b29027d..80b0c40c522b 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c | |||
@@ -1938,7 +1938,7 @@ megaraid_abort(Scsi_Cmnd *cmd) | |||
1938 | 1938 | ||
1939 | 1939 | ||
1940 | static int | 1940 | static int |
1941 | megaraid_reset(Scsi_Cmnd *cmd) | 1941 | __megaraid_reset(Scsi_Cmnd *cmd) |
1942 | { | 1942 | { |
1943 | adapter_t *adapter; | 1943 | adapter_t *adapter; |
1944 | megacmd_t mc; | 1944 | megacmd_t mc; |
@@ -1972,6 +1972,18 @@ megaraid_reset(Scsi_Cmnd *cmd) | |||
1972 | return rval; | 1972 | return rval; |
1973 | } | 1973 | } |
1974 | 1974 | ||
1975 | static int | ||
1976 | megaraid_reset(Scsi_Cmnd *cmd) | ||
1977 | { | ||
1978 | adapter = (adapter_t *)cmd->device->host->hostdata; | ||
1979 | int rc; | ||
1980 | |||
1981 | spin_lock_irq(&adapter->lock); | ||
1982 | rc = __megaraid_reset(cmd); | ||
1983 | spin_unlock_irq(&adapter->lock); | ||
1984 | |||
1985 | return rc; | ||
1986 | } | ||
1975 | 1987 | ||
1976 | 1988 | ||
1977 | /** | 1989 | /** |
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index bec4406011aa..057ed45b54b2 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c | |||
@@ -2726,7 +2726,7 @@ megaraid_abort_handler(struct scsi_cmnd *scp) | |||
2726 | * host | 2726 | * host |
2727 | **/ | 2727 | **/ |
2728 | static int | 2728 | static int |
2729 | megaraid_reset_handler(struct scsi_cmnd *scp) | 2729 | __megaraid_reset_handler(struct scsi_cmnd *scp) |
2730 | { | 2730 | { |
2731 | adapter_t *adapter; | 2731 | adapter_t *adapter; |
2732 | scb_t *scb; | 2732 | scb_t *scb; |
@@ -2847,6 +2847,18 @@ megaraid_reset_handler(struct scsi_cmnd *scp) | |||
2847 | return rval; | 2847 | return rval; |
2848 | } | 2848 | } |
2849 | 2849 | ||
2850 | static int | ||
2851 | megaraid_reset_handler(struct scsi_cmnd *cmd) | ||
2852 | { | ||
2853 | int rc; | ||
2854 | |||
2855 | spin_lock_irq(cmd->device->host->host_lock); | ||
2856 | rc = __megaraid_reset_handler(cmd); | ||
2857 | spin_unlock_irq(cmd->device->host->host_lock); | ||
2858 | |||
2859 | return rc; | ||
2860 | } | ||
2861 | |||
2850 | 2862 | ||
2851 | /* | 2863 | /* |
2852 | * START: internal commands library | 2864 | * START: internal commands library |
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index 638be81c4509..907a1e8cc880 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c | |||
@@ -1114,7 +1114,13 @@ qla1280_eh_abort(struct scsi_cmnd * cmd) | |||
1114 | static int | 1114 | static int |
1115 | qla1280_eh_device_reset(struct scsi_cmnd *cmd) | 1115 | qla1280_eh_device_reset(struct scsi_cmnd *cmd) |
1116 | { | 1116 | { |
1117 | return qla1280_error_action(cmd, DEVICE_RESET); | 1117 | int rc; |
1118 | |||
1119 | spin_lock_irq(cmd->device->host->host_lock); | ||
1120 | rc = qla1280_error_action(cmd, DEVICE_RESET); | ||
1121 | spin_unlock_irq(cmd->device->host->host_lock); | ||
1122 | |||
1123 | return rc; | ||
1118 | } | 1124 | } |
1119 | 1125 | ||
1120 | /************************************************************************** | 1126 | /************************************************************************** |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 1693998aa727..360974eb2b26 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -613,12 +613,8 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd) | |||
613 | qla_printk(KERN_INFO, ha, | 613 | qla_printk(KERN_INFO, ha, |
614 | "scsi(%ld:%d:%d): DEVICE RESET ISSUED.\n", ha->host_no, id, lun); | 614 | "scsi(%ld:%d:%d): DEVICE RESET ISSUED.\n", ha->host_no, id, lun); |
615 | 615 | ||
616 | spin_unlock_irq(ha->host->host_lock); | 616 | if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) |
617 | |||
618 | if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) { | ||
619 | spin_lock_irq(ha->host->host_lock); | ||
620 | goto eh_dev_reset_done; | 617 | goto eh_dev_reset_done; |
621 | } | ||
622 | 618 | ||
623 | if (qla2x00_wait_for_loop_ready(ha) == QLA_SUCCESS) { | 619 | if (qla2x00_wait_for_loop_ready(ha) == QLA_SUCCESS) { |
624 | if (qla2x00_device_reset(ha, fcport) == 0) | 620 | if (qla2x00_device_reset(ha, fcport) == 0) |
@@ -669,8 +665,6 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd) | |||
669 | "scsi(%ld:%d:%d): DEVICE RESET SUCCEEDED.\n", ha->host_no, id, lun); | 665 | "scsi(%ld:%d:%d): DEVICE RESET SUCCEEDED.\n", ha->host_no, id, lun); |
670 | 666 | ||
671 | eh_dev_reset_done: | 667 | eh_dev_reset_done: |
672 | spin_lock_irq(ha->host->host_lock); | ||
673 | |||
674 | return ret; | 668 | return ret; |
675 | } | 669 | } |
676 | 670 | ||
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 3877a78f5e50..87d925055b47 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -857,17 +857,14 @@ static int scsi_eh_abort_cmds(struct list_head *work_q, | |||
857 | **/ | 857 | **/ |
858 | static int scsi_try_bus_device_reset(struct scsi_cmnd *scmd) | 858 | static int scsi_try_bus_device_reset(struct scsi_cmnd *scmd) |
859 | { | 859 | { |
860 | unsigned long flags; | 860 | int rtn; |
861 | int rtn = FAILED; | ||
862 | 861 | ||
863 | if (!scmd->device->host->hostt->eh_device_reset_handler) | 862 | if (!scmd->device->host->hostt->eh_device_reset_handler) |
864 | return rtn; | 863 | return FAILED; |
865 | 864 | ||
866 | scmd->owner = SCSI_OWNER_LOWLEVEL; | 865 | scmd->owner = SCSI_OWNER_LOWLEVEL; |
867 | 866 | ||
868 | spin_lock_irqsave(scmd->device->host->host_lock, flags); | ||
869 | rtn = scmd->device->host->hostt->eh_device_reset_handler(scmd); | 867 | rtn = scmd->device->host->hostt->eh_device_reset_handler(scmd); |
870 | spin_unlock_irqrestore(scmd->device->host->host_lock, flags); | ||
871 | 868 | ||
872 | if (rtn == SUCCESS) { | 869 | if (rtn == SUCCESS) { |
873 | scmd->device->was_reset = 1; | 870 | scmd->device->was_reset = 1; |
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c index e2d055ed5b6f..5ea62552d47d 100644 --- a/drivers/scsi/sym53c8xx_2/sym_glue.c +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c | |||
@@ -867,7 +867,13 @@ static int sym53c8xx_eh_abort_handler(struct scsi_cmnd *cmd) | |||
867 | 867 | ||
868 | static int sym53c8xx_eh_device_reset_handler(struct scsi_cmnd *cmd) | 868 | static int sym53c8xx_eh_device_reset_handler(struct scsi_cmnd *cmd) |
869 | { | 869 | { |
870 | return sym_eh_handler(SYM_EH_DEVICE_RESET, "DEVICE RESET", cmd); | 870 | int rc; |
871 | |||
872 | spin_lock_irq(cmd->device->host->host_lock); | ||
873 | rc = sym_eh_handler(SYM_EH_DEVICE_RESET, "DEVICE RESET", cmd); | ||
874 | spin_unlock_irq(cmd->device->host->host_lock); | ||
875 | |||
876 | return rc; | ||
871 | } | 877 | } |
872 | 878 | ||
873 | static int sym53c8xx_eh_bus_reset_handler(struct scsi_cmnd *cmd) | 879 | static int sym53c8xx_eh_bus_reset_handler(struct scsi_cmnd *cmd) |