Merge master.kernel.org:/home/rmk/linux-2.6-arm
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 8 Jun 2009 15:29:31 +0000 (08:29 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 8 Jun 2009 15:29:31 +0000 (08:29 -0700)
* master.kernel.org:/home/rmk/linux-2.6-arm:
  [ARM] 5543/1: arm: serial amba: add missing declaration in serial.h
  [ARM] pxa: fix pxa27x_udc default pullup GPIO
  [ARM] pxa/imote2: fix UCAM sensor board ADC model number
  mx[23]: don't put clock lookups in __initdata
  fix oops when using console=ttymxcN with N > 0
  [ARM] ARMv7 errata: only apply fixes when running on applicable CPU
  [ARM] 5534/1: kmalloc must return a cache line aligned buffer

43 files changed:
Makefile
arch/x86/kernel/cpu/cpufreq/powernow-k8.c
arch/x86/lguest/Makefile
arch/x86/lguest/boot.c
arch/x86/pci/mmconfig-shared.c
drivers/ata/ahci.c
drivers/ata/ata_piix.c
drivers/ata/pata_ali.c
drivers/ata/pata_efar.c
drivers/ata/pata_legacy.c
drivers/char/mem.c
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_crtc_helper.c
drivers/gpu/drm/drm_edid.c
drivers/gpu/drm/drm_irq.c
drivers/gpu/drm/drm_sysfs.c
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_crt.c
drivers/gpu/drm/i915/intel_dvo.c
drivers/gpu/drm/i915/intel_hdmi.c
drivers/gpu/drm/i915/intel_lvds.c
drivers/gpu/drm/i915/intel_sdvo.c
drivers/gpu/drm/i915/intel_tv.c
drivers/gpu/drm/radeon/radeon_cp.c
drivers/gpu/drm/radeon/radeon_drv.h
drivers/media/video/ivtv/ivtv-queue.c
drivers/mmc/host/mvsdio.c
drivers/mmc/host/mxcmmc.c
drivers/mmc/host/omap.c
drivers/mmc/host/omap_hsmmc.c
drivers/mmc/host/sdhci-of.c
drivers/mtd/nand/davinci_nand.c
drivers/pci/probe.c
fs/btrfs/extent-tree.c
fs/btrfs/volumes.c
fs/buffer.c
fs/inode.c
include/drm/drm_crtc.h
include/drm/drm_crtc_helper.h
include/linux/tracehook.h
kernel/fork.c
kernel/ptrace.c

index 610d1c332c45d1d8d2da3adc42e0fb0ad20c7123..106515492089ac4dfb857080f13b0bc77c367b35 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -533,7 +533,7 @@ endif
 
 include $(srctree)/arch/$(SRCARCH)/Makefile
 
-ifneq (CONFIG_FRAME_WARN,0)
+ifneq ($(CONFIG_FRAME_WARN),0)
 KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN})
 endif
 
index f6b32d11235733a1c2cf7153effc4fa42e68e251..35dc8fbe92bd1679ffe0bd5311e474134b6f2ddb 100644 (file)
@@ -835,7 +835,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
 {
        struct cpufreq_frequency_table *powernow_table;
        int ret_val = -ENODEV;
-       acpi_integer space_id;
+       acpi_integer control, status;
 
        if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) {
                dprintk("register performance failed: bad ACPI data\n");
@@ -848,12 +848,13 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
                goto err_out;
        }
 
-       space_id = data->acpi_data.control_register.space_id;
-       if ((space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) ||
-               (space_id != ACPI_ADR_SPACE_FIXED_HARDWARE)) {
+       control = data->acpi_data.control_register.space_id;
+       status = data->acpi_data.status_register.space_id;
+
+       if ((control != ACPI_ADR_SPACE_FIXED_HARDWARE) ||
+           (status != ACPI_ADR_SPACE_FIXED_HARDWARE)) {
                dprintk("Invalid control/status registers (%x - %x)\n",
-                       data->acpi_data.control_register.space_id,
-                       space_id);
+                       control, status);
                goto err_out;
        }
 
index 27f0c9ed7f602753e3765807750ec565401e5de0..94e0e54056a9bcbf71e0bbe0abcf9db495da22ae 100644 (file)
@@ -1 +1,2 @@
 obj-y          := i386_head.o boot.o
+CFLAGS_boot.o  := $(call cc-option, -fno-stack-protector)
index ca7ec44bafc3b313aa1e3919339042f8ed53cf20..33a93b41739612cafe1fe3d918c39a3915f86a78 100644 (file)
@@ -67,6 +67,7 @@
 #include <asm/mce.h>
 #include <asm/io.h>
 #include <asm/i387.h>
+#include <asm/stackprotector.h>
 #include <asm/reboot.h>                /* for struct machine_ops */
 
 /*G:010 Welcome to the Guest!
@@ -1088,13 +1089,21 @@ __init void lguest_init(void)
         * lguest_init() where the rest of the fairly chaotic boot setup
         * occurs. */
 
+       /* The stack protector is a weird thing where gcc places a canary
+        * value on the stack and then checks it on return.  This file is
+        * compiled with -fno-stack-protector it, so we got this far without
+        * problems.  The value of the canary is kept at offset 20 from the
+        * %gs register, so we need to set that up before calling C functions
+        * in other files. */
+       setup_stack_canary_segment(0);
+       /* We could just call load_stack_canary_segment(), but we might as
+        * call switch_to_new_gdt() which loads the whole table and sets up
+        * the per-cpu segment descriptor register %fs as well. */
+       switch_to_new_gdt(0);
+
        /* As described in head_32.S, we map the first 128M of memory. */
        max_pfn_mapped = (128*1024*1024) >> PAGE_SHIFT;
 
-       /* Load the %fs segment register (the per-cpu segment register) with
-        * the normal data segment to get through booting. */
-       asm volatile ("mov %0, %%fs" : : "r" (__KERNEL_DS) : "memory");
-
        /* The Host<->Guest Switcher lives at the top of our address space, and
         * the Host told us how big it is when we made LGUEST_INIT hypercall:
         * it put the answer in lguest_data.reserve_mem  */
