From 9bd27cba1aeacb6b12d05f4e5ed6361072f08fe0 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Sun, 2 Nov 2008 21:40:07 +0100 Subject: ide-cd: fix DMA alignment regression e5318b531b008c79d2a0c0df06a7b8628da38e2f ("ide: use the dma safe check for REQ_TYPE_ATA_PC") introduced a regression which caused some ATAPI drives to turn off DMA for REQ_TYPE_BLOCK_PC commands while burning and thus degrading performance and ultimately causing an excessive amount of underruns. The issue is documented also in: http://bugzilla.kernel.org/show_bug.cgi?id=11742. Signed-off-by: Borislav Petkov Cc: FUJITA Tomonori Tested-by: Valerio Passini [bart: fixup patch description per comments from Sergei Shtylyov] Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-cd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/ide') diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 48b5eda3ab4..42ab6d8715f 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -1250,7 +1250,8 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq) * separate masks. */ alignment = queue_dma_alignment(q) | q->dma_pad_mask; - if ((unsigned long)buf & alignment || rq->data_len & alignment + if ((unsigned long)buf & alignment + || rq->data_len & q->dma_pad_mask || object_is_on_stack(buf)) drive->dma = 0; } -- cgit v1.2.3 From ccd32e221c3e3797ac56305c554ad8b07c13c815 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 2 Nov 2008 21:40:08 +0100 Subject: ide: Switch to a common address Signed-off-by: Alan Cox Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/alim15x3.c | 2 +- drivers/ide/hpt366.c | 2 +- drivers/ide/ide-disk.c | 2 +- drivers/ide/ide-iops.c | 2 +- drivers/ide/ide-pci-generic.c | 2 +- drivers/ide/ide-proc.c | 2 +- drivers/ide/it821x.c | 2 +- drivers/ide/jmicron.c | 2 +- drivers/ide/piix.c | 2 +- drivers/ide/scc_pata.c | 2 +- drivers/ide/siimage.c | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c index daf9dce39e5..e56c7b72f9e 100644 --- a/drivers/ide/alim15x3.c +++ b/drivers/ide/alim15x3.c @@ -5,7 +5,7 @@ * * Copyright (C) 1998-2000 Andre Hedrick (andre@linux-ide.org) * May be copied or modified under the terms of the GNU General Public License - * Copyright (C) 2002 Alan Cox + * Copyright (C) 2002 Alan Cox * ALi (now ULi M5228) support by Clear Zhang * Copyright (C) 2007 MontaVista Software, Inc. * Copyright (C) 2007 Bartlomiej Zolnierkiewicz diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c index a7909e9c720..f5afd46ed51 100644 --- a/drivers/ide/hpt366.c +++ b/drivers/ide/hpt366.c @@ -52,7 +52,7 @@ * different clocks on read/write. This requires overloading rw_disk and * other deeply crazy things. Thanks to for * keeping me sane. - * Alan Cox + * Alan Cox * * - fix the clock turnaround code: it was writing to the wrong ports when * called for the secondary channel, caching the current clock mode per- diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index e5adebe8ac2..eb9fac4d0f0 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -2,7 +2,7 @@ * Copyright (C) 1994-1998 Linus Torvalds & authors (see below) * Copyright (C) 1998-2002 Linux ATA Development * Andre Hedrick - * Copyright (C) 2003 Red Hat + * Copyright (C) 2003 Red Hat * Copyright (C) 2003-2005, 2007 Bartlomiej Zolnierkiewicz */ diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index bb7a1ed8094..5d6ba14e211 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2000-2002 Andre Hedrick - * Copyright (C) 2003 Red Hat + * Copyright (C) 2003 Red Hat * */ diff --git a/drivers/ide/ide-pci-generic.c b/drivers/ide/ide-pci-generic.c index 474f96a7c07..bddae2b329a 100644 --- a/drivers/ide/ide-pci-generic.c +++ b/drivers/ide/ide-pci-generic.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2001-2002 Andre Hedrick - * Portions (C) Copyright 2002 Red Hat Inc + * Portions (C) Copyright 2002 Red Hat Inc * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index c31d0dd7a53..f3cddd1b2f8 100644 --- a/drivers/ide/ide-proc.c +++ b/drivers/ide/ide-proc.c @@ -1,6 +1,6 @@ /* * Copyright (C) 1997-1998 Mark Lord - * Copyright (C) 2003 Red Hat + * Copyright (C) 2003 Red Hat * * Some code was moved here from ide.c, see it for original copyrights. */ diff --git a/drivers/ide/it821x.c b/drivers/ide/it821x.c index 995e18bb313..ef004089761 100644 --- a/drivers/ide/it821x.c +++ b/drivers/ide/it821x.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004 Red Hat + * Copyright (C) 2004 Red Hat * Copyright (C) 2007 Bartlomiej Zolnierkiewicz * * May be copied or modified under the terms of the GNU General Public License diff --git a/drivers/ide/jmicron.c b/drivers/ide/jmicron.c index 9a68433cf46..bf2be6431b2 100644 --- a/drivers/ide/jmicron.c +++ b/drivers/ide/jmicron.c @@ -1,6 +1,6 @@ /* - * Copyright (C) 2006 Red Hat + * Copyright (C) 2006 Red Hat * * May be copied or modified under the terms of the GNU General Public License */ diff --git a/drivers/ide/piix.c b/drivers/ide/piix.c index d63f9fdca76..61d2d920a5c 100644 --- a/drivers/ide/piix.c +++ b/drivers/ide/piix.c @@ -1,7 +1,7 @@ /* * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer * Copyright (C) 1998-2000 Andre Hedrick - * Copyright (C) 2003 Red Hat Inc + * Copyright (C) 2003 Red Hat * Copyright (C) 2006-2007 MontaVista Software, Inc. * * May be copied or modified under the terms of the GNU General Public License diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c index f26aa5d54ef..0f48f9dacfa 100644 --- a/drivers/ide/scc_pata.c +++ b/drivers/ide/scc_pata.c @@ -5,7 +5,7 @@ * * This code is based on drivers/ide/pci/siimage.c: * Copyright (C) 2001-2002 Andre Hedrick - * Copyright (C) 2003 Red Hat + * Copyright (C) 2003 Red Hat * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/drivers/ide/siimage.c b/drivers/ide/siimage.c index c3107df7773..7d622d20bc4 100644 --- a/drivers/ide/siimage.c +++ b/drivers/ide/siimage.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2001-2002 Andre Hedrick - * Copyright (C) 2003 Red Hat + * Copyright (C) 2003 Red Hat * Copyright (C) 2007-2008 MontaVista Software, Inc. * Copyright (C) 2007-2008 Bartlomiej Zolnierkiewicz * -- cgit v1.2.3 From 630a8b2500c8d04e87e597c4afa5e1fafff04591 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Sun, 2 Nov 2008 21:40:09 +0100 Subject: tx4938ide: Check minimum cycle time and SHWT range (v2) SHWT value is used as address valid to -CSx assertion and -CSx to -DIOx assertion setup time, and contrarywise, -DIOx to -CSx release and -CSx release to address invalid hold time, so it actualy applies 4 times and so constitutes -DIOx recovery time. Check requirement of the recovery time and cycle time. Also check SHWT maximum value. Suggested-by: Sergei Shtylyov Signed-off-by: Atsushi Nemoto Cc: ralf@linux-mips.org Acked-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/tx4938ide.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'drivers/ide') diff --git a/drivers/ide/tx4938ide.c b/drivers/ide/tx4938ide.c index fa660f931a1..9c518e72270 100644 --- a/drivers/ide/tx4938ide.c +++ b/drivers/ide/tx4938ide.c @@ -39,10 +39,17 @@ static void tx4938ide_tune_ebusc(unsigned int ebus_ch, /* Address-valid to DIOR/DIOW setup */ shwt = DIV_ROUND_UP(t->setup, cycle); + /* -DIOx recovery time (SHWT * 4) and cycle time requirement */ + while ((shwt * 4 + wt + (wt ? 2 : 3)) * cycle < t->cycle) + shwt++; + if (shwt > 7) { + pr_warning("tx4938ide: SHWT violation (%d)\n", shwt); + shwt = 7; + } pr_debug("tx4938ide: ebus %d, bus cycle %dns, WT %d, SHWT %d\n", ebus_ch, cycle, wt, shwt); - __raw_writeq((cr & ~(0x3f007ull)) | (wt << 12) | shwt, + __raw_writeq((cr & ~0x3f007ull) | (wt << 12) | shwt, &tx4938_ebuscptr->cr[ebus_ch]); } -- cgit v1.2.3 From 9d4eb0a33e620a85e36f66cf895d2bea6d556eac Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Sun, 2 Nov 2008 21:40:09 +0100 Subject: tx4938ide: Do not call devm_ioremap for whole 128KB Call devm_ioremap() for CS0 and CS1 separetely. And some style cleanups. Suggested-by: Sergei Shtylyov Signed-off-by: Atsushi Nemoto Cc: ralf@linux-mips.org Acked-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/tx4938ide.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/tx4938ide.c b/drivers/ide/tx4938ide.c index 9c518e72270..796289cf97e 100644 --- a/drivers/ide/tx4938ide.c +++ b/drivers/ide/tx4938ide.c @@ -235,7 +235,7 @@ static int __init tx4938ide_probe(struct platform_device *pdev) struct resource *res; struct tx4938ide_platform_info *pdata = pdev->dev.platform_data; int irq, ret, i; - unsigned long mapbase; + unsigned long mapbase, mapctl; struct ide_port_info d = tx4938ide_port_info; irq = platform_get_irq(pdev, 0); @@ -249,38 +249,43 @@ static int __init tx4938ide_probe(struct platform_device *pdev) res->end - res->start + 1, "tx4938ide")) return -EBUSY; mapbase = (unsigned long)devm_ioremap(&pdev->dev, res->start, - res->end - res->start + 1); - if (!mapbase) + 8 << pdata->ioport_shift); + mapctl = (unsigned long)devm_ioremap(&pdev->dev, + res->start + 0x10000 + + (6 << pdata->ioport_shift), + 1 << pdata->ioport_shift); + if (!mapbase || !mapctl) return -EBUSY; memset(&hw, 0, sizeof(hw)); if (pdata->ioport_shift) { unsigned long port = mapbase; + unsigned long ctl = mapctl; hw.io_ports_array[0] = port; #ifdef __BIG_ENDIAN port++; + ctl++; #endif for (i = 1; i <= 7; i++) hw.io_ports_array[i] = port + (i << pdata->ioport_shift); - hw.io_ports.ctl_addr = - port + 0x10000 + (6 << pdata->ioport_shift); + hw.io_ports.ctl_addr = ctl; } else - ide_std_init_ports(&hw, mapbase, mapbase + 0x10006); + ide_std_init_ports(&hw, mapbase, mapctl); hw.irq = irq; hw.dev = &pdev->dev; - pr_info("TX4938 IDE interface (base %#lx, irq %d)\n", mapbase, hw.irq); + pr_info("TX4938 IDE interface (base %#lx, ctl %#lx, irq %d)\n", + mapbase, mapctl, hw.irq); if (pdata->gbus_clock) tx4938ide_tune_ebusc(pdata->ebus_ch, pdata->gbus_clock, 0); else d.port_ops = NULL; ret = ide_host_add(&d, hws, &host); - if (ret) - return ret; - platform_set_drvdata(pdev, host); - return 0; + if (!ret) + platform_set_drvdata(pdev, host); + return ret; } static int __exit tx4938ide_remove(struct platform_device *pdev) -- cgit v1.2.3 From 7afa05350c42d8427f2d8f6112b64ab0812f3289 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Sun, 2 Nov 2008 21:40:10 +0100 Subject: tx4938ide: Avoid underflow on calculation of a wait cycle Make 'wt' variable signed while it can be negative during calculation. Suggested-by: Sergei Shtylyov Signed-off-by: Atsushi Nemoto Cc: sshtylyov@ru.mvista.com Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/tx4938ide.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/tx4938ide.c b/drivers/ide/tx4938ide.c index 796289cf97e..9120063e8f8 100644 --- a/drivers/ide/tx4938ide.c +++ b/drivers/ide/tx4938ide.c @@ -26,12 +26,13 @@ static void tx4938ide_tune_ebusc(unsigned int ebus_ch, unsigned int sp = (cr >> 4) & 3; unsigned int clock = gbus_clock / (4 - sp); unsigned int cycle = 1000000000 / clock; - unsigned int wt, shwt; + unsigned int shwt; + int wt; /* Minimum DIOx- active time */ wt = DIV_ROUND_UP(t->act8b, cycle) - 2; /* IORDY setup time: 35ns */ - wt = max(wt, DIV_ROUND_UP(35, cycle)); + wt = max_t(int, wt, DIV_ROUND_UP(35, cycle)); /* actual wait-cycle is max(wt & ~1, 1) */ if (wt > 2 && (wt & 1)) wt++; -- cgit v1.2.3 From 52ebb438e952c674e5a5c131292589db9bcf169b Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Sun, 2 Nov 2008 21:40:10 +0100 Subject: ide-gd: re-get capacity on revalidate We need to re-get a removable media's capacity when revalidating the disk so that its partitions get rescanned by the block layer. Signed-off-by: Borislav Petkov Cc: Tejun Heo Cc: axboe@kernel.dk Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-gd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drivers/ide') diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c index 7b666285437..b8078b3231f 100644 --- a/drivers/ide/ide-gd.c +++ b/drivers/ide/ide-gd.c @@ -281,7 +281,12 @@ static int ide_gd_media_changed(struct gendisk *disk) static int ide_gd_revalidate_disk(struct gendisk *disk) { struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); - set_capacity(disk, ide_gd_capacity(idkp->drive)); + ide_drive_t *drive = idkp->drive; + + if (ide_gd_media_changed(disk)) + drive->disk_ops->get_capacity(drive); + + set_capacity(disk, ide_gd_capacity(drive)); return 0; } -- cgit v1.2.3 From 980fc29f20f5cfb8cef29ddfccecb685f299ada4 Mon Sep 17 00:00:00 2001 From: Marc Pignat Date: Thu, 6 Nov 2008 11:44:34 +0100 Subject: pcmcia: add another pata/ide ID Support for Apacer photo steno pro card. Signed-off-by: Marc Pignat Signed-off-by: Dominik Brodowski CC: Alan Cox Date: Sat, 22 Nov 2008 17:34:34 +0000 Subject: icside section warnings icside_register_v[56] is called from (__devinit) icside_probe Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/ide/icside.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/icside.c b/drivers/ide/icside.c index 2d848010499..81f70caeb40 100644 --- a/drivers/ide/icside.c +++ b/drivers/ide/icside.c @@ -419,7 +419,7 @@ static void icside_setup_ports(hw_regs_t *hw, void __iomem *base, hw->chipset = ide_acorn; } -static int __init +static int __devinit icside_register_v5(struct icside_state *state, struct expansion_card *ec) { void __iomem *base; @@ -473,7 +473,7 @@ static const struct ide_port_info icside_v6_port_info __initdata = { .swdma_mask = ATA_SWDMA2, }; -static int __init +static int __devinit icside_register_v6(struct icside_state *state, struct expansion_card *ec) { void __iomem *ioc_base, *easi_base; -- cgit v1.2.3 From f9e3326dce0ef117308872cd234b903aa19aa40f Mon Sep 17 00:00:00 2001 From: Michael Schmitz Date: Tue, 2 Dec 2008 20:40:02 +0100 Subject: ide: fix the ide_release_lock imbalance ide_release_lock() spits out lots of: ide_release_lock: bug warnings on Atari Falcon. Fix the ide_release_lock imbalance. Signed-off-by: Michael Schmitz Cc: Geert Uytterhoeven Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-io.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 7162d67562a..0be7c4eb11c 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -967,14 +967,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; -- cgit v1.2.3 From 6636487e8dc49a1c43fed336bdc4a2f3d7ce6881 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 2 Dec 2008 20:40:03 +0100 Subject: amd74xx: workaround unreliable AltStatus register for nVidia controllers It seems that on some nVidia controllers using AltStatus register can be unreliable so default to Status register if the PCI device is in Compatibility Mode. In order to achieve this: * Add ide_pci_is_in_compatibility_mode() inline helper to . * Add IDE_HFLAG_BROKEN_ALTSTATUS host flag and set it in amd74xx host driver for nVidia controllers in Compatibility Mode. * Teach actual_try_to_identify() and drive_is_ready() about the new flag. This fixes the regression caused by removal of CONFIG_IDEPCI_SHARE_IRQ config option in 2.6.25 and using AltStatus register unconditionally when available (kernel.org bugs #11659 and #10216). [ Moreover for CONFIG_IDEPCI_SHARE_IRQ=y (which is what most people and distributions use) it never worked correctly. ] Thanks to Remy LABENE and Lars Winterfeld for help with debugging the problem. More info at: http://bugzilla.kernel.org/show_bug.cgi?id=11659 http://bugzilla.kernel.org/show_bug.cgi?id=10216 Reported-by: Remy LABENE Tested-by: Remy LABENE Tested-by: Lars Winterfeld Acked-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/amd74xx.c | 11 ++++++++++- drivers/ide/ide-iops.c | 3 ++- drivers/ide/ide-probe.c | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/amd74xx.c b/drivers/ide/amd74xx.c index 81ec73134ed..c6bcd3014a2 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-iops.c b/drivers/ide/ide-iops.c index 5d6ba14e211..142b9573d64 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c @@ -468,7 +468,8 @@ int drive_is_ready (ide_drive_t *drive) * 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!! */ diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 1649ea54f76..c55bdbd2231 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) -- cgit v1.2.3 From c7b997b372e8b6e7ee8d91696c74a556754f5fdb Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 2 Dec 2008 20:40:03 +0100 Subject: ide: add SAMSUNG SP0822N with firmware WA100-10 to ivb_list[] Should fix kernel.org bug #10225: http://bugzilla.kernel.org/show_bug.cgi?id=10225 Reported-by: Matthias B. Cc: Alan Cox Acked-by: Sergei Shtyltov Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-iops.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/ide') diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 142b9573d64..6f57de85dcd 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c @@ -611,6 +611,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 } }; -- cgit v1.2.3 From e9eb8388306364295308132265c00bea685f409f Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 2 Dec 2008 20:40:03 +0100 Subject: ide: respect current DMA setting during resume Respect current DMA setting during resume, otherwise PIO timings may get destroyed if host uses shared PIO/MWDMA timings. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-io.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 0be7c4eb11c..702a627b008 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -204,10 +204,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; } -- cgit v1.2.3 From 6b7d8fc36272169d1d07a07174f2c8a7909c025e Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 2 Dec 2008 20:40:03 +0100 Subject: ide: fix build for DEBUG_PM Also while at it: * Drop unused arguments from ide_complete_power_step(). * Move DEBUG_PM printk() from ide_end_drive_cmd() to ide_complete_power_step(). Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-io.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 702a627b008..7d275b2af3e 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; @@ -320,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; @@ -802,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 && -- cgit v1.2.3 From a3663801b1bb1b6f6e2be5198cc81bc16f1558fd Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 2 Dec 2008 20:40:04 +0100 Subject: ide: remove dead code from drive_is_ready() We guarantee 400ns delay at the time of issuing the command. Acked-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-iops.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 6f57de85dcd..c41c3b9b6f0 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c @@ -457,11 +457,6 @@ 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 -- cgit v1.2.3 From 95964018d53f479529dfdc2b46fe30c0a14a00e0 Mon Sep 17 00:00:00 2001 From: Hannes Eder Date: Tue, 2 Dec 2008 20:40:04 +0100 Subject: alim15x3: fix sparse warning Fix this sparse warning: drivers/ide/alim15x3.c:594:2: warning: returning void-valued expression Signed-off-by: Hannes Eder Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/alim15x3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/ide') diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c index e56c7b72f9e..45d2356bb72 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); -- cgit v1.2.3 From 1a659880ee755d96eeabe64bded059abed6d5ef5 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Mon, 8 Dec 2008 17:42:35 +0100 Subject: Revert "ide: respect current DMA setting during resume" This reverts commit e9eb8388306364295308132265c00bea685f409f since it could break resume (thanks to Paul Collins for the report). I'll look into sorting this out properly for 2.6.29 but for 2.6.28 it is the best to just revert my patch. Reported-by: Paul Collins Cc: rjw@sisk.pl Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 7d275b2af3e..cc35d6dbd41 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -208,8 +208,10 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * */ if (drive->hwif->dma_ops == NULL) break; - if (drive->dev_flags & IDE_DFLAG_USING_DMA) - ide_set_dma(drive); + /* + * TODO: respect IDE_DFLAG_USING_DMA + */ + ide_set_dma(drive); break; } -- cgit v1.2.3 From 53846574799884a04a4498f6342400d5c1423c79 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Mon, 8 Dec 2008 17:52:05 +0100 Subject: ide: build-fix for CONFIG_BLK_DEV_IDEDMA_PMAC=n IDE pmac host driver build fails with CONFIG_BLK_DEV_IDEDMA_PMAC=n as reported by Kamalesh: > drivers/ide/pmac.c: In function 'pmac_ide_set_pio_mode': > drivers/ide/pmac.c:527: error: implicit declaration of function 'kauai_lookup_timing' > drivers/ide/pmac.c:527: error: 'shasta_pio_timings' undeclared (first use in this function) > drivers/ide/pmac.c:527: error: (Each undeclared identifier is reported only once > drivers/ide/pmac.c:527: error: for each function it appears in.) > drivers/ide/pmac.c:534: error: 'kauai_pio_timings' undeclared (first use in this function) > drivers/ide/pmac.c: In function 'pmac_ide_do_resume': > drivers/ide/pmac.c:914: error: 'IDE_WAKEUP_DELAY' undeclared (first use in this function) > drivers/ide/pmac.c: At top level: > drivers/ide/pmac.c:1007: error: 'pmac_ide_init_dma' undeclared here (not in a function) > drivers/ide/pmac.c: In function 'pmac_ide_setup_device': > drivers/ide/pmac.c:1107: error: 'IDE_WAKEUP_DELAY' undeclared (first use in this function) > drivers/ide/pmac.c: In function 'pmac_ide_macio_attach': > drivers/ide/pmac.c:1209: error: 'pmac_ide_hwif_t' has no member named 'dma_regs' > drivers/ide/pmac.c:1210: error: 'pmac_ide_hwif_t' has no member named 'dma_regs' > make[2]: *** [drivers/ide/pmac.o] Error 1 Fix it by removing the superfluous config option. Reported-and-tested-by: Kamalesh Babulal Cc: Benjamin Herrenschmidt Cc: Sergei Shtylyov Cc: Stephen Rothwell Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/Kconfig | 14 +++----------- drivers/ide/pmac.c | 30 +++--------------------------- 2 files changed, 6 insertions(+), 38 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 6d7401772a8..e6857e01d1b 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig @@ -669,10 +669,12 @@ config BLK_DEV_CELLEB endif +# TODO: BLK_DEV_IDEDMA_PCI -> BLK_DEV_IDEDMA_SFF config BLK_DEV_IDE_PMAC tristate "PowerMac on-board IDE support" depends on PPC_PMAC && IDE=y select IDE_TIMINGS + select BLK_DEV_IDEDMA_PCI help This driver provides support for the on-board IDE controller on most of the recent Apple Power Macintoshes and PowerBooks. @@ -689,16 +691,6 @@ config BLK_DEV_IDE_PMAC_ATA100FIRST CD-ROM on hda. This option changes this to more natural hda for hard disk and hdc for CD-ROM. -config BLK_DEV_IDEDMA_PMAC - bool "PowerMac IDE DMA support" - depends on BLK_DEV_IDE_PMAC - select BLK_DEV_IDEDMA_PCI - help - This option allows the driver for the on-board IDE controller on - Power Macintoshes and PowerBooks to use DMA (direct memory access) - to transfer data to and from memory. Saying Y is safe and improves - performance. - config BLK_DEV_IDE_AU1XXX bool "IDE for AMD Alchemy Au1200" depends on SOC_AU1200 @@ -912,7 +904,7 @@ config BLK_DEV_UMC8672 endif config BLK_DEV_IDEDMA - def_bool BLK_DEV_IDEDMA_SFF || BLK_DEV_IDEDMA_PMAC || \ + def_bool BLK_DEV_IDEDMA_SFF || \ BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA endif # IDE diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c index 2e19d629853..7c481bb56fa 100644 --- a/drivers/ide/pmac.c +++ b/drivers/ide/pmac.c @@ -66,7 +66,6 @@ typedef struct pmac_ide_hwif { struct macio_dev *mdev; u32 timings[4]; volatile u32 __iomem * *kauai_fcr; -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC /* Those fields are duplicating what is in hwif. We currently * can't use the hwif ones because of some assumptions that are * beeing done by the generic code about the kind of dma controller @@ -74,8 +73,6 @@ typedef struct pmac_ide_hwif { */ volatile struct dbdma_regs __iomem * dma_regs; struct dbdma_cmd* dma_table_cpu; -#endif - } pmac_ide_hwif_t; enum { @@ -222,8 +219,6 @@ static const char* model_name[] = { #define KAUAI_FCR_UATA_RESET_N 0x00000002 #define KAUAI_FCR_UATA_ENABLE 0x00000001 -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC - /* Rounded Multiword DMA timings * * I gave up finding a generic formula for all controller @@ -413,8 +408,6 @@ static int pmac_ide_build_dmatable(ide_drive_t *drive, struct request *rq); static void pmac_ide_selectproc(ide_drive_t *drive); static void pmac_ide_kauai_selectproc(ide_drive_t *drive); -#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ - #define PMAC_IDE_REG(x) \ ((void __iomem *)((drive)->hwif->io_ports.data_addr + (x))) @@ -584,8 +577,6 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio) pmac_ide_do_update_timings(drive); } -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC - /* * Calculate KeyLargo ATA/66 UDMA timings */ @@ -786,7 +777,6 @@ set_timings_mdma(ide_drive_t *drive, int intf_type, u32 *timings, u32 *timings2, drive->name, speed & 0xf, *timings); #endif } -#endif /* #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC */ static void pmac_ide_set_dma_mode(ide_drive_t *drive, const u8 speed) { @@ -804,7 +794,6 @@ static void pmac_ide_set_dma_mode(ide_drive_t *drive, const u8 speed) tl[0] = *timings; tl[1] = *timings2; -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC if (speed >= XFER_UDMA_0) { if (pmif->kind == controller_kl_ata4) ret = set_timings_udma_ata4(&tl[0], speed); @@ -817,7 +806,7 @@ static void pmac_ide_set_dma_mode(ide_drive_t *drive, const u8 speed) ret = -1; } else set_timings_mdma(drive, pmif->kind, &tl[0], &tl[1], speed); -#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ + if (ret) return; @@ -1008,9 +997,7 @@ static const struct ide_port_info pmac_port_info = { .chipset = ide_pmac, .tp_ops = &pmac_tp_ops, .port_ops = &pmac_ide_port_ops, -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC .dma_ops = &pmac_dma_ops, -#endif .host_flags = IDE_HFLAG_SET_PIO_MODE_KEEP_DMA | IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_MMIO | @@ -1182,7 +1169,7 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match) pmif->regbase = regbase; pmif->irq = irq; pmif->kauai_fcr = NULL; -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC + if (macio_resource_count(mdev) >= 2) { if (macio_request_resource(mdev, 1, "ide-pmac (dma)")) printk(KERN_WARNING "ide-pmac: can't request DMA " @@ -1192,7 +1179,7 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match) pmif->dma_regs = ioremap(macio_resource_start(mdev, 1), 0x1000); } else pmif->dma_regs = NULL; -#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ + dev_set_drvdata(&mdev->ofdev.dev, pmif); memset(&hw, 0, sizeof(hw)); @@ -1300,9 +1287,7 @@ pmac_ide_pci_attach(struct pci_dev *pdev, const struct pci_device_id *id) base = ioremap(rbase, rlen); pmif->regbase = (unsigned long) base + 0x2000; -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC pmif->dma_regs = base + 0x1000; -#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ pmif->kauai_fcr = base; pmif->irq = pdev->irq; @@ -1434,8 +1419,6 @@ out: return error; } -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC - /* * pmac_ide_build_dmatable builds the DBDMA command list * for a transfer and sets the DBDMA channel to point to it. @@ -1723,13 +1706,6 @@ static int __devinit pmac_ide_init_dma(ide_hwif_t *hwif, return 0; } -#else -static int __devinit pmac_ide_init_dma(ide_hwif_t *hwif, - const struct ide_port_info *d) -{ - return -EOPNOTSUPP; -} -#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ module_init(pmac_ide_probe); -- cgit v1.2.3 From ecdbc6906e4c31bc387c64490e31ae3e0f929479 Mon Sep 17 00:00:00 2001 From: Robin Holt Date: Mon, 8 Dec 2008 15:47:20 -0800 Subject: [IA64] Clear up section mismatch for ioc4_ide_attach_one. The generic_defconfig has three section mismatches. This clears up ioc4_ide_attach_one(). Signed-off-by: Robin Holt Signed-off-by: Mike Reid Signed-off-by: Tony Luck --- drivers/ide/sgiioc4.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/sgiioc4.c b/drivers/ide/sgiioc4.c index 7defa0ae201..a687a7dfea6 100644 --- a/drivers/ide/sgiioc4.c +++ b/drivers/ide/sgiioc4.c @@ -550,7 +550,7 @@ static const struct ide_dma_ops sgiioc4_dma_ops = { .dma_timeout = ide_dma_timeout, }; -static const struct ide_port_info sgiioc4_port_info __devinitdata = { +static const struct ide_port_info sgiioc4_port_info __devinitconst = { .name = DRV_NAME, .chipset = ide_pci, .init_dma = ide_dma_sgiioc4, @@ -633,7 +633,7 @@ out: return ret; } -int +int __devinit ioc4_ide_attach_one(struct ioc4_driver_data *idd) { /* PCI-RT does not bring out IDE connection. @@ -645,7 +645,7 @@ ioc4_ide_attach_one(struct ioc4_driver_data *idd) return pci_init_sgiioc4(idd->idd_pdev); } -static struct ioc4_submodule ioc4_ide_submodule = { +static struct ioc4_submodule __devinitdata ioc4_ide_submodule = { .is_name = "IOC4_ide", .is_owner = THIS_MODULE, .is_probe = ioc4_ide_attach_one, -- cgit v1.2.3