Merge branch 'msm-urgent' of git://codeaurora.org/quic/kernel/dwalker/linux-msm
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 9 Jun 2010 16:45:46 +0000 (09:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 9 Jun 2010 16:45:46 +0000 (09:45 -0700)
* 'msm-urgent' of git://codeaurora.org/quic/kernel/dwalker/linux-msm:
  mmc: msm: fix compile error on MSM7x30
  msm: dma: add completion.h header

57 files changed:
arch/microblaze/include/asm/page.h
arch/microblaze/kernel/dma.c
arch/s390/appldata/appldata_os.c
arch/s390/defconfig
arch/s390/kernel/module.c
arch/s390/kvm/kvm-s390.c
arch/s390/kvm/sigp.c
arch/s390/mm/extmem.c
drivers/ata/libahci.c
drivers/ata/sata_sil24.c
drivers/ata/sata_via.c
drivers/firewire/core-card.c
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_fb_helper.c
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_fb.c
drivers/gpu/drm/nouveau/nouveau_bios.c
drivers/gpu/drm/nouveau/nouveau_fbcon.c
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/nouveau/nv50_fb.c
drivers/gpu/drm/nouveau/nv50_gpio.c
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r420.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_atombios.c
drivers/gpu/drm/radeon/radeon_combios.c
drivers/gpu/drm/radeon/radeon_display.c
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/radeon/radeon_fb.c
drivers/gpu/drm/radeon/radeon_kms.c
drivers/gpu/drm/radeon/radeon_legacy_encoders.c
drivers/gpu/drm/radeon/radeon_pm.c
drivers/gpu/drm/radeon/rv770.c
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
drivers/input/misc/hp_sdc_rtc.c
drivers/mtd/mtdchar.c
drivers/mtd/nand/Kconfig
drivers/mtd/nand/r852.c
drivers/pci/quirks.c
drivers/s390/cio/itcw.c
drivers/vhost/net.c
drivers/watchdog/wm8350_wdt.c
fs/jffs2/acl.c
fs/jffs2/dir.c
fs/jffs2/fs.c
fs/xfs/linux-2.6/xfs_aops.c
include/drm/radeon_drm.h
include/linux/miscdevice.h
include/linux/pci_ids.h
include/linux/writeback.h
include/trace/events/ext4.h
mm/page-writeback.c

index de493f8..464ff32 100644 (file)
@@ -34,6 +34,8 @@
 /* MS be sure that SLAB allocates aligned objects */
 #define ARCH_KMALLOC_MINALIGN  L1_CACHE_BYTES
 
+#define ARCH_SLAB_MINALIGN     L1_CACHE_BYTES
+
 #define PAGE_UP(addr)  (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1)))
 #define PAGE_DOWN(addr)        ((addr)&(~((PAGE_SIZE)-1)))
 
index 9dcd90b..79c7465 100644 (file)
@@ -90,7 +90,6 @@ static int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl,
        /* FIXME this part of code is untested */
        for_each_sg(sgl, sg, nents, i) {
                sg->dma_address = sg_phys(sg) + get_dma_direct_offset(dev);
-               sg->dma_length = sg->length;
                __dma_sync_page(page_to_phys(sg_page(sg)), sg->offset,
                                                        sg->length, direction);
        }
index 55c80ff..92f1cb7 100644 (file)
@@ -181,7 +181,7 @@ static int __init appldata_os_init(void)
                goto out;
        }
 
