diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-10 20:22:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-10 20:22:31 -0400 |
commit | 8bd51cce98aa80ff8b56d34a0e48316c5f887818 (patch) | |
tree | 76735fa7f5767fa379f30399a9bd048a3bbf3fc3 /drivers | |
parent | 9631eb0bc18bc1fd1cc84e535260d67ed6a36865 (diff) | |
parent | a7a832de9e9624bcf069a5369c3c38ba2f44d460 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6:
ide: add "optical" to sysfs "media" attribute
ide: ugly messages trying to open CD drive with no media present
ide: correctly prevent IDE timer expiry function to run if request was already handled
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/ide-cd.c | 9 | ||||
-rw-r--r-- | drivers/ide/ide-io.c | 6 | ||||
-rw-r--r-- | drivers/ide/ide-iops.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide.c | 2 |
4 files changed, 18 insertions, 1 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 45a928c058cf..638becda81c6 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -735,6 +735,15 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) | |||
735 | cdrom_saw_media_change (drive); | 735 | cdrom_saw_media_change (drive); |
736 | /*printk("%s: media changed\n",drive->name);*/ | 736 | /*printk("%s: media changed\n",drive->name);*/ |
737 | return 0; | 737 | return 0; |
738 | } else if ((sense_key == ILLEGAL_REQUEST) && | ||
739 | (rq->cmd[0] == GPCMD_START_STOP_UNIT)) { | ||
740 | /* | ||
741 | * Don't print error message for this condition-- | ||
742 | * SFF8090i indicates that 5/24/00 is the correct | ||
743 | * response to a request to close the tray if the | ||
744 | * drive doesn't have that capability. | ||
745 | * cdrom_log_sense() knows this! | ||
746 | */ | ||
738 | } else if (!(rq->cmd_flags & REQ_QUIET)) { | 747 | } else if (!(rq->cmd_flags & REQ_QUIET)) { |
739 | /* Otherwise, print an error. */ | 748 | /* Otherwise, print an error. */ |
740 | ide_dump_status(drive, "packet command error", stat); | 749 | ide_dump_status(drive, "packet command error", stat); |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 0e0280076fcd..8670112f1d39 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -1226,6 +1226,7 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq) | |||
1226 | #endif | 1226 | #endif |
1227 | /* so that ide_timer_expiry knows what to do */ | 1227 | /* so that ide_timer_expiry knows what to do */ |
1228 | hwgroup->sleeping = 1; | 1228 | hwgroup->sleeping = 1; |
1229 | hwgroup->req_gen_timer = hwgroup->req_gen; | ||
1229 | mod_timer(&hwgroup->timer, sleep); | 1230 | mod_timer(&hwgroup->timer, sleep); |
1230 | /* we purposely leave hwgroup->busy==1 | 1231 | /* we purposely leave hwgroup->busy==1 |
1231 | * while sleeping */ | 1232 | * while sleeping */ |
@@ -1411,7 +1412,8 @@ void ide_timer_expiry (unsigned long data) | |||
1411 | 1412 | ||
1412 | spin_lock_irqsave(&ide_lock, flags); | 1413 | spin_lock_irqsave(&ide_lock, flags); |
1413 | 1414 | ||
1414 | if ((handler = hwgroup->handler) == NULL) { | 1415 | if (((handler = hwgroup->handler) == NULL) || |
1416 | (hwgroup->req_gen != hwgroup->req_gen_timer)) { | ||
1415 | /* | 1417 | /* |
1416 | * Either a marginal timeout occurred | 1418 | * Either a marginal timeout occurred |
1417 | * (got the interrupt just as timer expired), | 1419 | * (got the interrupt just as timer expired), |
@@ -1439,6 +1441,7 @@ void ide_timer_expiry (unsigned long data) | |||
1439 | if ((wait = expiry(drive)) > 0) { | 1441 | if ((wait = expiry(drive)) > 0) { |
1440 | /* reset timer */ | 1442 | /* reset timer */ |
1441 | hwgroup->timer.expires = jiffies + wait; | 1443 | hwgroup->timer.expires = jiffies + wait; |
1444 | hwgroup->req_gen_timer = hwgroup->req_gen; | ||
1442 | add_timer(&hwgroup->timer); | 1445 | add_timer(&hwgroup->timer); |
1443 | spin_unlock_irqrestore(&ide_lock, flags); | 1446 | spin_unlock_irqrestore(&ide_lock, flags); |
1444 | return; | 1447 | return; |
@@ -1653,6 +1656,7 @@ irqreturn_t ide_intr (int irq, void *dev_id) | |||
1653 | printk(KERN_ERR "%s: ide_intr: hwgroup->busy was 0 ??\n", drive->name); | 1656 | printk(KERN_ERR "%s: ide_intr: hwgroup->busy was 0 ??\n", drive->name); |
1654 | } | 1657 | } |
1655 | hwgroup->handler = NULL; | 1658 | hwgroup->handler = NULL; |
1659 | hwgroup->req_gen++; | ||
1656 | del_timer(&hwgroup->timer); | 1660 | del_timer(&hwgroup->timer); |
1657 | spin_unlock(&ide_lock); | 1661 | spin_unlock(&ide_lock); |
1658 | 1662 | ||
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 1ee53a551c3a..3caa176b3155 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -889,6 +889,7 @@ static void __ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, | |||
889 | hwgroup->handler = handler; | 889 | hwgroup->handler = handler; |
890 | hwgroup->expiry = expiry; | 890 | hwgroup->expiry = expiry; |
891 | hwgroup->timer.expires = jiffies + timeout; | 891 | hwgroup->timer.expires = jiffies + timeout; |
892 | hwgroup->req_gen_timer = hwgroup->req_gen; | ||
892 | add_timer(&hwgroup->timer); | 893 | add_timer(&hwgroup->timer); |
893 | } | 894 | } |
894 | 895 | ||
@@ -929,6 +930,7 @@ void ide_execute_command(ide_drive_t *drive, task_ioreg_t cmd, ide_handler_t *ha | |||
929 | hwgroup->handler = handler; | 930 | hwgroup->handler = handler; |
930 | hwgroup->expiry = expiry; | 931 | hwgroup->expiry = expiry; |
931 | hwgroup->timer.expires = jiffies + timeout; | 932 | hwgroup->timer.expires = jiffies + timeout; |
933 | hwgroup->req_gen_timer = hwgroup->req_gen; | ||
932 | add_timer(&hwgroup->timer); | 934 | add_timer(&hwgroup->timer); |
933 | hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG); | 935 | hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG); |
934 | /* Drive takes 400nS to respond, we must avoid the IRQ being | 936 | /* Drive takes 400nS to respond, we must avoid the IRQ being |
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index a6f098fda884..ae5bf2be6f52 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -1962,6 +1962,8 @@ static char *media_string(ide_drive_t *drive) | |||
1962 | return "tape"; | 1962 | return "tape"; |
1963 | case ide_floppy: | 1963 | case ide_floppy: |
1964 | return "floppy"; | 1964 | return "floppy"; |
1965 | case ide_optical: | ||
1966 | return "optical"; | ||
1965 | default: | 1967 | default: |
1966 | return "UNKNOWN"; | 1968 | return "UNKNOWN"; |
1967 | } | 1969 | } |