From: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] IDE cleanups for 2.6.4-rc1 (2/3)
Date: Wed, 3 Mar 2004 05:38:10 +0100 [thread overview]
Message-ID: <200403030538.10029.bzolnier@elka.pw.edu.pl> (raw)
In-Reply-To: <404513E8.9010101@pobox.com>
On Wednesday 03 of March 2004 00:08, Jeff Garzik wrote:
> Bartlomiej Zolnierkiewicz wrote:
> > [IDE] remove ide_cmd_type_parser() logic
> >
> > Set ide_task_t fields (command_type, handler and prehandler) directly.
> > Remove unused ide_task_t->posthandler and all ide_cmd_type_parser()
> > logic.
> >
> > ide_cmd_type_parser() was meant to be used for ioctls but
> > ended up checking validity of kernel generated requests (doh!).
> >
> > Rationale for removal:
> > - it can't be used for existing ioctls (changes the way they work)
> > - kernel shouldn't check validity of (root only) user-space requests
> > (it can and should be done in user-space)
> > - it wastes CPU cycles on going through parsers
> > - it makes code harder to understand/follow
> > (now info about request is localized)
>
> Without the annoyingly-large 'switch', how do you figure out whether a
> command is non-data, pio-read, pio-write, dma-read, or dma-write?
Using ide_task_t->{command_type, handler}, command_type values:
IDE_DRIVE_TASK_IN - read
IDE_DRIVE_TASK_RAW_WRITE - write
IDE_DRIVE_TASK_NO_DATA - no data
If handler is NULL we know that command is a DMA one.
HDIO_DRIVE_TASKFILE gets information about taskfile from user-space in
ide_task_request_t->{command_type, data_phase}, data_phase can be:
TASKFILE_OUT_DMA{Q}
TASKFILE_IN_DMA{Q}
TASKFILE_MULTI_OUT
TASKFILE_OUT
TASKFILE_MULTI_IN
TASKFILE_IN
TASKFILE_NO_DATA
and this information is translated into ide_task_t->handler.
This is of course non-optimal and driver should be using something like
ata_taskfile->protocol (as in libata).
Please note that any attempts to verify commands (like this 'switch')
will fail for future or vendor specific ones.
Bartlomiej
next prev parent reply other threads:[~2004-03-03 4:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-02 21:15 Bartlomiej Zolnierkiewicz
2004-03-02 23:08 ` Jeff Garzik
2004-03-03 4:38 ` Bartlomiej Zolnierkiewicz [this message]
2004-03-03 4:41 ` Jeff Garzik
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=200403030538.10029.bzolnier@elka.pw.edu.pl \
--to=b.zolnierkiewicz@elka.pw.edu.pl \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.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
all inboxes | Powered by JetHome®