Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 26 Mar 2007 21:33:50 +0000 (14:33 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 26 Mar 2007 21:33:50 +0000 (14:33 -0700)
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6:
  PCI: Fix warning message in PCIE port driver
  PCI: Stop unhiding the SMBus on Toshiba laptops
  PCI: Fix up PCI power management doc
  pci: set pci=bfsort for PowerEdge R900

drivers/ide/Kconfig
drivers/ide/ide-io.c
drivers/ide/ide-iops.c
drivers/ide/ide.c
drivers/ide/pci/pdc202xx_new.c
fs/9p/v9fs_vfs.h
fs/9p/vfs_file.c
include/linux/compiler.h
include/linux/ide.h
kernel/time/clockevents.c

index 8f1fd017679b4201daafd858d3708fc171097903..ca2e4f830c392b01491248362c834901f73f920a 100644 (file)
@@ -103,8 +103,10 @@ config BLK_DEV_IDE_SATA
        ---help---
          There are two drivers for Serial ATA controllers.
 
-         The main driver, "libata", exists inside the SCSI subsystem
-         and supports most modern SATA controllers.
+         The main driver, "libata", uses the SCSI subsystem
+         and supports most modern SATA controllers. In order to use it
+         you may take a look at "Serial ATA (prod) and Parallel ATA
+         (experimental) drivers".
 
          The IDE driver (which you are currently configuring) supports
          a few first-generation SATA controllers.
index c193553f6fe749e88724e4a63f812179dde309c5..0e0280076fcde4b1274d5dee331e547509a3f335 100644 (file)
@@ -519,21 +519,24 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8
        if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ && hwif->err_stops_fifo == 0)
                try_to_flush_leftover_data(drive);
 
+       if (rq->errors >= ERROR_MAX || blk_noretry_request(rq)) {
+               ide_kill_rq(drive, rq);
+               return ide_stopped;
+       }
+
        if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT))
-               /* force an abort */
-               hwif->OUTB(WIN_IDLEIMMEDIATE, IDE_COMMAND_REG);
+               rq->errors |= ERROR_RESET;
 
-       if (rq->errors >= ERROR_MAX || blk_noretry_request(rq))
-               ide_kill_rq(drive, rq);
-       else {
-               if ((rq->errors & ERROR_RESET) == ERROR_RESET) {
-                       ++rq->errors;
-                       return ide_do_reset(drive);
-               }
-               if ((rq->errors & ERROR_RECAL) == ERROR_RECAL)
-                       drive->special.b.recalibrate = 1;
+       if ((rq->errors & ERROR_RESET) == ERROR_RESET) {
                ++rq->errors;
+               return ide_do_reset(drive);
        }
+
+       if ((rq->errors & ERROR_RECAL) == ERROR_RECAL)
+               drive->special.b.recalibrate = 1;
+
+       ++rq->errors;
+
        return ide_stopped;
 }
 
@@ -1025,6 +1028,13 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
        if (!drive->special.all) {
                ide_driver_t *drv;
 
+               /*
+                * We reset the drive so we need to issue a SETFEATURES.
+                * Do it _after_ do_special() restored device parameters.
+                */
+               if (drive->current_speed == 0xff)
+                       ide_config_drive_speed(drive, drive->desired_speed);
+
                if (rq->cmd_type == REQ_TYPE_ATA_CMD ||
                    rq->cmd_type == REQ_TYPE_ATA_TASK ||
                    rq->cmd_type == REQ_TYPE_ATA_TASKFILE)
index bd513f5a23236166541946391aab8239985201c9..1ee53a551c3adf6fe6397aea0945c5f1f4cbff20 100644 (file)
@@ -583,8 +583,12 @@ u8 eighty_ninty_three (ide_drive_t *drive)
        if(!(drive->id->hw_config & 0x4000))
                return 0;
 #endif /* CONFIG_IDEDMA_IVB */
-       if (!(drive->id->hw_config & 0x2000))
-               return 0;
+       /*
+        * FIXME:
+        * - change master/slave IDENTIFY order
+        * - force bit13 (80c cable present) check
+        *   (unless the slave device is pre-ATA3)
+        */
        return 1;
 }
 
