Linux 4.13.8
Greg KH
maintainerI'm announcing the release of the 4.13.8 kernel.
All users of the 4.13 kernel series must upgrade.
The updated 4.13.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.13.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 +- arch/mips/math-emu/cp1emu.c | 2 -- arch/mips/net/ebpf_jit.c | 2 +- arch/x86/include/asm/alternative-asm.h | 4 +++- arch/x86/include/asm/alternative.h | 6 +++--- arch/x86/kernel/cpu/microcode/core.c | 27 ++++++++++++++++++--------- arch/x86/kvm/mmu.c | 15 ++++++++------- arch/x86/kvm/paging_tmpl.h | 3 ++- arch/x86/kvm/vmx.c | 2 +- block/bio.c | 26 +++++++++++++++++++------- crypto/shash.c | 8 +++++--- crypto/skcipher.c | 17 +++++++++++------ drivers/base/property.c | 15 +++++++++------ drivers/dma/edma.c | 19 ++++++++++++++++--- drivers/dma/ti-dma-crossbar.c | 3 ++- drivers/gpu/drm/drm_atomic_helper.c | 1 + drivers/gpu/drm/i915/intel_bios.c | 2 +- drivers/gpu/drm/i915/intel_color.c | 16 +++++++--------- drivers/gpu/drm/i915/intel_display.c | 14 +++++++++----- drivers/gpu/drm/i915/intel_dp.c | 2 +- drivers/hid/usbhid/hid-core.c | 12 +++++++++++- drivers/iommu/amd_iommu.c | 1 + drivers/misc/mei/pci-me.c | 21 +++++++++++---------- drivers/misc/mei/pci-txe.c | 30 +++++++++++------------------- drivers/pci/host/pci-aardvark.c | 2 ++ drivers/pci/host/pci-tegra.c | 22 ++++++---------------- drivers/pinctrl/Kconfig | 1 + drivers/ras/cec.c | 2 +- drivers/usb/gadget/composite.c | 5 +++++ drivers/usb/gadget/configfs.c | 15 ++++++++------- drivers/usb/gadget/configfs.h | 11 ++++++----- drivers/usb/gadget/function/f_rndis.c | 12 ++++++++++-- drivers/usb/gadget/function/u_rndis.h | 1 + drivers/usb/gadget/udc/dummy_hcd.c | 9 ++++++--- drivers/usb/renesas_usbhs/fifo.c | 2 +- drivers/usb/serial/console.c | 3 ++- drivers/usb/serial/cp210x.c | 13 +++++++------ drivers/usb/serial/ftdi_sio.c | 2 ++ drivers/usb/serial/ftdi_sio_ids.h | 7 +++++++ drivers/usb/serial/option.c | 2 ++ drivers/usb/serial/qcserial.c | 4 ++++ fs/block_dev.c | 6 ++++-- fs/direct-io.c | 3 ++- fs/mpage.c | 14 +++++++++++--- fs/nfs/client.c | 2 +- fs/nfs/filelayout/filelayout.c | 3 ++- include/linux/buffer_head.h | 1 + include/sound/seq_virmidi.h | 1 + kernel/irq/chip.c | 2 +- kernel/irq/cpuhotplug.c | 28 +++++++++++++++++++++++++++- kernel/irq/manage.c | 3 +++ mm/vmalloc.c | 6 ------ sound/core/seq/seq_clientmgr.c | 6 +++++- sound/core/seq/seq_ports.c | 7 +++++-- sound/core/seq/seq_virmidi.c | 27 +++++++++++++++++++-------- sound/usb/caiaq/device.c | 12 +++++++++--- sound/usb/line6/driver.c | 7 ++++--- sound/usb/line6/podhd.c | 8 +++++--- sound/usb/mixer.c | 12 ++++++++++-- sound/usb/mixer.h | 2 ++ tools/perf/builtin-script.c | 4 ++-- 61 files changed, 337 insertions(+), 180 deletions(-)
Al Viro (2):
more bio_map_user_iov() leak fixes bio_copy_user_iov(): don't ignore ->iov_offset
Alan Stern (1):
USB: dummy-hcd: Fix deadlock caused by disconnect detection
Alexander Usyskin (1):
mei: always use domain runtime pm callbacks.
Andreas Engel (1):
USB: serial: cp210x: add support for ELV TFD500
Andreas Gruenbacher (1):
direct-io: Prevent NULL pointer access in submit_page_section
Andrew Gabbasov (2):
usb: gadget: configfs: Fix memory leak of interface directory data
usb: gadget: composite: Fix use-after-free in usb_composite_overwrite_options
Benjamin Coddington (1):
NFS: Fix uninitialized rpc_wait_queue
Borislav Petkov (1):
x86/microcode: Do the family check first
Greg Kroah-Hartman (1):
Linux 4.13.8
Haozhong Zhang (1):
KVM: nVMX: fix guest CR4 loading when emulating L2 to L1 exit
Henryk Heisig (1):
USB: serial: option: add support for TP-Link LTE module
Herbert Xu (2):
crypto: skcipher - Fix crash on zero-length input
crypto: shash - Fix zero-length shash ahash digest crash
Jaejoong Kim (1):
HID: usbhid: fix out-of-bounds bug
Jani Nikula (1):
drm/i915/bios: parse DDI ports also for CHV for HDMI DDC pin and DP AUX channel
Jarkko Nikula (1):
device property: Track owner device of device property
Jeffrey Chu (1):
USB: serial: ftdi_sio: add id for Cypress WICED dev board
Jeffy Chen (1):
drm/atomic: Unref duplicated drm_atomic_state in drm_atomic_helper_resume()
Joerg Roedel (1):
iommu/amd: Finish TLB flush in amd_iommu_unmap()
Johan Hovold (2):
USB: serial: console: fix use-after-free on disconnect
USB: serial: console: fix use-after-free after failed setup
Johannes Weiner (1):
Revert "vmalloc: back off when the current task is killed"
Kazuya Mizuguchi (1):
usb: renesas_usbhs: Fix DMAC sequence for receiving zero-length packet
Ladi Prosek (2):
KVM: MMU: always terminate page walks at level 1
KVM: nVMX: update last_nonleaf_level when initializing nested EPT
Maarten Lankhorst (1):
drm/i915: Use crtc_state_is_legacy_gamma in intel_color_check
Manasi Navare (1):
drm/i915/edp: Get the Panel Power Off timestamp after panel is off
Mark Santaniello (1):
perf script: Add missing separator for "-F ip,brstack" (and brstackoff)
Mathias Krause (1):
x86/alternatives: Fix alt_max_short macro to really be a max()
Matt Redfearn (1):
MIPS: bpf: Fix uninitialised target compiler error
Matthew Wilcox (1):
fs/mpage.c: fix mpage_writepage() for pages with buffers
Nicolas Iooss (1):
RAS/CEC: Use the right length for "cec_disable"
Paul Burton (1):
MIPS: math-emu: Remove pr_err() calls from fpu_emu()
Peter Ujfalusi (2):
dmaengine: edma: Align the memcpy acnt array size with the transfer
dmaengine: ti-dma-crossbar: Fix possible race condition with dma_inuse
Petr Mladek (1):
pinctrl/amd: Fix build dependency on pinmux code
Scott Mayhew (1):
nfs/filelayout: fix oops when freeing filelayout segment
Sebastian Frei (1):
USB: serial: cp210x: fix partnum regression
Shrirang Bagul (1):
USB: serial: qcserial: add Dell DW5818, DW5819
Takashi Iwai (7):
ALSA: usb-audio: Kill stray URB at exiting
ALSA: seq: Fix use-after-free at creating a port
ALSA: seq: Fix copy_from_user() call inside lock
ALSA: caiaq: Fix stray URB at probe error path
ALSA: line6: Fix NULL dereference at podhd_disconnect()
ALSA: line6: Fix missing initialization before error path
ALSA: line6: Fix leftover URB at error-path during probe
Thierry Reding (1):
Revert "PCI: tegra: Do not allocate MSI target memory"
Thomas Gleixner (2):
genirq/cpuhotplug: Enforce affinity setting on startup of managed irqs genirq/cpuhotplug: Add sanity check for effective affinity mask
Thomas Petazzoni (1):
PCI: aardvark: Move to struct pci_host_bridge IRQ mapping functions
Ville Syrjälä (1):
drm/i915: Read timings from the correct transcoder in intel_crtc_mode_get()
Vitaly Mayatskikh (1):
fix unbalanced page refcounting in bio_map_user_iov
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 13 -SUBLEVEL = 7 +SUBLEVEL = 8 EXTRAVERSION = NAME = Fearless Coyote
arch/mips/math-emu/cp1emu.c +0 -2
@@ -2387,7 +2387,6 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,break ;default :/* Reserved R6 ops */ -pr_err ("Reserved MIPS R6 CMP.condn.S operation\n" );return SIGILL ; } }
@@ -2461,7 +2460,6 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,break ;default :/* Reserved R6 ops */ -pr_err ("Reserved MIPS R6 CMP.condn.D operation\n" );return SIGILL ; } }
arch/mips/net/ebpf_jit.c +1 -1
@@ -679,7 +679,7 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, {int src, dst, r, td, ts, mem_off, b_off;bool need_swap, did_move, cmp_eq; -unsigned int target; +unsigned int target =0 ;u64 t64;s64 t64s;
arch/x86/include/asm/alternative-asm.h +3 -1
@@ -62,8 +62,10 @@#define new_len2 145f-144f/* -* max without conditionals. Idea adapted from: +* gas compatible max based on the idea from: * http://graphics.stanford.edu/~seander/bithacks.html#IntegerMinOrMax +* +* The additional "-" is needed because gas uses a "true" value of -1. */ #define alt_max_short (a, b) ((a) ^ (((a) ^ (b)) & -(-((a) < (b)))))
arch/x86/include/asm/alternative.h +3 -3
@@ -103,12 +103,12 @@ static inline int alternatives_text_reserved(void *start, void *end) alt_end_marker":\n" /* -* max without conditionals. Idea adapted from: +* gas compatible max based on the idea from: * http://graphics.stanford.edu/~seander/bithacks.html#IntegerMinOrMax * -* The additional "-" is needed because gas works with s32s. +* The additional "-" is needed because gas uses a "true" value of -1. */ -#define alt_max_short (a, b) "((" a ") ^ (((" a ") ^ (" b ")) & -(-((" a ") - (" b ")))))" +#define alt_max_short (a, b) "((" a ") ^ (((" a ") ^ (" b ")) & -(-((" a ") < (" b ")))))"/* * Pad the second replacement alternative with additional NOPs if it is
arch/x86/kernel/cpu/microcode/core.c +18 -9
@@ -122,9 +122,6 @@ static bool __init check_loader_disabled_bsp(void)bool *res = &dis_ucode_ldr;#endif -if (!have_cpuid_p ()) -return *res; -/* * CPUID(1).ECX[31]: reserved for hypervisor use. This is still not * completely accurate as xen pv guests don't see that CPUID bit set but
@@ -166,24 +163,36 @@ bool get_builtin_firmware(struct cpio_data *cd, const char *name)void __init load_ucode_bsp (void ) {unsigned int cpuid_1_eax; +bool intel = true; -if (check_loader_disabled_bsp ()) +if (!have_cpuid_p ())return ; cpuid_1_eax =native_cpuid_eax (1 );switch (x86_cpuid_vendor ()) {case X86_VENDOR_INTEL : -if (x86_family (cpuid_1_eax) >=6 ) -load_ucode_intel_bsp (); +if (x86_family (cpuid_1_eax) <6 ) +return ;break ; +case X86_VENDOR_AMD : -if (x86_family (cpuid_1_eax) >=0x10 ) -load_ucode_amd_bsp (cpuid_1_eax); +if (x86_family (cpuid_1_eax) <0x10 ) +return ; + intel = false;break ; +default : -break ; +return ; } + +if (check_loader_disabled_bsp ()) +return ; + +if (intel) +load_ucode_intel_bsp (); +else +load_ucode_amd_bsp (cpuid_1_eax); }static bool check_loader_disabled_ap (void )
arch/x86/kvm/mmu.c +8 -7
@@ -3934,13 +3934,6 @@ static bool sync_mmio_spte(struct kvm_vcpu *vcpu, u64 *sptep, gfn_t gfn,static inline bool is_last_gpte (struct kvm_mmu *mmu,unsigned level,unsigned gpte) { -/* -* PT_PAGE_TABLE_LEVEL always terminates. The RHS has bit 7 set -* iff level <= PT_PAGE_TABLE_LEVEL, which for our purpose means -* level == PT_PAGE_TABLE_LEVEL; set PT_PAGE_SIZE_MASK in gpte then. -*/ - gpte |= level -PT_PAGE_TABLE_LEVEL -1 ; -/* * The RHS has bit 7 set iff level < mmu->last_nonleaf_level. * If it is clear, there are no large pages at this level, so clear
@@ -3948,6 +3941,13 @@ static inline bool is_last_gpte(struct kvm_mmu *mmu,*/ gpte &= level - mmu->last_nonleaf_level; +/* +* PT_PAGE_TABLE_LEVEL always terminates. The RHS has bit 7 set +* iff level <= PT_PAGE_TABLE_LEVEL, which for our purpose means +* level == PT_PAGE_TABLE_LEVEL; set PT_PAGE_SIZE_MASK in gpte then. +*/ + gpte |= level -PT_PAGE_TABLE_LEVEL -1 ; +return gpte &PT_PAGE_SIZE_MASK ; }
@@ -4459,6 +4459,7 @@ void kvm_init_shadow_ept_mmu(struct kvm_vcpu *vcpu, bool execonly,update_permission_bitmask (vcpu, context, true);update_pkru_bitmask (vcpu, context, true); +update_last_nonleaf_level (vcpu, context);reset_rsvds_bits_mask_ept (vcpu, context, execonly);reset_ept_shadow_zero_bits_mask (vcpu, context, execonly); }
arch/x86/kvm/paging_tmpl.h +2 -1
@@ -334,10 +334,11 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker, --walker->level; index =PT_INDEX (addr, walker->level); - table_gfn =gpte_to_gfn (pte); offset = index *sizeof (pt_element_t); pte_gpa =gfn_to_gpa (table_gfn) + offset; + +BUG_ON (walker->level <1 ); walker->table_gfn[walker->level -1 ] = table_gfn; walker->pte_gpa[walker->level -1 ] = pte_gpa;
arch/x86/kvm/vmx.c +1 -1
@@ -11013,7 +11013,7 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,/* Same as above - no reason to call set_cr4_guest_host_mask(). */ vcpu->arch.cr4_guest_owned_bits = ~vmcs_readl (CR4_GUEST_HOST_MASK ); -kvm_set_cr4 (vcpu, vmcs12->host_cr4); +vmx_set_cr4 (vcpu, vmcs12->host_cr4);nested_ept_uninit_mmu_context (vcpu);
block/bio.c +19 -7
@@ -1235,8 +1235,8 @@ struct bio *bio_copy_user_iov(struct request_queue *q,*/ bmd->is_our_pages = map_data ?0 :1 ;memcpy (bmd->iov, iter->iov,sizeof (struct iovec ) * iter->nr_segs); -iov_iter_init (&bmd->iter, iter->type, bmd->iov, - iter->nr_segs, iter->count); + bmd->iter = *iter; + bmd->iter.iov = bmd->iov; ret = -ENOMEM ; bio =bio_kmalloc (gfp_mask, nr_pages);
@@ -1327,6 +1327,7 @@ struct bio *bio_map_user_iov(struct request_queue *q,int ret, offset;struct iov_iter i;struct iovec iov; +struct bio_vec *bvec;iov_for_each (iov, i, *iter) {unsigned long uaddr = (unsigned long ) iov.iov_base;
@@ -1371,7 +1372,12 @@ struct bio *bio_map_user_iov(struct request_queue *q, ret =get_user_pages_fast (uaddr, local_nr_pages, (iter->type &WRITE ) !=WRITE , &pages[cur_page]); -if (ret < local_nr_pages) { +if (unlikely (ret < local_nr_pages)) { +for (j = cur_page; j < page_limit; j++) { +if (!pages[j]) +break ; +put_page (pages[j]); + } ret = -EFAULT ; goto out_unmap; }
@@ -1379,6 +1385,7 @@ struct bio *bio_map_user_iov(struct request_queue *q, offset =offset_in_page (uaddr);for (j = cur_page; j < page_limit; j++) {unsigned int bytes =PAGE_SIZE - offset; +unsigned short prev_bi_vcnt = bio->bi_vcnt;if (len <=0 )break ;
@@ -1393,6 +1400,13 @@ struct bio *bio_map_user_iov(struct request_queue *q, bytes)break ; +/* +* check if vector was merged with previous +* drop page reference if needed +*/ +if (bio->bi_vcnt == prev_bi_vcnt) +put_page (pages[j]); + len -= bytes; offset =0 ; }
@@ -1419,10 +1433,8 @@ struct bio *bio_map_user_iov(struct request_queue *q,return bio; out_unmap: -for (j =0 ; j < nr_pages; j++) { -if (!pages[j]) -break ; -put_page (pages[j]); +bio_for_each_segment_all (bvec, bio, j) { +put_page (bvec->bv_page); } out:kfree (pages);
crypto/shash.c +5 -3
@@ -275,12 +275,14 @@ static int shash_async_finup(struct ahash_request *req)int shash_ahash_digest (struct ahash_request *req,struct shash_desc *desc) { -struct scatterlist *sg = req->src; -unsigned int offset = sg->offset;unsigned int nbytes = req->nbytes; +struct scatterlist *sg; +unsigned int offset;int err; -if (nbytes <min (sg->length, ((unsigned int )(PAGE_SIZE )) - offset)) { +if (nbytes && + (sg = req->src, offset = sg->offset, + nbytes <min (sg->length, ((unsigned int )(PAGE_SIZE )) - offset))) {void *data; data =kmap_atomic (sg_page (sg));
crypto/skcipher.c +11 -6
@@ -426,14 +426,9 @@ static int skcipher_copy_iv(struct skcipher_walk *walk)static int skcipher_walk_first (struct skcipher_walk *walk) { - walk->nbytes =0 ; -if (WARN_ON_ONCE (in_irq ()))return -EDEADLK ; -if (unlikely (!walk->total)) -return 0 ; - walk->buffer =NULL ;if (unlikely (((unsigned long )walk->iv & walk->alignmask))) {int err =skcipher_copy_iv (walk);
@@ -452,10 +447,15 @@ static int skcipher_walk_skcipher(struct skcipher_walk *walk, {struct crypto_skcipher *tfm =crypto_skcipher_reqtfm (req); + walk->total = req->cryptlen; + walk->nbytes =0 ; + +if (unlikely (!walk->total)) +return 0 ; +scatterwalk_start (&walk->in, req->src);scatterwalk_start (&walk->out, req->dst); - walk->total = req->cryptlen; walk->iv = req->iv; walk->oiv = req->iv;
@@ -509,6 +509,11 @@ static int skcipher_walk_aead_common(struct skcipher_walk *walk,struct crypto_aead *tfm =crypto_aead_reqtfm (req);int err; + walk->nbytes =0 ; + +if (unlikely (!walk->total)) +return 0 ; + walk->flags &= ~SKCIPHER_WALK_PHYS ;scatterwalk_start (&walk->in, req->src);
drivers/base/property.c +9 -6
@@ -21,6 +21,7 @@#include <linux/phy.h> struct property_set { +struct device *dev;struct fwnode_handle fwnode;const struct property_entry *properties; };
@@ -855,6 +856,7 @@ static struct property_set *pset_copy_set(const struct property_set *pset)void device_remove_properties (struct device *dev) {struct fwnode_handle *fwnode; +struct property_set *pset; fwnode =dev_fwnode (dev);if (!fwnode)
@@ -864,16 +866,16 @@ void device_remove_properties(struct device *dev)* the pset. If there is no real firmware node (ACPI/DT) primary * will hold the pset. */ -if (is_pset_node (fwnode)) { + pset =to_pset_node (fwnode); +if (pset) {set_primary_fwnode (dev,NULL ); -pset_free_set (to_pset_node (fwnode)); }else { - fwnode = fwnode->secondary; -if (!IS_ERR (fwnode) &&is_pset_node (fwnode)) { + pset =to_pset_node (fwnode->secondary); +if (pset && dev == pset->dev)set_secondary_fwnode (dev,NULL ); -pset_free_set (to_pset_node (fwnode)); - } } +if (pset && dev == pset->dev) +pset_free_set (pset); }EXPORT_SYMBOL_GPL (device_remove_properties);
@@ -903,6 +905,7 @@ int device_add_properties(struct device *dev, p->fwnode.type =FWNODE_PDATA ; p->fwnode.ops = &pset_fwnode_ops;set_secondary_fwnode (dev, &p->fwnode); + p->dev = dev;return 0 ; }EXPORT_SYMBOL_GPL (device_add_properties);
drivers/dma/edma.c +16 -3
@@ -1143,11 +1143,24 @@ static struct dma_async_tx_descriptor *edma_prep_dma_memcpy(struct edma_desc *edesc;struct device *dev = chan->device->dev;struct edma_chan *echan =to_edma_chan (chan); -unsigned int width, pset_len; +unsigned int width, pset_len, array_size;if (unlikely (!echan || !len))return NULL ; +/* Align the array size (acnt block) with the transfer properties */ +switch (__ffs ((src | dest | len))) { +case 0 : + array_size =SZ_32K -1 ; +break ; +case 1 : + array_size =SZ_32K -2 ; +break ; +default : + array_size =SZ_32K -4 ; +break ; + } +if (len <SZ_64K ) {/* * Transfer size less than 64K can be handled with one paRAM
@@ -1169,7 +1182,7 @@ static struct dma_async_tx_descriptor *edma_prep_dma_memcpy(* When the full_length is multibple of 32767 one slot can be * used to complete the transfer. */ - width =SZ_32K -1 ; + width = array_size; pset_len =rounddown (len, width);/* One slot is enough for lengths multiple of (SZ_32K -1) */ if (unlikely (pset_len == len))
@@ -1217,7 +1230,7 @@ static struct dma_async_tx_descriptor *edma_prep_dma_memcpy( } dest += pset_len; src += pset_len; - pset_len = width = len % (SZ_32K -1 ); + pset_len = width = len % array_size; ret =edma_config_pset (chan, &edesc->pset[1 ], src, dest,1 , width, pset_len,DMA_MEM_TO_MEM );
drivers/dma/ti-dma-crossbar.c +2 -1
@@ -262,13 +262,14 @@ static void *ti_dra7_xbar_route_allocate(struct of_phandle_args *dma_spec,mutex_lock (&xbar->mutex); map->xbar_out =find_first_zero_bit (xbar->dma_inuse, xbar->dma_requests); -mutex_unlock (&xbar->mutex);if (map->xbar_out == xbar->dma_requests) { +mutex_unlock (&xbar->mutex);dev_err (&pdev->dev,"Run out of free DMA requests\n" );kfree (map);return ERR_PTR (-ENOMEM ); }set_bit (map->xbar_out, xbar->dma_inuse); +mutex_unlock (&xbar->mutex); map->xbar_in = (u16 )dma_spec->args[0 ];
drivers/gpu/drm/drm_atomic_helper.c +1 -0
@@ -2756,6 +2756,7 @@ int drm_atomic_helper_resume(struct drm_device *dev,drm_modeset_backoff (&ctx); } +drm_atomic_state_put (state);drm_modeset_drop_locks (&ctx);drm_modeset_acquire_fini (&ctx);
drivers/gpu/drm/i915/intel_bios.c +1 -1
@@ -1231,7 +1231,7 @@ static void parse_ddi_ports(struct drm_i915_private *dev_priv, {enum port port; -if (!HAS_DDI (dev_priv)) +if (!HAS_DDI (dev_priv) && !IS_CHERRYVIEW (dev_priv))return ;if (!dev_priv->vbt.child_dev_num)
drivers/gpu/drm/i915/intel_color.c +7 -9
@@ -58,7 +58,7 @@#define I9XX_CSC_COEFF_1_0 \ ((7 << 12) | I9XX_CSC_COEFF_FP(CTM_COEFF_1_0, 8)) -static bool crtc_state_is_legacy (struct drm_crtc_state *state) +static bool crtc_state_is_legacy_gamma (struct drm_crtc_state *state) {return !state->degamma_lut && !state->ctm &&
@@ -245,7 +245,7 @@ static void cherryview_load_csc_matrix(struct drm_crtc_state *state) } mode = (state->ctm ?CGM_PIPE_MODE_CSC :0 ); -if (!crtc_state_is_legacy (state)) { +if (!crtc_state_is_legacy_gamma (state)) { mode |= (state->degamma_lut ?CGM_PIPE_MODE_DEGAMMA :0 ) | (state->gamma_lut ?CGM_PIPE_MODE_GAMMA :0 ); }
@@ -426,7 +426,7 @@ static void broadwell_load_luts(struct drm_crtc_state *state)struct intel_crtc_state *intel_state =to_intel_crtc_state (state);enum pipe pipe =to_intel_crtc (state->crtc)->pipe; -if (crtc_state_is_legacy (state)) { +if (crtc_state_is_legacy_gamma (state)) {haswell_load_luts (state);return ; }
@@ -486,7 +486,7 @@ static void glk_load_luts(struct drm_crtc_state *state)glk_load_degamma_lut (state); -if (crtc_state_is_legacy (state)) { +if (crtc_state_is_legacy_gamma (state)) {haswell_load_luts (state);return ; }
@@ -508,7 +508,7 @@ static void cherryview_load_luts(struct drm_crtc_state *state)uint32_t i, lut_size;uint32_t word0, word1; -if (crtc_state_is_legacy (state)) { +if (crtc_state_is_legacy_gamma (state)) {/* Turn off degamma/gamma on CGM block. */ I915_WRITE (CGM_PIPE_MODE (pipe), (state->ctm ?CGM_PIPE_MODE_CSC :0 ));
@@ -589,12 +589,10 @@ int intel_color_check(struct drm_crtc *crtc,return 0 ;/* -* We also allow no degamma lut and a gamma lut at the legacy +* We also allow no degamma lut/ctm and a gamma lut at the legacy * size (256 entries). */ -if (!crtc_state->degamma_lut && - crtc_state->gamma_lut && - crtc_state->gamma_lut->length ==LEGACY_LUT_LENGTH ) +if (crtc_state_is_legacy_gamma (crtc_state))return 0 ;return -EINVAL ;
drivers/gpu/drm/i915/intel_display.c +9 -5
@@ -10059,13 +10059,10 @@ struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev, {struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder; +enum transcoder cpu_transcoder;struct drm_display_mode *mode;struct intel_crtc_state *pipe_config; -int htot =I915_READ (HTOTAL (cpu_transcoder)); -int hsync =I915_READ (HSYNC (cpu_transcoder)); -int vtot =I915_READ (VTOTAL (cpu_transcoder)); -int vsync =I915_READ (VSYNC (cpu_transcoder)); +u32 htot, hsync, vtot, vsync;enum pipe pipe = intel_crtc->pipe; mode =kzalloc (sizeof (*mode),GFP_KERNEL );
@@ -10093,6 +10090,13 @@ struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev,i9xx_crtc_clock_get (intel_crtc, pipe_config); mode->clock = pipe_config->port_clock / pipe_config->pixel_multiplier; + + cpu_transcoder = pipe_config->cpu_transcoder; + htot =I915_READ (HTOTAL (cpu_transcoder)); + hsync =I915_READ (HSYNC (cpu_transcoder)); + vtot =I915_READ (VTOTAL (cpu_transcoder)); + vsync =I915_READ (VSYNC (cpu_transcoder)); + mode->hdisplay = (htot &0xffff ) +1 ; mode->htotal = ((htot &0xffff0000 ) >>16 ) +1 ; mode->hsync_start = (hsync &0xffff ) +1 ;
drivers/gpu/drm/i915/intel_dp.c +1 -1
@@ -2263,8 +2263,8 @@ static void edp_panel_off(struct intel_dp *intel_dp)I915_WRITE (pp_ctrl_reg, pp);POSTING_READ (pp_ctrl_reg); - intel_dp->panel_power_off_time =ktime_get_boottime ();wait_panel_off (intel_dp); + intel_dp->panel_power_off_time =ktime_get_boottime ();/* We got a reference when we enabled the VDD. */ intel_display_power_put (dev_priv, intel_dp->aux_power_domain);
drivers/hid/usbhid/hid-core.c +11 -1
@@ -975,6 +975,8 @@ static int usbhid_parse(struct hid_device *hid)unsigned int rsize =0 ;char *rdesc;int ret, n; +int num_descriptors; +size_t offset = offsetof(struct hid_descriptor , desc); quirks =usbhid_lookup_quirk (le16_to_cpu (dev->descriptor.idVendor),le16_to_cpu (dev->descriptor.idProduct));
@@ -997,10 +999,18 @@ static int usbhid_parse(struct hid_device *hid)return -ENODEV ; } +if (hdesc->bLength <sizeof (struct hid_descriptor )) { +dbg_hid ("hid descriptor is too short\n" ); +return -EINVAL ; + } + hid->version =le16_to_cpu (hdesc->bcdHID); hid->country = hdesc->bCountryCode; -for (n =0 ; n < hdesc->bNumDescriptors; n++) + num_descriptors =min_t (int, hdesc->bNumDescriptors, + (hdesc->bLength - offset) /sizeof (struct hid_class_descriptor )); + +for (n =0 ; n < num_descriptors; n++)if (hdesc->desc[n].bDescriptorType ==HID_DT_REPORT ) rsize =le16_to_cpu (hdesc->desc[n].wDescriptorLength);
drivers/iommu/amd_iommu.c +1 -0
@@ -3262,6 +3262,7 @@ static size_t amd_iommu_unmap(struct iommu_domain *dom, unsigned long iova,mutex_unlock (&domain->api_lock);domain_flush_tlb_pde (domain); +domain_flush_complete (domain);return unmap_size; }
drivers/misc/mei/pci-me.c +11 -10
@@ -222,12 +222,15 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pdev->dev_flags |=PCI_DEV_FLAGS_NEEDS_RESUME ;/* -* For not wake-able HW runtime pm framework -* can't be used on pci device level. -* Use domain runtime pm callbacks instead. -*/ -if (!pci_dev_run_wake (pdev)) -mei_me_set_pm_domain (dev); +* ME maps runtime suspend/resume to D0i states, +* hence we need to go around native PCI runtime service which +* eventually brings the device into D3cold/hot state, +* but the mei device cannot wake up from D3 unlike from D0i3. +* To get around the PCI device native runtime pm, +* ME uses runtime pm domain handlers which take precedence +* over the driver's pm handlers. +*/ +mei_me_set_pm_domain (dev);if (mei_pg_is_enabled (dev))pm_runtime_put_noidle (&pdev->dev);
@@ -267,8 +270,7 @@ static void mei_me_shutdown(struct pci_dev *pdev)dev_dbg (&pdev->dev,"shutdown\n" );mei_stop (dev); -if (!pci_dev_run_wake (pdev)) -mei_me_unset_pm_domain (dev); +mei_me_unset_pm_domain (dev);mei_disable_interrupts (dev);free_irq (pdev->irq, dev);
@@ -296,8 +298,7 @@ static void mei_me_remove(struct pci_dev *pdev)dev_dbg (&pdev->dev,"stop\n" );mei_stop (dev); -if (!pci_dev_run_wake (pdev)) -mei_me_unset_pm_domain (dev); +mei_me_unset_pm_domain (dev);mei_disable_interrupts (dev);
drivers/misc/mei/pci-txe.c +11 -19
@@ -144,12 +144,14 @@ static int mei_txe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pdev->dev_flags |=PCI_DEV_FLAGS_NEEDS_RESUME ;/* -* For not wake-able HW runtime pm framework -* can't be used on pci device level. -* Use domain runtime pm callbacks instead. -*/ -if (!pci_dev_run_wake (pdev)) -mei_txe_set_pm_domain (dev); +* TXE maps runtime suspend/resume to own power gating states, +* hence we need to go around native PCI runtime service which +* eventually brings the device into D3cold/hot state. +* But the TXE device cannot wake up from D3 unlike from own +* power gating. To get around PCI device native runtime pm, +* TXE uses runtime pm domain handlers which take precedence. +*/ +mei_txe_set_pm_domain (dev);pm_runtime_put_noidle (&pdev->dev);
@@ -186,8 +188,7 @@ static void mei_txe_shutdown(struct pci_dev *pdev)dev_dbg (&pdev->dev,"shutdown\n" );mei_stop (dev); -if (!pci_dev_run_wake (pdev)) -mei_txe_unset_pm_domain (dev); +mei_txe_unset_pm_domain (dev);mei_disable_interrupts (dev);free_irq (pdev->irq, dev);
@@ -215,8 +216,7 @@ static void mei_txe_remove(struct pci_dev *pdev)mei_stop (dev); -if (!pci_dev_run_wake (pdev)) -mei_txe_unset_pm_domain (dev); +mei_txe_unset_pm_domain (dev);mei_disable_interrupts (dev);free_irq (pdev->irq, dev);
@@ -318,15 +318,7 @@ static int mei_txe_pm_runtime_suspend(struct device *device)else ret = -EAGAIN ; -/* -* If everything is okay we're about to enter PCI low -* power state (D3) therefor we need to disable the -* interrupts towards host. -* However if device is not wakeable we do not enter -* D-low state and we need to keep the interrupt kicking -*/ -if (!ret &&pci_dev_run_wake (pdev)) -mei_disable_interrupts (dev); +/* keep irq on we are staying in D0 */ dev_dbg (&pdev->dev,"rpm: txe: runtime suspend ret=%d\n" , ret);
drivers/pci/host/pci-aardvark.c +2 -0
@@ -936,6 +936,8 @@ static int advk_pcie_probe(struct platform_device *pdev) bridge->sysdata = pcie; bridge->busnr =0 ; bridge->ops = &advk_pcie_ops; + bridge->map_irq = of_irq_parse_and_map_pci; + bridge->swizzle_irq = pci_common_swizzle; ret =pci_scan_root_bus_bridge (bridge);if (ret <0 ) {
drivers/pci/host/pci-tegra.c +6 -16
@@ -233,6 +233,7 @@ struct tegra_msi {struct msi_controller chip;DECLARE_BITMAP (used,INT_PCI_MSI_NR );struct irq_domain *domain; +unsigned long pages;struct mutex lock;u64 phys;int irq;
@@ -1529,22 +1530,9 @@ static int tegra_pcie_enable_msi(struct tegra_pcie *pcie) goto err; } -/* -* The PCI host bridge on Tegra contains some logic that intercepts -* MSI writes, which means that the MSI target address doesn't have -* to point to actual physical memory. Rather than allocating one 4 -* KiB page of system memory that's never used, we can simply pick -* an arbitrary address within an area reserved for system memory -* in the FPCI address map. -* -* However, in order to avoid confusion, we pick an address that -* doesn't map to physical memory. The FPCI address map reserves a -* 1012 GiB region for system memory and memory-mapped I/O. Since -* none of the Tegra SoCs that contain this PCI host bridge can -* address more than 16 GiB of system memory, the last 4 KiB of -* these 1012 GiB is a good candidate. -*/ - msi->phys =0xfcfffff000 ; +/* setup AFI/FPCI range */ + msi->pages =__get_free_pages (GFP_KERNEL ,0 ); + msi->phys =virt_to_phys ((void *)msi->pages);afi_writel (pcie, msi->phys >> soc->msi_base_shift,AFI_MSI_FPCI_BAR_ST );afi_writel (pcie, msi->phys,AFI_MSI_AXI_BAR_ST );
@@ -1596,6 +1584,8 @@ static int tegra_pcie_disable_msi(struct tegra_pcie *pcie)afi_writel (pcie,0 ,AFI_MSI_EN_VEC6 );afi_writel (pcie,0 ,AFI_MSI_EN_VEC7 ); +free_pages (msi->pages,0 ); +if (msi->irq >0 )free_irq (msi->irq, pcie);
drivers/pinctrl/Kconfig +1 -0
@@ -100,6 +100,7 @@ config PINCTRL_AMD tristate "AMD GPIO pin control" depends on GPIOLIB select GPIOLIB_IRQCHIP + select PINMUX select PINCONF select GENERIC_PINCONF help
drivers/ras/cec.c +1 -1
@@ -523,7 +523,7 @@ int __init parse_cec_param(char *str)if (*str =='=' ) str++; -if (!strncmp (str,"cec_disable" ,7 )) +if (!strcmp (str,"cec_disable" )) ce_arr.disabled =1 ;else return 0 ;
drivers/usb/gadget/composite.c +5 -0
@@ -2026,6 +2026,8 @@ static DEVICE_ATTR_RO(suspended);static void __composite_unbind (struct usb_gadget *gadget,bool unbind_driver) {struct usb_composite_dev *cdev =get_gadget_data (gadget); +struct usb_gadget_strings *gstr = cdev->driver->strings[0 ]; +struct usb_string *dev_str = gstr->strings;/* composite_disconnect() must already have been called * by the underlying peripheral controller driver!
@@ -2045,6 +2047,9 @@ static void __composite_unbind(struct usb_gadget *gadget, bool unbind_driver)composite_dev_cleanup (cdev); +if (dev_str[USB_GADGET_MANUFACTURER_IDX ].s == cdev->def_manufacturer) + dev_str[USB_GADGET_MANUFACTURER_IDX ].s ="" ; +kfree (cdev->def_manufacturer);kfree (cdev);set_gadget_data (gadget,NULL );
drivers/usb/gadget/configfs.c +8 -7
@@ -1143,11 +1143,12 @@ static struct configfs_attribute *interf_grp_attrs[] = { NULL }; -int usb_os_desc_prepare_interf_dir (struct config_group *parent, -int n_interf, -struct usb_os_desc **desc, -char **names, -struct module *owner) +struct config_group *usb_os_desc_prepare_interf_dir ( +struct config_group *parent, +int n_interf, +struct usb_os_desc **desc, +char **names, +struct module *owner) {struct config_group *os_desc_group;struct config_item_type *os_desc_type, *interface_type;
@@ -1159,7 +1160,7 @@ int usb_os_desc_prepare_interf_dir(struct config_group *parent,char *vlabuf =kzalloc (vla_group_size (data_chunk),GFP_KERNEL );if (!vlabuf) -return -ENOMEM ; +return ERR_PTR (-ENOMEM ); os_desc_group =vla_ptr (vlabuf, data_chunk, os_desc_group); os_desc_type =vla_ptr (vlabuf, data_chunk, os_desc_type);
@@ -1184,7 +1185,7 @@ int usb_os_desc_prepare_interf_dir(struct config_group *parent,configfs_add_default_group (&d->group, os_desc_group); } -return 0 ; +return os_desc_group; }EXPORT_SYMBOL (usb_os_desc_prepare_interf_dir);
drivers/usb/gadget/configfs.h +6 -5
@@ -5,11 +5,12 @@void unregister_gadget_item (struct config_item *item); -int usb_os_desc_prepare_interf_dir (struct config_group *parent, -int n_interf, -struct usb_os_desc **desc, -char **names, -struct module *owner); +struct config_group *usb_os_desc_prepare_interf_dir ( +struct config_group *parent, +int n_interf, +struct usb_os_desc **desc, +char **names, +struct module *owner);static inline struct usb_os_desc *to_usb_os_desc (struct config_item *item) {
drivers/usb/gadget/function/f_rndis.c +10 -2
@@ -892,6 +892,7 @@ static void rndis_free_inst(struct usb_function_instance *f)free_netdev (opts->net); } +kfree (opts->rndis_interf_group);/* single VLA chunk */ kfree (opts); }
@@ -900,6 +901,7 @@ static struct usb_function_instance *rndis_alloc_inst(void)struct f_rndis_opts *opts;struct usb_os_desc *descs[1 ];char *names[1 ]; +struct config_group *rndis_interf_group; opts =kzalloc (sizeof (*opts),GFP_KERNEL );if (!opts)
@@ -920,8 +922,14 @@ static struct usb_function_instance *rndis_alloc_inst(void) names[0 ] ="rndis" ;config_group_init_type_name (&opts->func_inst.group,"" , &rndis_func_type); -usb_os_desc_prepare_interf_dir (&opts->func_inst.group,1 , descs, - names,THIS_MODULE ); + rndis_interf_group = +usb_os_desc_prepare_interf_dir (&opts->func_inst.group,1 , descs, + names,THIS_MODULE ); +if (IS_ERR (rndis_interf_group)) { +rndis_free_inst (&opts->func_inst); +return ERR_CAST (rndis_interf_group); + } + opts->rndis_interf_group = rndis_interf_group;return &opts->func_inst; }
drivers/usb/gadget/function/u_rndis.h +1 -0
@@ -26,6 +26,7 @@ struct f_rndis_opts {bool bound;bool borrowed_net; +struct config_group *rndis_interf_group;struct usb_os_desc rndis_os_desc;char rndis_ext_compat_id[16 ];
drivers/usb/gadget/udc/dummy_hcd.c +6 -3
@@ -420,6 +420,7 @@ static void set_link_state_by_speed(struct dummy_hcd *dum_hcd)static void set_link_state (struct dummy_hcd *dum_hcd) {struct dummy *dum = dum_hcd->dum; +unsigned int power_bit; dum_hcd->active =0 ;if (dum->pullup)
@@ -430,17 +431,19 @@ static void set_link_state(struct dummy_hcd *dum_hcd)return ;set_link_state_by_speed (dum_hcd); + power_bit = (dummy_hcd_to_hcd (dum_hcd)->speed ==HCD_USB3 ? +USB_SS_PORT_STAT_POWER :USB_PORT_STAT_POWER );if ((dum_hcd->port_status &USB_PORT_STAT_ENABLE ) ==0 || dum_hcd->active) dum_hcd->resuming =0 ;/* Currently !connected or in reset */ -if ((dum_hcd->port_status &USB_PORT_STAT_CONNECTION ) ==0 || +if ((dum_hcd->port_status & power_bit) ==0 || (dum_hcd->port_status &USB_PORT_STAT_RESET ) !=0 ) { -unsigned disconnect =USB_PORT_STAT_CONNECTION & +unsigned int disconnect = power_bit & dum_hcd->old_status & (~dum_hcd->port_status); -unsigned reset =USB_PORT_STAT_RESET & +unsigned int reset =USB_PORT_STAT_RESET & (~dum_hcd->old_status) & dum_hcd->port_status;/* Report reset and disconnect events to the driver */
drivers/usb/renesas_usbhs/fifo.c +1 -1
@@ -857,9 +857,9 @@ static void xfer_work(struct work_struct *work) fifo->name, usbhs_pipe_number(pipe), pkt->length, pkt->zero);usbhs_pipe_running (pipe,1 ); -usbhsf_dma_start (pipe, fifo);usbhs_pipe_set_trans_count_if_bulk (pipe, pkt->trans);dma_async_issue_pending (chan); +usbhsf_dma_start (pipe, fifo);usbhs_pipe_enable (pipe); xfer_work_end:
drivers/usb/serial/console.c +2 -1
@@ -186,6 +186,7 @@ static int usb_console_setup(struct console *co, char *options)tty_kref_put (tty); reset_open_count: port->port.count =0 ; + info->port =NULL ;usb_autopm_put_interface (serial->interface); error_get_interface:usb_serial_put (serial);
@@ -265,7 +266,7 @@ static struct console usbcons = {void usb_serial_console_disconnect (struct usb_serial *serial) { -if (serial->port[0 ] == usbcons_info.port) { +if (serial->port[0 ] && serial->port[0 ] == usbcons_info.port) {usb_serial_console_exit ();usb_serial_put (serial); }
drivers/usb/serial/cp210x.c +7 -6
@@ -177,6 +177,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ { USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */ + { USB_DEVICE(0x18EF, 0xE032) }, /* ELV TFD500 Data Logger */ { USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */ { USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */ { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */
@@ -352,6 +353,7 @@ static struct usb_serial_driver * const serial_drivers[] = {#define CP210X_PARTNUM_CP2104 0x04#define CP210X_PARTNUM_CP2105 0x05#define CP210X_PARTNUM_CP2108 0x08 +#define CP210X_PARTNUM_UNKNOWN 0xFF/* CP210X_GET_COMM_STATUS returns these 0x13 bytes */ struct cp210x_comm_status {
@@ -1491,8 +1493,11 @@ static int cp210x_attach(struct usb_serial *serial) result =cp210x_read_vendor_block (serial,REQTYPE_DEVICE_TO_HOST ,CP210X_GET_PARTNUM , &priv->partnum,sizeof (priv->partnum)); -if (result <0 ) - goto err_free_priv; +if (result <0 ) { +dev_warn (&serial->interface->dev, +"querying part number failed\n" ); + priv->partnum =CP210X_PARTNUM_UNKNOWN ; + }usb_set_serial_data (serial, priv);
@@ -1505,10 +1510,6 @@ static int cp210x_attach(struct usb_serial *serial) }return 0 ; -err_free_priv: -kfree (priv); - -return result; }static void cp210x_disconnect (struct usb_serial *serial)
drivers/usb/serial/ftdi_sio.c +2 -0
@@ -1015,6 +1015,8 @@ static const struct usb_device_id id_table_combined[] = { { USB_DEVICE(WICED_VID, WICED_USB20706V2_PID) }, { USB_DEVICE(TI_VID, TI_CC3200_LAUNCHPAD_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_BT_USB_PID) }, + { USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_WL_USB_PID) }, { } /* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +7 -0
@@ -609,6 +609,13 @@#define ADI_GNICE_PID 0xF000#define ADI_GNICEPLUS_PID 0xF001 +/* +* Cypress WICED USB UART +*/ +#define CYPRESS_VID 0x04B4 +#define CYPRESS_WICED_BT_USB_PID 0x009B +#define CYPRESS_WICED_WL_USB_PID 0xF900 +/* * Microchip Technology, Inc. *
drivers/usb/serial/option.c +2 -0
@@ -522,6 +522,7 @@ static void option_instat_callback(struct urb *urb);/* TP-LINK Incorporated products */ #define TPLINK_VENDOR_ID 0x2357 +#define TPLINK_PRODUCT_LTE 0x000D#define TPLINK_PRODUCT_MA180 0x0201/* Changhong products */
@@ -2011,6 +2012,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) }, { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) }, + { USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, TPLINK_PRODUCT_LTE, 0xff, 0x00, 0x00) }, /* TP-Link LTE Module */ { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180), .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE(TPLINK_VENDOR_ID, 0x9000), /* TP-Link MA260 */
drivers/usb/serial/qcserial.c +4 -0
@@ -174,6 +174,10 @@ static const struct usb_device_id id_table[] = { {DEVICE_SWI(0x413c, 0x81b3)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ {DEVICE_SWI(0x413c, 0x81b5)}, /* Dell Wireless 5811e QDL */ {DEVICE_SWI(0x413c, 0x81b6)}, /* Dell Wireless 5811e QDL */ + {DEVICE_SWI(0x413c, 0x81cf)}, /* Dell Wireless 5819 */ + {DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */ + {DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */ + {DEVICE_SWI(0x413c, 0x81d2)}, /* Dell Wireless 5818 *//* Huawei devices */ {DEVICE_HWI(0x03f0, 0x581d)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) */
fs/block_dev.c +4 -2
@@ -716,10 +716,12 @@ int bdev_write_page(struct block_device *bdev, sector_t sector,set_page_writeback (page); result = ops->rw_page (bdev, sector +get_start_sect (bdev), page, true); -if (result) +if (result) {end_page_writeback (page); -else + }else { +clean_page_buffers (page);unlock_page (page); + }blk_queue_exit (bdev->bd_queue);return result; }
fs/direct-io.c +2 -1
@@ -838,7 +838,8 @@ submit_page_section(struct dio *dio, struct dio_submit *sdio, struct page *page,*/ if (sdio->boundary) { ret =dio_send_cur_page (dio, sdio, map_bh); -dio_bio_submit (dio, sdio); +if (sdio->bio) +dio_bio_submit (dio, sdio);put_page (sdio->cur_page); sdio->cur_page =NULL ; }
fs/mpage.c +11 -3
@@ -468,6 +468,16 @@ static void clean_buffers(struct page *page, unsigned first_unmapped)try_to_free_buffers (page); } +/* +* For situations where we want to clean all buffers attached to a page. +* We don't need to calculate how many buffers are attached to the page, +* we just need to specify a number larger than the maximum number of buffers. +*/ +void clean_page_buffers (struct page *page) +{ +clean_buffers (page, ~0U ); +} +static int __mpage_writepage (struct page *page,struct writeback_control *wbc,void *data) {
@@ -605,10 +615,8 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc,if (bio ==NULL ) {if (first_unmapped == blocks_per_page) {if (!bdev_write_page (bdev, blocks[0 ] << (blkbits -9 ), - page, wbc)) { -clean_buffers (page, first_unmapped); + page, wbc)) goto out; - } } bio =mpage_alloc (bdev, blocks[0 ] << (blkbits -9 ),BIO_MAX_PAGES ,GFP_NOFS |__GFP_HIGH);
fs/nfs/client.c +1 -1
@@ -218,7 +218,6 @@ static void nfs_cb_idr_remove_locked(struct nfs_client *clp)static void pnfs_init_server (struct nfs_server *server) {rpc_init_wait_queue (&server->roc_rpcwaitq,"pNFS ROC" ); -rpc_init_wait_queue (&server->uoc_rpcwaitq,"NFS UOC" ); }#else
@@ -888,6 +887,7 @@ struct nfs_server *nfs_alloc_server(void)ida_init (&server->openowner_id);ida_init (&server->lockowner_id);pnfs_init_server (server); +rpc_init_wait_queue (&server->uoc_rpcwaitq,"NFS UOC" );return server; }
fs/nfs/filelayout/filelayout.c +2 -1
@@ -745,7 +745,8 @@ filelayout_free_lseg(struct pnfs_layout_segment *lseg)struct nfs4_filelayout_segment *fl =FILELAYOUT_LSEG (lseg);dprintk ("--> %s\n" , __func__); -nfs4_fl_put_deviceid (fl->dsaddr); +if (fl->dsaddr !=NULL ) +nfs4_fl_put_deviceid (fl->dsaddr);/* This assumes a single RW lseg */ if (lseg->pls_range.iomode ==IOMODE_RW ) {struct nfs4_filelayout *flo;
include/linux/buffer_head.h +1 -0
@@ -232,6 +232,7 @@ int generic_write_end(struct file *, struct address_space *, loff_t, unsigned, unsigned, struct page *, void *);void page_zero_new_buffers (struct page *page,unsigned from,unsigned to); +void clean_page_buffers (struct page *page);int cont_write_begin (struct file *,struct address_space *,loff_t ,unsigned ,unsigned ,struct page **,void **,get_block_t *,loff_t *);
include/sound/seq_virmidi.h +1 -0
@@ -60,6 +60,7 @@ struct snd_virmidi_dev {int port;/* created/attached port */ unsigned int flags;/* SNDRV_VIRMIDI_* */ rwlock_t filelist_lock; +struct rw_semaphore filelist_sem;struct list_head filelist; };
kernel/irq/chip.c +1 -1
@@ -265,8 +265,8 @@ int irq_startup(struct irq_desc *desc, bool resend, bool force)irq_setup_affinity (desc);break ;case IRQ_STARTUP_MANAGED : +irq_do_set_affinity (d, aff, false); ret =__irq_startup (desc); -irq_set_affinity_locked (d, aff, false);break ;case IRQ_STARTUP_ABORT :return 0 ;
kernel/irq/cpuhotplug.c +27 -1
@@ -18,8 +18,34 @@static inline bool irq_needs_fixup (struct irq_data *d) {const struct cpumask *m =irq_data_get_effective_affinity_mask (d); +unsigned int cpu =smp_processor_id (); -return cpumask_test_cpu (smp_processor_id (), m); +#ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK +/* +* The cpumask_empty() check is a workaround for interrupt chips, +* which do not implement effective affinity, but the architecture has +* enabled the config switch. Use the general affinity mask instead. +*/ +if (cpumask_empty (m)) + m =irq_data_get_affinity_mask (d); + +/* +* Sanity check. If the mask is not empty when excluding the outgoing +* CPU then it must contain at least one online CPU. The outgoing CPU +* has been removed from the online mask already. +*/ +if (cpumask_any_but (m, cpu) < nr_cpu_ids && +cpumask_any_and (m, cpu_online_mask) >= nr_cpu_ids) { +/* +* If this happens then there was a missed IRQ fixup at some +* point. Warn about it and enforce fixup. +*/ +pr_warn ("Eff. affinity %*pbl of IRQ %u contains only offline CPUs after offlining CPU %u\n" , +cpumask_pr_args (m), d->irq, cpu); +return true; + } +#endif +return cpumask_test_cpu (cpu, m); }static bool migrate_one_irq (struct irq_desc *desc)
kernel/irq/manage.c +3 -0
@@ -175,6 +175,9 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,struct irq_chip *chip =irq_data_get_irq_chip (data);int ret; +if (!chip || !chip->irq_set_affinity) +return -EINVAL ; + ret = chip->irq_set_affinity (data, mask, force);switch (ret) {case IRQ_SET_MASK_OK :
mm/vmalloc.c +0 -6
@@ -1697,11 +1697,6 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,for (i =0 ; i < area->nr_pages; i++) {struct page *page; -if (fatal_signal_pending (current)) { - area->nr_pages = i; - goto fail_no_warn; - } -if (node ==NUMA_NO_NODE ) page =alloc_page (alloc_mask|highmem_mask);else
@@ -1725,7 +1720,6 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,warn_alloc (gfp_mask,NULL ,"vmalloc: allocation failure, allocated %ld of %ld bytes" , (area->nr_pages*PAGE_SIZE ), area->size); -fail_no_warn:vfree (area->addr);return NULL ; }
sound/core/seq/seq_clientmgr.c +5 -1
@@ -1259,6 +1259,7 @@ static int snd_seq_ioctl_create_port(struct snd_seq_client *client, void *arg)struct snd_seq_port_info *info = arg;struct snd_seq_client_port *port;struct snd_seq_port_callback *callback; +int port_idx;/* it is not allowed to create the port for an another client */ if (info->addr.client != client->number)
@@ -1269,7 +1270,9 @@ static int snd_seq_ioctl_create_port(struct snd_seq_client *client, void *arg)return -ENOMEM ;if (client->type ==USER_CLIENT && info->kernel) { -snd_seq_delete_port (client, port->addr.port); + port_idx = port->addr.port; +snd_seq_port_unlock (port); +snd_seq_delete_port (client, port_idx);return -EINVAL ; }if (client->type ==KERNEL_CLIENT ) {
@@ -1290,6 +1293,7 @@ static int snd_seq_ioctl_create_port(struct snd_seq_client *client, void *arg)snd_seq_set_port_info (port, info);snd_seq_system_client_ev_port_start (port->addr.client, port->addr.port); +snd_seq_port_unlock (port);return 0 ; }
sound/core/seq/seq_ports.c +5 -2
@@ -122,7 +122,9 @@ static void port_subs_info_init(struct snd_seq_port_subs_info *grp) } -/* create a port, port number is returned (-1 on failure) */ +/* create a port, port number is returned (-1 on failure); +* the caller needs to unref the port via snd_seq_port_unlock() appropriately +*/ struct snd_seq_client_port *snd_seq_create_port (struct snd_seq_client *client,int port) {
@@ -151,6 +153,7 @@ struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client,snd_use_lock_init (&new_port->use_lock);port_subs_info_init (&new_port->c_src);port_subs_info_init (&new_port->c_dest); +snd_use_lock_use (&new_port->use_lock); num = port >=0 ? port :0 ;mutex_lock (&client->ports_mutex);
@@ -165,9 +168,9 @@ struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client,list_add_tail (&new_port->list, &p->list); client->num_ports++; new_port->addr.port = num;/* store the port number in the port */ +sprintf (new_port->name,"port-%d" , num);write_unlock_irqrestore (&client->ports_lock, flags);mutex_unlock (&client->ports_mutex); -sprintf (new_port->name,"port-%d" , num);return new_port; }
sound/core/seq/seq_virmidi.c +19 -8
@@ -77,13 +77,17 @@ static void snd_virmidi_init_event(struct snd_virmidi *vmidi,* decode input event and put to read buffer of each opened file */ static int snd_virmidi_dev_receive_event (struct snd_virmidi_dev *rdev, -struct snd_seq_event *ev) +struct snd_seq_event *ev, +bool atomic) {struct snd_virmidi *vmidi;unsigned char msg[4 ];int len; -read_lock (&rdev->filelist_lock); +if (atomic) +read_lock (&rdev->filelist_lock); +else +down_read (&rdev->filelist_sem);list_for_each_entry (vmidi, &rdev->filelist, list) {if (!vmidi->trigger)continue ;
@@ -97,7 +101,10 @@ static int snd_virmidi_dev_receive_event(struct snd_virmidi_dev *rdev,snd_rawmidi_receive (vmidi->substream, msg, len); } } -read_unlock (&rdev->filelist_lock); +if (atomic) +read_unlock (&rdev->filelist_lock); +else +up_read (&rdev->filelist_sem);return 0 ; }
@@ -115,7 +122,7 @@ int snd_virmidi_receive(struct snd_rawmidi *rmidi, struct snd_seq_event *ev)struct snd_virmidi_dev *rdev; rdev = rmidi->private_data; - return snd_virmidi_dev_receive_event(rdev, ev); + return snd_virmidi_dev_receive_event(rdev, ev, true); }#endif /* 0 */
@@ -130,7 +137,7 @@ static int snd_virmidi_event_input(struct snd_seq_event *ev, int direct, rdev = private_data;if (!(rdev->flags &SNDRV_VIRMIDI_USE ))return 0 ;/* ignored */ -return snd_virmidi_dev_receive_event (rdev, ev); +return snd_virmidi_dev_receive_event (rdev, ev, atomic); }/*
@@ -209,7 +216,6 @@ static int snd_virmidi_input_open(struct snd_rawmidi_substream *substream)struct snd_virmidi_dev *rdev = substream->rmidi->private_data;struct snd_rawmidi_runtime *runtime = substream->runtime;struct snd_virmidi *vmidi; -unsigned long flags; vmidi =kzalloc (sizeof (*vmidi),GFP_KERNEL );if (vmidi ==NULL )
@@ -223,9 +229,11 @@ static int snd_virmidi_input_open(struct snd_rawmidi_substream *substream) vmidi->client = rdev->client; vmidi->port = rdev->port; runtime->private_data = vmidi; -write_lock_irqsave (&rdev->filelist_lock, flags); +down_write (&rdev->filelist_sem); +write_lock_irq (&rdev->filelist_lock);list_add_tail (&vmidi->list, &rdev->filelist); -write_unlock_irqrestore (&rdev->filelist_lock, flags); +write_unlock_irq (&rdev->filelist_lock); +up_write (&rdev->filelist_sem); vmidi->rdev = rdev;return 0 ; }
@@ -264,9 +272,11 @@ static int snd_virmidi_input_close(struct snd_rawmidi_substream *substream)struct snd_virmidi_dev *rdev = substream->rmidi->private_data;struct snd_virmidi *vmidi = substream->runtime->private_data; +down_write (&rdev->filelist_sem);write_lock_irq (&rdev->filelist_lock);list_del (&vmidi->list);write_unlock_irq (&rdev->filelist_lock); +up_write (&rdev->filelist_sem);snd_midi_event_free (vmidi->parser); substream->runtime->private_data =NULL ;kfree (vmidi);
@@ -520,6 +530,7 @@ int snd_virmidi_new(struct snd_card *card, int device, struct snd_rawmidi **rrmi rdev->rmidi = rmidi; rdev->device = device; rdev->client =-1 ; +init_rwsem (&rdev->filelist_sem);rwlock_init (&rdev->filelist_lock);INIT_LIST_HEAD (&rdev->filelist); rdev->seq_mode =SNDRV_VIRMIDI_SEQ_DISPATCH ;
sound/usb/caiaq/device.c +9 -3
@@ -469,10 +469,12 @@ static int init_card(struct snd_usb_caiaqdev *cdev) err =snd_usb_caiaq_send_command (cdev,EP1_CMD_GET_DEVICE_INFO ,NULL ,0 );if (err) -return err; + goto err_kill_urb; -if (!wait_event_timeout (cdev->ep1_wait_queue, cdev->spec_received,HZ )) -return -ENODEV ; +if (!wait_event_timeout (cdev->ep1_wait_queue, cdev->spec_received,HZ )) { + err = -ENODEV ; + goto err_kill_urb; + }usb_string (usb_dev, usb_dev->descriptor.iManufacturer, cdev->vendor_name,CAIAQ_USB_STR_LEN );
@@ -507,6 +509,10 @@ static int init_card(struct snd_usb_caiaqdev *cdev)setup_card (cdev);return 0 ; + + err_kill_urb: +usb_kill_urb (&cdev->ep1_in_urb); +return err; } static int snd_probe(struct usb_interface *intf,
sound/usb/line6/driver.c +4 -3
@@ -779,9 +779,10 @@ int line6_probe(struct usb_interface *interface,return 0 ; error: -if (line6->disconnect) - line6->disconnect (line6); -snd_card_free (card); +/* we can call disconnect callback here because no close-sync is +* needed yet at this point +*/ +line6_disconnect (interface);return ret; }EXPORT_SYMBOL_GPL (line6_probe);
sound/usb/line6/podhd.c +5 -3
@@ -301,7 +301,8 @@ static void podhd_disconnect(struct usb_line6 *line6) intf =usb_ifnum_to_if (line6->usbdev, pod->line6.properties->ctrl_if); -usb_driver_release_interface (&podhd_driver, intf); +if (intf) +usb_driver_release_interface (&podhd_driver, intf); } }
@@ -317,6 +318,9 @@ static int podhd_init(struct usb_line6 *line6, line6->disconnect = podhd_disconnect; +init_timer (&pod->startup_timer); +INIT_WORK (&pod->startup_work, podhd_startup_workqueue); +if (pod->line6.properties->capabilities &LINE6_CAP_CONTROL ) {/* claim the data interface */ intf = usb_ifnum_to_if(line6->usbdev,
@@ -358,8 +362,6 @@ static int podhd_init(struct usb_line6 *line6, }/* init device and delay registering */ -init_timer (&pod->startup_timer); -INIT_WORK (&pod->startup_work, podhd_startup_workqueue);podhd_startup (pod);return 0 ; }
sound/usb/mixer.c +10 -2
@@ -2228,6 +2228,9 @@ static int parse_audio_unit(struct mixer_build *state, int unitid)static void snd_usb_mixer_free (struct usb_mixer_interface *mixer) { +/* kill pending URBs */ +snd_usb_mixer_disconnect (mixer); +kfree (mixer->id_elems);if (mixer->urb) {kfree (mixer->urb->transfer_buffer);
@@ -2578,8 +2581,13 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,void snd_usb_mixer_disconnect (struct usb_mixer_interface *mixer) { -usb_kill_urb (mixer->urb); -usb_kill_urb (mixer->rc_urb); +if (mixer->disconnected) +return ; +if (mixer->urb) +usb_kill_urb (mixer->urb); +if (mixer->rc_urb) +usb_kill_urb (mixer->rc_urb); + mixer->disconnected = true; }#ifdef CONFIG_PM
sound/usb/mixer.h +2 -0
@@ -22,6 +22,8 @@ struct usb_mixer_interface {struct urb *rc_urb;struct usb_ctrlrequest *rc_setup_packet;u8 rc_buffer[6 ]; + +bool disconnected; };#define MAX_CHANNELS 16/* max logical channels */
tools/perf/builtin-script.c +2 -2
@@ -578,7 +578,7 @@ static void print_sample_brstack(struct perf_sample *sample,thread__find_addr_map (thread, sample->cpumode,MAP__FUNCTION , to, &alt); } -printf ("0x%" PRIx64, from); +printf (" 0x%" PRIx64, from);if (PRINT_FIELD (DSO )) {printf ("(" );map__fprintf_dsoname (alf.map, stdout);
@@ -673,7 +673,7 @@ static void print_sample_brstackoff(struct perf_sample *sample,if (alt.map && !alt.map->dso->adjust_symbols) to =map__map_ip (alt.map, to); -printf ("0x%" PRIx64, from); +printf (" 0x%" PRIx64, from);if (PRINT_FIELD (DSO )) {printf ("(" );map__fprintf_dsoname (alf.map, stdout);