All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ide: use __generic_unplug_device() in ide_do_drive_cmd() (take 2)
@ 2008-05-27 20:01 Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; only message in thread
From: Bartlomiej Zolnierkiewicz @ 2008-05-27 20:01 UTC (permalink / raw)
  To: linux-ide
  Cc: linux-kernel, FUJITA Tomonori, Borislav Petkov, Jens Axboe,
	Rafael J. Wysocki

* Call __elv_add_request() with 'plug' == 1 (so the device will be
  plugged) and then use __generic_unplug_device() instead of calling
  ide_do_request() directly.

v2:
* For blk_pm_resume_request() requests the queue is stopped so we
  need to call ->request_fn explicitly.

  Thanks to:
  - Rafael for reporting/bisecting the bug
  - Borislav/Rafael for testing the fix

This is a preparation for converting IDE to use blk_execute_rq().

Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
replacement patch

 drivers/ide/ide-io.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1606,8 +1606,11 @@ int ide_do_drive_cmd (ide_drive_t *drive
 	spin_lock_irqsave(&ide_lock, flags);
 	if (action == ide_preempt)
 		hwgroup->rq = NULL;
-	__elv_add_request(drive->queue, rq, where, 0);
-	ide_do_request(hwgroup, IDE_NO_IRQ);
+	__elv_add_request(drive->queue, rq, where, 1);
+	__generic_unplug_device(drive->queue);
+	/* the queue is stopped so it won't be plugged+unplugged */
+	if (blk_pm_resume_request(rq))
+		do_ide_request(drive->queue);
 	spin_unlock_irqrestore(&ide_lock, flags);
 
 	err = 0;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-26 20:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-27 20:01 [PATCH] ide: use __generic_unplug_device() in ide_do_drive_cmd() (take 2) Bartlomiej Zolnierkiewicz

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.