-       appldata_os_data = kzalloc(max_size, GFP_DMA);
+       appldata_os_data = kzalloc(max_size, GFP_KERNEL | GFP_DMA);
        if (appldata_os_data == NULL) {
                rc = -ENOMEM;
                goto out;
index bcd6884..253f158 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.34-rc3
-# Fri Apr  9 09:57:10 2010
+# Linux kernel version: 2.6.35-rc1
+# Fri Jun  4 11:32:40 2010
 #
 CONFIG_SCHED_MC=y
 CONFIG_MMU=y
@@ -35,11 +35,13 @@ CONFIG_CONSTRUCTORS=y
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_HAVE_KERNEL_GZIP=y
 CONFIG_HAVE_KERNEL_BZIP2=y
 CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_LZO=y
 CONFIG_KERNEL_GZIP=y
 # CONFIG_KERNEL_BZIP2 is not set
 # CONFIG_KERNEL_LZMA is not set
@@ -77,6 +79,7 @@ CONFIG_CGROUP_NS=y
 # CONFIG_CGROUP_CPUACCT is not set
 # CONFIG_RESOURCE_COUNTERS is not set
 # CONFIG_CGROUP_SCHED is not set
+# CONFIG_BLK_CGROUP is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
@@ -157,7 +160,6 @@ CONFIG_STOP_MACHINE=y
 CONFIG_BLOCK=y
 CONFIG_BLK_DEV_BSG=y
 # CONFIG_BLK_DEV_INTEGRITY is not set
-# CONFIG_BLK_CGROUP is not set
 CONFIG_BLOCK_COMPAT=y
 
 #
@@ -166,7 +168,6 @@ CONFIG_BLOCK_COMPAT=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_DEADLINE=y
 CONFIG_IOSCHED_CFQ=y
-# CONFIG_CFQ_GROUP_IOSCHED is not set
 CONFIG_DEFAULT_DEADLINE=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
@@ -247,7 +248,6 @@ CONFIG_64BIT=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=32
 CONFIG_HOTPLUG_CPU=y
-# CONFIG_SCHED_BOOK is not set
 CONFIG_COMPAT=y
 CONFIG_SYSVIPC_COMPAT=y
 CONFIG_AUDIT_ARCH=y
@@ -320,7 +320,6 @@ CONFIG_COMPAT_BINFMT_ELF=y
 # CONFIG_HAVE_AOUT is not set
 CONFIG_BINFMT_MISC=m
 CONFIG_FORCE_MAX_ZONEORDER=9
-# CONFIG_PROCESS_DEBUG is not set
 CONFIG_PFAULT=y
 # CONFIG_SHARED_KERNEL is not set
 # CONFIG_CMM is not set
@@ -457,6 +456,7 @@ CONFIG_NF_CONNTRACK=m
 # CONFIG_IP6_NF_IPTABLES is not set
 # CONFIG_IP_DCCP is not set
 CONFIG_IP_SCTP=m
+# CONFIG_NET_SCTPPROBE is not set
 # CONFIG_SCTP_DBG_MSG is not set
 # CONFIG_SCTP_DBG_OBJCNT is not set
 # CONFIG_SCTP_HMAC_NONE is not set
@@ -465,6 +465,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_RDS is not set
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
+# CONFIG_L2TP is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
@@ -525,6 +526,7 @@ CONFIG_NET_ACT_NAT=m
 # CONFIG_NET_CLS_IND is not set
 CONFIG_NET_SCH_FIFO=y
 # CONFIG_DCB is not set
+CONFIG_RPS=y
 
 #
 # Network testing
@@ -546,6 +548,7 @@ CONFIG_CAN_VCAN=m
 # CONFIG_WIMAX is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
 # CONFIG_PCMCIA is not set
 CONFIG_CCW=y
 
@@ -728,6 +731,7 @@ CONFIG_VIRTIO_NET=m
 # Character devices
 #
 CONFIG_DEVKMEM=y
+# CONFIG_N_GSM is not set
 CONFIG_UNIX98_PTYS=y
 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
@@ -775,6 +779,7 @@ CONFIG_S390_TAPE_34XX=m
 # CONFIG_MONREADER is not set
 CONFIG_MONWRITER=m
 CONFIG_S390_VMUR=m
+# CONFIG_RAMOOPS is not set
 
 #
 # PPS support
@@ -788,10 +793,6 @@ CONFIG_S390_VMUR=m
 # CONFIG_NEW_LEDS is not set
 CONFIG_ACCESSIBILITY=y
 # CONFIG_AUXDISPLAY is not set
-
-#
-# TI VLYNQ
-#
 # CONFIG_STAGING is not set
 
 #
@@ -976,6 +977,7 @@ CONFIG_DEBUG_MEMORY_INIT=y
 # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
 CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
 # CONFIG_LKDTM is not set
+# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set
 # CONFIG_FAULT_INJECTION is not set
 # CONFIG_LATENCYTOP is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1010,6 +1012,7 @@ CONFIG_BRANCH_PROFILE_NONE=y
 CONFIG_KPROBE_EVENT=y
 # CONFIG_RING_BUFFER_BENCHMARK is not set
 # CONFIG_DYNAMIC_DEBUG is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
 CONFIG_SAMPLES=y
 # CONFIG_SAMPLE_TRACEPOINTS is not set
 # CONFIG_SAMPLE_TRACE_EVENTS is not set
index 639380a..22cfd63 100644 (file)
@@ -55,8 +55,10 @@ void *module_alloc(unsigned long size)
 /* Free memory returned from module_alloc */
 void module_free(struct module *mod, void *module_region)
 {
-       vfree(mod->arch.syminfo);
-       mod->arch.syminfo = NULL;
+       if (mod) {
+               vfree(mod->arch.syminfo);
+               mod->arch.syminfo = NULL;
+       }
        vfree(module_region);
 }
 
index 8093e6f..ae37058 100644 (file)
@@ -761,7 +761,7 @@ static int __init kvm_s390_init(void)
         * to hold the maximum amount of facilites. On the other hand, we
         * only set facilities that are known to work in KVM.
         */
-       facilities = (unsigned long long *) get_zeroed_page(GFP_DMA);
+       facilities = (unsigned long long *) get_zeroed_page(GFP_KERNEL|GFP_DMA);
        if (!facilities) {
                kvm_exit();
                return -ENOMEM;
index eff3c59..702276f 100644 (file)
@@ -113,7 +113,7 @@ static int __inject_sigp_stop(struct kvm_s390_local_interrupt *li, int action)
 {
        struct kvm_s390_interrupt_info *inti;
 
-       inti = kzalloc(sizeof(*inti), GFP_KERNEL);
+       inti = kzalloc(sizeof(*inti), GFP_ATOMIC);
        if (!inti)
                return -ENOMEM;
        inti->type = KVM_S390_SIGP_STOP;
index 6409fd5..3cc95dd 100644 (file)
@@ -105,7 +105,7 @@ static int
 dcss_set_subcodes(void)
 {
 #ifdef CONFIG_64BIT
-       char *name = kmalloc(8 * sizeof(char), GFP_DMA);
+       char *name = kmalloc(8 * sizeof(char), GFP_KERNEL | GFP_DMA);
        unsigned long rx, ry;
        int rc;
 
@@ -252,12 +252,13 @@ dcss_diag_translate_rc (int vm_rc) {
 static int
 query_segment_type (struct dcss_segment *seg)
 {
-       struct qin64  *qin = kmalloc (sizeof(struct qin64), GFP_DMA);
-       struct qout64 *qout = kmalloc (sizeof(struct qout64), GFP_DMA);
-
-       int diag_cc, rc, i;
        unsigned long dummy, vmrc;
+       int diag_cc, rc, i;
+       struct qout64 *qout;
+       struct qin64 *qin;
 
+       qin = kmalloc(sizeof(*qin), GFP_KERNEL | GFP_DMA);
+       qout = kmalloc(sizeof(*qout), GFP_KERNEL | GFP_DMA);
        if ((qin == NULL) || (qout == NULL)) {
                rc = -ENOMEM;
                goto out_free;
@@ -286,7 +287,7 @@ query_segment_type (struct dcss_segment *seg)
           copy data for the new format. */
        if (segext_scode == DCSS_SEGEXT) {
                struct qout64_old *qout_old;
-               qout_old = kzalloc(sizeof(struct qout64_old), GFP_DMA);
+               qout_old = kzalloc(sizeof(*qout_old), GFP_KERNEL | GFP_DMA);
                if (qout_old == NULL) {
                        rc = -ENOMEM;
                        goto out_free;
@@ -407,11 +408,11 @@ segment_overlaps_others (struct dcss_segment *seg)
 static int
 __segment_load (char *name, int do_nonshared, unsigned long *addr, unsigned long *end)
 {
-       struct dcss_segment *seg = kmalloc(sizeof(struct dcss_segment),
-                       GFP_DMA);
-       int rc, diag_cc;
        unsigned long start_addr, end_addr, dummy;
+       struct dcss_segment *seg;
+       int rc, diag_cc;
 
+       seg = kmalloc(sizeof(*seg), GFP_KERNEL | GFP_DMA);
        if (seg == NULL) {
                rc = -ENOMEM;
                goto out;
index 1984a6e..261f86d 100644 (file)
@@ -541,29 +541,11 @@ static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val)
        return -EINVAL;
 }
 
-static int ahci_is_device_present(void __iomem *port_mmio)
-{
-       u8 status = readl(port_mmio + PORT_TFDATA) & 0xff;
-
-       /* Make sure PxTFD.STS.BSY and PxTFD.STS.DRQ are 0 */
-       if (status & (ATA_BUSY | ATA_DRQ))
-               return 0;
-
-       /* Make sure PxSSTS.DET is 3h */
-       status = readl(port_mmio + PORT_SCR_STAT) & 0xf;
-       if (status != 3)
-               return 0;
-       return 1;
-}
-
 void ahci_start_engine(struct ata_port *ap)
 {
        void __iomem *port_mmio = ahci_port_base(ap);
        u32 tmp;
 
-       if (!ahci_is_device_present(port_mmio))
-               return;
-
        /* start DMA */
        tmp = readl(port_mmio + PORT_CMD);
        tmp |= PORT_CMD_START;
@@ -1892,6 +1874,9 @@ static void ahci_error_handler(struct ata_port *ap)
        }
 
        sata_pmp_error_handler(ap);
+
+       if (!ata_dev_enabled(ap->link.device))
+               ahci_stop_engine(ap);
 }
 
 static void ahci_post_internal_cmd(struct ata_queued_cmd *qc)
index e925051..70b58fe 100644 (file)
@@ -539,12 +539,12 @@ static void sil24_config_port(struct ata_port *ap)
                writel(PORT_CS_IRQ_WOC, port + PORT_CTRL_CLR);
 
        /* zero error counters. */
-       writel(0x8000, port + PORT_DECODE_ERR_THRESH);
-       writel(0x8000, port + PORT_CRC_ERR_THRESH);
-       writel(0x8000, port + PORT_HSHK_ERR_THRESH);
-       writel(0x0000, port + PORT_DECODE_ERR_CNT);
-       writel(0x0000, port + PORT_CRC_ERR_CNT);
-       writel(0x0000, port + PORT_HSHK_ERR_CNT);
+       writew(0x8000, port + PORT_DECODE_ERR_THRESH);
+       writew(0x8000, port + PORT_CRC_ERR_THRESH);
+       writew(0x8000, port + PORT_HSHK_ERR_THRESH);
+       writew(0x0000, port + PORT_DECODE_ERR_CNT);
+       writew(0x0000, port + PORT_CRC_ERR_CNT);
+       writew(0x0000, port + PORT_HSHK_ERR_CNT);
 
        /* always use 64bit activation */
        writel(PORT_CS_32BIT_ACTV, port + PORT_CTRL_CLR);
index 0ecd0f6..4730c42 100644 (file)
@@ -578,10 +578,24 @@ static void svia_configure(struct pci_dev *pdev)
 
        /*
         * vt6421 has problems talking to some drives.  The following
-        * is the magic fix from Joseph Chan <JosephChan@via.com.tw>.
-        * Please add proper documentation if possible.
+        * is the fix from Joseph Chan <JosephChan@via.com.tw>.
+        *
+        * When host issues HOLD, device may send up to 20DW of data
+        * before acknowledging it with HOLDA and the host should be
+        * able to buffer them in FIFO.  Unfortunately, some WD drives
+        * send upto 40DW before acknowledging HOLD and, in the
+        * default configuration, this ends up overflowing vt6421's
+        * FIFO, making the controller abort the transaction with
+        * R_ERR.
+        *
+        * Rx52[2] is the internal 128DW FIFO Flow control watermark
+        * adjusting mechanism enable bit and the default value 0
+        * means host will issue HOLD to device when the left FIFO
+        * size goes below 32DW.  Setting it to 1 makes the watermark
+        * 64DW.
         *
         * https://bugzilla.kernel.org/show_bug.cgi?id=15173
+        * http://article.gmane.org/gmane.linux.ide/46352
         */
        if (pdev->device == 0x3249) {
                pci_read_config_byte(pdev, 0x52, &tmp8);
index 9dcb304..371713f 100644 (file)
@@ -231,7 +231,7 @@ void fw_schedule_bm_work(struct fw_card *card, unsigned long delay)
 static void fw_card_bm_work(struct work_struct *work)
 {
        struct fw_card *card = container_of(work, struct fw_card, work.work);
-       struct fw_device *root_device;
+       struct fw_device *root_device, *irm_device;
        struct fw_node *root_node;
        unsigned long flags;
        int root_id, new_root_id, irm_id, local_id;
@@ -239,6 +239,7 @@ static void fw_card_bm_work(struct work_struct *work)
        bool do_reset = false;
        bool root_device_is_running;
        bool root_device_is_cmc;
+       bool irm_is_1394_1995_only;
 
        spin_lock_irqsave(&card->lock, flags);
 
@@ -248,12 +249,18 @@ static void fw_card_bm_work(struct work_struct *work)
        }
 
        generation = card->generation;
+
        root_node = card->root_node;
        fw_node_get(root_node);
        root_device = root_node->data;
        root_device_is_running = root_device &&
                        atomic_read(&root_device->state) == FW_DEVICE_RUNNING;
        root_device_is_cmc = root_device && root_device->cmc;
+
+       irm_device = card->irm_node->data;
+       irm_is_1394_1995_only = irm_device && irm_device->config_rom &&
+                       (irm_device->config_rom[2] & 0x000000f0) == 0;
+
        root_id  = root_node->node_id;
        irm_id   = card->irm_node->node_id;
        local_id = card->local_node->node_id;
@@ -276,8 +283,15 @@ static void fw_card_bm_work(struct work_struct *work)
 
                if (!card->irm_node->link_on) {
                        new_root_id = local_id;
-                       fw_notify("IRM has link off, making local node (%02x) root.\n",
-                                 new_root_id);
+                       fw_notify("%s, making local node (%02x) root.\n",
+                                 "IRM has link off", new_root_id);
+                       goto pick_me;
+               }
+
+               if (irm_is_1394_1995_only) {
+                       new_root_id = local_id;
+                       fw_notify("%s, making local node (%02x) root.\n",
+                                 "IRM is not 1394a compliant", new_root_id);
                        goto pick_me;
                }
 
@@ -316,8 +330,8 @@ static void fw_card_bm_work(struct work_struct *work)
                         * root, and thus, IRM.
                         */
                        new_root_id = local_id;
-                       fw_notify("BM lock failed, making local node (%02x) root.\n",
-                                 new_root_id);
+                       fw_notify("%s, making local node (%02x) root.\n",
+                                 "BM lock failed", new_root_id);
                        goto pick_me;
                }
        } else if (card->bm_generation != generation) {
index 994d23b..57cea01 100644 (file)
@@ -1840,8 +1840,10 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
 
                ret = copy_from_user(clips, clips_ptr,
                                     num_clips * sizeof(*clips));
-               if (ret)
+               if (ret) {
+                       ret = -EFAULT;
                        goto out_err2;
+               }
        }
 
        if (fb->funcs->dirty) {
index b3779d2..08c4c92 100644 (file)
@@ -264,7 +264,7 @@ bool drm_fb_helper_force_kernel_mode(void)
 int drm_fb_helper_panic(struct notifier_block *n, unsigned long ununsed,
                        void *panic_str)
 {
-       DRM_ERROR("panic occurred, switching back to text console\n");
+       printk(KERN_ERR "panic occurred, switching back to text console\n");
        return drm_fb_helper_force_kernel_mode();
        return 0;
 }
index b2ebf02..59a2bf8 100644 (file)
@@ -1402,19 +1402,19 @@ static int i915_load_modeset_init(struct drm_device *dev,
        /* if we have > 1 VGA cards, then disable the radeon VGA resources */
        ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode);
        if (ret)
-               goto destroy_ringbuffer;
+               goto cleanup_ringbuffer;
 
        ret = vga_switcheroo_register_client(dev->pdev,
                                             i915_switcheroo_set_state,
                                             i915_switcheroo_can_switch);
        if (ret)
-               goto destroy_ringbuffer;
+               goto cleanup_vga_client;
 
        intel_modeset_init(dev);
 
        ret = drm_irq_install(dev);
        if (ret)
-               goto destroy_ringbuffer;
+               goto cleanup_vga_switcheroo;
 
        /* Always safe in the mode setting case. */
        /* FIXME: do pre/post-mode set stuff in core KMS code */
@@ -1426,11 +1426,20 @@ static int i915_load_modeset_init(struct drm_device *dev,
 
        I915_WRITE(INSTPM, (1 << 5) | (1 << 21));
 
-       intel_fbdev_init(dev);
+       ret = intel_fbdev_init(dev);
+       if (ret)
+               goto cleanup_irq;
+
        drm_kms_helper_poll_init(dev);
        return 0;
 
-destroy_ringbuffer:
+cleanup_irq:
+       drm_irq_uninstall(dev);
+cleanup_vga_switcheroo:
+       vga_switcheroo_unregister_client(dev->pdev);
+cleanup_vga_client:
+       vga_client_register(dev->pdev, NULL, NULL, NULL);
+cleanup_ringbuffer:
        mutex_lock(&dev->struct_mutex);
        i915_gem_cleanup_ringbuffer(dev);
        mutex_unlock(&dev->struct_mutex);
index 9ed8ecd..2765831 100644 (file)
@@ -278,6 +278,7 @@ typedef struct drm_i915_private {
        struct mem_block *agp_heap;
        unsigned int sr01, adpa, ppcr, dvob, dvoc, lvds;
        int vblank_pipe;
+       int num_pipe;
 
        /* For hangcheck timer */
 #define DRM_I915_HANGCHECK_PERIOD 75 /* in jiffies */
index 04e1bb4..cc8131f 100644 (file)
@@ -3653,6 +3653,11 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
                        pipeconf &= ~PIPEACONF_DOUBLE_WIDE;
        }
 
+       dspcntr |= DISPLAY_PLANE_ENABLE;
+       pipeconf |= PIPEACONF_ENABLE;
+       dpll |= DPLL_VCO_ENABLE;
+
+
        /* Disable the panel fitter if it was on our pipe */
        if (!HAS_PCH_SPLIT(dev) && intel_panel_fitter_pipe(dev) == pipe)
                I915_WRITE(PFIT_CONTROL, 0);
@@ -5470,7 +5475,6 @@ static void intel_init_display(struct drm_device *dev)
 void intel_modeset_init(struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
-       int num_pipe;
        int i;
 
        drm_mode_config_init(dev);
@@ -5500,13 +5504,13 @@ void intel_modeset_init(struct drm_device *dev)
                dev->mode_config.fb_base = pci_resource_start(dev->pdev, 0);
 
        if (IS_MOBILE(dev) || IS_I9XX(dev))
-               num_pipe = 2;
+               dev_priv->num_pipe = 2;
        else
-               num_pipe = 1;
+               dev_priv->num_pipe = 1;
        DRM_DEBUG_KMS("%d display pipe%s available.\n",
-                 num_pipe, num_pipe > 1 ? "s" : "");
+                     dev_priv->num_pipe, dev_priv->num_pipe > 1 ? "s" : "");
 
-       for (i = 0; i < num_pipe; i++) {
+       for (i = 0; i < dev_priv->num_pipe; i++) {
                intel_crtc_init(dev, i);
        }
 
index f8c76e6..c3c5052 100644 (file)
@@ -245,6 +245,7 @@ int intel_fbdev_init(struct drm_device *dev)
 {
        struct intel_fbdev *ifbdev;
        drm_i915_private_t *dev_priv = dev->dev_private;
+       int ret;
 
        ifbdev = kzalloc(sizeof(struct intel_fbdev), GFP_KERNEL);
        if (!ifbdev)
@@ -253,8 +254,13 @@ int intel_fbdev_init(struct drm_device *dev)
        dev_priv->fbdev = ifbdev;
        ifbdev->helper.funcs = &intel_fb_helper_funcs;
 
-       drm_fb_helper_init(dev, &ifbdev->helper, 2,
-                          INTELFB_CONN_LIMIT);
+       ret = drm_fb_helper_init(dev, &ifbdev->helper,
+                                dev_priv->num_pipe,
+                                INTELFB_CONN_LIMIT);
+       if (ret) {
+               kfree(ifbdev);
+               return ret;
+       }
 
        drm_fb_helper_single_add_all_connectors(&ifbdev->helper);
        drm_fb_helper_initial_config(&ifbdev->helper, 32);
index 9ba2dea..fc924b6 100644 (file)
@@ -834,7 +834,7 @@ init_i2c_device_find(struct drm_device *dev, int i2c_index)
        if (i2c_index == 0x81)
                i2c_index = (dcb->i2c_default_indices & 0xf0) >> 4;
 
-       if (i2c_index > DCB_MAX_NUM_I2C_ENTRIES) {
+       if (i2c_index >= DCB_MAX_NUM_I2C_ENTRIES) {
                NV_ERROR(dev, "invalid i2c_index 0x%x\n", i2c_index);
                return NULL;
        }
@@ -3920,7 +3920,8 @@ int nouveau_bios_parse_lvds_table(struct drm_device *dev, int pxclk, bool *dl, b
 
 static uint8_t *
 bios_output_config_match(struct drm_device *dev, struct dcb_entry *dcbent,
-                        uint16_t record, int record_len, int record_nr)
+                        uint16_t record, int record_len, int record_nr,
+                        bool match_link)
 {
        struct drm_nouveau_private *dev_priv = dev->dev_private;
        struct nvbios *bios = &dev_priv->vbios;
@@ -3928,12 +3929,28 @@ bios_output_config_match(struct drm_device *dev, struct dcb_entry *dcbent,
        uint16_t table;
        int i, v;
 
+       switch (dcbent->type) {
+       case OUTPUT_TMDS:
+       case OUTPUT_LVDS:
+       case OUTPUT_DP:
+               break;
+       default:
+               match_link = false;
+               break;
+       }
+
        for (i = 0; i < record_nr; i++, record += record_len) {
                table = ROM16(bios->data[record]);
                if (!table)
                        continue;
                entry = ROM32(bios->data[table]);
 
+               if (match_link) {
+                       v = (entry & 0x00c00000) >> 22;
+                       if (!(v & dcbent->sorconf.link))
+                               continue;
+               }
+
                v = (entry & 0x000f0000) >> 16;
                if (!(v & dcbent->or))
                        continue;
@@ -3975,7 +3992,7 @@ nouveau_bios_dp_table(struct drm_device *dev, struct dcb_entry *dcbent,
        *length = table[4];
        return bios_output_config_match(dev, dcbent,
                                        bios->display.dp_table_ptr + table[1],
-                                       table[2], table[3]);
+                                       table[2], table[3], table[0] >= 0x21);
 }
 
 int
@@ -4064,7 +4081,7 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent,
                        dcbent->type, dcbent->location, dcbent->or);
        otable = bios_output_config_match(dev, dcbent, table[1] +
                                          bios->display.script_table_ptr,
-                                         table[2], table[3]);
+                                         table[2], table[3], table[0] >= 0x21);
        if (!otable) {
                NV_ERROR(dev, "Couldn't find matching output script table\n");
                return 1;
index fd4a2df..c9a4a0d 100644 (file)
@@ -377,6 +377,7 @@ int nouveau_fbcon_init(struct drm_device *dev)
 {
        struct drm_nouveau_private *dev_priv = dev->dev_private;
        struct nouveau_fbdev *nfbdev;
+       int ret;
 
        nfbdev = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL);
        if (!nfbdev)
@@ -386,7 +387,12 @@ int nouveau_fbcon_init(struct drm_device *dev)
        dev_priv->nfbdev = nfbdev;
        nfbdev->helper.funcs = &nouveau_fbcon_helper_funcs;
 
-       drm_fb_helper_init(dev, &nfbdev->helper, 2, 4);
+       ret = drm_fb_helper_init(dev, &nfbdev->helper, 2, 4);
+       if (ret) {
+               kfree(nfbdev);
+               return ret;
+       }
+
        drm_fb_helper_single_add_all_connectors(&nfbdev->helper);
        drm_fb_helper_initial_config(&nfbdev->helper, 32);
        return 0;
index 147e59c..b02a231 100644 (file)
@@ -779,29 +779,24 @@ int nouveau_load(struct drm_device *dev, unsigned long flags)
                        return ret;
        }
 
-       /* map larger RAMIN aperture on NV40 cards */
-       dev_priv->ramin  = NULL;
+       /* Map PRAMIN BAR, or on older cards, the aperture withing BAR0 */
        if (dev_priv->card_type >= NV_40) {
                int ramin_bar = 2;
                if (pci_resource_len(dev->pdev, ramin_bar) == 0)
                        ramin_bar = 3;
 
                dev_priv->ramin_size = pci_resource_len(dev->pdev, ramin_bar);
-               dev_priv->ramin = ioremap(
-                               pci_resource_start(dev->pdev, ramin_bar),
+               dev_priv->ramin =
+                       ioremap(pci_resource_start(dev->pdev, ramin_bar),
                                dev_priv->ramin_size);
                if (!dev_priv->ramin) {
-                       NV_ERROR(dev, "Failed to init RAMIN mapping, "
-                                     "limited instance memory available\n");
+                       NV_ERROR(dev, "Failed to PRAMIN BAR");
+                       return -ENOMEM;
                }
-       }
-
-       /* On older cards (or if the above failed), create a map covering
-        * the BAR0 PRAMIN aperture */
-       if (!dev_priv->ramin) {
+       } else {
                dev_priv->ramin_size = 1 * 1024 * 1024;
                dev_priv->ramin = ioremap(mmio_start_offs + NV_RAMIN,
-                                                       dev_priv->ramin_size);
+                                         dev_priv->ramin_size);
                if (!dev_priv->ramin) {
                        NV_ERROR(dev, "Failed to map BAR0 PRAMIN.\n");
                        return -ENOMEM;
index a95e694..32611bd 100644 (file)
@@ -6,10 +6,16 @@
 int
 nv50_fb_init(struct drm_device *dev)
 {
-       /* This is needed to get meaningful information from 100c90
-        * on traps. No idea what these values mean exactly. */
        struct drm_nouveau_private *dev_priv = dev->dev_private;
 
+       /* Not a clue what this is exactly.  Without pointing it at a
+        * scratch page, VRAM->GART blits with M2MF (as in DDX DFS)
+        * cause IOMMU "read from address 0" errors (rh#561267)
+        */
+       nv_wr32(dev, 0x100c08, dev_priv->gart_info.sg_dummy_bus >> 8);
+
+       /* This is needed to get meaningful information from 100c90
+        * on traps. No idea what these values mean exactly. */
        switch (dev_priv->chipset) {
        case 0x50:
                nv_wr32(dev, 0x100c90, 0x0707ff);
index c61782b..bb47ad7 100644 (file)
@@ -31,7 +31,7 @@ nv50_gpio_location(struct dcb_gpio_entry *gpio, uint32_t *reg, uint32_t *shift)
 {
        const uint32_t nv50_gpio_reg[4] = { 0xe104, 0xe108, 0xe280, 0xe284 };
 
-       if (gpio->line > 32)
+       if (gpio->line >= 32)
                return -EINVAL;
 
        *reg = nv50_gpio_reg[gpio->line >> 3];
index 0440c09..4b6623d 100644 (file)
@@ -41,12 +41,18 @@ void evergreen_fini(struct radeon_device *rdev);
 
 void evergreen_pm_misc(struct radeon_device *rdev)
 {
-       int requested_index = rdev->pm.requested_power_state_index;
-       struct radeon_power_state *ps = &rdev->pm.power_state[requested_index];
-       struct radeon_voltage *voltage = &ps->clock_info[0].voltage;
-
-       if ((voltage->type == VOLTAGE_SW) && voltage->voltage)
-               radeon_atom_set_voltage(rdev, voltage->voltage);
+       int req_ps_idx = rdev->pm.requested_power_state_index;
+       int req_cm_idx = rdev->pm.requested_clock_mode_index;
+       struct radeon_power_state *ps = &rdev->pm.power_state[req_ps_idx];
+       struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
+
+       if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
+               if (voltage->voltage != rdev->pm.current_vddc) {
+                       radeon_atom_set_voltage(rdev, voltage->voltage);
+                       rdev->pm.current_vddc = voltage->voltage;
+                       DRM_DEBUG("Setting: v: %d\n", voltage->voltage);
+               }
+       }
 }
 
 void evergreen_pm_prepare(struct radeon_device *rdev)
@@ -2153,7 +2159,7 @@ int evergreen_init(struct radeon_device *rdev)
        if (r)
                return r;
 
-       rdev->accel_working = false;
+       rdev->accel_working = true;
        r = evergreen_startup(rdev);
        if (r) {
                dev_err(rdev->dev, "disabling GPU acceleration\n");
index cc004b0..cf89aa2 100644 (file)
@@ -162,6 +162,11 @@ void r100_pm_init_profile(struct radeon_device *rdev)
        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = 0;
        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+       /* mid sh */
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 0;
        /* high sh */
        rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx = 0;
        rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
@@ -172,6 +177,11 @@ void r100_pm_init_profile(struct radeon_device *rdev)
        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+       /* mid mh */
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 0;
        /* high mh */
        rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx = 0;
        rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
index 4415a5e..e6c8914 100644 (file)
@@ -45,9 +45,14 @@ void r420_pm_init_profile(struct radeon_device *rdev)
        rdev->pm.profiles[PM_PROFILE_DEFAULT_IDX].dpms_on_cm_idx = 0;
        /* low sh */
        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_ps_idx = 0;
-       rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = 1;
+       rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = 0;
        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+       /* mid sh */
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx = 1;
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 0;
        /* high sh */
        rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx = 0;
        rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
@@ -58,6 +63,11 @@ void r420_pm_init_profile(struct radeon_device *rdev)
        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+       /* mid mh */
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 0;
        /* high mh */
        rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx = 0;
        rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
index e14f597..0e91871 100644 (file)
@@ -291,6 +291,11 @@ void rs780_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+               /* mid sh */
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 0;
                /* high sh */
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx = 0;
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_on_ps_idx = 1;
@@ -301,6 +306,11 @@ void rs780_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+               /* mid mh */
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 0;
                /* high mh */
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx = 0;
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_ps_idx = 1;
@@ -317,6 +327,11 @@ void rs780_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = 1;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+               /* mid sh */
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx = 1;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx = 1;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 0;
                /* high sh */
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx = 1;
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_on_ps_idx = 2;
@@ -327,6 +342,11 @@ void rs780_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx = 1;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+               /* mid mh */
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx = 1;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx = 1;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 0;
                /* high mh */
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx = 1;
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_ps_idx = 2;
@@ -343,6 +363,11 @@ void rs780_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = 2;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+               /* mid sh */
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx = 2;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx = 2;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 0;
                /* high sh */
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx = 2;
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_on_ps_idx = 3;
@@ -353,6 +378,11 @@ void rs780_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+               /* mid mh */
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx = 2;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 0;
                /* high mh */
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx = 2;
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_ps_idx = 3;
@@ -375,6 +405,11 @@ void r600_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+               /* mid sh */
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx = rdev->pm.default_power_state_index;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 0;
                /* high sh */
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx = rdev->pm.default_power_state_index;
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
@@ -385,6 +420,11 @@ void r600_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+               /* mid mh */
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx = rdev->pm.default_power_state_index;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 0;
                /* high mh */
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx = rdev->pm.default_power_state_index;
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
@@ -401,7 +441,12 @@ void r600_pm_init_profile(struct radeon_device *rdev)
                        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_ps_idx = 1;
                        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = 1;
                        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
-                       rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 1;
+                       rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+                       /* mid sh */
+                       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx = 1;
+                       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx = 1;
+                       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+                       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 1;
                        /* high sh */
                        rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx = 1;
                        rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_on_ps_idx = 1;
@@ -411,7 +456,12 @@ void r600_pm_init_profile(struct radeon_device *rdev)
                        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_ps_idx = 2;
                        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx = 2;
                        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
-                       rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 1;
+                       rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+                       /* low mh */
+                       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx = 2;
+                       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx = 2;
+                       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+                       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 1;
                        /* high mh */
                        rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx = 2;
                        rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_ps_idx = 2;
@@ -430,14 +480,30 @@ void r600_pm_init_profile(struct radeon_device *rdev)
                                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx =
                                        r600_pm_get_type_index(rdev, POWER_STATE_TYPE_BATTERY, 0);
                                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
-                               rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 1;
+                               rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
                        } else {
                                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_ps_idx =
                                        r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 0);
                                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx =
                                        r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 0);
                                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
-                               rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 1;
+                               rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+                       }
+                       /* mid sh */
+                       if (rdev->flags & RADEON_IS_MOBILITY) {
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_BATTERY, 0);
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_BATTERY, 0);
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 1;
+                       } else {
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 0);
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 0);
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 1;
                        }
                        /* high sh */
                        rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx =
@@ -453,14 +519,30 @@ void r600_pm_init_profile(struct radeon_device *rdev)
                                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx =
                                        r600_pm_get_type_index(rdev, POWER_STATE_TYPE_BATTERY, 1);
                                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
-                               rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 2;
+                               rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
                        } else {
                                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_ps_idx =
                                        r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 1);
                                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx =
                                        r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 1);
                                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
-                               rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 1;
+                               rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+                       }
+                       /* mid mh */
+                       if (rdev->flags & RADEON_IS_MOBILITY) {
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_BATTERY, 1);
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_BATTERY, 1);
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 1;
+                       } else {
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 1);
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 1);
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 1;
                        }
                        /* high mh */
                        rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx =
@@ -475,13 +557,18 @@ void r600_pm_init_profile(struct radeon_device *rdev)
 
 void r600_pm_misc(struct radeon_device *rdev)
 {
-       int requested_index = rdev->pm.requested_power_state_index;
-       struct radeon_power_state *ps = &rdev->pm.power_state[requested_index];
-       struct radeon_voltage *voltage = &ps->clock_info[0].voltage;
-
-       if ((voltage->type == VOLTAGE_SW) && voltage->voltage)
-               radeon_atom_set_voltage(rdev, voltage->voltage);
+       int req_ps_idx = rdev->pm.requested_power_state_index;
+       int req_cm_idx = rdev->pm.requested_clock_mode_index;
+       struct radeon_power_state *ps = &rdev->pm.power_state[req_ps_idx];
+       struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
 
+       if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
+               if (voltage->voltage != rdev->pm.current_vddc) {
+                       radeon_atom_set_voltage(rdev, voltage->voltage);
+                       rdev->pm.current_vddc = voltage->voltage;
+                       DRM_DEBUG("Setting: v: %d\n", voltage->voltage);
+               }
+       }
 }
 
 bool r600_gui_idle(struct radeon_device *rdev)
index 5f96fe8..8e1d44c 100644 (file)
@@ -648,15 +648,18 @@ enum radeon_pm_profile_type {
        PM_PROFILE_DEFAULT,
        PM_PROFILE_AUTO,
        PM_PROFILE_LOW,
+       PM_PROFILE_MID,
        PM_PROFILE_HIGH,
 };
 
 #define PM_PROFILE_DEFAULT_IDX 0
 #define PM_PROFILE_LOW_SH_IDX  1
-#define PM_PROFILE_HIGH_SH_IDX 2
-#define PM_PROFILE_LOW_MH_IDX  3
-#define PM_PROFILE_HIGH_MH_IDX 4
-#define PM_PROFILE_MAX         5
+#define PM_PROFILE_MID_SH_IDX  2
+#define PM_PROFILE_HIGH_SH_IDX 3
+#define PM_PROFILE_LOW_MH_IDX  4
+#define PM_PROFILE_MID_MH_IDX  5
+#define PM_PROFILE_HIGH_MH_IDX 6
+#define PM_PROFILE_MAX         7
 
 struct radeon_pm_profile {
        int dpms_off_ps_idx;
@@ -745,6 +748,7 @@ struct radeon_pm {
        int                     default_power_state_index;
        u32                     current_sclk;
        u32                     current_mclk;
+       u32                     current_vddc;
        struct radeon_i2c_chan *i2c_bus;
        /* selected pm method */
        enum radeon_pm_method     pm_method;
index 4305cd5..99bd8a9 100644 (file)
@@ -1833,10 +1833,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
                                                /* skip invalid modes */
                                                if (rdev->pm.power_state[state_index].clock_info[mode_index].sclk == 0)
                                                        continue;
-                                               rdev->pm.power_state[state_index].clock_info[mode_index].voltage.type =
-                                                       VOLTAGE_SW;
-                                               rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage =
-                                                       clock_info->usVDDC;
+                                               /* voltage works differently on IGPs */
                                                mode_index++;
                                        } else if (ASIC_IS_DCE4(rdev)) {
                                                struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO *clock_info =
@@ -1969,6 +1966,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
 
        rdev->pm.current_power_state_index = rdev->pm.default_power_state_index;
        rdev->pm.current_clock_mode_index = 0;
+       rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
 }
 
 void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable)
index 102c744..1bee2f9 100644 (file)
@@ -2026,6 +2026,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
                                        combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC);
                                break;
                        default:
+                               ddc_i2c.valid = false;
                                break;
                        }
 
