From 899e1bc57340ad9acf5561b1eff7a684975ad800 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 19 Feb 2008 01:41:24 +0100 Subject: ide: Add missing base addresses for falconide and macide commit 29dd59755a849cc6475faa6a75f3b804e23a6fc2 ("ide: remove ide_setup_ports") forgot to take into account the base addresses for the CONTROL registers for falconide and macide, as pointed out by Michael Schmitz. Falconide was tested on Aranym. Signed-off-by: Geert Uytterhoeven Cc: Michael Schmitz Signed-off-by: Bartlomiej Zolnierkiewicz diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c index f044048..07bf129 100644 --- a/drivers/ide/legacy/falconide.c +++ b/drivers/ide/legacy/falconide.c @@ -54,7 +54,7 @@ static void __init falconide_setup_ports(hw_regs_t *hw) for (i = 1; i < 8; i++) hw->io_ports[i] = ATA_HD_BASE + 1 + i * 4; - hw->io_ports[IDE_CONTROL_OFFSET] = ATA_HD_CONTROL; + hw->io_ports[IDE_CONTROL_OFFSET] = ATA_HD_BASE + ATA_HD_CONTROL; hw->irq = IRQ_MFP_IDE; hw->ack_intr = NULL; diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c index a61e607..9a79098 100644 --- a/drivers/ide/legacy/macide.c +++ b/drivers/ide/legacy/macide.c @@ -74,7 +74,7 @@ static void __init macide_setup_ports(hw_regs_t *hw, unsigned long base, for (i = 0; i < 8; i++) hw->io_ports[i] = base + i * 4; - hw->io_ports[IDE_CONTROL_OFFSET] = IDE_CONTROL; + hw->io_ports[IDE_CONTROL_OFFSET] = base + IDE_CONTROL; hw->irq = irq; hw->ack_intr = ack_intr; -- cgit v0.10.2 From b152fcd34108d07a1e682786af583fd3e080cab3 Mon Sep 17 00:00:00 2001 From: Mikko Rapeli Date: Tue, 19 Feb 2008 01:41:25 +0100 Subject: ide/libata: ST310211A has buggy HPA too Signed-off-by: Mikko Rapeli Tested-by: Bart Champagne Cc: Jeff Garzik Signed-off-by: Bartlomiej Zolnierkiewicz diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index beaa3a9..f46eb6f 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4190,6 +4190,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { /* Devices which report 1 sector over size HPA */ { "ST340823A", NULL, ATA_HORKAGE_HPA_SIZE, }, { "ST320413A", NULL, ATA_HORKAGE_HPA_SIZE, }, + { "ST310211A", NULL, ATA_HORKAGE_HPA_SIZE, }, /* Devices which get the IVB wrong */ { "QUANTUM FIREBALLlct10 05", "A03.0900", ATA_HORKAGE_IVB, }, diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index aed8b31..8f5bed4 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -397,6 +397,7 @@ static inline int idedisk_supports_lba48(const struct hd_driveid *id) static const struct drive_list_entry hpa_list[] = { { "ST340823A", NULL }, { "ST320413A", NULL }, + { "ST310211A", NULL }, { NULL, NULL } }; -- cgit v0.10.2 From ef709165d8de1ba9dd3cd5e05dbabf71dc32d883 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Tue, 19 Feb 2008 01:41:25 +0100 Subject: MAINTAINERS: update ide-cd maintainer's email address Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz diff --git a/MAINTAINERS b/MAINTAINERS index 1d2edb4..082d1ee 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1924,7 +1924,7 @@ S: Maintained IDE/ATAPI CDROM DRIVER P: Borislav Petkov -M: bbpetkov@yahoo.de +M: petkovbb@gmail.com L: linux-ide@vger.kernel.org S: Maintained -- cgit v0.10.2 From d684b21f89b96af3adc06877f29fd9f5214b23c8 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 19 Feb 2008 01:41:25 +0100 Subject: falconide: locking bugfix commit 8ac4ce742c66100931b6f2d7a36b0df08bc721fe ("ide: fix host drivers depending on ide_generic to probe for interfaces (take 2)") moved probing to falconide but forgot to take care of Atari specific locking - fix it. Cc: Geert Uytterhoeven Cc: Michael Schmitz Signed-off-by: Bartlomiej Zolnierkiewicz diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index 709b9e4..9ebec08 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c @@ -17,9 +17,6 @@ static int __init ide_generic_init(void) u8 idx[MAX_HWIFS]; int i; - if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET]) - ide_get_lock(NULL, NULL); /* for atari only */ - for (i = 0; i < MAX_HWIFS; i++) { ide_hwif_t *hwif = &ide_hwifs[i]; @@ -31,9 +28,6 @@ static int __init ide_generic_init(void) ide_device_add_all(idx, NULL); - if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET]) - ide_release_lock(); /* for atari only */ - return 0; } diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c index 07bf129..8949ce7 100644 --- a/drivers/ide/legacy/falconide.c +++ b/drivers/ide/legacy/falconide.c @@ -84,7 +84,9 @@ static int __init falconide_init(void) ide_init_port_data(hwif, index); ide_init_port_hw(hwif, &hw); + ide_get_lock(NULL, NULL); ide_device_add(idx, NULL); + ide_release_lock(); } return 0; -- cgit v0.10.2 From 84f7e451e9213d8c328752d0f39bc362519d53d2 Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Tue, 19 Feb 2008 01:41:26 +0100 Subject: via82cxxx: add new PCI id for cx700 [bart: manually ported it over via82cxxx changes] From: Andrew Smith Signed-off-by: Bartlomiej Zolnierkiewicz diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index f3f79f8..9004e75 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c @@ -479,6 +479,7 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i static const struct pci_device_id via_pci_tbl[] = { { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C576_1), 0 }, { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C586_1), 0 }, + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_CX700_IDE), 0 }, { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_6410), 1 }, { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_SATA_EIDE), 1 }, { 0, }, diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index df6dd79..0519e53 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1351,6 +1351,7 @@ #define PCI_DEVICE_ID_VIA_8231_4 0x8235 #define PCI_DEVICE_ID_VIA_8365_1 0x8305 #define PCI_DEVICE_ID_VIA_CX700 0x8324 +#define PCI_DEVICE_ID_VIA_CX700_IDE 0x0581 #define PCI_DEVICE_ID_VIA_VX800 0x8353 #define PCI_DEVICE_ID_VIA_8371_1 0x8391 #define PCI_DEVICE_ID_VIA_82C598_1 0x8598 -- cgit v0.10.2 From f401fd55b5a9ef1a4572abaefaa6957af11ced61 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 19 Feb 2008 01:41:26 +0100 Subject: linux/hdsmart.h: fix goofups (take 2) Fix goofups of commit 76166952bbc81dda1c8a8c14e75a2aa06f6c052c (" is not used by kernel code"). Also update include/linux/Kbuild to reflect the fact that hdsmart.h uses __KERNEL__ ifdefs now. Reported-by: "Robert P. J. Day" Signed-off-by: Bartlomiej Zolnierkiewicz diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 5cae9b5..aada32f 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild @@ -70,7 +70,6 @@ header-y += fuse.h header-y += genetlink.h header-y += gen_stats.h header-y += gigaset_dev.h -header-y += hdsmart.h header-y += hysdn_if.h header-y += i2o-dev.h header-y += i8k.h @@ -211,6 +210,7 @@ unifdef-y += hayesesp.h unifdef-y += hdlcdrv.h unifdef-y += hdlc.h unifdef-y += hdreg.h +unifdef-y += hdsmart.h unifdef-y += hiddev.h unifdef-y += hpet.h unifdef-y += i2c.h diff --git a/include/linux/hdsmart.h b/include/linux/hdsmart.h index e691921..4f4faf9 100644 --- a/include/linux/hdsmart.h +++ b/include/linux/hdsmart.h @@ -17,7 +17,7 @@ #ifndef _LINUX_HDSMART_H #define _LINUX_HDSMART_H -#ifndef __KERNEL +#ifndef __KERNEL__ #define OFFLINE_FULL_SCAN 0 #define SHORT_SELF_TEST 1 #define EXTEND_SELF_TEST 2 @@ -121,6 +121,6 @@ typedef struct ata_smart_selftestlog_s { unsigned char resevered[2]; unsigned char chksum; } __attribute__ ((packed)) ata_smart_selftestlog_t; -#endif /* __KERNEL__ * +#endif /* __KERNEL__ */ #endif /* _LINUX_HDSMART_H */ -- cgit v0.10.2 From 1a1990f5479b0c9055c133b7e0e7fedfcbe11512 Mon Sep 17 00:00:00 2001 From: Jan Evert van Grootheest Date: Tue, 19 Feb 2008 01:41:26 +0100 Subject: ht6560b can only do up to PIO mode 4 According to the datasheet, ht6560b only supports up to PIO mode 4. [bart: manually ported it over 2.6.25-rc2] Signed-off-by: Jan Evert van Grootheest Signed-off-by: Bartlomiej Zolnierkiewicz diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c index 02d12c7..2701e7d 100644 --- a/drivers/ide/legacy/ht6560b.c +++ b/drivers/ide/legacy/ht6560b.c @@ -323,7 +323,7 @@ static const struct ide_port_info ht6560b_port_info __initdata = { IDE_HFLAG_NO_DMA | IDE_HFLAG_NO_AUTOTUNE | IDE_HFLAG_ABUSE_PREFETCH, - .pio_mask = ATA_PIO5, + .pio_mask = ATA_PIO4, }; static int __init ht6560b_init(void) -- cgit v0.10.2 From 0e7d8d480259319649f7a2c230622b98758d1c83 Mon Sep 17 00:00:00 2001 From: Jan Evert van Grootheest Date: Tue, 19 Feb 2008 01:41:26 +0100 Subject: ht6560b: force prefetch for some devices Prefetch needs to be set for some ide devices to work when connected to a ht6560b interface. This was not always done properly, causing a system with a HD and CD on the primary interface to not work properly. Or, in effect, hang hard. This patch forces prefetch on devices before checking whether it is necessary to change the settings in the interface This patch should also be applied to 2.4. I don't currently have a 2.4 tree around. (also change my email address) Signed-off-by: Jan Evert van Grootheest Cc: Sergei Shtylyov Cc: Alan Cox Signed-off-by: Bartlomiej Zolnierkiewicz diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c index 2701e7d..78ca68e 100644 --- a/drivers/ide/legacy/ht6560b.c +++ b/drivers/ide/legacy/ht6560b.c @@ -21,18 +21,21 @@ * "Prefetch" mode bit OFF for ide disks and * ON for anything else. * + * Version 0.08 Need to force prefetch for CDs and other non-disk + * devices. (not sure which devices exactly need + * prefetch) * * HT-6560B EIDE-controller support * To activate controller support use kernel parameter "ide0=ht6560b". * Use hdparm utility to enable PIO mode support. * * Author: Mikko Ala-Fossi - * Jan Evert van Grootheest + * Jan Evert van Grootheest * * Try: http://www.maf.iki.fi/~maf/ht6560b/ */ -#define HT6560B_VERSION "v0.07" +#define HT6560B_VERSION "v0.08" #include #include @@ -130,15 +133,20 @@ static void ht6560b_selectproc (ide_drive_t *drive) u8 select, timing; local_irq_save(flags); - + select = HT_CONFIG(drive); timing = HT_TIMING(drive); - + + /* + * Need to enforce prefetch sometimes because otherwise + * it'll hang (hard). + */ + if (drive->media != ide_disk || !drive->present) + select |= HT_PREFETCH_MODE; + if (select != current_select || timing != current_timing) { current_select = select; current_timing = timing; - if (drive->media != ide_disk || !drive->present) - select |= HT_PREFETCH_MODE; (void)inb(HT_CONFIG_PORT); (void)inb(HT_CONFIG_PORT); (void)inb(HT_CONFIG_PORT); @@ -188,11 +196,12 @@ static int __init try_to_init_ht6560b(void) outb(HT_TIMING_DEFAULT, 0x1f6); /* IDE_SELECT_REG */ (void) inb(0x1f7); /* IDE_STATUS_REG */ - printk("\nht6560b " HT6560B_VERSION + printk("ht6560b " HT6560B_VERSION ": chipset detected and initialized" #ifdef DEBUG " with debug enabled" #endif + "\n" ); return 1; } -- cgit v0.10.2 From 14e04c3f6e64bac468f0aa38c6d47aa95b60c074 Mon Sep 17 00:00:00 2001 From: Kiyoshi Ueda Date: Tue, 19 Feb 2008 01:41:26 +0100 Subject: ide-cd: fix missing residual count setting in DMA mode This patch fixes the missing residual count setting in DMA mode, which was introduced during the conversion to blk-end-request. The residual count could be used by the request submitter. So if it isn't set correctly, some upper layers does not work. (e.g. wodim for CD burning.) The bug is in only DMA mode. In PIO mode, we are setting the residual count correctly, so no need to fix. Signed-off-by: Kiyoshi Ueda Signed-off-by: Jun'ichi Nomura Reported-by: Andreas Schwab Tested-by: Andreas Schwab Tested-by: Laura Garcia Tested-by: Borislav Petkov Cc: Jens Axboe Signed-off-by: Bartlomiej Zolnierkiewicz diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 354c91d..310e497 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -1207,9 +1207,13 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) end_request: if (blk_pc_request(rq)) { unsigned long flags; + unsigned int dlen = rq->data_len; + + if (dma) + rq->data_len = 0; spin_lock_irqsave(&ide_lock, flags); - if (__blk_end_request(rq, 0, rq->data_len)) + if (__blk_end_request(rq, 0, dlen)) BUG(); HWGROUP(drive)->rq = NULL; spin_unlock_irqrestore(&ide_lock, flags); -- cgit v0.10.2