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: [PATCH 2/2] libata: ata_pio_task() fix
Date: Fri, 02 Sep 2005 23:55:34 +0800 [thread overview]
Message-ID: <431875F6.8080808@tw.ibm.com> (raw)
In-Reply-To: <43187433.9080204@tw.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 234 bytes --]
Jeff,
PATCH 2/2:
Modify ata_pio_task() to check the return value of patch 1/2
before queuing next step and using the value of 'ap->pio_task_state'.
For your review, thanks.
Albert
Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
[-- Attachment #2: pio2.diff --]
[-- Type: text/plain, Size: 1145 bytes --]
--- pio1/drivers/scsi/libata-core.c 2005-09-02 18:37:26.000000000 +0800
+++ pio2/drivers/scsi/libata-core.c 2005-09-02 18:37:19.000000000 +0800
@@ -2893,21 +2893,20 @@
{
struct ata_port *ap = _data;
unsigned long timeout = 0;
+ int has_next = 0;
switch (ap->pio_task_state) {
- case PIO_ST_IDLE:
- return;
-
case PIO_ST:
- ata_pio_block(ap);
+ has_next = ata_pio_block(ap);
break;
case PIO_ST_LAST:
- ata_pio_complete(ap);
+ has_next = ata_pio_complete(ap);
break;
case PIO_ST_POLL:
case PIO_ST_LAST_POLL:
+ has_next = 1;
timeout = ata_pio_poll(ap);
break;
@@ -2915,13 +2914,18 @@
case PIO_ST_ERR:
ata_pio_error(ap);
return;
+ default:
+ printk(KERN_ERR "ata%u unknown PIO task state %u\n",
+ ap->id, ap->pio_task_state);
+ return;
}
- if (timeout)
- queue_delayed_work(ata_wq, &ap->pio_task,
- timeout);
- else
- queue_work(ata_wq, &ap->pio_task);
+ if (has_next) {
+ if (timeout)
+ queue_delayed_work(ata_wq, &ap->pio_task, timeout);
+ else
+ queue_work(ata_wq, &ap->pio_task);
+ }
}
static void atapi_request_sense(struct ata_port *ap, struct ata_device *dev,
next prev parent reply other threads:[~2005-09-02 15:55 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 ` Albert Lee [this message]
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
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=431875F6.8080808@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.