@@ -2339,6 +2340,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
                        if (RBIOS8(tv_info + 6) == 'T') {
                                if (radeon_apply_legacy_tv_quirks(dev)) {
                                        hpd.hpd = RADEON_HPD_NONE;
+                                       ddc_i2c.valid = false;
                                        radeon_add_legacy_encoder(dev,
                                                                  radeon_get_encoder_id
                                                                  (dev,
@@ -2455,7 +2457,7 @@ default_mode:
        rdev->pm.power_state[state_index].clock_info[0].sclk = rdev->clock.default_sclk;
        rdev->pm.power_state[state_index].default_clock_mode = &rdev->pm.power_state[state_index].clock_info[0];
        if ((state_index > 0) &&
-           (rdev->pm.power_state[0].clock_info[0].voltage.type = VOLTAGE_GPIO))
+           (rdev->pm.power_state[0].clock_info[0].voltage.type == VOLTAGE_GPIO))
                rdev->pm.power_state[state_index].clock_info[0].voltage =
                        rdev->pm.power_state[0].clock_info[0].voltage;
        else
index 1006549..8154cdf 100644 (file)
@@ -284,8 +284,7 @@ static const char *connector_names[15] = {
        "eDP",
 };
 
-static const char *hpd_names[7] = {
-       "NONE",
+static const char *hpd_names[6] = {
        "HPD1",
        "HPD2",
        "HPD3",
index 902d173..e166fe4 100644 (file)
  * - 2.2.0 - add r6xx/r7xx const buffer support
  * - 2.3.0 - add MSPOS + 3D texture + r500 VAP regs
  * - 2.4.0 - add crtc id query
+ * - 2.5.0 - add get accel 2 to work around ddx breakage for evergreen
  */
 #define KMS_DRIVER_MAJOR       2
-#define KMS_DRIVER_MINOR       4
+#define KMS_DRIVER_MINOR       5
 #define KMS_DRIVER_PATCHLEVEL  0
 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
 int radeon_driver_unload_kms(struct drm_device *dev);
index e192acf..dc1634b 100644 (file)
@@ -363,6 +363,7 @@ int radeon_fbdev_init(struct radeon_device *rdev)
 {
        struct radeon_fbdev *rfbdev;
        int bpp_sel = 32;
+       int ret;
 
        /* select 8 bpp console on RN50 or 16MB cards */
        if (ASIC_IS_RN50(rdev) || rdev->mc.real_vram_size <= (32*1024*1024))
@@ -376,9 +377,14 @@ int radeon_fbdev_init(struct radeon_device *rdev)
        rdev->mode_info.rfbdev = rfbdev;
        rfbdev->helper.funcs = &radeon_fb_helper_funcs;
 
-       drm_fb_helper_init(rdev->ddev, &rfbdev->helper,
-                          rdev->num_crtc,
-                          RADEONFB_CONN_LIMIT);
+       ret = drm_fb_helper_init(rdev->ddev, &rfbdev->helper,
+                                rdev->num_crtc,
+                                RADEONFB_CONN_LIMIT);
+       if (ret) {
+               kfree(rfbdev);
+               return ret;
+       }
+
        drm_fb_helper_single_add_all_connectors(&rfbdev->helper);
        drm_fb_helper_initial_config(&rfbdev->helper, bpp_sel);
        return 0;
index 0406835..6a70c0d 100644 (file)
@@ -118,7 +118,11 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                value = rdev->num_z_pipes;
                break;
        case RADEON_INFO_ACCEL_WORKING:
-               value = rdev->accel_working;
+               /* xf86-video-ati 6.13.0 relies on this being false for evergreen */
+               if ((rdev->family >= CHIP_CEDAR) && (rdev->family <= CHIP_HEMLOCK))
+                       value = false;
+               else
+                       value = rdev->accel_working;
                break;
        case RADEON_INFO_CRTC_FROM_ID:
                for (i = 0, found = 0; i < rdev->num_crtc; i++) {
@@ -134,6 +138,9 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                        return -EINVAL;
                }
                break;
+       case RADEON_INFO_ACCEL_WORKING2:
+               value = rdev->accel_working;
+               break;
        default:
                DRM_DEBUG("Invalid request %d\n", info->request);
                return -EINVAL;
index 5a13b3e..5b07b88 100644 (file)
@@ -1168,6 +1168,17 @@ static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder
        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
        struct radeon_encoder_tv_dac *tv_dac = radeon_encoder->enc_priv;
        bool color = true;
+       struct drm_crtc *crtc;
+
+       /* find out if crtc2 is in use or if this encoder is using it */
+       list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
+               struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
+               if ((radeon_crtc->crtc_id == 1) && crtc->enabled) {
+                       if (encoder->crtc != crtc) {
+                               return connector_status_disconnected;
+                       }
+               }
+       }
 
        if (connector->connector_type == DRM_MODE_CONNECTOR_SVIDEO ||
            connector->connector_type == DRM_MODE_CONNECTOR_Composite ||
index 0228126..63f679a 100644 (file)
 #define RADEON_WAIT_VBLANK_TIMEOUT 200
 #define RADEON_WAIT_IDLE_TIMEOUT 200
 
+static const char *radeon_pm_state_type_name[5] = {
+       "Default",
+       "Powersave",
+       "Battery",
+       "Balanced",
+       "Performance",
+};
+
 static void radeon_dynpm_idle_work_handler(struct work_struct *work);
 static int radeon_debugfs_pm_init(struct radeon_device *rdev);
 static bool radeon_pm_in_vbl(struct radeon_device *rdev);
@@ -84,9 +92,9 @@ static void radeon_pm_update_profile(struct radeon_device *rdev)
                                rdev->pm.profile_index = PM_PROFILE_HIGH_SH_IDX;
                } else {
                        if (rdev->pm.active_crtc_count > 1)
-                               rdev->pm.profile_index = PM_PROFILE_LOW_MH_IDX;
+                               rdev->pm.profile_index = PM_PROFILE_MID_MH_IDX;
                        else
-                               rdev->pm.profile_index = PM_PROFILE_LOW_SH_IDX;
+                               rdev->pm.profile_index = PM_PROFILE_MID_SH_IDX;
                }
                break;
        case PM_PROFILE_LOW:
@@ -95,6 +103,12 @@ static void radeon_pm_update_profile(struct radeon_device *rdev)
                else
                        rdev->pm.profile_index = PM_PROFILE_LOW_SH_IDX;
                break;
+       case PM_PROFILE_MID:
+               if (rdev->pm.active_crtc_count > 1)
+                       rdev->pm.profile_index = PM_PROFILE_MID_MH_IDX;
+               else
+                       rdev->pm.profile_index = PM_PROFILE_MID_SH_IDX;
+               break;
        case PM_PROFILE_HIGH:
                if (rdev->pm.active_crtc_count > 1)
                        rdev->pm.profile_index = PM_PROFILE_HIGH_MH_IDX;
@@ -127,15 +141,6 @@ static void radeon_unmap_vram_bos(struct radeon_device *rdev)
                if (bo->tbo.mem.mem_type == TTM_PL_VRAM)
                        ttm_bo_unmap_virtual(&bo->tbo);
        }
-
-       if (rdev->gart.table.vram.robj)
-               ttm_bo_unmap_virtual(&rdev->gart.table.vram.robj->tbo);
-
-       if (rdev->stollen_vga_memory)
-               ttm_bo_unmap_virtual(&rdev->stollen_vga_memory->tbo);
-
-       if (rdev->r600_blit.shader_obj)
-               ttm_bo_unmap_virtual(&rdev->r600_blit.shader_obj->tbo);
 }
 
 static void radeon_sync_with_vblank(struct radeon_device *rdev)
@@ -281,6 +286,42 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev)
        mutex_unlock(&rdev->ddev->struct_mutex);
 }
 
+static void radeon_pm_print_states(struct radeon_device *rdev)
+{
+       int i, j;
+       struct radeon_power_state *power_state;
+       struct radeon_pm_clock_info *clock_info;
+
+       DRM_DEBUG("%d Power State(s)\n", rdev->pm.num_power_states);
+       for (i = 0; i < rdev->pm.num_power_states; i++) {
+               power_state = &rdev->pm.power_state[i];
+               DRM_DEBUG("State %d: %s\n", i,
+                       radeon_pm_state_type_name[power_state->type]);
+               if (i == rdev->pm.default_power_state_index)
+                       DRM_DEBUG("\tDefault");
+               if ((rdev->flags & RADEON_IS_PCIE) && !(rdev->flags & RADEON_IS_IGP))
+                       DRM_DEBUG("\t%d PCIE Lanes\n", power_state->pcie_lanes);
+               if (power_state->flags & RADEON_PM_STATE_SINGLE_DISPLAY_ONLY)
+                       DRM_DEBUG("\tSingle display only\n");
+               DRM_DEBUG("\t%d Clock Mode(s)\n", power_state->num_clock_modes);
+               for (j = 0; j < power_state->num_clock_modes; j++) {
+                       clock_info = &(power_state->clock_info[j]);
+                       if (rdev->flags & RADEON_IS_IGP)
+                               DRM_DEBUG("\t\t%d e: %d%s\n",
+                                       j,
+                                       clock_info->sclk * 10,
+                                       clock_info->flags & RADEON_PM_MODE_NO_DISPLAY ? "\tNo display only" : "");
+                       else
+                               DRM_DEBUG("\t\t%d e: %d\tm: %d\tv: %d%s\n",
+                                       j,
+                                       clock_info->sclk * 10,
+                                       clock_info->mclk * 10,
+                                       clock_info->voltage.voltage,
+                                       clock_info->flags & RADEON_PM_MODE_NO_DISPLAY ? "\tNo display only" : "");
+               }
+       }
+}
+
 static ssize_t radeon_get_pm_profile(struct device *dev,
                                     struct device_attribute *attr,
                                     char *buf)
@@ -311,6 +352,8 @@ static ssize_t radeon_set_pm_profile(struct device *dev,
                        rdev->pm.profile = PM_PROFILE_AUTO;
                else if (strncmp("low", buf, strlen("low")) == 0)
                        rdev->pm.profile = PM_PROFILE_LOW;
+               else if (strncmp("mid", buf, strlen("mid")) == 0)
+                       rdev->pm.profile = PM_PROFILE_MID;
                else if (strncmp("high", buf, strlen("high")) == 0)
                        rdev->pm.profile = PM_PROFILE_HIGH;
                else {
@@ -377,15 +420,19 @@ void radeon_pm_suspend(struct radeon_device *rdev)
 {
        mutex_lock(&rdev->pm.mutex);
        cancel_delayed_work(&rdev->pm.dynpm_idle_work);
-       rdev->pm.current_power_state_index = -1;
-       rdev->pm.current_clock_mode_index = -1;
-       rdev->pm.current_sclk = 0;
-       rdev->pm.current_mclk = 0;
        mutex_unlock(&rdev->pm.mutex);
 }
 
 void radeon_pm_resume(struct radeon_device *rdev)
 {
+       /* asic init will reset the default power state */
+       mutex_lock(&rdev->pm.mutex);
+       rdev->pm.current_power_state_index = rdev->pm.default_power_state_index;
+       rdev->pm.current_clock_mode_index = 0;
+       rdev->pm.current_sclk = rdev->clock.default_sclk;
+       rdev->pm.current_mclk = rdev->clock.default_mclk;
+       rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
+       mutex_unlock(&rdev->pm.mutex);
        radeon_pm_compute_clocks(rdev);
 }
 
@@ -394,32 +441,24 @@ int radeon_pm_init(struct radeon_device *rdev)
        int ret;
        /* default to profile method */
        rdev->pm.pm_method = PM_METHOD_PROFILE;
+       rdev->pm.profile = PM_PROFILE_DEFAULT;
        rdev->pm.dynpm_state = DYNPM_STATE_DISABLED;
        rdev->pm.dynpm_planned_action = DYNPM_ACTION_NONE;
        rdev->pm.dynpm_can_upclock = true;
        rdev->pm.dynpm_can_downclock = true;
-       rdev->pm.current_sclk = 0;
-       rdev->pm.current_mclk = 0;
+       rdev->pm.current_sclk = rdev->clock.default_sclk;
+       rdev->pm.current_mclk = rdev->clock.default_mclk;
 
        if (rdev->bios) {
                if (rdev->is_atom_bios)
                        radeon_atombios_get_power_modes(rdev);
                else
                        radeon_combios_get_power_modes(rdev);
+               radeon_pm_print_states(rdev);
                radeon_pm_init_profile(rdev);
-               rdev->pm.current_power_state_index = -1;
-               rdev->pm.current_clock_mode_index = -1;
        }
 
        if (rdev->pm.num_power_states > 1) {
-               if (rdev->pm.pm_method == PM_METHOD_PROFILE) {
-                       mutex_lock(&rdev->pm.mutex);
-                       rdev->pm.profile = PM_PROFILE_DEFAULT;
-                       radeon_pm_update_profile(rdev);
-                       radeon_pm_set_clocks(rdev);
-                       mutex_unlock(&rdev->pm.mutex);
-               }
-
                /* where's the best place to put these? */
                ret = device_create_file(rdev->dev, &dev_attr_power_profile);
                if (ret)
@@ -705,6 +744,8 @@ static int radeon_debugfs_pm_info(struct seq_file *m, void *data)
        seq_printf(m, "default memory clock: %u0 kHz\n", rdev->clock.default_mclk);
        if (rdev->asic->get_memory_clock)
                seq_printf(m, "current memory clock: %u0 kHz\n", radeon_get_memory_clock(rdev));
+       if (rdev->pm.current_vddc)
+               seq_printf(m, "voltage: %u mV\n", rdev->pm.current_vddc);
        if (rdev->asic->get_pcie_lanes)
                seq_printf(m, "PCIE lanes: %d\n", radeon_get_pcie_lanes(rdev));
 
index 33952da..cec536c 100644 (file)
@@ -44,12 +44,18 @@ void rv770_fini(struct radeon_device *rdev);
 
 void rv770_pm_misc(struct radeon_device *rdev)
 {
-       int requested_index = rdev->pm.requested_power_state_index;
-       struct radeon_power_state *ps = &rdev->pm.power_state[requested_index];
-       struct radeon_voltage *voltage = &ps->clock_info[0].voltage;
-
-       if ((voltage->type == VOLTAGE_SW) && voltage->voltage)
-               radeon_atom_set_voltage(rdev, voltage->voltage);
+       int req_ps_idx = rdev->pm.requested_power_state_index;
+       int req_cm_idx = rdev->pm.requested_clock_mode_index;
+       struct radeon_power_state *ps = &rdev->pm.power_state[req_ps_idx];
+       struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
+
+       if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
+               if (voltage->voltage != rdev->pm.current_vddc) {
+                       radeon_atom_set_voltage(rdev, voltage->voltage);
+                       rdev->pm.current_vddc = voltage->voltage;
+                       DRM_DEBUG("Setting: v: %d\n", voltage->voltage);
+               }
+       }
 }
 
 /*
index bdd67cf..8e39685 100644 (file)
@@ -644,6 +644,7 @@ int vmw_execbuf_ioctl(struct drm_device *dev, void *data,
        ret = copy_from_user(cmd, user_cmd, arg->command_size);
 
        if (unlikely(ret != 0)) {
+               ret = -EFAULT;
                DRM_ERROR("Failed copying commands.\n");
                goto out_commit;
        }
index f8fbbc6..8612378 100644 (file)
@@ -597,8 +597,10 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data,
 
        ret = copy_from_user(srf->sizes, user_sizes,
                             srf->num_sizes * sizeof(*srf->sizes));
-       if (unlikely(ret != 0))
+       if (unlikely(ret != 0)) {
+               ret = -EFAULT;
                goto out_err1;
+       }
 
        if (srf->scanout &&
            srf->num_sizes == 1 &&
@@ -697,9 +699,11 @@ int vmw_surface_reference_ioctl(struct drm_device *dev, void *data,
        if (user_sizes)
                ret = copy_to_user(user_sizes, srf->sizes,
                                   srf->num_sizes * sizeof(*srf->sizes));
-       if (unlikely(ret != 0))
+       if (unlikely(ret != 0)) {
                DRM_ERROR("copy_to_user failed %p %u\n",
                          user_sizes, srf->num_sizes);
+               ret = -EFAULT;
+       }
 out_bad_resource:
 out_no_reference:
        ttm_base_object_unref(&base);
index e00a1cc..c190664 100644 (file)
@@ -678,7 +678,7 @@ static const struct file_operations hp_sdc_rtc_fops = {
         .llseek =              no_llseek,
         .read =                        hp_sdc_rtc_read,
         .poll =                        hp_sdc_rtc_poll,
-        .unlocked_ioctl =      hp_sdc_rtc_ioctl,
+        .unlocked_ioctl =      hp_sdc_rtc_unlocked_ioctl,
         .open =                        hp_sdc_rtc_open,
         .fasync =              hp_sdc_rtc_fasync,
 };
index 000d65e..91c8013 100644 (file)
@@ -404,14 +404,9 @@ static int mtd_do_writeoob(struct file *file, struct mtd_info *mtd,
        if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs))
                return -EINVAL;
 
-       ops.oobbuf = kmalloc(length, GFP_KERNEL);
-       if (!ops.oobbuf)
-               return -ENOMEM;
-
-       if (copy_from_user(ops.oobbuf, ptr, length)) {
-               kfree(ops.oobbuf);
-               return -EFAULT;
-       }
+       ops.oobbuf = memdup_user(ptr, length);
+       if (IS_ERR(ops.oobbuf))
+               return PTR_ERR(ops.oobbuf);
 
        start &= ~((uint64_t)mtd->oobsize - 1);
        ret = mtd->write_oob(mtd, start, &ops);
index 98a04b3..ffc3720 100644 (file)
@@ -1,13 +1,3 @@
-menuconfig MTD_NAND
-       tristate "NAND Device Support"
-       depends on MTD
-       select MTD_NAND_IDS
-       select MTD_NAND_ECC
-       help
-         This enables support for accessing all type of NAND flash
-         devices. For further information see
-         <http://www.linux-mtd.infradead.org/doc/nand.html>.
-
 config MTD_NAND_ECC
        tristate
 
@@ -19,6 +9,17 @@ config MTD_NAND_ECC_SMC
          Software ECC according to the Smart Media Specification.
          The original Linux implementation had byte 0 and 1 swapped.
 
+
+menuconfig MTD_NAND
+       tristate "NAND Device Support"
+       depends on MTD
+       select MTD_NAND_IDS
+       select MTD_NAND_ECC
+       help
+         This enables support for accessing all type of NAND flash
+         devices. For further information see
+         <http://www.linux-mtd.infradead.org/doc/nand.html>.
+
 if MTD_NAND
 
 config MTD_NAND_VERIFY_WRITE
index 78a4232..bcfc851 100644 (file)
@@ -150,7 +150,6 @@ static void r852_dma_done(struct r852_device *dev, int error)
        if (dev->phys_dma_addr && dev->phys_dma_addr != dev->phys_bounce_buffer)
                pci_unmap_single(dev->pci_dev, dev->phys_dma_addr, R852_DMA_LEN,
                        dev->dma_dir ? PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE);
-       complete(&dev->dma_done);
 }
 
 /*
@@ -182,6 +181,7 @@ static void r852_do_dma(struct r852_device *dev, uint8_t *buf, int do_read)
        /* Set dma direction */
        dev->dma_dir = do_read;
        dev->dma_stage = 1;
+       INIT_COMPLETION(dev->dma_done);
 
        dbg_verbose("doing dma %s ", do_read ? "read" : "write");
 
@@ -494,6 +494,11 @@ int r852_ecc_correct(struct mtd_info *mtd, uint8_t *dat,
        if (dev->card_unstable)
                return 0;
 
+       if (dev->dma_error) {
+               dev->dma_error = 0;
+               return -1;
+       }
+
        r852_write_reg(dev, R852_CTL, dev->ctlreg | R852_CTL_ECC_ACCESS);
        ecc_reg = r852_read_reg_dword(dev, R852_DATALINE);
        r852_write_reg(dev, R852_CTL, dev->ctlreg);
@@ -707,6 +712,7 @@ void r852_card_detect_work(struct work_struct *work)
                container_of(work, struct r852_device, card_detect_work.work);
 
        r852_card_update_present(dev);
+       r852_update_card_detect(dev);
        dev->card_unstable = 0;
 
        /* False alarm */
@@ -722,7 +728,6 @@ void r852_card_detect_work(struct work_struct *work)
        else
                r852_unregister_nand_device(dev);
 exit:
-       /* Update detection logic */
        r852_update_card_detect(dev);
 }
 
@@ -796,6 +801,7 @@ static irqreturn_t r852_irq(int irq, void *data)
                if (dma_status & R852_DMA_IRQ_ERROR) {
                        dbg("recieved dma error IRQ");
                        r852_dma_done(dev, -EIO);
+                       complete(&dev->dma_done);
                        goto out;
                }
 
@@ -825,8 +831,10 @@ static irqreturn_t r852_irq(int irq, void *data)
                        r852_dma_enable(dev);
 
                /* Operation done */
-               if (dev->dma_stage == 3)
+               if (dev->dma_stage == 3) {
                        r852_dma_done(dev, 0);
+                       complete(&dev->dma_done);
+               }
                goto out;
        }
 
@@ -940,18 +948,19 @@ int  r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
 
        r852_dma_test(dev);
 
+       dev->irq = pci_dev->irq;
+       spin_lock_init(&dev->irqlock);
+
+       dev->card_detected = 0;
+       r852_card_update_present(dev);
+
        /*register irq handler*/
        error = -ENODEV;
        if (request_irq(pci_dev->irq, &r852_irq, IRQF_SHARED,
                          DRV_NAME, dev))
                goto error10;
 
-       dev->irq = pci_dev->irq;
-       spin_lock_init(&dev->irqlock);
-
        /* kick initial present test */
-       dev->card_detected = 0;
-       r852_card_update_present(dev);
        queue_delayed_work(dev->card_workqueue,
                &dev->card_detect_work, 0);
 
@@ -1081,7 +1090,7 @@ int r852_resume(struct device *device)
                        dev->card_detected ? "added" : "removed");
 
                queue_delayed_work(dev->card_workqueue,
-               &dev->card_detect_work, 1000);
+               &dev->card_detect_work, msecs_to_jiffies(1000));
                return 0;
        }
 
