Linux 4.4.191
Greg KH
maintainerI'm announcing the release of the 4.4.191 kernel.
All users of the 4.4 kernel series must upgrade.
The updated 4.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.4.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/kernel-parameters.txt | 7 Documentation/siphash.txt | 175 ++++++ MAINTAINERS | 7 Makefile | 2 arch/mips/kernel/i8253.c | 3 arch/x86/include/asm/bootparam_utils.h | 60 +- arch/x86/include/asm/msr-index.h | 1 arch/x86/include/asm/msr.h | 10 arch/x86/include/asm/nospec-branch.h | 2 arch/x86/include/asm/ptrace.h | 6 arch/x86/include/asm/suspend_32.h | 1 arch/x86/include/asm/suspend_64.h | 1 arch/x86/kernel/apic/apic.c | 72 ++ arch/x86/kernel/apic/bigsmp_32.c | 24 arch/x86/kernel/cpu/amd.c | 66 ++ arch/x86/kernel/ptrace.c | 3 arch/x86/kernel/uprobes.c | 17 arch/x86/kvm/x86.c | 9 arch/x86/power/cpu.c | 152 +++++ drivers/ata/libata-sff.c | 6 drivers/dma/ste_dma40.c | 4 drivers/hid/hid-tmff.c | 12 drivers/hid/wacom_wac.c | 2 drivers/hwtracing/stm/core.c | 1 drivers/isdn/hardware/mISDN/hfcsusb.c | 13 drivers/md/dm-bufio.c | 4 drivers/md/dm-table.c | 5 drivers/md/persistent-data/dm-btree.c | 31 - drivers/md/persistent-data/dm-space-map-metadata.c | 2 drivers/misc/vmw_vmci/vmci_doorbell.c | 6 drivers/mmc/core/sd.c | 6 drivers/mmc/host/sdhci-of-at91.c | 3 drivers/net/bonding/bond_main.c | 9 drivers/net/can/dev.c | 2 drivers/net/can/sja1000/peak_pcmcia.c | 2 drivers/net/can/usb/peak_usb/pcan_usb_core.c | 2 drivers/net/ethernet/arc/emac_main.c | 9 drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 5 drivers/net/ethernet/hisilicon/hip04_eth.c | 28 - drivers/net/usb/qmi_wwan.c | 1 drivers/nfc/st-nci/se.c | 2 drivers/nfc/st21nfca/se.c | 2 drivers/scsi/ufs/ufshcd.c | 3 drivers/usb/class/cdc-wdm.c | 16 drivers/usb/gadget/composite.c | 1 drivers/usb/host/fotg210-hcd.c | 4 drivers/usb/host/ohci-hcd.c | 15 drivers/usb/storage/realtek_cr.c | 15 drivers/usb/storage/unusual_devs.h | 2 drivers/vhost/net.c | 31 - drivers/vhost/scsi.c | 15 drivers/vhost/vhost.c | 20 drivers/vhost/vhost.h | 6 drivers/watchdog/bcm2835_wdt.c | 1 fs/gfs2/rgrp.c | 13 fs/nfs/nfs4_fs.h | 3 fs/nfs/nfs4client.c | 5 fs/nfs/nfs4state.c | 27 - fs/userfaultfd.c | 25 include/linux/siphash.h | 145 +++++ include/net/netfilter/nf_conntrack.h | 2 include/net/netns/ipv4.h | 2 include/net/tcp.h | 4 kernel/cgroup.c | 122 ++-- lib/Kconfig.debug | 10 lib/Makefile | 3 lib/siphash.c | 551 +++++++++++++++++++++ lib/test_siphash.c | 223 ++++++++ net/bridge/netfilter/ebtables.c | 4 net/core/stream.c | 16 net/ipv4/route.c | 12 net/ipv6/output_core.c | 30 - net/mac80211/cfg.c | 9 net/netfilter/nf_conntrack_core.c | 35 + net/netfilter/nf_conntrack_netlink.c | 34 + net/wireless/reg.c | 2 sound/core/seq/seq_clientmgr.c | 3 sound/core/seq/seq_fifo.c | 17 sound/core/seq/seq_fifo.h | 2 sound/soc/davinci/davinci-mcasp.c | 43 + sound/usb/mixer.c | 30 - tools/hv/hv_kvp_daemon.c | 2 tools/hv/hv_vss_daemon.c | 2 tools/perf/bench/numa.c | 6 tools/perf/tests/parse-events.c | 27 - tools/testing/selftests/kvm/config | 3 86 files changed, 2009 insertions(+), 307 deletions(-)
Aaron Armstrong Skomra (1):
HID: wacom: correct misreported EKR ring values
Adrian Hunter (1):
scsi: ufs: Fix NULL pointer dereference in ufshcd_config_vreg_hpm()
Adrian Vladu (1):
tools: hv: fix KVP and VSS daemons exit code
Alexander Kochetkov (1):
net: arc_emac: fix koops caused by sk_buff free
Arnd Bergmann (1):
dmaengine: ste_dma40: fix unneeded variable warning
Bandan Das (2):
x86/apic: Do not initialize LDR and DFR for bigsmp x86/apic: Include the LDR when clearing out APIC registers
Benjamin Herrenschmidt (1):
usb: gadget: composite: Clear "suspended" on reset/disconnect
Bob Ham (1):
net: usb: qmi_wwan: Add the BroadMobi BM818 card
Bob Peterson (1):
GFS2: don't set rgrp gl_object until it's inserted into rgrp tree
Chen Yu (1):
x86/pm: Introduce quirk framework to save/restore extra MSR registers around suspend/resume
Christophe JAILLET (1):
net: cxgb3_main: Fix a resource leak in a error path in 'init_one()'
Daniel Bristot de Oliveira (1):
cgroup: Disable IRQs while holding css_set_lock
Ding Xiang (1):
stm class: Fix a double free of stm_source_device
Dirk Morris (1):
netfilter: conntrack: Use consistent ct id hash calculation
Eric Dumazet (2):
inet: switch IP ID generator to siphash
tcp: make sure EPOLLOUT wont be missed
Eugen Hristev (1):
mmc: sdhci-of-at91: add quirk for broken HS200
Florian Westphal (1):
netfilter: ctnetlink: don't use conntrack/expect object addresses as id
Greg Kroah-Hartman (2):
x86/ptrace: fix up botched merge of spectrev1 fix Linux 4.4.191
Hans Ulli Kroll (1):
usb: host: fotg2: restart hcd after port reset
Henk van der Laan (1):
usb-storage: Add new JMS567 revision to unusual_devs
Hodaszi, Robert (1):
Revert "cfg80211: fix processing world regdomain when non modular"
Hui Peng (2):
ALSA: usb-audio: Fix a stack buffer overflow bug in check_input_term
ALSA: usb-audio: Fix an OOB bug in parse_audio_mixer_unit
Ilya Trukhanov (1):
HID: Add 044f:b320 ThrustMaster, Inc. 2 in 1 DT
Jason A. Donenfeld (2):
siphash: add cryptographically secure PRF
siphash: implement HalfSipHash1-3 for hash tables
Jason Wang (4):
vhost_net: introduce vhost_exceeds_weight()
vhost: introduce vhost_exceeds_weight()
vhost_net: fix possible infinite loop
vhost: scsi: add weight support
Jens Axboe (1):
libata: add SG safety checks in SFF pio transfers
Jia-Ju Bai (1):
isdn: mISDN: hfcsusb: Fix possible null-pointer dereferences in start_isoc_chain()
Jiangfeng Xiao (3):
net: hisilicon: make hip04_tx_reclaim non-reentrant
net: hisilicon: fix hip04-xmit never return TX_BUSY
net: hisilicon: Fix dma_map_single failed on arm64
Jiri Olsa (1):
perf bench numa: Fix cpu0 binding
Johannes Berg (1):
mac80211: fix possible sta leak
John Hubbard (2):
x86/boot: Save fields explicitly, zero out everything else x86/boot: Fix boot regression caused by bootparam sanitizing
Juliana Rodrigueiro (1):
isdn: hfcsusb: Fix mISDN driver crash caused by transfer buffer on the stack
Kai-Heng Feng (2):
USB: storage: ums-realtek: Update module parameter description for auto_delink_en
USB: storage: ums-realtek: Whitelist auto-delink support
Mikulas Patocka (2):
Revert "dm bufio: fix deadlock with loop device"
dm table: fix invalid memory accesses with too high sector number
Nadav Amit (1):
VMCI: Release resource if the work is already queued
Naresh Kamboju (1):
selftests: kvm: Adding config fragments
Navid Emamdoost (2):
st21nfca_connectivity_event_received: null check the allocation st_nci_hci_connectivity_event_received: null check the allocation
Oleg Nesterov (1):
userfaultfd_release: always remove uffd flags and clear vm_userfaultfd_ctx
Oliver Neukum (1):
USB: cdc-wdm: fix race between write and disconnect due to flag abuse
Paolo Abeni (1):
vhost_net: use packet weight for rx handler, too
Peter Ujfalusi (1):
ASoC: ti: davinci-mcasp: Correct slot_width posed constraint
Rasmus Villemoes (1):
can: dev: call netif_carrier_off() in register_candev()
Ricardo Neri (1):
ptrace,x86: Make user_64bit_mode() available to 32-bit builds
Sasha Levin (1):
Revert "perf test 6: Fix missing kvm module load for s390"
Sean Christopherson (2):
x86/retpoline: Don't clobber RFLAGS during CALL_NOSPEC on i386
KVM: x86: Don't update RIP or do single-step on faulting emulation
Sebastian Mayr (1):
uprobes/x86: Fix detection of 32-bit user mode
Stefan Wahren (1):
watchdog: bcm2835_wdt: Fix module autoload
Takashi Iwai (1):
ALSA: seq: Fix potential concurrent access to the deleted pool
Thomas Bogendoerfer (1):
MIPS: kernel: only use i8253 clocksource with periodic clockevent
Thomas Falcon (1):
bonding: Force slave speed check after link state recovery for 802.3ad
Thomas Gleixner (1):
x86/apic: Handle missing global clockevent gracefully
Tim Froidcoeur (1):
tcp: fix tcp_rtx_queue_tail in case of empty retransmit queue
Tom Lendacky (1):
x86/CPU/AMD: Clear RDRAND CPUID bit on AMD family 15h/16h
Trond Myklebust (1):
NFSv4: Fix a potential sleep while atomic in nfs4_do_reclaim()
Ulf Hansson (1):
mmc: core: Fix init of SD cards reporting an invalid VDD range
Wang Xiayang (2):
can: sja1000: force the string buffer NULL-terminated
can: peak_usb: force the string buffer NULL-terminated
Wenwen Wang (1):
netfilter: ebtables: fix a memory leak bug in compat
Yoshihiro Shimoda (1):
usb: host: ohci: fix a race condition between shutdown and irq
ZhangXiaoxu (2):
dm btree: fix order of block initialization in btree_split_beneath dm space map metadata: fix missing store of apply_bops() return value
haibinzhang(张海斌) (1):
vhost-net: set packet weight of tx polling to 2 * vq size
Greg KH
maintainerDocumentation/kernel-parameters.txt +7 -0
@@ -3415,6 +3415,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. Run specified binary instead of /init from the ramdisk, used for early userspace startup. See initrd. + rdrand= [X86] + force - Override the decision by the kernel to hide the + advertisement of RDRAND support (this affects + certain AMD processors because of buggy BIOS + support, specifically around the suspend/resume + path). + reboot= [KNL] Format (x86 or x86_64): [w[arm] | c[old] | h[ard] | s[oft] | g[pio]] \
Documentation/siphash.txt new file +175 -0
175 lines not on this page · raw message
MAINTAINERS +7 -0
@@ -9749,6 +9749,13 @@ F: arch/arm/mach-s3c24xx/mach-bast.c F: arch/arm/mach-s3c24xx/bast-ide.c F: arch/arm/mach-s3c24xx/bast-irq.c +SIPHASH PRF ROUTINES +M: Jason A. Donenfeld <[email protected]> +S: Maintained +F: lib/siphash.c +F: lib/test_siphash.c +F: include/linux/siphash.h + TI DAVINCI MACHINE SUPPORT M: Sekhar Nori <[email protected]> M: Kevin Hilman <[email protected]>
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 4 -SUBLEVEL = 190 +SUBLEVEL = 191 EXTRAVERSION = NAME = Blurry Fish Butt
arch/mips/kernel/i8253.c +2 -1
@@ -31,7 +31,8 @@ void __init setup_pit_timer(void)static int __init init_pit_clocksource (void ) { -if (num_possible_cpus () >1 )/* PIT does not scale! */ +if (num_possible_cpus () >1 ||/* PIT does not scale! */ + !clockevent_state_periodic (&i8253_clockevent))return 0 ;return clocksource_i8253_init ();
arch/x86/include/asm/bootparam_utils.h +47 -13
72 lines not on this page · raw message
arch/x86/include/asm/msr-index.h +1 -0
@@ -311,6 +311,7 @@#define MSR_AMD64_PATCH_LEVEL 0x0000008b#define MSR_AMD64_TSC_RATIO 0xc0000104#define MSR_AMD64_NB_CFG 0xc001001f +#define MSR_AMD64_CPUID_FN_1 0xc0011004#define MSR_AMD64_PATCH_LOADER 0xc0010020#define MSR_AMD64_OSVW_ID_LENGTH 0xc0010140#define MSR_AMD64_OSVW_STATUS 0xc0010141
arch/x86/include/asm/msr.h +10 -0
@@ -32,6 +32,16 @@ struct msr_regs_info {int err; }; +struct saved_msr { +bool valid; +struct msr_info info; +}; + +struct saved_msrs { +unsigned int num; +struct saved_msr *array; +}; +static inline unsigned long long native_read_tscp (unsigned int *aux) {unsigned long low, high;
arch/x86/include/asm/nospec-branch.h +1 -1
@@ -151,7 +151,7 @@" lfence;\n" \" jmp 902b;\n" \" .align 16\n" \ -"903: addl $4, %%esp;\n" \ +"903: lea 4(%%esp), %%esp;\n" \" pushl %[thunk_target];\n" \" ret;\n" \" .align 16\n" \
arch/x86/include/asm/ptrace.h +5 -1
@@ -121,9 +121,9 @@ static inline int v8086_mode(struct pt_regs *regs)#endif } -#ifdef CONFIG_X86_64 static inline bool user_64bit_mode (struct pt_regs *regs) { +#ifdef CONFIG_X86_64 #ifndef CONFIG_PARAVIRT /* * On non-paravirt systems, this is the only long mode CPL 3
@@ -134,8 +134,12 @@ static inline bool user_64bit_mode(struct pt_regs *regs)/* Headers are too twisted for this to go in paravirt.h. */ return regs->cs == __USER_CS || regs->cs == pv_info.extra_user_64bit_cs;#endif +#else /* !CONFIG_X86_64 */ +return false; +#endif } +#ifdef CONFIG_X86_64 #define current_user_stack_pointer () current_pt_regs()->sp#define compat_user_stack_pointer () current_pt_regs()->sp#endif
arch/x86/include/asm/suspend_32.h +1 -0
@@ -15,6 +15,7 @@ struct saved_context {unsigned long cr0, cr2, cr3, cr4;u64 misc_enable;bool misc_enable_saved; +struct saved_msrs saved_msrs;struct desc_ptr gdt_desc;struct desc_ptr idt;u16 ldt;
arch/x86/include/asm/suspend_64.h +1 -0
@@ -24,6 +24,7 @@ struct saved_context {unsigned long cr0, cr2, cr3, cr4, cr8;u64 misc_enable;bool misc_enable_saved; +struct saved_msrs saved_msrs;unsigned long efer;u16 gdt_pad;/* Unused */ struct desc_ptr gdt_desc;
arch/x86/kernel/apic/apic.c +57 -15
115 lines not on this page · raw message
arch/x86/kernel/apic/bigsmp_32.c +2 -22
@@ -37,32 +37,12 @@ static int bigsmp_early_logical_apicid(int cpu)return early_per_cpu (x86_cpu_to_apicid, cpu); } -static inline unsigned long calculate_ldr (int cpu) -{ -unsigned long val, id; - - val =apic_read (APIC_LDR ) & ~APIC_LDR_MASK ; - id =per_cpu (x86_bios_cpu_apicid, cpu); - val |=SET_APIC_LOGICAL_ID (id); - -return val; -} -/* -* Set up the logical destination ID. -* -* Intel recommends to set DFR, LDR and TPR before enabling -* an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel -* document number 292116). So here it goes... +* bigsmp enables physical destination mode +* and doesn't use LDR and DFR */ static void bigsmp_init_apic_ldr (void ) { -unsigned long val; -int cpu =smp_processor_id (); - -apic_write (APIC_DFR ,APIC_DFR_FLAT ); - val =calculate_ldr (cpu); -apic_write (APIC_LDR , val); }static void bigsmp_setup_apic_routing (void )
arch/x86/kernel/cpu/amd.c +66 -0
84 lines not on this page · raw message
arch/x86/kernel/ptrace.c +1 -2
@@ -698,11 +698,10 @@ static unsigned long ptrace_get_debugreg(struct task_struct *tsk, int n) {struct thread_struct *thread = &tsk->thread;unsigned long val =0 ; -int index = n;if (n <HBP_NUM ) { +int index =array_index_nospec (n,HBP_NUM );struct perf_event *bp = thread->ptrace_bps[index]; - index =array_index_nospec (index,HBP_NUM );if (bp) val = bp->hw.info.address;
arch/x86/kernel/uprobes.c +10 -7
@@ -514,9 +514,12 @@ struct uprobe_xol_ops {void (*abort)(struct arch_uprobe *,struct pt_regs *); }; -static inline int sizeof_long (void ) +static inline int sizeof_long (struct pt_regs *regs) { -return is_ia32_task () ?4 :8 ; +/* +* Check registers for mode as in_xxx_syscall() does not apply here. +*/ +return user_64bit_mode (regs) ?8 :4 ; }static int default_pre_xol_op (struct arch_uprobe *auprobe,struct pt_regs *regs)
@@ -527,9 +530,9 @@ static int default_pre_xol_op(struct arch_uprobe *auprobe, struct pt_regs *regs)static int push_ret_address (struct pt_regs *regs,unsigned long ip) { -unsigned long new_sp = regs->sp -sizeof_long (); +unsigned long new_sp = regs->sp -sizeof_long (regs); -if (copy_to_user ((void __user *)new_sp, &ip,sizeof_long ())) +if (copy_to_user ((void __user *)new_sp, &ip,sizeof_long (regs)))return -EFAULT ; regs->sp = new_sp;
@@ -562,7 +565,7 @@ static int default_post_xol_op(struct arch_uprobe *auprobe, struct pt_regs *regslong correction = utask->vaddr - utask->xol_vaddr; regs->ip += correction; }else if (auprobe->defparam.fixups &UPROBE_FIX_CALL ) { - regs->sp +=sizeof_long ();/* Pop incorrect return address */ + regs->sp +=sizeof_long (regs);/* Pop incorrect return address */ if (push_ret_address (regs, utask->vaddr + auprobe->defparam.ilen))return -ERESTART ; }
@@ -671,7 +674,7 @@ static int branch_post_xol_op(struct arch_uprobe *auprobe, struct pt_regs *regs)* "call" insn was executed out-of-line. Just restore ->sp and restart. * We could also restore ->ip and try to call branch_emulate_op() again. */ - regs->sp +=sizeof_long (); + regs->sp +=sizeof_long (regs);return -ERESTART ; }
@@ -962,7 +965,7 @@ bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)unsigned long arch_uretprobe_hijack_return_addr (unsigned long trampoline_vaddr,struct pt_regs *regs) { -int rasize =sizeof_long (), nleft; +int rasize =sizeof_long (regs), nleft;unsigned long orig_ret_vaddr =0 ;/* clear high bits for 32-bit apps */ if (copy_from_user (&orig_ret_vaddr, (void __user *)regs->sp, rasize))
arch/x86/kvm/x86.c +5 -4
@@ -5545,12 +5545,13 @@ restart:unsigned long rflags = kvm_x86_ops->get_rflags (vcpu);toggle_interruptibility (vcpu, ctxt->interruptibility); vcpu->arch.emulate_regs_need_sync_to_vcpu = false; -kvm_rip_write (vcpu, ctxt->eip); -if (r ==EMULATE_DONE && ctxt->tf) -kvm_vcpu_do_singlestep (vcpu, &r);if (!ctxt->have_exception || -exception_type (ctxt->exception.vector) ==EXCPT_TRAP ) +exception_type (ctxt->exception.vector) ==EXCPT_TRAP ) { +kvm_rip_write (vcpu, ctxt->eip); +if (r ==EMULATE_DONE && ctxt->tf) +kvm_vcpu_do_singlestep (vcpu, &r);__kvm_set_rflags (vcpu, ctxt->eflags); + }/* * For STI, interrupts are shadowed; so KVM_REQ_EVENT will
arch/x86/power/cpu.c +152 -0
185 lines not on this page · raw message
drivers/ata/libata-sff.c +6 -0
@@ -703,6 +703,10 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)unsigned int offset;unsigned char *buf; +if (!qc->cursg) { + qc->curbytes = qc->nbytes; +return ; + }if (qc->curbytes == qc->nbytes - qc->sect_size) ap->hsm_task_state =HSM_ST_LAST ;
@@ -742,6 +746,8 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)if (qc->cursg_ofs == qc->cursg->length) { qc->cursg =sg_next (qc->cursg); +if (!qc->cursg) + ap->hsm_task_state =HSM_ST_LAST ; qc->cursg_ofs =0 ; } }
drivers/dma/ste_dma40.c +2 -2
@@ -142,7 +142,7 @@ enum d40_events {* when the DMA hw is powered off. * TODO: Add save/restore of D40_DREG_GCC on dma40 v3 or later, if that works. */ -static u32 d40_backup_regs[] = { +static __maybe_unused u32 d40_backup_regs[] = {D40_DREG_LCPA ,D40_DREG_LCLA ,D40_DREG_PRMSE ,
@@ -211,7 +211,7 @@ static u32 d40_backup_regs_v4b[] = {#define BACKUP_REGS_SZ_V4B ARRAY_SIZE(d40_backup_regs_v4b) -static u32 d40_backup_regs_chan[] = { +static __maybe_unused u32 d40_backup_regs_chan[] = {D40_CHAN_REG_SSCFG ,D40_CHAN_REG_SSELT ,D40_CHAN_REG_SSPTR ,
drivers/hid/hid-tmff.c +12 -0
@@ -34,6 +34,8 @@#include "hid-ids.h" +#define THRUSTMASTER_DEVICE_ID_2_IN_1_DT 0xb320 +static const signed short ff_rumble[] = {FF_RUMBLE ,-1
@@ -88,6 +90,7 @@ static int tmff_play(struct input_dev *dev, void *data,struct hid_field *ff_field = tmff->ff_field;int x, y;int left, right;/* Rumbling */ +int motor_swap;switch (effect->type) {case FF_CONSTANT :
@@ -112,6 +115,13 @@ static int tmff_play(struct input_dev *dev, void *data, ff_field->logical_minimum, ff_field->logical_maximum); +/* 2-in-1 strong motor is left */ +if (hid->product ==THRUSTMASTER_DEVICE_ID_2_IN_1_DT ) { + motor_swap = left; + left = right; + right = motor_swap; + } +dbg_hid ("(left,right)=(%08x, %08x)\n" , left, right); ff_field->value[0 ] = left; ff_field->value[1 ] = right;
@@ -238,6 +248,8 @@ static const struct hid_device_id tm_devices[] = { .driver_data = (unsigned long)ff_rumble }, { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304), /* FireStorm Dual Power 2 (and 3) */ .driver_data = (unsigned long)ff_rumble }, + { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, THRUSTMASTER_DEVICE_ID_2_IN_1_DT), /* Dual Trigger 2-in-1 */ + .driver_data = (unsigned long)ff_rumble }, { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323), /* Dual Trigger 3-in-1 (PC Mode) */ .driver_data = (unsigned long)ff_rumble }, { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb324), /* Dual Trigger 3-in-1 (PS3 Mode) */
drivers/hid/wacom_wac.c +1 -1
@@ -674,7 +674,7 @@ static int wacom_remote_irq(struct wacom_wac *wacom_wac, size_t len)input_report_key (input,BTN_BASE2 , (data[11 ] &0x02 ));if (data[12 ] &0x80 ) -input_report_abs (input,ABS_WHEEL , (data[12 ] &0x7f )); +input_report_abs (input,ABS_WHEEL , (data[12 ] &0x7f ) -1 );else input_report_abs (input,ABS_WHEEL ,0 );
drivers/hwtracing/stm/core.c +0 -1
@@ -1020,7 +1020,6 @@ int stm_source_register_device(struct device *parent, err:put_device (&src->dev); -kfree (src);return err; }
drivers/isdn/hardware/mISDN/hfcsusb.c +12 -1
@@ -1402,6 +1402,7 @@ start_isoc_chain(struct usb_fifo *fifo, int num_packets_per_urb,printk (KERN_DEBUG "%s: %s: alloc urb for fifo %i failed" , hw->name, __func__, fifo->fifonum); +continue ; } fifo->iso[i].owner_fifo = (struct usb_fifo *) fifo; fifo->iso[i].indx = i;
@@ -1700,13 +1701,23 @@ hfcsusb_stop_endpoint(struct hfcsusb *hw, int channel)static int setup_hfcsusb (struct hfcsusb *hw) { +void *dmabuf =kmalloc (sizeof (u_char),GFP_KERNEL );u_char b; +int ret;if (debug &DBG_HFC_CALL_TRACE )printk (KERN_DEBUG "%s: %s\n" , hw->name, __func__); +if (!dmabuf) +return -ENOMEM ; + + ret =read_reg_atomic (hw,HFCUSB_CHIP_ID , dmabuf); + +memcpy (&b, dmabuf,sizeof (u_char)); +kfree (dmabuf); +/* check the chip id */ -if (read_reg_atomic (hw,HFCUSB_CHIP_ID , &b) !=1 ) { +if (ret !=1 ) {printk (KERN_DEBUG "%s: %s: cannot read chip id\n" , hw->name, __func__);return 1 ;
drivers/md/dm-bufio.c +3 -1
@@ -1561,7 +1561,9 @@ dm_bufio_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)unsigned long freed; c = container_of(shrink, struct dm_bufio_client, shrinker); -if (!dm_bufio_trylock (c)) +if (sc->gfp_mask & __GFP_FS) +dm_bufio_lock (c); +else if (!dm_bufio_trylock (c))return SHRINK_STOP ; freed =__scan (c, sc->nr_to_scan, sc->gfp_mask);
drivers/md/dm-table.c +4 -1
@@ -1167,7 +1167,7 @@ void dm_table_event(struct dm_table *t) }EXPORT_SYMBOL (dm_table_event); -sector_t dm_table_get_size (struct dm_table *t) +inline sector_t dm_table_get_size (struct dm_table *t) {return t->num_targets ? (t->highs[t->num_targets -1 ] +1 ) :0 ; }
@@ -1192,6 +1192,9 @@ struct dm_target *dm_table_find_target(struct dm_table *t, sector_t sector)unsigned int l, n =0 , k =0 ;sector_t *node; +if (unlikely (sector >=dm_table_get_size (t))) +return &t->targets[t->num_targets]; +for (l =0 ; l < t->depth; l++) { n =get_child (n, k); node =get_node (t, l, n);
drivers/md/persistent-data/dm-btree.c +16 -15
@@ -616,39 +616,40 @@ static int btree_split_beneath(struct shadow_spine *s, uint64_t key) new_parent =shadow_current (s); + pn =dm_block_data (new_parent); + size =le32_to_cpu (pn->header.flags) &INTERNAL_NODE ? +sizeof (__le64) : s->info->value_type.size; + +/* create & init the left block */ r =new_block (s->info, &left);if (r <0 )return r; + ln =dm_block_data (left); + nr_left =le32_to_cpu (pn->header.nr_entries) /2 ; + + ln->header.flags = pn->header.flags; + ln->header.nr_entries =cpu_to_le32 (nr_left); + ln->header.max_entries = pn->header.max_entries; + ln->header.value_size = pn->header.value_size; +memcpy (ln->keys, pn->keys, nr_left *sizeof (pn->keys[0 ])); +memcpy (value_ptr (ln,0 ),value_ptr (pn,0 ), nr_left * size); + +/* create & init the right block */ r =new_block (s->info, &right);if (r <0 ) {unlock_block (s->info, left);return r; } - pn =dm_block_data (new_parent); - ln =dm_block_data (left); rn =dm_block_data (right); - - nr_left =le32_to_cpu (pn->header.nr_entries) /2 ; nr_right =le32_to_cpu (pn->header.nr_entries) - nr_left; - ln->header.flags = pn->header.flags; - ln->header.nr_entries =cpu_to_le32 (nr_left); - ln->header.max_entries = pn->header.max_entries; - ln->header.value_size = pn->header.value_size; - rn->header.flags = pn->header.flags; rn->header.nr_entries =cpu_to_le32 (nr_right); rn->header.max_entries = pn->header.max_entries; rn->header.value_size = pn->header.value_size; - -memcpy (ln->keys, pn->keys, nr_left *sizeof (pn->keys[0 ]));memcpy (rn->keys, pn->keys + nr_left, nr_right *sizeof (pn->keys[0 ])); - - size =le32_to_cpu (pn->header.flags) &INTERNAL_NODE ? -sizeof (__le64) : s->info->value_type.size; -memcpy (value_ptr (ln,0 ),value_ptr (pn,0 ), nr_left * size);memcpy (value_ptr (rn,0 ),value_ptr (pn, nr_left), nr_right * size);
drivers/md/persistent-data/dm-space-map-metadata.c +1 -1
@@ -248,7 +248,7 @@ static int out(struct sm_metadata *smm) }if (smm->recursion_count ==1 ) -apply_bops (smm); + r =apply_bops (smm); smm->recursion_count--;
drivers/misc/vmw_vmci/vmci_doorbell.c +4 -2
@@ -318,7 +318,8 @@ int vmci_dbell_host_context_notify(u32 src_cid, struct vmci_handle handle) entry = container_of(resource, struct dbell_entry, resource);if (entry->run_delayed) { -schedule_work (&entry->work); +if (!schedule_work (&entry->work)) +vmci_resource_put (resource); }else { entry->notify_cb (entry->client_data);vmci_resource_put (resource);
@@ -366,7 +367,8 @@ static void dbell_fire_entries(u32 notify_idx) atomic_read(&dbell->active) == 1) {if (dbell->run_delayed) {vmci_resource_get (&dbell->resource); -schedule_work (&dbell->work); +if (!schedule_work (&dbell->work)) +vmci_resource_put (&dbell->resource); }else { dbell->notify_cb (dbell->client_data); }
drivers/mmc/core/sd.c +6 -0
@@ -1232,6 +1232,12 @@ int mmc_attach_sd(struct mmc_host *host) goto err; } +/* +* Some SD cards claims an out of spec VDD voltage range. Let's treat +* these bits as being in-valid and especially also bit7. +*/ + ocr &= ~0x7FFF ; + rocr =mmc_select_voltage (host, ocr);/*
drivers/mmc/host/sdhci-of-at91.c +3 -0
@@ -144,6 +144,9 @@ static int sdhci_at91_probe(struct platform_device *pdev)sdhci_get_of_property (pdev); +/* HS200 is broken at this moment */ + host->quirks2 =SDHCI_QUIRK2_BROKEN_HS200 ; + ret =sdhci_add_host (host);if (ret) goto clocks_disable_unprepare;
drivers/net/bonding/bond_main.c +9 -0
@@ -2081,6 +2081,15 @@ static void bond_miimon_commit(struct bonding *bond)bond_for_each_slave (bond, slave, iter) {switch (slave->new_link) {case BOND_LINK_NOCHANGE : +/* For 802.3ad mode, check current slave speed and +* duplex again in case its port was disabled after +* invalid speed/duplex reporting but recovered before +* link monitoring could make a decision on the actual +* link status +*/ +if (BOND_MODE (bond) ==BOND_MODE_8023AD && + slave->link ==BOND_LINK_UP ) +bond_3ad_adapter_speed_duplex_changed (slave);continue ;case BOND_LINK_UP :
drivers/net/can/dev.c +2 -0
@@ -1065,6 +1065,8 @@ static struct rtnl_link_ops can_link_ops __read_mostly = {int register_candev (struct net_device *dev) { dev->rtnl_link_ops = &can_link_ops; +netif_carrier_off (dev); +return register_netdev (dev); }EXPORT_SYMBOL_GPL (register_candev);
drivers/net/can/sja1000/peak_pcmcia.c +1 -1
@@ -487,7 +487,7 @@ static void pcan_free_channels(struct pcan_pccard *card)if (!netdev)continue ; -strncpy (name, netdev->name,IFNAMSIZ ); +strlcpy (name, netdev->name,IFNAMSIZ );unregister_sja1000dev (netdev);
drivers/net/can/usb/peak_usb/pcan_usb_core.c +1 -1
@@ -881,7 +881,7 @@ static void peak_usb_disconnect(struct usb_interface *intf) dev_prev_siblings = dev->prev_siblings; dev->state &= ~PCAN_USB_STATE_CONNECTED ; -strncpy (name, netdev->name,IFNAMSIZ ); +strlcpy (name, netdev->name,IFNAMSIZ );unregister_netdev (netdev);
drivers/net/ethernet/arc/emac_main.c +7 -2
@@ -163,7 +163,7 @@ static void arc_emac_tx_clean(struct net_device *ndev)struct sk_buff *skb = tx_buff->skb;unsigned int info =le32_to_cpu (txbd->info); -if ((info &FOR_EMAC ) || !txbd->data) +if ((info &FOR_EMAC ) || !txbd->data || !skb)break ;if (unlikely (info & (DROP |DEFR |LTCL |UFLO ))) {
@@ -191,6 +191,7 @@ static void arc_emac_tx_clean(struct net_device *ndev) txbd->data =0 ; txbd->info =0 ; + tx_buff->skb =NULL ; *txbd_dirty = (*txbd_dirty +1 ) %TX_BD_NUM ; }
@@ -619,7 +620,6 @@ static int arc_emac_tx(struct sk_buff *skb, struct net_device *ndev)dma_unmap_addr_set (&priv->tx_buff[*txbd_curr], addr, addr);dma_unmap_len_set (&priv->tx_buff[*txbd_curr], len, len); - priv->tx_buff[*txbd_curr].skb = skb; priv->txbd[*txbd_curr].data =cpu_to_le32 (addr);/* Make sure pointer to data buffer is set */
@@ -629,6 +629,11 @@ static int arc_emac_tx(struct sk_buff *skb, struct net_device *ndev) *info =cpu_to_le32 (FOR_EMAC |FIRST_OR_LAST_MASK | len); +/* Make sure info word is set */ +wmb (); + + priv->tx_buff[*txbd_curr].skb = skb; +/* Increment index to point to the next BD */ *txbd_curr = (*txbd_curr +1 ) %TX_BD_NUM ;
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +4 -1
@@ -3260,7 +3260,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)if (!adapter->regs) {dev_err (&pdev->dev,"cannot map device registers\n" ); err = -ENOMEM ; - goto out_free_adapter; + goto out_free_adapter_nofail; } adapter->pdev = pdev;
@@ -3378,6 +3378,9 @@ out_free_dev:if (adapter->port[i])free_netdev (adapter->port[i]); +out_free_adapter_nofail: +kfree_skb (adapter->nofail_skb); + out_free_adapter:kfree (adapter);
drivers/net/ethernet/hisilicon/hip04_eth.c +16 -12
@@ -157,6 +157,7 @@ struct hip04_priv {unsigned int reg_inten;struct napi_struct napi; +struct device *dev;struct net_device *ndev;struct tx_desc *tx_desc;
@@ -185,7 +186,7 @@ struct hip04_priv {static inline unsigned int tx_count (unsigned int head,unsigned int tail) { -return (head - tail) % (TX_DESC_NUM -1 ); +return (head - tail) %TX_DESC_NUM ; }static void hip04_config_port (struct net_device *ndev,u32 speed,u32 duplex)
@@ -387,7 +388,7 @@ static int hip04_tx_reclaim(struct net_device *ndev, bool force) }if (priv->tx_phys[tx_tail]) { -dma_unmap_single (&ndev->dev, priv->tx_phys[tx_tail], +dma_unmap_single (priv->dev, priv->tx_phys[tx_tail], priv->tx_skb[tx_tail]->len,DMA_TO_DEVICE ); priv->tx_phys[tx_tail] =0 ;
@@ -437,8 +438,8 @@ static int hip04_mac_start_xmit(struct sk_buff *skb, struct net_device *ndev)return NETDEV_TX_BUSY ; } - phys =dma_map_single (&ndev->dev, skb->data, skb->len,DMA_TO_DEVICE ); -if (dma_mapping_error (&ndev->dev, phys)) { + phys =dma_map_single (priv->dev, skb->data, skb->len,DMA_TO_DEVICE ); +if (dma_mapping_error (priv->dev, phys)) {dev_kfree_skb (skb);return NETDEV_TX_OK ; }
@@ -497,13 +498,16 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget)u16 len;u32 err; +/* clean up tx descriptors */ + tx_remaining =hip04_tx_reclaim (ndev, false); +while (cnt && !last) { buf = priv->rx_buf[priv->rx_head]; skb =build_skb (buf, priv->rx_buf_size);if (unlikely (!skb))net_dbg_ratelimited ("build_skb failed\n" ); -dma_unmap_single (&ndev->dev, priv->rx_phys[priv->rx_head], +dma_unmap_single (priv->dev, priv->rx_phys[priv->rx_head],RX_BUF_SIZE ,DMA_FROM_DEVICE ); priv->rx_phys[priv->rx_head] =0 ;
@@ -531,9 +535,9 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget) buf =netdev_alloc_frag (priv->rx_buf_size);if (!buf) goto done; - phys =dma_map_single (&ndev->dev, buf, + phys =dma_map_single (priv->dev, buf,RX_BUF_SIZE ,DMA_FROM_DEVICE ); -if (dma_mapping_error (&ndev->dev, phys)) +if (dma_mapping_error (priv->dev, phys)) goto done; priv->rx_buf[priv->rx_head] = buf; priv->rx_phys[priv->rx_head] = phys;
@@ -554,8 +558,7 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget) }napi_complete (napi); done: -/* clean up tx descriptors and start a new timer if necessary */ - tx_remaining =hip04_tx_reclaim (ndev, false); +/* start a new timer if necessary */ if (rx < budget && tx_remaining)hip04_start_tx_timer (priv);
@@ -637,9 +640,9 @@ static int hip04_mac_open(struct net_device *ndev)for (i =0 ; i <RX_DESC_NUM ; i++) {dma_addr_t phys; - phys =dma_map_single (&ndev->dev, priv->rx_buf[i], + phys =dma_map_single (priv->dev, priv->rx_buf[i],RX_BUF_SIZE ,DMA_FROM_DEVICE ); -if (dma_mapping_error (&ndev->dev, phys)) +if (dma_mapping_error (priv->dev, phys))return -EIO ; priv->rx_phys[i] = phys;
@@ -673,7 +676,7 @@ static int hip04_mac_stop(struct net_device *ndev)for (i =0 ; i <RX_DESC_NUM ; i++) {if (priv->rx_phys[i]) { -dma_unmap_single (&ndev->dev, priv->rx_phys[i], +dma_unmap_single (priv->dev, priv->rx_phys[i],RX_BUF_SIZE ,DMA_FROM_DEVICE ); priv->rx_phys[i] =0 ; }
@@ -824,6 +827,7 @@ static int hip04_mac_probe(struct platform_device *pdev)return -ENOMEM ; priv =netdev_priv (ndev); + priv->dev = d; priv->ndev = ndev;platform_set_drvdata (pdev, ndev);
drivers/net/usb/qmi_wwan.c +1 -0
@@ -719,6 +719,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x2001, 0x7e35, 4)}, /* D-Link DWM-222 */ {QMI_FIXED_INTF(0x2020, 0x2031, 4)}, /* Olicard 600 */ {QMI_FIXED_INTF(0x2020, 0x2033, 4)}, /* BroadMobi BM806U */ + {QMI_FIXED_INTF(0x2020, 0x2060, 4)}, /* BroadMobi BM818 */ {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */ {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */ {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */
drivers/nfc/st-nci/se.c +2 -0
@@ -346,6 +346,8 @@ static int st_nci_hci_connectivity_event_received(struct nci_dev *ndev, transaction = (struct nfc_evt_transaction *)devm_kzalloc (dev, skb->len -2 ,GFP_KERNEL ); +if (!transaction) +return -ENOMEM ; transaction->aid_len = skb->data[1 ];memcpy (transaction->aid, &skb->data[2 ], transaction->aid_len);
drivers/nfc/st21nfca/se.c +2 -0
@@ -327,6 +327,8 @@ int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, transaction = (struct nfc_evt_transaction *)devm_kzalloc (dev, skb->len -2 ,GFP_KERNEL ); +if (!transaction) +return -ENOMEM ; transaction->aid_len = skb->data[1 ]; memcpy(transaction->aid, &skb->data[2],
drivers/scsi/ufs/ufshcd.c +3 -0
@@ -4418,6 +4418,9 @@ static inline int ufshcd_config_vreg_lpm(struct ufs_hba *hba,static inline int ufshcd_config_vreg_hpm (struct ufs_hba *hba,struct ufs_vreg *vreg) { +if (!vreg) +return 0 ; +return ufshcd_config_vreg_load (hba->dev, vreg, vreg->max_uA); }
drivers/usb/class/cdc-wdm.c +12 -4
@@ -577,10 +577,20 @@ static int wdm_flush(struct file *file, fl_owner_t id) {struct wdm_device *desc = file->private_data; -wait_event (desc->wait, !test_bit (WDM_IN_USE , &desc->flags)); +wait_event (desc->wait, +/* +* needs both flags. We cannot do with one +* because resetting it would cause a race +* with write() yet we need to signal +* a disconnect +*/ + !test_bit (WDM_IN_USE , &desc->flags) || +test_bit (WDM_DISCONNECTING , &desc->flags));/* cannot dereference desc->intf if WDM_DISCONNECTING */ -if (desc->werr <0 && !test_bit (WDM_DISCONNECTING , &desc->flags)) +if (test_bit (WDM_DISCONNECTING , &desc->flags)) +return -ENODEV ; +if (desc->werr <0 )dev_err (&desc->intf->dev,"Error in flush path: %d\n" , desc->werr);
@@ -968,8 +978,6 @@ static void wdm_disconnect(struct usb_interface *intf)spin_lock_irqsave (&desc->iuspin, flags);set_bit (WDM_DISCONNECTING , &desc->flags);set_bit (WDM_READ , &desc->flags); -/* to terminate pending flushes */ -clear_bit (WDM_IN_USE , &desc->flags);spin_unlock_irqrestore (&desc->iuspin, flags);wake_up_all (&desc->wait);mutex_lock (&desc->rlock);
drivers/usb/gadget/composite.c +1 -0
@@ -1889,6 +1889,7 @@ void composite_disconnect(struct usb_gadget *gadget)* disconnect callbacks? */ spin_lock_irqsave (&cdev->lock, flags); + cdev->suspended =0 ;if (cdev->config)reset_config (cdev);if (cdev->driver->disconnect)
drivers/usb/host/fotg210-hcd.c +4 -0
@@ -1653,6 +1653,10 @@ static int fotg210_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,/* see what we found out */ temp =check_reset_complete (fotg210, wIndex, status_reg,fotg210_readl (fotg210, status_reg)); + +/* restart schedule */ + fotg210->command |=CMD_RUN ; +fotg210_writel (fotg210, fotg210->command, &fotg210->regs->command); }if (!(temp & (PORT_RESUME |PORT_RESET ))) {
drivers/usb/host/ohci-hcd.c +12 -3
@@ -415,8 +415,7 @@ static void ohci_usb_reset (struct ohci_hcd *ohci)* other cases where the next software may expect clean state from the * "firmware". this is bus-neutral, unlike shutdown() methods. */ -static void -ohci_shutdown (struct usb_hcd *hcd) +static void _ohci_shutdown (struct usb_hcd *hcd) {struct ohci_hcd *ohci;
@@ -432,6 +431,16 @@ ohci_shutdown (struct usb_hcd *hcd) ohci->rh_state =OHCI_RH_HALTED ; } +static void ohci_shutdown (struct usb_hcd *hcd) +{ +struct ohci_hcd *ohci =hcd_to_ohci (hcd); +unsigned long flags; + +spin_lock_irqsave (&ohci->lock, flags); +_ohci_shutdown (hcd); +spin_unlock_irqrestore (&ohci->lock, flags); +} +/*-------------------------------------------------------------------------* * HC functions *-------------------------------------------------------------------------*/
@@ -750,7 +759,7 @@ static void io_watchdog_func(unsigned long _ohci) died:usb_hc_died (ohci_to_hcd (ohci));ohci_dump (ohci); -ohci_shutdown (ohci_to_hcd (ohci)); +_ohci_shutdown (ohci_to_hcd (ohci)); goto done; }else {/* No write back because the done queue was empty */
drivers/usb/storage/realtek_cr.c +9 -6
@@ -50,7 +50,7 @@ MODULE_VERSION("1.03");static int auto_delink_en =1 ;module_param (auto_delink_en, int,S_IRUGO |S_IWUSR ); -MODULE_PARM_DESC (auto_delink_en,"enable auto delink" ); +MODULE_PARM_DESC (auto_delink_en,"auto delink mode (0=firmware, 1=software [default])" );#ifdef CONFIG_REALTEK_AUTOPM static int ss_en =1 ;
@@ -1006,12 +1006,15 @@ static int init_realtek_cr(struct us_data *us) goto INIT_FAIL; } -if (CHECK_FW_VER (chip,0x5888 ) ||CHECK_FW_VER (chip,0x5889 ) || -CHECK_FW_VER (chip,0x5901 )) -SET_AUTO_DELINK (chip); -if (STATUS_LEN (chip) ==16 ) { -if (SUPPORT_AUTO_DELINK (chip)) +if (CHECK_PID (chip,0x0138 ) ||CHECK_PID (chip,0x0158 ) || +CHECK_PID (chip,0x0159 )) { +if (CHECK_FW_VER (chip,0x5888 ) ||CHECK_FW_VER (chip,0x5889 ) || +CHECK_FW_VER (chip,0x5901 ))SET_AUTO_DELINK (chip); +if (STATUS_LEN (chip) ==16 ) { +if (SUPPORT_AUTO_DELINK (chip)) +SET_AUTO_DELINK (chip); + } }#ifdef CONFIG_REALTEK_AUTOPM if (ss_en)
drivers/usb/storage/unusual_devs.h +1 -1
@@ -2006,7 +2006,7 @@ UNUSUAL_DEV( 0x14cd, 0x6600, 0x0201, 0x0201, US_FL_IGNORE_RESIDUE ),/* Reported by Michael Büsch <[email protected]> */ -UNUSUAL_DEV( 0x152d, 0x0567, 0x0114, 0x0116, +UNUSUAL_DEV( 0x152d, 0x0567, 0x0114, 0x0117, "JMicron", "USB to ATA/ATAPI Bridge", USB_SC_DEVICE, USB_PR_DEVICE, NULL,
drivers/vhost/net.c +18 -13
@@ -39,6 +39,12 @@ MODULE_PARM_DESC(experimental_zcopytx, "Enable Zero Copy TX;"* Using this limit prevents one virtqueue from starving others. */ #define VHOST_NET_WEIGHT 0x80000 +/* Max number of packets transferred before requeueing the job. +* Using this limit prevents one virtqueue from starving others with small +* pkts. +*/ +#define VHOST_NET_PKT_WEIGHT 256 +/* MAX number of TX used buffers for outstanding zerocopy */ #define VHOST_MAX_PEND 128#define VHOST_GOODCOPY_LEN 256
@@ -308,6 +314,7 @@ static void handle_tx(struct vhost_net *net)struct socket *sock;struct vhost_net_ubuf_ref *uninitialized_var (ubufs );bool zcopy, zcopy_used; +int sent_pkts =0 ;mutex_lock (&vq->mutex); sock = vq->private_data;
@@ -319,7 +326,7 @@ static void handle_tx(struct vhost_net *net) hdr_size = nvq->vhost_hlen; zcopy = nvq->ubufs; -for (;;) { + do { /* Release DMAs done buffers first */ if (zcopy) vhost_zerocopy_signal_used(net, vq);
@@ -408,11 +415,7 @@ static void handle_tx(struct vhost_net *net)vhost_zerocopy_signal_used (net, vq); total_len += len;vhost_net_tx_packet (net); -if (unlikely (total_len >=VHOST_NET_WEIGHT )) { -vhost_poll_queue (&vq->poll); -break ; - } - } + }while (likely (!vhost_exceeds_weight (vq, ++sent_pkts, total_len))); out:mutex_unlock (&vq->mutex); }
@@ -539,6 +542,7 @@ static void handle_rx(struct vhost_net *net)struct socket *sock;struct iov_iter fixup;__virtio16 num_buffers; +int recv_pkts =0 ;mutex_lock (&vq->mutex); sock = vq->private_data;
@@ -553,7 +557,10 @@ static void handle_rx(struct vhost_net *net) vq->log : NULL; mergeable =vhost_has_feature (vq,VIRTIO_NET_F_MRG_RXBUF ); -while ((sock_len =peek_head_len (sock->sk))) { + do { + sock_len = peek_head_len(sock->sk); + if (!sock_len) + break; sock_len += sock_hlen; vhost_len = sock_len + vhost_hlen; headcount = get_rx_bufs(vq, vq->heads, vhost_len,
@@ -631,11 +638,8 @@ static void handle_rx(struct vhost_net *net)if (unlikely (vq_log))vhost_log_write (vq, vq_log, log, vhost_len); total_len += vhost_len; -if (unlikely (total_len >=VHOST_NET_WEIGHT )) { -vhost_poll_queue (&vq->poll); -break ; - } - } + }while (likely (!vhost_exceeds_weight (vq, ++recv_pkts, total_len))); + out:mutex_unlock (&vq->mutex); }
@@ -704,7 +708,8 @@ static int vhost_net_open(struct inode *inode, struct file *f) n->vqs[i].vhost_hlen =0 ; n->vqs[i].sock_hlen =0 ; } -vhost_dev_init (dev, vqs,VHOST_NET_VQ_MAX ); +vhost_dev_init (dev, vqs,VHOST_NET_VQ_MAX , +VHOST_NET_PKT_WEIGHT ,VHOST_NET_WEIGHT );vhost_poll_init (n->poll +VHOST_NET_VQ_TX , handle_tx_net,POLLOUT , dev);vhost_poll_init (n->poll +VHOST_NET_VQ_RX , handle_rx_net,POLLIN , dev);
drivers/vhost/scsi.c +11 -4
@@ -58,6 +58,12 @@#define VHOST_SCSI_PREALLOC_UPAGES 2048#define VHOST_SCSI_PREALLOC_PROT_SGLS 512 +/* Max number of requests before requeueing the job. +* Using this limit prevents one virtqueue from starving others with +* request. +*/ +#define VHOST_SCSI_WEIGHT 256 +struct vhost_scsi_inflight {/* Wait for the flush operation to finish */ struct completion comp;
@@ -855,7 +861,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)u64 tag;u32 exp_data_len, data_direction;unsigned out, in; -int head, ret, prot_bytes; +int head, ret, prot_bytes, c =0 ;size_t req_size, rsp_size =sizeof (struct virtio_scsi_cmd_resp );size_t out_size, in_size;u16 lun;
@@ -874,7 +880,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)vhost_disable_notify (&vs->dev, vq); -for (;;) { + do { head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), &out, &in, NULL, NULL);
@@ -1090,7 +1096,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)*/ INIT_WORK (&cmd->work, vhost_scsi_submission_work);queue_work (vhost_scsi_workqueue, &cmd->work); - } + }while (likely (!vhost_exceeds_weight (vq, ++c,0 ))); out:mutex_unlock (&vq->mutex); }
@@ -1443,7 +1449,8 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) vqs[i] = &vs->vqs[i].vq; vs->vqs[i].vq.handle_kick = vhost_scsi_handle_kick; } -vhost_dev_init (&vs->dev, vqs,VHOST_SCSI_MAX_VQ ); +vhost_dev_init (&vs->dev, vqs,VHOST_SCSI_MAX_VQ , +VHOST_SCSI_WEIGHT ,0 );vhost_scsi_init_inflight (vs,NULL );
drivers/vhost/vhost.c +19 -1
@@ -370,8 +370,24 @@ static void vhost_dev_free_iovecs(struct vhost_dev *dev)vhost_vq_free_iovecs (dev->vqs[i]); } +bool vhost_exceeds_weight (struct vhost_virtqueue *vq, +int pkts,int total_len) +{ +struct vhost_dev *dev = vq->dev; + +if ((dev->byte_weight && total_len >= dev->byte_weight) || + pkts >= dev->weight) { +vhost_poll_queue (&vq->poll); +return true; + } + +return false; +} +EXPORT_SYMBOL_GPL (vhost_exceeds_weight); +void vhost_dev_init (struct vhost_dev *dev, -struct vhost_virtqueue **vqs,int nvqs) +struct vhost_virtqueue **vqs,int nvqs, +int weight,int byte_weight) {struct vhost_virtqueue *vq;int i;
@@ -386,6 +402,8 @@ void vhost_dev_init(struct vhost_dev *dev,spin_lock_init (&dev->work_lock);INIT_LIST_HEAD (&dev->work_list); dev->worker =NULL ; + dev->weight = weight; + dev->byte_weight = byte_weight;for (i =0 ; i < dev->nvqs; ++i) { vq = dev->vqs[i];
drivers/vhost/vhost.h +5 -1
@@ -127,9 +127,13 @@ struct vhost_dev {spinlock_t work_lock;struct list_head work_list;struct task_struct *worker; +int weight; +int byte_weight; }; -void vhost_dev_init (struct vhost_dev *,struct vhost_virtqueue **vqs,int nvqs); +bool vhost_exceeds_weight (struct vhost_virtqueue *vq,int pkts,int total_len); +void vhost_dev_init (struct vhost_dev *,struct vhost_virtqueue **vqs, +int nvqs,int weight,int byte_weight);long vhost_dev_set_owner (struct vhost_dev *dev);bool vhost_dev_has_owner (struct vhost_dev *dev);long vhost_dev_check_owner (struct vhost_dev *);
drivers/watchdog/bcm2835_wdt.c +1 -0
@@ -248,6 +248,7 @@ module_param(nowayout, bool, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_ALIAS ("platform:bcm2835-wdt" );MODULE_AUTHOR ("Lubomir Rintel <[email protected]>" );MODULE_DESCRIPTION ("Driver for Broadcom BCM2835 watchdog timer" );MODULE_LICENSE ("GPL" );
fs/gfs2/rgrp.c +8 -5
@@ -739,6 +739,7 @@ void gfs2_clear_rgrpd(struct gfs2_sbd *sdp)gfs2_free_clones (rgd);kfree (rgd->rd_bits); + rgd->rd_bits =NULL ;return_all_reservations (rgd);kmem_cache_free (gfs2_rgrpd_cachep, rgd); }
@@ -933,10 +934,6 @@ static int read_rindex_entry(struct gfs2_inode *ip)if (error) goto fail; - rgd->rd_gl->gl_object = rgd; - rgd->rd_gl->gl_vm.start = (rgd->rd_addr * bsize) &PAGE_CACHE_MASK ; - rgd->rd_gl->gl_vm.end =PAGE_CACHE_ALIGN ((rgd->rd_addr + - rgd->rd_length) * bsize) -1 ; rgd->rd_rgl = (struct gfs2_rgrp_lvb *)rgd->rd_gl->gl_lksb.sb_lvbptr; rgd->rd_flags &= ~(GFS2_RDF_UPTODATE |GFS2_RDF_PREFERRED );if (rgd->rd_data > sdp->sd_max_rg_data)
@@ -944,14 +941,20 @@ static int read_rindex_entry(struct gfs2_inode *ip)spin_lock (&sdp->sd_rindex_spin); error =rgd_insert (rgd);spin_unlock (&sdp->sd_rindex_spin); -if (!error) +if (!error) { + rgd->rd_gl->gl_object = rgd; + rgd->rd_gl->gl_vm.start = (rgd->rd_addr * bsize) &PAGE_MASK ; + rgd->rd_gl->gl_vm.end =PAGE_ALIGN ((rgd->rd_addr + + rgd->rd_length) * bsize) -1 ;return 0 ; + } error =0 ;/* someone else read in the rgrp; free it and ignore it */ gfs2_glock_put (rgd->rd_gl); fail:kfree (rgd->rd_bits); + rgd->rd_bits =NULL ;kmem_cache_free (gfs2_rgrpd_cachep, rgd);return error; }
fs/nfs/nfs4_fs.h +2 -1
@@ -416,7 +416,8 @@ static inline void nfs4_schedule_session_recovery(struct nfs4_session *session,extern struct nfs4_state_owner *nfs4_get_state_owner (struct nfs_server *,struct rpc_cred *,gfp_t );extern void nfs4_put_state_owner (struct nfs4_state_owner *); -extern void nfs4_purge_state_owners (struct nfs_server *); +extern void nfs4_purge_state_owners (struct nfs_server *,struct list_head *); +extern void nfs4_free_state_owners (struct list_head *head);extern struct nfs4_state *nfs4_get_open_state (struct inode *,struct nfs4_state_owner *);extern void nfs4_put_open_state (struct nfs4_state *);extern void nfs4_close_state (struct nfs4_state *,fmode_t );
fs/nfs/nfs4client.c +4 -1
@@ -685,9 +685,12 @@ found:static void nfs4_destroy_server (struct nfs_server *server) { +LIST_HEAD (freeme); +nfs_server_return_all_delegations (server);unset_pnfs_layoutdriver (server); -nfs4_purge_state_owners (server); +nfs4_purge_state_owners (server, &freeme); +nfs4_free_state_owners (&freeme); }/*
fs/nfs/nfs4state.c +22 -5
@@ -611,24 +611,39 @@ void nfs4_put_state_owner(struct nfs4_state_owner *sp)/** * nfs4_purge_state_owners - Release all cached state owners * @server: nfs_server with cached state owners to release +* @head: resulting list of state owners * * Called at umount time. Remaining state owners will be on * the LRU with ref count of zero. +* Note that the state owners are not freed, but are added +* to the list @head, which can later be used as an argument +* to nfs4_free_state_owners. */ -void nfs4_purge_state_owners (struct nfs_server *server) +void nfs4_purge_state_owners (struct nfs_server *server,struct list_head *head) {struct nfs_client *clp = server->nfs_client;struct nfs4_state_owner *sp, *tmp; -LIST_HEAD (doomed);spin_lock (&clp->cl_lock);list_for_each_entry_safe (sp, tmp, &server->state_owners_lru, so_lru) { -list_move (&sp->so_lru, &doomed); +list_move (&sp->so_lru, head);nfs4_remove_state_owner_locked (sp); }spin_unlock (&clp->cl_lock); +} -list_for_each_entry_safe (sp, tmp, &doomed, so_lru) { +/** +* nfs4_purge_state_owners - Release all cached state owners +* @head: resulting list of state owners +* +* Frees a list of state owners that was generated by +* nfs4_purge_state_owners +*/ +void nfs4_free_state_owners (struct list_head *head) +{ +struct nfs4_state_owner *sp, *tmp; + +list_for_each_entry_safe (sp, tmp, head, so_lru) {list_del (&sp->so_lru);nfs4_free_state_owner (sp); }
@@ -1724,12 +1739,13 @@ static int nfs4_do_reclaim(struct nfs_client *clp, const struct nfs4_state_recovstruct nfs4_state_owner *sp;struct nfs_server *server;struct rb_node *pos; +LIST_HEAD (freeme);int status =0 ; restart:rcu_read_lock ();list_for_each_entry_rcu (server, &clp->cl_superblocks, client_link) { -nfs4_purge_state_owners (server); +nfs4_purge_state_owners (server, &freeme);spin_lock (&clp->cl_lock); for (pos = rb_first(&server->state_owners); pos != NULL;
@@ -1758,6 +1774,7 @@ restart:spin_unlock (&clp->cl_lock); }rcu_read_unlock (); +nfs4_free_state_owners (&freeme);return 0 ; }
fs/userfaultfd.c +13 -12
@@ -431,6 +431,7 @@ static int userfaultfd_release(struct inode *inode, struct file *file)/* len == 0 means wake all */ struct userfaultfd_wake_range range = { .len =0 , };unsigned long new_flags; +bool still_valid;ACCESS_ONCE (ctx->released) = true;
@@ -446,8 +447,7 @@ static int userfaultfd_release(struct inode *inode, struct file *file)* taking the mmap_sem for writing. */ down_write (&mm->mmap_sem); -if (!mmget_still_valid (mm)) - goto skip_mm; + still_valid =mmget_still_valid (mm); prev =NULL ;for (vma = mm->mmap; vma; vma = vma->vm_next) {cond_resched ();
@@ -458,19 +458,20 @@ static int userfaultfd_release(struct inode *inode, struct file *file)continue ; } new_flags = vma->vm_flags & ~(VM_UFFD_MISSING |VM_UFFD_WP ); - prev =vma_merge (mm, prev, vma->vm_start, vma->vm_end, - new_flags, vma->anon_vma, - vma->vm_file, vma->vm_pgoff, -vma_policy (vma), -NULL_VM_UFFD_CTX ); -if (prev) - vma = prev; -else - prev = vma; +if (still_valid) { + prev =vma_merge (mm, prev, vma->vm_start, vma->vm_end, + new_flags, vma->anon_vma, + vma->vm_file, vma->vm_pgoff, +vma_policy (vma), +NULL_VM_UFFD_CTX ); +if (prev) + vma = prev; +else + prev = vma; + } vma->vm_flags = new_flags; vma->vm_userfaultfd_ctx =NULL_VM_UFFD_CTX ; } -skip_mm:up_write (&mm->mmap_sem);mmput (mm); wakeup:
include/linux/siphash.h new file +145 -0
145 lines not on this page · raw message
include/net/netfilter/nf_conntrack.h +2 -0
@@ -297,6 +297,8 @@ struct nf_conn *nf_ct_tmpl_alloc(struct net *net, gfp_t flags);void nf_ct_tmpl_free (struct nf_conn *tmpl); +u32 nf_ct_get_id (const struct nf_conn *ct); +#define NF_CT_STAT_INC (net, count) __this_cpu_inc((net)->ct.stat->count)#define NF_CT_STAT_INC_ATOMIC (net, count) this_cpu_inc((net)->ct.stat->count)
include/net/netns/ipv4.h +2 -0
@@ -8,6 +8,7 @@#include <linux/uidgid.h> #include <net/inet_frag.h> #include <linux/rcupdate.h> +#include <linux/siphash.h> struct tcpm_hash_bucket ;struct ctl_table_header ;
@@ -109,5 +110,6 @@ struct netns_ipv4 {#endif #endif atomic_t rt_genid; + siphash_key_t ip_id_key; };#endif
include/net/tcp.h +4 -0
@@ -1540,6 +1540,10 @@ static inline struct sk_buff *tcp_rtx_queue_tail(const struct sock *sk) {struct sk_buff *skb =tcp_send_head (sk); +/* empty retransmit queue, for example due to zero window */ +if (skb ==tcp_write_queue_head (sk)) +return NULL ; +return skb ?tcp_write_queue_prev (sk, skb) :tcp_write_queue_tail (sk); }
kernel/cgroup.c +64 -58
429 lines not on this page · raw message
lib/Kconfig.debug +10 -0
@@ -1706,6 +1706,16 @@ config TEST_RHASHTABLE If unsure, say N. +config TEST_HASH + tristate "Perform selftest on hash functions" + default n + help + Enable this option to test the kernel's siphash (<linux/siphash.h>) + hash functions on boot (or module load). + + This is intended to help people writing architecture-specific + optimized versions. If unsure, say N. + endmenu # runtime tests config PROVIDE_OHCI1394_DMA_INIT
lib/Makefile +2 -1
@@ -13,7 +13,7 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \ sha1.o md5.o irq_regs.o argv_split.o \ proportions.o flex_proportions.o ratelimit.o show_mem.o \ is_single_threaded.o plist.o decompress.o kobject_uevent.o \ - earlycpio.o seq_buf.o nmi_backtrace.o + earlycpio.o seq_buf.o siphash.o nmi_backtrace.o obj-$(CONFIG_ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS) += usercopy.o lib-$(CONFIG_MMU) += ioremap.o
@@ -35,6 +35,7 @@ obj-$(CONFIG_TEST_HEXDUMP) += test-hexdump.o obj-y += kstrtox.o obj-$(CONFIG_TEST_BPF) += test_bpf.o obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.o +obj-$(CONFIG_TEST_HASH) += test_siphash.o obj-$(CONFIG_TEST_KASAN) += test_kasan.o obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o obj-$(CONFIG_TEST_LKM) += test_module.o
lib/siphash.c new file +551 -0
551 lines not on this page · raw message
lib/test_siphash.c new file +223 -0
35 lines not on this page · raw message
sound/soc/davinci/davinci-mcasp.c +34 -9
43 lines not on this page · raw message
tools/testing/selftests/kvm/config new file +3 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.