public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ross Biro <rossb@google.com>
To: linux-kernel@vger.kernel.org, alan@lxorguk.ukuu.org.uk,
	andre@linux-ide.org
Subject: [BUG] 2.4.21-pre3 hdparm -X violates IDE locking
Date: Wed, 15 Jan 2003 10:49:38 -0800	[thread overview]
Message-ID: <3E25AD42.3090409@google.com> (raw)


This bug impacts all versions of the kernel that I have looked at 
including 2.4.18 and above.  It probably impacts many other versions as 
well.

hdparm -X issues a drive command ioctl which eventually issue a command 
to the drive bypassing all of the normal locking.  The net effect is 
that a command can be set to the drive when the drive is not ready. 
 Some drives lock up when this happens.

The call chain is

ide_ioctl calls
ide_cmd_ioctl

If the command is a set features to change the communications speed, 
after the command is complete, ide_cmd_ioctl calls

ide_set_xfer_rate

ide_set_xfer_rate then calls drive->speedproc.

Most speedprocs then call ide_config_drive_speed
ide_config_drive_speed issue a set features command. and busy waits on it.

The easiest fix is to probably modify execute_drive_command to update 
drive->current_speed when it issues the appropriate SET FEATURES 
command, and then have ide_config_drive_speed do nothing if speed == 
current_speed.

I did a much bigger modification that handles changing drive speed 
specially and immediately.  I'll make patches for either one, but I 
wanted to get some opinions before I did so.

    Ross



                 reply	other threads:[~2003-01-15 18:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3E25AD42.3090409@google.com \
    --to=rossb@google.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andre@linux-ide.org \
    --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