diff options
| -rw-r--r-- | Documentation/scsi/hpsa.txt | 12 | ||||
| -rw-r--r-- | drivers/scsi/hpsa.c | 41 |
2 files changed, 53 insertions, 0 deletions
diff --git a/Documentation/scsi/hpsa.txt b/Documentation/scsi/hpsa.txt index 880c085b951b..891435a72fce 100644 --- a/Documentation/scsi/hpsa.txt +++ b/Documentation/scsi/hpsa.txt | |||
| @@ -45,6 +45,7 @@ HPSA specific entries in /sys | |||
| 45 | 45 | ||
| 46 | /sys/class/scsi_host/host*/rescan | 46 | /sys/class/scsi_host/host*/rescan |
| 47 | /sys/class/scsi_host/host*/firmware_revision | 47 | /sys/class/scsi_host/host*/firmware_revision |
| 48 | /sys/class/scsi_host/host*/resettable | ||
| 48 | /sys/class/scsi_host/host*/transport_mode | 49 | /sys/class/scsi_host/host*/transport_mode |
| 49 | 50 | ||
| 50 | the host "rescan" attribute is a write only attribute. Writing to this | 51 | the host "rescan" attribute is a write only attribute. Writing to this |
| @@ -66,6 +67,17 @@ HPSA specific entries in /sys | |||
| 66 | or "simple" mode. This is controlled by the "hpsa_simple_mode" module | 67 | or "simple" mode. This is controlled by the "hpsa_simple_mode" module |
| 67 | parameter. | 68 | parameter. |
| 68 | 69 | ||
| 70 | The "resettable" read-only attribute indicates whether a particular | ||
| 71 | controller is able to honor the "reset_devices" kernel parameter. If the | ||
| 72 | device is resettable, this file will contain a "1", otherwise, a "0". This | ||
| 73 | parameter is used by kdump, for example, to reset the controller at driver | ||
| 74 | load time to eliminate any outstanding commands on the controller and get the | ||
| 75 | controller into a known state so that the kdump initiated i/o will work right | ||
| 76 | and not be disrupted in any way by stale commands or other stale state | ||
| 77 | remaining on the controller from the previous kernel. This attribute enables | ||
| 78 | kexec tools to warn the user if they attempt to designate a device which is | ||
| 79 | unable to honor the reset_devices kernel parameter as a dump device. | ||
| 80 | |||
| 69 | HPSA specific disk attributes: | 81 | HPSA specific disk attributes: |
| 70 | ------------------------------ | 82 | ------------------------------ |
| 71 | 83 | ||
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index dcabef4bb149..415ad4fb50d4 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
| @@ -273,6 +273,44 @@ static ssize_t host_show_transport_mode(struct device *dev, | |||
| 273 | "performant" : "simple"); | 273 | "performant" : "simple"); |
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | /* List of controllers which cannot be reset on kexec with reset_devices */ | ||
| 277 | static u32 unresettable_controller[] = { | ||
| 278 | 0x324a103C, /* Smart Array P712m */ | ||
| 279 | 0x324b103C, /* SmartArray P711m */ | ||
| 280 | 0x3223103C, /* Smart Array P800 */ | ||
| 281 | 0x3234103C, /* Smart Array P400 */ | ||
| 282 | 0x3235103C, /* Smart Array P400i */ | ||
| 283 | 0x3211103C, /* Smart Array E200i */ | ||
| 284 | 0x3212103C, /* Smart Array E200 */ | ||
| 285 | 0x3213103C, /* Smart Array E200i */ | ||
| 286 | 0x3214103C, /* Smart Array E200i */ | ||
| 287 | 0x3215103C, /* Smart Array E200i */ | ||
| 288 | 0x3237103C, /* Smart Array E500 */ | ||
| 289 | 0x323D103C, /* Smart Array P700m */ | ||
| 290 | 0x409C0E11, /* Smart Array 6400 */ | ||
| 291 | 0x409D0E11, /* Smart Array 6400 EM */ | ||
| 292 | }; | ||
| 293 | |||
| 294 | static int ctlr_is_resettable(struct ctlr_info *h) | ||
| 295 | { | ||
| 296 | int i; | ||
| 297 | |||
| 298 | for (i = 0; i < ARRAY_SIZE(unresettable_controller); i++) | ||
| 299 | if (unresettable_controller[i] == h->board_id) | ||
| 300 | return 0; | ||
| 301 | return 1; | ||
| 302 | } | ||
| 303 | |||
| 304 | static ssize_t host_show_resettable(struct device *dev, | ||
| 305 | struct device_attribute *attr, char *buf) | ||
| 306 | { | ||
| 307 | struct ctlr_info *h; | ||
| 308 | struct Scsi_Host *shost = class_to_shost(dev); | ||
| 309 | |||
| 310 | h = shost_to_hba(shost); | ||
| 311 | return snprintf(buf, 20, "%d\n", ctlr_is_resettable(h)); | ||
| 312 | } | ||
| 313 | |||
| 276 | static inline int is_logical_dev_addr_mode(unsigned char scsi3addr[]) | 314 | static inline int is_logical_dev_addr_mode(unsigned char scsi3addr[]) |
| 277 | { | 315 | { |
| 278 | return (scsi3addr[3] & 0xC0) == 0x40; | 316 | return (scsi3addr[3] & 0xC0) == 0x40; |
| @@ -379,6 +417,8 @@ static DEVICE_ATTR(commands_outstanding, S_IRUGO, | |||
| 379 | host_show_commands_outstanding, NULL); | 417 | host_show_commands_outstanding, NULL); |
| 380 | static DEVICE_ATTR(transport_mode, S_IRUGO, | 418 | static DEVICE_ATTR(transport_mode, S_IRUGO, |
| 381 | host_show_transport_mode, NULL); | 419 | host_show_transport_mode, NULL); |
| 420 | static DEVICE_ATTR(resettable, S_IRUGO, | ||
| 421 | host_show_resettable, NULL); | ||
| 382 | 422 | ||
| 383 | static struct device_attribute *hpsa_sdev_attrs[] = { | 423 | static struct device_attribute *hpsa_sdev_attrs[] = { |
| 384 | &dev_attr_raid_level, | 424 | &dev_attr_raid_level, |
| @@ -392,6 +432,7 @@ static struct device_attribute *hpsa_shost_attrs[] = { | |||
| 392 | &dev_attr_firmware_revision, | 432 | &dev_attr_firmware_revision, |
| 393 | &dev_attr_commands_outstanding, | 433 | &dev_attr_commands_outstanding, |
| 394 | &dev_attr_transport_mode, | 434 | &dev_attr_transport_mode, |
| 435 | &dev_attr_resettable, | ||
| 395 | NULL, | 436 | NULL, |
| 396 | }; | 437 | }; |
| 397 | 438 | ||