index b7512cf..477345d 100644 (file)
@@ -1457,7 +1457,8 @@ static void quirk_jmicron_ata(struct pci_dev *pdev)
        conf5 &= ~(1 << 24);  /* Clear bit 24 */
 
        switch (pdev->device) {
-       case PCI_DEVICE_ID_JMICRON_JMB360:
+       case PCI_DEVICE_ID_JMICRON_JMB360: /* SATA single port */
+       case PCI_DEVICE_ID_JMICRON_JMB362: /* SATA dual ports */
                /* The controller should be in single function ahci mode */
                conf1 |= 0x0002A100; /* Set 8, 13, 15, 17 */
                break;
@@ -1493,12 +1494,14 @@ static void quirk_jmicron_ata(struct pci_dev *pdev)
 }
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB360, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB362, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB360, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata);
+DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB362, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, quirk_jmicron_ata);
index 17da9ab..a0ae295 100644 (file)
@@ -42,7 +42,7 @@
  * size_t size;
  *
  * size = itcw_calc_size(1, 2, 0);
- * buffer = kmalloc(size, GFP_DMA);
+ * buffer = kmalloc(size, GFP_KERNEL | GFP_DMA);
  * if (!buffer)
  *     return -ENOMEM;
  * itcw = itcw_init(buffer, size, ITCW_OP_READ, 1, 2, 0);
