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

+20 -1
+9
drivers/ide/ide-cd.c
··· 735 cdrom_saw_media_change (drive); 736 /*printk("%s: media changed\n",drive->name);*/ 737 return 0; 738 } else if (!(rq->cmd_flags & REQ_QUIET)) { 739 /* Otherwise, print an error. */ 740 ide_dump_status(drive, "packet command error", stat);
··· 735 cdrom_saw_media_change (drive); 736 /*printk("%s: media changed\n",drive->name);*/ 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 + */ 747 } else if (!(rq->cmd_flags & REQ_QUIET)) { 748 /* Otherwise, print an error. */ 749 ide_dump_status(drive, "packet command error", stat);
+5 -1
drivers/ide/ide-io.c
··· 1226 #endif 1227 /* so that ide_timer_expiry knows what to do */ 1228 hwgroup->sleeping = 1; 1229 mod_timer(&hwgroup->timer, sleep); 1230 /* we purposely leave hwgroup->busy==1 1231 * while sleeping */ ··· 1412 1413 spin_lock_irqsave(&ide_lock, flags); 1414 1415 - if ((handler = hwgroup->handler) == NULL) { 1416 /* 1417 * Either a marginal timeout occurred 1418 * (got the interrupt just as timer expired), ··· 1441 if ((wait = expiry(drive)) > 0) { 1442 /* reset timer */ 1443 hwgroup->timer.expires = jiffies + wait; 1444 add_timer(&hwgroup->timer); 1445 spin_unlock_irqrestore(&ide_lock, flags); 1446 return; ··· 1656 printk(KERN_ERR "%s: ide_intr: hwgroup->busy was 0 ??\n", drive->name); 1657 } 1658 hwgroup->handler = NULL; 1659 del_timer(&hwgroup->timer); 1660 spin_unlock(&ide_lock); 1661
··· 1226 #endif 1227 /* so that ide_timer_expiry knows what to do */ 1228 hwgroup->sleeping = 1; 1229 + hwgroup->req_gen_timer = hwgroup->req_gen; 1230 mod_timer(&hwgroup->timer, sleep); 1231 /* we purposely leave hwgroup->busy==1 1232 * while sleeping */ ··· 1411 1412 spin_lock_irqsave(&ide_lock, flags); 1413 1414 + if (((handler = hwgroup->handler) == NULL) || 1415 + (hwgroup->req_gen != hwgroup->req_gen_timer)) { 1416 /* 1417 * Either a marginal timeout occurred 1418 * (got the interrupt just as timer expired), ··· 1439 if ((wait = expiry(drive)) > 0) { 1440 /* reset timer */ 1441 hwgroup->timer.expires = jiffies + wait; 1442 + hwgroup->req_gen_timer = hwgroup->req_gen; 1443 add_timer(&hwgroup->timer); 1444 spin_unlock_irqrestore(&ide_lock, flags); 1445 return; ··· 1653 printk(KERN_ERR "%s: ide_intr: hwgroup->busy was 0 ??\n", drive->name); 1654 } 1655 hwgroup->handler = NULL; 1656 + hwgroup->req_gen++; 1657 del_timer(&hwgroup->timer); 1658 spin_unlock(&ide_lock); 1659
+2
drivers/ide/ide-iops.c
··· 889 hwgroup->handler = handler; 890 hwgroup->expiry = expiry; 891 hwgroup->timer.expires = jiffies + timeout; 892 add_timer(&hwgroup->timer); 893 } 894 ··· 930 hwgroup->handler = handler; 931 hwgroup->expiry = expiry; 932 hwgroup->timer.expires = jiffies + timeout; 933 add_timer(&hwgroup->timer); 934 hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG); 935 /* Drive takes 400nS to respond, we must avoid the IRQ being
··· 889 hwgroup->handler = handler; 890 hwgroup->expiry = expiry; 891 hwgroup->timer.expires = jiffies + timeout; 892 + hwgroup->req_gen_timer = hwgroup->req_gen; 893 add_timer(&hwgroup->timer); 894 } 895 ··· 929 hwgroup->handler = handler; 930 hwgroup->expiry = expiry; 931 hwgroup->timer.expires = jiffies + timeout; 932 + hwgroup->req_gen_timer = hwgroup->req_gen; 933 add_timer(&hwgroup->timer); 934 hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG); 935 /* Drive takes 400nS to respond, we must avoid the IRQ being
+2
drivers/ide/ide.c
··· 1962 return "tape"; 1963 case ide_floppy: 1964 return "floppy"; 1965 default: 1966 return "UNKNOWN"; 1967 }
··· 1962 return "tape"; 1963 case ide_floppy: 1964 return "floppy"; 1965 + case ide_optical: 1966 + return "optical"; 1967 default: 1968 return "UNKNOWN"; 1969 }
+2
include/linux/ide.h
··· 861 int (*expiry)(ide_drive_t *); 862 /* ide_system_bus_speed */ 863 int pio_clock; 864 865 unsigned char cmd_buf[4]; 866 } ide_hwgroup_t;
··· 861 int (*expiry)(ide_drive_t *); 862 /* ide_system_bus_speed */ 863 int pio_clock; 864 + int req_gen; 865 + int req_gen_timer; 866 867 unsigned char cmd_buf[4]; 868 } ide_hwgroup_t;