diff for duplicates of <200812022102.14690.bzolnier@gmail.com> diff --git a/a/1.txt b/N1/1.txt index 9f92386..d154ae6 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,251 +1,17 @@ -* amd74xx host driver fix for nVidia controllers (this should take - care of most bugreports about ATAPI devices not working properly) - - [ libata developers are encouraged to copy the fix to pata_amd - (the issue manifests itself with pata_amd reporting diagnostics - failure on good devices) ] - +* amd74xx host driver fix for nVidia controllers (this should take care of most bugreports about ATAPI devices not working properly) + [ libata developers are encouraged to copy the fix to pata_amd (the issue manifests itself with pata_amd reporting diagnostics failure on good devices) ] * quirk for SAMSUNG SP0822N with firmware WA100-10 to allow UDMA > 33 - * fix ide_release_lock imbalance for Atari (from Michael Schmitz) - + few misc fixes - Linus, please pull from: - master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git/ - to receive the following updates: + drivers/ide/alim15x3.c | 2 +- drivers/ide/amd74xx.c | 11 ++++++++++- drivers/ide/ide-io.c | 30 ++++++++++++++---------------- drivers/ide/ide-iops.c | 9 +++------ drivers/ide/ide-probe.c | 3 ++- include/linux/ide.h | 8 ++++++++ 6 files changed, 38 insertions(+), 25 deletions(-) - drivers/ide/alim15x3.c | 2 +- - drivers/ide/amd74xx.c | 11 ++++++++++- - drivers/ide/ide-io.c | 30 ++++++++++++++---------------- - drivers/ide/ide-iops.c | 9 +++------ - drivers/ide/ide-probe.c | 3 ++- - include/linux/ide.h | 8 ++++++++ - 6 files changed, 38 insertions(+), 25 deletions(-) - - -Bartlomiej Zolnierkiewicz (5): - amd74xx: workaround unreliable AltStatus register for nVidia controllers - ide: add SAMSUNG SP0822N with firmware WA100-10 to ivb_list[] - ide: respect current DMA setting during resume - ide: fix build for DEBUG_PM - ide: remove dead code from drive_is_ready() - -Hannes Eder (1): - alim15x3: fix sparse warning - -Michael Schmitz (1): - ide: fix the ide_release_lock imbalance - +Bartlomiej Zolnierkiewicz (5): amd74xx: workaround unreliable AltStatus register for nVidia controllers ide: add SAMSUNG SP0822N with firmware WA100-10 to ivb_list[] ide: respect current DMA setting during resume ide: fix build for DEBUG_PM ide: remove dead code from drive_is_ready() +Hannes Eder (1): alim15x3: fix sparse warning +Michael Schmitz (1): ide: fix the ide_release_lock imbalance -diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c -index e56c7b7..45d2356 100644 ---- a/drivers/ide/alim15x3.c -+++ b/drivers/ide/alim15x3.c -@@ -591,7 +591,7 @@ static int __init ali15x3_ide_init(void) - - static void __exit ali15x3_ide_exit(void) - { -- return pci_unregister_driver(&alim15x3_pci_driver); -+ pci_unregister_driver(&alim15x3_pci_driver); - } - - module_init(ali15x3_ide_init); -diff --git a/drivers/ide/amd74xx.c b/drivers/ide/amd74xx.c -index 81ec731..c6bcd30 100644 ---- a/drivers/ide/amd74xx.c -+++ b/drivers/ide/amd74xx.c -@@ -3,7 +3,7 @@ - * IDE driver for Linux. - * - * Copyright (c) 2000-2002 Vojtech Pavlik -- * Copyright (c) 2007 Bartlomiej Zolnierkiewicz -+ * Copyright (c) 2007-2008 Bartlomiej Zolnierkiewicz - * - * Based on the work of: - * Andre Hedrick -@@ -263,6 +263,15 @@ static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_ - d.udma_mask = ATA_UDMA5; - } - -+ /* -+ * It seems that on some nVidia controllers using AltStatus -+ * register can be unreliable so default to Status register -+ * if the device is in Compatibility Mode. -+ */ -+ if (dev->vendor == PCI_VENDOR_ID_NVIDIA && -+ ide_pci_is_in_compatibility_mode(dev)) -+ d.host_flags |= IDE_HFLAG_BROKEN_ALTSTATUS; -+ - printk(KERN_INFO "%s %s: UDMA%s controller\n", - d.name, pci_name(dev), amd_dma[fls(d.udma_mask) - 1]); - -diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c -index 7162d67..7d275b2 100644 ---- a/drivers/ide/ide-io.c -+++ b/drivers/ide/ide-io.c -@@ -132,10 +132,14 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors) - } - EXPORT_SYMBOL(ide_end_request); - --static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 stat, u8 error) -+static void ide_complete_power_step(ide_drive_t *drive, struct request *rq) - { - struct request_pm_state *pm = rq->data; - -+#ifdef DEBUG_PM -+ printk(KERN_INFO "%s: complete_power_step(step: %d)\n", -+ drive->name, pm->pm_step); -+#endif - if (drive->media != ide_disk) - return; - -@@ -172,7 +176,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * - /* Not supported? Switch to next step now. */ - if (ata_id_flush_enabled(drive->id) == 0 || - (drive->dev_flags & IDE_DFLAG_WCACHE) == 0) { -- ide_complete_power_step(drive, rq, 0, 0); -+ ide_complete_power_step(drive, rq); - return ide_stopped; - } - if (ata_id_flush_ext_enabled(drive->id)) -@@ -191,7 +195,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * - if (drive->media != ide_disk) - pm->pm_step = IDE_PM_RESTORE_DMA; - else -- ide_complete_power_step(drive, rq, 0, 0); -+ ide_complete_power_step(drive, rq); - return ide_stopped; - case IDE_PM_IDLE: /* Resume step 2 (idle) */ - args->tf.command = ATA_CMD_IDLEIMMEDIATE; -@@ -204,10 +208,8 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * - */ - if (drive->hwif->dma_ops == NULL) - break; -- /* -- * TODO: respect IDE_DFLAG_USING_DMA -- */ -- ide_set_dma(drive); -+ if (drive->dev_flags & IDE_DFLAG_USING_DMA) -+ ide_set_dma(drive); - break; - } - -@@ -322,11 +324,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) - } - } else if (blk_pm_request(rq)) { - struct request_pm_state *pm = rq->data; --#ifdef DEBUG_PM -- printk("%s: complete_power_step(step: %d, stat: %x, err: %x)\n", -- drive->name, rq->pm->pm_step, stat, err); --#endif -- ide_complete_power_step(drive, rq, stat, err); -+ -+ ide_complete_power_step(drive, rq); - if (pm->pm_step == IDE_PM_COMPLETED) - ide_complete_pm_request(drive, rq); - return; -@@ -804,7 +803,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) - struct request_pm_state *pm = rq->data; - #ifdef DEBUG_PM - printk("%s: start_power_step(step: %d)\n", -- drive->name, rq->pm->pm_step); -+ drive->name, pm->pm_step); - #endif - startstop = ide_start_power_step(drive, rq); - if (startstop == ide_stopped && -@@ -967,14 +966,13 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq) - ide_startstop_t startstop; - int loops = 0; - -- /* for atari only: POSSIBLY BROKEN HERE(?) */ -- ide_get_lock(ide_intr, hwgroup); -- - /* caller must own ide_lock */ - BUG_ON(!irqs_disabled()); - - while (!hwgroup->busy) { - hwgroup->busy = 1; -+ /* for atari only */ -+ ide_get_lock(ide_intr, hwgroup); - drive = choose_drive(hwgroup); - if (drive == NULL) { - int sleeping = 0; -diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c -index 5d6ba14..c41c3b9 100644 ---- a/drivers/ide/ide-iops.c -+++ b/drivers/ide/ide-iops.c -@@ -457,18 +457,14 @@ int drive_is_ready (ide_drive_t *drive) - if (drive->waiting_for_dma) - return hwif->dma_ops->dma_test_irq(drive); - --#if 0 -- /* need to guarantee 400ns since last command was issued */ -- udelay(1); --#endif -- - /* - * We do a passive status test under shared PCI interrupts on - * cards that truly share the ATA side interrupt, but may also share - * an interrupt with another pci card/device. We make no assumptions - * about possible isa-pnp and pci-pnp issues yet. - */ -- if (hwif->io_ports.ctl_addr) -+ if (hwif->io_ports.ctl_addr && -+ (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) - stat = hwif->tp_ops->read_altstatus(hwif); - else - /* Note: this may clear a pending IRQ!! */ -@@ -610,6 +606,7 @@ static const struct drive_list_entry ivb_list[] = { - { "TSSTcorp CDDVDW SH-S202N" , "SB01" }, - { "TSSTcorp CDDVDW SH-S202H" , "SB00" }, - { "TSSTcorp CDDVDW SH-S202H" , "SB01" }, -+ { "SAMSUNG SP0822N" , "WA100-10" }, - { NULL , NULL } - }; - -diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c -index 1649ea5..c55bdbd 100644 ---- a/drivers/ide/ide-probe.c -+++ b/drivers/ide/ide-probe.c -@@ -266,7 +266,8 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd) - /* take a deep breath */ - msleep(50); - -- if (io_ports->ctl_addr) { -+ if (io_ports->ctl_addr && -+ (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) { - a = tp_ops->read_altstatus(hwif); - s = tp_ops->read_status(hwif); - if ((a ^ s) & ~ATA_IDX) -diff --git a/include/linux/ide.h b/include/linux/ide.h -index 54525be..010fb26 100644 ---- a/include/linux/ide.h -+++ b/include/linux/ide.h -@@ -1296,6 +1296,13 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o - #define ide_pci_register_driver(d) pci_register_driver(d) - #endif - -+static inline int ide_pci_is_in_compatibility_mode(struct pci_dev *dev) -+{ -+ if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 5) != 5) -+ return 1; -+ return 0; -+} -+ - void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, - hw_regs_t *, hw_regs_t **); - void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); -@@ -1375,6 +1382,7 @@ enum { - IDE_HFLAG_IO_32BIT = (1 << 24), - /* unmask IRQs */ - IDE_HFLAG_UNMASK_IRQS = (1 << 25), -+ IDE_HFLAG_BROKEN_ALTSTATUS = (1 << 26), - /* serialize ports if DMA is possible (for sl82c105) */ - IDE_HFLAG_SERIALIZE_DMA = (1 << 27), - /* force host out of "simplex" mode */ -\0 +diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.cindex e56c7b7..45d2356 100644--- a/drivers/ide/alim15x3.c+++ b/drivers/ide/alim15x3.c@@ -591,7 +591,7 @@ static int __init ali15x3_ide_init(void) static void __exit ali15x3_ide_exit(void) {- return pci_unregister_driver(&alim15x3_pci_driver);+ pci_unregister_driver(&alim15x3_pci_driver); } module_init(ali15x3_ide_init);diff --git a/drivers/ide/amd74xx.c b/drivers/ide/amd74xx.cindex 81ec731..c6bcd30 100644--- a/drivers/ide/amd74xx.c+++ b/drivers/ide/amd74xx.c@@ -3,7 +3,7 @@ * IDE driver for Linux. * * Copyright (c) 2000-2002 Vojtech Pavlik- * Copyright (c) 2007 Bartlomiej Zolnierkiewicz+ * Copyright (c) 2007-2008 Bartlomiej Zolnierkiewicz * * Based on the work of: * Andre Hedrick@@ -263,6 +263,15 @@ static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_ d.udma_mask = ATA_UDMA5; } + /*+ * It seems that on some nVidia controllers using AltStatus+ * register can be unreliable so default to Status register+ * if the device is in Compatibility Mode.+ */+ if (dev->vendor == PCI_VENDOR_ID_NVIDIA &&+ ide_pci_is_in_compatibility_mode(dev))+ d.host_flags |= IDE_HFLAG_BROKEN_ALTSTATUS;+ printk(KERN_INFO "%s %s: UDMA%s controller\n", d.name, pci_name(dev), amd_dma[fls(d.udma_mask) - 1]); diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.cindex 7162d67..7d275b2 100644--- a/drivers/ide/ide-io.c+++ b/drivers/ide/ide-io.c@@ -132,10 +132,14 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors) } EXPORT_SYMBOL(ide_end_request); -static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 stat, u8 error)+static void ide_complete_power_step(ide_drive_t *drive, struct request *rq) { struct request_pm_state *pm = rq->data; +#ifdef DEBUG_PM+ printk(KERN_INFO "%s: complete_power_step(step: %d)\n",+ drive->name, pm->pm_step);+#endif if (drive->media != ide_disk) return; @@ -172,7 +176,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * /* Not supported? Switch to next step now. */ if (ata_id_flush_enabled(drive->id) == 0 || (drive->dev_flags & IDE_DFLAG_WCACHE) == 0) {- ide_complete_power_step(drive, rq, 0, 0);+ ide_complete_power_step(drive, rq); return ide_stopped; } if (ata_id_flush_ext_enabled(drive->id))@@ -191,7 +195,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * if (drive->media != ide_disk) pm->pm_step = IDE_PM_RESTORE_DMA; else- ide_complete_power_step(drive, rq, 0, 0);+ ide_complete_power_step(drive, rq); return ide_stopped; case IDE_PM_IDLE: /* Resume step 2 (idle) */ args->tf.command = ATA_CMD_IDLEIMMEDIATE;@@ -204,10 +208,8 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * */ if (drive->hwif->dma_ops == NULL) break;- /*- * TODO: respect IDE_DFLAG_USING_DMA- */- ide_set_dma(drive);+ if (drive->dev_flags & IDE_DFLAG_USING_DMA)+ ide_set_dma(drive); break; } @@ -322,11 +324,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) } } else if (blk_pm_request(rq)) { struct request_pm_state *pm = rq->data;-#ifdef DEBUG_PM- printk("%s: complete_power_step(step: %d, stat: %x, err: %x)\n",- drive->name, rq->pm->pm_step, stat, err);-#endif- ide_complete_power_step(drive, rq, stat, err);++ ide_complete_power_step(drive, rq); if (pm->pm_step == IDE_PM_COMPLETED) ide_complete_pm_request(drive, rq); return;@@ -804,7 +803,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) struct request_pm_state *pm = rq->data; #ifdef DEBUG_PM printk("%s: start_power_step(step: %d)\n",- drive->name, rq->pm->pm_step);+ drive->name, pm->pm_step); #endif startstop = ide_start_power_step(drive, rq); if (startstop == ide_stopped &&@@ -967,14 +966,13 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq) ide_startstop_t startstop; int loops = 0; - /* for atari only: POSSIBLY BROKEN HERE(?) */- ide_get_lock(ide_intr, hwgroup);- /* caller must own ide_lock */ BUG_ON(!irqs_disabled()); while (!hwgroup->busy) { hwgroup->busy = 1;+ /* for atari only */+ ide_get_lock(ide_intr, hwgroup); drive = choose_drive(hwgroup); if (drive == NULL) { int sleeping = 0;diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.cindex 5d6ba14..c41c3b9 100644--- a/drivers/ide/ide-iops.c+++ b/drivers/ide/ide-iops.c@@ -457,18 +457,14 @@ int drive_is_ready (ide_drive_t *drive) if (drive->waiting_for_dma) return hwif->dma_ops->dma_test_irq(drive); -#if 0- /* need to guarantee 400ns since last command was issued */- udelay(1);-#endif- /* * We do a passive status test under shared PCI interrupts on * cards that truly share the ATA side interrupt, but may also share * an interrupt with another pci card/device. We make no assumptions * about possible isa-pnp and pci-pnp issues yet. */- if (hwif->io_ports.ctl_addr)+ if (hwif->io_ports.ctl_addr &&+ (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) stat = hwif->tp_ops->read_altstatus(hwif); else /* Note: this may clear a pending IRQ!! */@@ -610,6 +606,7 @@ static const struct drive_list_entry ivb_list[] = { { "TSSTcorp CDDVDW SH-S202N" , "SB01" }, { "TSSTcorp CDDVDW SH-S202H" , "SB00" }, { "TSSTcorp CDDVDW SH-S202H" , "SB01" },+ { "SAMSUNG SP0822N" , "WA100-10" }, { NULL , NULL } }; diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.cindex 1649ea5..c55bdbd 100644--- a/drivers/ide/ide-probe.c+++ b/drivers/ide/ide-probe.c@@ -266,7 +266,8 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd) /* take a deep breath */ msleep(50); - if (io_ports->ctl_addr) {+ if (io_ports->ctl_addr &&+ (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) { a = tp_ops->read_altstatus(hwif); s = tp_ops->read_status(hwif); if ((a ^ s) & ~ATA_IDX)diff --git a/include/linux/ide.h b/include/linux/ide.hindex 54525be..010fb26 100644--- a/include/linux/ide.h+++ b/include/linux/ide.h@@ -1296,6 +1296,13 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o #define ide_pci_register_driver(d) pci_register_driver(d) #endif +static inline int ide_pci_is_in_compatibility_mode(struct pci_dev *dev)+{+ if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 5) != 5)+ return 1;+ return 0;+}+ void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, hw_regs_t *, hw_regs_t **); void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);@@ -1375,6 +1382,7 @@ enum { IDE_HFLAG_IO_32BIT = (1 << 24), /* unmask IRQs */ IDE_HFLAG_UNMASK_IRQS = (1 << 25),+ IDE_HFLAG_BROKEN_ALTSTATUS = (1 << 26), /* serialize ports if DMA is possible (for sl82c105) */ IDE_HFLAG_SERIALIZE_DMA = (1 << 27), /* force host out of "simplex" mode */\0ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥ diff --git a/a/content_digest b/N1/content_digest index b687690..3e1f9d4 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -9,255 +9,21 @@ "\00:1\0" "b\0" "\n" - "* amd74xx host driver fix for nVidia controllers (this should take\n" - " care of most bugreports about ATAPI devices not working properly) \n" - "\n" - " [ libata developers are encouraged to copy the fix to pata_amd\n" - " (the issue manifests itself with pata_amd reporting diagnostics\n" - " failure on good devices) ]\n" - "\n" + "* amd74xx host driver fix for nVidia controllers (this should take care of most bugreports about ATAPI devices not working properly) \n" + " [ libata developers are encouraged to copy the fix to pata_amd (the issue manifests itself with pata_amd reporting diagnostics failure on good devices) ]\n" "* quirk for SAMSUNG SP0822N with firmware WA100-10 to allow UDMA > 33\n" - "\n" "* fix ide_release_lock imbalance for Atari (from Michael Schmitz)\n" - "\n" "+ few misc fixes\n" "\n" - "\n" "Linus, please pull from:\n" - "\n" "master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git/\n" - "\n" "to receive the following updates:\n" + " drivers/ide/alim15x3.c | 2 +- drivers/ide/amd74xx.c | 11 ++++++++++- drivers/ide/ide-io.c | 30 ++++++++++++++---------------- drivers/ide/ide-iops.c | 9 +++------ drivers/ide/ide-probe.c | 3 ++- include/linux/ide.h | 8 ++++++++ 6 files changed, 38 insertions(+), 25 deletions(-)\n" "\n" - " drivers/ide/alim15x3.c | 2 +-\n" - " drivers/ide/amd74xx.c | 11 ++++++++++-\n" - " drivers/ide/ide-io.c | 30 ++++++++++++++----------------\n" - " drivers/ide/ide-iops.c | 9 +++------\n" - " drivers/ide/ide-probe.c | 3 ++-\n" - " include/linux/ide.h | 8 ++++++++\n" - " 6 files changed, 38 insertions(+), 25 deletions(-)\n" - "\n" - "\n" - "Bartlomiej Zolnierkiewicz (5):\n" - " amd74xx: workaround unreliable AltStatus register for nVidia controllers\n" - " ide: add SAMSUNG SP0822N with firmware WA100-10 to ivb_list[]\n" - " ide: respect current DMA setting during resume\n" - " ide: fix build for DEBUG_PM\n" - " ide: remove dead code from drive_is_ready()\n" - "\n" - "Hannes Eder (1):\n" - " alim15x3: fix sparse warning\n" - "\n" - "Michael Schmitz (1):\n" - " ide: fix the ide_release_lock imbalance\n" - "\n" + "Bartlomiej Zolnierkiewicz (5): amd74xx: workaround unreliable AltStatus register for nVidia controllers ide: add SAMSUNG SP0822N with firmware WA100-10 to ivb_list[] ide: respect current DMA setting during resume ide: fix build for DEBUG_PM ide: remove dead code from drive_is_ready()\n" + "Hannes Eder (1): alim15x3: fix sparse warning\n" + "Michael Schmitz (1): ide: fix the ide_release_lock imbalance\n" "\n" - "diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c\n" - "index e56c7b7..45d2356 100644\n" - "--- a/drivers/ide/alim15x3.c\n" - "+++ b/drivers/ide/alim15x3.c\n" - "@@ -591,7 +591,7 @@ static int __init ali15x3_ide_init(void)\n" - " \n" - " static void __exit ali15x3_ide_exit(void)\n" - " {\n" - "-\treturn pci_unregister_driver(&alim15x3_pci_driver);\n" - "+\tpci_unregister_driver(&alim15x3_pci_driver);\n" - " }\n" - " \n" - " module_init(ali15x3_ide_init);\n" - "diff --git a/drivers/ide/amd74xx.c b/drivers/ide/amd74xx.c\n" - "index 81ec731..c6bcd30 100644\n" - "--- a/drivers/ide/amd74xx.c\n" - "+++ b/drivers/ide/amd74xx.c\n" - "@@ -3,7 +3,7 @@\n" - " * IDE driver for Linux.\n" - " *\n" - " * Copyright (c) 2000-2002 Vojtech Pavlik\n" - "- * Copyright (c) 2007 Bartlomiej Zolnierkiewicz\n" - "+ * Copyright (c) 2007-2008 Bartlomiej Zolnierkiewicz\n" - " *\n" - " * Based on the work of:\n" - " * Andre Hedrick\n" - "@@ -263,6 +263,15 @@ static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_\n" - " \t\t\td.udma_mask = ATA_UDMA5;\n" - " \t}\n" - " \n" - "+\t/*\n" - "+\t * It seems that on some nVidia controllers using AltStatus\n" - "+\t * register can be unreliable so default to Status register\n" - "+\t * if the device is in Compatibility Mode.\n" - "+\t */\n" - "+\tif (dev->vendor == PCI_VENDOR_ID_NVIDIA &&\n" - "+\t ide_pci_is_in_compatibility_mode(dev))\n" - "+\t\td.host_flags |= IDE_HFLAG_BROKEN_ALTSTATUS;\n" - "+\n" - " \tprintk(KERN_INFO \"%s %s: UDMA%s controller\\n\",\n" - " \t\td.name, pci_name(dev), amd_dma[fls(d.udma_mask) - 1]);\n" - " \n" - "diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c\n" - "index 7162d67..7d275b2 100644\n" - "--- a/drivers/ide/ide-io.c\n" - "+++ b/drivers/ide/ide-io.c\n" - "@@ -132,10 +132,14 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors)\n" - " }\n" - " EXPORT_SYMBOL(ide_end_request);\n" - " \n" - "-static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 stat, u8 error)\n" - "+static void ide_complete_power_step(ide_drive_t *drive, struct request *rq)\n" - " {\n" - " \tstruct request_pm_state *pm = rq->data;\n" - " \n" - "+#ifdef DEBUG_PM\n" - "+\tprintk(KERN_INFO \"%s: complete_power_step(step: %d)\\n\",\n" - "+\t\tdrive->name, pm->pm_step);\n" - "+#endif\n" - " \tif (drive->media != ide_disk)\n" - " \t\treturn;\n" - " \n" - "@@ -172,7 +176,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *\n" - " \t\t/* Not supported? Switch to next step now. */\n" - " \t\tif (ata_id_flush_enabled(drive->id) == 0 ||\n" - " \t\t (drive->dev_flags & IDE_DFLAG_WCACHE) == 0) {\n" - "-\t\t\tide_complete_power_step(drive, rq, 0, 0);\n" - "+\t\t\tide_complete_power_step(drive, rq);\n" - " \t\t\treturn ide_stopped;\n" - " \t\t}\n" - " \t\tif (ata_id_flush_ext_enabled(drive->id))\n" - "@@ -191,7 +195,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *\n" - " \t\tif (drive->media != ide_disk)\n" - " \t\t\tpm->pm_step = IDE_PM_RESTORE_DMA;\n" - " \t\telse\n" - "-\t\t\tide_complete_power_step(drive, rq, 0, 0);\n" - "+\t\t\tide_complete_power_step(drive, rq);\n" - " \t\treturn ide_stopped;\n" - " \tcase IDE_PM_IDLE:\t\t/* Resume step 2 (idle) */\n" - " \t\targs->tf.command = ATA_CMD_IDLEIMMEDIATE;\n" - "@@ -204,10 +208,8 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *\n" - " \t\t */\n" - " \t\tif (drive->hwif->dma_ops == NULL)\n" - " \t\t\tbreak;\n" - "-\t\t/*\n" - "-\t\t * TODO: respect IDE_DFLAG_USING_DMA\n" - "-\t\t */\n" - "-\t\tide_set_dma(drive);\n" - "+\t\tif (drive->dev_flags & IDE_DFLAG_USING_DMA)\n" - "+\t\t\tide_set_dma(drive);\n" - " \t\tbreak;\n" - " \t}\n" - " \n" - "@@ -322,11 +324,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)\n" - " \t\t}\n" - " \t} else if (blk_pm_request(rq)) {\n" - " \t\tstruct request_pm_state *pm = rq->data;\n" - "-#ifdef DEBUG_PM\n" - "-\t\tprintk(\"%s: complete_power_step(step: %d, stat: %x, err: %x)\\n\",\n" - "-\t\t\tdrive->name, rq->pm->pm_step, stat, err);\n" - "-#endif\n" - "-\t\tide_complete_power_step(drive, rq, stat, err);\n" - "+\n" - "+\t\tide_complete_power_step(drive, rq);\n" - " \t\tif (pm->pm_step == IDE_PM_COMPLETED)\n" - " \t\t\tide_complete_pm_request(drive, rq);\n" - " \t\treturn;\n" - "@@ -804,7 +803,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)\n" - " \t\t\tstruct request_pm_state *pm = rq->data;\n" - " #ifdef DEBUG_PM\n" - " \t\t\tprintk(\"%s: start_power_step(step: %d)\\n\",\n" - "-\t\t\t\tdrive->name, rq->pm->pm_step);\n" - "+\t\t\t\tdrive->name, pm->pm_step);\n" - " #endif\n" - " \t\t\tstartstop = ide_start_power_step(drive, rq);\n" - " \t\t\tif (startstop == ide_stopped &&\n" - "@@ -967,14 +966,13 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq)\n" - " \tide_startstop_t\tstartstop;\n" - " \tint loops = 0;\n" - " \n" - "-\t/* for atari only: POSSIBLY BROKEN HERE(?) */\n" - "-\tide_get_lock(ide_intr, hwgroup);\n" - "-\n" - " \t/* caller must own ide_lock */\n" - " \tBUG_ON(!irqs_disabled());\n" - " \n" - " \twhile (!hwgroup->busy) {\n" - " \t\thwgroup->busy = 1;\n" - "+\t\t/* for atari only */\n" - "+\t\tide_get_lock(ide_intr, hwgroup);\n" - " \t\tdrive = choose_drive(hwgroup);\n" - " \t\tif (drive == NULL) {\n" - " \t\t\tint sleeping = 0;\n" - "diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c\n" - "index 5d6ba14..c41c3b9 100644\n" - "--- a/drivers/ide/ide-iops.c\n" - "+++ b/drivers/ide/ide-iops.c\n" - "@@ -457,18 +457,14 @@ int drive_is_ready (ide_drive_t *drive)\n" - " \tif (drive->waiting_for_dma)\n" - " \t\treturn hwif->dma_ops->dma_test_irq(drive);\n" - " \n" - "-#if 0\n" - "-\t/* need to guarantee 400ns since last command was issued */\n" - "-\tudelay(1);\n" - "-#endif\n" - "-\n" - " \t/*\n" - " \t * We do a passive status test under shared PCI interrupts on\n" - " \t * cards that truly share the ATA side interrupt, but may also share\n" - " \t * an interrupt with another pci card/device. We make no assumptions\n" - " \t * about possible isa-pnp and pci-pnp issues yet.\n" - " \t */\n" - "-\tif (hwif->io_ports.ctl_addr)\n" - "+\tif (hwif->io_ports.ctl_addr &&\n" - "+\t (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0)\n" - " \t\tstat = hwif->tp_ops->read_altstatus(hwif);\n" - " \telse\n" - " \t\t/* Note: this may clear a pending IRQ!! */\n" - "@@ -610,6 +606,7 @@ static const struct drive_list_entry ivb_list[] = {\n" - " \t{ \"TSSTcorp CDDVDW SH-S202N\"\t, \"SB01\"\t},\n" - " \t{ \"TSSTcorp CDDVDW SH-S202H\"\t, \"SB00\"\t},\n" - " \t{ \"TSSTcorp CDDVDW SH-S202H\"\t, \"SB01\"\t},\n" - "+\t{ \"SAMSUNG SP0822N\"\t\t, \"WA100-10\"\t},\n" - " \t{ NULL\t\t\t\t, NULL\t\t}\n" - " };\n" - " \n" - "diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c\n" - "index 1649ea5..c55bdbd 100644\n" - "--- a/drivers/ide/ide-probe.c\n" - "+++ b/drivers/ide/ide-probe.c\n" - "@@ -266,7 +266,8 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)\n" - " \t/* take a deep breath */\n" - " \tmsleep(50);\n" - " \n" - "-\tif (io_ports->ctl_addr) {\n" - "+\tif (io_ports->ctl_addr &&\n" - "+\t (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) {\n" - " \t\ta = tp_ops->read_altstatus(hwif);\n" - " \t\ts = tp_ops->read_status(hwif);\n" - " \t\tif ((a ^ s) & ~ATA_IDX)\n" - "diff --git a/include/linux/ide.h b/include/linux/ide.h\n" - "index 54525be..010fb26 100644\n" - "--- a/include/linux/ide.h\n" - "+++ b/include/linux/ide.h\n" - "@@ -1296,6 +1296,13 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o\n" - " #define ide_pci_register_driver(d) pci_register_driver(d)\n" - " #endif\n" - " \n" - "+static inline int ide_pci_is_in_compatibility_mode(struct pci_dev *dev)\n" - "+{\n" - "+\tif ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 5) != 5)\n" - "+\t\treturn 1;\n" - "+\treturn 0;\n" - "+}\n" - "+\n" - " void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int,\n" - " \t\t\t hw_regs_t *, hw_regs_t **);\n" - " void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);\n" - "@@ -1375,6 +1382,7 @@ enum {\n" - " \tIDE_HFLAG_IO_32BIT\t\t= (1 << 24),\n" - " \t/* unmask IRQs */\n" - " \tIDE_HFLAG_UNMASK_IRQS\t\t= (1 << 25),\n" - "+\tIDE_HFLAG_BROKEN_ALTSTATUS\t= (1 << 26),\n" - " \t/* serialize ports if DMA is possible (for sl82c105) */\n" - " \tIDE_HFLAG_SERIALIZE_DMA\t\t= (1 << 27),\n" - " \t/* force host out of \"simplex\" mode */\n" - "\0" + "diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.cindex e56c7b7..45d2356 100644--- a/drivers/ide/alim15x3.c+++ b/drivers/ide/alim15x3.c@@ -591,7 +591,7 @@ static int __init ali15x3_ide_init(void) static void __exit ali15x3_ide_exit(void) {-\treturn pci_unregister_driver(&alim15x3_pci_driver);+\tpci_unregister_driver(&alim15x3_pci_driver); } module_init(ali15x3_ide_init);diff --git a/drivers/ide/amd74xx.c b/drivers/ide/amd74xx.cindex 81ec731..c6bcd30 100644--- a/drivers/ide/amd74xx.c+++ b/drivers/ide/amd74xx.c@@ -3,7 +3,7 @@ * IDE driver for Linux. * * Copyright (c) 2000-2002 Vojtech Pavlik- * Copyright (c) 2007 Bartlomiej Zolnierkiewicz+ * Copyright (c) 2007-2008 Bartlomiej Zolnierkiewicz * * Based on the work of: * Andre Hedrick@@ -263,6 +263,15 @@ static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_ \t\t\td.udma_mask = ATA_UDMA5; \t} +\t/*+\t * It seems that on some nVidia controllers using AltStatus+\t * register can be unreliable so default to Status register+\t * if the device is in Compatibility Mode.+\t */+\tif (dev->vendor == PCI_VENDOR_ID_NVIDIA &&+\t ide_pci_is_in_compatibility_mode(dev))+\t\td.host_flags |= IDE_HFLAG_BROKEN_ALTSTATUS;+ \tprintk(KERN_INFO \"%s %s: UDMA%s controller\\n\", \t\td.name, pci_name(dev), amd_dma[fls(d.udma_mask) - 1]); diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.cindex 7162d67..7d275b2 100644--- a/drivers/ide/ide-io.c+++ b/drivers/ide/ide-io.c@@ -132,10 +132,14 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors) } EXPORT_SYMBOL(ide_end_request); -static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 stat, u8 error)+static void ide_complete_power_step(ide_drive_t *drive, struct request *rq) { \tstruct request_pm_state *pm = rq->data; +#ifdef DEBUG_PM+\tprintk(KERN_INFO \"%s: complete_power_step(step: %d)\\n\",+\t\tdrive->name, pm->pm_step);+#endif \tif (drive->media != ide_disk) \t\treturn; @@ -172,7 +176,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * \t\t/* Not supported? Switch to next step now. */ \t\tif (ata_id_flush_enabled(drive->id) == 0 || \t\t (drive->dev_flags & IDE_DFLAG_WCACHE) == 0) {-\t\t\tide_complete_power_step(drive, rq, 0, 0);+\t\t\tide_complete_power_step(drive, rq); \t\t\treturn ide_stopped; \t\t} \t\tif (ata_id_flush_ext_enabled(drive->id))@@ -191,7 +195,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * \t\tif (drive->media != ide_disk) \t\t\tpm->pm_step = IDE_PM_RESTORE_DMA; \t\telse-\t\t\tide_complete_power_step(drive, rq, 0, 0);+\t\t\tide_complete_power_step(drive, rq); \t\treturn ide_stopped; \tcase IDE_PM_IDLE:\t\t/* Resume step 2 (idle) */ \t\targs->tf.command = ATA_CMD_IDLEIMMEDIATE;@@ -204,10 +208,8 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * \t\t */ \t\tif (drive->hwif->dma_ops == NULL) \t\t\tbreak;-\t\t/*-\t\t * TODO: respect IDE_DFLAG_USING_DMA-\t\t */-\t\tide_set_dma(drive);+\t\tif (drive->dev_flags & IDE_DFLAG_USING_DMA)+\t\t\tide_set_dma(drive); \t\tbreak; \t} @@ -322,11 +324,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) \t\t} \t} else if (blk_pm_request(rq)) { \t\tstruct request_pm_state *pm = rq->data;-#ifdef DEBUG_PM-\t\tprintk(\"%s: complete_power_step(step: %d, stat: %x, err: %x)\\n\",-\t\t\tdrive->name, rq->pm->pm_step, stat, err);-#endif-\t\tide_complete_power_step(drive, rq, stat, err);++\t\tide_complete_power_step(drive, rq); \t\tif (pm->pm_step == IDE_PM_COMPLETED) \t\t\tide_complete_pm_request(drive, rq); \t\treturn;@@ -804,7 +803,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) \t\t\tstruct request_pm_state *pm = rq->data; #ifdef DEBUG_PM \t\t\tprintk(\"%s: start_power_step(step: %d)\\n\",-\t\t\t\tdrive->name, rq->pm->pm_step);+\t\t\t\tdrive->name, pm->pm_step); #endif \t\t\tstartstop = ide_start_power_step(drive, rq); \t\t\tif (startstop == ide_stopped &&@@ -967,14 +966,13 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq) \tide_startstop_t\tstartstop; \tint loops = 0; -\t/* for atari only: POSSIBLY BROKEN HERE(?) */-\tide_get_lock(ide_intr, hwgroup);- \t/* caller must own ide_lock */ \tBUG_ON(!irqs_disabled()); \twhile (!hwgroup->busy) { \t\thwgroup->busy = 1;+\t\t/* for atari only */+\t\tide_get_lock(ide_intr, hwgroup); \t\tdrive = choose_drive(hwgroup); \t\tif (drive == NULL) { \t\t\tint sleeping = 0;diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.cindex 5d6ba14..c41c3b9 100644--- a/drivers/ide/ide-iops.c+++ b/drivers/ide/ide-iops.c@@ -457,18 +457,14 @@ int drive_is_ready (ide_drive_t *drive) \tif (drive->waiting_for_dma) \t\treturn hwif->dma_ops->dma_test_irq(drive); -#if 0-\t/* need to guarantee 400ns since last command was issued */-\tudelay(1);-#endif- \t/* \t * We do a passive status test under shared PCI interrupts on \t * cards that truly share the ATA side interrupt, but may also share \t * an interrupt with another pci card/device. We make no assumptions \t * about possible isa-pnp and pci-pnp issues yet. \t */-\tif (hwif->io_ports.ctl_addr)+\tif (hwif->io_ports.ctl_addr &&+\t (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) \t\tstat = hwif->tp_ops->read_altstatus(hwif); \telse \t\t/* Note: this may clear a pending IRQ!! */@@ -610,6 +606,7 @@ static const struct drive_list_entry ivb_list[] = { \t{ \"TSSTcorp CDDVDW SH-S202N\"\t, \"SB01\"\t}, \t{ \"TSSTcorp CDDVDW SH-S202H\"\t, \"SB00\"\t}, \t{ \"TSSTcorp CDDVDW SH-S202H\"\t, \"SB01\"\t},+\t{ \"SAMSUNG SP0822N\"\t\t, \"WA100-10\"\t}, \t{ NULL\t\t\t\t, NULL\t\t} }; diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.cindex 1649ea5..c55bdbd 100644--- a/drivers/ide/ide-probe.c+++ b/drivers/ide/ide-probe.c@@ -266,7 +266,8 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd) \t/* take a deep breath */ \tmsleep(50); -\tif (io_ports->ctl_addr) {+\tif (io_ports->ctl_addr &&+\t (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) { \t\ta = tp_ops->read_altstatus(hwif); \t\ts = tp_ops->read_status(hwif); \t\tif ((a ^ s) & ~ATA_IDX)diff --git a/include/linux/ide.h b/include/linux/ide.hindex 54525be..010fb26 100644--- a/include/linux/ide.h+++ b/include/linux/ide.h@@ -1296,6 +1296,13 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o #define ide_pci_register_driver(d) pci_register_driver(d) #endif +static inline int ide_pci_is_in_compatibility_mode(struct pci_dev *dev)+{+\tif ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 5) != 5)+\t\treturn 1;+\treturn 0;+}+ void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, \t\t\t hw_regs_t *, hw_regs_t **); void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);@@ -1375,6 +1382,7 @@ enum { \tIDE_HFLAG_IO_32BIT\t\t= (1 << 24), \t/* unmask IRQs */ \tIDE_HFLAG_UNMASK_IRQS\t\t= (1 << 25),+\tIDE_HFLAG_BROKEN_ALTSTATUS\t= (1 << 26), \t/* serialize ports if DMA is possible (for sl82c105) */ \tIDE_HFLAG_SERIALIZE_DMA\t\t= (1 << 27), \t/* force host out of \"simplex\" mode */\0\303\277\303\264\303\250\302\272{.n\303\207+\302\211\302\267\302\237\302\256\302\211\302\255\302\206+%\302\212\303\213\303\277\302\261\303\251\303\235\302\266\027\302\245\302\212w\303\277\302\272{.n\303\207+\302\211\302\267\302\245\302\212{\302\261\303\276G\302\253\302\235\303\251\303\277\302\212{ay\302\272\035\303\212\302\207\303\232\302\231\303\253,j\a\302\255\302\242f\302\243\302\242\302\267h\302\232\302\217\303\257\302\201\303\252\303\277\302\221\303\252\303\247z_\303\250\302\256\003(\302\255\303\251\302\232\302\216\302\212\303\235\302\242j\"\302\235\303\272\032\302\266\033m\302\247\303\277\303\277\302\276\a\302\253\303\276G\302\253\302\235\303\251\303\277\302\242\302\270?\302\231\302\250\303\250\302\255\303\232&\302\243\303\270\302\247~\302\217\303\241\302\266iO\302\225\303\246\302\254z\302\267\302\232v\303\230^\024\004\032\302\266\033m\302\247\303\277\303\277\303\203\f\303\277\302\266\303\254\303\277\302\242\302\270?\302\226I\302\245" -a7455409734cd63323628c477715c5ed9c5e8b186c3cf0300fd9ee45d0f5197e +f281e96b4f216827bb7a6c7a510aefa63d68d4ebef3ae8f2e446415e4034ef36
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.