index 0f41c91..df5b6b9 100644 (file)
@@ -637,7 +637,7 @@ const static struct file_operations vhost_net_fops = {
 };
 
 static struct miscdevice vhost_net_misc = {
-       VHOST_NET_MINOR,
+       MISC_DYNAMIC_MINOR,
        "vhost-net",
        &vhost_net_fops,
 };
index 89dd7b0..b68d928 100644 (file)
@@ -284,7 +284,7 @@ static int __devinit wm8350_wdt_probe(struct platform_device *pdev)
        struct wm8350 *wm8350 = platform_get_drvdata(pdev);
 
        if (!wm8350) {
-               dev_err(wm8350->dev, "No driver data supplied\n");
+               pr_err("No driver data supplied\n");
                return -ENODEV;
        }
 
index a33aab6..54a92fd 100644 (file)
@@ -234,8 +234,9 @@ static int jffs2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
                        if (inode->i_mode != mode) {
                                struct iattr attr;
 
-                               attr.ia_valid = ATTR_MODE;
+                               attr.ia_valid = ATTR_MODE | ATTR_CTIME;
                                attr.ia_mode = mode;
+                               attr.ia_ctime = CURRENT_TIME_SEC;
                                rc = jffs2_do_setattr(inode, &attr);
                                if (rc < 0)
                                        return rc;
index 7aa4417..166062a 100644 (file)
@@ -222,15 +222,18 @@ static int jffs2_create(struct inode *dir_i, struct dentry *dentry, int mode,
        dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(ri->ctime));
 
        jffs2_free_raw_inode(ri);
-       d_instantiate(dentry, inode);
 
        D1(printk(KERN_DEBUG "jffs2_create: Created ino #%lu with mode %o, nlink %d(%d). nrpages %ld\n",
                  inode->i_ino, inode->i_mode, inode->i_nlink,
                  f->inocache->pino_nlink, inode->i_mapping->nrpages));
+
+       d_instantiate(dentry, inode);
+       unlock_new_inode(inode);
        return 0;
 
  fail:
        make_bad_inode(inode);
+       unlock_new_inode(inode);
        iput(inode);
        jffs2_free_raw_inode(ri);
        return ret;
@@ -360,8 +363,8 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
                /* Eeek. Wave bye bye */
                mutex_unlock(&f->sem);
                jffs2_complete_reservation(c);
-               jffs2_clear_inode(inode);
-               return PTR_ERR(fn);
+               ret = PTR_ERR(fn);
+               goto fail;
        }
 
        /* We use f->target field to store the target path. */
