Showing results for 
Search instead for 
Did you mean: 

patch for hdparm -> cciss support


patch for hdparm -> cciss support

I have created a patch for hdparm so that it can support the cciss driver.

I wanted to submit it to you for review and pointers. I would like to learn about the testing process that you go through, maybe I can make my change better. I have already submitted this to Mark Lord Who is the project owner for hdparm at
Please let me know what you think and if you have any suggestions.

Compaq Smart Array exposes disk like this


For all intents and purposes I believe we can treat this as a scsi disk. As such I have altered hdparm to support it. Here are my notes.

If you need more (for example if you have some sort of test suite I could use to test the change) please let me know.

[nocadmin@hispeed-ovo hdparm-5.3-cciss-patched]$ df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p1 991928 387880 552848 42% /
/dev/cciss/c0d0p6 25515428 4512800 19685608 19% /home
none 127712 0 127712 0% /dev/shm
/dev/cciss/c0d0p2 4959856 3132004 1571832 67% /usr
/dev/cciss/c0d0p3 1983920 104360 1777152 6% /var
[nocadmin@server1 hdparm-5.3-cciss-patched]$ find /proc -name \*cciss\* 2>/dev/null
[nocadmin@server1 hdparm-5.3-cciss-patched]$ more /proc/driver/cciss/cciss0
cciss0: Compaq Smart Array 5i Controller
Board ID: 0x40800e11
Firmware Version: 1.80
Memory Address: 0xd0839000
IRQ: 11
Logical drives: 1
Current Q depth: 0
Current # commands on controller 0
Max Q depth since init: 128
Max # commands on controller since init: 130
Max SG entries since init: 31
Sequential access devices: 0

cciss/c0d0: blkszQ2 nr_blocksq122560
nr_allocs 9024370
nr_frees 9024370
[nocadmin@server1 hdparm-5.3-cciss-patched]$ uname -a
Linux server1 2.4.18-3smp #1 SMP Thu Apr 18 07:27:31 EDT 2002 i686 unknown
[nocadmin@server1 hdparm-5.3-cciss-patched]$ more /etc/issue
Red Hat Linux release 7.3 (Valhalla)
Kernel \r on an \m

[nocadmin@server1 hdparm-5.3-cciss-patched]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
[nocadmin@server1 hdparm-5.3-cciss-patched]$

[root@server1 hdparm-5.3-cciss-patched]# ./hdparm /dev/cciss/c0d0p1

readonly 0 (off)
geometry 716/255/32, sectors 048128, start 2
[root@server1 hdparm]# diff hdparm-5.3-cciss-patched/hdparm.c hdparm-5.3/hdparm.c
< #ifndef CCISS_MAJOR
< #define CCISS_MAJOR 104
< #endif
< #ifdef CCISS_MAJOR
< case (CCISS_MAJOR):
< #endif
[root@server1 hdparm]# diff -ruN hdparm-5.3 hdparm-5.3-cciss-patched > hdparm-5.3.diff
[root@server1 hdparm]# more hdparm-5.3.diff
diff -ruN hdparm-5.3/hdparm.c hdparm-5.3-cciss-patched/hdparm.c
--- hdparm-5.3/hdparm.c Sun Nov 24 17:52:19 2002
+++ hdparm-5.3-cciss-patched/hdparm.c Wed Feb 26 11:21:34 2003
@@ -698,6 +698,10 @@
#define VXVM_MAJOR 199

+#ifndef CCISS_MAJOR
+#define CCISS_MAJOR 104
void process_dev (char *devname)
int fd;
@@ -729,6 +733,9 @@
case (VXVM_MAJOR):
+ case (CCISS_MAJOR):
is_scsi_hd ;
[root@server1 hdparm]#

fall down seven time stand up eight
Eric Becker
Occasional Visitor

Re: patch for hdparm -> cciss support

I'm a bit confused as to where you entered the previous code and how you patched hdparm. I'm desperately trying to get hdparm to work with my cciss controller. Any help that you can give would be appreciated.