@@ -1090,6 +1094,9 @@ static void pre_reset(ide_drive_t *drive)
        if (HWIF(drive)->pre_reset != NULL)
                HWIF(drive)->pre_reset(drive);
 
+       if (drive->current_speed != 0xff)
+               drive->desired_speed = drive->current_speed;
+       drive->current_speed = 0xff;
 }
 
 /*
index 695610f0e3e4b4eaa49cfc024e6e07694fae15c5..a6f098fda884719b1b51b0341238a752d1b6d23d 100644 (file)
@@ -1124,17 +1124,40 @@ static int set_io_32bit(ide_drive_t *drive, int arg)
 static int set_using_dma (ide_drive_t *drive, int arg)
 {
 #ifdef CONFIG_BLK_DEV_IDEDMA
+       ide_hwif_t *hwif = drive->hwif;
+       int err = -EPERM;
+
        if (!drive->id || !(drive->id->capability & 1))
-               return -EPERM;
-       if (HWIF(drive)->ide_dma_check == NULL)
-               return -EPERM;
+               goto out;
+
+       if (hwif->ide_dma_check == NULL)
+               goto out;
+
+       err = -EBUSY;
+       if (ide_spin_wait_hwgroup(drive))
+               goto out;
+       /*
+        * set ->busy flag, unlock and let it ride
+        */
+       hwif->hwgroup->busy = 1;
+       spin_unlock_irq(&ide_lock);
+
+       err = 0;
+
        if (arg) {
-               if (ide_set_dma(drive))
-                       return -EIO;
-               if (HWIF(drive)->ide_dma_on(drive)) return -EIO;
+               if (ide_set_dma(drive) || hwif->ide_dma_on(drive))
+                       err = -EIO;
        } else
                ide_dma_off(drive);
-       return 0;
+
+       /*
+        * lock, clear ->busy flag and unlock before leaving
+        */
+       spin_lock_irq(&ide_lock);
+       hwif->hwgroup->busy = 0;
+       spin_unlock_irq(&ide_lock);
+out:
+       return err;
 #else
        return -EPERM;
 #endif
index 6ceb25bc5a7bb1109e22ff804a997dde62d66cc9..ace98929cc3d86a3897edb6c6e08b894e6de72a3 100644 (file)
@@ -255,7 +255,7 @@ static int config_chipset_for_dma(ide_drive_t *drive)
                printk(KERN_WARNING "%s reduced to Ultra33 mode.\n", drive->name);
        }
 
