Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 12 Feb 2008 04:42:11 +0000 (20:42 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 12 Feb 2008 04:42:11 +0000 (20:42 -0800)
* 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  sata_mv: platform driver allocs dma without create
  pata_ninja32: setup changes
  pata_legacy: typo fix
  pata_amd: Note in the module description it handles Nvidia
  sata_mv: fix loop with last port
  libata: ignore deverr on SETXFER if mode is configured
  pata_via: fix SATA cable detection on cx700

30 files changed:
arch/x86/kernel/quirks.c
arch/x86/mm/pageattr-test.c
drivers/ide/Kconfig
drivers/ide/arm/bast-ide.c
drivers/ide/arm/palm_bk3710.c
drivers/ide/ide-cd.c
drivers/ide/ide-disk.c
drivers/ide/ide-dma.c
drivers/ide/ide-io.c
drivers/ide/ide-iops.c
drivers/ide/ide-lib.c
drivers/ide/ide-probe.c
drivers/ide/ide-tape.c
drivers/ide/ide.c
drivers/ide/legacy/gayle.c
drivers/ide/pci/cs5520.c
drivers/ide/pci/pdc202xx_old.c
fs/lockd/host.c
fs/lockd/svclock.c
include/asm-generic/topology.h
include/linux/ide.h
include/linux/sunrpc/svc.h
init/Makefile
net/sunrpc/xprtrdma/svc_rdma_sendto.c
scripts/Kbuild.include
security/selinux/hooks.c
security/selinux/include/av_perm_to_string.h
security/selinux/include/av_permissions.h
security/selinux/include/class_to_string.h
security/selinux/include/flask.h

index 1941482d4ca317d52ddbd9af51a7142a96a452ba..c47208fc59324a1919116ba118ce11af3d8fcda0 100644 (file)
@@ -11,7 +11,7 @@
 static void __devinit quirk_intel_irqbalance(struct pci_dev *dev)
 {
        u8 config, rev;
-       u32 word;
+       u16 word;
 
        /* BIOS may enable hardware IRQ balancing for
         * E7520/E7320/E7525(revision ID 0x9 and below)
@@ -26,8 +26,11 @@ static void __devinit quirk_intel_irqbalance(struct pci_dev *dev)
        pci_read_config_byte(dev, 0xf4, &config);
        pci_write_config_byte(dev, 0xf4, config|0x2);
 
-       /* read xTPR register */
-       raw_pci_read(0, 0, 0x40, 0x4c, 2, &word);
+       /*
+        * read xTPR register.  We may not have a pci_dev for device 8
+        * because it might be hidden until the above write.
+        */
+       pci_bus_read_config_word(dev->bus, PCI_DEVFN(8, 0), 0x4c, &word);
 
        if (!(word & (1 << 13))) {
                dev_info(&dev->dev, "Intel E7520/7320/7525 detected; "
index ed82016003540ec66ccd7b18157188f6a9d7a5cf..75f1b109aae8fe6711d12b440df3743f38150ce3 100644 (file)
@@ -40,7 +40,6 @@ struct split_state {
 static int print_split(struct split_state *s)
 {
        long i, expected, missed = 0;
-       int printed = 0;
        int err = 0;
 
        s->lpg = s->gpg = s->spg = s->exec = 0;
@@ -53,12 +52,6 @@ static int print_split(struct split_state *s)
 
                pte = lookup_address(addr, &level);
                if (!pte) {
-                       if (!printed) {
-                               dump_pagetable(addr);
-                               printk(KERN_INFO "CPA %lx no pte level %d\n",
-                                       addr, level);
-                               printed = 1;
-                       }
                        missed++;
                        i++;
                        continue;
index 043c34ad0a05fee2659972d8e66ba41dcf9277b0..df752e690e4739f595dee6dde3c103db522da5fa 100644 (file)
@@ -378,6 +378,9 @@ config BLK_DEV_IDEPNP
          would like the kernel to automatically detect and activate
          it, say Y here.
 
+config BLK_DEV_IDEDMA_SFF
+       bool
+
 if PCI
 
 comment "PCI IDE chipsets support"
@@ -459,6 +462,7 @@ config BLK_DEV_RZ1000
 config BLK_DEV_IDEDMA_PCI
        bool
        select BLK_DEV_IDEPCI
+       select BLK_DEV_IDEDMA_SFF
 
 config BLK_DEV_AEC62XX
        tristate "AEC62XX chipset support"
@@ -688,23 +692,6 @@ config BLK_DEV_PDC202XX_OLD
 
          If unsure, say N.
 
-config PDC202XX_BURST
-       bool "Special UDMA Feature"
-       depends on BLK_DEV_PDC202XX_OLD
-       help
-         This option causes the pdc202xx driver to enable UDMA modes on the
-         PDC202xx even when the PDC202xx BIOS has not done so.
-
-         It was originally designed for the PDC20246/Ultra33, whose BIOS will
-         only setup UDMA on the first two PDC20246 cards.  It has also been
-         used successfully on a PDC20265/Ultra100, allowing use of UDMA modes
-         when the PDC20265 BIOS has been disabled (for faster boot up).
-
-         Please read the comments at the top of
-         <file:drivers/ide/pci/pdc202xx_old.c>.
-
-         If unsure, say N.
-
 config BLK_DEV_PDC202XX_NEW
        tristate "PROMISE PDC202{68|69|70|71|75|76|77} support"
        select BLK_DEV_IDEDMA_PCI
@@ -1016,7 +1003,7 @@ config BLK_DEV_Q40IDE
 config BLK_DEV_PALMCHIP_BK3710
        tristate "Palmchip bk3710 IDE controller support"
        depends on ARCH_DAVINCI
-       select BLK_DEV_IDEDMA_PCI
+       select BLK_DEV_IDEDMA_SFF
        help
          Say Y here if you want to support the onchip IDE controller on the
          TI DaVinci SoC
@@ -1124,7 +1111,8 @@ config BLK_DEV_UMC8672
 endif
 
 config BLK_DEV_IDEDMA
-       def_bool BLK_DEV_IDEDMA_PCI || BLK_DEV_IDEDMA_PMAC || BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
+       def_bool BLK_DEV_IDEDMA_SFF || BLK_DEV_IDEDMA_PMAC || \
+                BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
 
 config IDE_ARCH_OBSOLETE_INIT
        def_bool ALPHA || (ARM && !ARCH_L7200) || BLACKFIN || X86 || IA64 || M32R || MIPS || PARISC || PPC || (SUPERH64 && BLK_DEV_IDEPCI) || SPARC
index 0e7574c0ee60bcbfa48c75ef8f3843b71c44bac5..161d30c8481e8fe79bf135d97aa77c42d6be43f4 100644 (file)
 #include <asm/arch/bast-map.h>
 #include <asm/arch/bast-irq.h>
 
-/* list of registered interfaces */
-static ide_hwif_t *ifs[2];
-
-static int __init
-bastide_register(unsigned int base, unsigned int aux, int irq,
-                ide_hwif_t **hwif)
+static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
 {
        ide_hwif_t *hwif;
        hw_regs_t hw;
@@ -76,8 +71,9 @@ static int __init bastide_init(void)
 
        printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n");
 
-       bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0, &ifs[0]);
-       bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1, &ifs[1]);
+       bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0);
+       bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1);
+
        return 0;
 }
 
index c3069970a0128860693bf64864a7224640f98b4d..8e1f6bd338872c0fe08a985e81e75019c3f26983 100644 (file)
@@ -311,15 +311,37 @@ static void __devinit palm_bk3710_chipinit(void __iomem *base)
        palm_bk3710_setpiomode(base, NULL, 0, 600, 0);
        palm_bk3710_setpiomode(base, NULL, 1, 600, 0);
 }
+
+static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif)
+{
+       return ATA_CBL_PATA80;
+}
+
+static void __devinit palm_bk3710_init_hwif(ide_hwif_t *hwif)
+{
+       hwif->set_pio_mode = palm_bk3710_set_pio_mode;
+       hwif->set_dma_mode = palm_bk3710_set_dma_mode;
+
+       hwif->cable_detect = palm_bk3710_cable_detect;
+}
+
+static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
+       .init_hwif              = palm_bk3710_init_hwif,
+       .host_flags             = IDE_HFLAG_NO_DMA, /* hack (no PCI) */
+       .pio_mask               = ATA_PIO4,
+       .udma_mask              = ATA_UDMA4,    /* (input clk 99MHz) */
+       .mwdma_mask             = ATA_MWDMA2,
+};
+
 static int __devinit palm_bk3710_probe(struct platform_device *pdev)
 {
-       hw_regs_t ide_ctlr_info;
-       int index = 0;
-       int pribase;
        struct clk *clkp;
        struct resource *mem, *irq;
        ide_hwif_t *hwif;
        void __iomem *base;
+       int pribase, i;
+       hw_regs_t hw;
+       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
        clkp = clk_get(NULL, "IDECLK");
        if (IS_ERR(clkp))
@@ -330,7 +352,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
        ide_palm_clk = clk_get_rate(ideclkp)/100000;
        ide_palm_clk = (10000/ide_palm_clk) + 1;
        /* Register the IDE interface with Linux ATA Interface */
-       memset(&ide_ctlr_info, 0, sizeof(ide_ctlr_info));
+       memset(&hw, 0, sizeof(hw));
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (mem == NULL) {
@@ -349,32 +371,42 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
        palm_bk3710_chipinit(base);
 
        pribase = mem->start + IDE_PALM_ATA_PRI_REG_OFFSET;
-       for (index = 0; index < IDE_NR_PORTS - 2; index++)
-               ide_ctlr_info.io_ports[index] = pribase + index;
-       ide_ctlr_info.io_ports[IDE_CONTROL_OFFSET] = mem->start +
+       for (i = 0; i < IDE_NR_PORTS - 2; i++)
+               hw.io_ports[i] = pribase + i;
+       hw.io_ports[IDE_CONTROL_OFFSET] = mem->start +
                        IDE_PALM_ATA_PRI_CTL_OFFSET;
-       ide_ctlr_info.irq = irq->start;
-       ide_ctlr_info.chipset = ide_palm3710;
+       hw.irq = irq->start;
+       hw.chipset = ide_palm3710;
 
-       if (ide_register_hw(&ide_ctlr_info, NULL, &hwif) < 0) {
-               printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
-               return -ENODEV;
-       }
+       hwif = ide_deprecated_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+       if (hwif == NULL)
+               goto out;
+
+       i = hwif->index;
+
+       if (hwif->present)
+               ide_unregister(i, 0, 0);
+       else if (!hwif->hold)
+               ide_init_port_data(hwif, i);
+
+       ide_init_port_hw(hwif, &hw);
 
-       hwif->set_pio_mode = &palm_bk3710_set_pio_mode;
-       hwif->set_dma_mode = &palm_bk3710_set_dma_mode;
        hwif->mmio = 1;
        default_hwif_mmiops(hwif);
-       hwif->cbl = ATA_CBL_PATA80;
-       hwif->ultra_mask = 0x1f;        /* Ultra DMA Mode 4 Max
-                                               (input clk 99MHz) */
-       hwif->mwdma_mask = 0x7;
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
 
        ide_setup_dma(hwif, mem->start);
 
+       idx[0] = i;
+
+       ide_device_add(idx, &palm_bk3710_port_info);
+
+       if (!hwif->present)
+               goto out;
+
        return 0;
+out:
+       printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
+       return -ENODEV;
 }
 
 static struct platform_driver platform_bk_driver = {
index 5e42c19a03e3b7f9e2eec932a929660cb513730d..354c91d06a6d26d6af5f5c0fd5bb38d178d82a2f 100644 (file)
@@ -1555,7 +1555,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense)
        if (stat)
                return stat;
 
-       toc->hdr.toc_length = ntohs (toc->hdr.toc_length);
+       toc->hdr.toc_length = be16_to_cpu(toc->hdr.toc_length);
 
        if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) {
                toc->hdr.first_track = BCD2BIN(toc->hdr.first_track);
index 3c69822507e2a59216e8d2690362c961a940579b..aed8b31ca561512bf1f048175a2c88d14102f11a 100644 (file)
@@ -590,20 +590,24 @@ static ide_proc_entry_t idedisk_proc[] = {
 static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
 {
        ide_drive_t *drive = q->queuedata;
-       ide_task_t task;
+       ide_task_t *task = kmalloc(sizeof(*task), GFP_ATOMIC);
 
-       memset(&task, 0, sizeof(task));
+       /* FIXME: map struct ide_taskfile on rq->cmd[] */
+       BUG_ON(task == NULL);
+
+       memset(task, 0, sizeof(*task));
        if (ide_id_has_flush_cache_ext(drive->id) &&
            (drive->capacity64 >= (1UL << 28)))
-               task.tf.command = WIN_FLUSH_CACHE_EXT;
+               task->tf.command = WIN_FLUSH_CACHE_EXT;
        else
-               task.tf.command = WIN_FLUSH_CACHE;
-       task.tf_flags   = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
-       task.data_phase = TASKFILE_NO_DATA;
+               task->tf.command = WIN_FLUSH_CACHE;
+       task->tf_flags   = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE |
+                          IDE_TFLAG_DYN;
+       task->data_phase = TASKFILE_NO_DATA;
 
        rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
        rq->cmd_flags |= REQ_SOFTBARRIER;
-       rq->special = &task;
+       rq->special = task;
 }
 
 /*
index a4bb32883c6bfb23d04c19f60e2b714da9a92744..d0e7b537353e38ea1bb23ff6f0604f0d93777752 100644 (file)
@@ -198,7 +198,7 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq)
 
 EXPORT_SYMBOL_GPL(ide_build_sglist);
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 /**
  *     ide_build_dmatable      -       build IDE DMA table
  *
@@ -316,7 +316,7 @@ void ide_destroy_dmatable (ide_drive_t *drive)
 
 EXPORT_SYMBOL_GPL(ide_destroy_dmatable);
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 /**
  *     config_drive_for_dma    -       attempt to activate IDE DMA
  *     @drive: the drive to place in DMA mode
@@ -424,7 +424,7 @@ void ide_dma_host_set(ide_drive_t *drive, int on)
 }
 
 EXPORT_SYMBOL_GPL(ide_dma_host_set);
-#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
+#endif /* CONFIG_BLK_DEV_IDEDMA_SFF  */
 
 /**
  *     ide_dma_off_quietly     -       Generic DMA kill
@@ -474,7 +474,7 @@ void ide_dma_on(ide_drive_t *drive)
        drive->hwif->dma_host_set(drive, 1);
 }
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 /**
  *     ide_dma_setup   -       begin a DMA phase
  *     @drive: target device
@@ -591,7 +591,7 @@ static int __ide_dma_test_irq(ide_drive_t *drive)
 }
 #else
 static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; }
-#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
+#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
 
 int __ide_dma_bad_drive (ide_drive_t *drive)
 {
@@ -840,7 +840,7 @@ void ide_check_dma_crc(ide_drive_t *drive)
                ide_dma_on(drive);
 }
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 void ide_dma_lost_irq (ide_drive_t *drive)
 {
        printk("%s: DMA interrupt recovery\n", drive->name);
@@ -1002,4 +1002,4 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base)
 }
 
 EXPORT_SYMBOL_GPL(ide_setup_dma);
-#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
+#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
index 3addbe478d26743701ba669c4ae6acf5b2050725..715379605a7bb55f887eb887832c4765eccab485 100644 (file)
@@ -361,17 +361,21 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
        spin_unlock_irqrestore(&ide_lock, flags);
 
        if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
-               ide_task_t *args = (ide_task_t *) rq->special;
+               ide_task_t *task = (ide_task_t *)rq->special;
+
                if (rq->errors == 0)
-                       rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT);
-                       
-               if (args) {
-                       struct ide_taskfile *tf = &args->tf;
+                       rq->errors = !OK_STAT(stat, READY_STAT, BAD_STAT);
+
+               if (task) {
+                       struct ide_taskfile *tf = &task->tf;
 
                        tf->error = err;
                        tf->status = stat;
 
-                       ide_tf_read(drive, args);
+                       ide_tf_read(drive, task);
+
+                       if (task->tf_flags & IDE_TFLAG_DYN)
+                               kfree(task);
                }
        } else if (blk_pm_request(rq)) {
                struct request_pm_state *pm = rq->data;
@@ -388,7 +392,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
        spin_lock_irqsave(&ide_lock, flags);
        HWGROUP(drive)->rq = NULL;
        rq->errors = err;
-       if (__blk_end_request(rq, (rq->errors ? -EIO : 0), 0))
+       if (unlikely(__blk_end_request(rq, (rq->errors ? -EIO : 0),
+                                      blk_rq_bytes(rq))))
                BUG();
        spin_unlock_irqrestore(&ide_lock, flags);
 }
index c32e759df2089a5229f211154f0642da5e6e3fed..c419266234a75276a1ed85e00314d6b182b12b70 100644 (file)
@@ -786,15 +786,11 @@ static void __ide_set_handler (ide_drive_t *drive, ide_handler_t *handler,
 {
        ide_hwgroup_t *hwgroup = HWGROUP(drive);
 
-       if (hwgroup->handler != NULL) {
-               printk(KERN_CRIT "%s: ide_set_handler: handler not null; "
-                       "old=%p, new=%p\n",
-                       drive->name, hwgroup->handler, handler);
-       }
+       BUG_ON(hwgroup->handler);
        hwgroup->handler        = handler;
        hwgroup->expiry         = expiry;
        hwgroup->timer.expires  = jiffies + timeout;
-       hwgroup->req_gen_timer = hwgroup->req_gen;
+       hwgroup->req_gen_timer  = hwgroup->req_gen;
        add_timer(&hwgroup->timer);
 }
 
@@ -827,11 +823,9 @@ void ide_execute_command(ide_drive_t *drive, u8 cmd, ide_handler_t *handler,
                         unsigned timeout, ide_expiry_t *expiry)
 {
        unsigned long flags;
-       ide_hwgroup_t *hwgroup = HWGROUP(drive);
        ide_hwif_t *hwif = HWIF(drive);
 
        spin_lock_irqsave(&ide_lock, flags);
-       BUG_ON(hwgroup->handler);
        __ide_set_handler(drive, handler, timeout, expiry);
        hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG);
        /*
index 1ff676cc6473f56dd9a5cc00b7f31d57c4899e4d..29e2c9719c307e4147b624dcf4b188ab1f8d484c 100644 (file)
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
-/*
- *     IDE library routines. These are plug in code that most 
- *     drivers can use but occasionally may be weird enough
- *     to want to do their own thing with
- *
- *     Add common non I/O op stuff here. Make sure it has proper
- *     kernel-doc function headers or your patch will be rejected
- */
-
 static const char *udma_str[] =
         { "UDMA/16", "UDMA/25",  "UDMA/33",  "UDMA/44",
           "UDMA/66", "UDMA/100", "UDMA/133", "UDMA7" };
index 6daea896c5dbe34ca18095e12f8f708e73a4c7b0..4a2cb28682263d6a3c3a861490dfbe770d96c2d6 100644 (file)
@@ -1051,7 +1051,7 @@ static int init_irq (ide_hwif_t *hwif)
                int sa = 0;
 #if defined(__mc68000__)
                sa = IRQF_SHARED;
-#endif /* __mc68000__ || CONFIG_APUS */
+#endif /* __mc68000__ */
 
                if (IDE_CHIPSET_IS_PCI(hwif->chipset))
                        sa = IRQF_SHARED;
@@ -1355,7 +1355,7 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
        hwif->ultra_mask = d->udma_mask;
 
        /* reset DMA masks only for SFF-style DMA controllers */
-       if ((d->host_flags && IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
+       if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
                hwif->swdma_mask = hwif->mwdma_mask = hwif->ultra_mask = 0;
 
        if (d->host_flags & IDE_HFLAG_RQSIZE_256)
index 49dd2e7bae7a788f95f8157089f9d20c8d7e695b..0598ecfd5f3706b0402182875f324474361bbf5b 100644 (file)
@@ -466,9 +466,6 @@ static void ide_tape_put(struct ide_tape_obj *tape)
 /* 0 = no tape is loaded, so we don't rewind after ejecting */
 #define IDETAPE_MEDIUM_PRESENT         9
 
-/* A define for the READ BUFFER command */
-#define IDETAPE_RETRIEVE_FAULTY_BLOCK  6
-
 /* Some defines for the SPACE command */
 #define IDETAPE_SPACE_OVER_FILEMARK    1
 #define IDETAPE_SPACE_TO_EOD           3
@@ -490,7 +487,6 @@ enum {
        REQ_IDETAPE_PC2         = (1 << 1), /* packet command (second stage) */
        REQ_IDETAPE_READ        = (1 << 2),
        REQ_IDETAPE_WRITE       = (1 << 3),
-       REQ_IDETAPE_READ_BUFFER = (1 << 4),
 };
 
 /* Error codes returned in rq->errors to the higher part of the driver. */
@@ -1523,29 +1519,6 @@ static void idetape_create_read_cmd(idetape_tape_t *tape, idetape_pc_t *pc,
                set_bit(PC_DMA_RECOMMENDED, &pc->flags);
 }
 
-static void idetape_create_read_buffer_cmd(idetape_tape_t *tape,
-               idetape_pc_t *pc, struct idetape_bh *bh)
-{
-       int size = 32768;
-       struct idetape_bh *p = bh;
-
-       idetape_init_pc(pc);
-       pc->c[0] = READ_BUFFER;
-       pc->c[1] = IDETAPE_RETRIEVE_FAULTY_BLOCK;
-       pc->c[7] = size >> 8;
-       pc->c[8] = size & 0xff;
-       pc->callback = &idetape_pc_callback;
-       pc->bh = bh;
-       atomic_set(&bh->b_count, 0);
-       pc->buffer = NULL;
-       while (p) {
-               atomic_set(&p->b_count, 0);
-               p = p->b_reqnext;
-       }
-       pc->request_transfer = size;
-       pc->buffer_size = size;
-}
-
 static void idetape_create_write_cmd(idetape_tape_t *tape, idetape_pc_t *pc,
                unsigned int length, struct idetape_bh *bh)
 {
@@ -1655,13 +1628,6 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
                                         (struct idetape_bh *)rq->special);
                goto out;
        }
-       if (rq->cmd[0] & REQ_IDETAPE_READ_BUFFER) {
-               tape->postpone_cnt = 0;
-               pc = idetape_next_pc_storage(drive);
-               idetape_create_read_buffer_cmd(tape, pc,
-                               (struct idetape_bh *)rq->special);
-               goto out;
-       }
        if (rq->cmd[0] & REQ_IDETAPE_PC1) {
                pc = (idetape_pc_t *) rq->buffer;
                rq->cmd[0] &= ~(REQ_IDETAPE_PC1);
index ad0e9955f73c9ce38de7485b487bb778b9542e87..4a8952a6c3daa2433c8cc7c876c5d4b55388daf1 100644 (file)
@@ -44,8 +44,6 @@
  *  inspiration from lots of linux users, esp.  hamish@zot.apana.org.au
  */
 
-#define        REVISION        "Revision: 7.00alpha2"
-
 #define _IDE_C                 /* Tell ide.h it's really us */
 
 #include <linux/module.h>
@@ -1618,7 +1616,7 @@ static int __init ide_init(void)
 {
        int ret;
 
-       printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n");
+       printk(KERN_INFO "Uniform Multi-Platform E-IDE driver\n");
        system_bus_speed = ide_system_bus_speed();
 
        printk(KERN_INFO "ide: Assuming %dMHz system bus speed "
index 9d3851d27677785ff331fc8908cd93e9e5da81ed..b7d81090d5da50e21b221ed4b1fb20a242942c33 100644 (file)
@@ -94,7 +94,7 @@ static int gayle_ack_intr_a1200(ide_hwif_t *hwif)
 
 static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base,
                                     unsigned long ctl, unsigned long irq_port,
-                                    ide_ack_intr_t *ack_intr);
+                                    ide_ack_intr_t *ack_intr)
 {
        int i;
 
index 0be1a824102b90494f33410e3a199e8f5a432187..1c163e4ef03f1d7b5972d13b65a343ebd8ddba2d 100644 (file)
@@ -147,11 +147,6 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
 
        /* We must not grab the entire device, it has 'ISA' space in its
         * BARS too and we will freak out other bits of the kernel
-        *
-        * pci_enable_device_bars() is going away. I replaced it with
-        * IO only enable for now but I'll need confirmation this is
-        * allright for that device. If not, it will need some kind of
-        * quirk. --BenH.
         */
        if (pci_enable_device_io(dev)) {
                printk(KERN_WARNING "%s: Unable to enable 55x0.\n", d->name);
index da4329790387c6019ceaf7b24d7394840b25fb1d..150422ec3cfabc6685d8f6a8bf5b82804cf969b4 100644 (file)
@@ -3,26 +3,6 @@
  *  Copyright (C) 2006-2007            MontaVista Software, Inc.
  *  Copyright (C) 2007                 Bartlomiej Zolnierkiewicz
  *
- *  Promise Ultra33 cards with BIOS v1.20 through 1.28 will need this
- *  compiled into the kernel if you have more than one card installed.
- *  Note that BIOS v1.29 is reported to fix the problem.  Since this is
- *  safe chipset tuning, including this support is harmless
- *
- *  Promise Ultra66 cards with BIOS v1.11 this
- *  compiled into the kernel if you have more than one card installed.
- *
- *  Promise Ultra100 cards.
- *
- *  The latest chipset code will support the following ::
- *  Three Ultra33 controllers and 12 drives.
- *  8 are UDMA supported and 4 are limited to DMA mode 2 multi-word.
- *  The 8/4 ratio is a BIOS code limit by promise.
- *
- *  UNLESS you enable "CONFIG_PDC202XX_BURST"
- *
- */
-
-/*
  *  Portions Copyright (C) 1999 Promise Technology, Inc.
  *  Author: Frank Tiernan (frankt@promise.com)
  *  Released under terms of General Public License
@@ -344,7 +324,6 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
                (primary_mode & 1) ? "MASTER" : "PCI",
                (secondary_mode & 1) ? "MASTER" : "PCI" );
 
-#ifdef CONFIG_PDC202XX_BURST
        if (!(udma_speed_flag & 1)) {
                printk(KERN_INFO "%s: FORCING BURST BIT 0x%02x->0x%02x ",
                        hwif->cds->name, udma_speed_flag,
@@ -352,7 +331,6 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
                outb(udma_speed_flag | 1, dmabase | 0x1f);
                printk("%sACTIVE\n", (inb(dmabase | 0x1f) & 1) ? "" : "IN");
        }
-#endif /* CONFIG_PDC202XX_BURST */
 
        ide_setup_dma(hwif, dmabase);
 }
index ca6b16fc3101a3df88d60350060eae56d6528535..f1ef49fff118ea8aa8322dd4404e0ca65ea3e518 100644 (file)
@@ -243,10 +243,18 @@ nlm_bind_host(struct nlm_host *host)
                        .program        = &nlm_program,
                        .version        = host->h_version,
                        .authflavor     = RPC_AUTH_UNIX,
-                       .flags          = (RPC_CLNT_CREATE_HARDRTRY |
+                       .flags          = (RPC_CLNT_CREATE_NOPING |
                                           RPC_CLNT_CREATE_AUTOBIND),
                };
 
+               /*
+                * lockd retries server side blocks automatically so we want
+                * those to be soft RPC calls. Client side calls need to be
+                * hard RPC tasks.
+                */
+               if (!host->h_server)
+                       args.flags |= RPC_CLNT_CREATE_HARDRTRY;
+
                clnt = rpc_create(&args);
                if (!IS_ERR(clnt))
                        host->h_rpcclnt = clnt;
index 2f4d8fa666892b9fa8b41266a627608c55c1e8a0..fe9bdb4a220cd32827c5818001651cabb5f1966d 100644 (file)
@@ -763,11 +763,20 @@ callback:
        dprintk("lockd: GRANTing blocked lock.\n");
        block->b_granted = 1;
 
-       /* Schedule next grant callback in 30 seconds */
-       nlmsvc_insert_block(block, 30 * HZ);
+       /* keep block on the list, but don't reattempt until the RPC
+        * completes or the submission fails
+        */
+       nlmsvc_insert_block(block, NLM_NEVER);
+
+       /* Call the client -- use a soft RPC task since nlmsvc_retry_blocked
+        * will queue up a new one if this one times out
+        */
+       error = nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG,
+                               &nlmsvc_grant_ops);
 
-       /* Call the client */
-       nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG, &nlmsvc_grant_ops);
+       /* RPC submission failed, wait a bit and retry */
+       if (error < 0)
+               nlmsvc_insert_block(block, 10 * HZ);
 }
 
 /*
@@ -786,6 +795,17 @@ static void nlmsvc_grant_callback(struct rpc_task *task, void *data)
 
        dprintk("lockd: GRANT_MSG RPC callback\n");
 
+       /* if the block is not on a list at this point then it has
+        * been invalidated. Don't try to requeue it.
+        *
+        * FIXME: it's possible that the block is removed from the list
+        * after this check but before the nlmsvc_insert_block. In that
+        * case it will be added back. Perhaps we need better locking
+        * for nlm_blocked?
+        */
+       if (list_empty(&block->b_list))
+               return;
+
        /* Technically, we should down the file semaphore here. Since we
         * move the block towards the head of the queue only, no harm
         * can be done, though. */
index 5d9d70cd17fc41fecef6095b4322381c23a8a3f8..342a2a0105c4c070f988d39afc90f46d52dca12d 100644 (file)
 /* Other architectures wishing to use this simple topology API should fill
    in the below functions as appropriate in their own <asm/topology.h> file. */
 #ifndef cpu_to_node
-#define cpu_to_node(cpu)       (0)
+#define cpu_to_node(cpu)       ((void)(cpu),0)
 #endif
 #ifndef parent_node
-#define parent_node(node)      (0)
+#define parent_node(node)      ((void)(node),0)
 #endif
 #ifndef node_to_cpumask
-#define node_to_cpumask(node)  (cpu_online_map)
+#define node_to_cpumask(node)  ((void)node, cpu_online_map)
 #endif
 #ifndef node_to_first_cpu
-#define node_to_first_cpu(node)        (0)
+#define node_to_first_cpu(node)        ((void)(node),0)
 #endif
 #ifndef pcibus_to_node
-#define pcibus_to_node(node)   (-1)
+#define pcibus_to_node(bus)    ((void)(bus), -1)
 #endif
 
 #ifndef pcibus_to_cpumask
index acec99da832dc475a44aa1e18696f84e1dae1f53..a3b69c10d667c98c5631308456673374491aaec5 100644 (file)
@@ -906,6 +906,8 @@ enum {
                                          IDE_TFLAG_IN_DEVICE,
        /* force 16-bit I/O operations */
        IDE_TFLAG_IO_16BIT              = (1 << 30),
+       /* ide_task_t was allocated using kmalloc() */
+       IDE_TFLAG_DYN                   = (1 << 31),
 };
 
 struct ide_taskfile {
@@ -998,8 +1000,7 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o
 void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *);
 void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
 
-/* FIXME: palm_bk3710 uses BLK_DEV_IDEDMA_PCI without BLK_DEV_IDEPCI! */
-#if defined(CONFIG_BLK_DEV_IDEPCI) && defined(CONFIG_BLK_DEV_IDEDMA_PCI)
+#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
 void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *);
 #else
 static inline void ide_hwif_setup_dma(ide_hwif_t *hwif,
@@ -1146,7 +1147,7 @@ ide_startstop_t ide_dma_intr(ide_drive_t *);
 int ide_build_sglist(ide_drive_t *, struct request *);
 void ide_destroy_dmatable(ide_drive_t *);
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 extern int ide_build_dmatable(ide_drive_t *, struct request *);
 extern int ide_release_dma(ide_hwif_t *);
 extern void ide_setup_dma(ide_hwif_t *, unsigned long);
@@ -1157,7 +1158,7 @@ extern void ide_dma_start(ide_drive_t *);
 extern int __ide_dma_end(ide_drive_t *);
 extern void ide_dma_lost_irq(ide_drive_t *);
 extern void ide_dma_timeout(ide_drive_t *);
-#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
+#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
 
 #else
 static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; }
@@ -1171,7 +1172,7 @@ static inline int ide_set_dma(ide_drive_t *drive) { return 1; }
 static inline void ide_check_dma_crc(ide_drive_t *drive) { ; }
 #endif /* CONFIG_BLK_DEV_IDEDMA */
 
-#ifndef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifndef CONFIG_BLK_DEV_IDEDMA_SFF
 static inline void ide_release_dma(ide_hwif_t *drive) {;}
 #endif
 
@@ -1294,7 +1295,7 @@ static inline void ide_dump_identify(u8 *id)
 static inline int hwif_to_node(ide_hwif_t *hwif)
 {
        struct pci_dev *dev = to_pci_dev(hwif->dev);
-       return dev ? pcibus_to_node(dev->bus) : -1;
+       return hwif->dev ? pcibus_to_node(dev->bus) : -1;
 }
 
 static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive)
