lkml.org 
[lkml]   [2001]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[BUG] HDIO_DRIVE_RESET ioctl is buggy
linux-2.4.8-ac2 , hdc is an ACER 1208A CD-RW

it is the same for several latest linux versions :

[root@localhost scsireset]# ./idereset /dev/hdc
hdc: DMA disabled
idereset : ioctl succesful
hdc: ide_set_handler: handler not null; old=c0184340, new=e0887354
bug: kernel timer added twice at c0184251.

source if idereset.c :

/*************************
* idereset - reset an ide device
*
* Usage : idereset /dev/hdX
*
*
* Copyright 2001 David Balazic
*/

#define IDERESET_VERSION "v0.1"


#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/hdreg.h>

void print_usage(FILE * out_file)
{
fprintf(out_file,"idereset " IDERESET_VERSION "\nArgument error.Usage :\n");
fprintf(out_file,"idereset /dev/hdX\n");
}

int main (int argc,char ** argv)
{
int device_fd; /* file descriptor for the device file */

if ( argc !=2 )
{
print_usage(stderr);
return 1;
}
/* open device */
device_fd=open(argv[1], O_RDONLY | O_NONBLOCK);
if ( device_fd == -1 )
{
perror(argv[1]);
return 1;
}
/* ioctl */
if(ioctl( device_fd, HDIO_DRIVE_RESET , NULL))
perror(argv[1]);
else
printf("idereset : ioctl succesful\n");

close(device_fd);

return 0;
}
--
David Balazic
--------------
"Be excellent to each other." - Bill & Ted
- - - - - - - - - - - - - - - - - - - - - -
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:57    [W:0.029 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site