index 5fa10bb9604f5efe9c18f58fc21b95bea5c5bed2..8766b0e216c5f1a139a7094630933670dd3f1cc4 100644 (file)
@@ -375,7 +375,7 @@ static acpi_status __init check_mcfg_resource(struct acpi_resource *res,
                if (!fixmem32)
                        return AE_OK;
                if ((mcfg_res->start >= fixmem32->address) &&
-                   (mcfg_res->end <= (fixmem32->address +
+                   (mcfg_res->end < (fixmem32->address +
                                      fixmem32->address_length))) {
                        mcfg_res->flags = 1;
                        return AE_CTRL_TERMINATE;
@@ -392,7 +392,7 @@ static acpi_status __init check_mcfg_resource(struct acpi_resource *res,
                return AE_OK;
 
        if ((mcfg_res->start >= address.minimum) &&
-           (mcfg_res->end <= (address.minimum + address.address_length))) {
+           (mcfg_res->end < (address.minimum + address.address_length))) {
                mcfg_res->flags = 1;
                return AE_CTRL_TERMINATE;
        }
@@ -418,7 +418,7 @@ static int __init is_acpi_reserved(u64 start, u64 end, unsigned not_used)
        struct resource mcfg_res;
 
        mcfg_res.start = start;
-       mcfg_res.end = end;
+       mcfg_res.end = end - 1;
        mcfg_res.flags = 0;
 
        acpi_get_devices("PNP0C01", find_mboard_resource, &mcfg_res, NULL);
index 08186ecbaf8d037c0e9f136802bb3577488bcab9..6b91c26a4635647ca1a29a175f0bd7a1b6e44245 100644 (file)
@@ -220,6 +220,7 @@ enum {
        AHCI_HFLAG_NO_HOTPLUG           = (1 << 7), /* ignore PxSERR.DIAG.N */
        AHCI_HFLAG_SECT255              = (1 << 8), /* max 255 sectors */
        AHCI_HFLAG_YES_NCQ              = (1 << 9), /* force NCQ cap on */
+       AHCI_HFLAG_NO_SUSPEND           = (1 << 10), /* don't suspend */
 
        /* ap->flags bits */
 
@@ -2316,9 +2317,17 @@ static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg)
 static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
 {
        struct ata_host *host = dev_get_drvdata(&pdev->dev);
+       struct ahci_host_priv *hpriv = host->private_data;
        void __iomem *mmio = host->iomap[AHCI_PCI_BAR];
        u32 ctl;
 
+       if (mesg.event & PM_EVENT_SUSPEND &&
+           hpriv->flags & AHCI_HFLAG_NO_SUSPEND) {
+               dev_printk(KERN_ERR, &pdev->dev,
+                          "BIOS update required for suspend/resume\n");
+               return -EIO;
+       }
+
        if (mesg.event & PM_EVENT_SLEEP) {
                /* AHCI spec rev1.1 section 8.3.3:
                 * Software must disable interrupts prior to requesting a
@@ -2610,6 +2619,63 @@ static bool ahci_broken_system_poweroff(struct pci_dev *pdev)
        return false;
 }
 
+static bool ahci_broken_suspend(struct pci_dev *pdev)
+{
+       static const struct dmi_system_id sysids[] = {
+               /*
+                * On HP dv[4-6] and HDX18 with earlier BIOSen, link
+                * to the harddisk doesn't become online after
+                * resuming from STR.  Warn and fail suspend.
+                */
+               {
+                       .ident = "dv4",
+                       .matches = {
+                               DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+                               DMI_MATCH(DMI_PRODUCT_NAME,
+                                         "HP Pavilion dv4 Notebook PC"),
+                       },
+                       .driver_data = "F.30", /* cutoff BIOS version */
+               },
+               {
+                       .ident = "dv5",
+                       .matches = {
+                               DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+                               DMI_MATCH(DMI_PRODUCT_NAME,
+                                         "HP Pavilion dv5 Notebook PC"),
+                       },
+                       .driver_data = "F.16", /* cutoff BIOS version */
+               },
+               {
+                       .ident = "dv6",
+                       .matches = {
+                               DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+                               DMI_MATCH(DMI_PRODUCT_NAME,
+                                         "HP Pavilion dv6 Notebook PC"),
+                       },
+                       .driver_data = "F.21",  /* cutoff BIOS version */
+               },
+               {
+                       .ident = "HDX18",
+                       .matches = {
+                               DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+                               DMI_MATCH(DMI_PRODUCT_NAME,
+                                         "HP HDX18 Notebook PC"),
+                       },
+                       .driver_data = "F.23",  /* cutoff BIOS version */
+               },
+               { }     /* terminate list */
+       };
+       const struct dmi_system_id *dmi = dmi_first_match(sysids);
+       const char *ver;
+
+       if (!dmi || pdev->bus->number || pdev->devfn != PCI_DEVFN(0x1f, 2))
+               return false;
+
+       ver = dmi_get_system_info(DMI_BIOS_VERSION);
+
+       return !ver || strcmp(ver, dmi->driver_data) < 0;
+}
+
 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        static int printed_version;
@@ -2715,6 +2781,12 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
                        "quirky BIOS, skipping spindown on poweroff\n");
        }
 
+       if (ahci_broken_suspend(pdev)) {
+               hpriv->flags |= AHCI_HFLAG_NO_SUSPEND;
+               dev_printk(KERN_WARNING, &pdev->dev,
+                          "BIOS update required for suspend/resume\n");
+       }
+
        /* CAP.NP sometimes indicate the index of the last enabled
         * port, at other times, that of the last possible port, so
         * determining the maximum port number requires looking at
index d51a17c0f59b2fa369616bc3c948988ed57d3d26..1aeb7082b0c4e34faecfb1d9f92ae14fbec766ca 100644 (file)
@@ -1455,6 +1455,15 @@ static bool piix_broken_system_poweroff(struct pci_dev *pdev)
                        /* PCI slot number of the controller */
                        .driver_data = (void *)0x1FUL,
                },
+               {
+                       .ident = "HP Compaq nc6000",
+                       .matches = {
+                               DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+                               DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nc6000"),
+                       },
+                       /* PCI slot number of the controller */
+                       .driver_data = (void *)0x1FUL,
+               },
 
                { }     /* terminate list */
        };
index 751b7ea4816cf90e34f81d245b7f2378d938b3e4..fc9c5d6d7d80a45ddcda3cc777af2a16be925bd0 100644 (file)
@@ -497,14 +497,16 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
        };
        /* Revision 0x20 added DMA */
        static const struct ata_port_info info_20 = {
-               .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_PIO_LBA48,
+               .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_PIO_LBA48 |
+                                                       ATA_FLAG_IGN_SIMPLEX,
                .pio_mask = ATA_PIO4,
                .mwdma_mask = ATA_MWDMA2,
                .port_ops = &ali_20_port_ops
        };
        /* Revision 0x20 with support logic added UDMA */
        static const struct ata_port_info info_20_udma = {
-               .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_PIO_LBA48,
+               .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_PIO_LBA48 |
+                                                       ATA_FLAG_IGN_SIMPLEX,
                .pio_mask = ATA_PIO4,
                .mwdma_mask = ATA_MWDMA2,
                .udma_mask = ATA_UDMA2,
@@ -512,7 +514,8 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
        };
        /* Revision 0xC2 adds UDMA66 */
        static const struct ata_port_info info_c2 = {
-               .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_PIO_LBA48,
+               .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_PIO_LBA48 |
+                                                       ATA_FLAG_IGN_SIMPLEX,
                .pio_mask = ATA_PIO4,
                .mwdma_mask = ATA_MWDMA2,
                .udma_mask = ATA_UDMA4,
@@ -520,7 +523,8 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
        };
        /* Revision 0xC3 is UDMA66 for now */
        static const struct ata_port_info info_c3 = {
-               .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_PIO_LBA48,
+               .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_PIO_LBA48 |
+                                                       ATA_FLAG_IGN_SIMPLEX,
                .pio_mask = ATA_PIO4,
                .mwdma_mask = ATA_MWDMA2,
                .udma_mask = ATA_UDMA4,
@@ -528,7 +532,8 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
        };
        /* Revision 0xC4 is UDMA100 */
        static const struct ata_port_info info_c4 = {
-               .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_PIO_LBA48,
+               .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_PIO_LBA48 |
+                                                       ATA_FLAG_IGN_SIMPLEX,
                .pio_mask = ATA_PIO4,
                .mwdma_mask = ATA_MWDMA2,
                .udma_mask = ATA_UDMA5,
@@ -536,7 +541,7 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
        };
        /* Revision 0xC5 is UDMA133 with LBA48 DMA */
        static const struct ata_port_info info_c5 = {
-               .flags = ATA_FLAG_SLAVE_POSS,
+               .flags = ATA_FLAG_SLAVE_POSS |  ATA_FLAG_IGN_SIMPLEX,
                .pio_mask = ATA_PIO4,
                .mwdma_mask = ATA_MWDMA2,
                .udma_mask = ATA_UDMA6,
index 2085e0a3a05a77a9bfe452de87e613503ca910a1..2a6412f5d117b9c61e66c13380a4045d5877f599 100644 (file)
@@ -22,7 +22,7 @@
 #include <linux/ata.h>
 
 #define DRV_NAME       "pata_efar"
-#define DRV_VERSION    "0.4.4"
+#define DRV_VERSION    "0.4.5"
 
 /**
  *     efar_pre_reset  -       Enable bits
@@ -98,18 +98,17 @@ static void efar_set_piomode (struct ata_port *ap, struct ata_device *adev)
                            { 2, 1 },
                            { 2, 3 }, };
 
-       if (pio > 2)
-               control |= 1;   /* TIME1 enable */
+       if (pio > 1)
+               control |= 1;   /* TIME */
        if (ata_pio_need_iordy(adev))   /* PIO 3/4 require IORDY */
-               control |= 2;   /* IE enable */
-       /* Intel specifies that the PPE functionality is for disk only */
+               control |= 2;   /* IE */
+       /* Intel specifies that the prefetch/posting is for disk only */
        if (adev->class == ATA_DEV_ATA)
-               control |= 4;   /* PPE enable */
+               control |= 4;   /* PPE */
 
        pci_read_config_word(dev, idetm_port, &idetm_data);
 
-       /* Enable PPE, IE and TIME as appropriate */
-
+       /* Set PPE, IE, and TIME as appropriate */
        if (adev->devno == 0) {
                idetm_data &= 0xCCF0;
                idetm_data |= control;
@@ -129,7 +128,7 @@ static void efar_set_piomode (struct ata_port *ap, struct ata_device *adev)
                pci_write_config_byte(dev, 0x44, slave_data);
        }
 
-       idetm_data |= 0x4000;   /* Ensure SITRE is enabled */
+       idetm_data |= 0x4000;   /* Ensure SITRE is set */
        pci_write_config_word(dev, idetm_port, idetm_data);
 }
 
