linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] libata: ata_pio_task() accessing 'ap->pio_task_state' fix
@ 2005-09-02 15:48 Albert Lee
  2005-09-02 15:53 ` [PATCH 1/2] libata: ata_pio_complete() and ata_pio_block() return value Albert Lee
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Albert Lee @ 2005-09-02 15:48 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Linux IDE, Doug Maxey, Bartlomiej Zolnierkiewicz, Tejun Heo

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-09-08  6:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).