@@ -370,8 +373,8 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
                printk(KERN_WARNING "Can't allocate %d bytes of memory\n", targetlen + 1);
                mutex_unlock(&f->sem);
                jffs2_complete_reservation(c);
-               jffs2_clear_inode(inode);
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto fail;
        }
 
        memcpy(f->target, target, targetlen + 1);
@@ -386,30 +389,24 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
        jffs2_complete_reservation(c);
 
        ret = jffs2_init_security(inode, dir_i);
-       if (ret) {
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
+
        ret = jffs2_init_acl_post(inode);
-       if (ret) {
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
 
        ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen,
                                  ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
-       if (ret) {
-               /* Eep. */
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
 
        rd = jffs2_alloc_raw_dirent();
        if (!rd) {
                /* Argh. Now we treat it like a normal delete */
                jffs2_complete_reservation(c);
-               jffs2_clear_inode(inode);
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto fail;
        }
 
        dir_f = JFFS2_INODE_INFO(dir_i);
@@ -437,8 +434,8 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
                jffs2_complete_reservation(c);
                jffs2_free_raw_dirent(rd);
                mutex_unlock(&dir_f->sem);
-               jffs2_clear_inode(inode);
-               return PTR_ERR(fd);
+               ret = PTR_ERR(fd);
+               goto fail;
        }
 
        dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime));