index 64c771056187a3957c70ce3c212e0db82db49ff9..64c97552964a42f523b5c3dcba8a149f5edd4b3e 100644 (file)
@@ -409,16 +409,13 @@ char *               svc_print_addr(struct svc_rqst *, char *, size_t);
  * for all cases without actually generating the checksum, so we just use a
  * static value.
  */
-static inline void
-svc_reserve_auth(struct svc_rqst *rqstp, int space)
+static inline void svc_reserve_auth(struct svc_rqst *rqstp, int space)
 {
-       int                     added_space = 0;
+       int added_space = 0;
 
-       switch(rqstp->rq_authop->flavour) {
-               case RPC_AUTH_GSS:
-                       added_space = RPC_MAX_AUTH_SIZE;
-       }
-       return svc_reserve(rqstp, space + added_space);
+       if (rqstp->rq_authop->flavour)
+               added_space = RPC_MAX_AUTH_SIZE;
+       svc_reserve(rqstp, space + added_space);
 }
 
 #endif /* SUNRPC_SVC_H */
index c5f157ce293e7625c428b8e853732d1977add6bc..4a243df426f70b9f3fbe366f1b94dbb8f4cdd1cf 100644 (file)
@@ -27,6 +27,7 @@ $(obj)/version.o: include/linux/compile.h
 # mkcompile_h will make sure to only update the
 # actual file if its content has changed.
 
