aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-08-12 20:44:53 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-12 20:44:53 -0400
commitaa11d958d1a6572eda08214d7c6a735804fe48a5 (patch)
treed025b05270ad1e010660d17eeadc6ac3c1abbd7d /drivers/ide
parent07f6642ee9418e962e54cbc07471cfe2e559c568 (diff)
parent9799218ae36910af50f002a5db1802d576fffb43 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: arch/microblaze/include/asm/socket.h
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-disk.c1
-rw-r--r--drivers/ide/ide-io.c54
-rw-r--r--drivers/ide/ide-tape.c1
3 files changed, 34 insertions, 22 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 695181120cdb..7f878017b736 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -455,6 +455,7 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
455 455
456 rq->cmd_type = REQ_TYPE_ATA_TASKFILE; 456 rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
457 rq->special = cmd; 457 rq->special = cmd;
458 cmd->rq = rq;
458} 459}
459 460
460ide_devset_get(multcount, mult_count); 461ide_devset_get(multcount, mult_count);
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index d5f3c77beadd..db96138fefcd 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -466,14 +466,10 @@ void do_ide_request(struct request_queue *q)
466 466
467 if (!ide_lock_port(hwif)) { 467 if (!ide_lock_port(hwif)) {
468 ide_hwif_t *prev_port; 468 ide_hwif_t *prev_port;
469
470 WARN_ON_ONCE(hwif->rq);
469repeat: 471repeat:
470 prev_port = hwif->host->cur_port; 472 prev_port = hwif->host->cur_port;
471
472 if (drive->dev_flags & IDE_DFLAG_BLOCKED)
473 rq = hwif->rq;
474 else
475 WARN_ON_ONCE(hwif->rq);
476
477 if (drive->dev_flags & IDE_DFLAG_SLEEPING && 473 if (drive->dev_flags & IDE_DFLAG_SLEEPING &&
478 time_after(drive->sleep, jiffies)) { 474 time_after(drive->sleep, jiffies)) {
479 ide_unlock_port(hwif); 475 ide_unlock_port(hwif);
@@ -500,29 +496,43 @@ repeat:
500 hwif->cur_dev = drive; 496 hwif->cur_dev = drive;
501 drive->dev_flags &= ~(IDE_DFLAG_SLEEPING | IDE_DFLAG_PARKED); 497 drive->dev_flags &= ~(IDE_DFLAG_SLEEPING | IDE_DFLAG_PARKED);
502 498
503 if (rq == NULL) { 499 spin_unlock_irq(&hwif->lock);
504 spin_unlock_irq(&hwif->lock); 500 spin_lock_irq(q->queue_lock);
505 spin_lock_irq(q->queue_lock); 501 /*
506 /* 502 * we know that the queue isn't empty, but this can happen
507 * we know that the queue isn't empty, but this can 503 * if the q->prep_rq_fn() decides to kill a request
508 * happen if ->prep_rq_fn() decides to kill a request 504 */
509 */ 505 if (!rq)
510 rq = blk_fetch_request(drive->queue); 506 rq = blk_fetch_request(drive->queue);
511 spin_unlock_irq(q->queue_lock);
512 spin_lock_irq(&hwif->lock);
513 507
514 if (rq == NULL) { 508 spin_unlock_irq(q->queue_lock);
515 ide_unlock_port(hwif); 509 spin_lock_irq(&hwif->lock);
516 goto out; 510
517 } 511 if (!rq) {
512 ide_unlock_port(hwif);
513 goto out;
518 } 514 }
519 515
520 /* 516 /*
521 * Sanity: don't accept a request that isn't a PM request 517 * Sanity: don't accept a request that isn't a PM request
522 * if we are currently power managed. 518 * if we are currently power managed. This is very important as
519 * blk_stop_queue() doesn't prevent the blk_fetch_request()
520 * above to return us whatever is in the queue. Since we call
521 * ide_do_request() ourselves, we end up taking requests while
522 * the queue is blocked...
523 *
524 * We let requests forced at head of queue with ide-preempt
525 * though. I hope that doesn't happen too much, hopefully not
526 * unless the subdriver triggers such a thing in its own PM
527 * state machine.
523 */ 528 */
524 BUG_ON((drive->dev_flags & IDE_DFLAG_BLOCKED) && 529 if ((drive->dev_flags & IDE_DFLAG_BLOCKED) &&
525 blk_pm_request(rq) == 0); 530 blk_pm_request(rq) == 0 &&
531 (rq->cmd_flags & REQ_PREEMPT) == 0) {
532 /* there should be no pending command at this point */
533 ide_unlock_port(hwif);
534 goto plug_device;
535 }
526 536
527 hwif->rq = rq; 537 hwif->rq = rq;
528 538
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 013dc595fab6..bc5fb12b913c 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -1064,6 +1064,7 @@ static int idetape_blkdev_ioctl(ide_drive_t *drive, unsigned int cmd,
1064 tape->best_dsc_rw_freq = config.dsc_rw_frequency; 1064 tape->best_dsc_rw_freq = config.dsc_rw_frequency;
1065 break; 1065 break;
1066 case 0x0350: 1066 case 0x0350:
1067 memset(&config, 0, sizeof(config));
1067 config.dsc_rw_frequency = (int) tape->best_dsc_rw_freq; 1068 config.dsc_rw_frequency = (int) tape->best_dsc_rw_freq;
1068 config.nr_stages = 1; 1069 config.nr_stages = 1;
1069 if (copy_to_user(argp, &config, sizeof(config))) 1070 if (copy_to_user(argp, &config, sizeof(config)))