index f72c6c5b820f9dbcad9f69f0e08211f98604797d..6932e56d179c8200a86905dbb6040916fc71c7b6 100644 (file)
@@ -48,6 +48,7 @@
  *
  */
 
+#include <linux/async.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -1028,6 +1029,7 @@ static __init int legacy_init_one(struct legacy_probe *probe)
                                &legacy_sht);
        if (ret)
                goto fail;
+       async_synchronize_full();
        ld->platform_dev = pdev;
 
        /* Nothing found means we drop the port as its probably not there */
index 8f05c38c2f0636c548e857218448556e8ecf76de..65e12bca657cfa0ba14f842ce6b442411f68bca6 100644 (file)
@@ -694,6 +694,9 @@ static ssize_t read_zero(struct file * file, char __user * buf,
                written += chunk - unwritten;
                if (unwritten)
                        break;
+               /* Consider changing this to just 'signal_pending()' with lots of testing */
+               if (fatal_signal_pending(current))
+                       return written ? written : -EINTR;
                buf += chunk;
                count -= chunk;
                cond_resched();
index 94a76887173444f0e8390014a0ff586eefbea8f8..8fab7890a363e6109a540bf5a98b08e9dae8fd1d 100644 (file)
@@ -2294,7 +2294,12 @@ int drm_mode_connector_property_set_ioctl(struct drm_device *dev,
                }
        }
 
-       if (connector->funcs->set_property)
+       /* Do DPMS ourselves */
+       if (property == connector->dev->mode_config.dpms_property) {
+               if (connector->funcs->dpms)
+                       (*connector->funcs->dpms)(connector, (int) out_resp->value);
+               ret = 0;
+       } else if (connector->funcs->set_property)
                ret = connector->funcs->set_property(connector, property, out_resp->value);
 
        /* store the property value if succesful */
index 45890447feecf26910f6b6d4dc9854c20c3b454d..a6f73f1e99d9b839e369861c5b24e4f17279b8aa 100644 (file)
@@ -198,6 +198,29 @@ static void drm_helper_add_std_modes(struct drm_device *dev,
        }
 }
 
+/**
+ * drm_helper_encoder_in_use - check if a given encoder is in use
+ * @encoder: encoder to check
+ *
+ * LOCKING:
+ * Caller must hold mode config lock.
+ *
+ * Walk @encoders's DRM device's mode_config and see if it's in use.
+ *
+ * RETURNS:
+ * True if @encoder is part of the mode_config, false otherwise.
+ */
+bool drm_helper_encoder_in_use(struct drm_encoder *encoder)
+{
+       struct drm_connector *connector;
+       struct drm_device *dev = encoder->dev;
+       list_for_each_entry(connector, &dev->mode_config.connector_list, head)
+               if (connector->encoder == encoder)
+                       return true;
+       return false;
+}
+EXPORT_SYMBOL(drm_helper_encoder_in_use);
+
 /**
  * drm_helper_crtc_in_use - check if a given CRTC is in a mode_config
  * @crtc: CRTC to check
@@ -216,7 +239,7 @@ bool drm_helper_crtc_in_use(struct drm_crtc *crtc)
        struct drm_device *dev = crtc->dev;
        /* FIXME: Locking around list access? */
        list_for_each_entry(encoder, &dev->mode_config.encoder_list, head)
-               if (encoder->crtc == crtc)
+               if (encoder->crtc == crtc && drm_helper_encoder_in_use(encoder))
                        return true;
        return false;
 }
@@ -240,7 +263,7 @@ void drm_helper_disable_unused_functions(struct drm_device *dev)
 
        list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
                encoder_funcs = encoder->helper_private;
-               if (!encoder->crtc)
+               if (!drm_helper_encoder_in_use(encoder))
                        (*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF);
        }
 
@@ -935,6 +958,88 @@ bool drm_helper_initial_config(struct drm_device *dev)
 }
 EXPORT_SYMBOL(drm_helper_initial_config);
 
