linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [BUG] HDIO_DRIVE_RESET ioctl is buggy
@ 2001-08-23 10:17 David Balazic
  0 siblings, 0 replies; 2+ messages in thread
From: David Balazic @ 2001-08-23 10:17 UTC (permalink / raw)
  To: david.balazic, linux-kernel, andre, axboe


The HDIO_DRIVE_RESET ioctl implementation in ide.c is broken :

linux-2.4.8-ac8 , hdd is a Teac CD532E-B CDROM drive

( it is the same for several latest linux versions )

[root@localhost scsireset]# ./idereset /dev/hdd # source of iderest below , it just sends the ioctl
hdd: DMA disabled
idereset : ioctl succesful # this is from my idereset program , the rest are kernel messages
hdd: ide_set_handler: handler not null; old=c017e9a0, new=e08ce2f0
bug: kernel timer added twice at c017e8e8.


relevant System.map parts :

c017e800 T ide_end_request
c017e890 T ide_set_handler
c017e8f0 T current_capacity
c017e920 T ide_geninit
c017e9a0 t atapi_reset_pollfunc
c017ea70 t reset_pollfunc
c017ebd0 t check_dma_crc

part of  `ksymoops -s all.map` :

e08ce240 t cdrom_start_read     [ide-cd]
e08ce2f0 t cdrom_pc_intr        [ide-cd]
e08ce4b0 t cdrom_do_pc_continuation     [ide-cd]

source if idereset.c :

/*************************
 * idereset - reset an ide device
 * 
 * Usage : idereset /dev/hdX
 * 
 */

#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
- - - - - - - - - - - - - - - - - - - - - -

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [BUG] HDIO_DRIVE_RESET ioctl is buggy
@ 2001-08-16  7:46 David Balazic
  0 siblings, 0 replies; 2+ messages in thread
From: David Balazic @ 2001-08-16  7:46 UTC (permalink / raw)
  To: linux-kernel

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
- - - - - - - - - - - - - - - - - - - - - -

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-08-23 10:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-23 10:17 [BUG] HDIO_DRIVE_RESET ioctl is buggy David Balazic
  -- strict thread matches above, loose matches on Subject: below --
2001-08-16  7:46 David Balazic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).