From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Rx2Nl-0007Ol-UL for garchives@archives.gentoo.org; Mon, 13 Feb 2012 20:20:20 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C8E18E096C; Mon, 13 Feb 2012 20:20:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 50230E096C for ; Mon, 13 Feb 2012 20:20:10 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 94AE2654CD for ; Mon, 13 Feb 2012 20:20:04 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2195) id 5D0062004B; Mon, 13 Feb 2012 20:20:03 +0000 (UTC) To: gentoo-commits@lists.gentoo.org From: "Mike Pagano (mpagano)" Subject: [gentoo-commits] linux-patches r2090 - genpatches-2.6/trunk/3.2 X-VCS-Repository: linux-patches X-VCS-Revision: 2090 X-VCS-Files: genpatches-2.6/trunk/3.2/1005_linux-3.2.6.patch genpatches-2.6/trunk/3.2/0000_README X-VCS-Directories: genpatches-2.6/trunk/3.2 X-VCS-Committer: mpagano X-VCS-Committer-Name: Mike Pagano Content-Type: text/plain; charset=UTF-8 Message-Id: <20120213202003.5D0062004B@flycatcher.gentoo.org> Date: Mon, 13 Feb 2012 20:20:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 2282aeb8-9599-4868-822d-5317e5b7e8b8 X-Archives-Hash: 7a58a1ab710b6e14b8fc7956318d5d04 Author: mpagano Date: 2012-02-13 20:20:02 +0000 (Mon, 13 Feb 2012) New Revision: 2090 Added: genpatches-2.6/trunk/3.2/1005_linux-3.2.6.patch Modified: genpatches-2.6/trunk/3.2/0000_README Log: Linux patch 3.2.6 Modified: genpatches-2.6/trunk/3.2/0000_README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- genpatches-2.6/trunk/3.2/0000_README 2012-02-10 17:30:16 UTC (rev 208= 9) +++ genpatches-2.6/trunk/3.2/0000_README 2012-02-13 20:20:02 UTC (rev 209= 0) @@ -60,6 +60,10 @@ From: http://www.kernel.org Desc: Linux 3.2.5 =20 +Patch: 1005_linux-3.2.6.patch +From: http://www.kernel.org +Desc: Linux 3.2.6 + Patch: 2400_kcopy-patch-for-infiniband-driver.patch From: Alexey Shvetsov Desc: Zero copy for infiniband psm userspace driver Added: genpatches-2.6/trunk/3.2/1005_linux-3.2.6.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- genpatches-2.6/trunk/3.2/1005_linux-3.2.6.patch = (rev 0) +++ genpatches-2.6/trunk/3.2/1005_linux-3.2.6.patch 2012-02-13 20:20:02 U= TC (rev 2090) @@ -0,0 +1,2789 @@ +diff --git a/Makefile b/Makefile +index e9dd0ff..47fe496 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION =3D 3 + PATCHLEVEL =3D 2 +-SUBLEVEL =3D 5 ++SUBLEVEL =3D 6 + EXTRAVERSION =3D + NAME =3D Saber-toothed Squirrel +=20 +diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c +index 483727a..90fa8b3 100644 +--- a/arch/arm/kernel/ptrace.c ++++ b/arch/arm/kernel/ptrace.c +@@ -699,10 +699,13 @@ static int vfp_set(struct task_struct *target, + { + int ret; + struct thread_info *thread =3D task_thread_info(target); +- struct vfp_hard_struct new_vfp =3D thread->vfpstate.hard; ++ struct vfp_hard_struct new_vfp; + const size_t user_fpregs_offset =3D offsetof(struct user_vfp, fpregs); + const size_t user_fpscr_offset =3D offsetof(struct user_vfp, fpscr); +=20 ++ vfp_sync_hwstate(thread); ++ new_vfp =3D thread->vfpstate.hard; ++ + ret =3D user_regset_copyin(&pos, &count, &kbuf, &ubuf, + &new_vfp.fpregs, + user_fpregs_offset, +@@ -723,9 +726,8 @@ static int vfp_set(struct task_struct *target, + if (ret) + return ret; +=20 +- vfp_sync_hwstate(thread); +- thread->vfpstate.hard =3D new_vfp; + vfp_flush_hwstate(thread); ++ thread->vfpstate.hard =3D new_vfp; +=20 + return 0; + } +diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c +index 0340224..9e617bd 100644 +--- a/arch/arm/kernel/signal.c ++++ b/arch/arm/kernel/signal.c +@@ -227,6 +227,8 @@ static int restore_vfp_context(struct vfp_sigframe _= _user *frame) + if (magic !=3D VFP_MAGIC || size !=3D VFP_STORAGE_SIZE) + return -EINVAL; +=20 ++ vfp_flush_hwstate(thread); ++ + /* + * Copy the floating point registers. There can be unused + * registers see asm/hwcap.h for details. +@@ -251,9 +253,6 @@ static int restore_vfp_context(struct vfp_sigframe _= _user *frame) + __get_user_error(h->fpinst, &frame->ufp_exc.fpinst, err); + __get_user_error(h->fpinst2, &frame->ufp_exc.fpinst2, err); +=20 +- if (!err) +- vfp_flush_hwstate(thread); +- + return err ? -EFAULT : 0; + } +=20 +diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c +index 130034b..dfffbbf 100644 +--- a/arch/arm/mach-omap2/gpmc.c ++++ b/arch/arm/mach-omap2/gpmc.c +@@ -528,7 +528,13 @@ int gpmc_cs_configure(int cs, int cmd, int wval) +=20 + case GPMC_CONFIG_DEV_SIZE: + regval =3D gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); ++ ++ /* clear 2 target bits */ ++ regval &=3D ~GPMC_CONFIG1_DEVICESIZE(3); ++ ++ /* set the proper value */ + regval |=3D GPMC_CONFIG1_DEVICESIZE(wval); ++ + gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval); + break; +=20 +diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8= .c +index bce576d..ad683ec 100644 +--- a/drivers/cpufreq/powernow-k8.c ++++ b/drivers/cpufreq/powernow-k8.c +@@ -54,6 +54,9 @@ static DEFINE_PER_CPU(struct powernow_k8_data *, power= now_data); +=20 + static int cpu_family =3D CPU_OPTERON; +=20 ++/* array to map SW pstate number to acpi state */ ++static u32 ps_to_as[8]; ++ + /* core performance boost */ + static bool cpb_capable, cpb_enabled; + static struct msr __percpu *msrs; +@@ -80,9 +83,9 @@ static u32 find_khz_freq_from_fid(u32 fid) + } +=20 + static u32 find_khz_freq_from_pstate(struct cpufreq_frequency_table *da= ta, +- u32 pstate) ++ u32 pstate) + { +- return data[pstate].frequency; ++ return data[ps_to_as[pstate]].frequency; + } +=20 + /* Return the vco fid for an input fid +@@ -926,23 +929,27 @@ static int fill_powernow_table_pstate(struct power= now_k8_data *data, + invalidate_entry(powernow_table, i); + continue; + } +- rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi); +- if (!(hi & HW_PSTATE_VALID_MASK)) { +- pr_debug("invalid pstate %d, ignoring\n", index); +- invalidate_entry(powernow_table, i); +- continue; +- } +=20 +- powernow_table[i].index =3D index; ++ ps_to_as[index] =3D i; +=20 + /* Frequency may be rounded for these */ + if ((boot_cpu_data.x86 =3D=3D 0x10 && boot_cpu_data.x86_model < 10) + || boot_cpu_data.x86 =3D=3D 0x11) { ++ ++ rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi); ++ if (!(hi & HW_PSTATE_VALID_MASK)) { ++ pr_debug("invalid pstate %d, ignoring\n", index); ++ invalidate_entry(powernow_table, i); ++ continue; ++ } ++ + powernow_table[i].frequency =3D + freq_from_fid_did(lo & 0x3f, (lo >> 6) & 7); + } else + powernow_table[i].frequency =3D + data->acpi_data.states[i].core_frequency * 1000; ++ ++ powernow_table[i].index =3D index; + } + return 0; + } +@@ -1189,7 +1196,8 @@ static int powernowk8_target(struct cpufreq_policy= *pol, + powernow_k8_acpi_pst_values(data, newstate); +=20 + if (cpu_family =3D=3D CPU_HW_PSTATE) +- ret =3D transition_frequency_pstate(data, newstate); ++ ret =3D transition_frequency_pstate(data, ++ data->powernow_table[newstate].index); + else + ret =3D transition_frequency_fidvid(data, newstate); + if (ret) { +@@ -1202,7 +1210,7 @@ static int powernowk8_target(struct cpufreq_policy= *pol, +=20 + if (cpu_family =3D=3D CPU_HW_PSTATE) + pol->cur =3D find_khz_freq_from_pstate(data->powernow_table, +- newstate); ++ data->powernow_table[newstate].index); + else + pol->cur =3D find_khz_freq_from_fid(data->currfid); + ret =3D 0; +diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c +index fcfa0a8..a60adbf 100644 +--- a/drivers/dma/at_hdmac.c ++++ b/drivers/dma/at_hdmac.c +@@ -1286,7 +1286,7 @@ static int __init at_dma_probe(struct platform_dev= ice *pdev) +=20 + tasklet_init(&atchan->tasklet, atc_tasklet, + (unsigned long)atchan); +- atc_enable_irq(atchan); ++ atc_enable_chan_irq(atdma, i); + } +=20 + /* set base routines */ +@@ -1353,7 +1353,7 @@ static int __exit at_dma_remove(struct platform_de= vice *pdev) + struct at_dma_chan *atchan =3D to_at_dma_chan(chan); +=20 + /* Disable interrupts */ +- atc_disable_irq(atchan); ++ atc_disable_chan_irq(atdma, chan->chan_id); + tasklet_disable(&atchan->tasklet); +=20 + tasklet_kill(&atchan->tasklet); +diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h +index aa4c9ae..5aa82b4 100644 +--- a/drivers/dma/at_hdmac_regs.h ++++ b/drivers/dma/at_hdmac_regs.h +@@ -326,28 +326,27 @@ static void atc_dump_lli(struct at_dma_chan *atcha= n, struct at_lli *lli) + } +=20 +=20 +-static void atc_setup_irq(struct at_dma_chan *atchan, int on) ++static void atc_setup_irq(struct at_dma *atdma, int chan_id, int on) + { +- struct at_dma *atdma =3D to_at_dma(atchan->chan_common.device); +- u32 ebci; ++ u32 ebci; +=20 + /* enable interrupts on buffer transfer completion & error */ +- ebci =3D AT_DMA_BTC(atchan->chan_common.chan_id) +- | AT_DMA_ERR(atchan->chan_common.chan_id); ++ ebci =3D AT_DMA_BTC(chan_id) ++ | AT_DMA_ERR(chan_id); + if (on) + dma_writel(atdma, EBCIER, ebci); + else + dma_writel(atdma, EBCIDR, ebci); + } +=20 +-static inline void atc_enable_irq(struct at_dma_chan *atchan) ++static void atc_enable_chan_irq(struct at_dma *atdma, int chan_id) + { +- atc_setup_irq(atchan, 1); ++ atc_setup_irq(atdma, chan_id, 1); + } +=20 +-static inline void atc_disable_irq(struct at_dma_chan *atchan) ++static void atc_disable_chan_irq(struct at_dma *atdma, int chan_id) + { +- atc_setup_irq(atchan, 0); ++ atc_setup_irq(atdma, chan_id, 0); + } +=20 +=20 +diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c +index 6628fea..7f5f0da 100644 +--- a/drivers/firewire/ohci.c ++++ b/drivers/firewire/ohci.c +@@ -263,6 +263,7 @@ static inline struct fw_ohci *fw_ohci(struct fw_card= *card) + static char ohci_driver_name[] =3D KBUILD_MODNAME; +=20 + #define PCI_DEVICE_ID_AGERE_FW643 0x5901 ++#define PCI_DEVICE_ID_CREATIVE_SB1394 0x4001 + #define PCI_DEVICE_ID_JMICRON_JMB38X_FW 0x2380 + #define PCI_DEVICE_ID_TI_TSB12LV22 0x8009 + #define PCI_DEVICE_ID_TI_TSB12LV26 0x8020 +@@ -289,6 +290,9 @@ static const struct { + {PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_AGERE_FW643, 6, + QUIRK_NO_MSI}, +=20 ++ {PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_SB1394, PCI_ANY_ID, ++ QUIRK_RESET_PACKET}, ++ + {PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB38X_FW, PCI_ANY_ID, + QUIRK_NO_MSI}, +=20 +@@ -299,7 +303,7 @@ static const struct { + QUIRK_NO_MSI}, +=20 + {PCI_VENDOR_ID_RICOH, PCI_ANY_ID, PCI_ANY_ID, +- QUIRK_CYCLE_TIMER}, ++ QUIRK_CYCLE_TIMER | QUIRK_NO_MSI}, +=20 + {PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_TSB12LV22, PCI_ANY_ID, + QUIRK_CYCLE_TIMER | QUIRK_RESET_PACKET | QUIRK_NO_1394A}, +diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/= i915_debugfs.c +index 004b048..b2e3c97 100644 +--- a/drivers/gpu/drm/i915/i915_debugfs.c ++++ b/drivers/gpu/drm/i915/i915_debugfs.c +@@ -1314,9 +1314,13 @@ static int i915_gen6_forcewake_count_info(struct = seq_file *m, void *data) + struct drm_info_node *node =3D (struct drm_info_node *) m->private; + struct drm_device *dev =3D node->minor->dev; + struct drm_i915_private *dev_priv =3D dev->dev_private; ++ unsigned forcewake_count; +=20 +- seq_printf(m, "forcewake count =3D %d\n", +- atomic_read(&dev_priv->forcewake_count)); ++ spin_lock_irq(&dev_priv->gt_lock); ++ forcewake_count =3D dev_priv->forcewake_count; ++ spin_unlock_irq(&dev_priv->gt_lock); ++ ++ seq_printf(m, "forcewake count =3D %u\n", forcewake_count); +=20 + return 0; + } +diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915= _dma.c +index a9ae374..c4da951 100644 +--- a/drivers/gpu/drm/i915/i915_dma.c ++++ b/drivers/gpu/drm/i915/i915_dma.c +@@ -2042,6 +2042,7 @@ int i915_driver_load(struct drm_device *dev, unsig= ned long flags) + if (!IS_I945G(dev) && !IS_I945GM(dev)) + pci_enable_msi(dev->pdev); +=20 ++ spin_lock_init(&dev_priv->gt_lock); + spin_lock_init(&dev_priv->irq_lock); + spin_lock_init(&dev_priv->error_lock); + spin_lock_init(&dev_priv->rps_lock); +diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915= _drv.c +index a1103fc..e2d85a9 100644 +--- a/drivers/gpu/drm/i915/i915_drv.c ++++ b/drivers/gpu/drm/i915/i915_drv.c +@@ -368,11 +368,12 @@ void __gen6_gt_force_wake_mt_get(struct drm_i915_p= rivate *dev_priv) + */ + void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv) + { +- WARN_ON(!mutex_is_locked(&dev_priv->dev->struct_mutex)); ++ unsigned long irqflags; +=20 +- /* Forcewake is atomic in case we get in here without the lock */ +- if (atomic_add_return(1, &dev_priv->forcewake_count) =3D=3D 1) ++ spin_lock_irqsave(&dev_priv->gt_lock, irqflags); ++ if (dev_priv->forcewake_count++ =3D=3D 0) + dev_priv->display.force_wake_get(dev_priv); ++ spin_unlock_irqrestore(&dev_priv->gt_lock, irqflags); + } +=20 + void __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv) +@@ -392,10 +393,12 @@ void __gen6_gt_force_wake_mt_put(struct drm_i915_p= rivate *dev_priv) + */ + void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv) + { +- WARN_ON(!mutex_is_locked(&dev_priv->dev->struct_mutex)); ++ unsigned long irqflags; +=20 +- if (atomic_dec_and_test(&dev_priv->forcewake_count)) ++ spin_lock_irqsave(&dev_priv->gt_lock, irqflags); ++ if (--dev_priv->forcewake_count =3D=3D 0) + dev_priv->display.force_wake_put(dev_priv); ++ spin_unlock_irqrestore(&dev_priv->gt_lock, irqflags); + } +=20 + void __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv) +@@ -626,6 +629,7 @@ int i915_reset(struct drm_device *dev, u8 flags) + * need to + */ + bool need_display =3D true; ++ unsigned long irqflags; + int ret; +=20 + if (!i915_try_reset) +@@ -644,8 +648,10 @@ int i915_reset(struct drm_device *dev, u8 flags) + case 6: + ret =3D gen6_do_reset(dev, flags); + /* If reset with a user forcewake, try to restore */ +- if (atomic_read(&dev_priv->forcewake_count)) +- __gen6_gt_force_wake_get(dev_priv); ++ spin_lock_irqsave(&dev_priv->gt_lock, irqflags); ++ if (dev_priv->forcewake_count) ++ dev_priv->display.force_wake_get(dev_priv); ++ spin_unlock_irqrestore(&dev_priv->gt_lock, irqflags); + break; + case 5: + ret =3D ironlake_do_reset(dev, flags); +diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915= _drv.h +index 554bef7..ae294a0 100644 +--- a/drivers/gpu/drm/i915/i915_drv.h ++++ b/drivers/gpu/drm/i915/i915_drv.h +@@ -286,7 +286,13 @@ typedef struct drm_i915_private { + int relative_constants_mode; +=20 + void __iomem *regs; +- u32 gt_fifo_count; ++ /** gt_fifo_count and the subsequent register write are synchronized ++ * with dev->struct_mutex. */ ++ unsigned gt_fifo_count; ++ /** forcewake_count is protected by gt_lock */ ++ unsigned forcewake_count; ++ /** gt_lock is also taken in irq contexts. */ ++ struct spinlock gt_lock; +=20 + struct intel_gmbus { + struct i2c_adapter adapter; +@@ -337,6 +343,8 @@ typedef struct drm_i915_private { + struct timer_list hangcheck_timer; + int hangcheck_count; + uint32_t last_acthd; ++ uint32_t last_acthd_bsd; ++ uint32_t last_acthd_blt; + uint32_t last_instdone; + uint32_t last_instdone1; +=20 +@@ -736,8 +744,6 @@ typedef struct drm_i915_private { +=20 + struct drm_property *broadcast_rgb_property; + struct drm_property *force_audio_property; +- +- atomic_t forcewake_count; + } drm_i915_private_t; +=20 + enum i915_cache_level { +diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915= _irq.c +index b40004b..d47a53b 100644 +--- a/drivers/gpu/drm/i915/i915_irq.c ++++ b/drivers/gpu/drm/i915/i915_irq.c +@@ -1669,7 +1669,7 @@ void i915_hangcheck_elapsed(unsigned long data) + { + struct drm_device *dev =3D (struct drm_device *)data; + drm_i915_private_t *dev_priv =3D dev->dev_private; +- uint32_t acthd, instdone, instdone1; ++ uint32_t acthd, instdone, instdone1, acthd_bsd, acthd_blt; + bool err =3D false; +=20 + if (!i915_enable_hangcheck) +@@ -1686,16 +1686,21 @@ void i915_hangcheck_elapsed(unsigned long data) + } +=20 + if (INTEL_INFO(dev)->gen < 4) { +- acthd =3D I915_READ(ACTHD); + instdone =3D I915_READ(INSTDONE); + instdone1 =3D 0; + } else { +- acthd =3D I915_READ(ACTHD_I965); + instdone =3D I915_READ(INSTDONE_I965); + instdone1 =3D I915_READ(INSTDONE1); + } ++ acthd =3D intel_ring_get_active_head(&dev_priv->ring[RCS]); ++ acthd_bsd =3D HAS_BSD(dev) ? ++ intel_ring_get_active_head(&dev_priv->ring[VCS]) : 0; ++ acthd_blt =3D HAS_BLT(dev) ? ++ intel_ring_get_active_head(&dev_priv->ring[BCS]) : 0; +=20 + if (dev_priv->last_acthd =3D=3D acthd && ++ dev_priv->last_acthd_bsd =3D=3D acthd_bsd && ++ dev_priv->last_acthd_blt =3D=3D acthd_blt && + dev_priv->last_instdone =3D=3D instdone && + dev_priv->last_instdone1 =3D=3D instdone1) { + if (dev_priv->hangcheck_count++ > 1) { +@@ -1727,6 +1732,8 @@ void i915_hangcheck_elapsed(unsigned long data) + dev_priv->hangcheck_count =3D 0; +=20 + dev_priv->last_acthd =3D acthd; ++ dev_priv->last_acthd_bsd =3D acthd_bsd; ++ dev_priv->last_acthd_blt =3D acthd_blt; + dev_priv->last_instdone =3D instdone; + dev_priv->last_instdone1 =3D instdone1; + } +diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/= i915_suspend.c +index 43cbafe..a1eb83d 100644 +--- a/drivers/gpu/drm/i915/i915_suspend.c ++++ b/drivers/gpu/drm/i915/i915_suspend.c +@@ -34,6 +34,10 @@ static bool i915_pipe_enabled(struct drm_device *dev,= enum pipe pipe) + struct drm_i915_private *dev_priv =3D dev->dev_private; + u32 dpll_reg; +=20 ++ /* On IVB, 3rd pipe shares PLL with another one */ ++ if (pipe > 1) ++ return false; ++ + if (HAS_PCH_SPLIT(dev)) + dpll_reg =3D (pipe =3D=3D PIPE_A) ? _PCH_DPLL_A : _PCH_DPLL_B; + else +diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/inte= l_dp.c +index 92b041b..db3b461 100644 +--- a/drivers/gpu/drm/i915/intel_dp.c ++++ b/drivers/gpu/drm/i915/intel_dp.c +@@ -1926,6 +1926,7 @@ intel_dp_link_down(struct intel_dp *intel_dp) + intel_wait_for_vblank(dev, to_intel_crtc(crtc)->pipe); + } +=20 ++ DP &=3D ~DP_AUDIO_OUTPUT_ENABLE; + I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN); + POSTING_READ(intel_dp->output_reg); + msleep(intel_dp->panel_power_down_delay); +diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/in= tel_hdmi.c +index d4f5a0b..64541f7 100644 +--- a/drivers/gpu/drm/i915/intel_hdmi.c ++++ b/drivers/gpu/drm/i915/intel_hdmi.c +@@ -269,6 +269,10 @@ static void intel_hdmi_dpms(struct drm_encoder *enc= oder, int mode) + struct drm_i915_private *dev_priv =3D dev->dev_private; + struct intel_hdmi *intel_hdmi =3D enc_to_intel_hdmi(encoder); + u32 temp; ++ u32 enable_bits =3D SDVO_ENABLE; ++ ++ if (intel_hdmi->has_audio) ++ enable_bits |=3D SDVO_AUDIO_ENABLE; +=20 + temp =3D I915_READ(intel_hdmi->sdvox_reg); +=20 +@@ -281,9 +285,9 @@ static void intel_hdmi_dpms(struct drm_encoder *enco= der, int mode) + } +=20 + if (mode !=3D DRM_MODE_DPMS_ON) { +- temp &=3D ~SDVO_ENABLE; ++ temp &=3D ~enable_bits; + } else { +- temp |=3D SDVO_ENABLE; ++ temp |=3D enable_bits; + } +=20 + I915_WRITE(intel_hdmi->sdvox_reg, temp); +diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/inte= l_tv.c +index f3c6a9a..2b1fcad 100644 +--- a/drivers/gpu/drm/i915/intel_tv.c ++++ b/drivers/gpu/drm/i915/intel_tv.c +@@ -417,7 +417,7 @@ static const struct tv_mode tv_modes[] =3D { + { + .name =3D "NTSC-M", + .clock =3D 108000, +- .refresh =3D 29970, ++ .refresh =3D 59940, + .oversample =3D TV_OVERSAMPLE_8X, + .component_only =3D 0, + /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 3.580MHz */ +@@ -460,7 +460,7 @@ static const struct tv_mode tv_modes[] =3D { + { + .name =3D "NTSC-443", + .clock =3D 108000, +- .refresh =3D 29970, ++ .refresh =3D 59940, + .oversample =3D TV_OVERSAMPLE_8X, + .component_only =3D 0, + /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 4.43MHz */ +@@ -502,7 +502,7 @@ static const struct tv_mode tv_modes[] =3D { + { + .name =3D "NTSC-J", + .clock =3D 108000, +- .refresh =3D 29970, ++ .refresh =3D 59940, + .oversample =3D TV_OVERSAMPLE_8X, + .component_only =3D 0, +=20 +@@ -545,7 +545,7 @@ static const struct tv_mode tv_modes[] =3D { + { + .name =3D "PAL-M", + .clock =3D 108000, +- .refresh =3D 29970, ++ .refresh =3D 59940, + .oversample =3D TV_OVERSAMPLE_8X, + .component_only =3D 0, +=20 +@@ -589,7 +589,7 @@ static const struct tv_mode tv_modes[] =3D { + /* 625 Lines, 50 Fields, 15.625KHz line, Sub-Carrier 4.434MHz */ + .name =3D "PAL-N", + .clock =3D 108000, +- .refresh =3D 25000, ++ .refresh =3D 50000, + .oversample =3D TV_OVERSAMPLE_8X, + .component_only =3D 0, +=20 +@@ -634,7 +634,7 @@ static const struct tv_mode tv_modes[] =3D { + /* 625 Lines, 50 Fields, 15.625KHz line, Sub-Carrier 4.434MHz */ + .name =3D "PAL", + .clock =3D 108000, +- .refresh =3D 25000, ++ .refresh =3D 50000, + .oversample =3D TV_OVERSAMPLE_8X, + .component_only =3D 0, +=20 +@@ -821,7 +821,7 @@ static const struct tv_mode tv_modes[] =3D { + { + .name =3D "1080i@50Hz", + .clock =3D 148800, +- .refresh =3D 25000, ++ .refresh =3D 50000, + .oversample =3D TV_OVERSAMPLE_2X, + .component_only =3D 1, +=20 +@@ -847,7 +847,7 @@ static const struct tv_mode tv_modes[] =3D { + { + .name =3D "1080i@60Hz", + .clock =3D 148800, +- .refresh =3D 30000, ++ .refresh =3D 60000, + .oversample =3D TV_OVERSAMPLE_2X, + .component_only =3D 1, +=20 +diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nou= veau/nouveau_gem.c +index 5f0bc57..7ce3fde 100644 +--- a/drivers/gpu/drm/nouveau/nouveau_gem.c ++++ b/drivers/gpu/drm/nouveau/nouveau_gem.c +@@ -380,6 +380,25 @@ retry: + } +=20 + static int ++validate_sync(struct nouveau_channel *chan, struct nouveau_bo *nvbo) ++{ ++ struct nouveau_fence *fence =3D NULL; ++ int ret =3D 0; ++ ++ spin_lock(&nvbo->bo.bdev->fence_lock); ++ if (nvbo->bo.sync_obj) ++ fence =3D nouveau_fence_ref(nvbo->bo.sync_obj); ++ spin_unlock(&nvbo->bo.bdev->fence_lock); ++ ++ if (fence) { ++ ret =3D nouveau_fence_sync(fence, chan); ++ nouveau_fence_unref(&fence); ++ } ++ ++ return ret; ++} ++ ++static int + validate_list(struct nouveau_channel *chan, struct list_head *list, + struct drm_nouveau_gem_pushbuf_bo *pbbo, uint64_t user_pbbo_ptr) + { +@@ -393,7 +412,7 @@ validate_list(struct nouveau_channel *chan, struct l= ist_head *list, + list_for_each_entry(nvbo, list, entry) { + struct drm_nouveau_gem_pushbuf_bo *b =3D &pbbo[nvbo->pbbo_index]; +=20 +- ret =3D nouveau_fence_sync(nvbo->bo.sync_obj, chan); ++ ret =3D validate_sync(chan, nvbo); + if (unlikely(ret)) { + NV_ERROR(dev, "fail pre-validate sync\n"); + return ret; +@@ -416,7 +435,7 @@ validate_list(struct nouveau_channel *chan, struct l= ist_head *list, + return ret; + } +=20 +- ret =3D nouveau_fence_sync(nvbo->bo.sync_obj, chan); ++ ret =3D validate_sync(chan, nvbo); + if (unlikely(ret)) { + NV_ERROR(dev, "fail post-validate sync\n"); + return ret; +diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/ra= deon/atombios_crtc.c +index 2b97262..b30081f 100644 +--- a/drivers/gpu/drm/radeon/atombios_crtc.c ++++ b/drivers/gpu/drm/radeon/atombios_crtc.c +@@ -1189,7 +1189,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *= crtc, + WREG32(EVERGREEN_GRPH_ENABLE + radeon_crtc->crtc_offset, 1); +=20 + WREG32(EVERGREEN_DESKTOP_HEIGHT + radeon_crtc->crtc_offset, +- crtc->mode.vdisplay); ++ target_fb->height); + x &=3D ~3; + y &=3D ~1; + WREG32(EVERGREEN_VIEWPORT_START + radeon_crtc->crtc_offset, +@@ -1358,7 +1358,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc = *crtc, + WREG32(AVIVO_D1GRPH_ENABLE + radeon_crtc->crtc_offset, 1); +=20 + WREG32(AVIVO_D1MODE_DESKTOP_HEIGHT + radeon_crtc->crtc_offset, +- crtc->mode.vdisplay); ++ target_fb->height); + x &=3D ~3; + y &=3D ~1; + WREG32(AVIVO_D1MODE_VIEWPORT_START + radeon_crtc->crtc_offset, +diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/rade= on/atombios_dp.c +index a71557c..552b436 100644 +--- a/drivers/gpu/drm/radeon/atombios_dp.c ++++ b/drivers/gpu/drm/radeon/atombios_dp.c +@@ -564,9 +564,21 @@ int radeon_dp_get_panel_mode(struct drm_encoder *en= coder, + ENCODER_OBJECT_ID_NUTMEG) + panel_mode =3D DP_PANEL_MODE_INTERNAL_DP1_MODE; + else if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) = =3D=3D +- ENCODER_OBJECT_ID_TRAVIS) +- panel_mode =3D DP_PANEL_MODE_INTERNAL_DP2_MODE; +- else if (connector->connector_type =3D=3D DRM_MODE_CONNECTOR_eDP) { ++ ENCODER_OBJECT_ID_TRAVIS) { ++ u8 id[6]; ++ int i; ++ for (i =3D 0; i < 6; i++) ++ id[i] =3D radeon_read_dpcd_reg(radeon_connector, 0x503 + i); ++ if (id[0] =3D=3D 0x73 && ++ id[1] =3D=3D 0x69 && ++ id[2] =3D=3D 0x76 && ++ id[3] =3D=3D 0x61 && ++ id[4] =3D=3D 0x72 && ++ id[5] =3D=3D 0x54) ++ panel_mode =3D DP_PANEL_MODE_INTERNAL_DP1_MODE; ++ else ++ panel_mode =3D DP_PANEL_MODE_INTERNAL_DP2_MODE; ++ } else if (connector->connector_type =3D=3D DRM_MODE_CONNECTOR_eDP) { + u8 tmp =3D radeon_read_dpcd_reg(radeon_connector, DP_EDP_CONFIGURATIO= N_CAP); + if (tmp & 1) + panel_mode =3D DP_PANEL_MODE_INTERNAL_DP2_MODE; +diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/ra= deon/radeon_device.c +index 9b39145..9231564 100644 +--- a/drivers/gpu/drm/radeon/radeon_device.c ++++ b/drivers/gpu/drm/radeon/radeon_device.c +@@ -864,6 +864,8 @@ int radeon_suspend_kms(struct drm_device *dev, pm_me= ssage_t state) + if (dev->switch_power_state =3D=3D DRM_SWITCH_POWER_OFF) + return 0; +=20 ++ drm_kms_helper_poll_disable(dev); ++ + /* turn off display hw */ + list_for_each_entry(connector, &dev->mode_config.connector_list, head)= { + drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); +@@ -950,6 +952,8 @@ int radeon_resume_kms(struct drm_device *dev) + list_for_each_entry(connector, &dev->mode_config.connector_list, head)= { + drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); + } ++ ++ drm_kms_helper_poll_enable(dev); + return 0; + } +=20 +diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c +index 4b57ab6..c25387d 100644 +--- a/drivers/hwmon/w83627ehf.c ++++ b/drivers/hwmon/w83627ehf.c +@@ -1920,9 +1920,26 @@ w83627ehf_check_fan_inputs(const struct w83627ehf= _sio_data *sio_data, + fan4min =3D 0; + fan5pin =3D 0; + } else if (sio_data->kind =3D=3D nct6776) { +- fan3pin =3D !(superio_inb(sio_data->sioreg, 0x24) & 0x40); +- fan4pin =3D !!(superio_inb(sio_data->sioreg, 0x1C) & 0x01); +- fan5pin =3D !!(superio_inb(sio_data->sioreg, 0x1C) & 0x02); ++ bool gpok =3D superio_inb(sio_data->sioreg, 0x27) & 0x80; ++ ++ superio_select(sio_data->sioreg, W83627EHF_LD_HWM); ++ regval =3D superio_inb(sio_data->sioreg, SIO_REG_ENABLE); ++ ++ if (regval & 0x80) ++ fan3pin =3D gpok; ++ else ++ fan3pin =3D !(superio_inb(sio_data->sioreg, 0x24) & 0x40); ++ ++ if (regval & 0x40) ++ fan4pin =3D gpok; ++ else ++ fan4pin =3D !!(superio_inb(sio_data->sioreg, 0x1C) & 0x01); ++ ++ if (regval & 0x20) ++ fan5pin =3D gpok; ++ else ++ fan5pin =3D !!(superio_inb(sio_data->sioreg, 0x1C) & 0x02); ++ + fan4min =3D fan4pin; + } else if (sio_data->kind =3D=3D w83667hg || sio_data->kind =3D=3D w83= 667hg_b) { + fan3pin =3D 1; +diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/c= ore/uverbs_cmd.c +index e3db8ef..a8445b8 100644 +--- a/drivers/infiniband/core/uverbs_cmd.c ++++ b/drivers/infiniband/core/uverbs_cmd.c +@@ -1485,6 +1485,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file = *file, + qp->event_handler =3D attr.event_handler; + qp->qp_context =3D attr.qp_context; + qp->qp_type =3D attr.qp_type; ++ atomic_set(&qp->usecnt, 0); + atomic_inc(&pd->usecnt); + atomic_inc(&attr.send_cq->usecnt); + if (attr.recv_cq) +diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/v= erbs.c +index 602b1bd..575b780 100644 +--- a/drivers/infiniband/core/verbs.c ++++ b/drivers/infiniband/core/verbs.c +@@ -421,6 +421,7 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd, + qp->uobject =3D NULL; + qp->qp_type =3D qp_init_attr->qp_type; +=20 ++ atomic_set(&qp->usecnt, 0); + if (qp_init_attr->qp_type =3D=3D IB_QPT_XRC_TGT) { + qp->event_handler =3D __ib_shared_qp_event_handler; + qp->qp_context =3D qp; +@@ -430,7 +431,6 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd, + qp->xrcd =3D qp_init_attr->xrcd; + atomic_inc(&qp_init_attr->xrcd->usecnt); + INIT_LIST_HEAD(&qp->open_list); +- atomic_set(&qp->usecnt, 0); +=20 + real_qp =3D qp; + qp =3D __ib_open_qp(real_qp, qp_init_attr->event_handler, +diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/ml= x4/mad.c +index f36da99..77702c0 100644 +--- a/drivers/infiniband/hw/mlx4/mad.c ++++ b/drivers/infiniband/hw/mlx4/mad.c +@@ -256,12 +256,9 @@ static int ib_process_mad(struct ib_device *ibdev, = int mad_flags, u8 port_num, + return IB_MAD_RESULT_SUCCESS; +=20 + /* +- * Don't process SMInfo queries or vendor-specific +- * MADs -- the SMA can't handle them. ++ * Don't process SMInfo queries -- the SMA can't handle them. + */ +- if (in_mad->mad_hdr.attr_id =3D=3D IB_SMP_ATTR_SM_INFO || +- ((in_mad->mad_hdr.attr_id & IB_SMP_ATTR_VENDOR_MASK) =3D=3D +- IB_SMP_ATTR_VENDOR_MASK)) ++ if (in_mad->mad_hdr.attr_id =3D=3D IB_SMP_ATTR_SM_INFO) + return IB_MAD_RESULT_SUCCESS; + } else if (in_mad->mad_hdr.mgmt_class =3D=3D IB_MGMT_CLASS_PERF_MGMT |= | + in_mad->mad_hdr.mgmt_class =3D=3D MLX4_IB_VENDOR_CLASS1 || +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index 4ee277a..e0b3e33 100644 +--- a/drivers/iommu/amd_iommu.c ++++ b/drivers/iommu/amd_iommu.c +@@ -2479,6 +2479,9 @@ static unsigned device_dma_ops_init(void) +=20 + for_each_pci_dev(pdev) { + if (!check_device(&pdev->dev)) { ++ ++ iommu_ignore_device(&pdev->dev); ++ + unhandled +=3D 1; + continue; + } +diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c +index 5865dd2..a4d134d 100644 +--- a/drivers/iommu/msm_iommu.c ++++ b/drivers/iommu/msm_iommu.c +@@ -481,23 +481,19 @@ static int msm_iommu_unmap(struct iommu_domain *do= main, unsigned long va, +=20 + priv =3D domain->priv; +=20 +- if (!priv) { +- ret =3D -ENODEV; ++ if (!priv) + goto fail; +- } +=20 + fl_table =3D priv->pgtable; +=20 + if (len !=3D SZ_16M && len !=3D SZ_1M && + len !=3D SZ_64K && len !=3D SZ_4K) { + pr_debug("Bad length: %d\n", len); +- ret =3D -EINVAL; + goto fail; + } +=20 + if (!fl_table) { + pr_debug("Null page table\n"); +- ret =3D -EINVAL; + goto fail; + } +=20 +@@ -506,7 +502,6 @@ static int msm_iommu_unmap(struct iommu_domain *doma= in, unsigned long va, +=20 + if (*fl_pte =3D=3D 0) { + pr_debug("First level PTE is 0\n"); +- ret =3D -ENODEV; + goto fail; + } +=20 +diff --git a/drivers/misc/cb710/core.c b/drivers/misc/cb710/core.c +index 68cd05b..85cc771 100644 +--- a/drivers/misc/cb710/core.c ++++ b/drivers/misc/cb710/core.c +@@ -245,6 +245,7 @@ static int __devinit cb710_probe(struct pci_dev *pde= v, + if (err) + return err; +=20 ++ spin_lock_init(&chip->irq_lock); + chip->pdev =3D pdev; + chip->iobase =3D pcim_iomap_table(pdev)[0]; +=20 +diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand= .c +index 23e5d77..ee6e26e 100644 +--- a/drivers/mtd/nand/atmel_nand.c ++++ b/drivers/mtd/nand/atmel_nand.c +@@ -161,6 +161,37 @@ static int atmel_nand_device_ready(struct mtd_info = *mtd) + !!host->board->rdy_pin_active_low; + } +=20 ++/* ++ * Minimal-overhead PIO for data access. ++ */ ++static void atmel_read_buf8(struct mtd_info *mtd, u8 *buf, int len) ++{ ++ struct nand_chip *nand_chip =3D mtd->priv; ++ ++ __raw_readsb(nand_chip->IO_ADDR_R, buf, len); ++} ++ ++static void atmel_read_buf16(struct mtd_info *mtd, u8 *buf, int len) ++{ ++ struct nand_chip *nand_chip =3D mtd->priv; ++ ++ __raw_readsw(nand_chip->IO_ADDR_R, buf, len / 2); ++} ++ ++static void atmel_write_buf8(struct mtd_info *mtd, const u8 *buf, int l= en) ++{ ++ struct nand_chip *nand_chip =3D mtd->priv; ++ ++ __raw_writesb(nand_chip->IO_ADDR_W, buf, len); ++} ++ ++static void atmel_write_buf16(struct mtd_info *mtd, const u8 *buf, int = len) ++{ ++ struct nand_chip *nand_chip =3D mtd->priv; ++ ++ __raw_writesw(nand_chip->IO_ADDR_W, buf, len / 2); ++} ++ + static void dma_complete_func(void *completion) + { + complete(completion); +@@ -235,27 +266,33 @@ err_buf: + static void atmel_read_buf(struct mtd_info *mtd, u8 *buf, int len) + { + struct nand_chip *chip =3D mtd->priv; ++ struct atmel_nand_host *host =3D chip->priv; +=20 + if (use_dma && len > mtd->oobsize) + /* only use DMA for bigger than oob size: better performances */ + if (atmel_nand_dma_op(mtd, buf, len, 1) =3D=3D 0) + return; +=20 +- /* if no DMA operation possible, use PIO */ +- memcpy_fromio(buf, chip->IO_ADDR_R, len); ++ if (host->board->bus_width_16) ++ atmel_read_buf16(mtd, buf, len); ++ else ++ atmel_read_buf8(mtd, buf, len); + } +=20 + static void atmel_write_buf(struct mtd_info *mtd, const u8 *buf, int le= n) + { + struct nand_chip *chip =3D mtd->priv; ++ struct atmel_nand_host *host =3D chip->priv; +=20 + if (use_dma && len > mtd->oobsize) + /* only use DMA for bigger than oob size: better performances */ + if (atmel_nand_dma_op(mtd, (void *)buf, len, 0) =3D=3D 0) + return; +=20 +- /* if no DMA operation possible, use PIO */ +- memcpy_toio(chip->IO_ADDR_W, buf, len); ++ if (host->board->bus_width_16) ++ atmel_write_buf16(mtd, buf, len); ++ else ++ atmel_write_buf8(mtd, buf, len); + } +=20 + /* +diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gp= mi-nand/gpmi-lib.c +index de4db76..bb2fe60 100644 +--- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c ++++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c +@@ -69,17 +69,19 @@ static int clear_poll_bit(void __iomem *addr, u32 ma= sk) + * [1] enable the module. + * [2] reset the module. + * +- * In most of the cases, it's ok. But there is a hardware bug in the BC= H block. ++ * In most of the cases, it's ok. ++ * But in MX23, there is a hardware bug in the BCH block (see erratum #= 2847). + * If you try to soft reset the BCH block, it becomes unusable until + * the next hard reset. This case occurs in the NAND boot mode. When th= e board + * boots by NAND, the ROM of the chip will initialize the BCH blocks it= self. + * So If the driver tries to reset the BCH again, the BCH will not work= anymore. +- * You will see a DMA timeout in this case. ++ * You will see a DMA timeout in this case. The bug has been fixed ++ * in the following chips, such as MX28. + * + * To avoid this bug, just add a new parameter `just_enable` for + * the mxs_reset_block(), and rewrite it here. + */ +-int gpmi_reset_block(void __iomem *reset_addr, bool just_enable) ++static int gpmi_reset_block(void __iomem *reset_addr, bool just_enable) + { + int ret; + int timeout =3D 0x400; +@@ -206,7 +208,15 @@ int bch_set_geometry(struct gpmi_nand_data *this) + if (ret) + goto err_out; +=20 +- ret =3D gpmi_reset_block(r->bch_regs, true); ++ /* ++ * Due to erratum #2847 of the MX23, the BCH cannot be soft reset on th= is ++ * chip, otherwise it will lock up. So we skip resetting BCH on the MX2= 3. ++ * On the other hand, the MX28 needs the reset, because one case has be= en ++ * seen where the BCH produced ECC errors constantly after 10000 ++ * consecutive reboots. The latter case has not been seen on the MX23 y= et, ++ * still we don't know if it could happen there as well. ++ */ ++ ret =3D gpmi_reset_block(r->bch_regs, GPMI_IS_MX23(this)); + if (ret) + goto err_out; +=20 +diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/etherne= t/realtek/8139cp.c +index ee5da92..aba4f67 100644 +--- a/drivers/net/ethernet/realtek/8139cp.c ++++ b/drivers/net/ethernet/realtek/8139cp.c +@@ -563,6 +563,7 @@ rx_next: + if (cpr16(IntrStatus) & cp_rx_intr_mask) + goto rx_status_loop; +=20 ++ napi_gro_flush(napi); + spin_lock_irqsave(&cp->lock, flags); + __napi_complete(napi); + cpw16_f(IntrMask, cp_intr_mask); +diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c +index 749c2a1..1932029 100644 +--- a/drivers/pcmcia/ds.c ++++ b/drivers/pcmcia/ds.c +@@ -1269,10 +1269,8 @@ static int pcmcia_bus_add(struct pcmcia_socket *s= kt) +=20 + static int pcmcia_bus_early_resume(struct pcmcia_socket *skt) + { +- if (!verify_cis_cache(skt)) { +- pcmcia_put_socket(skt); ++ if (!verify_cis_cache(skt)) + return 0; +- } +=20 + dev_dbg(&skt->dev, "cis mismatch - different card\n"); +=20 +diff --git a/drivers/staging/asus_oled/asus_oled.c b/drivers/staging/asu= s_oled/asus_oled.c +index 7bb7da7..63bafbb 100644 +--- a/drivers/staging/asus_oled/asus_oled.c ++++ b/drivers/staging/asus_oled/asus_oled.c +@@ -355,7 +355,14 @@ static void send_data(struct asus_oled_dev *odev) +=20 + static int append_values(struct asus_oled_dev *odev, uint8_t val, size_= t count) + { +- while (count-- > 0 && val) { ++ odev->last_val =3D val; ++ ++ if (val =3D=3D 0) { ++ odev->buf_offs +=3D count; ++ return 0; ++ } ++ ++ while (count-- > 0) { + size_t x =3D odev->buf_offs % odev->width; + size_t y =3D odev->buf_offs / odev->width; + size_t i; +@@ -406,7 +413,6 @@ static int append_values(struct asus_oled_dev *odev,= uint8_t val, size_t count) + ; + } +=20 +- odev->last_val =3D val; + odev->buf_offs++; + } +=20 +@@ -805,10 +811,9 @@ error: +=20 + static void __exit asus_oled_exit(void) + { ++ usb_deregister(&oled_driver); + class_remove_file(oled_class, &class_attr_version.attr); + class_destroy(oled_class); +- +- usb_deregister(&oled_driver); + } +=20 + module_init(asus_oled_init); +diff --git a/drivers/staging/rtl8712/drv_types.h b/drivers/staging/rtl87= 12/drv_types.h +index 9b5d771..ed85b44 100644 +--- a/drivers/staging/rtl8712/drv_types.h ++++ b/drivers/staging/rtl8712/drv_types.h +@@ -37,6 +37,8 @@ struct _adapter; + #include "wlan_bssdef.h" + #include "rtl8712_spec.h" + #include "rtl8712_hal.h" ++#include ++#include +=20 + enum _NIC_VERSION { + RTL8711_NIC, +@@ -168,6 +170,7 @@ struct _adapter { + s32 bSurpriseRemoved; + u32 IsrContent; + u32 ImrContent; ++ bool fw_found; + u8 EepromAddressSize; + u8 hw_init_completed; + struct task_struct *cmdThread; +@@ -184,6 +187,10 @@ struct _adapter { + _workitem wkFilterRxFF0; + u8 blnEnableRxFF0Filter; + spinlock_t lockRxFF0Filter; ++ const struct firmware *fw; ++ struct usb_interface *pusb_intf; ++ struct mutex mutex_start; ++ struct completion rtl8712_fw_ready; + }; +=20 + static inline u8 *myid(struct eeprom_priv *peepriv) +diff --git a/drivers/staging/rtl8712/hal_init.c b/drivers/staging/rtl871= 2/hal_init.c +index d0029aa..cc893c0 100644 +--- a/drivers/staging/rtl8712/hal_init.c ++++ b/drivers/staging/rtl8712/hal_init.c +@@ -42,29 +42,56 @@ + #define FWBUFF_ALIGN_SZ 512 + #define MAX_DUMP_FWSZ 49152 /*default =3D 49152 (48k)*/ +=20 +-static u32 rtl871x_open_fw(struct _adapter *padapter, void **pphfwfile_= hdl, +- const u8 **ppmappedfw) ++static void rtl871x_load_fw_cb(const struct firmware *firmware, void *c= ontext) + { ++ struct _adapter *padapter =3D context; ++ ++ complete(&padapter->rtl8712_fw_ready); ++ if (!firmware) { ++ struct usb_device *udev =3D padapter->dvobjpriv.pusbdev; ++ struct usb_interface *pusb_intf =3D padapter->pusb_intf; ++ printk(KERN_ERR "r8712u: Firmware request failed\n"); ++ padapter->fw_found =3D false; ++ usb_put_dev(udev); ++ usb_set_intfdata(pusb_intf, NULL); ++ return; ++ } ++ padapter->fw =3D firmware; ++ padapter->fw_found =3D true; ++ /* firmware available - start netdev */ ++ register_netdev(padapter->pnetdev); ++} ++ ++static const char firmware_file[] =3D "rtlwifi/rtl8712u.bin"; ++ ++int rtl871x_load_fw(struct _adapter *padapter) ++{ ++ struct device *dev =3D &padapter->dvobjpriv.pusbdev->dev; + int rc; +- const char firmware_file[] =3D "rtlwifi/rtl8712u.bin"; +- const struct firmware **praw =3D (const struct firmware **) +- (pphfwfile_hdl); +- struct dvobj_priv *pdvobjpriv =3D (struct dvobj_priv *) +- (&padapter->dvobjpriv); +- struct usb_device *pusbdev =3D pdvobjpriv->pusbdev; +=20 ++ init_completion(&padapter->rtl8712_fw_ready); + printk(KERN_INFO "r8712u: Loading firmware from \"%s\"\n", + firmware_file); +- rc =3D request_firmware(praw, firmware_file, &pusbdev->dev); +- if (rc < 0) { +- printk(KERN_ERR "r8712u: Unable to load firmware\n"); +- printk(KERN_ERR "r8712u: Install latest linux-firmware\n"); ++ rc =3D request_firmware_nowait(THIS_MODULE, 1, firmware_file, dev, ++ GFP_KERNEL, padapter, rtl871x_load_fw_cb); ++ if (rc) ++ printk(KERN_ERR "r8712u: Firmware request error %d\n", rc); ++ return rc; ++} ++MODULE_FIRMWARE("rtlwifi/rtl8712u.bin"); ++ ++static u32 rtl871x_open_fw(struct _adapter *padapter, const u8 **ppmapp= edfw) ++{ ++ const struct firmware **praw =3D &padapter->fw; ++ ++ if (padapter->fw->size > 200000) { ++ printk(KERN_ERR "r8172u: Badfw->size of %d\n", ++ (int)padapter->fw->size); + return 0; + } + *ppmappedfw =3D (u8 *)((*praw)->data); + return (*praw)->size; + } +-MODULE_FIRMWARE("rtlwifi/rtl8712u.bin"); +=20 + static void fill_fwpriv(struct _adapter *padapter, struct fw_priv *pfwp= riv) + { +@@ -142,18 +169,17 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) + uint dump_imem_sz, imem_sz, dump_emem_sz, emem_sz; /* max =3D 49152; *= / + struct fw_hdr fwhdr; + u32 ulfilelength; /* FW file size */ +- void *phfwfile_hdl =3D NULL; + const u8 *pmappedfw =3D NULL; + u8 *ptmpchar =3D NULL, *ppayload, *ptr; + struct tx_desc *ptx_desc; + u32 txdscp_sz =3D sizeof(struct tx_desc); + u8 ret =3D _FAIL; +=20 +- ulfilelength =3D rtl871x_open_fw(padapter, &phfwfile_hdl, &pmappedfw); ++ ulfilelength =3D rtl871x_open_fw(padapter, &pmappedfw); + if (pmappedfw && (ulfilelength > 0)) { + update_fwhdr(&fwhdr, pmappedfw); + if (chk_fwhdr(&fwhdr, ulfilelength) =3D=3D _FAIL) +- goto firmware_rel; ++ return ret; + fill_fwpriv(padapter, &fwhdr.fwpriv); + /* firmware check ok */ + maxlen =3D (fwhdr.img_IMEM_size > fwhdr.img_SRAM_size) ? +@@ -161,7 +187,7 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) + maxlen +=3D txdscp_sz; + ptmpchar =3D _malloc(maxlen + FWBUFF_ALIGN_SZ); + if (ptmpchar =3D=3D NULL) +- goto firmware_rel; ++ return ret; +=20 + ptx_desc =3D (struct tx_desc *)(ptmpchar + FWBUFF_ALIGN_SZ - + ((addr_t)(ptmpchar) & (FWBUFF_ALIGN_SZ - 1))); +@@ -297,8 +323,6 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) +=20 + exit_fail: + kfree(ptmpchar); +-firmware_rel: +- release_firmware((struct firmware *)phfwfile_hdl); + return ret; + } +=20 +diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl871= 2/os_intfs.c +index 9a75c6d..98a3d68 100644 +--- a/drivers/staging/rtl8712/os_intfs.c ++++ b/drivers/staging/rtl8712/os_intfs.c +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + #include "osdep_service.h" + #include "drv_types.h" + #include "xmit_osdep.h" +@@ -264,12 +265,12 @@ static void start_drv_timers(struct _adapter *pada= pter) + void r8712_stop_drv_timers(struct _adapter *padapter) + { + _cancel_timer_ex(&padapter->mlmepriv.assoc_timer); +- _cancel_timer_ex(&padapter->mlmepriv.sitesurveyctrl. +- sitesurvey_ctrl_timer); + _cancel_timer_ex(&padapter->securitypriv.tkip_timer); + _cancel_timer_ex(&padapter->mlmepriv.scan_to_timer); + _cancel_timer_ex(&padapter->mlmepriv.dhcp_timer); + _cancel_timer_ex(&padapter->mlmepriv.wdg_timer); ++ _cancel_timer_ex(&padapter->mlmepriv.sitesurveyctrl. ++ sitesurvey_ctrl_timer); + } +=20 + static u8 init_default_value(struct _adapter *padapter) +@@ -347,7 +348,8 @@ u8 r8712_free_drv_sw(struct _adapter *padapter) + r8712_free_mlme_priv(&padapter->mlmepriv); + r8712_free_io_queue(padapter); + _free_xmit_priv(&padapter->xmitpriv); +- _r8712_free_sta_priv(&padapter->stapriv); ++ if (padapter->fw_found) ++ _r8712_free_sta_priv(&padapter->stapriv); + _r8712_free_recv_priv(&padapter->recvpriv); + mp871xdeinit(padapter); + if (pnetdev) +@@ -388,6 +390,7 @@ static int netdev_open(struct net_device *pnetdev) + { + struct _adapter *padapter =3D (struct _adapter *)netdev_priv(pnetdev); +=20 ++ mutex_lock(&padapter->mutex_start); + if (padapter->bup =3D=3D false) { + padapter->bDriverStopped =3D false; + padapter->bSurpriseRemoved =3D false; +@@ -435,11 +438,13 @@ static int netdev_open(struct net_device *pnetdev) + /* start driver mlme relation timer */ + start_drv_timers(padapter); + padapter->ledpriv.LedControlHandler(padapter, LED_CTL_NO_LINK); ++ mutex_unlock(&padapter->mutex_start); + return 0; + netdev_open_error: + padapter->bup =3D false; + netif_carrier_off(pnetdev); + netif_stop_queue(pnetdev); ++ mutex_unlock(&padapter->mutex_start); + return -1; + } +=20 +@@ -473,6 +478,9 @@ static int netdev_close(struct net_device *pnetdev) + r8712_free_network_queue(padapter); + /* The interface is no longer Up: */ + padapter->bup =3D false; ++ release_firmware(padapter->fw); ++ /* never exit with a firmware callback pending */ ++ wait_for_completion(&padapter->rtl8712_fw_ready); + return 0; + } +=20 +diff --git a/drivers/staging/rtl8712/rtl8712_hal.h b/drivers/staging/rtl= 8712/rtl8712_hal.h +index 665e718..d19865a 100644 +--- a/drivers/staging/rtl8712/rtl8712_hal.h ++++ b/drivers/staging/rtl8712/rtl8712_hal.h +@@ -145,5 +145,6 @@ struct hal_priv { + }; +=20 + uint rtl8712_hal_init(struct _adapter *padapter); ++int rtl871x_load_fw(struct _adapter *padapter); +=20 + #endif +diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl871= 2/usb_intf.c +index 5385da2..9bade18 100644 +--- a/drivers/staging/rtl8712/usb_intf.c ++++ b/drivers/staging/rtl8712/usb_intf.c +@@ -89,6 +89,7 @@ static struct usb_device_id rtl871x_usb_id_tbl[] =3D { + {USB_DEVICE(0x0DF6, 0x0045)}, + {USB_DEVICE(0x0DF6, 0x0059)}, /* 11n mode disable */ + {USB_DEVICE(0x0DF6, 0x004B)}, ++ {USB_DEVICE(0x0DF6, 0x005B)}, + {USB_DEVICE(0x0DF6, 0x005D)}, + {USB_DEVICE(0x0DF6, 0x0063)}, + /* Sweex */ +@@ -389,6 +390,7 @@ static int r871xu_drv_init(struct usb_interface *pus= b_intf, + pdvobjpriv =3D &padapter->dvobjpriv; + pdvobjpriv->padapter =3D padapter; + padapter->dvobjpriv.pusbdev =3D udev; ++ padapter->pusb_intf =3D pusb_intf; + usb_set_intfdata(pusb_intf, pnetdev); + SET_NETDEV_DEV(pnetdev, &pusb_intf->dev); + /* step 2. */ +@@ -595,10 +597,11 @@ static int r871xu_drv_init(struct usb_interface *p= usb_intf, + "%pM\n", mac); + memcpy(pnetdev->dev_addr, mac, ETH_ALEN); + } +- /* step 6. Tell the network stack we exist */ +- if (register_netdev(pnetdev) !=3D 0) ++ /* step 6. Load the firmware asynchronously */ ++ if (rtl871x_load_fw(padapter)) + goto error; + spin_lock_init(&padapter->lockRxFF0Filter); ++ mutex_init(&padapter->mutex_start); + return 0; + error: + usb_put_dev(udev); +@@ -629,7 +632,8 @@ static void r871xu_dev_remove(struct usb_interface *= pusb_intf) + flush_scheduled_work(); + udelay(1); + /*Stop driver mlme relation timer */ +- r8712_stop_drv_timers(padapter); ++ if (padapter->fw_found) ++ r8712_stop_drv_timers(padapter); + r871x_dev_unload(padapter); + r8712_free_drv_sw(padapter); + } +diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcac= he/zcache-main.c +index 56c1f9c..f5e469d 100644 +--- a/drivers/staging/zcache/zcache-main.c ++++ b/drivers/staging/zcache/zcache-main.c +@@ -358,8 +358,8 @@ static struct zbud_hdr *zbud_create(uint16_t client_= id, uint16_t pool_id, + if (unlikely(zbpg =3D=3D NULL)) + goto out; + /* ok, have a page, now compress the data before taking locks */ +- spin_lock(&zbpg->lock); + spin_lock(&zbud_budlists_spinlock); ++ spin_lock(&zbpg->lock); + list_add_tail(&zbpg->bud_list, &zbud_unbuddied[nchunks].list); + zbud_unbuddied[nchunks].count++; + zh =3D &zbpg->buddy[0]; +@@ -389,12 +389,11 @@ init_zh: + zh->oid =3D *oid; + zh->pool_id =3D pool_id; + zh->client_id =3D client_id; +- /* can wait to copy the data until the list locks are dropped */ +- spin_unlock(&zbud_budlists_spinlock); +- + to =3D zbud_data(zh, size); + memcpy(to, cdata, size); + spin_unlock(&zbpg->lock); ++ spin_unlock(&zbud_budlists_spinlock); ++ + zbud_cumul_chunk_counts[nchunks]++; + atomic_inc(&zcache_zbud_curr_zpages); + zcache_zbud_cumul_zpages++; +@@ -1782,9 +1781,9 @@ static int zcache_frontswap_poolid =3D -1; + * Swizzling increases objects per swaptype, increasing tmem concurrenc= y + * for heavy swaploads. Later, larger nr_cpus -> larger SWIZ_BITS + * Setting SWIZ_BITS to 27 basically reconstructs the swap entry from +- * frontswap_get_page() ++ * frontswap_get_page(), but has side-effects. Hence using 8. + */ +-#define SWIZ_BITS 27 ++#define SWIZ_BITS 8 + #define SWIZ_MASK ((1 << SWIZ_BITS) - 1) + #define _oswiz(_type, _ind) ((_type << SWIZ_BITS) | (_ind & SWIZ_MASK)) + #define iswiz(_ind) (_ind >> SWIZ_BITS) +diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/= iscsi_target.c +index 8599545..0c1d5c73 100644 +--- a/drivers/target/iscsi/iscsi_target.c ++++ b/drivers/target/iscsi/iscsi_target.c +@@ -1062,7 +1062,7 @@ attach_cmd: + if (ret < 0) + return iscsit_add_reject_from_cmd( + ISCSI_REASON_BOOKMARK_NO_RESOURCES, +- 1, 1, buf, cmd); ++ 1, 0, buf, cmd); + /* + * Check the CmdSN against ExpCmdSN/MaxCmdSN here if + * the Immediate Bit is not set, and no Immediate +@@ -3165,6 +3165,30 @@ static int iscsit_send_task_mgt_rsp( + return 0; + } +=20 ++static bool iscsit_check_inaddr_any(struct iscsi_np *np) ++{ ++ bool ret =3D false; ++ ++ if (np->np_sockaddr.ss_family =3D=3D AF_INET6) { ++ const struct sockaddr_in6 sin6 =3D { ++ .sin6_addr =3D IN6ADDR_ANY_INIT }; ++ struct sockaddr_in6 *sock_in6 =3D ++ (struct sockaddr_in6 *)&np->np_sockaddr; ++ ++ if (!memcmp(sock_in6->sin6_addr.s6_addr, ++ sin6.sin6_addr.s6_addr, 16)) ++ ret =3D true; ++ } else { ++ struct sockaddr_in * sock_in =3D ++ (struct sockaddr_in *)&np->np_sockaddr; ++ ++ if (sock_in->sin_addr.s_addr =3D=3D INADDR_ANY) ++ ret =3D true; ++ } ++ ++ return ret; ++} ++ + static int iscsit_build_sendtargets_response(struct iscsi_cmd *cmd) + { + char *payload =3D NULL; +@@ -3214,12 +3238,17 @@ static int iscsit_build_sendtargets_response(str= uct iscsi_cmd *cmd) + spin_lock(&tpg->tpg_np_lock); + list_for_each_entry(tpg_np, &tpg->tpg_gnp_list, + tpg_np_list) { ++ struct iscsi_np *np =3D tpg_np->tpg_np; ++ bool inaddr_any =3D iscsit_check_inaddr_any(np); ++ + len =3D sprintf(buf, "TargetAddress=3D" + "%s%s%s:%hu,%hu", +- (tpg_np->tpg_np->np_sockaddr.ss_family =3D=3D AF_INET6) ? +- "[" : "", tpg_np->tpg_np->np_ip, +- (tpg_np->tpg_np->np_sockaddr.ss_family =3D=3D AF_INET6) ? +- "]" : "", tpg_np->tpg_np->np_port, ++ (np->np_sockaddr.ss_family =3D=3D AF_INET6) ? ++ "[" : "", (inaddr_any =3D=3D false) ? ++ np->np_ip : conn->local_ip, ++ (np->np_sockaddr.ss_family =3D=3D AF_INET6) ? ++ "]" : "", (inaddr_any =3D=3D false) ? ++ np->np_port : conn->local_port, + tpg->tpgt); + len +=3D 1; +=20 +diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/i= scsi/iscsi_target_core.h +index f1a02da..7da2d6a 100644 +--- a/drivers/target/iscsi/iscsi_target_core.h ++++ b/drivers/target/iscsi/iscsi_target_core.h +@@ -508,6 +508,7 @@ struct iscsi_conn { + u16 cid; + /* Remote TCP Port */ + u16 login_port; ++ u16 local_port; + int net_size; + u32 auth_id; + #define CONNFLAG_SCTP_STRUCT_FILE 0x01 +@@ -527,6 +528,7 @@ struct iscsi_conn { + unsigned char bad_hdr[ISCSI_HDR_LEN]; + #define IPV6_ADDRESS_SPACE 48 + unsigned char login_ip[IPV6_ADDRESS_SPACE]; ++ unsigned char local_ip[IPV6_ADDRESS_SPACE]; + int conn_usage_count; + int conn_waiting_on_uc; + atomic_t check_immediate_queue; +diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/= iscsi/iscsi_target_login.c +index d734bde..bd2adec 100644 +--- a/drivers/target/iscsi/iscsi_target_login.c ++++ b/drivers/target/iscsi/iscsi_target_login.c +@@ -616,8 +616,8 @@ static int iscsi_post_login_handler( + } +=20 + pr_debug("iSCSI Login successful on CID: %hu from %s to" +- " %s:%hu,%hu\n", conn->cid, conn->login_ip, np->np_ip, +- np->np_port, tpg->tpgt); ++ " %s:%hu,%hu\n", conn->cid, conn->login_ip, ++ conn->local_ip, conn->local_port, tpg->tpgt); +=20 + list_add_tail(&conn->conn_list, &sess->sess_conn_list); + atomic_inc(&sess->nconn); +@@ -659,7 +659,8 @@ static int iscsi_post_login_handler( + sess->session_state =3D TARG_SESS_STATE_LOGGED_IN; +=20 + pr_debug("iSCSI Login successful on CID: %hu from %s to %s:%hu,%hu\n", +- conn->cid, conn->login_ip, np->np_ip, np->np_port, tpg->tpgt); ++ conn->cid, conn->login_ip, conn->local_ip, conn->local_port, ++ tpg->tpgt); +=20 + spin_lock_bh(&sess->conn_lock); + list_add_tail(&conn->conn_list, &sess->sess_conn_list); +@@ -1019,6 +1020,18 @@ static int __iscsi_target_login_thread(struct isc= si_np *np) + snprintf(conn->login_ip, sizeof(conn->login_ip), "%pI6c", + &sock_in6.sin6_addr.in6_u); + conn->login_port =3D ntohs(sock_in6.sin6_port); ++ ++ if (conn->sock->ops->getname(conn->sock, ++ (struct sockaddr *)&sock_in6, &err, 0) < 0) { ++ pr_err("sock_ops->getname() failed.\n"); ++ iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, ++ ISCSI_LOGIN_STATUS_TARGET_ERROR); ++ goto new_sess_out; ++ } ++ snprintf(conn->local_ip, sizeof(conn->local_ip), "%pI6c", ++ &sock_in6.sin6_addr.in6_u); ++ conn->local_port =3D ntohs(sock_in6.sin6_port); ++ + } else { + memset(&sock_in, 0, sizeof(struct sockaddr_in)); +=20 +@@ -1031,6 +1044,16 @@ static int __iscsi_target_login_thread(struct isc= si_np *np) + } + sprintf(conn->login_ip, "%pI4", &sock_in.sin_addr.s_addr); + conn->login_port =3D ntohs(sock_in.sin_port); ++ ++ if (conn->sock->ops->getname(conn->sock, ++ (struct sockaddr *)&sock_in, &err, 0) < 0) { ++ pr_err("sock_ops->getname() failed.\n"); ++ iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, ++ ISCSI_LOGIN_STATUS_TARGET_ERROR); ++ goto new_sess_out; ++ } ++ sprintf(conn->local_ip, "%pI4", &sock_in.sin_addr.s_addr); ++ conn->local_port =3D ntohs(sock_in.sin_port); + } +=20 + conn->network_transport =3D np->np_network_transport; +@@ -1038,7 +1061,7 @@ static int __iscsi_target_login_thread(struct iscs= i_np *np) + pr_debug("Received iSCSI login request from %s on %s Network" + " Portal %s:%hu\n", conn->login_ip, + (conn->network_transport =3D=3D ISCSI_TCP) ? "TCP" : "SCTP", +- np->np_ip, np->np_port); ++ conn->local_ip, conn->local_port); +=20 + pr_debug("Moving to TARG_CONN_STATE_IN_LOGIN.\n"); + conn->conn_state =3D TARG_CONN_STATE_IN_LOGIN; +diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/i= scsi/iscsi_target_util.c +index 02348f7..99f2af3 100644 +--- a/drivers/target/iscsi/iscsi_target_util.c ++++ b/drivers/target/iscsi/iscsi_target_util.c +@@ -851,6 +851,17 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd) + case ISCSI_OP_SCSI_TMFUNC: + transport_generic_free_cmd(&cmd->se_cmd, 1); + break; ++ case ISCSI_OP_REJECT: ++ /* ++ * Handle special case for REJECT when iscsi_add_reject*() has ++ * overwritten the original iscsi_opcode assignment, and the ++ * associated cmd->se_cmd needs to be released. ++ */ ++ if (cmd->se_cmd.se_tfo !=3D NULL) { ++ transport_generic_free_cmd(&cmd->se_cmd, 1); ++ break; ++ } ++ /* Fall-through */ + default: + iscsit_release_cmd(cmd); + break; +diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_co= re_cdb.c +index 2e8c1be..251e48f 100644 +--- a/drivers/target/target_core_cdb.c ++++ b/drivers/target/target_core_cdb.c +@@ -701,6 +701,13 @@ int target_emulate_inquiry(struct se_task *task) + int p, ret; +=20 + if (!(cdb[1] & 0x1)) { ++ if (cdb[2]) { ++ pr_err("INQUIRY with EVPD=3D=3D0 but PAGE CODE=3D%02x\n", ++ cdb[2]); ++ cmd->scsi_sense_reason =3D TCM_INVALID_CDB_FIELD; ++ return -EINVAL; ++ } ++ + ret =3D target_emulate_inquiry_std(cmd); + goto out; + } +@@ -732,7 +739,7 @@ int target_emulate_inquiry(struct se_task *task) + } +=20 + pr_err("Unknown VPD Code: 0x%02x\n", cdb[2]); +- cmd->scsi_sense_reason =3D TCM_UNSUPPORTED_SCSI_OPCODE; ++ cmd->scsi_sense_reason =3D TCM_INVALID_CDB_FIELD; + ret =3D -EINVAL; +=20 + out_unmap: +diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_cor= e_pr.c +index 95dee70..9119d92 100644 +--- a/drivers/target/target_core_pr.c ++++ b/drivers/target/target_core_pr.c +@@ -481,6 +481,7 @@ static int core_scsi3_pr_seq_non_holder( + case READ_MEDIA_SERIAL_NUMBER: + case REPORT_LUNS: + case REQUEST_SENSE: ++ case PERSISTENT_RESERVE_IN: + ret =3D 0; /*/ Allowed CDBs */ + break; + default: +@@ -3138,7 +3139,7 @@ static int core_scsi3_pro_preempt( + if (!calling_it_nexus) + core_scsi3_ua_allocate(pr_reg_nacl, + pr_res_mapped_lun, 0x2A, +- ASCQ_2AH_RESERVATIONS_PREEMPTED); ++ ASCQ_2AH_REGISTRATIONS_PREEMPTED); + } + spin_unlock(&pr_tmpl->registration_lock); + /* +@@ -3251,7 +3252,7 @@ static int core_scsi3_pro_preempt( + * additional sense code set to REGISTRATIONS PREEMPTED; + */ + core_scsi3_ua_allocate(pr_reg_nacl, pr_res_mapped_lun, 0x2A, +- ASCQ_2AH_RESERVATIONS_PREEMPTED); ++ ASCQ_2AH_REGISTRATIONS_PREEMPTED); + } + spin_unlock(&pr_tmpl->registration_lock); + /* +diff --git a/drivers/target/target_core_transport.c b/drivers/target/tar= get_core_transport.c +index e87d0eb..861628e 100644 +--- a/drivers/target/target_core_transport.c ++++ b/drivers/target/target_core_transport.c +@@ -3701,6 +3701,11 @@ transport_allocate_control_task(struct se_cmd *cm= d) + struct se_task *task; + unsigned long flags; +=20 ++ /* Workaround for handling zero-length control CDBs */ ++ if ((cmd->se_cmd_flags & SCF_SCSI_CONTROL_SG_IO_CDB) && ++ !cmd->data_length) ++ return 0; ++ + task =3D transport_generic_get_task(cmd, cmd->data_direction); + if (!task) + return -ENOMEM; +@@ -3772,6 +3777,14 @@ int transport_generic_new_cmd(struct se_cmd *cmd) + else if (!task_cdbs && (cmd->se_cmd_flags & SCF_SCSI_DATA_SG_IO_CDB)) = { + cmd->t_state =3D TRANSPORT_COMPLETE; + atomic_set(&cmd->t_transport_active, 1); ++ ++ if (cmd->t_task_cdb[0] =3D=3D REQUEST_SENSE) { ++ u8 ua_asc =3D 0, ua_ascq =3D 0; ++ ++ core_scsi3_ua_clear_for_request_sense(cmd, ++ &ua_asc, &ua_ascq); ++ } ++ + INIT_WORK(&cmd->work, target_complete_ok_work); + queue_work(target_completion_wq, &cmd->work); + return 0; +@@ -4403,8 +4416,8 @@ int transport_send_check_condition_and_sense( + /* CURRENT ERROR */ + buffer[offset] =3D 0x70; + buffer[offset+SPC_ADD_SENSE_LEN_OFFSET] =3D 10; +- /* ABORTED COMMAND */ +- buffer[offset+SPC_SENSE_KEY_OFFSET] =3D ABORTED_COMMAND; ++ /* ILLEGAL REQUEST */ ++ buffer[offset+SPC_SENSE_KEY_OFFSET] =3D ILLEGAL_REQUEST; + /* INVALID FIELD IN CDB */ + buffer[offset+SPC_ASC_KEY_OFFSET] =3D 0x24; + break; +@@ -4412,8 +4425,8 @@ int transport_send_check_condition_and_sense( + /* CURRENT ERROR */ + buffer[offset] =3D 0x70; + buffer[offset+SPC_ADD_SENSE_LEN_OFFSET] =3D 10; +- /* ABORTED COMMAND */ +- buffer[offset+SPC_SENSE_KEY_OFFSET] =3D ABORTED_COMMAND; ++ /* ILLEGAL REQUEST */ ++ buffer[offset+SPC_SENSE_KEY_OFFSET] =3D ILLEGAL_REQUEST; + /* INVALID FIELD IN PARAMETER LIST */ + buffer[offset+SPC_ASC_KEY_OFFSET] =3D 0x26; + break; +diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c +index 5e096f4..65447c5 100644 +--- a/drivers/tty/vt/vt_ioctl.c ++++ b/drivers/tty/vt/vt_ioctl.c +@@ -1463,7 +1463,6 @@ compat_kdfontop_ioctl(struct compat_console_font_o= p __user *fontop, + if (!perm && op->op !=3D KD_FONT_OP_GET) + return -EPERM; + op->data =3D compat_ptr(((struct compat_console_font_op *)op)->data); +- op->flags |=3D KD_FONT_FLAG_OLD; + i =3D con_font_op(vc, op); + if (i) + return i; +diff --git a/drivers/usb/gadget/f_loopback.c b/drivers/usb/gadget/f_loop= back.c +index 6d87f28..2c0cd82 100644 +--- a/drivers/usb/gadget/f_loopback.c ++++ b/drivers/usb/gadget/f_loopback.c +@@ -418,7 +418,7 @@ int __init loopback_add(struct usb_composite_dev *cd= ev, bool autoresume) +=20 + /* support autoresume for remote wakeup testing */ + if (autoresume) +- sourcesink_driver.bmAttributes |=3D USB_CONFIG_ATT_WAKEUP; ++ loopback_driver.bmAttributes |=3D USB_CONFIG_ATT_WAKEUP; +=20 + /* support OTG systems */ + if (gadget_is_otg(cdev->gadget)) { +diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks= .c +index caf8742..ac53a66 100644 +--- a/drivers/usb/host/pci-quirks.c ++++ b/drivers/usb/host/pci-quirks.c +@@ -867,6 +867,12 @@ hc_init: +=20 + static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev) + { ++ /* Skip Netlogic mips SoC's internal PCI USB controller. ++ * This device does not need/support EHCI/OHCI handoff ++ */ ++ if (pdev->vendor =3D=3D 0x184e) /* vendor Netlogic */ ++ return; ++ + if (pdev->class =3D=3D PCI_CLASS_SERIAL_USB_UHCI) + quirk_usb_handoff_uhci(pdev); + else if (pdev->class =3D=3D PCI_CLASS_SERIAL_USB_OHCI) +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio= .c +index 058b92c..f030471 100644 +--- a/drivers/usb/serial/ftdi_sio.c ++++ b/drivers/usb/serial/ftdi_sio.c +@@ -839,6 +839,7 @@ static struct usb_device_id id_table_combined [] =3D= { + { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LOGBOOKML_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) }, ++ { USB_DEVICE(FTDI_VID, FTDI_CINTERION_MC55I_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) }, + { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID), + .driver_info =3D (kernel_ulong_t)&ftdi_jtag_quirk }, +diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi= _sio_ids.h +index 76d4f31..4eb7715 100644 +--- a/drivers/usb/serial/ftdi_sio_ids.h ++++ b/drivers/usb/serial/ftdi_sio_ids.h +@@ -1187,3 +1187,10 @@ + */ + /* ZigBee controller */ + #define FTDI_RF_R106 0x8A28 ++ ++/* ++ * Product: HCP HIT GPRS modem ++ * Manufacturer: HCP d.o.o. ++ * ATI command output: Cinterion MC55i ++ */ ++#define FTDI_CINTERION_MC55I_PID 0xA951 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c +index 2a9ed6e..338d082 100644 +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -855,6 +855,18 @@ static const struct usb_device_id option_ids[] =3D = { + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0083, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0086, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0087, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0088, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0089, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0090, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0091, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0092, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0093, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0094, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0095, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0096, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0097, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0098, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0099, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0104, 0xff, 0xff, 0xf= f), + .driver_info =3D (kernel_ulong_t)&net_intf4_blacklist }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0105, 0xff, 0xff, 0xf= f) }, +@@ -883,7 +895,6 @@ static const struct usb_device_id option_ids[] =3D { + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0151, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0153, 0xff, 0xff, 0xf= f) }, +- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0154, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0155, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0156, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0157, 0xff, 0xff, 0xf= f) }, +@@ -892,6 +903,12 @@ static const struct usb_device_id option_ids[] =3D = { + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0160, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0161, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0162, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0164, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0170, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xf= f) }, +@@ -1066,6 +1083,116 @@ static const struct usb_device_id option_ids[] =3D= { + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1401, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1403, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1404, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1405, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1406, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1407, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1408, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1409, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1410, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1411, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1412, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1413, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1414, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1415, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1416, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1417, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1418, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1419, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1420, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1421, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1422, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1423, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1424, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1425, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1427, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1428, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1429, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1430, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1431, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1432, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1433, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1434, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1435, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1436, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1437, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1438, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1439, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1440, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1441, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1442, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1443, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1444, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1445, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1446, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1447, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1448, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1449, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1450, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1451, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1452, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1453, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1454, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1455, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1456, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1457, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1458, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1459, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1460, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1461, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1462, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1463, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1464, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1465, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1466, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1467, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1468, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1469, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1470, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1471, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1472, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1473, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1474, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1475, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1476, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1477, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1478, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1479, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1480, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1481, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1482, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1483, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1484, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1485, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1486, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1487, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1488, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1489, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1490, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1491, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1492, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1493, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1494, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1495, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1496, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1497, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1498, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1499, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1500, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1501, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1502, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1503, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1504, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1505, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1506, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1507, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1508, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1509, 0xff, 0xff, 0xf= f) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1510, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xf= f) }, /* ZTE CDMA products */ + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xf= f) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xf= f) }, +diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c +index 63409c1..e919c70 100644 +--- a/drivers/video/atmel_lcdfb.c ++++ b/drivers/video/atmel_lcdfb.c +@@ -1089,7 +1089,7 @@ static int atmel_lcdfb_suspend(struct platform_dev= ice *pdev, pm_message_t mesg) + */ + lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL); +=20 +- sinfo->saved_lcdcon =3D lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL); ++ sinfo->saved_lcdcon =3D lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_CTR); + lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0); + if (sinfo->atmel_lcdfb_power_control) + sinfo->atmel_lcdfb_power_control(0); +diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c +index 4ec3ee9..2504809 100644 +--- a/fs/cifs/sess.c ++++ b/fs/cifs/sess.c +@@ -246,16 +246,15 @@ static void ascii_ssetup_strings(char **pbcc_area,= struct cifs_ses *ses, + /* copy user */ + /* BB what about null user mounts - check that we do this BB */ + /* copy user */ +- if (ses->user_name !=3D NULL) ++ if (ses->user_name !=3D NULL) { + strncpy(bcc_ptr, ses->user_name, MAX_USERNAME_SIZE); ++ bcc_ptr +=3D strnlen(ses->user_name, MAX_USERNAME_SIZE); ++ } + /* else null user mount */ +- +- bcc_ptr +=3D strnlen(ses->user_name, MAX_USERNAME_SIZE); + *bcc_ptr =3D 0; + bcc_ptr++; /* account for null termination */ +=20 + /* copy domain */ +- + if (ses->domainName !=3D NULL) { + strncpy(bcc_ptr, ses->domainName, 256); + bcc_ptr +=3D strnlen(ses->domainName, 256); +diff --git a/fs/ecryptfs/read_write.c b/fs/ecryptfs/read_write.c +index 54eb14c..608c1c3 100644 +--- a/fs/ecryptfs/read_write.c ++++ b/fs/ecryptfs/read_write.c +@@ -130,7 +130,7 @@ int ecryptfs_write(struct inode *ecryptfs_inode, cha= r *data, loff_t offset, + pgoff_t ecryptfs_page_idx =3D (pos >> PAGE_CACHE_SHIFT); + size_t start_offset_in_page =3D (pos & ~PAGE_CACHE_MASK); + size_t num_bytes =3D (PAGE_CACHE_SIZE - start_offset_in_page); +- size_t total_remaining_bytes =3D ((offset + size) - pos); ++ loff_t total_remaining_bytes =3D ((offset + size) - pos); +=20 + if (fatal_signal_pending(current)) { + rc =3D -EINTR; +@@ -141,7 +141,7 @@ int ecryptfs_write(struct inode *ecryptfs_inode, cha= r *data, loff_t offset, + num_bytes =3D total_remaining_bytes; + if (pos < offset) { + /* remaining zeros to write, up to destination offset */ +- size_t total_remaining_zeros =3D (offset - pos); ++ loff_t total_remaining_zeros =3D (offset - pos); +=20 + if (num_bytes > total_remaining_zeros) + num_bytes =3D total_remaining_zeros; +diff --git a/fs/proc/base.c b/fs/proc/base.c +index 1fc1dca..1ace83d 100644 +--- a/fs/proc/base.c ++++ b/fs/proc/base.c +@@ -775,6 +775,13 @@ static int mem_open(struct inode* inode, struct fil= e* file) + if (IS_ERR(mm)) + return PTR_ERR(mm); +=20 ++ if (mm) { ++ /* ensure this mm_struct can't be freed */ ++ atomic_inc(&mm->mm_count); ++ /* but do not pin its memory */ ++ mmput(mm); ++ } ++ + /* OK to pass negative loff_t, we can catch out-of-range */ + file->f_mode |=3D FMODE_UNSIGNED_OFFSET; + file->private_data =3D mm; +@@ -782,57 +789,13 @@ static int mem_open(struct inode* inode, struct fi= le* file) + return 0; + } +=20 +-static ssize_t mem_read(struct file * file, char __user * buf, +- size_t count, loff_t *ppos) ++static ssize_t mem_rw(struct file *file, char __user *buf, ++ size_t count, loff_t *ppos, int write) + { +- int ret; +- char *page; +- unsigned long src =3D *ppos; + struct mm_struct *mm =3D file->private_data; +- +- if (!mm) +- return 0; +- +- page =3D (char *)__get_free_page(GFP_TEMPORARY); +- if (!page) +- return -ENOMEM; +- +- ret =3D 0; +-=20 +- while (count > 0) { +- int this_len, retval; +- +- this_len =3D (count > PAGE_SIZE) ? PAGE_SIZE : count; +- retval =3D access_remote_vm(mm, src, page, this_len, 0); +- if (!retval) { +- if (!ret) +- ret =3D -EIO; +- break; +- } +- +- if (copy_to_user(buf, page, retval)) { +- ret =3D -EFAULT; +- break; +- } +-=20 +- ret +=3D retval; +- src +=3D retval; +- buf +=3D retval; +- count -=3D retval; +- } +- *ppos =3D src; +- +- free_page((unsigned long) page); +- return ret; +-} +- +-static ssize_t mem_write(struct file * file, const char __user *buf, +- size_t count, loff_t *ppos) +-{ +- int copied; ++ unsigned long addr =3D *ppos; ++ ssize_t copied; + char *page; +- unsigned long dst =3D *ppos; +- struct mm_struct *mm =3D file->private_data; +=20 + if (!mm) + return 0; +@@ -842,31 +805,54 @@ static ssize_t mem_write(struct file * file, const= char __user *buf, + return -ENOMEM; +=20 + copied =3D 0; ++ if (!atomic_inc_not_zero(&mm->mm_users)) ++ goto free; ++ + while (count > 0) { +- int this_len, retval; ++ int this_len =3D min_t(int, count, PAGE_SIZE); +=20 +- this_len =3D (count > PAGE_SIZE) ? PAGE_SIZE : count; +- if (copy_from_user(page, buf, this_len)) { ++ if (write && copy_from_user(page, buf, this_len)) { + copied =3D -EFAULT; + break; + } +- retval =3D access_remote_vm(mm, dst, page, this_len, 1); +- if (!retval) { ++ ++ this_len =3D access_remote_vm(mm, addr, page, this_len, write); ++ if (!this_len) { + if (!copied) + copied =3D -EIO; + break; + } +- copied +=3D retval; +- buf +=3D retval; +- dst +=3D retval; +- count -=3D retval; =09 ++ ++ if (!write && copy_to_user(buf, page, this_len)) { ++ copied =3D -EFAULT; ++ break; ++ } ++ ++ buf +=3D this_len; ++ addr +=3D this_len; ++ copied +=3D this_len; ++ count -=3D this_len; + } +- *ppos =3D dst; ++ *ppos =3D addr; +=20 ++ mmput(mm); ++free: + free_page((unsigned long) page); + return copied; + } +=20 ++static ssize_t mem_read(struct file *file, char __user *buf, ++ size_t count, loff_t *ppos) ++{ ++ return mem_rw(file, buf, count, ppos, 0); ++} ++ ++static ssize_t mem_write(struct file *file, const char __user *buf, ++ size_t count, loff_t *ppos) ++{ ++ return mem_rw(file, (char __user*)buf, count, ppos, 1); ++} ++ + loff_t mem_lseek(struct file *file, loff_t offset, int orig) + { + switch (orig) { +@@ -886,8 +872,8 @@ loff_t mem_lseek(struct file *file, loff_t offset, i= nt orig) + static int mem_release(struct inode *inode, struct file *file) + { + struct mm_struct *mm =3D file->private_data; +- +- mmput(mm); ++ if (mm) ++ mmdrop(mm); + return 0; + } +=20 +diff --git a/fs/udf/super.c b/fs/udf/super.c +index e185253..87cb24a 100644 +--- a/fs/udf/super.c ++++ b/fs/udf/super.c +@@ -1799,6 +1799,12 @@ static void udf_close_lvid(struct super_block *sb= ) + le16_to_cpu(lvid->descTag.descCRCLength))); +=20 + lvid->descTag.tagChecksum =3D udf_tag_checksum(&lvid->descTag); ++ /* ++ * We set buffer uptodate unconditionally here to avoid spurious ++ * warnings from mark_buffer_dirty() when previous EIO has marked ++ * the buffer as !uptodate ++ */ ++ set_buffer_uptodate(bh); + mark_buffer_dirty(bh); + sbi->s_lvid_dirty =3D 0; + mutex_unlock(&sbi->s_alloc_mutex); +diff --git a/include/linux/freezer.h b/include/linux/freezer.h +index a5386e3..b5d6b6a 100644 +--- a/include/linux/freezer.h ++++ b/include/linux/freezer.h +@@ -51,6 +51,7 @@ extern void refrigerator(void); + extern int freeze_processes(void); + extern int freeze_kernel_threads(void); + extern void thaw_processes(void); ++extern void thaw_kernel_threads(void); +=20 + static inline int try_to_freeze(void) + { +@@ -185,6 +186,7 @@ static inline void refrigerator(void) {} + static inline int freeze_processes(void) { return -ENOSYS; } + static inline int freeze_kernel_threads(void) { return -ENOSYS; } + static inline void thaw_processes(void) {} ++static inline void thaw_kernel_threads(void) {} +=20 + static inline int try_to_freeze(void) { return 0; } +=20 +diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h +index 83b0ea3..8a0ede4 100644 +--- a/include/linux/pm_qos.h ++++ b/include/linux/pm_qos.h +@@ -107,7 +107,19 @@ static inline void pm_qos_remove_request(struct pm_= qos_request *req) + { return; } +=20 + static inline int pm_qos_request(int pm_qos_class) +- { return 0; } ++{ ++ switch (pm_qos_class) { ++ case PM_QOS_CPU_DMA_LATENCY: ++ return PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE; ++ case PM_QOS_NETWORK_LATENCY: ++ return PM_QOS_NETWORK_LAT_DEFAULT_VALUE; ++ case PM_QOS_NETWORK_THROUGHPUT: ++ return PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE; ++ default: ++ return PM_QOS_DEFAULT_VALUE; ++ } ++} ++ + static inline int pm_qos_add_notifier(int pm_qos_class, + struct notifier_block *notifier) + { return 0; } +diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h +index 61b2905..3b6f628 100644 +--- a/include/linux/usb/ch9.h ++++ b/include/linux/usb/ch9.h +@@ -589,7 +589,7 @@ static inline int usb_endpoint_is_isoc_out( + */ + static inline int usb_endpoint_maxp(const struct usb_endpoint_descripto= r *epd) + { +- return le16_to_cpu(epd->wMaxPacketSize); ++ return __le16_to_cpu(epd->wMaxPacketSize); + } +=20 + /*---------------------------------------------------------------------= ----*/ +diff --git a/kernel/kprobes.c b/kernel/kprobes.c +index 52fd049..faa39d1 100644 +--- a/kernel/kprobes.c ++++ b/kernel/kprobes.c +@@ -1673,8 +1673,12 @@ static int __kprobes pre_handler_kretprobe(struct= kprobe *p, + ri->rp =3D rp; + ri->task =3D current; +=20 +- if (rp->entry_handler && rp->entry_handler(ri, regs)) ++ if (rp->entry_handler && rp->entry_handler(ri, regs)) { ++ raw_spin_lock_irqsave(&rp->lock, flags); ++ hlist_add_head(&ri->hlist, &rp->free_instances); ++ raw_spin_unlock_irqrestore(&rp->lock, flags); + return 0; ++ } +=20 + arch_prepare_kretprobe(ri, regs); +=20 +diff --git a/kernel/panic.c b/kernel/panic.c +index b2659360..3458469 100644 +--- a/kernel/panic.c ++++ b/kernel/panic.c +@@ -237,11 +237,20 @@ void add_taint(unsigned flag) + * Can't trust the integrity of the kernel anymore. + * We don't call directly debug_locks_off() because the issue + * is not necessarily serious enough to set oops_in_progress to 1 +- * Also we want to keep up lockdep for staging development and +- * post-warning case. ++ * Also we want to keep up lockdep for staging/out-of-tree ++ * development and post-warning case. + */ +- if (flag !=3D TAINT_CRAP && flag !=3D TAINT_WARN && __debug_locks_off(= )) +- printk(KERN_WARNING "Disabling lock debugging due to kernel taint\n")= ; ++ switch (flag) { ++ case TAINT_CRAP: ++ case TAINT_OOT_MODULE: ++ case TAINT_WARN: ++ case TAINT_FIRMWARE_WORKAROUND: ++ break; ++ ++ default: ++ if (__debug_locks_off()) ++ printk(KERN_WARNING "Disabling lock debugging due to kernel taint\n"= ); ++ } +=20 + set_bit(flag, &tainted_mask); + } +diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c +index a6b0503..624538a 100644 +--- a/kernel/power/hibernate.c ++++ b/kernel/power/hibernate.c +@@ -55,7 +55,7 @@ enum { +=20 + static int hibernation_mode =3D HIBERNATION_SHUTDOWN; +=20 +-static bool freezer_test_done; ++bool freezer_test_done; +=20 + static const struct platform_hibernation_ops *hibernation_ops; +=20 +diff --git a/kernel/power/power.h b/kernel/power/power.h +index 23a2db1..0c4defe 100644 +--- a/kernel/power/power.h ++++ b/kernel/power/power.h +@@ -50,6 +50,8 @@ static inline char *check_image_kernel(struct swsusp_i= nfo *info) + #define SPARE_PAGES ((1024 * 1024) >> PAGE_SHIFT) +=20 + /* kernel/power/hibernate.c */ ++extern bool freezer_test_done; ++ + extern int hibernation_snapshot(int platform_mode); + extern int hibernation_restore(int platform_mode); + extern int hibernation_platform_enter(void); +diff --git a/kernel/power/process.c b/kernel/power/process.c +index addbbe5..3d4b954 100644 +--- a/kernel/power/process.c ++++ b/kernel/power/process.c +@@ -203,3 +203,12 @@ void thaw_processes(void) + printk("done.\n"); + } +=20 ++void thaw_kernel_threads(void) ++{ ++ printk("Restarting kernel threads ... "); ++ thaw_workqueues(); ++ thaw_tasks(true); ++ schedule(); ++ printk("done.\n"); ++} ++ +diff --git a/kernel/power/user.c b/kernel/power/user.c +index 6d8f535..f08d227 100644 +--- a/kernel/power/user.c ++++ b/kernel/power/user.c +@@ -283,10 +283,17 @@ static long snapshot_ioctl(struct file *filp, unsi= gned int cmd, + } + pm_restore_gfp_mask(); + error =3D hibernation_snapshot(data->platform_support); +- if (!error) ++ if (error) { ++ thaw_kernel_threads(); ++ } else { + error =3D put_user(in_suspend, (int __user *)arg); +- if (!error) +- data->ready =3D 1; ++ if (!error && !freezer_test_done) ++ data->ready =3D 1; ++ if (freezer_test_done) { ++ freezer_test_done =3D false; ++ thaw_kernel_threads(); ++ } ++ } + break; +=20 + case SNAPSHOT_ATOMIC_RESTORE: +@@ -303,6 +310,15 @@ static long snapshot_ioctl(struct file *filp, unsig= ned int cmd, + swsusp_free(); + memset(&data->handle, 0, sizeof(struct snapshot_handle)); + data->ready =3D 0; ++ /* ++ * It is necessary to thaw kernel threads here, because ++ * SNAPSHOT_CREATE_IMAGE may be invoked directly after ++ * SNAPSHOT_FREE. In that case, if kernel threads were not ++ * thawed, the preallocation of memory carried out by ++ * hibernation_snapshot() might run into problems (i.e. it ++ * might fail or even deadlock). ++ */ ++ thaw_kernel_threads(); + break; +=20 + case SNAPSHOT_SET_IMAGE_SIZE: +diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c +index 583a136..78fcacf 100644 +--- a/kernel/sched_rt.c ++++ b/kernel/sched_rt.c +@@ -1388,6 +1388,11 @@ static int push_rt_task(struct rq *rq) + if (!next_task) + return 0; +=20 ++#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW ++ if (unlikely(task_running(rq, next_task))) ++ return 0; ++#endif ++ + retry: + if (unlikely(next_task =3D=3D rq->curr)) { + WARN_ON(1); +diff --git a/mm/compaction.c b/mm/compaction.c +index 899d956..8fb8a40 100644 +--- a/mm/compaction.c ++++ b/mm/compaction.c +@@ -313,12 +313,34 @@ static isolate_migrate_t isolate_migratepages(stru= ct zone *zone, + } else if (!locked) + spin_lock_irq(&zone->lru_lock); +=20 ++ /* ++ * migrate_pfn does not necessarily start aligned to a ++ * pageblock. Ensure that pfn_valid is called when moving ++ * into a new MAX_ORDER_NR_PAGES range in case of large ++ * memory holes within the zone ++ */ ++ if ((low_pfn & (MAX_ORDER_NR_PAGES - 1)) =3D=3D 0) { ++ if (!pfn_valid(low_pfn)) { ++ low_pfn +=3D MAX_ORDER_NR_PAGES - 1; ++ continue; ++ } ++ } ++ + if (!pfn_valid_within(low_pfn)) + continue; + nr_scanned++; +=20 +- /* Get the page and skip if free */ ++ /* ++ * Get the page and ensure the page is within the same zone. ++ * See the comment in isolate_freepages about overlapping ++ * nodes. It is deliberate that the new zone lock is not taken ++ * as memory compaction should not move pages between nodes. ++ */ + page =3D pfn_to_page(low_pfn); ++ if (page_zone(page) !=3D zone) ++ continue; ++ ++ /* Skip if free */ + if (PageBuddy(page)) + continue; +=20 +diff --git a/mm/filemap.c b/mm/filemap.c +index 90286a4..03c5b0e 100644 +--- a/mm/filemap.c ++++ b/mm/filemap.c +@@ -1400,15 +1400,12 @@ generic_file_aio_read(struct kiocb *iocb, const = struct iovec *iov, + unsigned long seg =3D 0; + size_t count; + loff_t *ppos =3D &iocb->ki_pos; +- struct blk_plug plug; +=20 + count =3D 0; + retval =3D generic_segment_checks(iov, &nr_segs, &count, VERIFY_WRITE)= ; + if (retval) + return retval; +=20 +- blk_start_plug(&plug); +- + /* coalesce the iovecs and go direct-to-BIO for O_DIRECT */ + if (filp->f_flags & O_DIRECT) { + loff_t size; +@@ -1424,8 +1421,12 @@ generic_file_aio_read(struct kiocb *iocb, const s= truct iovec *iov, + retval =3D filemap_write_and_wait_range(mapping, pos, + pos + iov_length(iov, nr_segs) - 1); + if (!retval) { ++ struct blk_plug plug; ++ ++ blk_start_plug(&plug); + retval =3D mapping->a_ops->direct_IO(READ, iocb, + iov, pos, nr_segs); ++ blk_finish_plug(&plug); + } + if (retval > 0) { + *ppos =3D pos + retval; +@@ -1481,7 +1482,6 @@ generic_file_aio_read(struct kiocb *iocb, const st= ruct iovec *iov, + break; + } + out: +- blk_finish_plug(&plug); + return retval; + } + EXPORT_SYMBOL(generic_file_aio_read); +diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c +index f91b2f6..a4eb311 100644 +--- a/mm/filemap_xip.c ++++ b/mm/filemap_xip.c +@@ -263,7 +263,12 @@ found: + xip_pfn); + if (err =3D=3D -ENOMEM) + return VM_FAULT_OOM; +- BUG_ON(err); ++ /* ++ * err =3D=3D -EBUSY is fine, we've raced against another thread ++ * that faulted-in the same page ++ */ ++ if (err !=3D -EBUSY) ++ BUG_ON(err); + return VM_FAULT_NOPAGE; + } else { + int err, ret =3D VM_FAULT_OOM; +diff --git a/mm/huge_memory.c b/mm/huge_memory.c +index 36b3d98..33141f5 100644 +--- a/mm/huge_memory.c ++++ b/mm/huge_memory.c +@@ -2064,7 +2064,7 @@ static void collect_mm_slot(struct mm_slot *mm_slo= t) + { + struct mm_struct *mm =3D mm_slot->mm; +=20 +- VM_BUG_ON(!spin_is_locked(&khugepaged_mm_lock)); ++ VM_BUG_ON(NR_CPUS !=3D 1 && !spin_is_locked(&khugepaged_mm_lock)); +=20 + if (khugepaged_test_exit(mm)) { + /* free mm_slot */ +@@ -2094,7 +2094,7 @@ static unsigned int khugepaged_scan_mm_slot(unsign= ed int pages, + int progress =3D 0; +=20 + VM_BUG_ON(!pages); +- VM_BUG_ON(!spin_is_locked(&khugepaged_mm_lock)); ++ VM_BUG_ON(NR_CPUS !=3D 1 && !spin_is_locked(&khugepaged_mm_lock)); +=20 + if (khugepaged_scan.mm_slot) + mm_slot =3D khugepaged_scan.mm_slot; +diff --git a/mm/swap.c b/mm/swap.c +index a91caf7..55b266d 100644 +--- a/mm/swap.c ++++ b/mm/swap.c +@@ -667,7 +667,7 @@ void lru_add_page_tail(struct zone* zone, + VM_BUG_ON(!PageHead(page)); + VM_BUG_ON(PageCompound(page_tail)); + VM_BUG_ON(PageLRU(page_tail)); +- VM_BUG_ON(!spin_is_locked(&zone->lru_lock)); ++ VM_BUG_ON(NR_CPUS !=3D 1 && !spin_is_locked(&zone->lru_lock)); +=20 + SetPageLRU(page_tail); +=20 +diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c +index 4562e9d..05c8768 100644 +--- a/sound/pci/hda/hda_codec.c ++++ b/sound/pci/hda/hda_codec.c +@@ -1446,7 +1446,7 @@ void snd_hda_codec_setup_stream(struct hda_codec *= codec, hda_nid_t nid, + for (i =3D 0; i < c->cvt_setups.used; i++) { + p =3D snd_array_elem(&c->cvt_setups, i); + if (!p->active && p->stream_tag =3D=3D stream_tag && +- get_wcaps_type(get_wcaps(codec, p->nid)) =3D=3D type) ++ get_wcaps_type(get_wcaps(c, p->nid)) =3D=3D type) + p->dirty =3D 1; + } + } +diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c +index 5b0a9bb..ec0518e 100644 +--- a/sound/pci/hda/patch_cirrus.c ++++ b/sound/pci/hda/patch_cirrus.c +@@ -976,8 +976,10 @@ static void cs_automic(struct hda_codec *codec) + /* specific to CS421x, single ADC */ + if (spec->vendor_nid =3D=3D CS421X_VENDOR_NID) { + if (present) { +- spec->last_input =3D spec->cur_input; +- spec->cur_input =3D spec->automic_idx; ++ if (spec->cur_input !=3D spec->automic_idx) { ++ spec->last_input =3D spec->cur_input; ++ spec->cur_input =3D spec->automic_idx; ++ } + } else { + spec->cur_input =3D spec->last_input; + } +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek= .c +index 5f03c40..34e5fcc 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -176,6 +176,7 @@ struct alc_spec { + unsigned int detect_lo:1; /* Line-out detection enabled */ + unsigned int automute_speaker_possible:1; /* there are speakers and ei= ther LO or HP */ + unsigned int automute_lo_possible:1; /* there are line outs and HP *= / ++ unsigned int keep_vref_in_automute:1; /* Don't clear VREF in automute = */ +=20 + /* other flags */ + unsigned int no_analog :1; /* digital I/O only */ +@@ -519,13 +520,24 @@ static void do_automute(struct hda_codec *codec, i= nt num_pins, hda_nid_t *pins, +=20 + for (i =3D 0; i < num_pins; i++) { + hda_nid_t nid =3D pins[i]; ++ unsigned int val; + if (!nid) + break; + switch (spec->automute_mode) { + case ALC_AUTOMUTE_PIN: ++ /* don't reset VREF value in case it's controlling ++ * the amp (see alc861_fixup_asus_amp_vref_0f()) ++ */ ++ if (spec->keep_vref_in_automute) { ++ val =3D snd_hda_codec_read(codec, nid, 0, ++ AC_VERB_GET_PIN_WIDGET_CONTROL, 0); ++ val &=3D ~PIN_HP; ++ } else ++ val =3D 0; ++ val |=3D pin_bits; + snd_hda_codec_write(codec, nid, 0, + AC_VERB_SET_PIN_WIDGET_CONTROL, +- pin_bits); ++ val); + break; + case ALC_AUTOMUTE_AMP: + snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0, +@@ -5011,7 +5023,6 @@ static const struct snd_pci_quirk alc269_fixup_tbl= [] =3D { + SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", + ALC269_FIXUP_AMIC), + SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), +- SND_PCI_QUIRK(0x1043, 0x1113, "ASUS N63Jn", ALC269_FIXUP_AMIC), + SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), + SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), + SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), +@@ -5226,6 +5237,25 @@ enum { + PINFIX_ASUS_A6RP, + }; +=20 ++/* On some laptops, VREF of pin 0x0f is abused for controlling the main= amp */ ++static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, ++ const struct alc_fixup *fix, int action) ++{ ++ struct alc_spec *spec =3D codec->spec; ++ unsigned int val; ++ ++ if (action !=3D ALC_FIXUP_ACT_INIT) ++ return; ++ val =3D snd_hda_codec_read(codec, 0x0f, 0, ++ AC_VERB_GET_PIN_WIDGET_CONTROL, 0); ++ if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) ++ val |=3D AC_PINCTL_IN_EN; ++ val |=3D AC_PINCTL_VREF_50; ++ snd_hda_codec_write(codec, 0x0f, 0, ++ AC_VERB_SET_PIN_WIDGET_CONTROL, val); ++ spec->keep_vref_in_automute =3D 1; ++} ++ + static const struct alc_fixup alc861_fixups[] =3D { + [PINFIX_FSC_AMILO_PI1505] =3D { + .type =3D ALC_FIXUP_PINS, +@@ -5236,17 +5266,13 @@ static const struct alc_fixup alc861_fixups[] =3D= { + } + }, + [PINFIX_ASUS_A6RP] =3D { +- .type =3D ALC_FIXUP_VERBS, +- .v.verbs =3D (const struct hda_verb[]) { +- /* node 0x0f VREF seems controlling the master output */ +- { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 }, +- { } +- }, ++ .type =3D ALC_FIXUP_FUNC, ++ .v.func =3D alc861_fixup_asus_amp_vref_0f, + }, + }; +=20 + static const struct snd_pci_quirk alc861_fixup_tbl[] =3D { +- SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", PINFIX_ASUS_A6RP), ++ SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", PINFIX_ASUS_A6RP), + SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", PINFIX_ASUS_A6RP), + SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", PINFIX_FSC_AMILO_PI1= 505), + {} +diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c +index 8d69e59..a0a3f50 100644 +--- a/sound/pci/hda/patch_via.c ++++ b/sound/pci/hda/patch_via.c +@@ -198,6 +198,9 @@ struct via_spec { + unsigned int no_pin_power_ctl; + enum VIA_HDA_CODEC codec_type; +=20 ++ /* analog low-power control */ ++ bool alc_mode; ++ + /* smart51 setup */ + unsigned int smart51_nums; + hda_nid_t smart51_pins[2]; +@@ -748,6 +751,7 @@ static int via_pin_power_ctl_put(struct snd_kcontrol= *kcontrol, + return 0; + spec->no_pin_power_ctl =3D val; + set_widgets_power_state(codec); ++ analog_low_current_mode(codec); + return 1; + } +=20 +@@ -1035,13 +1039,19 @@ static bool is_aa_path_mute(struct hda_codec *co= dec) + } +=20 + /* enter/exit analog low-current mode */ +-static void analog_low_current_mode(struct hda_codec *codec) ++static void __analog_low_current_mode(struct hda_codec *codec, bool for= ce) + { + struct via_spec *spec =3D codec->spec; + bool enable; + unsigned int verb, parm; +=20 +- enable =3D is_aa_path_mute(codec) && (spec->opened_streams !=3D 0); ++ if (spec->no_pin_power_ctl) ++ enable =3D false; ++ else ++ enable =3D is_aa_path_mute(codec) && !spec->opened_streams; ++ if (enable =3D=3D spec->alc_mode && !force) ++ return; ++ spec->alc_mode =3D enable; +=20 + /* decide low current mode's verb & parameter */ + switch (spec->codec_type) { +@@ -1073,6 +1083,11 @@ static void analog_low_current_mode(struct hda_co= dec *codec) + snd_hda_codec_write(codec, codec->afg, 0, verb, parm); + } +=20 ++static void analog_low_current_mode(struct hda_codec *codec) ++{ ++ return __analog_low_current_mode(codec, false); ++} ++ + /* + * generic initialization of ADC, input mixers and output mixers + */ +@@ -1445,6 +1460,7 @@ static int via_build_controls(struct hda_codec *co= dec) + struct snd_kcontrol *kctl; + int err, i; +=20 ++ spec->no_pin_power_ctl =3D 1; + if (spec->set_widgets_power_state) + if (!via_clone_control(spec, &via_pin_power_ctl_enum)) + return -ENOMEM; +@@ -1498,10 +1514,6 @@ static int via_build_controls(struct hda_codec *c= odec) + return err; + } +=20 +- /* init power states */ +- set_widgets_power_state(codec); +- analog_low_current_mode(codec); +- + via_free_kctls(codec); /* no longer needed */ + return 0; + } +@@ -2771,6 +2783,10 @@ static int via_init(struct hda_codec *codec) + for (i =3D 0; i < spec->num_iverbs; i++) + snd_hda_sequence_write(codec, spec->init_verbs[i]); +=20 ++ /* init power states */ ++ set_widgets_power_state(codec); ++ __analog_low_current_mode(codec, true); ++ + via_auto_init_multi_out(codec); + via_auto_init_hp_out(codec); + via_auto_init_speaker_out(codec); +diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_m= ixer.c +index 26c7e8b..c0dbb52 100644 +--- a/sound/pci/oxygen/oxygen_mixer.c ++++ b/sound/pci/oxygen/oxygen_mixer.c +@@ -618,9 +618,12 @@ static int ac97_volume_get(struct snd_kcontrol *ctl= , + mutex_lock(&chip->mutex); + reg =3D oxygen_read_ac97(chip, codec, index); + mutex_unlock(&chip->mutex); +- value->value.integer.value[0] =3D 31 - (reg & 0x1f); +- if (stereo) +- value->value.integer.value[1] =3D 31 - ((reg >> 8) & 0x1f); ++ if (!stereo) { ++ value->value.integer.value[0] =3D 31 - (reg & 0x1f); ++ } else { ++ value->value.integer.value[0] =3D 31 - ((reg >> 8) & 0x1f); ++ value->value.integer.value[1] =3D 31 - (reg & 0x1f); ++ } + return 0; + } +=20 +@@ -636,14 +639,14 @@ static int ac97_volume_put(struct snd_kcontrol *ct= l, +=20 + mutex_lock(&chip->mutex); + oldreg =3D oxygen_read_ac97(chip, codec, index); +- newreg =3D oldreg; +- newreg =3D (newreg & ~0x1f) | +- (31 - (value->value.integer.value[0] & 0x1f)); +- if (stereo) +- newreg =3D (newreg & ~0x1f00) | +- ((31 - (value->value.integer.value[1] & 0x1f)) << 8); +- else +- newreg =3D (newreg & ~0x1f00) | ((newreg & 0x1f) << 8); ++ if (!stereo) { ++ newreg =3D oldreg & ~0x1f; ++ newreg |=3D 31 - (value->value.integer.value[0] & 0x1f); ++ } else { ++ newreg =3D oldreg & ~0x1f1f; ++ newreg |=3D (31 - (value->value.integer.value[0] & 0x1f)) << 8; ++ newreg |=3D 31 - (value->value.integer.value[1] & 0x1f); ++ } + change =3D newreg !=3D oldreg; + if (change) + oxygen_write_ac97(chip, codec, index, newreg); +diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c +index 53edd9a..d795294 100644 +--- a/sound/soc/codecs/wm8962.c ++++ b/sound/soc/codecs/wm8962.c +@@ -3172,13 +3172,13 @@ static int wm8962_hw_params(struct snd_pcm_subst= ream *substream, + case SNDRV_PCM_FORMAT_S16_LE: + break; + case SNDRV_PCM_FORMAT_S20_3LE: +- aif0 |=3D 0x40; ++ aif0 |=3D 0x4; + break; + case SNDRV_PCM_FORMAT_S24_LE: +- aif0 |=3D 0x80; ++ aif0 |=3D 0x8; + break; + case SNDRV_PCM_FORMAT_S32_LE: +- aif0 |=3D 0xc0; ++ aif0 |=3D 0xc; + break; + default: + return -EINVAL; +diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c +index d0c545b..6e502af 100644 +--- a/sound/soc/codecs/wm8994.c ++++ b/sound/soc/codecs/wm8994.c +@@ -729,6 +729,8 @@ static void vmid_reference(struct snd_soc_codec *cod= ec) + { + struct wm8994_priv *wm8994 =3D snd_soc_codec_get_drvdata(codec); +=20 ++ pm_runtime_get_sync(codec->dev); ++ + wm8994->vmid_refcount++; +=20 + dev_dbg(codec->dev, "Referencing VMID, refcount is now %d\n", +@@ -742,7 +744,7 @@ static void vmid_reference(struct snd_soc_codec *cod= ec) + WM8994_VMID_RAMP_MASK, + WM8994_STARTUP_BIAS_ENA | + WM8994_VMID_BUF_ENA | +- (0x11 << WM8994_VMID_RAMP_SHIFT)); ++ (0x3 << WM8994_VMID_RAMP_SHIFT)); +=20 + /* Main bias enable, VMID=3D2x40k */ + snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1, +@@ -796,6 +798,8 @@ static void vmid_dereference(struct snd_soc_codec *c= odec) + WM8994_VMID_BUF_ENA | + WM8994_VMID_RAMP_MASK, 0); + } ++ ++ pm_runtime_put(codec->dev); + } +=20 + static int vmid_event(struct snd_soc_dapm_widget *w, +diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c +index 48e61e9..3642e06 100644 +--- a/sound/soc/codecs/wm_hubs.c ++++ b/sound/soc/codecs/wm_hubs.c +@@ -587,14 +587,14 @@ SOC_DAPM_SINGLE("Left Output Switch", WM8993_LINE_= MIXER1, 0, 1, 0), + }; +=20 + static const struct snd_kcontrol_new line2_mix[] =3D { +-SOC_DAPM_SINGLE("IN2R Switch", WM8993_LINE_MIXER2, 2, 1, 0), +-SOC_DAPM_SINGLE("IN2L Switch", WM8993_LINE_MIXER2, 1, 1, 0), ++SOC_DAPM_SINGLE("IN1L Switch", WM8993_LINE_MIXER2, 2, 1, 0), ++SOC_DAPM_SINGLE("IN1R Switch", WM8993_LINE_MIXER2, 1, 1, 0), + SOC_DAPM_SINGLE("Output Switch", WM8993_LINE_MIXER2, 0, 1, 0), + }; +=20 + static const struct snd_kcontrol_new line2n_mix[] =3D { +-SOC_DAPM_SINGLE("Left Output Switch", WM8993_LINE_MIXER2, 6, 1, 0), +-SOC_DAPM_SINGLE("Right Output Switch", WM8993_LINE_MIXER2, 5, 1, 0), ++SOC_DAPM_SINGLE("Left Output Switch", WM8993_LINE_MIXER2, 5, 1, 0), ++SOC_DAPM_SINGLE("Right Output Switch", WM8993_LINE_MIXER2, 6, 1, 0), + }; +=20 + static const struct snd_kcontrol_new line2p_mix[] =3D { +@@ -614,6 +614,8 @@ SND_SOC_DAPM_INPUT("IN2RP:VXRP"), + SND_SOC_DAPM_MICBIAS("MICBIAS2", WM8993_POWER_MANAGEMENT_1, 5, 0), + SND_SOC_DAPM_MICBIAS("MICBIAS1", WM8993_POWER_MANAGEMENT_1, 4, 0), +=20 ++SND_SOC_DAPM_SUPPLY("LINEOUT_VMID_BUF", WM8993_ANTIPOP1, 7, 0, NULL, 0)= , ++ + SND_SOC_DAPM_MIXER("IN1L PGA", WM8993_POWER_MANAGEMENT_2, 6, 0, + in1l_pga, ARRAY_SIZE(in1l_pga)), + SND_SOC_DAPM_MIXER("IN1R PGA", WM8993_POWER_MANAGEMENT_2, 4, 0, +@@ -832,9 +834,11 @@ static const struct snd_soc_dapm_route lineout1_dif= f_routes[] =3D { + }; +=20 + static const struct snd_soc_dapm_route lineout1_se_routes[] =3D { ++ { "LINEOUT1N Mixer", NULL, "LINEOUT_VMID_BUF" }, + { "LINEOUT1N Mixer", "Left Output Switch", "Left Output PGA" }, + { "LINEOUT1N Mixer", "Right Output Switch", "Right Output PGA" }, +=20 ++ { "LINEOUT1P Mixer", NULL, "LINEOUT_VMID_BUF" }, + { "LINEOUT1P Mixer", "Left Output Switch", "Left Output PGA" }, +=20 + { "LINEOUT1N Driver", NULL, "LINEOUT1N Mixer" }, +@@ -842,8 +846,8 @@ static const struct snd_soc_dapm_route lineout1_se_r= outes[] =3D { + }; +=20 + static const struct snd_soc_dapm_route lineout2_diff_routes[] =3D { +- { "LINEOUT2 Mixer", "IN2L Switch", "IN2L PGA" }, +- { "LINEOUT2 Mixer", "IN2R Switch", "IN2R PGA" }, ++ { "LINEOUT2 Mixer", "IN1L Switch", "IN1L PGA" }, ++ { "LINEOUT2 Mixer", "IN1R Switch", "IN1R PGA" }, + { "LINEOUT2 Mixer", "Output Switch", "Right Output PGA" }, +=20 + { "LINEOUT2N Driver", NULL, "LINEOUT2 Mixer" }, +@@ -851,9 +855,11 @@ static const struct snd_soc_dapm_route lineout2_dif= f_routes[] =3D { + }; +=20 + static const struct snd_soc_dapm_route lineout2_se_routes[] =3D { ++ { "LINEOUT2N Mixer", NULL, "LINEOUT_VMID_BUF" }, + { "LINEOUT2N Mixer", "Left Output Switch", "Left Output PGA" }, + { "LINEOUT2N Mixer", "Right Output Switch", "Right Output PGA" }, +=20 ++ { "LINEOUT2P Mixer", NULL, "LINEOUT_VMID_BUF" }, + { "LINEOUT2P Mixer", "Right Output Switch", "Right Output PGA" }, +=20 + { "LINEOUT2N Driver", NULL, "LINEOUT2N Mixer" },