Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6:
cmd64x: fix hwif->chipset setup
MAINTAINERS: update ide-cd entry
ide-cd: fix 'ireason' reporting in cdrom_pc_intr()
ide-cd: fix error message in cdrom_pc_intr()
ide-cd: add error message for DMA error to cdrom_read_intr()
ide-cd: fix error messages in cdrom_write_intr()
ide-cd: add missing 'ireason' masking to cdrom_write_intr()
ide-cd: fix error messages in cdrom_{read,write}_check_ireason()
ide-cd: use ide_cd_release() in ide_cd_probe()
ide-cd: fix ACER/AOpen 24X CDROM speed reporting on big-endian machines
ide-cd: fix SAMSUNG CD-ROM SCR-3231 quirk
drivers/ide/: Spelling fixes

+42 -37
+3 -1
MAINTAINERS
··· 1870 1870 S: Maintained 1871 1871 1872 1872 IDE/ATAPI CDROM DRIVER 1873 + P: Borislav Petkov 1874 + M: bbpetkov@yahoo.de 1873 1875 L: linux-ide@vger.kernel.org 1874 - S: Unmaintained 1876 + S: Maintained 1875 1877 1876 1878 IDE/ATAPI FLOPPY DRIVERS 1877 1879 P: Paul Bristow
+34 -32
drivers/ide/ide-cd.c
··· 1068 1068 return 0; 1069 1069 else if (ireason == 0) { 1070 1070 /* Whoops... The drive is expecting to receive data from us! */ 1071 - printk(KERN_ERR "%s: read_intr: Drive wants to transfer data the " 1072 - "wrong way!\n", drive->name); 1071 + printk(KERN_ERR "%s: %s: wrong transfer direction!\n", 1072 + drive->name, __FUNCTION__); 1073 1073 1074 1074 /* Throw some data at the drive so it doesn't hang 1075 1075 and quit this request. */ ··· 1086 1086 return 0; 1087 1087 } else { 1088 1088 /* Drive wants a command packet, or invalid ireason... */ 1089 - printk(KERN_ERR "%s: read_intr: bad interrupt reason %x\n", drive->name, 1090 - ireason); 1089 + printk(KERN_ERR "%s: %s: bad interrupt reason 0x%02x\n", 1090 + drive->name, __FUNCTION__, ireason); 1091 1091 } 1092 1092 1093 1093 cdrom_end_request(drive, 0); ··· 1112 1112 */ 1113 1113 if (dma) { 1114 1114 info->dma = 0; 1115 - if ((dma_error = HWIF(drive)->ide_dma_end(drive))) 1115 + dma_error = HWIF(drive)->ide_dma_end(drive); 1116 + if (dma_error) { 1117 + printk(KERN_ERR "%s: DMA read error\n", drive->name); 1116 1118 ide_dma_off(drive); 1119 + } 1117 1120 } 1118 1121 1119 1122 if (cdrom_decode_status(drive, 0, &stat)) ··· 1446 1443 return ide_stopped; 1447 1444 1448 1445 /* Read the interrupt reason and the transfer length. */ 1449 - ireason = HWIF(drive)->INB(IDE_IREASON_REG); 1446 + ireason = HWIF(drive)->INB(IDE_IREASON_REG) & 0x3; 1450 1447 lowcyl = HWIF(drive)->INB(IDE_BCOUNTL_REG); 1451 1448 highcyl = HWIF(drive)->INB(IDE_BCOUNTH_REG); 1452 1449 ··· 1487 1484 if (thislen > len) thislen = len; 1488 1485 1489 1486 /* The drive wants to be written to. */ 1490 - if ((ireason & 3) == 0) { 1487 + if (ireason == 0) { 1491 1488 if (!rq->data) { 1492 1489 blk_dump_rq_flags(rq, "cdrom_pc_intr, write"); 1493 1490 goto confused; ··· 1509 1506 } 1510 1507 1511 1508 /* Same drill for reading. */ 1512 - else if ((ireason & 3) == 2) { 1509 + else if (ireason == 2) { 1513 1510 if (!rq->data) { 1514 - blk_dump_rq_flags(rq, "cdrom_pc_intr, write"); 1511 + blk_dump_rq_flags(rq, "cdrom_pc_intr, read"); 1515 1512 goto confused; 1516 1513 } 1517 1514 /* Transfer the data. */ ··· 1635 1632 return 0; 1636 1633 else if (ireason == 2) { 1637 1634 /* Whoops... The drive wants to send data. */ 1638 - printk(KERN_ERR "%s: write_intr: wrong transfer direction!\n", 1639 - drive->name); 1635 + printk(KERN_ERR "%s: %s: wrong transfer direction!\n", 1636 + drive->name, __FUNCTION__); 1640 1637 1641 1638 while (len > 0) { 1642 1639 int dum = 0; ··· 1645 1642 } 1646 1643 } else { 1647 1644 /* Drive wants a command packet, or invalid ireason... */ 1648 - printk(KERN_ERR "%s: write_intr: bad interrupt reason %x\n", 1649 - drive->name, ireason); 1645 + printk(KERN_ERR "%s: %s: bad interrupt reason 0x%02x\n", 1646 + drive->name, __FUNCTION__, ireason); 1650 1647 } 1651 1648 1652 1649 cdrom_end_request(drive, 0); ··· 1808 1805 /* Check for errors. */ 1809 1806 if (dma) { 1810 1807 info->dma = 0; 1811 - if ((dma_error = HWIF(drive)->ide_dma_end(drive))) { 1812 - printk(KERN_ERR "ide-cd: write dma error\n"); 1808 + dma_error = HWIF(drive)->ide_dma_end(drive); 1809 + if (dma_error) { 1810 + printk(KERN_ERR "%s: DMA write error\n", drive->name); 1813 1811 ide_dma_off(drive); 1814 1812 } 1815 1813 } ··· 1830 1826 } 1831 1827 1832 1828 /* Read the interrupt reason and the transfer length. */ 1833 - ireason = HWIF(drive)->INB(IDE_IREASON_REG); 1829 + ireason = HWIF(drive)->INB(IDE_IREASON_REG) & 0x3; 1834 1830 lowcyl = HWIF(drive)->INB(IDE_BCOUNTL_REG); 1835 1831 highcyl = HWIF(drive)->INB(IDE_BCOUNTH_REG); 1836 1832 ··· 1843 1839 */ 1844 1840 uptodate = 1; 1845 1841 if (rq->current_nr_sectors > 0) { 1846 - printk(KERN_ERR "%s: write_intr: data underrun (%d blocks)\n", 1847 - drive->name, rq->current_nr_sectors); 1842 + printk(KERN_ERR "%s: %s: data underrun (%d blocks)\n", 1843 + drive->name, __FUNCTION__, 1844 + rq->current_nr_sectors); 1848 1845 uptodate = 0; 1849 1846 } 1850 1847 cdrom_end_request(drive, uptodate); ··· 1865 1860 int this_transfer; 1866 1861 1867 1862 if (!rq->current_nr_sectors) { 1868 - printk(KERN_ERR "ide-cd: write_intr: oops\n"); 1863 + printk(KERN_ERR "%s: %s: confused, missing data\n", 1864 + drive->name, __FUNCTION__); 1869 1865 break; 1870 1866 } 1871 1867 ··· 2694 2688 if (!drive->id->model[0] && 2695 2689 !strncmp(drive->id->fw_rev, "241N", 4)) { 2696 2690 CDROM_STATE_FLAGS(drive)->current_speed = 2697 - (((unsigned int)cap->curspeed) + (176/2)) / 176; 2691 + (le16_to_cpu(cap->curspeed) + (176/2)) / 176; 2698 2692 CDROM_CONFIG_FLAGS(drive)->max_speed = 2699 - (((unsigned int)cap->maxspeed) + (176/2)) / 176; 2693 + (le16_to_cpu(cap->maxspeed) + (176/2)) / 176; 2700 2694 } else { 2701 2695 CDROM_STATE_FLAGS(drive)->current_speed = 2702 - (ntohs(cap->curspeed) + (176/2)) / 176; 2696 + (be16_to_cpu(cap->curspeed) + (176/2)) / 176; 2703 2697 CDROM_CONFIG_FLAGS(drive)->max_speed = 2704 - (ntohs(cap->maxspeed) + (176/2)) / 176; 2698 + (be16_to_cpu(cap->maxspeed) + (176/2)) / 176; 2705 2699 } 2706 2700 } 2707 2701 ··· 2914 2908 devinfo->mask |= CDC_MO_DRIVE; 2915 2909 if (!CDROM_CONFIG_FLAGS(drive)->ram) 2916 2910 devinfo->mask |= CDC_RAM; 2911 + 2912 + if (CDROM_CONFIG_FLAGS(drive)->no_speed_select) 2913 + devinfo->mask |= CDC_SELECT_SPEED; 2917 2914 2918 2915 devinfo->disk = info->disk; 2919 2916 return register_cdrom(devinfo); ··· 3170 3161 CDROM_CONFIG_FLAGS(drive)->limit_nframes = 1; 3171 3162 /* the 3231 model does not support the SET_CD_SPEED command */ 3172 3163 else if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-3231")) 3173 - cdi->mask |= CDC_SELECT_SPEED; 3164 + CDROM_CONFIG_FLAGS(drive)->no_speed_select = 1; 3174 3165 3175 3166 #if ! STANDARD_ATAPI 3176 3167 /* by default Sanyo 3 CD changer support is turned off and ··· 3513 3504 g->driverfs_dev = &drive->gendev; 3514 3505 g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE; 3515 3506 if (ide_cdrom_setup(drive)) { 3516 - struct cdrom_device_info *devinfo = &info->devinfo; 3517 3507 ide_proc_unregister_driver(drive, &ide_cdrom_driver); 3518 - kfree(info->buffer); 3519 - kfree(info->toc); 3520 - kfree(info->changer_info); 3521 - if (devinfo->handle == drive && unregister_cdrom(devinfo)) 3522 - printk (KERN_ERR "%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name); 3523 - kfree(info); 3524 - drive->driver_data = NULL; 3508 + ide_cd_release(&info->kref); 3525 3509 goto failed; 3526 3510 } 3527 3511
+2 -1
drivers/ide/ide-cd.h
··· 91 91 __u8 close_tray : 1; /* can close the tray */ 92 92 __u8 writing : 1; /* pseudo write in progress */ 93 93 __u8 mo_drive : 1; /* drive is an MO device */ 94 - __u8 reserved : 2; 94 + __u8 no_speed_select : 1; /* SET_CD_SPEED command is unsupported. */ 95 + __u8 reserved : 1; 95 96 byte max_speed; /* Max speed of the drive */ 96 97 }; 97 98 #define CDROM_CONFIG_FLAGS(drive) (&(((struct cdrom_info *)(drive->driver_data))->config_flags))
+2 -2
drivers/ide/pci/cmd64x.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/cmd64x.c Version 1.51 Nov 8, 2007 2 + * linux/drivers/ide/pci/cmd64x.c Version 1.52 Dec 24, 2007 3 3 * 4 4 * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines. 5 5 * Due to massive hardware bugs, UltraDMA is only supported ··· 564 564 .init_chipset = init_chipset_cmd64x, 565 565 .init_hwif = init_hwif_cmd64x, 566 566 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, 567 + .chipset = ide_cmd646, 567 568 .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE, 568 569 .pio_mask = ATA_PIO5, 569 570 .mwdma_mask = ATA_MWDMA2, ··· 574 573 .init_chipset = init_chipset_cmd64x, 575 574 .init_hwif = init_hwif_cmd64x, 576 575 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, 577 - .chipset = ide_cmd646, 578 576 .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE, 579 577 .pio_mask = ATA_PIO5, 580 578 .mwdma_mask = ATA_MWDMA2,
+1 -1
drivers/ide/pci/cs5535.c
··· 49 49 #define ATAC_BM0_PRD 0x04 50 50 #define CS5535_CABLE_DETECT 0x48 51 51 52 - /* Format I PIO settings. We seperate out cmd and data for safer timings */ 52 + /* Format I PIO settings. We separate out cmd and data for safer timings */ 53 53 54 54 static unsigned int cs5535_pio_cmd_timings[5] = 55 55 { 0xF7F4, 0x53F3, 0x13F1, 0x5131, 0x1131 };