linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Dow" <jdow@earthlink.net>
To: "Jeff Garzik" <jgarzik@mandrakesoft.com>,
	"Linus Torvalds" <torvalds@transmeta.com>
Cc: "Bill Davidsen" <davidsen@tmr.com>,
	"LKML" <linux-kernel@vger.kernel.org>
Subject: Re: [patch] My AMD IDE driver, v2.7
Date: Mon, 11 Mar 2002 18:50:34 -0800	[thread overview]
Message-ID: <01a401c1c970$aeb74110$1125a8c0@wednesday> (raw)
In-Reply-To: <Pine.LNX.4.33.0203111741310.8121-100000@home.transmeta.com> <3C8D667F.5040208@mandrakesoft.com>

From: "Jeff Garzik" <jgarzik@mandrakesoft.com>

> Linus Torvalds wrote:
> 
> >
> >On Mon, 11 Mar 2002, Jeff Garzik wrote:

...

> First, for verification of the driver, it's darned useful to be able to 
> issue ATA commands from userspace.  But since we're being generic, let's 
> just call them device commands, and imagine SCSI perhaps playing in this 
> playground too.

No fooling! (By way of history I was one of the SCSI device driver mavens
for the Amiga. We covered this generic command ground, recovered this ground,
and generally ground this ground into the ground.)

> Second, if you are issuing device commands from userspace, you need to 
> deal with synchronization with the commands being issued from kernel space.

Generally speaking, yes.

> Third, if you have synchronization, that's a good and easy point to add 
> -optional- filtering.

And while I see your point I still ask, "But why?" To make this work the
way it should work you will need a special table of normally disallowed
commands that are allowed for each specific device on the IDE buses
within a machine. You also need this to be generic enough to allow some
commands to go through except for some specific sets of parameters. Now,
I realize that SCSI is more generic than IDE. However, contemplating this
sort of filtering within SCSI device drivers fell into such a point of
silliness that it became the general concensus within the community that
the filtering is inappropriate. In point of fact this proved useful when
technology marched on. The facility within SCSI device drivers for directly
issueing low level commands became instantly important with the advent of
drives that were larger than 2^24 bytes. The normal read/write interface
on the device drivers was byte offset and byte count oriented, even though
it required the byte offsets to be on block boundaries. The direct SCSI
command interface allowed for workaround patches that broke the disk into
several virtual disks. These patches would open the low level driver and
insert themselves as the "real" device driver for the set of devices on
each SCSI bus. This died away fairly quickly as filesystem adaptations
became more popular. These adaptations, in the case finally adopted within
the latest OS revisions, involved an institutionalized driver patch that
presented a proper 64 bit read/write interface to the filesystems. The
fact that the device drivers that are no longer under any sort of
development are patched using direct SCSI commands is neatly hidden
from the users. But it is there and allowed the OS to survive where there
was no further maintenance effort taking place.

I note there seem to be more than one device driver for Linux that is no
longer maintained or poorly maintained. While I doubt this will be the
case for generic IDE, I do suspect that specific IDE interfaces that have
"peculiarities" will fall by the wayside as fewer people use them. It
might be nice to have the ability to patch around these drivers rather
than try to patch then with no test cases handy. It saved a significant
amount of grief on the Amiga. There's no reason I can see that it would
not save grief on Linux.

> Now... the overall point I am trying to sell is...  IFF certain 
> lesser-used device commands are primarily issued from userspace, and IFF 
> it is not reasonable to create a new kernel interface, is it not 
> reasonable to be able to issue raw device commands from userspace?  Just 
> the verification case alone seems like a strong argument.
> 
> Call it device_command not ata_command if you want, and add SCSI 
> support.  Passing in raw device_commands from userspace is useful, IMO. 
>  Throw in filtering of those commands, and life is golden for everybody 
> AFAICS.  There is no need to be ATA specific with these goals...

