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 0/2] libata: ata_pio_task() accessing 'ap->pio_task_state' fix
Date: Fri, 02 Sep 2005 23:48:03 +0800 [thread overview]
Message-ID: <43187433.9080204@tw.ibm.com> (raw)
Jeff,
During PIO, after calling ata_poll_qc_complete(), the next command might be
running and the value of 'ap->pio_task_state' might have been changed.
Accessing 'ap->pio_task_state' is not safe at this point.
Ex.
qc 1 completed. queuing a final task with ap->pio_task_state == PIO_ST_IDLE.
qc 2 started, queuing a new task with ap->pio_task_state set to PIO_ST.
qc 1 read ap->pio_task_state as PIO_ST; not PIO_ST_IDLE as expected.
=> 2 qc running in the workqueue with pio_task_state PIO_ST.
Changes:
1/2: Modify ata_pio_complete() and ata_pio_block() to return
whether qc has been completed.
2/2: Modify ata_pio_task() to check the return value. Only queue next
step and
access 'ap->pio_task_state' if the command is not completed.
Patch for 2.6.13 (80ac2912f846c01d702774bb6aa7100ec71e88b9).
Tested on x86 with Promise PDC20275 and LG DVD-Multi drive.
For your review and advice, thanks.
Albert
next reply other threads:[~2005-09-02 15:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-02 15:48 Albert Lee [this message]
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
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=43187433.9080204@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.