commit:     9b1ae75ce3b7546ecbaf6b6a880ea885166190cb
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 23 11:45:51 2016 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
CommitDate: Thu Jun 23 11:45:51 2016 +0000
URL:        https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=9b1ae75c

Linux patch 4.1.27

 0000_README             |    4 +
 1026_linux-4.1.27.patch | 1129 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 1133 insertions(+)

diff --git a/0000_README b/0000_README
index 783092f..b592a97 100644
--- a/0000_README
+++ b/0000_README
@@ -147,6 +147,10 @@ Patch:  1025_linux-4.1.26.patch
 From:   http://www.kernel.org
 Desc:   Linux 4.1.26
 
+Patch:  1026_linux-4.1.27.patch
+From:   http://www.kernel.org
+Desc:   Linux 4.1.27
+
 Patch:  1500_XATTR_USER_PREFIX.patch
 From:   https://bugs.gentoo.org/show_bug.cgi?id=470644
 Desc:   Support for namespace user.pax.* on tmpfs.

diff --git a/1026_linux-4.1.27.patch b/1026_linux-4.1.27.patch
new file mode 100644
index 0000000..bd3e683
--- /dev/null
+++ b/1026_linux-4.1.27.patch
@@ -0,0 +1,1129 @@
+diff --git a/Makefile b/Makefile
+index 080a87e290b9..54b3d8ae8624 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,6 @@
+ VERSION = 4
+ PATCHLEVEL = 1
+-SUBLEVEL = 26
++SUBLEVEL = 27
+ EXTRAVERSION =
+ NAME = Series 4800
+ 
+diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
+index ef9119f7462e..4d9375814b53 100644
+--- a/arch/arm/kernel/ptrace.c
++++ b/arch/arm/kernel/ptrace.c
+@@ -733,8 +733,8 @@ static int vfp_set(struct task_struct *target,
+       if (ret)
+               return ret;
+ 
+-      vfp_flush_hwstate(thread);
+       thread->vfpstate.hard = new_vfp;
++      vfp_flush_hwstate(thread);
+ 
+       return 0;
+ }
+diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c
+index d7c0acb35ec2..8d49614d600d 100644
+--- a/arch/parisc/kernel/unaligned.c
++++ b/arch/parisc/kernel/unaligned.c
+@@ -666,7 +666,7 @@ void handle_unaligned(struct pt_regs *regs)
+               break;
+       }
+ 
+-      if (modify && R1(regs->iir))
++      if (ret == 0 && modify && R1(regs->iir))
+               regs->gr[R1(regs->iir)] = newbase;
+ 
+ 
+@@ -677,6 +677,14 @@ void handle_unaligned(struct pt_regs *regs)
+ 
+       if (ret)
+       {
++              /*
++               * The unaligned handler failed.
++               * If we were called by __get_user() or __put_user() jump
++               * to it's exception fixup handler instead of crashing.
++               */
++              if (!user_mode(regs) && fixup_exception(regs))
++                      return;
++
+               printk(KERN_CRIT "Unaligned handler failed, ret = %d\n", ret);
+               die_if_kernel("Unaligned data reference", regs, 28);
+ 
+diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
+index f4f99f01b746..a4bf6e0eb813 100644
+--- a/arch/powerpc/include/asm/reg.h
++++ b/arch/powerpc/include/asm/reg.h
+@@ -708,7 +708,7 @@
+ #define   MMCR0_FCWAIT        0x00000002UL /* freeze counter in WAIT state */
+ #define   MMCR0_FCHV  0x00000001UL /* freeze conditions in hypervisor mode */
+ #define SPRN_MMCR1    798
+-#define SPRN_MMCR2    769
++#define SPRN_MMCR2    785
+ #define SPRN_MMCRA    0x312
+ #define   MMCRA_SDSYNC        0x80000000UL /* SDAR synced with SIAR */
+ #define   MMCRA_SDAR_DCACHE_MISS 0x40000000UL
+@@ -745,13 +745,13 @@
+ #define SPRN_PMC6     792
+ #define SPRN_PMC7     793
+ #define SPRN_PMC8     794
+-#define SPRN_SIAR     780
+-#define SPRN_SDAR     781
+ #define SPRN_SIER     784
+ #define   SIER_SIPR           0x2000000       /* Sampled MSR_PR */
+ #define   SIER_SIHV           0x1000000       /* Sampled MSR_HV */
+ #define   SIER_SIAR_VALID     0x0400000       /* SIAR contents valid */
+ #define   SIER_SDAR_VALID     0x0200000       /* SDAR contents valid */
++#define SPRN_SIAR     796
++#define SPRN_SDAR     797
+ #define SPRN_TACR     888
+ #define SPRN_TCSCR    889
+ #define SPRN_CSIGR    890
+diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
+index fd1fe4c37599..ae97ba211d8e 100644
+--- a/arch/powerpc/kernel/prom_init.c
++++ b/arch/powerpc/kernel/prom_init.c
+@@ -647,6 +647,7 @@ unsigned char ibm_architecture_vec[] = {
+       W(0xffff0000), W(0x003e0000),   /* POWER6 */
+       W(0xffff0000), W(0x003f0000),   /* POWER7 */
+       W(0xffff0000), W(0x004b0000),   /* POWER8E */
++      W(0xffff0000), W(0x004c0000),   /* POWER8NVL */
+       W(0xffff0000), W(0x004d0000),   /* POWER8 */
+       W(0xffffffff), W(0x0f000004),   /* all 2.07-compliant */
+       W(0xffffffff), W(0x0f000003),   /* all 2.06-compliant */
+@@ -709,7 +710,7 @@ unsigned char ibm_architecture_vec[] = {
+        * must match by the macro below. Update the definition if
+        * the structure layout changes.
+        */
+-#define IBM_ARCH_VEC_NRCORES_OFFSET   125
++#define IBM_ARCH_VEC_NRCORES_OFFSET   133
+       W(NR_CPUS),                     /* number of cores supported */
+       0,
+       0,
+diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c 
b/arch/powerpc/platforms/pseries/eeh_pseries.c
+index 2039397cc75d..d2a44cd476f2 100644
+--- a/arch/powerpc/platforms/pseries/eeh_pseries.c
++++ b/arch/powerpc/platforms/pseries/eeh_pseries.c
+@@ -623,29 +623,50 @@ static int pseries_eeh_configure_bridge(struct eeh_pe 
*pe)
+ {
+       int config_addr;
+       int ret;
++      /* Waiting 0.2s maximum before skipping configuration */
++      int max_wait = 200;
+ 
+       /* Figure out the PE address */
+       config_addr = pe->config_addr;
+       if (pe->addr)
+               config_addr = pe->addr;
+ 
+-      /* Use new configure-pe function, if supported */
+-      if (ibm_configure_pe != RTAS_UNKNOWN_SERVICE) {
+-              ret = rtas_call(ibm_configure_pe, 3, 1, NULL,
+-                              config_addr, BUID_HI(pe->phb->buid),
+-                              BUID_LO(pe->phb->buid));
+-      } else if (ibm_configure_bridge != RTAS_UNKNOWN_SERVICE) {
+-              ret = rtas_call(ibm_configure_bridge, 3, 1, NULL,
+-                              config_addr, BUID_HI(pe->phb->buid),
+-                              BUID_LO(pe->phb->buid));
+-      } else {
+-              return -EFAULT;
+-      }
++      while (max_wait > 0) {
++              /* Use new configure-pe function, if supported */
++              if (ibm_configure_pe != RTAS_UNKNOWN_SERVICE) {
++                      ret = rtas_call(ibm_configure_pe, 3, 1, NULL,
++                                      config_addr, BUID_HI(pe->phb->buid),
++                                      BUID_LO(pe->phb->buid));
++              } else if (ibm_configure_bridge != RTAS_UNKNOWN_SERVICE) {
++                      ret = rtas_call(ibm_configure_bridge, 3, 1, NULL,
++                                      config_addr, BUID_HI(pe->phb->buid),
++                                      BUID_LO(pe->phb->buid));
++              } else {
++                      return -EFAULT;
++              }
+ 
+-      if (ret)
+-              pr_warn("%s: Unable to configure bridge PHB#%d-PE#%x (%d)\n",
+-                      __func__, pe->phb->global_number, pe->addr, ret);
++              if (!ret)
++                      return ret;
++
++              /*
++               * If RTAS returns a delay value that's above 100ms, cut it
++               * down to 100ms in case firmware made a mistake.  For more
++               * on how these delay values work see rtas_busy_delay_time
++               */
++              if (ret > RTAS_EXTENDED_DELAY_MIN+2 &&
++                  ret <= RTAS_EXTENDED_DELAY_MAX)
++                      ret = RTAS_EXTENDED_DELAY_MIN+2;
++
++              max_wait -= rtas_busy_delay_time(ret);
++
++              if (max_wait < 0)
++                      break;
++
++              rtas_busy_delay(ret);
++      }
+ 
++      pr_warn("%s: Unable to configure bridge PHB#%d-PE#%x (%d)\n",
++              __func__, pe->phb->global_number, pe->addr, ret);
+       return ret;
+ }
+ 
+diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
+index 57bbf2fb21f6..78c366462e70 100644
+--- a/arch/x86/boot/Makefile
++++ b/arch/x86/boot/Makefile
+@@ -162,6 +162,9 @@ isoimage: $(obj)/bzImage
+       for i in lib lib64 share end ; do \
+               if [ -f /usr/$$i/syslinux/isolinux.bin ] ; then \
+                       cp /usr/$$i/syslinux/isolinux.bin $(obj)/isoimage ; \
++                      if [ -f /usr/$$i/syslinux/ldlinux.c32 ]; then \
++                              cp /usr/$$i/syslinux/ldlinux.c32 
$(obj)/isoimage ; \
++                      fi ; \
+                       break ; \
+               fi ; \
+               if [ $$i = end ] ; then exit 1 ; fi ; \
+diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
+index 75eb9603ed29..bd84d2226ca1 100644
+--- a/arch/x86/kvm/x86.c
++++ b/arch/x86/kvm/x86.c
+@@ -3174,6 +3174,11 @@ static int kvm_vcpu_ioctl_x86_set_debugregs(struct 
kvm_vcpu *vcpu,
+       if (dbgregs->flags)
+               return -EINVAL;
+ 
++      if (dbgregs->dr6 & ~0xffffffffull)
++              return -EINVAL;
++      if (dbgregs->dr7 & ~0xffffffffull)
++              return -EINVAL;
++
+       memcpy(vcpu->arch.db, dbgregs->db, sizeof(vcpu->arch.db));
+       kvm_update_dr0123(vcpu);
+       vcpu->arch.dr6 = dbgregs->dr6;
+diff --git a/crypto/asymmetric_keys/Kconfig b/crypto/asymmetric_keys/Kconfig
+index 4870f28403f5..05bfe568cd30 100644
+--- a/crypto/asymmetric_keys/Kconfig
++++ b/crypto/asymmetric_keys/Kconfig
+@@ -14,6 +14,7 @@ config ASYMMETRIC_PUBLIC_KEY_SUBTYPE
+       select MPILIB
+       select PUBLIC_KEY_ALGO_RSA
+       select CRYPTO_HASH_INFO
++      select CRYPTO_AKCIPHER
+       help
+         This option provides support for asymmetric public key type handling.
+         If signature generation and/or verification are to be used,
+diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
+index 1ee2ab58e37d..e6eed20b1401 100644
+--- a/drivers/cpufreq/intel_pstate.c
++++ b/drivers/cpufreq/intel_pstate.c
+@@ -1037,8 +1037,11 @@ static int intel_pstate_cpu_init(struct cpufreq_policy 
*policy)
+ 
+       /* cpuinfo and default policy values */
+       policy->cpuinfo.min_freq = cpu->pstate.min_pstate * cpu->pstate.scaling;
+-      policy->cpuinfo.max_freq =
+-              cpu->pstate.turbo_pstate * cpu->pstate.scaling;
++      update_turbo_state();
++      policy->cpuinfo.max_freq = limits.turbo_disabled ?
++                      cpu->pstate.max_pstate : cpu->pstate.turbo_pstate;
++      policy->cpuinfo.max_freq *= cpu->pstate.scaling;
++
+       policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
+       cpumask_set_cpu(policy->cpu, policy->cpus);
+ 
+diff --git a/drivers/crypto/ccp/ccp-crypto-aes-xts.c 
b/drivers/crypto/ccp/ccp-crypto-aes-xts.c
+index 52c7395cb8d8..0d0d4529ee36 100644
+--- a/drivers/crypto/ccp/ccp-crypto-aes-xts.c
++++ b/drivers/crypto/ccp/ccp-crypto-aes-xts.c
+@@ -122,6 +122,7 @@ static int ccp_aes_xts_crypt(struct ablkcipher_request 
*req,
+       struct ccp_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
+       struct ccp_aes_req_ctx *rctx = ablkcipher_request_ctx(req);
+       unsigned int unit;
++      u32 unit_size;
+       int ret;
+ 
+       if (!ctx->u.aes.key_len)
+@@ -133,11 +134,17 @@ static int ccp_aes_xts_crypt(struct ablkcipher_request 
*req,
+       if (!req->info)
+               return -EINVAL;
+ 
+-      for (unit = 0; unit < ARRAY_SIZE(unit_size_map); unit++)
+-              if (!(req->nbytes & (unit_size_map[unit].size - 1)))
+-                      break;
++      unit_size = CCP_XTS_AES_UNIT_SIZE__LAST;
++      if (req->nbytes <= unit_size_map[0].size) {
++              for (unit = 0; unit < ARRAY_SIZE(unit_size_map); unit++) {
++                      if (!(req->nbytes & (unit_size_map[unit].size - 1))) {
++                              unit_size = unit_size_map[unit].value;
++                              break;
++                      }
++              }
++      }
+ 
+-      if ((unit_size_map[unit].value == CCP_XTS_AES_UNIT_SIZE__LAST) ||
++      if ((unit_size == CCP_XTS_AES_UNIT_SIZE__LAST) ||
+           (ctx->u.aes.key_len != AES_KEYSIZE_128)) {
+               /* Use the fallback to process the request for any
+                * unsupported unit sizes or key sizes
+@@ -158,7 +165,7 @@ static int ccp_aes_xts_crypt(struct ablkcipher_request 
*req,
+       rctx->cmd.engine = CCP_ENGINE_XTS_AES_128;
+       rctx->cmd.u.xts.action = (encrypt) ? CCP_AES_ACTION_ENCRYPT
+                                          : CCP_AES_ACTION_DECRYPT;
+-      rctx->cmd.u.xts.unit_size = unit_size_map[unit].value;
++      rctx->cmd.u.xts.unit_size = unit_size;
+       rctx->cmd.u.xts.key = &ctx->u.aes.key_sg;
+       rctx->cmd.u.xts.key_len = ctx->u.aes.key_len;
+       rctx->cmd.u.xts.iv = &rctx->iv_sg;
+diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
+index a7e7be0a8ae8..cb46c468b01e 100644
+--- a/drivers/edac/sb_edac.c
++++ b/drivers/edac/sb_edac.c
+@@ -218,8 +218,11 @@ static const u32 rir_offset[MAX_RIR_RANGES][MAX_RIR_WAY] 
= {
+       { 0x1a0, 0x1a4, 0x1a8, 0x1ac, 0x1b0, 0x1b4, 0x1b8, 0x1bc },
+ };
+ 
+-#define RIR_RNK_TGT(reg)              GET_BITFIELD(reg, 16, 19)
+-#define RIR_OFFSET(reg)               GET_BITFIELD(reg,  2, 14)
++#define RIR_RNK_TGT(type, reg) (((type) == BROADWELL) ? \
++      GET_BITFIELD(reg, 20, 23) : GET_BITFIELD(reg, 16, 19))
++
++#define RIR_OFFSET(type, reg) (((type) == HASWELL || (type) == BROADWELL) ? \
++      GET_BITFIELD(reg,  2, 15) : GET_BITFIELD(reg,  2, 14))
+ 
+ /* Device 16, functions 2-7 */
+ 
+@@ -1101,14 +1104,14 @@ static void get_memory_layout(const struct 
mem_ctl_info *mci)
+                               pci_read_config_dword(pvt->pci_tad[i],
+                                                     rir_offset[j][k],
+                                                     &reg);
+-                              tmp_mb = RIR_OFFSET(reg) << 6;
++                              tmp_mb = RIR_OFFSET(pvt->info.type, reg) << 6;
+ 
+                               gb = div_u64_rem(tmp_mb, 1024, &mb);
+                               edac_dbg(0, "CH#%d RIR#%d INTL#%d, offset 
%u.%03u GB (0x%016Lx), tgt: %d, reg=0x%08x\n",
+                                        i, j, k,
+                                        gb, (mb*1000)/1024,
+                                        ((u64)tmp_mb) << 20L,
+-                                       (u32)RIR_RNK_TGT(reg),
++                                       (u32)RIR_RNK_TGT(pvt->info.type, reg),
+                                        reg);
+                       }
+               }
+@@ -1432,7 +1435,7 @@ static int get_memory_error_data(struct mem_ctl_info 
*mci,
+       pci_read_config_dword(pvt->pci_tad[base_ch],
+                             rir_offset[n_rir][idx],
+                             &reg);
+-      *rank = RIR_RNK_TGT(reg);
++      *rank = RIR_RNK_TGT(pvt->info.type, reg);
+ 
+       edac_dbg(0, "RIR#%d: channel address 0x%08Lx < 0x%08Lx, RIR interleave 
%d, index %d\n",
+                n_rir,
+diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
+index b164ce837b43..81ddd1d6d84b 100644
+--- a/drivers/gpio/gpio-bcm-kona.c
++++ b/drivers/gpio/gpio-bcm-kona.c
+@@ -549,11 +549,11 @@ static void bcm_kona_gpio_reset(struct bcm_kona_gpio 
*kona_gpio)
+       /* disable interrupts and clear status */
+       for (i = 0; i < kona_gpio->num_bank; i++) {
+               /* Unlock the entire bank first */
+-              bcm_kona_gpio_write_lock_regs(kona_gpio, i, UNLOCK_CODE);
++              bcm_kona_gpio_write_lock_regs(reg_base, i, UNLOCK_CODE);
+               writel(0xffffffff, reg_base + GPIO_INT_MASK(i));
+               writel(0xffffffff, reg_base + GPIO_INT_STATUS(i));
+               /* Now re-lock the bank */
+-              bcm_kona_gpio_write_lock_regs(kona_gpio, i, LOCK_CODE);
++              bcm_kona_gpio_write_lock_regs(reg_base, i, LOCK_CODE);
+       }
+ }
+ 
+diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
+index 6bc612b8a49f..95752d38b7fe 100644
+--- a/drivers/gpio/gpiolib.c
++++ b/drivers/gpio/gpiolib.c
+@@ -375,7 +375,7 @@ struct gpio_chip *gpiochip_find(void *data,
+ 
+       spin_lock_irqsave(&gpio_lock, flags);
+       list_for_each_entry(chip, &gpio_chips, list)
+-              if (match(chip, data))
++              if (chip && match(chip, data))
+                       break;
+ 
+       /* No match? */
+diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c 
b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+index 567791b27d6d..cf43f77be254 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
++++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+@@ -572,6 +572,7 @@ nouveau_fbcon_init(struct drm_device *dev)
+       if (ret)
+               goto fini;
+ 
++      fbcon->helper.fbdev->pixmap.buf_align = 4;
+       return 0;
+ 
+ fini:
+diff --git a/drivers/gpu/drm/nouveau/nv04_fbcon.c 
b/drivers/gpu/drm/nouveau/nv04_fbcon.c
+index 495c57644ced..7a92d15d474e 100644
+--- a/drivers/gpu/drm/nouveau/nv04_fbcon.c
++++ b/drivers/gpu/drm/nouveau/nv04_fbcon.c
+@@ -82,7 +82,6 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct 
fb_image *image)
+       uint32_t fg;
+       uint32_t bg;
+       uint32_t dsize;
+-      uint32_t width;
+       uint32_t *data = (uint32_t *)image->data;
+       int ret;
+ 
+@@ -93,9 +92,6 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct 
fb_image *image)
+       if (ret)
+               return ret;
+ 
+-      width = ALIGN(image->width, 8);
+-      dsize = ALIGN(width * image->height, 32) >> 5;
+-
+       if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
+           info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
+               fg = ((uint32_t *) info->pseudo_palette)[image->fg_color];
+@@ -111,10 +107,11 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct 
fb_image *image)
+                        ((image->dx + image->width) & 0xffff));
+       OUT_RING(chan, bg);
+       OUT_RING(chan, fg);
+-      OUT_RING(chan, (image->height << 16) | width);
++      OUT_RING(chan, (image->height << 16) | image->width);
+       OUT_RING(chan, (image->height << 16) | image->width);
+       OUT_RING(chan, (image->dy << 16) | (image->dx & 0xffff));
+ 
++      dsize = ALIGN(image->width * image->height, 32) >> 5;
+       while (dsize) {
+               int iter_len = dsize > 128 ? 128 : dsize;
+ 
+diff --git a/drivers/gpu/drm/nouveau/nv50_fbcon.c 
b/drivers/gpu/drm/nouveau/nv50_fbcon.c
+index 394c89abcc97..cb2a71ada99e 100644
+--- a/drivers/gpu/drm/nouveau/nv50_fbcon.c
++++ b/drivers/gpu/drm/nouveau/nv50_fbcon.c
+@@ -95,7 +95,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct 
fb_image *image)
+       struct nouveau_fbdev *nfbdev = info->par;
+       struct nouveau_drm *drm = nouveau_drm(nfbdev->dev);
+       struct nouveau_channel *chan = drm->channel;
+-      uint32_t width, dwords, *data = (uint32_t *)image->data;
++      uint32_t dwords, *data = (uint32_t *)image->data;
+       uint32_t mask = ~(~0 >> (32 - info->var.bits_per_pixel));
+       uint32_t *palette = info->pseudo_palette;
+       int ret;
+@@ -107,9 +107,6 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct 
fb_image *image)
+       if (ret)
+               return ret;
+ 
+-      width = ALIGN(image->width, 32);
+-      dwords = (width * image->height) >> 5;
+-
+       BEGIN_NV04(chan, NvSub2D, 0x0814, 2);
+       if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
+           info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
+@@ -128,6 +125,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct 
fb_image *image)
+       OUT_RING(chan, 0);
+       OUT_RING(chan, image->dy);
+ 
++      dwords = ALIGN(image->width * image->height, 32) >> 5;
+       while (dwords) {
+               int push = dwords > 2047 ? 2047 : dwords;
+ 
+diff --git a/drivers/gpu/drm/nouveau/nvc0_fbcon.c 
b/drivers/gpu/drm/nouveau/nvc0_fbcon.c
+index 61246677e8dc..69f760e8c54f 100644
+--- a/drivers/gpu/drm/nouveau/nvc0_fbcon.c
++++ b/drivers/gpu/drm/nouveau/nvc0_fbcon.c
+@@ -95,7 +95,7 @@ nvc0_fbcon_imageblit(struct fb_info *info, const struct 
fb_image *image)
+       struct nouveau_fbdev *nfbdev = info->par;
+       struct nouveau_drm *drm = nouveau_drm(nfbdev->dev);
+       struct nouveau_channel *chan = drm->channel;
+-      uint32_t width, dwords, *data = (uint32_t *)image->data;
++      uint32_t dwords, *data = (uint32_t *)image->data;
+       uint32_t mask = ~(~0 >> (32 - info->var.bits_per_pixel));
+       uint32_t *palette = info->pseudo_palette;
+       int ret;
+@@ -107,9 +107,6 @@ nvc0_fbcon_imageblit(struct fb_info *info, const struct 
fb_image *image)
+       if (ret)
+               return ret;
+ 
+-      width = ALIGN(image->width, 32);
+-      dwords = (width * image->height) >> 5;
+-
+       BEGIN_NVC0(chan, NvSub2D, 0x0814, 2);
+       if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
+           info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
+@@ -128,6 +125,7 @@ nvc0_fbcon_imageblit(struct fb_info *info, const struct 
fb_image *image)
+       OUT_RING  (chan, 0);
+       OUT_RING  (chan, image->dy);
+ 
++      dwords = ALIGN(image->width * image->height, 32) >> 5;
+       while (dwords) {
+               int push = dwords > 2047 ? 2047 : dwords;
+ 
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
+index 5606c25e5d02..6d9fea664c6a 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
+@@ -796,21 +796,41 @@ gf100_gr_trap_gpc_rop(struct gf100_gr_priv *priv, int 
gpc)
+ }
+ 
+ static const struct nvkm_enum gf100_mp_warp_error[] = {
+-      { 0x00, "NO_ERROR" },
+-      { 0x01, "STACK_MISMATCH" },
++      { 0x01, "STACK_ERROR" },
++      { 0x02, "API_STACK_ERROR" },
++      { 0x03, "RET_EMPTY_STACK_ERROR" },
++      { 0x04, "PC_WRAP" },
+       { 0x05, "MISALIGNED_PC" },
+-      { 0x08, "MISALIGNED_GPR" },
+-      { 0x09, "INVALID_OPCODE" },
+-      { 0x0d, "GPR_OUT_OF_BOUNDS" },
+-      { 0x0e, "MEM_OUT_OF_BOUNDS" },
+-      { 0x0f, "UNALIGNED_MEM_ACCESS" },
+-      { 0x11, "INVALID_PARAM" },
++      { 0x06, "PC_OVERFLOW" },
++      { 0x07, "MISALIGNED_IMMC_ADDR" },
++      { 0x08, "MISALIGNED_REG" },
++      { 0x09, "ILLEGAL_INSTR_ENCODING" },
++      { 0x0a, "ILLEGAL_SPH_INSTR_COMBO" },
++      { 0x0b, "ILLEGAL_INSTR_PARAM" },
++      { 0x0c, "INVALID_CONST_ADDR" },
++      { 0x0d, "OOR_REG" },
++      { 0x0e, "OOR_ADDR" },
++      { 0x0f, "MISALIGNED_ADDR" },
++      { 0x10, "INVALID_ADDR_SPACE" },
++      { 0x11, "ILLEGAL_INSTR_PARAM2" },
++      { 0x12, "INVALID_CONST_ADDR_LDC" },
++      { 0x13, "GEOMETRY_SM_ERROR" },
++      { 0x14, "DIVERGENT" },
++      { 0x15, "WARP_EXIT" },
+       {}
+ };
+ 
+ static const struct nvkm_bitfield gf100_mp_global_error[] = {
++      { 0x00000001, "SM_TO_SM_FAULT" },
++      { 0x00000002, "L1_ERROR" },
+       { 0x00000004, "MULTIPLE_WARP_ERRORS" },
+-      { 0x00000008, "OUT_OF_STACK_SPACE" },
++      { 0x00000008, "PHYSICAL_STACK_OVERFLOW" },
++      { 0x00000010, "BPT_INT" },
++      { 0x00000020, "BPT_PAUSE" },
++      { 0x00000040, "SINGLE_STEP_COMPLETE" },
++      { 0x20000000, "ECC_SEC_ERROR" },
++      { 0x40000000, "ECC_DED_ERROR" },
++      { 0x80000000, "TIMEOUT" },
+       {}
+ };
+ 
+diff --git a/drivers/media/usb/uvc/uvc_v4l2.c 
b/drivers/media/usb/uvc/uvc_v4l2.c
+index c4b1ac6750d8..3f86e548d795 100644
+--- a/drivers/media/usb/uvc/uvc_v4l2.c
++++ b/drivers/media/usb/uvc/uvc_v4l2.c
+@@ -1379,47 +1379,44 @@ static int uvc_v4l2_put_xu_query(const struct 
uvc_xu_control_query *kp,
+ static long uvc_v4l2_compat_ioctl32(struct file *file,
+                    unsigned int cmd, unsigned long arg)
+ {
++      struct uvc_fh *handle = file->private_data;
+       union {
+               struct uvc_xu_control_mapping xmap;
+               struct uvc_xu_control_query xqry;
+       } karg;
+       void __user *up = compat_ptr(arg);
+-      mm_segment_t old_fs;
+       long ret;
+ 
+       switch (cmd) {
+       case UVCIOC_CTRL_MAP32:
+-              cmd = UVCIOC_CTRL_MAP;
+               ret = uvc_v4l2_get_xu_mapping(&karg.xmap, up);
++              if (ret)
++                      return ret;
++              ret = uvc_ioctl_ctrl_map(handle->chain, &karg.xmap);
++              if (ret)
++                      return ret;
++              ret = uvc_v4l2_put_xu_mapping(&karg.xmap, up);
++              if (ret)
++                      return ret;
++
+               break;
+ 
+       case UVCIOC_CTRL_QUERY32:
+-              cmd = UVCIOC_CTRL_QUERY;
+               ret = uvc_v4l2_get_xu_query(&karg.xqry, up);
++              if (ret)
++                      return ret;
++              ret = uvc_xu_ctrl_query(handle->chain, &karg.xqry);
++              if (ret)
++                      return ret;
++              ret = uvc_v4l2_put_xu_query(&karg.xqry, up);
++              if (ret)
++                      return ret;
+               break;
+ 
+       default:
+               return -ENOIOCTLCMD;
+       }
+ 
+-      old_fs = get_fs();
+-      set_fs(KERNEL_DS);
+-      ret = video_ioctl2(file, cmd, (unsigned long)&karg);
+-      set_fs(old_fs);
+-
+-      if (ret < 0)
+-              return ret;
+-
+-      switch (cmd) {
+-      case UVCIOC_CTRL_MAP:
+-              ret = uvc_v4l2_put_xu_mapping(&karg.xmap, up);
+-              break;
+-
+-      case UVCIOC_CTRL_QUERY:
+-              ret = uvc_v4l2_put_xu_query(&karg.xqry, up);
+-              break;
+-      }
+-
+       return ret;
+ }
+ #endif
+diff --git a/drivers/net/wireless/mac80211_hwsim.c 
b/drivers/net/wireless/mac80211_hwsim.c
+index d5c0a1af08b9..eafaeb01aa3e 100644
+--- a/drivers/net/wireless/mac80211_hwsim.c
++++ b/drivers/net/wireless/mac80211_hwsim.c
+@@ -2724,6 +2724,7 @@ static int hwsim_tx_info_frame_received_nl(struct 
sk_buff *skb_2,
+       if (!info->attrs[HWSIM_ATTR_ADDR_TRANSMITTER] ||
+           !info->attrs[HWSIM_ATTR_FLAGS] ||
+           !info->attrs[HWSIM_ATTR_COOKIE] ||
++          !info->attrs[HWSIM_ATTR_SIGNAL] ||
+           !info->attrs[HWSIM_ATTR_TX_INFO])
+               goto out;
+ 
+diff --git a/drivers/of/irq.c b/drivers/of/irq.c
+index 1a7980692f25..f5d497989fcd 100644
+--- a/drivers/of/irq.c
++++ b/drivers/of/irq.c
+@@ -385,13 +385,13 @@ int of_irq_to_resource(struct device_node *dev, int 
index, struct resource *r)
+ EXPORT_SYMBOL_GPL(of_irq_to_resource);
+ 
+ /**
+- * of_irq_get - Decode a node's IRQ and return it as a Linux irq number
++ * of_irq_get - Decode a node's IRQ and return it as a Linux IRQ number
+  * @dev: pointer to device tree node
+- * @index: zero-based index of the irq
+- *
+- * Returns Linux irq number on success, or -EPROBE_DEFER if the irq domain
+- * is not yet created.
++ * @index: zero-based index of the IRQ
+  *
++ * Returns Linux IRQ number on success, or 0 on the IRQ mapping failure, or
++ * -EPROBE_DEFER if the IRQ domain is not yet created, or error code in case
++ * of any other failure.
+  */
+ int of_irq_get(struct device_node *dev, int index)
+ {
+@@ -412,12 +412,13 @@ int of_irq_get(struct device_node *dev, int index)
+ EXPORT_SYMBOL_GPL(of_irq_get);
+ 
+ /**
+- * of_irq_get_byname - Decode a node's IRQ and return it as a Linux irq number
++ * of_irq_get_byname - Decode a node's IRQ and return it as a Linux IRQ number
+  * @dev: pointer to device tree node
+- * @name: irq name
++ * @name: IRQ name
+  *
+- * Returns Linux irq number on success, or -EPROBE_DEFER if the irq domain
+- * is not yet created, or error code in case of any other failure.
++ * Returns Linux IRQ number on success, or 0 on the IRQ mapping failure, or
++ * -EPROBE_DEFER if the IRQ domain is not yet created, or error code in case
++ * of any other failure.
+  */
+ int of_irq_get_byname(struct device_node *dev, const char *name)
+ {
+diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c 
b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+index de08175aef0a..d32a72e96c72 100644
+--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
++++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+@@ -1030,9 +1030,10 @@ static void mtk_eint_irq_handler(unsigned irq, struct 
irq_desc *desc)
+       const struct mtk_desc_pin *pin;
+ 
+       chained_irq_enter(chip, desc);
+-      for (eint_num = 0; eint_num < pctl->devdata->ap_num; eint_num += 32) {
++      for (eint_num = 0;
++           eint_num < pctl->devdata->ap_num;
++           eint_num += 32, reg += 4) {
+               status = readl(reg);
+-              reg += 4;
+               while (status) {
+                       offset = __ffs(status);
+                       index = eint_num + offset;
+diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
+index ac418e73536d..42d3f82e75c7 100644
+--- a/drivers/scsi/scsi_devinfo.c
++++ b/drivers/scsi/scsi_devinfo.c
+@@ -227,6 +227,7 @@ static struct {
+       {"PIONEER", "CD-ROM DRM-624X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
+       {"Promise", "VTrak E610f", NULL, BLIST_SPARSELUN | BLIST_NO_RSOC},
+       {"Promise", "", NULL, BLIST_SPARSELUN},
++      {"QEMU", "QEMU CD-ROM", NULL, BLIST_SKIP_VPD_PAGES},
+       {"QNAP", "iSCSI Storage", NULL, BLIST_MAX_1024},
+       {"SYNOLOGY", "iSCSI Storage", NULL, BLIST_MAX_1024},
+       {"QUANTUM", "XP34301", "1071", BLIST_NOTQ},
+diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
+index 448ebdaa3d69..17fbf1d3eadc 100644
+--- a/drivers/scsi/scsi_lib.c
++++ b/drivers/scsi/scsi_lib.c
+@@ -909,9 +909,12 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned 
int good_bytes)
+       }
+ 
+       /*
+-       * If we finished all bytes in the request we are done now.
++       * special case: failed zero length commands always need to
++       * drop down into the retry code. Otherwise, if we finished
++       * all bytes in the request we are done now.
+        */
+-      if (!scsi_end_request(req, error, good_bytes, 0))
++      if (!(blk_rq_bytes(req) == 0 && error) &&
++          !scsi_end_request(req, error, good_bytes, 0))
+               return;
+ 
+       /*
+diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
+index f65f0d109fc8..5db5e91fd12f 100644
+--- a/drivers/thermal/cpu_cooling.c
++++ b/drivers/thermal/cpu_cooling.c
+@@ -52,7 +52,7 @@
+  *    registered cooling device.
+  * @cpufreq_state: integer value representing the current state of cpufreq
+  *    cooling devices.
+- * @cpufreq_val: integer value representing the absolute value of the clipped
++ * @clipped_freq: integer value representing the absolute value of the clipped
+  *    frequency.
+  * @max_level: maximum cooling level. One less than total number of valid
+  *    cpufreq frequencies.
+@@ -66,7 +66,7 @@ struct cpufreq_cooling_device {
+       int id;
+       struct thermal_cooling_device *cool_dev;
+       unsigned int cpufreq_state;
+-      unsigned int cpufreq_val;
++      unsigned int clipped_freq;
+       unsigned int max_level;
+       unsigned int *freq_table;       /* In descending order */
+       struct cpumask allowed_cpus;
+@@ -195,7 +195,7 @@ static int cpufreq_thermal_notifier(struct notifier_block 
*nb,
+                                       &cpufreq_dev->allowed_cpus))
+                       continue;
+ 
+-              max_freq = cpufreq_dev->cpufreq_val;
++              max_freq = cpufreq_dev->clipped_freq;
+ 
+               if (policy->max != max_freq)
+                       cpufreq_verify_within_limits(policy, 0, max_freq);
+@@ -273,7 +273,7 @@ static int cpufreq_set_cur_state(struct 
thermal_cooling_device *cdev,
+ 
+       clip_freq = cpufreq_device->freq_table[state];
+       cpufreq_device->cpufreq_state = state;
+-      cpufreq_device->cpufreq_val = clip_freq;
++      cpufreq_device->clipped_freq = clip_freq;
+ 
+       cpufreq_update_policy(cpu);
+ 
+@@ -363,14 +363,6 @@ __cpufreq_cooling_register(struct device_node *np,
+               goto free_table;
+       }
+ 
+-      snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d",
+-               cpufreq_dev->id);
+-
+-      cool_dev = thermal_of_cooling_device_register(np, dev_name, cpufreq_dev,
+-                                                    &cpufreq_cooling_ops);
+-      if (IS_ERR(cool_dev))
+-              goto remove_idr;
+-
+       /* Fill freq-table in descending order of frequencies */
+       for (i = 0, freq = -1; i <= cpufreq_dev->max_level; i++) {
+               freq = find_next_max(table, freq);
+@@ -383,7 +375,15 @@ __cpufreq_cooling_register(struct device_node *np,
+                       pr_debug("%s: freq:%u KHz\n", __func__, freq);
+       }
+ 
+-      cpufreq_dev->cpufreq_val = cpufreq_dev->freq_table[0];
++      snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d",
++               cpufreq_dev->id);
++
++      cool_dev = thermal_of_cooling_device_register(np, dev_name, cpufreq_dev,
++                                                    &cpufreq_cooling_ops);
++      if (IS_ERR(cool_dev))
++              goto remove_idr;
++
++      cpufreq_dev->clipped_freq = cpufreq_dev->freq_table[0];
+       cpufreq_dev->cool_dev = cool_dev;
+ 
+       mutex_lock(&cooling_cpufreq_lock);
+diff --git a/fs/dcache.c b/fs/dcache.c
+index 10bce74c427f..2c75b393d31a 100644
+--- a/fs/dcache.c
++++ b/fs/dcache.c
+@@ -1618,7 +1618,7 @@ struct dentry *d_alloc(struct dentry * parent, const 
struct qstr *name)
+       struct dentry *dentry = __d_alloc(parent->d_sb, name);
+       if (!dentry)
+               return NULL;
+-
++      dentry->d_flags |= DCACHE_RCUACCESS;
+       spin_lock(&parent->d_lock);
+       /*
+        * don't need child lock because it is not subject
+@@ -2410,7 +2410,6 @@ static void __d_rehash(struct dentry * entry, struct 
hlist_bl_head *b)
+ {
+       BUG_ON(!d_unhashed(entry));
+       hlist_bl_lock(b);
+-      entry->d_flags |= DCACHE_RCUACCESS;
+       hlist_bl_add_head_rcu(&entry->d_hash, b);
+       hlist_bl_unlock(b);
+ }
+@@ -2629,6 +2628,7 @@ static void __d_move(struct dentry *dentry, struct 
dentry *target,
+       /* ... and switch them in the tree */
+       if (IS_ROOT(dentry)) {
+               /* splicing a tree */
++              dentry->d_flags |= DCACHE_RCUACCESS;
+               dentry->d_parent = target->d_parent;
+               target->d_parent = target;
+               list_del_init(&target->d_child);
+diff --git a/fs/ecryptfs/kthread.c b/fs/ecryptfs/kthread.c
+index 866bb18efefe..e818f5ac7a26 100644
+--- a/fs/ecryptfs/kthread.c
++++ b/fs/ecryptfs/kthread.c
+@@ -25,6 +25,7 @@
+ #include <linux/slab.h>
+ #include <linux/wait.h>
+ #include <linux/mount.h>
++#include <linux/file.h>
+ #include "ecryptfs_kernel.h"
+ 
+ struct ecryptfs_open_req {
+@@ -147,7 +148,7 @@ int ecryptfs_privileged_open(struct file **lower_file,
+       flags |= IS_RDONLY(d_inode(lower_dentry)) ? O_RDONLY : O_RDWR;
+       (*lower_file) = dentry_open(&req.path, flags, cred);
+       if (!IS_ERR(*lower_file))
+-              goto out;
++              goto have_file;
+       if ((flags & O_ACCMODE) == O_RDONLY) {
+               rc = PTR_ERR((*lower_file));
+               goto out;
+@@ -165,8 +166,16 @@ int ecryptfs_privileged_open(struct file **lower_file,
+       mutex_unlock(&ecryptfs_kthread_ctl.mux);
+       wake_up(&ecryptfs_kthread_ctl.wait);
+       wait_for_completion(&req.done);
+-      if (IS_ERR(*lower_file))
++      if (IS_ERR(*lower_file)) {
+               rc = PTR_ERR(*lower_file);
++              goto out;
++      }
++have_file:
++      if ((*lower_file)->f_op->mmap == NULL) {
++              fput(*lower_file);
++              *lower_file = NULL;
++              rc = -EMEDIUMTYPE;
++      }
+ out:
+       return rc;
+ }
+diff --git a/fs/namespace.c b/fs/namespace.c
+index fce3cc1a3fa7..6257268147ee 100644
+--- a/fs/namespace.c
++++ b/fs/namespace.c
+@@ -2390,8 +2390,10 @@ static int do_new_mount(struct path *path, const char 
*fstype, int flags,
+                       mnt_flags |= MNT_NODEV | MNT_LOCK_NODEV;
+               }
+               if (type->fs_flags & FS_USERNS_VISIBLE) {
+-                      if (!fs_fully_visible(type, &mnt_flags))
++                      if (!fs_fully_visible(type, &mnt_flags)) {
++                              put_filesystem(type);
+                               return -EPERM;
++                      }
+               }
+       }
+ 
+@@ -3236,7 +3238,7 @@ static bool fs_fully_visible(struct file_system_type 
*type, int *new_mnt_flags)
+               list_for_each_entry(child, &mnt->mnt_mounts, mnt_child) {
+                       struct inode *inode = child->mnt_mountpoint->d_inode;
+                       /* Only worry about locked mounts */
+-                      if (!(mnt->mnt.mnt_flags & MNT_LOCKED))
++                      if (!(child->mnt.mnt_flags & MNT_LOCKED))
+                               continue;
+                       /* Is the directory permanetly empty? */
+                       if (!is_empty_dir_inode(inode))
+diff --git a/fs/proc/root.c b/fs/proc/root.c
+index 68feb0f70e63..c3e1bc595e6d 100644
+--- a/fs/proc/root.c
++++ b/fs/proc/root.c
+@@ -121,6 +121,13 @@ static struct dentry *proc_mount(struct file_system_type 
*fs_type,
+       if (IS_ERR(sb))
+               return ERR_CAST(sb);
+ 
++      /*
++       * procfs isn't actually a stacking filesystem; however, there is
++       * too much magic going on inside it to permit stacking things on
++       * top of it
++       */
++      sb->s_stack_depth = FILESYSTEM_MAX_STACK_DEPTH;
++
+       if (!proc_parse_options(options, ns)) {
+               deactivate_locked_super(sb);
+               return ERR_PTR(-EINVAL);
+diff --git a/include/linux/irqchip/arm-gic-v3.h 
b/include/linux/irqchip/arm-gic-v3.h
+index ffbc034c8810..cbf1ce800fd1 100644
+--- a/include/linux/irqchip/arm-gic-v3.h
++++ b/include/linux/irqchip/arm-gic-v3.h
+@@ -307,7 +307,7 @@
+ #define ICC_SGI1R_AFFINITY_1_SHIFT    16
+ #define ICC_SGI1R_AFFINITY_1_MASK     (0xff << ICC_SGI1R_AFFINITY_1_SHIFT)
+ #define ICC_SGI1R_SGI_ID_SHIFT                24
+-#define ICC_SGI1R_SGI_ID_MASK         (0xff << ICC_SGI1R_SGI_ID_SHIFT)
++#define ICC_SGI1R_SGI_ID_MASK         (0xfULL << ICC_SGI1R_SGI_ID_SHIFT)
+ #define ICC_SGI1R_AFFINITY_2_SHIFT    32
+ #define ICC_SGI1R_AFFINITY_2_MASK     (0xffULL << ICC_SGI1R_AFFINITY_1_SHIFT)
+ #define ICC_SGI1R_IRQ_ROUTING_MODE_BIT        40
+diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
+index 4cccea6b8934..6f1c3e41b2a6 100644
+--- a/kernel/locking/mutex.c
++++ b/kernel/locking/mutex.c
+@@ -486,9 +486,6 @@ __ww_mutex_lock_check_stamp(struct mutex *lock, struct 
ww_acquire_ctx *ctx)
+       if (!hold_ctx)
+               return 0;
+ 
+-      if (unlikely(ctx == hold_ctx))
+-              return -EALREADY;
+-
+       if (ctx->stamp - hold_ctx->stamp <= LONG_MAX &&
+           (ctx->stamp != hold_ctx->stamp || ctx > hold_ctx)) {
+ #ifdef CONFIG_DEBUG_MUTEXES
+@@ -514,6 +511,12 @@ __mutex_lock_common(struct mutex *lock, long state, 
unsigned int subclass,
+       unsigned long flags;
+       int ret;
+ 
++      if (use_ww_ctx) {
++              struct ww_mutex *ww = container_of(lock, struct ww_mutex, base);
++              if (unlikely(ww_ctx == READ_ONCE(ww->ctx)))
++                      return -EALREADY;
++      }
++
+       preempt_disable();
+       mutex_acquire_nest(&lock->dep_map, subclass, 0, nest_lock, ip);
+ 
+diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
+index afcc67a157fd..c5af4e3d4497 100644
+--- a/net/mac80211/mesh.c
++++ b/net/mac80211/mesh.c
+@@ -161,6 +161,10 @@ void mesh_sta_cleanup(struct sta_info *sta)
+               del_timer_sync(&sta->plink_timer);
+       }
+ 
++      /* make sure no readers can access nexthop sta from here on */
++      mesh_path_flush_by_nexthop(sta);
++      synchronize_net();
++
+       if (changed)
+               ieee80211_mbss_info_change_notify(sdata, changed);
+ }
+diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c
+index b50ee5d622e1..c753211cb83f 100644
+--- a/net/wireless/wext-core.c
++++ b/net/wireless/wext-core.c
+@@ -955,8 +955,29 @@ static int wireless_process_ioctl(struct net *net, struct 
ifreq *ifr,
+                       return private(dev, iwr, cmd, info, handler);
+       }
+       /* Old driver API : call driver ioctl handler */
+-      if (dev->netdev_ops->ndo_do_ioctl)
+-              return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
++      if (dev->netdev_ops->ndo_do_ioctl) {
++#ifdef CONFIG_COMPAT
++              if (info->flags & IW_REQUEST_FLAG_COMPAT) {
++                      int ret = 0;
++                      struct iwreq iwr_lcl;
++                      struct compat_iw_point *iwp_compat = (void *) 
&iwr->u.data;
++
++                      memcpy(&iwr_lcl, iwr, sizeof(struct iwreq));
++                      iwr_lcl.u.data.pointer = 
compat_ptr(iwp_compat->pointer);
++                      iwr_lcl.u.data.length = iwp_compat->length;
++                      iwr_lcl.u.data.flags = iwp_compat->flags;
++
++                      ret = dev->netdev_ops->ndo_do_ioctl(dev, (void *) 
&iwr_lcl, cmd);
++
++                      iwp_compat->pointer = 
ptr_to_compat(iwr_lcl.u.data.pointer);
++                      iwp_compat->length = iwr_lcl.u.data.length;
++                      iwp_compat->flags = iwr_lcl.u.data.flags;
++
++                      return ret;
++              } else
++#endif
++                      return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
++      }
+       return -EOPNOTSUPP;
+ }
+ 
+diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
+index 78691d51a479..0ef6956dcfa6 100644
+--- a/scripts/mod/file2alias.c
++++ b/scripts/mod/file2alias.c
+@@ -653,7 +653,7 @@ static int do_of_entry (const char *filename, void 
*symval, char *alias)
+       len = sprintf(alias, "of:N%sT%s", (*name)[0] ? *name : "*",
+                     (*type)[0] ? *type : "*");
+ 
+-      if (compatible[0])
++      if ((*compatible)[0])
+               sprintf(&alias[len], "%sC%s", (*type)[0] ? "*" : "",
+                       *compatible);
+ 
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
+index bee74795c9b9..a62872f7b41a 100644
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -3608,13 +3608,20 @@ static void alc269_fixup_hp_line1_mic1_led(struct 
hda_codec *codec,
+ static void alc_headset_mode_unplugged(struct hda_codec *codec)
+ {
+       static struct coef_fw coef0255[] = {
+-              WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
+               WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
+               UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp 
control(Set to verb control)*/
+               WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
+               WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp 
control */
+               {}
+       };
++      static struct coef_fw coef0255_1[] = {
++              WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
++              {}
++      };
++      static struct coef_fw coef0256[] = {
++              WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
++              {}
++      };
+       static struct coef_fw coef0233[] = {
+               WRITE_COEF(0x1b, 0x0c0b),
+               WRITE_COEF(0x45, 0xc429),
+@@ -3657,7 +3664,11 @@ static void alc_headset_mode_unplugged(struct hda_codec 
*codec)
+ 
+       switch (codec->core.vendor_id) {
+       case 0x10ec0255:
++              alc_process_coef_fw(codec, coef0255_1);
++              alc_process_coef_fw(codec, coef0255);
++              break;
+       case 0x10ec0256:
++              alc_process_coef_fw(codec, coef0256);
+               alc_process_coef_fw(codec, coef0255);
+               break;
+       case 0x10ec0233:
+@@ -3854,6 +3865,12 @@ static void alc_headset_mode_ctia(struct hda_codec 
*codec)
+               WRITE_COEFEX(0x57, 0x03, 0x8ea6),
+               {}
+       };
++      static struct coef_fw coef0256[] = {
++              WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
++              WRITE_COEF(0x1b, 0x0c6b),
++              WRITE_COEFEX(0x57, 0x03, 0x8ea6),
++              {}
++      };
+       static struct coef_fw coef0233[] = {
+               WRITE_COEF(0x45, 0xd429),
+               WRITE_COEF(0x1b, 0x0c2b),
+@@ -3887,9 +3904,11 @@ static void alc_headset_mode_ctia(struct hda_codec 
*codec)
+ 
+       switch (codec->core.vendor_id) {
+       case 0x10ec0255:
+-      case 0x10ec0256:
+               alc_process_coef_fw(codec, coef0255);
+               break;
++      case 0x10ec0256:
++              alc_process_coef_fw(codec, coef0256);
++              break;
+       case 0x10ec0233:
+       case 0x10ec0283:
+               alc_process_coef_fw(codec, coef0233);
+@@ -3922,6 +3941,12 @@ static void alc_headset_mode_omtp(struct hda_codec 
*codec)
+               WRITE_COEFEX(0x57, 0x03, 0x8ea6),
+               {}
+       };
++      static struct coef_fw coef0256[] = {
++              WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
++              WRITE_COEF(0x1b, 0x0c6b),
++              WRITE_COEFEX(0x57, 0x03, 0x8ea6),
++              {}
++      };
+       static struct coef_fw coef0233[] = {
+               WRITE_COEF(0x45, 0xe429),
+               WRITE_COEF(0x1b, 0x0c2b),
+@@ -3955,9 +3980,11 @@ static void alc_headset_mode_omtp(struct hda_codec 
*codec)
+ 
+       switch (codec->core.vendor_id) {
+       case 0x10ec0255:
+-      case 0x10ec0256:
+               alc_process_coef_fw(codec, coef0255);
+               break;
++      case 0x10ec0256:
++              alc_process_coef_fw(codec, coef0256);
++              break;
+       case 0x10ec0233:
+       case 0x10ec0283:
+               alc_process_coef_fw(codec, coef0233);
+@@ -4181,7 +4208,7 @@ static void alc_fixup_headset_mode_no_hp_mic(struct 
hda_codec *codec,
+ static void alc255_set_default_jack_type(struct hda_codec *codec)
+ {
+       /* Set to iphone type */
+-      static struct coef_fw fw[] = {
++      static struct coef_fw alc255fw[] = {
+               WRITE_COEF(0x1b, 0x880b),
+               WRITE_COEF(0x45, 0xd089),
+               WRITE_COEF(0x1b, 0x080b),
+@@ -4189,7 +4216,22 @@ static void alc255_set_default_jack_type(struct 
hda_codec *codec)
+               WRITE_COEF(0x1b, 0x0c0b),
+               {}
+       };
+-      alc_process_coef_fw(codec, fw);
++      static struct coef_fw alc256fw[] = {
++              WRITE_COEF(0x1b, 0x884b),
++              WRITE_COEF(0x45, 0xd089),
++              WRITE_COEF(0x1b, 0x084b),
++              WRITE_COEF(0x46, 0x0004),
++              WRITE_COEF(0x1b, 0x0c4b),
++              {}
++      };
++      switch (codec->core.vendor_id) {
++      case 0x10ec0255:
++              alc_process_coef_fw(codec, alc255fw);
++              break;
++      case 0x10ec0256:
++              alc_process_coef_fw(codec, alc256fw);
++              break;
++      }
+       msleep(30);
+ }
+ 
+@@ -5446,6 +5488,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
+       SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", 
ALC292_FIXUP_TPT440_DOCK),
+       SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", 
ALC292_FIXUP_TPT440_DOCK),
+       SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", 
ALC292_FIXUP_TPT440_DOCK),
++      SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
+       SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
+       SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", 
ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
+       SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", 
ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
+@@ -5698,6 +5741,10 @@ static const struct snd_hda_pin_quirk 
alc269_pin_fixup_tbl[] = {
+               {0x17, 0x40000000},
+               {0x1d, 0x40700001},
+               {0x21, 0x02211040}),
++      SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", 
ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
++              {0x12, 0x90a60180},
++              {0x14, 0x90170120},
++              {0x21, 0x02211030}),
+       SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", 
ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
+               ALC255_STANDARD_PINS,
+               {0x12, 0x90a60160},
+diff --git a/virt/kvm/irqchip.c b/virt/kvm/irqchip.c
+index 1d56a901e791..1470f2aab091 100644
+--- a/virt/kvm/irqchip.c
++++ b/virt/kvm/irqchip.c
+@@ -51,7 +51,7 @@ int kvm_irq_map_gsi(struct kvm *kvm,
+ 
+       irq_rt = srcu_dereference_check(kvm->irq_routing, &kvm->irq_srcu,
+                                       lockdep_is_held(&kvm->irq_lock));
+-      if (gsi < irq_rt->nr_rt_entries) {
++      if (irq_rt && gsi < irq_rt->nr_rt_entries) {
+               hlist_for_each_entry(e, &irq_rt->map[gsi], link) {
+                       entries[n] = *e;
+                       ++n;

Reply via email to