aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid
diff options
context:
space:
mode:
authorRajashekhara, Mahesh <Mahesh_Rajashekhara@adaptec.com>2010-05-10 07:29:25 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-05-16 22:58:27 -0400
commit9cccde93fed1ca988eb2fb17ab9194bf7b5ed1b0 (patch)
treeec928f9197c24c147ac6ac51ba981c9ca027ca77 /drivers/scsi/aacraid
parentda3cc679b247a22efe0746d129074015b278e64d (diff)
[SCSI] aacraid: add an ifdef'd device delete case instead of taking the device offline
Problem description: -------------------- The problem reported by one of the customer was when a logical array is deleted(from the SDK, from the GUI, from arcconf) then the corresponding physical device (/dev/sdb, for example) is not removed from the Linux namespace. So you end up with a "dead" device entry. And some of the linux tools go slightly wonky. Solution: --------- Based on the notification from FW, the driver calls "scsi_remove_device" for the DELETED drive. This call not only informs the scsi device status to the SCSI mid layer and also it will remove corresponding scsi device entries from the Linux sysfs. Signed-off-by: Mahesh Rajashekhara <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/aacraid')
-rw-r--r--drivers/scsi/aacraid/aacraid.h4
-rw-r--r--drivers/scsi/aacraid/commsup.c8
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 9f985267c30f..4dbcc055ac78 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -12,7 +12,7 @@
12 *----------------------------------------------------------------------------*/ 12 *----------------------------------------------------------------------------*/
13 13
14#ifndef AAC_DRIVER_BUILD 14#ifndef AAC_DRIVER_BUILD
15# define AAC_DRIVER_BUILD 26000 15# define AAC_DRIVER_BUILD 26400
16# define AAC_DRIVER_BRANCH "-ms" 16# define AAC_DRIVER_BRANCH "-ms"
17#endif 17#endif
18#define MAXIMUM_NUM_CONTAINERS 32 18#define MAXIMUM_NUM_CONTAINERS 32
@@ -26,6 +26,8 @@
26#define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff) 26#define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff)
27#define AAC_MAX_32BIT_SGBCOUNT ((unsigned short)256) 27#define AAC_MAX_32BIT_SGBCOUNT ((unsigned short)256)
28 28
29#define AAC_DEBUG_INSTRUMENT_AIF_DELETE
30
29/* 31/*
30 * These macros convert from physical channels to virtual channels 32 * These macros convert from physical channels to virtual channels
31 */ 33 */
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 69692b050e3c..70079146e203 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -1133,6 +1133,9 @@ retry_next:
1133 if (device) { 1133 if (device) {
1134 switch (device_config_needed) { 1134 switch (device_config_needed) {
1135 case DELETE: 1135 case DELETE:
1136#if (defined(AAC_DEBUG_INSTRUMENT_AIF_DELETE))
1137 scsi_remove_device(device);
1138#else
1136 if (scsi_device_online(device)) { 1139 if (scsi_device_online(device)) {
1137 scsi_device_set_state(device, SDEV_OFFLINE); 1140 scsi_device_set_state(device, SDEV_OFFLINE);
1138 sdev_printk(KERN_INFO, device, 1141 sdev_printk(KERN_INFO, device,
@@ -1141,6 +1144,7 @@ retry_next:
1141 "array deleted" : 1144 "array deleted" :
1142 "enclosure services event"); 1145 "enclosure services event");
1143 } 1146 }
1147#endif
1144 break; 1148 break;
1145 case ADD: 1149 case ADD:
1146 if (!scsi_device_online(device)) { 1150 if (!scsi_device_online(device)) {
@@ -1155,12 +1159,16 @@ retry_next:
1155 case CHANGE: 1159 case CHANGE:
1156 if ((channel == CONTAINER_CHANNEL) 1160 if ((channel == CONTAINER_CHANNEL)
1157 && (!dev->fsa_dev[container].valid)) { 1161 && (!dev->fsa_dev[container].valid)) {
1162#if (defined(AAC_DEBUG_INSTRUMENT_AIF_DELETE))
1163 scsi_remove_device(device);
1164#else
1158 if (!scsi_device_online(device)) 1165 if (!scsi_device_online(device))
1159 break; 1166 break;
1160 scsi_device_set_state(device, SDEV_OFFLINE); 1167 scsi_device_set_state(device, SDEV_OFFLINE);
1161 sdev_printk(KERN_INFO, device, 1168 sdev_printk(KERN_INFO, device,
1162 "Device offlined - %s\n", 1169 "Device offlined - %s\n",
1163 "array failed"); 1170 "array failed");
1171#endif
1164 break; 1172 break;
1165 } 1173 }
1166 scsi_rescan_device(&device->sdev_gendev); 1174 scsi_rescan_device(&device->sdev_gendev);