+static int drm_helper_choose_encoder_dpms(struct drm_encoder *encoder)
+{
+       int dpms = DRM_MODE_DPMS_OFF;
+       struct drm_connector *connector;
+       struct drm_device *dev = encoder->dev;
+
+       list_for_each_entry(connector, &dev->mode_config.connector_list, head)
+               if (connector->encoder == encoder)
+                       if (connector->dpms < dpms)
+                               dpms = connector->dpms;
+       return dpms;
+}
+
+static int drm_helper_choose_crtc_dpms(struct drm_crtc *crtc)
+{
+       int dpms = DRM_MODE_DPMS_OFF;
+       struct drm_connector *connector;
+       struct drm_device *dev = crtc->dev;
+
+       list_for_each_entry(connector, &dev->mode_config.connector_list, head)
+               if (connector->encoder && connector->encoder->crtc == crtc)
+                       if (connector->dpms < dpms)
+                               dpms = connector->dpms;
+       return dpms;
+}
+
+/**
+ * drm_helper_connector_dpms
+ * @connector affected connector
+ * @mode DPMS mode
+ *
+ * Calls the low-level connector DPMS function, then
+ * calls appropriate encoder and crtc DPMS functions as well
+ */
+void drm_helper_connector_dpms(struct drm_connector *connector, int mode)
+{
+       struct drm_encoder *encoder = connector->encoder;
+       struct drm_crtc *crtc = encoder ? encoder->crtc : NULL;
+       int old_dpms;
+
+       if (mode == connector->dpms)
+               return;
+
+       old_dpms = connector->dpms;
+       connector->dpms = mode;
+
+       /* from off to on, do crtc then encoder */
+       if (mode < old_dpms) {
+               if (crtc) {
+                       struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
+                       if (crtc_funcs->dpms)
+                               (*crtc_funcs->dpms) (crtc,
+                                                    drm_helper_choose_crtc_dpms(crtc));
+               }
+               if (encoder) {
+                       struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
+                       if (encoder_funcs->dpms)
+                               (*encoder_funcs->dpms) (encoder,
+                                                       drm_helper_choose_encoder_dpms(encoder));
+               }
+       }
+
+       /* from on to off, do encoder then crtc */
+       if (mode > old_dpms) {
+               if (encoder) {
+                       struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
+                       if (encoder_funcs->dpms)
+                               (*encoder_funcs->dpms) (encoder,
+                                                       drm_helper_choose_encoder_dpms(encoder));
+               }
+               if (crtc) {
+                       struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
+                       if (crtc_funcs->dpms)
+                               (*crtc_funcs->dpms) (crtc,
+                                                    drm_helper_choose_crtc_dpms(crtc));
+               }
+       }
+
+       return;
+}
+EXPORT_SYMBOL(drm_helper_connector_dpms);
+
 /**
  * drm_hotplug_stage_two
  * @dev DRM device
index ca9c61656714b3da8ef3d76938c622e28aa3af13..6f6b26479d82281e98ff1f9998d5f472e6938201 100644 (file)
@@ -289,6 +289,11 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
        struct drm_display_mode *mode;
        struct detailed_pixel_timing *pt = &timing->data.pixel_data;
 
+       /* ignore tiny modes */
+       if (((pt->hactive_hi << 8) | pt->hactive_lo) < 64 ||
+           ((pt->vactive_hi << 8) | pt->hactive_lo) < 64)
+               return NULL;
+
        if (pt->stereo) {
                printk(KERN_WARNING "stereo mode not supported\n");
                return NULL;
index 93e677a481f5388f380bc86547297e8f87bddbb0..fc8e5acd9d9af489cdab27e31b2be81078c600db 100644 (file)
@@ -196,6 +196,7 @@ int drm_irq_install(struct drm_device *dev)
 {
        int ret = 0;
        unsigned long sh_flags = 0;
+       char *irqname;
 
        if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
                return -EINVAL;
@@ -227,8 +228,13 @@ int drm_irq_install(struct drm_device *dev)
        if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED))
                sh_flags = IRQF_SHARED;
 
