]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 2 Nov 2008 21:32:26 +0000 (13:32 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 2 Nov 2008 21:32:26 +0000 (13:32 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6:
  ide-gd: re-get capacity on revalidate
  tx4938ide: Avoid underflow on calculation of a wait cycle
  tx4938ide: Do not call devm_ioremap for whole 128KB
  tx4938ide: Check minimum cycle time and SHWT range (v2)
  ide: Switch to a common address
  ide-cd: fix DMA alignment regression

14 files changed:
drivers/ide/alim15x3.c
drivers/ide/hpt366.c
drivers/ide/ide-cd.c
drivers/ide/ide-disk.c
drivers/ide/ide-gd.c
drivers/ide/ide-iops.c
drivers/ide/ide-pci-generic.c
drivers/ide/ide-proc.c
drivers/ide/it821x.c
drivers/ide/jmicron.c
drivers/ide/piix.c
drivers/ide/scc_pata.c
drivers/ide/siimage.c
drivers/ide/tx4938ide.c

index daf9dce39e522226a83d5433179e414b1c8a4730..e56c7b72f9e24ce592e4f776932815bf9dd5bccb 100644 (file)
@@ -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 <alan@redhat.com>
+ *  Copyright (C) 2002 Alan Cox
  *  ALi (now ULi M5228) support by Clear Zhang <Clear.Zhang@ali.com.tw>
  *  Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com>
  *  Copyright (C) 2007 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
index a7909e9c720e5741d402ceeee78b1d83322dabbe..f5afd46ed51cc80034bf2fd04ecdf6f31e2e95ab 100644 (file)
@@ -52,7 +52,7 @@
  * different clocks on read/write. This requires overloading rw_disk and
  * other deeply crazy things. Thanks to <http://www.hoerstreich.de> for
  * keeping me sane. 
- *             Alan Cox <alan@redhat.com>
+ *             Alan Cox <alan@lxorguk.ukuu.org.uk>
  *
  * - fix the clock turnaround code: it was writing to the wrong ports when
  *   called for the secondary channel, caching the current clock mode per-
index 48b5eda3ab41688e3bf65a0a9e72831fb59a92a4..42ab6d8715f26c6018201e32cace684d15d7435b 100644 (file)
@@ -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;
        }
index e5adebe8ac2c88501ff9d0e11a049a7eb530655c..eb9fac4d0f0cd3f617c7537b7c37315729679f49 100644 (file)
@@ -2,7 +2,7 @@
  *  Copyright (C) 1994-1998       Linus Torvalds & authors (see below)
  *  Copyright (C) 1998-2002       Linux ATA Development
  *                                   Andre Hedrick <andre@linux-ide.org>
- *  Copyright (C) 2003            Red Hat <alan@redhat.com>
+ *  Copyright (C) 2003            Red Hat
  *  Copyright (C) 2003-2005, 2007  Bartlomiej Zolnierkiewicz
  */
 
index 7b6662854374ceb9f2e209b3633f4d49ebaad345..b8078b3231f7f9de114affcd3b4c5ced5e436728 100644 (file)
@@ -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;
 }
 
index bb7a1ed8094e399b1860113ecbaee3ced4b5c96a..5d6ba14e211df826f794693bf0c682c59a9e4c06 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Copyright (C) 2000-2002    Andre Hedrick <andre@linux-ide.org>
- *  Copyright (C) 2003         Red Hat <alan@redhat.com>
+ *  Copyright (C) 2003         Red Hat
  *
  */
 
index 474f96a7c076a317bd29d72be1f3b181b0b50686..bddae2b329a0e35930e153386eb6c2a15099d6a9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Copyright (C) 2001-2002    Andre Hedrick <andre@linux-ide.org>
- *  Portions (C) Copyright 2002  Red Hat Inc <alan@redhat.com>
+ *  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
index c31d0dd7a5322aa56355462db58a213c3a3d9a63..f3cddd1b2f8f38b3c1a0c5f5d9c9c33f82802940 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Copyright (C) 1997-1998    Mark Lord
- *  Copyright (C) 2003         Red Hat <alan@redhat.com>
+ *  Copyright (C) 2003         Red Hat
  *
  *  Some code was moved here from ide.c, see it for original copyrights.
  */
index 995e18bb3139c55cde7bd06f4f7369c6ec3a9e70..ef004089761ba951a6294403d01eb7a4fe48ca9a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004          Red Hat <alan@redhat.com>
+ * Copyright (C) 2004          Red Hat
  * Copyright (C) 2007          Bartlomiej Zolnierkiewicz
  *
  *  May be copied or modified under the terms of the GNU General Public License
index 9a68433cf46d38e041c4f5bf9f5a8e1e6927656f..bf2be6431b204d0a593b898a58ce4286a0e3f48b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (C) 2006          Red Hat <alan@redhat.com>
+ * Copyright (C) 2006          Red Hat
  *
  *  May be copied or modified under the terms of the GNU General Public License
  */
index d63f9fdca76bce87e37f4c6604ade546be5f6ab7..61d2d920a5cd494d9d70929cd7edfe0e76b7465c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer
  *  Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org>
- *  Copyright (C) 2003 Red Hat Inc <alan@redhat.com>
+ *  Copyright (C) 2003 Red Hat
  *  Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com>
  *
  *  May be copied or modified under the terms of the GNU General Public License
index f26aa5d54efbd5c9f42a6300a3a82ea72646543d..0f48f9dacfa5e003ab307482c06ed3f9b3fdb6e9 100644 (file)
@@ -5,7 +5,7 @@
  *
  * This code is based on drivers/ide/pci/siimage.c:
  * Copyright (C) 2001-2002     Andre Hedrick <andre@linux-ide.org>
- * Copyright (C) 2003          Red Hat <alan@redhat.com>
+ * 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
index c3107df7773d170668f324aab2266bad95b75d4f..7d622d20bc4c656b6a26e5e38cc16c288e5b1a49 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2001-2002     Andre Hedrick <andre@linux-ide.org>
- * Copyright (C) 2003          Red Hat <alan@redhat.com>
+ * Copyright (C) 2003          Red Hat
  * Copyright (C) 2007-2008     MontaVista Software, Inc.
  * Copyright (C) 2007-2008     Bartlomiej Zolnierkiewicz
  *
index fa660f931a117a0477c782a57dc9af0f3aa91309..9120063e8f87d841534e93b5de7ef11f13be3ea9 100644 (file)
@@ -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++;
@@ -39,10 +40,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]);
 }
 
@@ -228,7 +236,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);
@@ -242,38 +250,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)