From: Albert Lee <albertcc@tw.ibm.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Linux IDE <linux-ide@vger.kernel.org>,
Doug Maxey <dwm@maxeymade.com>,
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
Tejun Heo <htejun@gmail.com>
Subject: Re: [PATCH 0/2] libata: ata_pio_task() accessing 'ap->pio_task_state' fix
Date: Thu, 08 Sep 2005 14:25:47 +0800 [thread overview]
Message-ID: <431FD96B.3050801@tw.ibm.com> (raw)
In-Reply-To: <431F891C.6050000@pobox.com>
Jeff Garzik wrote:
> Albert Lee wrote:
>
>> Only one minor addition for your review:
>>
>> * ata_pio_block() changed to go to PIO_ST_LAST state, instead of
>> going to PIO_ST_IDLE state directly and calling
>> ata_poll_qc_complete().
>>
>> i.e.
>> @@ -2845,9 +2852,7 @@
>> if (is_atapi_taskfile(&qc->tf)) {
>> /* no more data to transfer or unsupported ATAPI command */
>> if ((status & ATA_DRQ) == 0) {
>> - ap->pio_task_state = PIO_ST_IDLE;
>> -
>> - ata_poll_qc_complete(qc, status);
>> + ap->pio_task_state = PIO_ST_LAST;
>> return;
>> }
>
>
> hmmmm. I think that should be PIO_ST_ERR not PIO_ST_LAST. Comments?
>
Just tested it. Changing to PIO_ST_ERR will break REQUEST_SENSE and
MODE_SENSE. :(
For REQUEST_SENSE and MODE_SENSE, the data returned from the device might be
less than the buffer provided and those two commands relies on DRQ == 0
to mark the end of
the data transfer.
e.g. a sample REQUST SENSE transaction:
1. ata_pio_task() entered with PIO_ST.
2. ata_pio_block() called, 24 bytes received from the device.
3. The buffer size is 96 bytes, so the state is kept as PIO_ST.
4. ata_pio_task() entered with PIO_ST.
5. ata_pio_block() called, DRQ == 0 to mark the end of data transfer.
6. state changed to PIO_ST_LAST and command completed as successful.
DRQ == 0 in step 5 seems to be normal and should be treated as OK.
Albert
prev parent reply other threads:[~2005-09-08 6:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-02 15:48 [PATCH 0/2] libata: ata_pio_task() accessing 'ap->pio_task_state' fix Albert Lee
2005-09-02 15:53 ` [PATCH 1/2] libata: ata_pio_complete() and ata_pio_block() return value Albert Lee
2005-09-02 15:55 ` [PATCH 2/2] libata: ata_pio_task() fix Albert Lee
2005-09-07 5:41 ` [PATCH 0/2] libata: ata_pio_task() accessing 'ap->pio_task_state' fix Jeff Garzik
2005-09-07 10:03 ` Albert Lee
2005-09-08 0:43 ` Jeff Garzik
2005-09-08 6:25 ` Albert Lee [this message]
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=431FD96B.3050801@tw.ibm.com \
--to=albertcc@tw.ibm.com \
--cc=bzolnier@gmail.com \
--cc=dwm@maxeymade.com \
--cc=htejun@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).