From: David Balazic <david.balazic@uni-mb.si>
To: david.balazic@uni-mb.si,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
andre@linux-ide.org, axboe@suse.de
Subject: Re: [BUG] HDIO_DRIVE_RESET ioctl is buggy
Date: Thu, 23 Aug 2001 12:17:05 +0200 [thread overview]
Message-ID: <3B84D821.C2D157D1@uni-mb.si> (raw)
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
- - - - - - - - - - - - - - - - - - - - - -
next reply other threads:[~2001-08-23 10:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-23 10:17 David Balazic [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-08-16 7:46 [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=3B84D821.C2D157D1@uni-mb.si \
--to=david.balazic@uni-mb.si \
--cc=andre@linux-ide.org \
--cc=axboe@suse.de \
--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