@@ -453,7 +450,14 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
        jffs2_complete_reservation(c);
 
        d_instantiate(dentry, inode);
+       unlock_new_inode(inode);
        return 0;
+
+ fail:
+       make_bad_inode(inode);
+       unlock_new_inode(inode);
+       iput(inode);
+       return ret;
 }
 
 
@@ -519,8 +523,8 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
                /* Eeek. Wave bye bye */
                mutex_unlock(&f->sem);
                jffs2_complete_reservation(c);
-               jffs2_clear_inode(inode);
-               return PTR_ERR(fn);
+               ret = PTR_ERR(fn);
+               goto fail;
        }
        /* No data here. Only a metadata node, which will be
           obsoleted by the first data write
@@ -531,30 +535,24 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
        jffs2_complete_reservation(c);
 
        ret = jffs2_init_security(inode, dir_i);
-       if (ret) {
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
+
        ret = jffs2_init_acl_post(inode);
-       if (ret) {
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
 
        ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen,
                                  ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
-       if (ret) {
-               /* Eep. */
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
 
        rd = jffs2_alloc_raw_dirent();
        if (!rd) {
                /* Argh. Now we treat it like a normal delete */
                jffs2_complete_reservation(c);
-               jffs2_clear_inode(inode);
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto fail;
        }
 
        dir_f = JFFS2_INODE_INFO(dir_i);