-       if (drive->media != ide_disk)
+       if (drive->media != ide_disk && drive->media != ide_cdrom)
                return 0;
 
        if (id->capability & 4) {
@@ -545,6 +545,7 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
 
        hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
 
+       hwif->atapi_dma  = 1;
        hwif->ultra_mask = 0x7f;
        hwif->mwdma_mask = 0x07;
 
index 8ada4c5c5d70b47abf82297ec8337c9bcb403e98..6a82d39dc49896394128826d0a501b4528bca857 100644 (file)
@@ -40,7 +40,6 @@
 extern struct file_system_type v9fs_fs_type;
 extern const struct address_space_operations v9fs_addr_operations;
 extern const struct file_operations v9fs_file_operations;
-extern const struct file_operations v9fs_cached_file_operations;
 extern const struct file_operations v9fs_dir_operations;
 extern struct dentry_operations v9fs_dentry_operations;
 extern struct dentry_operations v9fs_cached_dentry_operations;
index 653dfa5b253174bcf4712211ece50540beed06e8..c7b6772538432150b0ab9e717175b108087d9de9 100644 (file)
@@ -42,6 +42,8 @@
 #include "v9fs_vfs.h"
 #include "fid.h"
 
+static const struct file_operations v9fs_cached_file_operations;
+
 /**
  * v9fs_file_open - open a file (or directory)
  * @inode: inode to be opened
@@ -245,7 +247,7 @@ v9fs_file_write(struct file *filp, const char __user * data,
        return total;
 }
 
-const struct file_operations v9fs_cached_file_operations = {
+static const struct file_operations v9fs_cached_file_operations = {
        .llseek = generic_file_llseek,
        .read = do_sync_read,
        .aio_read = generic_file_aio_read,
index aca66984aafd7635f254f18f8ae4518925a69703..3b6949b417451d16145d9117c3ad72fa8cb654b6 100644 (file)
@@ -15,8 +15,8 @@
 # define __acquire(x)  __context__(x,1)
 # define __release(x)  __context__(x,-1)
 # define __cond_lock(x,c)      ((c) ? ({ __acquire(x); 1; }) : 0)
-extern void __chk_user_ptr(void __user *);
-extern void __chk_io_ptr(void __iomem *);
+extern void __chk_user_ptr(const void __user *);
+extern void __chk_io_ptr(const void __iomem *);
 #else
 # define __user
 # define __kernel
index 34f2676b3c625a20ac5a93e6251e5be006b39dbf..58564a199862fe1011fe9c3f3b0aac755114d07c 100644 (file)
@@ -615,6 +615,7 @@ typedef struct ide_drive_s {
         u8     init_speed;     /* transfer rate set at boot */
         u8     pio_speed;      /* unused by core, used by some drivers for fallback from DMA */
         u8     current_speed;  /* current transfer rate set */
+       u8      desired_speed;  /* desired transfer rate set */
         u8     dn;             /* now wide spread use */
         u8     wcache;         /* status of write cache */
        u8      acoustic;       /* acoustic management */
index 67932ea78c175b604f51620a2f9d3ad56aaa2a6f..76212b2a99def6776596665a0b3326ef44ee0a00 100644 (file)
@@ -274,72 +274,3 @@ void clockevents_notify(unsigned long reason, void *arg)
 }
 EXPORT_SYMBOL_GPL(clockevents_notify);
 
-#ifdef CONFIG_SYSFS
-
-/**
- * clockevents_show_registered - sysfs interface for listing clockevents
- * @dev:       unused
- * @buf:       char buffer to be filled with clock events list
- *
- * Provides sysfs interface for listing registered clock event devices
- */
-static ssize_t clockevents_show_registered(struct sys_device *dev, char *buf)
-{
-       struct list_head *tmp;
-       char *p = buf;
-       int cpu;
-
-       spin_lock(&clockevents_lock);
-
-       list_for_each(tmp, &clockevent_devices) {
-               struct clock_event_device *ce;
-
-               ce = list_entry(tmp, struct clock_event_device, list);
-               p += sprintf(p, "%-20s F:%04x M:%d", ce->name,
-                            ce->features, ce->mode);
-               p += sprintf(p, " C:");
-               if (!cpus_equal(ce->cpumask, cpu_possible_map)) {
-                       for_each_cpu_mask(cpu, ce->cpumask)
-                               p += sprintf(p, " %d", cpu);
-               } else {
-                       /*
-                        * FIXME: Add the cpu which is handling this sucker
-                        */
-               }
-               p += sprintf(p, "\n");
-       }
-
-       spin_unlock(&clockevents_lock);
-
-       return p - buf;
-}
-
-/*
- * Sysfs setup bits:
- */
-static SYSDEV_ATTR(registered, 0600,
-                  clockevents_show_registered, NULL);
-
-static struct sysdev_class clockevents_sysclass = {
-       set_kset_name("clockevents"),
-};
-
-static struct sys_device clockevents_sys_device = {
-       .id     = 0,
-       .cls    = &clockevents_sysclass,
-};
-
-static int __init clockevents_sysfs_init(void)
-{
-       int error = sysdev_class_register(&clockevents_sysclass);
-
-       if (!error)
-               error = sysdev_register(&clockevents_sys_device);
-       if (!error)
-               error = sysdev_create_file(
-                               &clockevents_sys_device,
-                               &attr_registered);
-       return error;
-}
-device_initcall(clockevents_sysfs_init);
-#endif