Hello community,
here is the log from the commit of package hdparm
checked in at Sun Apr 29 22:10:57 CEST 2007.
--------
--- hdparm/hdparm.changes 2007-04-29 11:52:14.000000000 +0200
+++ /mounts/work_users/ro/STABLE/hdparm/hdparm.changes 2007-04-29 21:57:40.837384000 +0200
@@ -1,0 +2,9 @@
+Sun Apr 29 21:57:26 CEST 2007 - ro(a)suse.de
+
+- update to 7.2
+ - tweak -C
+ - added more debug info from --verbose
+ - added --drq-hsm-error to test libata EH (VERY DANGEROUS, do not use)
+ - fixed breakage when used with old IDE driver
+
+-------------------------------------------------------------------
Old:
----
hdparm-7.1.tar.bz2
New:
----
hdparm-7.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ hdparm.spec ++++++
--- /var/tmp/diff_new_pack.U21550/_old 2007-04-29 22:10:16.000000000 +0200
+++ /var/tmp/diff_new_pack.U21550/_new 2007-04-29 22:10:16.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package hdparm (Version 7.1)
+# spec file for package hdparm (Version 7.2)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -16,7 +16,7 @@
PreReq: %insserv_prereq %fillup_prereq coreutils
Provides: base:/sbin/hdparm
Autoreqprov: on
-Version: 7.1
+Version: 7.2
Release: 1
Summary: A Program to Get and Set Hard Disk Parameters
Source: hdparm-%{version}.tar.bz2
@@ -103,6 +103,12 @@
%changelog
* Sun Apr 29 2007 - ro(a)suse.de
+- update to 7.2
+ - tweak -C
+ - added more debug info from --verbose
+ - added --drq-hsm-error to test libata EH (VERY DANGEROUS, do not use)
+ - fixed breakage when used with old IDE driver
+* Sun Apr 29 2007 - ro(a)suse.de
- update to 7.1
- big-endian fixes for -I, --Istdin, --Istdout
- cody tidying in sgio.c
++++++ hdparm-6.3-err_return.patch ++++++
--- /var/tmp/diff_new_pack.U21550/_old 2007-04-29 22:10:16.000000000 +0200
+++ /var/tmp/diff_new_pack.U21550/_new 2007-04-29 22:10:16.000000000 +0200
@@ -63,7 +63,7 @@
}
static void on_off (unsigned int value)
-@@ -780,7 +786,7 @@
+@@ -784,7 +790,7 @@
void process_dev (char *devname)
{
@@ -72,7 +72,7 @@
static long parm, multcount;
__u16 *id = (void *)-1;
-@@ -796,14 +802,18 @@
+@@ -800,14 +806,18 @@
if (set_fsreadahead) {
if (get_fsreadahead)
printf(" setting fs readahead to %d\n", fsreadahead);
@@ -93,7 +93,7 @@
}
if (scan_hwif) {
int args[3];
-@@ -811,8 +821,10 @@
+@@ -815,8 +825,10 @@
args[0] = hwif_data;
args[1] = hwif_ctrl;
args[2] = hwif_irq;
@@ -105,7 +105,7 @@
}
if (set_piomode) {
if (get_piomode) {
-@@ -825,68 +837,86 @@
+@@ -829,68 +841,86 @@
else
printf(" attempting to set UDMA mode to %d\n", (piomode-200));
}
@@ -201,7 +201,7 @@
}
if (set_doorlock) {
__u8 args[4] = {0,0,0,0};
-@@ -895,8 +925,10 @@
+@@ -899,8 +929,10 @@
printf(" setting drive doorlock to %d", doorlock);
on_off(doorlock);
}
@@ -213,7 +213,7 @@
}
if (set_dkeep) {
/* lock/unlock the drive's "feature" settings */
-@@ -906,24 +938,30 @@
+@@ -910,24 +942,30 @@
on_off(dkeep);
}
args[2] = dkeep ? 0x66 : 0xcc;
@@ -247,7 +247,7 @@
}
if (set_xfermode) {
__u8 args[4] = {ATA_OP_SETFEATURES,0,3,0};
-@@ -932,8 +970,10 @@
+@@ -936,8 +974,10 @@
printf(" setting xfermode to %d", xfermode_requested);
interpret_xfermode(xfermode_requested);
}
@@ -259,7 +259,7 @@
}
if (set_lookahead) {
__u8 args[4] = {ATA_OP_SETFEATURES,0,0,0};
-@@ -942,8 +982,10 @@
+@@ -946,8 +986,10 @@
printf(" setting drive read-lookahead to %d", lookahead);
on_off(lookahead);
}
@@ -271,7 +271,7 @@
}
if (set_powerup_in_standby) {
__u8 args[4] = {ATA_OP_SETFEATURES,0,0,0};
-@@ -978,14 +1020,18 @@
+@@ -982,14 +1024,18 @@
if (get_apmmode)
printf(" 0x%02x (%d)\n",apmmode,apmmode);
}
@@ -292,7 +292,7 @@
}
if (set_acoustic) {
__u8 args[4];
-@@ -995,8 +1041,10 @@
+@@ -999,8 +1045,10 @@
args[1] = acoustic;
args[2] = acoustic ? 0x42 : 0xc2;
args[3] = 0;
@@ -304,7 +304,7 @@
}
if (set_wcache) {
__u8 flushcache1[4] = {ATA_OP_FLUSHCACHE,0,0,0};
-@@ -1009,11 +1057,16 @@
+@@ -1013,11 +1061,16 @@
}
if (!wcache && do_drive_cmd(fd, flushcache1))
perror (" HDIO_DRIVE_CMD(flushcache1) failed");
@@ -324,7 +324,7 @@
}
if (set_standbynow) {
__u8 args1[4] = {ATA_OP_STANDBYNOW1,0,0,0};
-@@ -1021,8 +1074,10 @@
+@@ -1025,8 +1078,10 @@
if (get_standbynow)
printf(" issuing standby command\n");
if (do_drive_cmd(fd, args1)
@@ -336,7 +336,7 @@
}
if (set_sleepnow) {
__u8 args1[4] = {ATA_OP_SLEEPNOW1,0,0,0};
-@@ -1030,8 +1085,10 @@
+@@ -1034,8 +1089,10 @@
if (get_sleepnow)
printf(" issuing sleep command\n");
if (do_drive_cmd(fd, args1)
@@ -348,7 +348,7 @@
}
if (set_security) {
do_set_security(fd);
-@@ -1039,15 +1096,19 @@
+@@ -1043,15 +1100,19 @@
if (set_freeze) {
__u8 args[4] = {ATA_OP_SECURITY_FREEZE_LOCK,0,0,0};
printf(" issuing Security Freeze command\n");
@@ -370,7 +370,7 @@
}
if (set_standby) {
__u8 args[4] = {ATA_OP_SETIDLE1,standby,0,0};
-@@ -1055,14 +1116,18 @@
+@@ -1059,14 +1120,18 @@
printf(" setting standby to %u", standby);
interpret_standby();
}
@@ -389,9 +389,9 @@
perror(" HDIO_SET_BUSSTATE failed");
+ }
}
- if (get_hitachi_temp) {
- __u8 args[4] = {0xf0,0,0x01,0}; /* "Sense Condition", vendor-specific */
-@@ -1104,12 +1169,18 @@
+ if (do_drq_hsm_error) {
+ id = get_identify_data(fd, id);
+@@ -1122,12 +1187,18 @@
break;
default:printf("\?\?\?)\n");
}
@@ -410,7 +410,7 @@
}
}
-@@ -1120,6 +1191,9 @@
+@@ -1138,6 +1209,9 @@
printf(" (DMA-Assisted-PIO)\n");
else
on_off(parm);
@@ -420,7 +420,7 @@
}
}
if (get_dma_q) {
-@@ -1134,28 +1208,34 @@
+@@ -1152,28 +1226,34 @@
if (0 == ioctl(fd, HDIO_GET_KEEPSETTINGS, &parm)) {
printf(" keepsettings = %2ld", parm);
on_off(parm);
@@ -461,7 +461,7 @@
printf(" readahead = %2ld", parm);
on_off(parm);
}
-@@ -1170,12 +1250,13 @@
+@@ -1188,12 +1268,13 @@
static struct hd_geometry g;
static struct local_hd_big_geometry bg;
@@ -478,15 +478,20 @@
printf(msg, g.cylinders, g.heads, g.sectors, blksize, g.start);
}
}
-@@ -1185,6 +1266,7 @@
+@@ -1202,9 +1283,10 @@
+ const char *state;
if (do_drive_cmd(fd, args)
&& (args[0] = ATA_OP_CHECKPOWERMODE2) /* (single =) try again with 0x98 */
- && do_drive_cmd(fd, args)) {
+- && do_drive_cmd(fd, args))
++ && do_drive_cmd(fd, args)) {
+ err = errno;
- if (errno != EIO || args[0] != 0 || args[1] != 0)
- state = "unknown";
- else
-@@ -1205,8 +1287,10 @@
+ state = "unknown";
+- else
++ } else
+ state = (args[2] == 255) ? "active/idle" : "standby";
+ printf(" drive state is: %s\n", state);
+ }
+@@ -1219,8 +1301,10 @@
dump_identity(id2);
} else if (errno == -ENOMSG)
printf(" no identification info available\n");
@@ -498,7 +503,7 @@
}
if (do_IDentity) {
id = get_identify_data(fd, id);
-@@ -1259,39 +1343,46 @@
+@@ -1273,39 +1357,46 @@
}
}
if (get_busstate) {
++++++ hdparm-7.1.tar.bz2 -> hdparm-7.2.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hdparm-7.1/Changelog new/hdparm-7.2/Changelog
--- old/hdparm-7.1/Changelog 2007-04-28 23:28:11.000000000 +0200
+++ new/hdparm-7.2/Changelog 2007-04-29 20:36:22.000000000 +0200
@@ -1,3 +1,8 @@
+hdparm-7.2
+ - tweak -C
+ - added more debug info from --verbose
+ - added --drq-hsm-error to test libata EH (VERY DANGEROUS, do not use)
+ - fixed breakage when used with old IDE driver
hdparm-7.1
- big-endian fixes for -I, --Istdin, --Istdout
- cody tidying in sgio.c
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hdparm-7.1/hdparm.c new/hdparm-7.2/hdparm.c
--- old/hdparm-7.1/hdparm.c 2007-04-28 23:28:30.000000000 +0200
+++ new/hdparm-7.2/hdparm.c 2007-04-29 20:11:38.000000000 +0200
@@ -86,7 +86,7 @@
static int get_powermode = 0, set_powermode = 0;
static int set_apmmode = 0, get_apmmode= 0, apmmode = 0;
static int get_cdromspeed = 0, set_cdromspeed = 0, cdromspeed = 0;
-static int do_IDentity = 0;
+static int do_IDentity = 0, do_drq_hsm_error = 0;
static int get_unregister = 0, set_unregister = 0, unregister = 0;
static int hwif = 0;
static int scan_hwif = 0;
@@ -751,6 +751,8 @@
exit(err);
}
+static __u8 last_identify_op = 0;
+
static void *get_identify_data (int fd, void *prev)
{
static __u8 args[4+512];
@@ -760,10 +762,12 @@
if (prev != (void *)-1)
return prev;
memset(args, 0, sizeof(args));
- args[0] = ATA_OP_IDENTIFY;
+ last_identify_op = ATA_OP_IDENTIFY;
+ args[0] = last_identify_op;
args[3] = 1;
if (do_drive_cmd(fd, args)) {
- args[0] = ATA_OP_PIDENTIFY;
+ last_identify_op = ATA_OP_PIDENTIFY;
+ args[0] = last_identify_op;
args[1] = 0;
args[2] = 0;
args[3] = 1;
@@ -1064,6 +1068,20 @@
if (ioctl(fd, HDIO_SET_BUSSTATE, busstate))
perror(" HDIO_SET_BUSSTATE failed");
}
+ if (do_drq_hsm_error) {
+ id = get_identify_data(fd, id);
+ if (id) {
+ __u8 args[4] = {0,0,0,0};
+ args[0] = last_identify_op;
+ sync();
+ printf(" triggering \"stuck DRQ\" host state machine error\n");
+ sync();
+ sleep(1);
+ do_drive_cmd(fd, args);
+ perror("do_drq_hsm_error");
+ fprintf(stderr, "ata status=0x%02x ata error=0x%02x\n", args[0], args[1]);
+ }
+ }
if (get_hitachi_temp) {
__u8 args[4] = {0xf0,0,0x01,0}; /* "Sense Condition", vendor-specific */
if (do_drive_cmd(fd, args))
@@ -1184,14 +1202,10 @@
const char *state;
if (do_drive_cmd(fd, args)
&& (args[0] = ATA_OP_CHECKPOWERMODE2) /* (single =) try again with 0x98 */
- && do_drive_cmd(fd, args)) {
- if (errno != EIO || args[0] != 0 || args[1] != 0)
- state = "unknown";
- else
- state = "sleeping";
- } else {
+ && do_drive_cmd(fd, args))
+ state = "unknown";
+ else
state = (args[2] == 255) ? "active/idle" : "standby";
- }
printf(" drive state is: %s\n", state);
}
if (do_identity) {
@@ -1349,6 +1363,7 @@
" --Istdout write identify data to stdout as ASCII hex\n"
" --verbose display extra diagnostics from some commands\n"
" --security-help display help for ATA security commands\n"
+ " --drq_hsm_error crash system with a \"stuck DRQ\" error (VERY DANGEROUS)\n"
"\n");
exit(rc);
}
@@ -1580,6 +1595,8 @@
--num_flags_processed; /* doesn't count as an action flag */
} else if (0 == strcasecmp(name, "direct")) {
open_flags |= O_DIRECT;
+ } else if (0 == strcasecmp(name, "drq-hsm-error")) {
+ do_drq_hsm_error = 1;
} else if (0 == strcasecmp(name, "Istdout")) {
do_IDentity = 2;
} else if (0 == strcasecmp(name, "security-mode")) {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hdparm-7.1/hdparm.lsm new/hdparm-7.2/hdparm.lsm
--- old/hdparm-7.1/hdparm.lsm 2007-04-28 23:30:26.000000000 +0200
+++ new/hdparm-7.2/hdparm.lsm 2007-04-29 20:36:35.000000000 +0200
@@ -1,8 +1,9 @@
Begin4
Title: hdparm
-Version: 7.1
-Entered-date: 2007-04-28
+Version: 7.2
+Entered-date: 2007-04-29
Description: hdparm - get/set hard disk parameters for Linux IDE drives.
+ v7.2 fixed breakage when used with old IDE driver
v7.1 big-endian fixes for -I, --Istdin, --Istdout
v7.0 major overhaul, proper SATA support, new features and tweaks
v6.9 --Istdin fix, new -s flag, new SCT reporting, fixed -T x2 error..
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hdparm-7.1/kernel_patches/README new/hdparm-7.2/kernel_patches/README
--- old/hdparm-7.1/kernel_patches/README 2007-04-28 22:28:52.000000000 +0200
+++ new/hdparm-7.2/kernel_patches/README 2007-04-29 20:37:14.000000000 +0200
@@ -18,7 +18,7 @@
(eg. using "hdparm -s1"). Without this patch, such drives become
expensive paperweights, at least until booted under a kernel
that has had the patch applied. This patch is needed for all
-kernels prior to 2.6.22.
+kernels prior to 2.6.22, but not with 2.6.22 or later.
03_libata_standby_spinup.patch
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hdparm-7.1/sgio.c new/hdparm-7.2/sgio.c
--- old/hdparm-7.1/sgio.c 2007-04-28 23:29:24.000000000 +0200
+++ new/hdparm-7.2/sgio.c 2007-04-29 20:33:08.000000000 +0200
@@ -29,9 +29,9 @@
#define SG_ATA_PROTO_NON_DATA ( 3 << 1)
#define SG_ATA_PROTO_PIO_IN ( 4 << 1)
#define SG_ATA_PROTO_PIO_OUT ( 5 << 1)
-#define SG_ATA_PROTO_DMA ( 6 << 1)
-#define SG_ATA_PROTO_UDMA_IN (11 << 1) /* not yet supported in libata */
-#define SG_ATA_PROTO_UDMA_OUT (12 << 1) /* not yet supported in libata */
+#define SG_ATA_PROTO_DMA ( 6 << 1)
+#define SG_ATA_PROTO_UDMA_IN (11 << 1) /* not yet supported in libata */
+#define SG_ATA_PROTO_UDMA_OUT (12 << 1) /* not yet supported in libata */
#define ATA_USING_LBA (1 << 6)
@@ -64,17 +64,18 @@
memset(tf, 0, sizeof(*tf));
tf->command = ata_op;
+ tf->dev = ATA_USING_LBA;
if (lba) {
tf->lob.lbal = lba;
tf->lob.lbam = lba >> 8;
tf->lob.lbah = lba >> 16;
if ((lba & ~lba28_mask) == 0) {
- tf->dev = ((lba >> 24) & 0x0f) | ATA_USING_LBA;
+ tf->dev |= (lba >> 24) & 0x0f;
} else {
- tf->dev = ATA_USING_LBA;
tf->hob.lbal = lba >> 24;
tf->hob.lbam = lba >> 32;
tf->hob.lbah = lba >> 36;
+ tf->is_lba48 = 1;
}
}
if (nsect) {
@@ -148,20 +149,20 @@
io_hdr.pack_id = tf_to_lba(tf);
io_hdr.timeout = (timeout_secs ? timeout_secs : 5) * 1000; /* msecs */
- if (ioctl(fd, SG_IO, &io_hdr) < 0) {
+ if (ioctl(fd, SG_IO, &io_hdr) == -1) {
if (verbose)
perror("ioctl(fd,SG_IO)");
return -1; /* SG_IO not supported */
}
-
+ if (verbose) {
+ fprintf(stderr, "SG_IO: ATA_16 status=0x%x, host_status=0x%x, driver_status=0x%x\n",
+ io_hdr.status, io_hdr.host_status, io_hdr.driver_status);
+ }
if (io_hdr.host_status || io_hdr.driver_status != SG_DRIVER_SENSE
|| (io_hdr.status && io_hdr.status != SG_CHECK_CONDITION))
{
- if (verbose) {
- fprintf(stderr, "SG_IO: ATA_16 status=0x%x, host_status=0x%x, driver_status=0x%x\n",
- io_hdr.status, io_hdr.host_status, io_hdr.driver_status);
- }
- return EIO;
+ errno = EIO;
+ return -1;
}
if (sb[0] != 0x72 || sb[7] < 14)
@@ -184,6 +185,8 @@
tf->hob.lbam = desc[ 8];
tf->hob.lbah = desc[10];
}
+ if (verbose)
+ fprintf(stderr, " ATA_16 tf->status=0x%02x tf->error=0x%02x\n", tf->status, tf->error);
return 0;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org