From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: vatsa@in.ibm.com
Cc: lkcd-devel@lists.sourceforge.net,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-ide@vger.kernel.org
Subject: Re: [PATCH] Poll-based IDE driver
Date: Wed, 08 Oct 2003 22:47:22 +0100 [thread overview]
Message-ID: <1065649641.10565.21.camel@dhcp23.swansea.linux.org.uk> (raw)
In-Reply-To: <20031008151357.A31976@in.ibm.com>
On Mer, 2003-10-08 at 10:43, Srivatsa Vaddagiri wrote:
> 1. Taking control of the drive
> It is possible that the kernel IDE driver was very _actively_
> using the dump drive when my driver takes over. For ex, there
> may be active DMA requests pending with the drive when
> my driver takes control ..
In 2.4 we issue one command at a time in 2.6 we may have several TCQ
commands queued. You may need to test if the drive is busy, wait and if
neccessary reset and recover it. If possible avoid the reset because
that means the drive will need some reconfiguration (see specs)
> Currently all my drive does to take control of the drive
> is to disable drive interrupts (set nIEN bit). It then
> starts issuing PIO WRITE commands to write data to disk.
Make sure you disable interrupts before using nIEN. Not all older
devices honour nIEN so you can get suprises
> Do I need to do anything else in order to take
> control of the drive?
>
> Do I need to explicitly program the drive for PIO transfer
> mode before I start issuing it PIO write commands?
The PIO mode on the controller and drive should have been set correctly
by the base IDE driver at boot time.
> 2. Power Management
> Tackling Sleep state may involve a drive reset followed by
> reinitializing drive parameters which will make my driver
> more complex (as I may have to take care of reset sequence of
> various chipsets separately). For now, I would like my driver
> not supporting the sleep state.
Makes sense. Many drives seem to come out of sleep state themselves
anyway.
> 3. Shutdown sequence
> You mentioned that I need to follow proper shutdown sequence
> when I am done writing to the drive. Apart from
> flushing (if the drive supports it) is there anything
> more to the shutdown sequence?
Flush the cache, and place the drive in a suitable standby/sleep state -
follow the code in ide-disk.c for the way we do it in the main code.
> 4. Relinquishing control of the drive
> Currently all I am doing to give control back to
> the kernel IDE driver is to re-enable the drive
> interrupts (clear nIEN).
>
> Is there anything more I need to be taking care of?
Hard question. I think that providing you mark the drive busy, wait
for the IDE layer to complete any pending commands and restore the state
afterwards it ought to be possible. Would need a lot of thought and more
time than I have right now to think about it since getting it wrong
might lose requests and generate very hard to pin down errors.
next prev parent reply other threads:[~2003-10-08 21:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-17 9:11 [PATCH] Poll-based IDE dump driver for LKCD Srivatsa Vaddagiri
2003-09-17 13:55 ` Alan Cox
2003-10-08 9:43 ` [PATCH] Poll-based IDE driver Srivatsa Vaddagiri
2003-10-08 11:50 ` Dave Jones
2003-10-08 12:14 ` Srivatsa Vaddagiri
2003-10-08 12:15 ` Dave Jones
2003-10-08 13:26 ` Russell King
2003-10-08 18:34 ` [lkcd-devel] " Stephen Hemminger
2003-10-08 21:48 ` Alan Cox
2003-10-08 23:43 ` Jamie Lokier
2003-10-08 16:36 ` Andre Hedrick
2003-10-08 16:48 ` Dave Jones
2003-10-09 6:57 ` Andre Hedrick
2003-10-08 21:47 ` Alan Cox [this message]
2003-10-09 7:06 ` Andre Hedrick
2003-10-13 17:41 ` PRD Table id ol
2003-10-15 20:46 ` Alan Cox
2003-10-16 11:47 ` Andre Hedrick
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=1065649641.10565.21.camel@dhcp23.swansea.linux.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkcd-devel@lists.sourceforge.net \
--cc=vatsa@in.ibm.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
all inboxes | Powered by JetHome®