public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Balazic <david.balazic@uni-mb.si>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [BUG] HDIO_DRIVE_RESET ioctl is buggy
Date: Thu, 16 Aug 2001 09:46:38 +0200	[thread overview]
Message-ID: <3B7B7A5E.2C1EAF1A@uni-mb.si> (raw)

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

             reply	other threads:[~2001-08-16  7:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-16  7:46 David Balazic [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-08-23 10:17 [BUG] HDIO_DRIVE_RESET ioctl is buggy David Balazic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3B7B7A5E.2C1EAF1A@uni-mb.si \
    --to=david.balazic@uni-mb.si \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox