diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2009-12-16 08:32:29 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-01-18 11:48:11 -0500 |
commit | 64e155adc250ab68255b761c1faa77799aa1e41a (patch) | |
tree | 772fc7ffc844dc34e01f6e05831523733510a53c /drivers/message/fusion/mptsas.c | |
parent | e0f553ab58f478321717100e44b28f765bd2a045 (diff) |
[SCSI] mptfusion: block device when target is being removed by FW
Add support to set the sdev state to SDEV_BLOCK during device removal
to stop IOs comming to the deleting driver immediately.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r-- | drivers/message/fusion/mptsas.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 1b7f550daebc..c20bbe45da82 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -1075,6 +1075,19 @@ mptsas_target_reset(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
1075 | return 0; | 1075 | return 0; |
1076 | } | 1076 | } |
1077 | 1077 | ||
1078 | static void | ||
1079 | mptsas_block_io_sdev(struct scsi_device *sdev, void *data) | ||
1080 | { | ||
1081 | scsi_device_set_state(sdev, SDEV_BLOCK); | ||
1082 | } | ||
1083 | |||
1084 | static void | ||
1085 | mptsas_block_io_starget(struct scsi_target *starget) | ||
1086 | { | ||
1087 | if (starget) | ||
1088 | starget_for_each_device(starget, NULL, mptsas_block_io_sdev); | ||
1089 | } | ||
1090 | |||
1078 | /** | 1091 | /** |
1079 | * mptsas_target_reset_queue | 1092 | * mptsas_target_reset_queue |
1080 | * | 1093 | * |
@@ -1098,10 +1111,11 @@ mptsas_target_reset_queue(MPT_ADAPTER *ioc, | |||
1098 | id = sas_event_data->TargetID; | 1111 | id = sas_event_data->TargetID; |
1099 | channel = sas_event_data->Bus; | 1112 | channel = sas_event_data->Bus; |
1100 | 1113 | ||
1101 | if (!(vtarget = mptsas_find_vtarget(ioc, channel, id))) | 1114 | vtarget = mptsas_find_vtarget(ioc, channel, id); |
1102 | return; | 1115 | if (vtarget) { |
1103 | 1116 | mptsas_block_io_starget(vtarget->starget); | |
1104 | vtarget->deleted = 1; /* block IO */ | 1117 | vtarget->deleted = 1; /* block IO */ |
1118 | } | ||
1105 | 1119 | ||
1106 | target_reset_list = kzalloc(sizeof(struct mptsas_target_reset_event), | 1120 | target_reset_list = kzalloc(sizeof(struct mptsas_target_reset_event), |
1107 | GFP_ATOMIC); | 1121 | GFP_ATOMIC); |
@@ -1868,7 +1882,8 @@ mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
1868 | if (ioc->sas_discovery_quiesce_io) | 1882 | if (ioc->sas_discovery_quiesce_io) |
1869 | return SCSI_MLQUEUE_HOST_BUSY; | 1883 | return SCSI_MLQUEUE_HOST_BUSY; |
1870 | 1884 | ||
1871 | // scsi_print_command(SCpnt); | 1885 | if (ioc->debug_level & MPT_DEBUG_SCSI) |
1886 | scsi_print_command(SCpnt); | ||
1872 | 1887 | ||
1873 | return mptscsih_qcmd(SCpnt,done); | 1888 | return mptscsih_qcmd(SCpnt,done); |
1874 | } | 1889 | } |