It might be a good exercise, Jeff, to define the filters in such a way
that potentially harmful commands can be adequately filters while other
potentially "saving" commands can be allowed even if they differ only in
parameters. It is also interesting to note that direct userland ATA and
ATAPI reads and writes are fully as dangerous as any exotic level commands.
Linux seems to allow this danger. What makes the other commands so dangerous?
I'm not as familiar with the Linux SCSI interfaces as with those of the
Amiga. (I've sort of moved on to video work.) However, I wonder if the Linux
SCSI world filters "mode select" and manufacturer defined commands or not.
I suspect they have a longer history with this sort of interface and its
abuse than IDE. It might pay to investigate and adopt consonant postures.

{^_^}   Joanne Dow, jdow@earthlink.net, did Amiga SCSI device drivers for
        a decade or so as a consultant.


  parent reply	other threads:[~2002-03-12  2:51 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-11 15:13 [patch] My AMD IDE driver, v2.7 Vojtech Pavlik
2002-03-11 16:36 ` Martin Dalecki
2002-03-11 20:49   ` Rik van Riel
2002-03-11 22:45     ` Alan Cox
2002-03-11 22:39       ` Linus Torvalds
2002-03-11 22:45         ` Vojtech Pavlik
2002-03-11 22:53           ` Linus Torvalds
2002-03-12  0:14             ` Bill Davidsen
2002-03-12  0:34               ` Jeff Garzik
2002-03-12  0:58                 ` Erik Andersen
2002-03-12  1:33                   ` Jeff Garzik
2002-03-12  1:41                     ` Linus Torvalds
2002-03-12  1:50                       ` Jeff Garzik
2002-03-11 18:50                         ` gmack
2002-03-12  2:19                         ` Linus Torvalds
2002-03-12  2:34                           ` Jeff Garzik
2002-03-12 11:21                             ` Martin Dalecki
2002-03-12  2:54                           ` J. Dow
2002-03-12  6:32                           ` Vojtech Pavlik
2002-03-14 15:12                             ` Pavel Machek
2002-03-13 18:42                         ` Horst von Brand
2002-03-13 19:11                           ` Andre Hedrick
2002-03-12  6:25                     ` Vojtech Pavlik
2002-03-12  7:13                   ` Erik Andersen
2002-03-12 16:40                 ` Bill Davidsen
2002-03-12  0:51               ` Linus Torvalds
2002-03-12  1:41                 ` Jeff Garzik
2002-03-12  1:44                   ` Linus Torvalds
2002-03-12  2:22                     ` Jeff Garzik
2002-03-12  2:33                       ` Linus Torvalds
2002-03-12  2:37                         ` Jeff Garzik
2002-03-12  3:34                           ` Olivier Galibert
2002-03-12  4:13                             ` Jeff Garzik
2002-03-14 14:13                               ` Pavel Machek
2002-03-15 11:05                                 ` Jeff Garzik
2002-03-18 19:20                                   ` Pavel Machek
2002-03-19  9:29                                     ` Vojtech Pavlik
2002-03-19 21:21                                       ` Pavel Machek
2002-03-19 21:56                                         ` Vojtech Pavlik
2002-03-20  8:00                                           ` Daniela Engert
2002-03-20 18:11                                             ` Bill Davidsen
2002-03-20 18:46                                               ` Daniela Engert
2002-03-20 22:15                                             ` Pavel Machek
2002-03-20 23:09                                               ` Daniel Kobras
2002-03-19 22:33                                         ` Andre Hedrick
2002-03-20  0:25                                         ` Alan Cox
2002-03-15 14:45                                 ` Alan Cox
2002-03-12 11:23                           ` Martin Dalecki
2002-03-12  2:50                       ` J. Dow [this message]
2002-03-12  3:10                         ` Jeff Garzik
2002-03-12  3:28                           ` Linus Torvalds
2002-03-12  3:46                             ` Jeff Garzik
2002-03-12  6:10                               ` J. Dow
2002-03-12  3:58                             ` Linus Torvalds
2002-03-12  4:26                               ` Jeff Garzik
2002-03-12  4:40                                 ` Linus Torvalds
2002-03-12  6:26                                 ` J. Dow
2002-03-12 11:44                                   ` Martin Dalecki
2002-03-12  4:31                               ` Linus Torvalds
2002-03-12  5:05                                 ` Jeff Garzik
2002-03-12  5:20                                   ` Linus Torvalds
2002-03-12 11:39                                 ` Martin Dalecki
2002-03-12  4:49                               ` Erik Andersen
2002-03-12  5:08                                 ` Linus Torvalds
2002-03-12 11:36                               ` Martin Dalecki
2002-03-12  6:05                             ` J. Dow
2002-03-12  4:41                           ` Erik Andersen
2002-03-12  4:48                             ` Jeff Garzik
2002-03-12  6:30                               ` J. Dow
2002-03-12  6:29                             ` J. Dow
2002-03-12 16:36                             ` Bill Davidsen
2002-03-12  2:57                   ` Alan Cox
2002-03-12  2:49                     ` Jeff Garzik
2002-03-12 11:17                       ` Alan Cox
2002-03-13  8:14                       ` ide filters / 'ide dump' / 'bio dump' bert hubert
2002-03-13 10:11                         ` Jeff Garzik
2002-03-13 12:05                           ` Malcolm Beattie
2002-03-13 17:17                           ` Linus Torvalds
2002-03-12 11:10                   ` [patch] My AMD IDE driver, v2.7 Martin Dalecki
2002-03-12  0:33                     ` benh
2002-03-12 20:21                   ` Gunther Mayer
2002-03-12 16:33                 ` Bill Davidsen
2002-03-12 11:00           ` Martin Dalecki
2002-03-12 15:59             ` Vojtech Pavlik
2002-03-12 16:11               ` Martin Dalecki
2002-03-12 16:21                 ` Vojtech Pavlik
2002-03-12 16:26                   ` Martin Dalecki
2002-03-12 16:33                     ` Vojtech Pavlik
2002-03-12 16:41                       ` Martin Dalecki
2002-03-13  0:01                         ` Russell King
2002-03-12 16:43                       ` Martin Dalecki
2002-03-12 16:50                         ` Vojtech Pavlik
2002-03-12 16:58                           ` Martin Dalecki
2002-03-14 14:02                           ` Pavel Machek
2002-03-15 11:13                             ` Vojtech Pavlik
2002-03-18 19:21                               ` Pavel Machek
2002-03-13 19:43                   ` Bill Davidsen
2002-03-12 16:44                 ` Sebastian Droege
2002-03-12 16:17               ` Martin Dalecki
2002-03-12 16:27                 ` Vojtech Pavlik
2002-03-12 16:32                   ` Martin Dalecki
2002-03-12 20:00             ` [patch] PIIX driver rewrite Vojtech Pavlik
2002-03-12 20:35             ` Sebastian Droege
2002-03-12 20:34               ` Vojtech Pavlik
2002-03-12 21:07               ` Sebastian Droege
2002-03-12 21:19                 ` Vojtech Pavlik
2002-03-11 23:01         ` [patch] My AMD IDE driver, v2.7 Alan Cox

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='01a401c1c970$aeb74110$1125a8c0@wednesday' \
    --to=jdow@earthlink.net \
    --cc=davidsen@tmr.com \
    --cc=jgarzik@mandrakesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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;
as well as URLs for NNTP newsgroup(s).