+       if (dev->devname)
+               irqname = dev->devname;
+       else
+               irqname = dev->driver->name;
+
        ret = request_irq(drm_dev_to_irq(dev), dev->driver->irq_handler,
-                         sh_flags, dev->devname, dev);
+                         sh_flags, irqname, dev);
 
        if (ret < 0) {
                mutex_lock(&dev->struct_mutex);
index 8f9372921f8296cc0fe9961ad5afda7165215bfa..9987ab8808356d13b01c2540c085181e4f7db791 100644 (file)
@@ -147,7 +147,7 @@ static ssize_t status_show(struct device *device,
        enum drm_connector_status status;
 
        status = connector->funcs->detect(connector);
-       return snprintf(buf, PAGE_SIZE, "%s",
+       return snprintf(buf, PAGE_SIZE, "%s\n",
                        drm_get_connector_status_name(status));
 }
 
@@ -166,7 +166,7 @@ static ssize_t dpms_show(struct device *device,
        if (ret)
                return 0;
 
-       return snprintf(buf, PAGE_SIZE, "%s",
+       return snprintf(buf, PAGE_SIZE, "%s\n",
                        drm_get_dpms_name((int)dpms_status));
 }
 
@@ -176,7 +176,7 @@ static ssize_t enabled_show(struct device *device,
 {
        struct drm_connector *connector = to_drm_connector(device);
 
-       return snprintf(buf, PAGE_SIZE, connector->encoder ? "enabled" :
+       return snprintf(buf, PAGE_SIZE, "%s\n", connector->encoder ? "enabled" :
                        "disabled");
 }
 
@@ -317,6 +317,7 @@ static struct device_attribute connector_attrs_opt1[] = {
 
 static struct bin_attribute edid_attr = {
        .attr.name = "edid",
+       .attr.mode = 0444,
        .size = 128,
        .read = edid_show,
 };
index 53d5445526253138a2e572c64e9698054ee5fe8f..0ccb63ee50ee5fea5b2232e6b3b481c108d56f03 100644 (file)
@@ -987,12 +987,6 @@ static int i915_load_modeset_init(struct drm_device *dev)
        int fb_bar = IS_I9XX(dev) ? 2 : 0;
        int ret = 0;
 
-       dev->devname = kstrdup(DRIVER_NAME, GFP_KERNEL);
-       if (!dev->devname) {
-               ret = -ENOMEM;
-               goto out;
-       }
-
        dev->mode_config.fb_base = drm_get_resource_start(dev, fb_bar) &
                0xff000000;
 
@@ -1006,7 +1000,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
 
        ret = i915_probe_agp(dev, &agp_size, &prealloc_size);
        if (ret)
-               goto kfree_devname;
+               goto out;
 
        /* Basic memrange allocator for stolen space (aka vram) */
        drm_mm_init(&dev_priv->vram, 0, prealloc_size);
@@ -1024,7 +1018,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
 
        ret = i915_gem_init_ringbuffer(dev);
        if (ret)
-               goto kfree_devname;
+               goto out;
 
        /* Allow hardware batchbuffers unless told otherwise.
         */
@@ -1056,8 +1050,6 @@ static int i915_load_modeset_init(struct drm_device *dev)
 
 destroy_ringbuffer:
        i915_gem_cleanup_ringbuffer(dev);
-kfree_devname:
-       kfree(dev->devname);
 out:
        return ret;
 }
index 670d12881468297e8e0af0fe40222c3f54f5cb2f..39f5c658ef5e7c9754444672e86c166cd12a0191 100644 (file)
@@ -2260,9 +2260,6 @@ try_again:
                        goto try_again;
                }
 
-               BUG_ON(old_obj_priv->active ||
-                      (reg->obj->write_domain & I915_GEM_GPU_DOMAINS));
-
                /*
                 * Zap this virtual mapping so we can set up a fence again
                 * for this object next time we need it.
index 640f5158effc742d489942fdc01db5fb024cc52a..79acc4f4c1f803911ba7a99c72846b1f9f0b2db3 100644 (file)
@@ -381,11 +381,6 @@ static int intel_crt_set_property(struct drm_connector *connector,
                                  struct drm_property *property,
                                  uint64_t value)
 {
-       struct drm_device *dev = connector->dev;
-
-       if (property == dev->mode_config.dpms_property && connector->encoder)
-               intel_crt_dpms(connector->encoder, (uint32_t)(value & 0xf));
-
        return 0;
 }
 
@@ -402,6 +397,7 @@ static const struct drm_encoder_helper_funcs intel_crt_helper_funcs = {
 };
 
 static const struct drm_connector_funcs intel_crt_connector_funcs = {
+       .dpms = drm_helper_connector_dpms,
        .detect = intel_crt_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
        .destroy = intel_crt_destroy,
index 8b8d6e65cd3fe2179056bce7860c61c74895820c..1ee3007d6ec04e062e8d18fd482047687b1ea026 100644 (file)
@@ -316,6 +316,7 @@ static const struct drm_encoder_helper_funcs intel_dvo_helper_funcs = {
 };
 
 static const struct drm_connector_funcs intel_dvo_connector_funcs = {
+       .dpms = drm_helper_connector_dpms,
        .save = intel_dvo_save,
        .restore = intel_dvo_restore,
        .detect = intel_dvo_detect,
index d0983bb93a18e4cbc6a5af57198adfa2c8f5254d..7d6bdd705326e4443b5dfe1b66981e8c06375307 100644 (file)
@@ -219,6 +219,7 @@ static const struct drm_encoder_helper_funcs intel_hdmi_helper_funcs = {
 };
 
 static const struct drm_connector_funcs intel_hdmi_connector_funcs = {
+       .dpms = drm_helper_connector_dpms,
        .save = intel_hdmi_save,
        .restore = intel_hdmi_restore,
        .detect = intel_hdmi_detect,
index 53731f0ffcb52b4d3444cdfe659f38b5fec479a0..53cccfa58b951012f127ce79891a6d7eca79d288 100644 (file)
@@ -343,11 +343,6 @@ static int intel_lvds_set_property(struct drm_connector *connector,
                                   struct drm_property *property,
                                   uint64_t value)
 {
-       struct drm_device *dev = connector->dev;
-
-       if (property == dev->mode_config.dpms_property && connector->encoder)
-               intel_lvds_dpms(connector->encoder, (uint32_t)(value & 0xf));
-
        return 0;
 }
 
@@ -366,6 +361,7 @@ static const struct drm_connector_helper_funcs intel_lvds_connector_helper_funcs
 };
 
 static const struct drm_connector_funcs intel_lvds_connector_funcs = {
+       .dpms = drm_helper_connector_dpms,
        .save = intel_lvds_save,
        .restore = intel_lvds_restore,
        .detect = intel_lvds_detect,
@@ -391,7 +387,7 @@ static int __init intel_no_lvds_dmi_callback(const struct dmi_system_id *id)
 }
 
 /* These systems claim to have LVDS, but really don't */
-static const struct dmi_system_id __initdata intel_no_lvds[] = {
+static const struct dmi_system_id intel_no_lvds[] = {
        {
                .callback = intel_no_lvds_dmi_callback,
                .ident = "Apple Mac Mini (Core series)",
index f3ef6bfd8ffc93fe0cab884238ddc0043cc4bcaf..3093b4d4a4ddb2329d407a09aa17bce413d5e77f 100644 (file)
@@ -1616,6 +1616,7 @@ static const struct drm_encoder_helper_funcs intel_sdvo_helper_funcs = {
 };
 
 static const struct drm_connector_funcs intel_sdvo_connector_funcs = {
+       .dpms = drm_helper_connector_dpms,
        .save = intel_sdvo_save,
        .restore = intel_sdvo_restore,
        .detect = intel_sdvo_detect,
index d2c32983242dcda215d17badc211378711ed9750..98ac0546b7bd97ea924eb2d44e3e456ca91c8c2c 100644 (file)
@@ -1626,6 +1626,7 @@ static const struct drm_encoder_helper_funcs intel_tv_helper_funcs = {
 };
 
 static const struct drm_connector_funcs intel_tv_connector_funcs = {
+       .dpms = drm_helper_connector_dpms,
        .save = intel_tv_save,
        .restore = intel_tv_restore,
        .detect = intel_tv_detect,
index 77a7a4d846508f8e2f1e89aee9b0f3ff812cd84a..aff90bb964885568567f17d43a2f1b8dd79f179c 100644 (file)
@@ -2185,9 +2185,9 @@ void radeon_commit_ring(drm_radeon_private_t *dev_priv)
 
        /* check if the ring is padded out to 16-dword alignment */
 
-       tail_aligned = dev_priv->ring.tail & 0xf;
+       tail_aligned = dev_priv->ring.tail & (RADEON_RING_ALIGN-1);
        if (tail_aligned) {
-               int num_p2 = 16 - tail_aligned;
+               int num_p2 = RADEON_RING_ALIGN - tail_aligned;
 
                ring = dev_priv->ring.start;
                /* pad with some CP_PACKET2 */
index 8071d965f1428871b98df31bc68440bdd40b4ba3..0c6bfc1de153108fe2780b3d49978a26a008a9b7 100644 (file)
@@ -1964,11 +1964,14 @@ do {                                                            \
 
 #define RING_LOCALS    int write, _nr, _align_nr; unsigned int mask; u32 *ring;
 
+#define RADEON_RING_ALIGN 16
+
 #define BEGIN_RING( n ) do {                                           \
        if ( RADEON_VERBOSE ) {                                         \
                DRM_INFO( "BEGIN_RING( %d )\n", (n));                   \
        }                                                               \
-       _align_nr = (n + 0xf) & ~0xf;                                   \
+       _align_nr = RADEON_RING_ALIGN - ((dev_priv->ring.tail + n) & (RADEON_RING_ALIGN-1));    \
+       _align_nr += n;                                                 \
        if (dev_priv->ring.space <= (_align_nr * sizeof(u32))) {        \
                 COMMIT_RING();                                         \
                radeon_wait_ring( dev_priv, _align_nr * sizeof(u32));   \
index ff7b7deded4f5108def042ffc8e6cdf665982201..7fde36e6d22704b9fd8a748c88e67188422d1520 100644 (file)
@@ -230,7 +230,8 @@ int ivtv_stream_alloc(struct ivtv_stream *s)
                return -ENOMEM;
        }
        if (ivtv_might_use_dma(s)) {
-               s->sg_handle = pci_map_single(itv->pdev, s->sg_dma, sizeof(struct ivtv_sg_element), s->dma);
+               s->sg_handle = pci_map_single(itv->pdev, s->sg_dma,
+                               sizeof(struct ivtv_sg_element), PCI_DMA_TODEVICE);
                ivtv_stream_sync_for_cpu(s);
        }
 
index c643d0fe118f1369dc63439bba6aa1e4dbbf9021..b56d72ff06e9efbf169d5b2f0c7af2c4f6e7589e 100644 (file)
@@ -64,6 +64,31 @@ static int mvsd_setup_data(struct mvsd_host *host, struct mmc_data *data)
        unsigned int tmout;
        int tmout_index;
 
+       /*
+        * Hardware weirdness.  The FIFO_EMPTY bit of the HW_STATE
+        * register is sometimes not set before a while when some
+        * "unusual" data block sizes are used (such as with the SWITCH
+        * command), even despite the fact that the XFER_DONE interrupt
+        * was raised.  And if another data transfer starts before
+        * this bit comes to good sense (which eventually happens by
+        * itself) then the new transfer simply fails with a timeout.
+        */
+       if (!(mvsd_read(MVSD_HW_STATE) & (1 << 13))) {
+               unsigned long t = jiffies + HZ;
+               unsigned int hw_state,  count = 0;
+               do {
+                       if (time_after(jiffies, t)) {
+                               dev_warn(host->dev, "FIFO_EMPTY bit missing\n");
+                               break;
+                       }
+                       hw_state = mvsd_read(MVSD_HW_STATE);
+                       count++;
+               } while (!(hw_state & (1 << 13)));
+               dev_dbg(host->dev, "*** wait for FIFO_EMPTY bit "
+                                  "(hw=0x%04x, count=%d, jiffies=%ld)\n",
+                                  hw_state, count, jiffies - (t - HZ));
+       }
+
        /* If timeout=0 then maximum timeout index is used. */
        tmout = DIV_ROUND_UP(data->timeout_ns, host->ns_per_clk);
        tmout += data->timeout_clks;
@@ -620,9 +645,18 @@ static void mvsd_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
        if (ios->bus_width == MMC_BUS_WIDTH_4)
                ctrl_reg |= MVSD_HOST_CTRL_DATA_WIDTH_4_BITS;
 
+       /*
+        * The HI_SPEED_EN bit is causing trouble with many (but not all)
+        * high speed SD, SDHC and SDIO cards.  Not enabling that bit
+        * makes all cards work.  So let's just ignore that bit for now
+        * and revisit this issue if problems for not enabling this bit
+        * are ever reported.
+        */
+#if 0
        if (ios->timing == MMC_TIMING_MMC_HS ||
            ios->timing == MMC_TIMING_SD_HS)
                ctrl_reg |= MVSD_HOST_CTRL_HI_SPEED_EN;
+#endif
 
        host->ctrl = ctrl_reg;
        mvsd_write(MVSD_HOST_CTRL, ctrl_reg);
@@ -882,3 +916,4 @@ module_param(nodma, int, 0);
 MODULE_AUTHOR("Maen Suleiman, Nicolas Pitre");
 MODULE_DESCRIPTION("Marvell MMC,SD,SDIO Host Controller driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:mvsdio");
index b4a615c55f28b5e4a8e9fb681dcc188771c8224d..f4cbe473670e0ad0a096fa43d12302b67490fadf 100644 (file)
@@ -140,6 +140,8 @@ struct mxcmci_host {
        struct work_struct      datawork;
 };
 
+static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios);
+
 static inline int mxcmci_use_dma(struct mxcmci_host *host)
 {
        return host->do_dma;
@@ -160,7 +162,7 @@ static void mxcmci_softreset(struct mxcmci_host *host)
        writew(0xff, host->base + MMC_REG_RES_TO);
 }
 
-static void mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
+static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
 {
        unsigned int nob = data->blocks;
        unsigned int blksz = data->blksz;
@@ -168,6 +170,7 @@ static void mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
 #ifdef HAS_DMA
        struct scatterlist *sg;
        int i;
+       int ret;
 #endif
        if (data->flags & MMC_DATA_STREAM)
                nob = 0xffff;
@@ -183,7 +186,7 @@ static void mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
        for_each_sg(data->sg, sg, data->sg_len, i) {
                if (sg->offset & 3 || sg->length & 3) {
                        host->do_dma = 0;
-                       return;
+                       return 0;
                }
        }
 
@@ -192,23 +195,30 @@ static void mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
                host->dma_nents = dma_map_sg(mmc_dev(host->mmc), data->sg,
                                             data->sg_len,  host->dma_dir);
 
-               imx_dma_setup_sg(host->dma, data->sg, host->dma_nents, datasize,
-                                host->res->start + MMC_REG_BUFFER_ACCESS,
-                                DMA_MODE_READ);
+               ret = imx_dma_setup_sg(host->dma, data->sg, host->dma_nents,
+                               datasize,
+                               host->res->start + MMC_REG_BUFFER_ACCESS,
+                               DMA_MODE_READ);
        } else {
                host->dma_dir = DMA_TO_DEVICE;
                host->dma_nents = dma_map_sg(mmc_dev(host->mmc), data->sg,
                                             data->sg_len,  host->dma_dir);
 
-               imx_dma_setup_sg(host->dma, data->sg, host->dma_nents, datasize,
-                                host->res->start + MMC_REG_BUFFER_ACCESS,
-                                DMA_MODE_WRITE);
+               ret = imx_dma_setup_sg(host->dma, data->sg, host->dma_nents,
+                               datasize,
+                               host->res->start + MMC_REG_BUFFER_ACCESS,
+                               DMA_MODE_WRITE);
        }
 
+       if (ret) {
+               dev_err(mmc_dev(host->mmc), "failed to setup DMA : %d\n", ret);
+               return ret;
+       }
        wmb();
 
        imx_dma_enable(host->dma);
 #endif /* HAS_DMA */
+       return 0;
 }
 
 static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd,
@@ -345,8 +355,11 @@ static int mxcmci_poll_status(struct mxcmci_host *host, u32 mask)
                stat = readl(host->base + MMC_REG_STATUS);
                if (stat & STATUS_ERR_MASK)
                        return stat;
-               if (time_after(jiffies, timeout))
+               if (time_after(jiffies, timeout)) {
+                       mxcmci_softreset(host);
+                       mxcmci_set_clk_rate(host, host->clock);
                        return STATUS_TIME_OUT_READ;
+               }
                if (stat & mask)
                        return 0;
                cpu_relax();
@@ -531,6 +544,7 @@ static void mxcmci_request(struct mmc_host *mmc, struct mmc_request *req)
 {
        struct mxcmci_host *host = mmc_priv(mmc);
        unsigned int cmdat = host->cmdat;
+       int error;
 
        WARN_ON(host->req != NULL);
 
@@ -540,7 +554,12 @@ static void mxcmci_request(struct mmc_host *mmc, struct mmc_request *req)
        host->do_dma = 1;
 #endif
        if (req->data) {
-               mxcmci_setup_data(host, req->data);
+               error = mxcmci_setup_data(host, req->data);
+               if (error) {
+                       req->cmd->error = error;
+                       goto out;
+               }
+
 
                cmdat |= CMD_DAT_CONT_DATA_ENABLE;
 
@@ -548,7 +567,9 @@ static void mxcmci_request(struct mmc_host *mmc, struct mmc_request *req)
                        cmdat |= CMD_DAT_CONT_WRITE;
        }
 
-       if (mxcmci_start_cmd(host, req->cmd, cmdat))
+       error = mxcmci_start_cmd(host, req->cmd, cmdat);
+out:
+       if (error)
                mxcmci_finish_request(host, req);
 }
 
@@ -724,7 +745,9 @@ static int mxcmci_probe(struct platform_device *pdev)
                goto out_clk_put;
        }
 
-       mmc->f_min = clk_get_rate(host->clk) >> 7;
+       mmc->f_min = clk_get_rate(host->clk) >> 16;
+       if (mmc->f_min < 400000)
+               mmc->f_min = 400000;
        mmc->f_max = clk_get_rate(host->clk) >> 1;
 
        /* recommended in data sheet */
index bfa25c01c8722f17684520b1ab3adfee9bdef193..dceb5ee3bda068da5668b87783f9cd8339e9207f 100644 (file)
@@ -822,7 +822,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
                del_timer(&host->cmd_abort_timer);
                host->abort = 1;
                OMAP_MMC_WRITE(host, IE, 0);
-               disable_irq(host->irq);
+               disable_irq_nosync(host->irq);
                schedule_work(&host->cmd_abort_work);
                return IRQ_HANDLED;
        }
index e62a22a7f00cb10089ab36424793aa498a81284f..c40cb96255a2c92a6e395df960dd7989b9143800 100644 (file)
@@ -680,7 +680,7 @@ static void mmc_omap_dma_cb(int lch, u16 ch_status, void *data)
        host->dma_ch = -1;
        /*
         * DMA Callback: run in interrupt context.
-        * mutex_unlock will through a kernel warning if used.
+        * mutex_unlock will throw a kernel warning if used.
         */
        up(&host->sem);
 }
index 3ff4ac3abe8b779a4edcd71390676da81a5e4b71..128c614d11aa2d8d2446762cf1e97a123d2f99e5 100644 (file)
@@ -55,7 +55,13 @@ static u32 esdhc_readl(struct sdhci_host *host, int reg)
 
 static u16 esdhc_readw(struct sdhci_host *host, int reg)
 {
-       return in_be16(host->ioaddr + (reg ^ 0x2));
+       u16 ret;
+
+       if (unlikely(reg == SDHCI_HOST_VERSION))
+               ret = in_be16(host->ioaddr + reg);
+       else
+               ret = in_be16(host->ioaddr + (reg ^ 0x2));
+       return ret;
 }
 
 static u8 esdhc_readb(struct sdhci_host *host, int reg)
@@ -277,6 +283,7 @@ static int __devexit sdhci_of_remove(struct of_device *ofdev)
 static const struct of_device_id sdhci_of_match[] = {
        { .compatible = "fsl,mpc8379-esdhc", .data = &sdhci_esdhc, },
        { .compatible = "fsl,mpc8536-esdhc", .data = &sdhci_esdhc, },
+       { .compatible = "fsl,esdhc", .data = &sdhci_esdhc, },
        { .compatible = "generic-sdhci", },
        {},
 };
index 0119220de7d03c8d4f1b25ff0b46615b262814da..02700f769b8aaca397e830068aeb93419d498834 100644 (file)
@@ -407,16 +407,17 @@ static int __init nand_davinci_probe(struct platform_device *pdev)
        }
        info->chip.ecc.mode = ecc_mode;
 
-       info->clk = clk_get(&pdev->dev, "AEMIFCLK");
+       info->clk = clk_get(&pdev->dev, "aemif");
        if (IS_ERR(info->clk)) {
                ret = PTR_ERR(info->clk);
-               dev_dbg(&pdev->dev, "unable to get AEMIFCLK, err %d\n", ret);
+               dev_dbg(&pdev->dev, "unable to get AEMIF clock, err %d\n", ret);
                goto err_clk;
        }
 
        ret = clk_enable(info->clk);
        if (ret < 0) {
-               dev_dbg(&pdev->dev, "unable to enable AEMIFCLK, err %d\n", ret);
+               dev_dbg(&pdev->dev, "unable to enable AEMIF clock, err %d\n",
+                       ret);
                goto err_clk_enable;
        }
 
index e3c3e081b83431755b7c3e875c84e5e7bc30f684..f1ae2475ffffcd827844694c0075448d62cfb3e1 100644 (file)
@@ -745,6 +745,8 @@ int pci_setup_device(struct pci_dev *dev)
 
        /* Early fixups, before probing the BARs */
        pci_fixup_device(pci_fixup_early, dev);
+       /* device class may be changed after fixup */
+       class = dev->class >> 8;
 
        switch (dev->hdr_type) {                    /* header type */
        case PCI_HEADER_TYPE_NORMAL:                /* standard header */
index 3e2c7c738f23844c0a401faac13db203304b7e9c..35af933550630ce7bcae0a5b5a1632492f51ab0a 100644 (file)
@@ -2622,7 +2622,18 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
                                                       search_start);
                if (block_group && block_group_bits(block_group, data)) {
                        down_read(&space_info->groups_sem);
-                       goto have_block_group;
+                       if (list_empty(&block_group->list) ||
+                           block_group->ro) {
+                               /*
+                                * someone is removing this block group,
+                                * we can't jump into the have_block_group
+                                * target because our list pointers are not
+                                * valid
+                                */
+                               btrfs_put_block_group(block_group);
+                               up_read(&space_info->groups_sem);
+                       } else
+                               goto have_block_group;
                } else if (block_group) {
                        btrfs_put_block_group(block_group);
                }
@@ -2656,6 +2667,13 @@ have_block_group:
                         * people trying to start a new cluster
                         */
                        spin_lock(&last_ptr->refill_lock);
+                       if (last_ptr->block_group &&
+                           (last_ptr->block_group->ro ||
+                           !block_group_bits(last_ptr->block_group, data))) {
+                               offset = 0;
+                               goto refill_cluster;
+                       }
+
                        offset = btrfs_alloc_from_cluster(block_group, last_ptr,
                                                 num_bytes, search_start);
                        if (offset) {
@@ -2681,10 +2699,17 @@ have_block_group:
 
                                last_ptr_loop = 1;
                                search_start = block_group->key.objectid;
+                               /*
+                                * we know this block group is properly
+                                * in the list because
+                                * btrfs_remove_block_group, drops the
+                                * cluster before it removes the block
+                                * group from the list
+                                */
                                goto have_block_group;
                        }
                        spin_unlock(&last_ptr->lock);
-
+refill_cluster:
                        /*
                         * this cluster didn't work out, free it and
                         * start over
@@ -5968,6 +5993,7 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
 {
        struct btrfs_path *path;
        struct btrfs_block_group_cache *block_group;
+       struct btrfs_free_cluster *cluster;
        struct btrfs_key key;
        int ret;
 
@@ -5979,6 +6005,21 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
 
        memcpy(&key, &block_group->key, sizeof(key));
 
+       /* make sure this block group isn't part of an allocation cluster */
+       cluster = &root->fs_info->data_alloc_cluster;
+       spin_lock(&cluster->refill_lock);
+       btrfs_return_cluster_to_free_space(block_group, cluster);
+       spin_unlock(&cluster->refill_lock);
+
+       /*
+        * make sure this block group isn't part of a metadata
+        * allocation cluster
+        */
+       cluster = &root->fs_info->meta_alloc_cluster;
+       spin_lock(&cluster->refill_lock);
+       btrfs_return_cluster_to_free_space(block_group, cluster);
+       spin_unlock(&cluster->refill_lock);
+
        path = btrfs_alloc_path();
        BUG_ON(!path);
 
@@ -5988,7 +6029,11 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
        spin_unlock(&root->fs_info->block_group_cache_lock);
        btrfs_remove_free_space_cache(block_group);
        down_write(&block_group->space_info->groups_sem);
-       list_del(&block_group->list);
+       /*
+        * we must use list_del_init so people can check to see if they
+        * are still on the list after taking the semaphore
+        */
+       list_del_init(&block_group->list);
        up_write(&block_group->space_info->groups_sem);
 
        spin_lock(&block_group->space_info->lock);
index 5f01dad4b696352f211106b4c9bd0024268913b6..a6d35b0054ca7a0d8a83ed2708b3610cb10229d9 100644 (file)
@@ -1440,6 +1440,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
        device->io_align = root->sectorsize;
        device->sector_size = root->sectorsize;
        device->total_bytes = i_size_read(bdev->bd_inode);
+       device->disk_total_bytes = device->total_bytes;
        device->dev_root = root->fs_info->dev_root;
        device->bdev = bdev;
        device->in_fs_metadata = 1;
index aed297739eb0796d8c6212842003fb2976c5fba0..49106127a4aa5f8f480dbd61968c0c6d0acd6b58 100644 (file)
@@ -2736,6 +2736,8 @@ has_buffers:
                pos += blocksize;
        }
 
+       map_bh.b_size = blocksize;
+       map_bh.b_state = 0;
        err = get_block(inode, iblock, &map_bh, 0);
        if (err)
                goto unlock;
index 0571983755dcdfa8b86ca89d5ccc2db1ed213027..bca0c618fdb35cc762c772b8cf3fe06c31e6b5e4 100644 (file)
@@ -219,6 +219,7 @@ static struct inode *alloc_inode(struct super_block *sb)
 void destroy_inode(struct inode *inode)
 {
        BUG_ON(inode_has_buffers(inode));
+       ima_inode_free(inode);
        security_inode_free(inode);
        if (inode->i_sb->s_op->destroy_inode)
                inode->i_sb->s_op->destroy_inode(inode);
@@ -1053,13 +1054,22 @@ int insert_inode_locked(struct inode *inode)
        struct super_block *sb = inode->i_sb;
        ino_t ino = inode->i_ino;
        struct hlist_head *head = inode_hashtable + hash(sb, ino);
-       struct inode *old;
 
        inode->i_state |= I_LOCK|I_NEW;
        while (1) {
+               struct hlist_node *node;
+               struct inode *old = NULL;
                spin_lock(&inode_lock);
-               old = find_inode_fast(sb, head, ino);
-               if (likely(!old)) {
+               hlist_for_each_entry(old, node, head, i_hash) {
+                       if (old->i_ino != ino)
+                               continue;
+                       if (old->i_sb != sb)
+                               continue;
+                       if (old->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE))
+                               continue;
+                       break;
+               }
+               if (likely(!node)) {
                        hlist_add_head(&inode->i_hash, head);
                        spin_unlock(&inode_lock);
                        return 0;
@@ -1081,14 +1091,24 @@ int insert_inode_locked4(struct inode *inode, unsigned long hashval,
 {
        struct super_block *sb = inode->i_sb;
        struct hlist_head *head = inode_hashtable + hash(sb, hashval);
-       struct inode *old;
 
        inode->i_state |= I_LOCK|I_NEW;
 
        while (1) {
+               struct hlist_node *node;
+               struct inode *old = NULL;
+
                spin_lock(&inode_lock);
-               old = find_inode(sb, head, test, data);
-               if (likely(!old)) {
+               hlist_for_each_entry(old, node, head, i_hash) {
+                       if (old->i_sb != sb)
+                               continue;
+                       if (!test(old, data))
+                               continue;
+                       if (old->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE))
+                               continue;
+                       break;
+               }
+               if (likely(!node)) {
                        hlist_add_head(&inode->i_hash, head);
                        spin_unlock(&inode_lock);
                        return 0;
index 3c1924c010e8c3a2898bbb908f778b1ebed27bf4..7300fb86676730cf39173c844178f7ecdbbfe0db 100644 (file)
@@ -471,6 +471,9 @@ struct drm_connector {
        u32 property_ids[DRM_CONNECTOR_MAX_PROPERTY];
        uint64_t property_values[DRM_CONNECTOR_MAX_PROPERTY];
 
+       /* requested DPMS state */
+       int dpms;
+
        void *helper_private;
 
        uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER];
index ec073d8288d9438005796a121dd6815d204d2bcc..6769ff6c1bc07fd3311d6dd5da066c75225fd625 100644 (file)
@@ -99,6 +99,8 @@ extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
                                     struct drm_framebuffer *old_fb);
 extern bool drm_helper_crtc_in_use(struct drm_crtc *crtc);
 
+extern void drm_helper_connector_dpms(struct drm_connector *connector, int mode);
+
 extern int drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb,
                                          struct drm_mode_fb_cmd *mode_cmd);
 
index c7aa154f4bfcf97081048f4e8ab59ef6fa8147ed..eb96603d92db0d556141cacf771ca01b26bd779d 100644 (file)
@@ -259,14 +259,12 @@ static inline void tracehook_finish_clone(struct task_struct *child,
 
 /**
  * tracehook_report_clone - in parent, new child is about to start running
- * @trace:             return value from tracehook_prepare_clone()
  * @regs:              parent's user register state
  * @clone_flags:       flags from parent's system call
  * @pid:               new child's PID in the parent's namespace
  * @child:             new child task
  *
- * Called after a child is set up, but before it has been started
- * running.  @trace is the value returned by tracehook_prepare_clone().
+ * Called after a child is set up, but before it has been started running.
  * This is not a good place to block, because the child has not started
  * yet.  Suspend the child here if desired, and then block in
  * tracehook_report_clone_complete().  This must prevent the child from
@@ -276,13 +274,14 @@ static inline void tracehook_finish_clone(struct task_struct *child,
  *
  * Called with no locks held, but the child cannot run until this returns.
  */
-static inline void tracehook_report_clone(int trace, struct pt_regs *regs,
+static inline void tracehook_report_clone(struct pt_regs *regs,
                                          unsigned long clone_flags,
                                          pid_t pid, struct task_struct *child)
 {
-       if (unlikely(trace) || unlikely(clone_flags & CLONE_PTRACE)) {
+       if (unlikely(task_ptrace(child))) {
                /*
-                * The child starts up with an immediate SIGSTOP.
+                * It doesn't matter who attached/attaching to this
+                * task, the pending SIGSTOP is right in any case.
                 */
                sigaddset(&child->pending.signal, SIGSTOP);
                set_tsk_thread_flag(child, TIF_SIGPENDING);
index b9e2edd00726538467877d458d7aeb7771c03015..875ffbdd96d09ccb2a9587636f472b8b8278cbfd 100644 (file)
@@ -1409,7 +1409,7 @@ long do_fork(unsigned long clone_flags,
                }
 
                audit_finish_fork(p);
-               tracehook_report_clone(trace, regs, clone_flags, nr, p);
+               tracehook_report_clone(regs, clone_flags, nr, p);
 
                /*
                 * We set PF_STARTING at creation in case tracing wants to
index 0692ab5a0d672341000d1697d7c308c566060fb4..42c317874cfa8d2703c13f3c44757a6f397459ac 100644 (file)
@@ -304,6 +304,8 @@ int ptrace_detach(struct task_struct *child, unsigned int data)
        if (child->ptrace) {
                child->exit_code = data;
                dead = __ptrace_detach(current, child);
+               if (!child->exit_state)
+                       wake_up_process(child);
        }
        write_unlock_irq(&tasklist_lock);