+       chk_compile.h = :
  quiet_chk_compile.h = echo '  CHK     $@'
 silent_chk_compile.h = :
 include/linux/compile.h: FORCE
index 3e321949e1dc55cbd89db97a857e6fe70512f6c3..0598b229c11d326720a6c56b9bce66cfaa66e6b7 100644 (file)
@@ -159,7 +159,8 @@ static int send_write(struct svcxprt_rdma *xprt, struct svc_rqst *rqstp,
        BUG_ON(sge_count >= 32);
        dprintk("svcrdma: RDMA_WRITE rmr=%x, to=%llx, xdr_off=%d, "
                "write_len=%d, xdr_sge=%p, sge_count=%d\n",
-               rmr, to, xdr_off, write_len, xdr_sge, sge_count);
+               rmr, (unsigned long long)to, xdr_off,
+               write_len, xdr_sge, sge_count);
 
        ctxt = svc_rdma_get_context(xprt);
        ctxt->count = 0;
index da3559ea92e03759d6a2a6d32c1307a9e1dc5c3b..d64e6badc9427ed9d6c8a2d47652d5ecab693293 100644 (file)
@@ -39,10 +39,13 @@ escsq = $(subst $(squote),'\$(squote)',$1)
 # - If they are equal no change, and no timestamp update
 # - stdin is piped in from the first prerequisite ($<) so one has
 #   to specify a valid file as first prerequisite (often the kbuild file)
