Skip to content

Commit 957c2ec

Browse files
Stephen M. CameronJens Axboe
authored andcommitted
cciss: export resettable host attribute
This attribute, requested by Redhat, allows kexec-tools to know whether the controller can honor the reset_devices kernel parameter and actually reset the controller. For kdump to work properly it is necessary that the reset_devices parameter be honored. This attribute enables kexec-tools to warn the user if they attempt to designate a non-resettable controller as the dump device. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
1 parent 0356781 commit 957c2ec

2 files changed

Lines changed: 51 additions & 0 deletions

File tree

‎Documentation/ABI/testing/sysfs-bus-pci-devices-cciss‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,15 @@ Kernel Version: 2.6.31
5959
Contact: iss_storagedev@hp.com
6060
Description: Displays the usage count (number of opens) of logical drive Y
6161
of controller X.
62+
63+
Where: /sys/bus/pci/devices/<dev>/ccissX/resettable
64+
Date: February 2011
65+
Kernel Version: 2.6.38
66+
Contact: iss_storagedev@hp.com
67+
Description: Value of 1 indicates the controller can honor the reset_devices
68+
kernel parameter. Value of 0 indicates reset_devices cannot be
69+
honored. This is to allow, for example, kexec tools to be able
70+
to warn the user if they designate an unresettable device as
71+
a dump device, as kdump requires resetting the device in order
72+
to work reliably.
73+

‎drivers/block/cciss.c‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,44 @@ static void __devinit cciss_procinit(ctlr_info_t *h)
556556
#define to_hba(n) container_of(n, struct ctlr_info, dev)
557557
#define to_drv(n) container_of(n, drive_info_struct, dev)
558558

559+
/* List of controllers which cannot be reset on kexec with reset_devices */
560+
static u32 unresettable_controller[] = {
561+
0x324a103C, /* Smart Array P712m */
562+
0x324b103C, /* SmartArray P711m */
563+
0x3223103C, /* Smart Array P800 */
564+
0x3234103C, /* Smart Array P400 */
565+
0x3235103C, /* Smart Array P400i */
566+
0x3211103C, /* Smart Array E200i */
567+
0x3212103C, /* Smart Array E200 */
568+
0x3213103C, /* Smart Array E200i */
569+
0x3214103C, /* Smart Array E200i */
570+
0x3215103C, /* Smart Array E200i */
571+
0x3237103C, /* Smart Array E500 */
572+
0x323D103C, /* Smart Array P700m */
573+
0x409C0E11, /* Smart Array 6400 */
574+
0x409D0E11, /* Smart Array 6400 EM */
575+
};
576+
577+
static int ctlr_is_resettable(struct ctlr_info *h)
578+
{
579+
int i;
580+
581+
for (i = 0; i < ARRAY_SIZE(unresettable_controller); i++)
582+
if (unresettable_controller[i] == h->board_id)
583+
return 0;
584+
return 1;
585+
}
586+
587+
static ssize_t host_show_resettable(struct device *dev,
588+
struct device_attribute *attr,
589+
char *buf)
590+
{
591+
struct ctlr_info *h = to_hba(dev);
592+
593+
return snprintf(buf, 20, "%d\n", ctlr_is_resettable(h));
594+
}
595+
static DEVICE_ATTR(resettable, S_IRUGO, host_show_resettable, NULL);
596+
559597
static ssize_t host_store_rescan(struct device *dev,
560598
struct device_attribute *attr,
561599
const char *buf, size_t count)
@@ -741,6 +779,7 @@ static DEVICE_ATTR(usage_count, S_IRUGO, cciss_show_usage_count, NULL);
741779

742780
static struct attribute *cciss_host_attrs[] = {
743781
&dev_attr_rescan.attr,
782+
&dev_attr_resettable.attr,
744783
NULL
745784
};
746785

0 commit comments

Comments
 (0)