@@ -582,8 +580,8 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
                jffs2_complete_reservation(c);
                jffs2_free_raw_dirent(rd);
                mutex_unlock(&dir_f->sem);
-               jffs2_clear_inode(inode);
-               return PTR_ERR(fd);
+               ret = PTR_ERR(fd);
+               goto fail;
        }
 
        dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime));
@@ -599,7 +597,14 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
        jffs2_complete_reservation(c);
 
        d_instantiate(dentry, inode);
+       unlock_new_inode(inode);
        return 0;
+
+ fail:
+       make_bad_inode(inode);
+       unlock_new_inode(inode);
+       iput(inode);
+       return ret;
 }
 
 static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry)
@@ -693,8 +698,8 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
                /* Eeek. Wave bye bye */
                mutex_unlock(&f->sem);
                jffs2_complete_reservation(c);
-               jffs2_clear_inode(inode);
-               return PTR_ERR(fn);
+               ret = PTR_ERR(fn);
+               goto fail;
        }
        /* No data here. Only a metadata node, which will be
           obsoleted by the first data write
@@ -705,30 +710,24 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
        jffs2_complete_reservation(c);
 
        ret = jffs2_init_security(inode, dir_i);
-       if (ret) {
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
+
        ret = jffs2_init_acl_post(inode);
-       if (ret) {
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
 
        ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen,
                                  ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
-       if (ret) {
-               /* Eep. */
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
 
        rd = jffs2_alloc_raw_dirent();
        if (!rd) {
                /* Argh. Now we treat it like a normal delete */
                jffs2_complete_reservation(c);
-               jffs2_clear_inode(inode);
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto fail;
        }
 
        dir_f = JFFS2_INODE_INFO(dir_i);
@@ -759,8 +758,8 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
                jffs2_complete_reservation(c);
                jffs2_free_raw_dirent(rd);
                mutex_unlock(&dir_f->sem);
-               jffs2_clear_inode(inode);
-               return PTR_ERR(fd);
+               ret = PTR_ERR(fd);
+               goto fail;
        }
 
        dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime));
@@ -775,8 +774,14 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
        jffs2_complete_reservation(c);
 
        d_instantiate(dentry, inode);
-
+       unlock_new_inode(inode);
        return 0;
+
+ fail:
+       make_bad_inode(inode);
+       unlock_new_inode(inode);
+       iput(inode);
+       return ret;
 }
 
 static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
index 8bc2c80..459d39d 100644 (file)
@@ -465,7 +465,12 @@ struct inode *jffs2_new_inode (struct inode *dir_i, int mode, struct jffs2_raw_i
        inode->i_blocks = 0;
        inode->i_size = 0;
 
-       insert_inode_hash(inode);
+       if (insert_inode_locked(inode) < 0) {
+               make_bad_inode(inode);
+               unlock_new_inode(inode);
+               iput(inode);
+               return ERR_PTR(-EINVAL);
+       }
 
        return inode;
 }
index a0fa3bf..34640d6 100644 (file)
@@ -1381,14 +1381,6 @@ xfs_vm_writepage(
        if (!page_has_buffers(page))
                create_empty_buffers(page, 1 << inode->i_blkbits, 0);
 
-
-       /*
-        *  VM calculation for nr_to_write seems off.  Bump it way
-        *  up, this gets simple streaming writes zippy again.
-        *  To be reviewed again after Jens' writeback changes.
-        */
-       wbc->nr_to_write *= 4;
-
        /*
         * Convert delayed allocate, unwritten or unmapped space
         * to real space and flush out to disk.
index 3ff9fc0..5347063 100644 (file)
@@ -903,6 +903,7 @@ struct drm_radeon_cs {
 #define RADEON_INFO_NUM_Z_PIPES        0x02
 #define RADEON_INFO_ACCEL_WORKING      0x03
 #define RADEON_INFO_CRTC_FROM_ID       0x04
+#define RADEON_INFO_ACCEL_WORKING2     0x05
 
 struct drm_radeon_info {
        uint32_t                request;
index b631c46..f6c9b7d 100644 (file)
@@ -3,6 +3,12 @@
 #include <linux/module.h>
 #include <linux/major.h>
 
+/*
+ *     These allocations are managed by device@lanana.org. If you use an
+ *     entry that is not in assigned your entry may well be moved and
+ *     reassigned, or set dynamic if a fixed value is not justified.
+ */
+
 #define PSMOUSE_MINOR          1
 #define MS_BUSMOUSE_MINOR      2
 #define ATIXL_BUSMOUSE_MINOR   3
@@ -30,7 +36,6 @@
 #define HPET_MINOR             228
 #define FUSE_MINOR             229
 #define KVM_MINOR              232
-#define VHOST_NET_MINOR                233
 #define BTRFS_MINOR            234
 #define AUTOFS_MINOR           235
 #define MISC_DYNAMIC_MINOR     255
index f149dd1..4eb4679 100644 (file)
 #define PCI_VENDOR_ID_JMICRON          0x197B
 #define PCI_DEVICE_ID_JMICRON_JMB360   0x2360
 #define PCI_DEVICE_ID_JMICRON_JMB361   0x2361
+#define PCI_DEVICE_ID_JMICRON_JMB362   0x2362
 #define PCI_DEVICE_ID_JMICRON_JMB363   0x2363
 #define PCI_DEVICE_ID_JMICRON_JMB365   0x2365
 #define PCI_DEVICE_ID_JMICRON_JMB366   0x2366
index f641346..d63ef8f 100644 (file)
@@ -56,15 +56,6 @@ struct writeback_control {
        unsigned for_reclaim:1;         /* Invoked from the page allocator */
        unsigned range_cyclic:1;        /* range_start is cyclic */
        unsigned more_io:1;             /* more io to be dispatched */
-       /*
-        * write_cache_pages() won't update wbc->nr_to_write and
-        * mapping->writeback_index if no_nrwrite_index_update
-        * is set.  write_cache_pages() may write more than we
-        * requested and we want to make sure nr_to_write and
-        * writeback_index are updated in a consistent manner
-        * so we use a single control to update them
-        */
-       unsigned no_nrwrite_index_update:1;
 };
 
 /*
index f5b1ba9..f3865c7 100644 (file)
@@ -306,7 +306,6 @@ TRACE_EVENT(ext4_da_writepages_result,
                __field(        int,    pages_written           )
                __field(        long,   pages_skipped           )
                __field(        char,   more_io                 )       
-               __field(        char,   no_nrwrite_index_update )
                __field(       pgoff_t, writeback_index         )
        ),
 
@@ -317,16 +316,14 @@ TRACE_EVENT(ext4_da_writepages_result,
                __entry->pages_written  = pages_written;
                __entry->pages_skipped  = wbc->pages_skipped;
                __entry->more_io        = wbc->more_io;
-               __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update;
                __entry->writeback_index = inode->i_mapping->writeback_index;
        ),
 
-       TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld more_io %d no_nrwrite_index_update %d writeback_index %lu",
+       TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld more_io %d writeback_index %lu",
                  jbd2_dev_to_name(__entry->dev),
                  (unsigned long) __entry->ino, __entry->ret,
                  __entry->pages_written, __entry->pages_skipped,
                  __entry->more_io,
-                 __entry->no_nrwrite_index_update,
                  (unsigned long) __entry->writeback_index)
 );
 
index 5fa63bd..bbd396a 100644 (file)
@@ -835,7 +835,6 @@ int write_cache_pages(struct address_space *mapping,
        pgoff_t done_index;
        int cycled;
        int range_whole = 0;
-       long nr_to_write = wbc->nr_to_write;
 
        pagevec_init(&pvec, 0);
        if (wbc->range_cyclic) {
@@ -852,7 +851,22 @@ int write_cache_pages(struct address_space *mapping,
                if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX)
                        range_whole = 1;
                cycled = 1; /* ignore range_cyclic tests */
+
+               /*
+                * If this is a data integrity sync, cap the writeback to the
+                * current end of file. Any extension to the file that occurs
+                * after this is a new write and we don't need to write those
+                * pages out to fulfil our data integrity requirements. If we
+                * try to write them out, we can get stuck in this scan until
+                * the concurrent writer stops adding dirty pages and extending
+                * EOF.
+                */
+               if (wbc->sync_mode == WB_SYNC_ALL &&
+                   wbc->range_end == LLONG_MAX) {
+                       end = i_size_read(mapping->host) >> PAGE_CACHE_SHIFT;
+               }
        }
+
 retry:
        done_index = index;
        while (!done && (index <= end)) {
@@ -935,11 +949,10 @@ continue_unlock:
                                        done = 1;
                                        break;
                                }
-                       }
+                       }
 
-                       if (nr_to_write > 0) {
-                               nr_to_write--;
-                               if (nr_to_write == 0 &&
+                       if (wbc->nr_to_write > 0) {
+                               if (--wbc->nr_to_write == 0 &&
                                    wbc->sync_mode == WB_SYNC_NONE) {
                                        /*
                                         * We stop writing back only if we are
@@ -970,11 +983,8 @@ continue_unlock:
                end = writeback_index - 1;
                goto retry;
        }
-       if (!wbc->no_nrwrite_index_update) {
-               if (wbc->range_cyclic || (range_whole && nr_to_write > 0))
-                       mapping->writeback_index = done_index;
-               wbc->nr_to_write = nr_to_write;
-       }
+       if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0))
+               mapping->writeback_index = done_index;
 
        return ret;
 }