+       chk_filechk = :
  quiet_chk_filechk = echo '  CHK     $@'
 silent_chk_filechk = :
+       upd_filechk = :
  quiet_upd_filechk = echo '  UPD     $@'
 silent_upd_filechk = :
+
 define filechk
        $(Q)set -e;                             \
        $($(quiet)chk_filechk);                 \
index e5ed07510309edb0da10a151095cd3529bf41442..44f16d9041e3896b2444f2fc77f14c5d3181cde1 100644 (file)
@@ -1272,12 +1272,18 @@ static int task_has_perm(struct task_struct *tsk1,
                            SECCLASS_PROCESS, perms, NULL);
 }
 
+#if CAP_LAST_CAP > 63
+#error Fix SELinux to handle capabilities > 63.
+#endif
+
 /* Check whether a task is allowed to use a capability. */
 static int task_has_capability(struct task_struct *tsk,
                               int cap)
 {
        struct task_security_struct *tsec;
        struct avc_audit_data ad;
+       u16 sclass;
+       u32 av = CAP_TO_MASK(cap);
 
        tsec = tsk->security;
 
@@ -1285,8 +1291,19 @@ static int task_has_capability(struct task_struct *tsk,
        ad.tsk = tsk;
        ad.u.cap = cap;
 
-       return avc_has_perm(tsec->sid, tsec->sid,
-                           SECCLASS_CAPABILITY, CAP_TO_MASK(cap), &ad);
+       switch (CAP_TO_INDEX(cap)) {
+       case 0:
+               sclass = SECCLASS_CAPABILITY;
+               break;
+       case 1:
+               sclass = SECCLASS_CAPABILITY2;
+               break;
+       default:
+               printk(KERN_ERR
+                      "SELinux:  out of range capability %d\n", cap);
+               BUG();
+       }
+       return avc_has_perm(tsec->sid, tsec->sid, sclass, av, &ad);
 }
 
 /* Check whether a task is allowed to use a system operation. */
index 399f868c5c8fb945f430e1f3206c73036bb38045..d5696690d3a2c583bdb1762d7a75468968d67a84 100644 (file)
    S_(SECCLASS_CAPABILITY, CAPABILITY__LEASE, "lease")
    S_(SECCLASS_CAPABILITY, CAPABILITY__AUDIT_WRITE, "audit_write")
    S_(SECCLASS_CAPABILITY, CAPABILITY__AUDIT_CONTROL, "audit_control")
+   S_(SECCLASS_CAPABILITY, CAPABILITY__SETFCAP, "setfcap")
+   S_(SECCLASS_CAPABILITY2, CAPABILITY2__MAC_OVERRIDE, "mac_override")
+   S_(SECCLASS_CAPABILITY2, CAPABILITY2__MAC_ADMIN, "mac_admin")
    S_(SECCLASS_NETLINK_ROUTE_SOCKET, NETLINK_ROUTE_SOCKET__NLMSG_READ, "nlmsg_read")
    S_(SECCLASS_NETLINK_ROUTE_SOCKET, NETLINK_ROUTE_SOCKET__NLMSG_WRITE, "nlmsg_write")
    S_(SECCLASS_NETLINK_FIREWALL_SOCKET, NETLINK_FIREWALL_SOCKET__NLMSG_READ, "nlmsg_read")
index 84c9abc809787026b077d2f0a808ee9f1efe71ca..75b41311ab86bd94391a21daa7e03795a3192877 100644 (file)
 #define CAPABILITY__LEASE                         0x10000000UL
 #define CAPABILITY__AUDIT_WRITE                   0x20000000UL
 #define CAPABILITY__AUDIT_CONTROL                 0x40000000UL
+#define CAPABILITY__SETFCAP                       0x80000000UL
+#define CAPABILITY2__MAC_OVERRIDE                 0x00000001UL
+#define CAPABILITY2__MAC_ADMIN                    0x00000002UL
 #define NETLINK_ROUTE_SOCKET__IOCTL               0x00000001UL
 #define NETLINK_ROUTE_SOCKET__READ                0x00000002UL
 #define NETLINK_ROUTE_SOCKET__WRITE               0x00000004UL
index b1b0d1d8f9503d11004ab32581a8d17e647ea16a..bd813c366e34d3e00025136fb131967ea3d033ca 100644 (file)
@@ -71,3 +71,4 @@
     S_(NULL)
     S_(NULL)
     S_("peer")
+    S_("capability2")
index 09e9dd23ee1a5f54345122b1f286852772e25227..febf8868e8524226c637565802b6efbb411f88be 100644 (file)
@@ -51,6 +51,7 @@
 #define SECCLASS_DCCP_SOCKET                             60
 #define SECCLASS_MEMPROTECT                              61
 #define SECCLASS_PEER                                    68
+#define SECCLASS_CAPABILITY2                             69
 
 /*
  * Security identifier indices for initial entities