This is the 4.4.103 stable release

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAlofw0sACgkQONu9yGCS
 aT4MPBAAo85uk2d6CXKRkNl3qKWtiStKXUet+NJFVr4GotOeg6ul9yul5jcs4pvl
 BJYnBh2LE77oDCOUKaSKI/0nDOHJs9n5m8GxjvG6cAvfn9RdgNm6kCCxNQFEhpNT
 IrmRrmCMd3aKPNrdz2Cbd4qHzNr0JuIv/bykNHDA/rw+PkQeLzZgiGIw9ftg1yHJ
 npzNLCjfVDPRy4qUCDYSS7+p83oHpWq3tHfha7M1S5HphsjVWjG79ABIKkN8w86z
 5KnY3dqt5tqO4w0gZzKXv0gg4IJS62YqeJbF/dSefASvnBkINIzxBOEu0+xOFQ5t
 ezKkukpe8ivX4eUP2ruF9jAjVLCPYCm6UaWbYQZBAAf04KHC09uXDjB4wdGCINt6
 tdOgfm60OsPHUFjx9KBn8M81Iabq8DYNubp+naG2U/j7lGzh3+mvyAlzQKetXMct
 b69skOxrjfT+2cCYeqz0UupHJigi5VLjX8hjpraXJA9oEwdS5gr9CfckEN3aUysu
 YmQ2LtgGuglUdV3Lc4QptFxRDoKna3E/Gx6rzMDPtRdV1L6dn9CULRz+Pw4T+nWl
 m6Ly9QXJVmC+d6fPW7cOEytPKRIqAUHSXQZxcPNPEcaPxD9CPWGO6TJLanc0BNYS
 g7u9kLA2fWmWnAkvEosP8lxJlQvgorhkXdCpEWuL+mAbnaImpts=
 =2wPT
 -----END PGP SIGNATURE-----

Merge 4.4.103 into android-4.4

Changes in 4.4.103
	s390: fix transactional execution control register handling
	s390/runtime instrumention: fix possible memory corruption
	s390/disassembler: add missing end marker for e7 table
	s390/disassembler: increase show_code buffer size
	ipv6: only call ip6_route_dev_notify() once for NETDEV_UNREGISTER
	AF_VSOCK: Shrink the area influenced by prepare_to_wait
	vsock: use new wait API for vsock_stream_sendmsg()
	sched: Make resched_cpu() unconditional
	lib/mpi: call cond_resched() from mpi_powm() loop
	x86/decoder: Add new TEST instruction pattern
	ARM: 8722/1: mm: make STRICT_KERNEL_RWX effective for LPAE
	ARM: 8721/1: mm: dump: check hardware RO bit for LPAE
	MIPS: ralink: Fix MT7628 pinmux
	MIPS: ralink: Fix typo in mt7628 pinmux function
	ALSA: hda: Add Raven PCI ID
	dm bufio: fix integer overflow when limiting maximum cache size
	dm: fix race between dm_get_from_kobject() and __dm_destroy()
	MIPS: Fix an n32 core file generation regset support regression
	MIPS: BCM47XX: Fix LED inversion for WRT54GSv1
	autofs: don't fail mount for transient error
	nilfs2: fix race condition that causes file system corruption
	eCryptfs: use after free in ecryptfs_release_messaging()
	bcache: check ca->alloc_thread initialized before wake up it
	isofs: fix timestamps beyond 2027
	NFS: Fix typo in nomigration mount option
	nfs: Fix ugly referral attributes
	nfsd: deal with revoked delegations appropriately
	rtlwifi: rtl8192ee: Fix memory leak when loading firmware
	rtlwifi: fix uninitialized rtlhal->last_suspend_sec time
	ata: fixes kernel crash while tracing ata_eh_link_autopsy event
	ext4: fix interaction between i_size, fallocate, and delalloc after a crash
	ALSA: pcm: update tstamp only if audio_tstamp changed
	ALSA: usb-audio: Add sanity checks to FE parser
	ALSA: usb-audio: Fix potential out-of-bound access at parsing SU
	ALSA: usb-audio: Add sanity checks in v2 clock parsers
	ALSA: timer: Remove kernel warning at compat ioctl error paths
	ALSA: hda/realtek - Fix ALC700 family no sound issue
	fix a page leak in vhost_scsi_iov_to_sgl() error recovery
	fs/9p: Compare qid.path in v9fs_test_inode
	iscsi-target: Fix non-immediate TMR reference leak
	target: Fix QUEUE_FULL + SCSI task attribute handling
	KVM: nVMX: set IDTR and GDTR limits when loading L1 host state
	KVM: SVM: obey guest PAT
	SUNRPC: Fix tracepoint storage issues with svc_recv and svc_rqst_status
	clk: ti: dra7-atl-clock: Fix of_node reference counting
	clk: ti: dra7-atl-clock: fix child-node lookups
	libnvdimm, namespace: fix label initialization to use valid seq numbers
	libnvdimm, namespace: make 'resource' attribute only readable by root
	IB/srpt: Do not accept invalid initiator port names
	IB/srp: Avoid that a cable pull can trigger a kernel crash
	NFC: fix device-allocation error return
	i40e: Use smp_rmb rather than read_barrier_depends
	igb: Use smp_rmb rather than read_barrier_depends
	igbvf: Use smp_rmb rather than read_barrier_depends
	ixgbevf: Use smp_rmb rather than read_barrier_depends
	i40evf: Use smp_rmb rather than read_barrier_depends
	fm10k: Use smp_rmb rather than read_barrier_depends
	ixgbe: Fix skb list corruption on Power systems
	parisc: Fix validity check of pointer size argument in new CAS implementation
	powerpc/signal: Properly handle return value from uprobe_deny_signal()
	media: Don't do DMA on stack for firmware upload in the AS102 driver
	media: rc: check for integer overflow
	cx231xx-cards: fix NULL-deref on missing association descriptor
	media: v4l2-ctrl: Fix flags field on Control events
	sched/rt: Simplify the IPI based RT balancing logic
	fscrypt: lock mutex before checking for bounce page pool
	net/9p: Switch to wait_event_killable()
	PM / OPP: Add missing of_node_put(np)
	e1000e: Fix error path in link detection
	e1000e: Fix return value test
	e1000e: Separate signaling for link check/link up
	RDS: RDMA: return appropriate error on rdma map failures
	PCI: Apply _HPX settings only to relevant devices
	dmaengine: zx: set DMA_CYCLIC cap_mask bit
	net: Allow IP_MULTICAST_IF to set index to L3 slave
	net: 3com: typhoon: typhoon_init_one: make return values more specific
	net: 3com: typhoon: typhoon_init_one: fix incorrect return values
	drm/armada: Fix compile fail
	ath10k: fix incorrect txpower set by P2P_DEVICE interface
	ath10k: ignore configuring the incorrect board_id
	ath10k: fix potential memory leak in ath10k_wmi_tlv_op_pull_fw_stats()
	ath10k: set CTS protection VDEV param only if VDEV is up
	ALSA: hda - Apply ALC269_FIXUP_NO_SHUTUP on HDA_FIXUP_ACT_PROBE
	drm: Apply range restriction after color adjustment when allocation
	mac80211: Remove invalid flag operations in mesh TSF synchronization
	mac80211: Suppress NEW_PEER_CANDIDATE event if no room
	iio: light: fix improper return value
	staging: iio: cdc: fix improper return value
	spi: SPI_FSL_DSPI should depend on HAS_DMA
	netfilter: nft_queue: use raw_smp_processor_id()
	netfilter: nf_tables: fix oob access
	ASoC: rsnd: don't double free kctrl
	btrfs: return the actual error value from from btrfs_uuid_tree_iterate
	ASoC: wm_adsp: Don't overrun firmware file buffer when reading region data
	s390/kbuild: enable modversions for symbols exported from asm
	xen: xenbus driver must not accept invalid transaction ids
	Revert "sctp: do not peel off an assoc from one netns to another one"
	Linux 4.4.103

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2017-11-30 15:43:08 +00:00
commit 9fbf3d7374
101 changed files with 699 additions and 441 deletions

View file

@ -1,6 +1,6 @@
VERSION = 4 VERSION = 4
PATCHLEVEL = 4 PATCHLEVEL = 4
SUBLEVEL = 102 SUBLEVEL = 103
EXTRAVERSION = EXTRAVERSION =
NAME = Blurry Fish Butt NAME = Blurry Fish Butt

View file

@ -126,8 +126,8 @@ static const struct prot_bits section_bits[] = {
.val = PMD_SECT_USER, .val = PMD_SECT_USER,
.set = "USR", .set = "USR",
}, { }, {
.mask = L_PMD_SECT_RDONLY, .mask = L_PMD_SECT_RDONLY | PMD_SECT_AP2,
.val = L_PMD_SECT_RDONLY, .val = L_PMD_SECT_RDONLY | PMD_SECT_AP2,
.set = "ro", .set = "ro",
.clear = "RW", .clear = "RW",
#elif __LINUX_ARM_ARCH__ >= 6 #elif __LINUX_ARM_ARCH__ >= 6

View file

@ -611,8 +611,8 @@ static struct section_perm ro_perms[] = {
.start = (unsigned long)_stext, .start = (unsigned long)_stext,
.end = (unsigned long)__init_begin, .end = (unsigned long)__init_begin,
#ifdef CONFIG_ARM_LPAE #ifdef CONFIG_ARM_LPAE
.mask = ~L_PMD_SECT_RDONLY, .mask = ~(L_PMD_SECT_RDONLY | PMD_SECT_AP2),
.prot = L_PMD_SECT_RDONLY, .prot = L_PMD_SECT_RDONLY | PMD_SECT_AP2,
#else #else
.mask = ~(PMD_SECT_APX | PMD_SECT_AP_WRITE), .mask = ~(PMD_SECT_APX | PMD_SECT_AP_WRITE),
.prot = PMD_SECT_APX | PMD_SECT_AP_WRITE, .prot = PMD_SECT_APX | PMD_SECT_AP_WRITE,

View file

@ -330,7 +330,7 @@ bcm47xx_leds_linksys_wrt54g3gv2[] __initconst = {
/* Verified on: WRT54GS V1.0 */ /* Verified on: WRT54GS V1.0 */
static const struct gpio_led static const struct gpio_led
bcm47xx_leds_linksys_wrt54g_type_0101[] __initconst = { bcm47xx_leds_linksys_wrt54g_type_0101[] __initconst = {
BCM47XX_GPIO_LED(0, "green", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF), BCM47XX_GPIO_LED(0, "green", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
BCM47XX_GPIO_LED(1, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON), BCM47XX_GPIO_LED(1, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON),
BCM47XX_GPIO_LED(7, "green", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF), BCM47XX_GPIO_LED(7, "green", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
}; };

View file

@ -650,6 +650,19 @@ static const struct user_regset_view user_mips64_view = {
.n = ARRAY_SIZE(mips64_regsets), .n = ARRAY_SIZE(mips64_regsets),
}; };
#ifdef CONFIG_MIPS32_N32
static const struct user_regset_view user_mipsn32_view = {
.name = "mipsn32",
.e_flags = EF_MIPS_ABI2,
.e_machine = ELF_ARCH,
.ei_osabi = ELF_OSABI,
.regsets = mips64_regsets,
.n = ARRAY_SIZE(mips64_regsets),
};
#endif /* CONFIG_MIPS32_N32 */
#endif /* CONFIG_64BIT */ #endif /* CONFIG_64BIT */
const struct user_regset_view *task_user_regset_view(struct task_struct *task) const struct user_regset_view *task_user_regset_view(struct task_struct *task)
@ -660,6 +673,10 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task)
#ifdef CONFIG_MIPS32_O32 #ifdef CONFIG_MIPS32_O32
if (test_tsk_thread_flag(task, TIF_32BIT_REGS)) if (test_tsk_thread_flag(task, TIF_32BIT_REGS))
return &user_mips_view; return &user_mips_view;
#endif
#ifdef CONFIG_MIPS32_N32
if (test_tsk_thread_flag(task, TIF_32BIT_ADDR))
return &user_mipsn32_view;
#endif #endif
return &user_mips64_view; return &user_mips64_view;
#endif #endif

View file

@ -141,8 +141,8 @@ static struct rt2880_pmx_func i2c_grp_mt7628[] = {
FUNC("i2c", 0, 4, 2), FUNC("i2c", 0, 4, 2),
}; };
static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("reclk", 0, 36, 1) }; static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("refclk", 0, 37, 1) };
static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 37, 1) }; static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 36, 1) };
static struct rt2880_pmx_func wdt_grp_mt7628[] = { FUNC("wdt", 0, 38, 1) }; static struct rt2880_pmx_func wdt_grp_mt7628[] = { FUNC("wdt", 0, 38, 1) };
static struct rt2880_pmx_func spi_grp_mt7628[] = { FUNC("spi", 0, 7, 4) }; static struct rt2880_pmx_func spi_grp_mt7628[] = { FUNC("spi", 0, 7, 4) };

View file

@ -688,15 +688,15 @@ cas_action:
/* ELF32 Process entry path */ /* ELF32 Process entry path */
lws_compare_and_swap_2: lws_compare_and_swap_2:
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
/* Clip the input registers */ /* Clip the input registers. We don't need to clip %r23 as we
only use it for word operations */
depdi 0, 31, 32, %r26 depdi 0, 31, 32, %r26
depdi 0, 31, 32, %r25 depdi 0, 31, 32, %r25
depdi 0, 31, 32, %r24 depdi 0, 31, 32, %r24
depdi 0, 31, 32, %r23
#endif #endif
/* Check the validity of the size pointer */ /* Check the validity of the size pointer */
subi,>>= 4, %r23, %r0 subi,>>= 3, %r23, %r0
b,n lws_exit_nosys b,n lws_exit_nosys
/* Jump to the functions which will load the old and new values into /* Jump to the functions which will load the old and new values into

View file

@ -102,7 +102,7 @@ static void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka,
static void do_signal(struct pt_regs *regs) static void do_signal(struct pt_regs *regs)
{ {
sigset_t *oldset = sigmask_to_save(); sigset_t *oldset = sigmask_to_save();
struct ksignal ksig; struct ksignal ksig = { .sig = 0 };
int ret; int ret;
int is32 = is_32bit_task(); int is32 = is_32bit_task();

View file

@ -0,0 +1,8 @@
#ifndef _ASM_S390_PROTOTYPES_H
#include <linux/kvm_host.h>
#include <linux/ftrace.h>
#include <asm/fpu/api.h>
#include <asm-generic/asm-prototypes.h>
#endif /* _ASM_S390_PROTOTYPES_H */

View file

@ -34,8 +34,8 @@ static inline void restore_access_regs(unsigned int *acrs)
save_access_regs(&prev->thread.acrs[0]); \ save_access_regs(&prev->thread.acrs[0]); \
save_ri_cb(prev->thread.ri_cb); \ save_ri_cb(prev->thread.ri_cb); \
} \ } \
if (next->mm) { \
update_cr_regs(next); \ update_cr_regs(next); \
if (next->mm) { \
set_cpu_flag(CIF_FPU); \ set_cpu_flag(CIF_FPU); \
restore_access_regs(&next->thread.acrs[0]); \ restore_access_regs(&next->thread.acrs[0]); \
restore_ri_cb(next->thread.ri_cb, prev->thread.ri_cb); \ restore_ri_cb(next->thread.ri_cb, prev->thread.ri_cb); \

View file

@ -1549,6 +1549,7 @@ static struct s390_insn opcode_e7[] = {
{ "vfsq", 0xce, INSTR_VRR_VV000MM }, { "vfsq", 0xce, INSTR_VRR_VV000MM },
{ "vfs", 0xe2, INSTR_VRR_VVV00MM }, { "vfs", 0xe2, INSTR_VRR_VVV00MM },
{ "vftci", 0x4a, INSTR_VRI_VVIMM }, { "vftci", 0x4a, INSTR_VRI_VVIMM },
{ "", 0, INSTR_INVALID }
}; };
static struct s390_insn opcode_eb[] = { static struct s390_insn opcode_eb[] = {
@ -1961,7 +1962,7 @@ void show_code(struct pt_regs *regs)
{ {
char *mode = user_mode(regs) ? "User" : "Krnl"; char *mode = user_mode(regs) ? "User" : "Krnl";
unsigned char code[64]; unsigned char code[64];
char buffer[64], *ptr; char buffer[128], *ptr;
mm_segment_t old_fs; mm_segment_t old_fs;
unsigned long addr; unsigned long addr;
int start, end, opsize, hops, i; int start, end, opsize, hops, i;
@ -2024,7 +2025,7 @@ void show_code(struct pt_regs *regs)
start += opsize; start += opsize;
printk(buffer); printk(buffer);
ptr = buffer; ptr = buffer;
ptr += sprintf(ptr, "\n "); ptr += sprintf(ptr, "\n\t ");
hops++; hops++;
} }
printk("\n"); printk("\n");

View file

@ -325,8 +325,10 @@ static __init void detect_machine_facilities(void)
S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE; S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
if (test_facility(40)) if (test_facility(40))
S390_lowcore.machine_flags |= MACHINE_FLAG_LPP; S390_lowcore.machine_flags |= MACHINE_FLAG_LPP;
if (test_facility(50) && test_facility(73)) if (test_facility(50) && test_facility(73)) {
S390_lowcore.machine_flags |= MACHINE_FLAG_TE; S390_lowcore.machine_flags |= MACHINE_FLAG_TE;
__ctl_set_bit(0, 55);
}
if (test_facility(51)) if (test_facility(51))
S390_lowcore.machine_flags |= MACHINE_FLAG_TLB_LC; S390_lowcore.machine_flags |= MACHINE_FLAG_TLB_LC;
if (test_facility(129)) { if (test_facility(129)) {

View file

@ -137,6 +137,7 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
memset(&p->thread.per_user, 0, sizeof(p->thread.per_user)); memset(&p->thread.per_user, 0, sizeof(p->thread.per_user));
memset(&p->thread.per_event, 0, sizeof(p->thread.per_event)); memset(&p->thread.per_event, 0, sizeof(p->thread.per_event));
clear_tsk_thread_flag(p, TIF_SINGLE_STEP); clear_tsk_thread_flag(p, TIF_SINGLE_STEP);
p->thread.per_flags = 0;
/* Initialize per thread user and system timer values */ /* Initialize per thread user and system timer values */
ti = task_thread_info(p); ti = task_thread_info(p);
ti->user_timer = 0; ti->user_timer = 0;

View file

@ -47,11 +47,13 @@ void exit_thread_runtime_instr(void)
{ {
struct task_struct *task = current; struct task_struct *task = current;
preempt_disable();
if (!task->thread.ri_cb) if (!task->thread.ri_cb)
return; return;
disable_runtime_instr(); disable_runtime_instr();
kfree(task->thread.ri_cb); kfree(task->thread.ri_cb);
task->thread.ri_cb = NULL; task->thread.ri_cb = NULL;
preempt_enable();
} }
SYSCALL_DEFINE1(s390_runtime_instr, int, command) SYSCALL_DEFINE1(s390_runtime_instr, int, command)
@ -62,9 +64,7 @@ SYSCALL_DEFINE1(s390_runtime_instr, int, command)
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (command == S390_RUNTIME_INSTR_STOP) { if (command == S390_RUNTIME_INSTR_STOP) {
preempt_disable();
exit_thread_runtime_instr(); exit_thread_runtime_instr();
preempt_enable();
return 0; return 0;
} }

View file

@ -3114,6 +3114,13 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
u32 ecx = msr->index; u32 ecx = msr->index;
u64 data = msr->data; u64 data = msr->data;
switch (ecx) { switch (ecx) {
case MSR_IA32_CR_PAT:
if (!kvm_mtrr_valid(vcpu, MSR_IA32_CR_PAT, data))
return 1;
vcpu->arch.pat = data;
svm->vmcb->save.g_pat = data;
mark_dirty(svm->vmcb, VMCB_NPT);
break;
case MSR_IA32_TSC: case MSR_IA32_TSC:
kvm_write_tsc(vcpu, msr); kvm_write_tsc(vcpu, msr);
break; break;

View file

@ -10394,6 +10394,8 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,
vmcs_writel(GUEST_SYSENTER_EIP, vmcs12->host_ia32_sysenter_eip); vmcs_writel(GUEST_SYSENTER_EIP, vmcs12->host_ia32_sysenter_eip);
vmcs_writel(GUEST_IDTR_BASE, vmcs12->host_idtr_base); vmcs_writel(GUEST_IDTR_BASE, vmcs12->host_idtr_base);
vmcs_writel(GUEST_GDTR_BASE, vmcs12->host_gdtr_base); vmcs_writel(GUEST_GDTR_BASE, vmcs12->host_gdtr_base);
vmcs_write32(GUEST_IDTR_LIMIT, 0xFFFF);
vmcs_write32(GUEST_GDTR_LIMIT, 0xFFFF);
/* If not VM_EXIT_CLEAR_BNDCFGS, the L2 value propagates to L1. */ /* If not VM_EXIT_CLEAR_BNDCFGS, the L2 value propagates to L1. */
if (vmcs12->vm_exit_controls & VM_EXIT_CLEAR_BNDCFGS) if (vmcs12->vm_exit_controls & VM_EXIT_CLEAR_BNDCFGS)

View file

@ -833,7 +833,7 @@ EndTable
GrpTable: Grp3_1 GrpTable: Grp3_1
0: TEST Eb,Ib 0: TEST Eb,Ib
1: 1: TEST Eb,Ib
2: NOT Eb 2: NOT Eb
3: NEG Eb 3: NEG Eb
4: MUL AL,Eb 4: MUL AL,Eb

View file

@ -2245,8 +2245,8 @@ static void ata_eh_link_autopsy(struct ata_link *link)
if (dev->flags & ATA_DFLAG_DUBIOUS_XFER) if (dev->flags & ATA_DFLAG_DUBIOUS_XFER)
eflags |= ATA_EFLAG_DUBIOUS_XFER; eflags |= ATA_EFLAG_DUBIOUS_XFER;
ehc->i.action |= ata_eh_speed_down(dev, eflags, all_err_mask); ehc->i.action |= ata_eh_speed_down(dev, eflags, all_err_mask);
}
trace_ata_eh_link_autopsy(dev, ehc->i.action, all_err_mask); trace_ata_eh_link_autopsy(dev, ehc->i.action, all_err_mask);
}
DPRINTK("EXIT\n"); DPRINTK("EXIT\n");
} }

View file

@ -1205,6 +1205,7 @@ static int _of_add_opp_table_v2(struct device *dev, struct device_node *opp_np)
if (ret) { if (ret) {
dev_err(dev, "%s: Failed to add OPP, %d\n", __func__, dev_err(dev, "%s: Failed to add OPP, %d\n", __func__,
ret); ret);
of_node_put(np);
goto free_table; goto free_table;
} }
} }

View file

@ -265,7 +265,7 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev)
/* Get configuration for the ATL instances */ /* Get configuration for the ATL instances */
snprintf(prop, sizeof(prop), "atl%u", i); snprintf(prop, sizeof(prop), "atl%u", i);
cfg_node = of_find_node_by_name(node, prop); cfg_node = of_get_child_by_name(node, prop);
if (cfg_node) { if (cfg_node) {
ret = of_property_read_u32(cfg_node, "bws", ret = of_property_read_u32(cfg_node, "bws",
&cdesc->bws); &cdesc->bws);
@ -278,6 +278,7 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev)
atl_write(cinfo, DRA7_ATL_AWSMUX_REG(i), atl_write(cinfo, DRA7_ATL_AWSMUX_REG(i),
cdesc->aws); cdesc->aws);
} }
of_node_put(cfg_node);
} }
cdesc->probed = true; cdesc->probed = true;

View file

@ -813,6 +813,7 @@ static int zx_dma_probe(struct platform_device *op)
INIT_LIST_HEAD(&d->slave.channels); INIT_LIST_HEAD(&d->slave.channels);
dma_cap_set(DMA_SLAVE, d->slave.cap_mask); dma_cap_set(DMA_SLAVE, d->slave.cap_mask);
dma_cap_set(DMA_MEMCPY, d->slave.cap_mask); dma_cap_set(DMA_MEMCPY, d->slave.cap_mask);
dma_cap_set(DMA_CYCLIC, d->slave.cap_mask);
dma_cap_set(DMA_PRIVATE, d->slave.cap_mask); dma_cap_set(DMA_PRIVATE, d->slave.cap_mask);
d->slave.dev = &op->dev; d->slave.dev = &op->dev;
d->slave.device_free_chan_resources = zx_dma_free_chan_resources; d->slave.device_free_chan_resources = zx_dma_free_chan_resources;

View file

@ -4,3 +4,5 @@ armada-y += armada_510.o
armada-$(CONFIG_DEBUG_FS) += armada_debugfs.o armada-$(CONFIG_DEBUG_FS) += armada_debugfs.o
obj-$(CONFIG_DRM_ARMADA) := armada.o obj-$(CONFIG_DRM_ARMADA) := armada.o
CFLAGS_armada_trace.o := -I$(src)

View file

@ -262,14 +262,12 @@ static void drm_mm_insert_helper_range(struct drm_mm_node *hole_node,
BUG_ON(!hole_node->hole_follows || node->allocated); BUG_ON(!hole_node->hole_follows || node->allocated);
if (adj_start < start)
adj_start = start;
if (adj_end > end)
adj_end = end;
if (mm->color_adjust) if (mm->color_adjust)
mm->color_adjust(hole_node, color, &adj_start, &adj_end); mm->color_adjust(hole_node, color, &adj_start, &adj_end);
adj_start = max(adj_start, start);
adj_end = min(adj_end, end);
if (flags & DRM_MM_CREATE_TOP) if (flags & DRM_MM_CREATE_TOP)
adj_start = adj_end - size; adj_start = adj_end - size;
@ -475,17 +473,15 @@ static struct drm_mm_node *drm_mm_search_free_in_range_generic(const struct drm_
flags & DRM_MM_SEARCH_BELOW) { flags & DRM_MM_SEARCH_BELOW) {
u64 hole_size = adj_end - adj_start; u64 hole_size = adj_end - adj_start;
if (adj_start < start)
adj_start = start;
if (adj_end > end)
adj_end = end;
if (mm->color_adjust) { if (mm->color_adjust) {
mm->color_adjust(entry, color, &adj_start, &adj_end); mm->color_adjust(entry, color, &adj_start, &adj_end);
if (adj_end <= adj_start) if (adj_end <= adj_start)
continue; continue;
} }
adj_start = max(adj_start, start);
adj_end = min(adj_end, end);
if (!check_free_hole(adj_start, adj_end, size, alignment)) if (!check_free_hole(adj_start, adj_end, size, alignment))
continue; continue;

View file

@ -119,7 +119,7 @@ static int cm3232_reg_init(struct cm3232_chip *chip)
if (ret < 0) if (ret < 0)
dev_err(&chip->client->dev, "Error writing reg_cmd\n"); dev_err(&chip->client->dev, "Error writing reg_cmd\n");
return 0; return ret;
} }
/** /**

View file

@ -670,12 +670,19 @@ static void srp_path_rec_completion(int status,
static int srp_lookup_path(struct srp_rdma_ch *ch) static int srp_lookup_path(struct srp_rdma_ch *ch)
{ {
struct srp_target_port *target = ch->target; struct srp_target_port *target = ch->target;
int ret; int ret = -ENODEV;
ch->path.numb_path = 1; ch->path.numb_path = 1;
init_completion(&ch->done); init_completion(&ch->done);
/*
* Avoid that the SCSI host can be removed by srp_remove_target()
* before srp_path_rec_completion() is called.
*/
if (!scsi_host_get(target->scsi_host))
goto out;
ch->path_query_id = ib_sa_path_rec_get(&srp_sa_client, ch->path_query_id = ib_sa_path_rec_get(&srp_sa_client,
target->srp_host->srp_dev->dev, target->srp_host->srp_dev->dev,
target->srp_host->port, target->srp_host->port,
@ -689,18 +696,24 @@ static int srp_lookup_path(struct srp_rdma_ch *ch)
GFP_KERNEL, GFP_KERNEL,
srp_path_rec_completion, srp_path_rec_completion,
ch, &ch->path_query); ch, &ch->path_query);
if (ch->path_query_id < 0) ret = ch->path_query_id;
return ch->path_query_id; if (ret < 0)
goto put;
ret = wait_for_completion_interruptible(&ch->done); ret = wait_for_completion_interruptible(&ch->done);
if (ret < 0) if (ret < 0)
return ret; goto put;
if (ch->status < 0) ret = ch->status;
if (ret < 0)
shost_printk(KERN_WARNING, target->scsi_host, shost_printk(KERN_WARNING, target->scsi_host,
PFX "Path record query failed\n"); PFX "Path record query failed\n");
return ch->status; put:
scsi_host_put(target->scsi_host);
out:
return ret;
} }
static int srp_send_req(struct srp_rdma_ch *ch, bool multich) static int srp_send_req(struct srp_rdma_ch *ch, bool multich)

View file

@ -3425,7 +3425,7 @@ static int srpt_parse_i_port_id(u8 i_port_id[16], const char *name)
{ {
const char *p; const char *p;
unsigned len, count, leading_zero_bytes; unsigned len, count, leading_zero_bytes;
int ret, rc; int ret;
p = name; p = name;
if (strncasecmp(p, "0x", 2) == 0) if (strncasecmp(p, "0x", 2) == 0)
@ -3437,10 +3437,9 @@ static int srpt_parse_i_port_id(u8 i_port_id[16], const char *name)
count = min(len / 2, 16U); count = min(len / 2, 16U);
leading_zero_bytes = 16 - count; leading_zero_bytes = 16 - count;
memset(i_port_id, 0, leading_zero_bytes); memset(i_port_id, 0, leading_zero_bytes);
rc = hex2bin(i_port_id + leading_zero_bytes, p, count); ret = hex2bin(i_port_id + leading_zero_bytes, p, count);
if (rc < 0) if (ret < 0)
pr_debug("hex2bin failed for srpt_parse_i_port_id: %d\n", rc); pr_debug("hex2bin failed for srpt_parse_i_port_id: %d\n", ret);
ret = 0;
out: out:
return ret; return ret;
} }

View file

@ -406,6 +406,7 @@ long bch_bucket_alloc(struct cache *ca, unsigned reserve, bool wait)
finish_wait(&ca->set->bucket_wait, &w); finish_wait(&ca->set->bucket_wait, &w);
out: out:
if (ca->alloc_thread)
wake_up_process(ca->alloc_thread); wake_up_process(ca->alloc_thread);
trace_bcache_alloc(ca, reserve); trace_bcache_alloc(ca, reserve);

View file

@ -928,7 +928,8 @@ static void __get_memory_limit(struct dm_bufio_client *c,
buffers = c->minimum_buffers; buffers = c->minimum_buffers;
*limit_buffers = buffers; *limit_buffers = buffers;
*threshold_buffers = buffers * DM_BUFIO_WRITEBACK_PERCENT / 100; *threshold_buffers = mult_frac(buffers,
DM_BUFIO_WRITEBACK_PERCENT, 100);
} }
/* /*
@ -1829,19 +1830,15 @@ static int __init dm_bufio_init(void)
memset(&dm_bufio_caches, 0, sizeof dm_bufio_caches); memset(&dm_bufio_caches, 0, sizeof dm_bufio_caches);
memset(&dm_bufio_cache_names, 0, sizeof dm_bufio_cache_names); memset(&dm_bufio_cache_names, 0, sizeof dm_bufio_cache_names);
mem = (__u64)((totalram_pages - totalhigh_pages) * mem = (__u64)mult_frac(totalram_pages - totalhigh_pages,
DM_BUFIO_MEMORY_PERCENT / 100) << PAGE_SHIFT; DM_BUFIO_MEMORY_PERCENT, 100) << PAGE_SHIFT;
if (mem > ULONG_MAX) if (mem > ULONG_MAX)
mem = ULONG_MAX; mem = ULONG_MAX;
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
/* if (mem > mult_frac(VMALLOC_TOTAL, DM_BUFIO_VMALLOC_PERCENT, 100))
* Get the size of vmalloc space the same way as VMALLOC_TOTAL mem = mult_frac(VMALLOC_TOTAL, DM_BUFIO_VMALLOC_PERCENT, 100);
* in fs/proc/internal.h
*/
if (mem > (VMALLOC_END - VMALLOC_START) * DM_BUFIO_VMALLOC_PERCENT / 100)
mem = (VMALLOC_END - VMALLOC_START) * DM_BUFIO_VMALLOC_PERCENT / 100;
#endif #endif
dm_bufio_default_cache_size = mem; dm_bufio_default_cache_size = mem;

View file

@ -3507,11 +3507,15 @@ struct mapped_device *dm_get_from_kobject(struct kobject *kobj)
md = container_of(kobj, struct mapped_device, kobj_holder.kobj); md = container_of(kobj, struct mapped_device, kobj_holder.kobj);
if (test_bit(DMF_FREEING, &md->flags) || spin_lock(&_minor_lock);
dm_deleting_md(md)) if (test_bit(DMF_FREEING, &md->flags) || dm_deleting_md(md)) {
return NULL; md = NULL;
goto out;
}
dm_get(md); dm_get(md);
out:
spin_unlock(&_minor_lock);
return md; return md;
} }

View file

@ -286,10 +286,13 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
if (!dev->max_timeout) if (!dev->max_timeout)
return -ENOSYS; return -ENOSYS;
/* Check for multiply overflow */
if (val > U32_MAX / 1000)
return -EINVAL;
tmp = val * 1000; tmp = val * 1000;
if (tmp < dev->min_timeout || if (tmp < dev->min_timeout || tmp > dev->max_timeout)
tmp > dev->max_timeout)
return -EINVAL; return -EINVAL;
dev->timeout = tmp; dev->timeout = tmp;

View file

@ -101,18 +101,23 @@ static int as102_firmware_upload(struct as10x_bus_adapter_t *bus_adap,
unsigned char *cmd, unsigned char *cmd,
const struct firmware *firmware) { const struct firmware *firmware) {
struct as10x_fw_pkt_t fw_pkt; struct as10x_fw_pkt_t *fw_pkt;
int total_read_bytes = 0, errno = 0; int total_read_bytes = 0, errno = 0;
unsigned char addr_has_changed = 0; unsigned char addr_has_changed = 0;
fw_pkt = kmalloc(sizeof(*fw_pkt), GFP_KERNEL);
if (!fw_pkt)
return -ENOMEM;
for (total_read_bytes = 0; total_read_bytes < firmware->size; ) { for (total_read_bytes = 0; total_read_bytes < firmware->size; ) {
int read_bytes = 0, data_len = 0; int read_bytes = 0, data_len = 0;
/* parse intel hex line */ /* parse intel hex line */
read_bytes = parse_hex_line( read_bytes = parse_hex_line(
(u8 *) (firmware->data + total_read_bytes), (u8 *) (firmware->data + total_read_bytes),
fw_pkt.raw.address, fw_pkt->raw.address,
fw_pkt.raw.data, fw_pkt->raw.data,
&data_len, &data_len,
&addr_has_changed); &addr_has_changed);
@ -122,28 +127,28 @@ static int as102_firmware_upload(struct as10x_bus_adapter_t *bus_adap,
/* detect the end of file */ /* detect the end of file */
total_read_bytes += read_bytes; total_read_bytes += read_bytes;
if (total_read_bytes == firmware->size) { if (total_read_bytes == firmware->size) {
fw_pkt.u.request[0] = 0x00; fw_pkt->u.request[0] = 0x00;
fw_pkt.u.request[1] = 0x03; fw_pkt->u.request[1] = 0x03;
/* send EOF command */ /* send EOF command */
errno = bus_adap->ops->upload_fw_pkt(bus_adap, errno = bus_adap->ops->upload_fw_pkt(bus_adap,
(uint8_t *) (uint8_t *)
&fw_pkt, 2, 0); fw_pkt, 2, 0);
if (errno < 0) if (errno < 0)
goto error; goto error;
} else { } else {
if (!addr_has_changed) { if (!addr_has_changed) {
/* prepare command to send */ /* prepare command to send */
fw_pkt.u.request[0] = 0x00; fw_pkt->u.request[0] = 0x00;
fw_pkt.u.request[1] = 0x01; fw_pkt->u.request[1] = 0x01;
data_len += sizeof(fw_pkt.u.request); data_len += sizeof(fw_pkt->u.request);
data_len += sizeof(fw_pkt.raw.address); data_len += sizeof(fw_pkt->raw.address);
/* send cmd to device */ /* send cmd to device */
errno = bus_adap->ops->upload_fw_pkt(bus_adap, errno = bus_adap->ops->upload_fw_pkt(bus_adap,
(uint8_t *) (uint8_t *)
&fw_pkt, fw_pkt,
data_len, data_len,
0); 0);
if (errno < 0) if (errno < 0)
@ -152,6 +157,7 @@ static int as102_firmware_upload(struct as10x_bus_adapter_t *bus_adap,
} }
} }
error: error:
kfree(fw_pkt);
return (errno == 0) ? total_read_bytes : errno; return (errno == 0) ? total_read_bytes : errno;
} }

View file

@ -1672,7 +1672,7 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
nr = dev->devno; nr = dev->devno;
assoc_desc = udev->actconfig->intf_assoc[0]; assoc_desc = udev->actconfig->intf_assoc[0];
if (assoc_desc->bFirstInterface != ifnum) { if (!assoc_desc || assoc_desc->bFirstInterface != ifnum) {
dev_err(d, "Not found matching IAD interface\n"); dev_err(d, "Not found matching IAD interface\n");
retval = -ENODEV; retval = -ENODEV;
goto err_if; goto err_if;

View file

@ -1200,6 +1200,16 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
} }
EXPORT_SYMBOL(v4l2_ctrl_fill); EXPORT_SYMBOL(v4l2_ctrl_fill);
static u32 user_flags(const struct v4l2_ctrl *ctrl)
{
u32 flags = ctrl->flags;
if (ctrl->is_ptr)
flags |= V4L2_CTRL_FLAG_HAS_PAYLOAD;
return flags;
}
static void fill_event(struct v4l2_event *ev, struct v4l2_ctrl *ctrl, u32 changes) static void fill_event(struct v4l2_event *ev, struct v4l2_ctrl *ctrl, u32 changes)
{ {
memset(ev->reserved, 0, sizeof(ev->reserved)); memset(ev->reserved, 0, sizeof(ev->reserved));
@ -1207,7 +1217,7 @@ static void fill_event(struct v4l2_event *ev, struct v4l2_ctrl *ctrl, u32 change
ev->id = ctrl->id; ev->id = ctrl->id;
ev->u.ctrl.changes = changes; ev->u.ctrl.changes = changes;
ev->u.ctrl.type = ctrl->type; ev->u.ctrl.type = ctrl->type;
ev->u.ctrl.flags = ctrl->flags; ev->u.ctrl.flags = user_flags(ctrl);
if (ctrl->is_ptr) if (ctrl->is_ptr)
ev->u.ctrl.value64 = 0; ev->u.ctrl.value64 = 0;
else else
@ -2536,10 +2546,8 @@ int v4l2_query_ext_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_query_ext_ctr
else else
qc->id = ctrl->id; qc->id = ctrl->id;
strlcpy(qc->name, ctrl->name, sizeof(qc->name)); strlcpy(qc->name, ctrl->name, sizeof(qc->name));
qc->flags = ctrl->flags; qc->flags = user_flags(ctrl);
qc->type = ctrl->type; qc->type = ctrl->type;
if (ctrl->is_ptr)
qc->flags |= V4L2_CTRL_FLAG_HAS_PAYLOAD;
qc->elem_size = ctrl->elem_size; qc->elem_size = ctrl->elem_size;
qc->elems = ctrl->elems; qc->elems = ctrl->elems;
qc->nr_of_dims = ctrl->nr_of_dims; qc->nr_of_dims = ctrl->nr_of_dims;

View file

@ -2366,9 +2366,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
* 4) Get the hardware address. * 4) Get the hardware address.
* 5) Put the card to sleep. * 5) Put the card to sleep.
*/ */
if (typhoon_reset(ioaddr, WaitSleep) < 0) { err = typhoon_reset(ioaddr, WaitSleep);
if (err < 0) {
err_msg = "could not reset 3XP"; err_msg = "could not reset 3XP";
err = -EIO;
goto error_out_dma; goto error_out_dma;
} }
@ -2382,16 +2382,16 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
typhoon_init_interface(tp); typhoon_init_interface(tp);
typhoon_init_rings(tp); typhoon_init_rings(tp);
if(typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST) < 0) { err = typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST);
if (err < 0) {
err_msg = "cannot boot 3XP sleep image"; err_msg = "cannot boot 3XP sleep image";
err = -EIO;
goto error_out_reset; goto error_out_reset;
} }
INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_MAC_ADDRESS); INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_MAC_ADDRESS);
if(typhoon_issue_command(tp, 1, &xp_cmd, 1, xp_resp) < 0) { err = typhoon_issue_command(tp, 1, &xp_cmd, 1, xp_resp);
if (err < 0) {
err_msg = "cannot read MAC address"; err_msg = "cannot read MAC address";
err = -EIO;
goto error_out_reset; goto error_out_reset;
} }
@ -2400,6 +2400,7 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (!is_valid_ether_addr(dev->dev_addr)) { if (!is_valid_ether_addr(dev->dev_addr)) {
err_msg = "Could not obtain valid ethernet address, aborting"; err_msg = "Could not obtain valid ethernet address, aborting";
err = -EIO;
goto error_out_reset; goto error_out_reset;
} }
@ -2407,7 +2408,8 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
* later when we print out the version reported. * later when we print out the version reported.
*/ */
INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_VERSIONS); INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_VERSIONS);
if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) { err = typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp);
if (err < 0) {
err_msg = "Could not get Sleep Image version"; err_msg = "Could not get Sleep Image version";
goto error_out_reset; goto error_out_reset;
} }
@ -2424,9 +2426,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if(xp_resp[0].numDesc != 0) if(xp_resp[0].numDesc != 0)
tp->capabilities |= TYPHOON_WAKEUP_NEEDS_RESET; tp->capabilities |= TYPHOON_WAKEUP_NEEDS_RESET;
if(typhoon_sleep(tp, PCI_D3hot, 0) < 0) { err = typhoon_sleep(tp, PCI_D3hot, 0);
if (err < 0) {
err_msg = "cannot put adapter to sleep"; err_msg = "cannot put adapter to sleep";
err = -EIO;
goto error_out_reset; goto error_out_reset;
} }
@ -2449,7 +2451,8 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
dev->features = dev->hw_features | dev->features = dev->hw_features |
NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_RXCSUM; NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_RXCSUM;
if(register_netdev(dev) < 0) { err = register_netdev(dev);
if (err < 0) {
err_msg = "unable to register netdev"; err_msg = "unable to register netdev";
goto error_out_reset; goto error_out_reset;
} }

View file

@ -410,6 +410,9 @@ void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw)
* Checks to see of the link status of the hardware has changed. If a * Checks to see of the link status of the hardware has changed. If a
* change in link status has been detected, then we read the PHY registers * change in link status has been detected, then we read the PHY registers
* to get the current speed/duplex if link exists. * to get the current speed/duplex if link exists.
*
* Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (link
* up).
**/ **/
s32 e1000e_check_for_copper_link(struct e1000_hw *hw) s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
{ {
@ -423,7 +426,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
* Change or Rx Sequence Error interrupt. * Change or Rx Sequence Error interrupt.
*/ */
if (!mac->get_link_status) if (!mac->get_link_status)
return 0; return 1;
/* First we want to see if the MII Status Register reports /* First we want to see if the MII Status Register reports
* link. If so, then we want to get the current speed/duplex * link. If so, then we want to get the current speed/duplex
@ -461,12 +464,14 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
* different link partner. * different link partner.
*/ */
ret_val = e1000e_config_fc_after_link_up(hw); ret_val = e1000e_config_fc_after_link_up(hw);
if (ret_val) if (ret_val) {
e_dbg("Error configuring flow control\n"); e_dbg("Error configuring flow control\n");
return ret_val; return ret_val;
} }
return 1;
}
/** /**
* e1000e_check_for_fiber_link - Check for link (Fiber) * e1000e_check_for_fiber_link - Check for link (Fiber)
* @hw: pointer to the HW structure * @hw: pointer to the HW structure

View file

@ -5017,7 +5017,7 @@ static bool e1000e_has_link(struct e1000_adapter *adapter)
case e1000_media_type_copper: case e1000_media_type_copper:
if (hw->mac.get_link_status) { if (hw->mac.get_link_status) {
ret_val = hw->mac.ops.check_for_link(hw); ret_val = hw->mac.ops.check_for_link(hw);
link_active = !hw->mac.get_link_status; link_active = ret_val > 0;
} else { } else {
link_active = true; link_active = true;
} }
@ -5035,7 +5035,7 @@ static bool e1000e_has_link(struct e1000_adapter *adapter)
break; break;
} }
if ((ret_val == E1000_ERR_PHY) && (hw->phy.type == e1000_phy_igp_3) && if ((ret_val == -E1000_ERR_PHY) && (hw->phy.type == e1000_phy_igp_3) &&
(er32(CTRL) & E1000_PHY_CTRL_GBE_DISABLE)) { (er32(CTRL) & E1000_PHY_CTRL_GBE_DISABLE)) {
/* See e1000_kmrn_lock_loss_workaround_ich8lan() */ /* See e1000_kmrn_lock_loss_workaround_ich8lan() */
e_info("Gigabit has been disabled, downgrading speed\n"); e_info("Gigabit has been disabled, downgrading speed\n");

View file

@ -1744,6 +1744,7 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
s32 ret_val = 0; s32 ret_val = 0;
u16 i, phy_status; u16 i, phy_status;
*success = false;
for (i = 0; i < iterations; i++) { for (i = 0; i < iterations; i++) {
/* Some PHYs require the MII_BMSR register to be read /* Some PHYs require the MII_BMSR register to be read
* twice due to the link bit being sticky. No harm doing * twice due to the link bit being sticky. No harm doing
@ -1763,16 +1764,16 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); ret_val = e1e_rphy(hw, MII_BMSR, &phy_status);
if (ret_val) if (ret_val)
break; break;
if (phy_status & BMSR_LSTATUS) if (phy_status & BMSR_LSTATUS) {
*success = true;
break; break;
}
if (usec_interval >= 1000) if (usec_interval >= 1000)
msleep(usec_interval / 1000); msleep(usec_interval / 1000);
else else
udelay(usec_interval); udelay(usec_interval);
} }
*success = (i < iterations);
return ret_val; return ret_val;
} }

View file

@ -1226,7 +1226,7 @@ static bool fm10k_clean_tx_irq(struct fm10k_q_vector *q_vector,
break; break;
/* prevent any other reads prior to eop_desc */ /* prevent any other reads prior to eop_desc */
read_barrier_depends(); smp_rmb();
/* if DD is not set pending work has not been completed */ /* if DD is not set pending work has not been completed */
if (!(eop_desc->flags & FM10K_TXD_FLAG_DONE)) if (!(eop_desc->flags & FM10K_TXD_FLAG_DONE))

View file

@ -3595,7 +3595,7 @@ static bool i40e_clean_fdir_tx_irq(struct i40e_ring *tx_ring, int budget)
break; break;
/* prevent any other reads prior to eop_desc */ /* prevent any other reads prior to eop_desc */
read_barrier_depends(); smp_rmb();
/* if the descriptor isn't done, no work yet to do */ /* if the descriptor isn't done, no work yet to do */
if (!(eop_desc->cmd_type_offset_bsz & if (!(eop_desc->cmd_type_offset_bsz &

View file

@ -663,7 +663,7 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
break; break;
/* prevent any other reads prior to eop_desc */ /* prevent any other reads prior to eop_desc */
read_barrier_depends(); smp_rmb();
/* we have caught up to head, no work left to do */ /* we have caught up to head, no work left to do */
if (tx_head == tx_desc) if (tx_head == tx_desc)

View file

@ -172,7 +172,7 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
break; break;
/* prevent any other reads prior to eop_desc */ /* prevent any other reads prior to eop_desc */
read_barrier_depends(); smp_rmb();
/* we have caught up to head, no work left to do */ /* we have caught up to head, no work left to do */
if (tx_head == tx_desc) if (tx_head == tx_desc)

View file

@ -6433,7 +6433,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
break; break;
/* prevent any other reads prior to eop_desc */ /* prevent any other reads prior to eop_desc */
read_barrier_depends(); smp_rmb();
/* if DD is not set pending work has not been completed */ /* if DD is not set pending work has not been completed */
if (!(eop_desc->wb.status & cpu_to_le32(E1000_TXD_STAT_DD))) if (!(eop_desc->wb.status & cpu_to_le32(E1000_TXD_STAT_DD)))

View file

@ -809,7 +809,7 @@ static bool igbvf_clean_tx_irq(struct igbvf_ring *tx_ring)
break; break;
/* prevent any other reads prior to eop_desc */ /* prevent any other reads prior to eop_desc */
read_barrier_depends(); smp_rmb();
/* if DD is not set pending work has not been completed */ /* if DD is not set pending work has not been completed */
if (!(eop_desc->wb.status & cpu_to_le32(E1000_TXD_STAT_DD))) if (!(eop_desc->wb.status & cpu_to_le32(E1000_TXD_STAT_DD)))

View file

@ -1114,7 +1114,7 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
break; break;
/* prevent any other reads prior to eop_desc */ /* prevent any other reads prior to eop_desc */
read_barrier_depends(); smp_rmb();
/* if DD is not set pending work has not been completed */ /* if DD is not set pending work has not been completed */
if (!(eop_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD))) if (!(eop_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD)))

View file

@ -312,7 +312,7 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_q_vector *q_vector,
break; break;
/* prevent any other reads prior to eop_desc */ /* prevent any other reads prior to eop_desc */
read_barrier_depends(); smp_rmb();
/* if DD is not set pending work has not been completed */ /* if DD is not set pending work has not been completed */
if (!(eop_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD))) if (!(eop_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD)))

View file

@ -548,8 +548,11 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar)
"boot get otp board id result 0x%08x board_id %d chip_id %d\n", "boot get otp board id result 0x%08x board_id %d chip_id %d\n",
result, board_id, chip_id); result, board_id, chip_id);
if ((result & ATH10K_BMI_BOARD_ID_STATUS_MASK) != 0) if ((result & ATH10K_BMI_BOARD_ID_STATUS_MASK) != 0 ||
(board_id == 0)) {
ath10k_warn(ar, "board id is not exist in otp, ignore it\n");
return -EOPNOTSUPP; return -EOPNOTSUPP;
}
ar->id.bmi_ids_valid = true; ar->id.bmi_ids_valid = true;
ar->id.bmi_board_id = board_id; ar->id.bmi_board_id = board_id;

View file

@ -1127,6 +1127,36 @@ static int ath10k_monitor_recalc(struct ath10k *ar)
return ath10k_monitor_stop(ar); return ath10k_monitor_stop(ar);
} }
static bool ath10k_mac_can_set_cts_prot(struct ath10k_vif *arvif)
{
struct ath10k *ar = arvif->ar;
lockdep_assert_held(&ar->conf_mutex);
if (!arvif->is_started) {
ath10k_dbg(ar, ATH10K_DBG_MAC, "defer cts setup, vdev is not ready yet\n");
return false;
}
return true;
}
static int ath10k_mac_set_cts_prot(struct ath10k_vif *arvif)
{
struct ath10k *ar = arvif->ar;
u32 vdev_param;
lockdep_assert_held(&ar->conf_mutex);
vdev_param = ar->wmi.vdev_param->protection_mode;
ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d cts_protection %d\n",
arvif->vdev_id, arvif->use_cts_prot);
return ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
arvif->use_cts_prot ? 1 : 0);
}
static int ath10k_recalc_rtscts_prot(struct ath10k_vif *arvif) static int ath10k_recalc_rtscts_prot(struct ath10k_vif *arvif)
{ {
struct ath10k *ar = arvif->ar; struct ath10k *ar = arvif->ar;
@ -4180,7 +4210,8 @@ static int ath10k_mac_txpower_recalc(struct ath10k *ar)
lockdep_assert_held(&ar->conf_mutex); lockdep_assert_held(&ar->conf_mutex);
list_for_each_entry(arvif, &ar->arvifs, list) { list_for_each_entry(arvif, &ar->arvifs, list) {
WARN_ON(arvif->txpower < 0); if (arvif->txpower <= 0)
continue;
if (txpower == -1) if (txpower == -1)
txpower = arvif->txpower; txpower = arvif->txpower;
@ -4188,8 +4219,8 @@ static int ath10k_mac_txpower_recalc(struct ath10k *ar)
txpower = min(txpower, arvif->txpower); txpower = min(txpower, arvif->txpower);
} }
if (WARN_ON(txpower == -1)) if (txpower == -1)
return -EINVAL; return 0;
ret = ath10k_mac_txpower_setup(ar, txpower); ret = ath10k_mac_txpower_setup(ar, txpower);
if (ret) { if (ret) {
@ -4787,20 +4818,18 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
if (changed & BSS_CHANGED_ERP_CTS_PROT) { if (changed & BSS_CHANGED_ERP_CTS_PROT) {
arvif->use_cts_prot = info->use_cts_prot; arvif->use_cts_prot = info->use_cts_prot;
ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d cts_prot %d\n",
arvif->vdev_id, info->use_cts_prot);
ret = ath10k_recalc_rtscts_prot(arvif); ret = ath10k_recalc_rtscts_prot(arvif);
if (ret) if (ret)
ath10k_warn(ar, "failed to recalculate rts/cts prot for vdev %d: %d\n", ath10k_warn(ar, "failed to recalculate rts/cts prot for vdev %d: %d\n",
arvif->vdev_id, ret); arvif->vdev_id, ret);
vdev_param = ar->wmi.vdev_param->protection_mode; if (ath10k_mac_can_set_cts_prot(arvif)) {
ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, ret = ath10k_mac_set_cts_prot(arvif);
info->use_cts_prot ? 1 : 0);
if (ret) if (ret)
ath10k_warn(ar, "failed to set protection mode %d on vdev %i: %d\n", ath10k_warn(ar, "failed to set cts protection for vdev %d: %d\n",
info->use_cts_prot, arvif->vdev_id, ret); arvif->vdev_id, ret);
}
} }
if (changed & BSS_CHANGED_ERP_SLOT) { if (changed & BSS_CHANGED_ERP_SLOT) {
@ -6712,6 +6741,13 @@ ath10k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
arvif->is_up = true; arvif->is_up = true;
} }
if (ath10k_mac_can_set_cts_prot(arvif)) {
ret = ath10k_mac_set_cts_prot(arvif);
if (ret)
ath10k_warn(ar, "failed to set cts protection for vdev %d: %d\n",
arvif->vdev_id, ret);
}
mutex_unlock(&ar->conf_mutex); mutex_unlock(&ar->conf_mutex);
return 0; return 0;

View file

@ -1105,8 +1105,10 @@ static int ath10k_wmi_tlv_op_pull_fw_stats(struct ath10k *ar,
struct ath10k_fw_stats_pdev *dst; struct ath10k_fw_stats_pdev *dst;
src = data; src = data;
if (data_len < sizeof(*src)) if (data_len < sizeof(*src)) {
kfree(tb);
return -EPROTO; return -EPROTO;
}
data += sizeof(*src); data += sizeof(*src);
data_len -= sizeof(*src); data_len -= sizeof(*src);
@ -1126,8 +1128,10 @@ static int ath10k_wmi_tlv_op_pull_fw_stats(struct ath10k *ar,
struct ath10k_fw_stats_vdev *dst; struct ath10k_fw_stats_vdev *dst;
src = data; src = data;
if (data_len < sizeof(*src)) if (data_len < sizeof(*src)) {
kfree(tb);
return -EPROTO; return -EPROTO;
}
data += sizeof(*src); data += sizeof(*src);
data_len -= sizeof(*src); data_len -= sizeof(*src);
@ -1145,8 +1149,10 @@ static int ath10k_wmi_tlv_op_pull_fw_stats(struct ath10k *ar,
struct ath10k_fw_stats_peer *dst; struct ath10k_fw_stats_peer *dst;
src = data; src = data;
if (data_len < sizeof(*src)) if (data_len < sizeof(*src)) {
kfree(tb);
return -EPROTO; return -EPROTO;
}
data += sizeof(*src); data += sizeof(*src);
data_len -= sizeof(*src); data_len -= sizeof(*src);

View file

@ -664,7 +664,7 @@ void rtl92ee_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
bool rtstatus;
u32 totalpacketlen; u32 totalpacketlen;
u8 u1rsvdpageloc[5] = { 0 }; u8 u1rsvdpageloc[5] = { 0 };
bool b_dlok = false; bool b_dlok = false;
@ -727,6 +727,8 @@ void rtl92ee_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
memcpy((u8 *)skb_put(skb, totalpacketlen), memcpy((u8 *)skb_put(skb, totalpacketlen),
&reserved_page_packet, totalpacketlen); &reserved_page_packet, totalpacketlen);
rtstatus = rtl_cmd_send_packet(hw, skb);
if (rtstatus)
b_dlok = true; b_dlok = true;
if (b_dlok) { if (b_dlok) {

View file

@ -1377,6 +1377,7 @@ static void _rtl8821ae_get_wakeup_reason(struct ieee80211_hw *hw)
ppsc->wakeup_reason = 0; ppsc->wakeup_reason = 0;
do_gettimeofday(&ts);
rtlhal->last_suspend_sec = ts.tv_sec; rtlhal->last_suspend_sec = ts.tv_sec;
switch (fw_reason) { switch (fw_reason) {

View file

@ -823,7 +823,7 @@ static int init_labels(struct nd_mapping *nd_mapping, int num_labels)
nsindex = to_namespace_index(ndd, 0); nsindex = to_namespace_index(ndd, 0);
memset(nsindex, 0, ndd->nsarea.config_size); memset(nsindex, 0, ndd->nsarea.config_size);
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
int rc = nd_label_write_index(ndd, i, i*2, ND_NSINDEX_INIT); int rc = nd_label_write_index(ndd, i, 3 - i, ND_NSINDEX_INIT);
if (rc) if (rc)
return rc; return rc;

View file

@ -1305,7 +1305,7 @@ static umode_t namespace_visible(struct kobject *kobj,
if (a == &dev_attr_resource.attr) { if (a == &dev_attr_resource.attr) {
if (is_namespace_blk(dev)) if (is_namespace_blk(dev))
return 0; return 0;
return a->mode; return 0400;
} }
if (is_namespace_pmem(dev) || is_namespace_blk(dev)) { if (is_namespace_pmem(dev) || is_namespace_blk(dev)) {

View file

@ -1414,7 +1414,15 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp)
static void program_hpp_type1(struct pci_dev *dev, struct hpp_type1 *hpp) static void program_hpp_type1(struct pci_dev *dev, struct hpp_type1 *hpp)
{ {
if (hpp) int pos;
if (!hpp)
return;
pos = pci_find_capability(dev, PCI_CAP_ID_PCIX);
if (!pos)
return;
dev_warn(&dev->dev, "PCI-X settings not supported\n"); dev_warn(&dev->dev, "PCI-X settings not supported\n");
} }
@ -1441,6 +1449,9 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
if (!hpp) if (!hpp)
return; return;
if (!pci_is_pcie(dev))
return;
if (hpp->revision > 1) { if (hpp->revision > 1) {
dev_warn(&dev->dev, "PCIe settings rev %d not supported\n", dev_warn(&dev->dev, "PCIe settings rev %d not supported\n",
hpp->revision); hpp->revision);

View file

@ -315,6 +315,7 @@ config SPI_FSL_SPI
config SPI_FSL_DSPI config SPI_FSL_DSPI
tristate "Freescale DSPI controller" tristate "Freescale DSPI controller"
select REGMAP_MMIO select REGMAP_MMIO
depends on HAS_DMA
depends on SOC_VF610 || SOC_LS1021A || ARCH_LAYERSCAPE || COMPILE_TEST depends on SOC_VF610 || SOC_LS1021A || ARCH_LAYERSCAPE || COMPILE_TEST
help help
This enables support for the Freescale DSPI controller in master This enables support for the Freescale DSPI controller in master

View file

@ -272,7 +272,7 @@ static int ad7150_write_event_config(struct iio_dev *indio_dev,
error_ret: error_ret:
mutex_unlock(&chip->state_lock); mutex_unlock(&chip->state_lock);
return 0; return ret;
} }
static int ad7150_read_event_value(struct iio_dev *indio_dev, static int ad7150_read_event_value(struct iio_dev *indio_dev,

View file

@ -1923,13 +1923,15 @@ attach:
if (!(hdr->opcode & ISCSI_OP_IMMEDIATE)) { if (!(hdr->opcode & ISCSI_OP_IMMEDIATE)) {
int cmdsn_ret = iscsit_sequence_cmd(conn, cmd, buf, hdr->cmdsn); int cmdsn_ret = iscsit_sequence_cmd(conn, cmd, buf, hdr->cmdsn);
if (cmdsn_ret == CMDSN_HIGHER_THAN_EXP) if (cmdsn_ret == CMDSN_HIGHER_THAN_EXP) {
out_of_order_cmdsn = 1; out_of_order_cmdsn = 1;
else if (cmdsn_ret == CMDSN_LOWER_THAN_EXP) } else if (cmdsn_ret == CMDSN_LOWER_THAN_EXP) {
target_put_sess_cmd(&cmd->se_cmd);
return 0; return 0;
else if (cmdsn_ret == CMDSN_ERROR_CANNOT_RECOVER) } else if (cmdsn_ret == CMDSN_ERROR_CANNOT_RECOVER) {
return -1; return -1;
} }
}
iscsit_ack_from_expstatsn(conn, be32_to_cpu(hdr->exp_statsn)); iscsit_ack_from_expstatsn(conn, be32_to_cpu(hdr->exp_statsn));
if (out_of_order_cmdsn || !(hdr->opcode & ISCSI_OP_IMMEDIATE)) if (out_of_order_cmdsn || !(hdr->opcode & ISCSI_OP_IMMEDIATE))

View file

@ -1970,6 +1970,8 @@ static void target_restart_delayed_cmds(struct se_device *dev)
list_del(&cmd->se_delayed_node); list_del(&cmd->se_delayed_node);
spin_unlock(&dev->delayed_cmd_lock); spin_unlock(&dev->delayed_cmd_lock);
cmd->transport_state |= CMD_T_SENT;
__target_execute_cmd(cmd, true); __target_execute_cmd(cmd, true);
if (cmd->sam_task_attr == TCM_ORDERED_TAG) if (cmd->sam_task_attr == TCM_ORDERED_TAG)
@ -2007,6 +2009,8 @@ static void transport_complete_task_attr(struct se_cmd *cmd)
pr_debug("Incremented dev_cur_ordered_id: %u for ORDERED\n", pr_debug("Incremented dev_cur_ordered_id: %u for ORDERED\n",
dev->dev_cur_ordered_id); dev->dev_cur_ordered_id);
} }
cmd->se_cmd_flags &= ~SCF_TASK_ATTR_SET;
restart: restart:
target_restart_delayed_cmds(dev); target_restart_delayed_cmds(dev);
} }

View file

@ -703,6 +703,7 @@ vhost_scsi_iov_to_sgl(struct vhost_scsi_cmd *cmd, bool write,
struct scatterlist *sg, int sg_count) struct scatterlist *sg, int sg_count)
{ {
size_t off = iter->iov_offset; size_t off = iter->iov_offset;
struct scatterlist *p = sg;
int i, ret; int i, ret;
for (i = 0; i < iter->nr_segs; i++) { for (i = 0; i < iter->nr_segs; i++) {
@ -711,8 +712,8 @@ vhost_scsi_iov_to_sgl(struct vhost_scsi_cmd *cmd, bool write,
ret = vhost_scsi_map_to_sgl(cmd, base, len, sg, write); ret = vhost_scsi_map_to_sgl(cmd, base, len, sg, write);
if (ret < 0) { if (ret < 0) {
for (i = 0; i < sg_count; i++) { while (p < sg) {
struct page *page = sg_page(&sg[i]); struct page *page = sg_page(p++);
if (page) if (page)
put_page(page); put_page(page);
} }

View file

@ -316,7 +316,7 @@ static int xenbus_write_transaction(unsigned msg_type,
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
} }
} else if (msg_type == XS_TRANSACTION_END) { } else if (u->u.msg.tx_id != 0) {
list_for_each_entry(trans, &u->transactions, list) list_for_each_entry(trans, &u->transactions, list)
if (trans->handle.id == u->u.msg.tx_id) if (trans->handle.id == u->u.msg.tx_id)
break; break;

View file

@ -483,6 +483,9 @@ static int v9fs_test_inode(struct inode *inode, void *data)
if (v9inode->qid.type != st->qid.type) if (v9inode->qid.type != st->qid.type)
return 0; return 0;
if (v9inode->qid.path != st->qid.path)
return 0;
return 1; return 1;
} }

View file

@ -87,6 +87,9 @@ static int v9fs_test_inode_dotl(struct inode *inode, void *data)
if (v9inode->qid.type != st->qid.type) if (v9inode->qid.type != st->qid.type)
return 0; return 0;
if (v9inode->qid.path != st->qid.path)
return 0;
return 1; return 1;
} }

View file

@ -87,7 +87,8 @@ static int autofs4_write(struct autofs_sb_info *sbi,
spin_unlock_irqrestore(&current->sighand->siglock, flags); spin_unlock_irqrestore(&current->sighand->siglock, flags);
} }
return (bytes > 0); /* if 'wr' returned 0 (impossible) we assume -EIO (safe) */
return bytes == 0 ? 0 : wr < 0 ? wr : -EIO;
} }
static void autofs4_notify_daemon(struct autofs_sb_info *sbi, static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
@ -101,6 +102,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
} pkt; } pkt;
struct file *pipe = NULL; struct file *pipe = NULL;
size_t pktsz; size_t pktsz;
int ret;
DPRINTK("wait id = 0x%08lx, name = %.*s, type=%d", DPRINTK("wait id = 0x%08lx, name = %.*s, type=%d",
(unsigned long) wq->wait_queue_token, wq->name.len, wq->name.name, type); (unsigned long) wq->wait_queue_token, wq->name.len, wq->name.name, type);
@ -173,7 +175,18 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
mutex_unlock(&sbi->wq_mutex); mutex_unlock(&sbi->wq_mutex);
if (autofs4_write(sbi, pipe, &pkt, pktsz)) if (autofs4_write(sbi, pipe, &pkt, pktsz))
switch (ret = autofs4_write(sbi, pipe, &pkt, pktsz)) {
case 0:
break;
case -ENOMEM:
case -ERESTARTSYS:
/* Just fail this one */
autofs4_wait_release(sbi, wq->wait_queue_token, ret);
break;
default:
autofs4_catatonic_mode(sbi); autofs4_catatonic_mode(sbi);
break;
}
fput(pipe); fput(pipe);
} }

View file

@ -348,7 +348,5 @@ skip:
out: out:
btrfs_free_path(path); btrfs_free_path(path);
if (ret) return ret;
btrfs_warn(fs_info, "btrfs_uuid_tree_iterate failed %d", ret);
return 0;
} }

View file

@ -442,13 +442,14 @@ void ecryptfs_release_messaging(void)
} }
if (ecryptfs_daemon_hash) { if (ecryptfs_daemon_hash) {
struct ecryptfs_daemon *daemon; struct ecryptfs_daemon *daemon;
struct hlist_node *n;
int i; int i;
mutex_lock(&ecryptfs_daemon_hash_mux); mutex_lock(&ecryptfs_daemon_hash_mux);
for (i = 0; i < (1 << ecryptfs_hash_bits); i++) { for (i = 0; i < (1 << ecryptfs_hash_bits); i++) {
int rc; int rc;
hlist_for_each_entry(daemon, hlist_for_each_entry_safe(daemon, n,
&ecryptfs_daemon_hash[i], &ecryptfs_daemon_hash[i],
euid_chain) { euid_chain) {
rc = ecryptfs_exorcise_daemon(daemon); rc = ecryptfs_exorcise_daemon(daemon);

View file

@ -214,11 +214,9 @@ int ext4_get_encryption_info(struct inode *inode)
if (ei->i_crypt_info) if (ei->i_crypt_info)
return 0; return 0;
if (!ext4_read_workqueue) {
res = ext4_init_crypto(); res = ext4_init_crypto();
if (res) if (res)
return res; return res;
}
res = ext4_xattr_get(inode, EXT4_XATTR_INDEX_ENCRYPTION, res = ext4_xattr_get(inode, EXT4_XATTR_INDEX_ENCRYPTION,
EXT4_XATTR_NAME_ENCRYPTION_CONTEXT, EXT4_XATTR_NAME_ENCRYPTION_CONTEXT,

View file

@ -4818,7 +4818,8 @@ static long ext4_zero_range(struct file *file, loff_t offset,
} }
if (!(mode & FALLOC_FL_KEEP_SIZE) && if (!(mode & FALLOC_FL_KEEP_SIZE) &&
offset + len > i_size_read(inode)) { (offset + len > i_size_read(inode) ||
offset + len > EXT4_I(inode)->i_disksize)) {
new_size = offset + len; new_size = offset + len;
ret = inode_newsize_ok(inode, new_size); ret = inode_newsize_ok(inode, new_size);
if (ret) if (ret)
@ -4994,7 +4995,8 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
} }
if (!(mode & FALLOC_FL_KEEP_SIZE) && if (!(mode & FALLOC_FL_KEEP_SIZE) &&
offset + len > i_size_read(inode)) { (offset + len > i_size_read(inode) ||
offset + len > EXT4_I(inode)->i_disksize)) {
new_size = offset + len; new_size = offset + len;
ret = inode_newsize_ok(inode, new_size); ret = inode_newsize_ok(inode, new_size);
if (ret) if (ret)

View file

@ -103,7 +103,7 @@ static inline unsigned int isonum_733(char *p)
/* Ignore bigendian datum due to broken mastering programs */ /* Ignore bigendian datum due to broken mastering programs */
return get_unaligned_le32(p); return get_unaligned_le32(p);
} }
extern int iso_date(char *, int); extern int iso_date(u8 *, int);
struct inode; /* To make gcc happy */ struct inode; /* To make gcc happy */

View file

@ -65,7 +65,7 @@ struct RR_PL_s {
}; };
struct stamp { struct stamp {
char time[7]; __u8 time[7]; /* actually 6 unsigned, 1 signed */
} __attribute__ ((packed)); } __attribute__ ((packed));
struct RR_TF_s { struct RR_TF_s {

View file

@ -15,7 +15,7 @@
* to GMT. Thus we should always be correct. * to GMT. Thus we should always be correct.
*/ */
int iso_date(char * p, int flag) int iso_date(u8 *p, int flag)
{ {
int year, month, day, hour, minute, second, tz; int year, month, day, hour, minute, second, tz;
int crtime; int crtime;

View file

@ -242,15 +242,12 @@ const u32 nfs4_fsinfo_bitmap[3] = { FATTR4_WORD0_MAXFILESIZE
}; };
const u32 nfs4_fs_locations_bitmap[3] = { const u32 nfs4_fs_locations_bitmap[3] = {
FATTR4_WORD0_TYPE FATTR4_WORD0_CHANGE
| FATTR4_WORD0_CHANGE
| FATTR4_WORD0_SIZE | FATTR4_WORD0_SIZE
| FATTR4_WORD0_FSID | FATTR4_WORD0_FSID
| FATTR4_WORD0_FILEID | FATTR4_WORD0_FILEID
| FATTR4_WORD0_FS_LOCATIONS, | FATTR4_WORD0_FS_LOCATIONS,
FATTR4_WORD1_MODE FATTR4_WORD1_OWNER
| FATTR4_WORD1_NUMLINKS
| FATTR4_WORD1_OWNER
| FATTR4_WORD1_OWNER_GROUP | FATTR4_WORD1_OWNER_GROUP
| FATTR4_WORD1_RAWDEV | FATTR4_WORD1_RAWDEV
| FATTR4_WORD1_SPACE_USED | FATTR4_WORD1_SPACE_USED
@ -6351,9 +6348,7 @@ static int _nfs4_proc_fs_locations(struct rpc_clnt *client, struct inode *dir,
struct page *page) struct page *page)
{ {
struct nfs_server *server = NFS_SERVER(dir); struct nfs_server *server = NFS_SERVER(dir);
u32 bitmask[3] = { u32 bitmask[3];
[0] = FATTR4_WORD0_FSID | FATTR4_WORD0_FS_LOCATIONS,
};
struct nfs4_fs_locations_arg args = { struct nfs4_fs_locations_arg args = {
.dir_fh = NFS_FH(dir), .dir_fh = NFS_FH(dir),
.name = name, .name = name,
@ -6372,12 +6367,15 @@ static int _nfs4_proc_fs_locations(struct rpc_clnt *client, struct inode *dir,
dprintk("%s: start\n", __func__); dprintk("%s: start\n", __func__);
bitmask[0] = nfs4_fattr_bitmap[0] | FATTR4_WORD0_FS_LOCATIONS;
bitmask[1] = nfs4_fattr_bitmap[1];
/* Ask for the fileid of the absent filesystem if mounted_on_fileid /* Ask for the fileid of the absent filesystem if mounted_on_fileid
* is not supported */ * is not supported */
if (NFS_SERVER(dir)->attr_bitmask[1] & FATTR4_WORD1_MOUNTED_ON_FILEID) if (NFS_SERVER(dir)->attr_bitmask[1] & FATTR4_WORD1_MOUNTED_ON_FILEID)
bitmask[1] |= FATTR4_WORD1_MOUNTED_ON_FILEID; bitmask[0] &= ~FATTR4_WORD0_FILEID;
else else
bitmask[0] |= FATTR4_WORD0_FILEID; bitmask[1] &= ~FATTR4_WORD1_MOUNTED_ON_FILEID;
nfs_fattr_init(&fs_locations->fattr); nfs_fattr_init(&fs_locations->fattr);
fs_locations->server = server; fs_locations->server = server;

View file

@ -1322,7 +1322,7 @@ static int nfs_parse_mount_options(char *raw,
mnt->options |= NFS_OPTION_MIGRATION; mnt->options |= NFS_OPTION_MIGRATION;
break; break;
case Opt_nomigration: case Opt_nomigration:
mnt->options &= NFS_OPTION_MIGRATION; mnt->options &= ~NFS_OPTION_MIGRATION;
break; break;
/* /*

View file

@ -3829,7 +3829,8 @@ static struct nfs4_delegation *find_deleg_stateid(struct nfs4_client *cl, statei
{ {
struct nfs4_stid *ret; struct nfs4_stid *ret;
ret = find_stateid_by_type(cl, s, NFS4_DELEG_STID); ret = find_stateid_by_type(cl, s,
NFS4_DELEG_STID|NFS4_REVOKED_DELEG_STID);
if (!ret) if (!ret)
return NULL; return NULL;
return delegstateid(ret); return delegstateid(ret);
@ -3852,6 +3853,12 @@ nfs4_check_deleg(struct nfs4_client *cl, struct nfsd4_open *open,
deleg = find_deleg_stateid(cl, &open->op_delegate_stateid); deleg = find_deleg_stateid(cl, &open->op_delegate_stateid);
if (deleg == NULL) if (deleg == NULL)
goto out; goto out;
if (deleg->dl_stid.sc_type == NFS4_REVOKED_DELEG_STID) {
nfs4_put_stid(&deleg->dl_stid);
if (cl->cl_minorversion)
status = nfserr_deleg_revoked;
goto out;
}
flags = share_access_to_flags(open->op_share_access); flags = share_access_to_flags(open->op_share_access);
status = nfs4_check_delegmode(deleg, flags); status = nfs4_check_delegmode(deleg, flags);
if (status) { if (status) {
@ -4696,6 +4703,16 @@ nfsd4_lookup_stateid(struct nfsd4_compound_state *cstate,
struct nfs4_stid **s, struct nfsd_net *nn) struct nfs4_stid **s, struct nfsd_net *nn)
{ {
__be32 status; __be32 status;
bool return_revoked = false;
/*
* only return revoked delegations if explicitly asked.
* otherwise we report revoked or bad_stateid status.
*/
if (typemask & NFS4_REVOKED_DELEG_STID)
return_revoked = true;
else if (typemask & NFS4_DELEG_STID)
typemask |= NFS4_REVOKED_DELEG_STID;
if (ZERO_STATEID(stateid) || ONE_STATEID(stateid)) if (ZERO_STATEID(stateid) || ONE_STATEID(stateid))
return nfserr_bad_stateid; return nfserr_bad_stateid;
@ -4710,6 +4727,12 @@ nfsd4_lookup_stateid(struct nfsd4_compound_state *cstate,
*s = find_stateid_by_type(cstate->clp, stateid, typemask); *s = find_stateid_by_type(cstate->clp, stateid, typemask);
if (!*s) if (!*s)
return nfserr_bad_stateid; return nfserr_bad_stateid;
if (((*s)->sc_type == NFS4_REVOKED_DELEG_STID) && !return_revoked) {
nfs4_put_stid(*s);
if (cstate->minorversion)
return nfserr_deleg_revoked;
return nfserr_bad_stateid;
}
return nfs_ok; return nfs_ok;
} }

View file

@ -1945,8 +1945,6 @@ static int nilfs_segctor_collect_dirty_files(struct nilfs_sc_info *sci,
"failed to get inode block.\n"); "failed to get inode block.\n");
return err; return err;
} }
mark_buffer_dirty(ibh);
nilfs_mdt_mark_dirty(ifile);
spin_lock(&nilfs->ns_inode_lock); spin_lock(&nilfs->ns_inode_lock);
if (likely(!ii->i_bh)) if (likely(!ii->i_bh))
ii->i_bh = ibh; ii->i_bh = ibh;
@ -1955,6 +1953,10 @@ static int nilfs_segctor_collect_dirty_files(struct nilfs_sc_info *sci,
goto retry; goto retry;
} }
// Always redirty the buffer to avoid race condition
mark_buffer_dirty(ii->i_bh);
nilfs_mdt_mark_dirty(ifile);
clear_bit(NILFS_I_QUEUED, &ii->i_state); clear_bit(NILFS_I_QUEUED, &ii->i_state);
set_bit(NILFS_I_BUSY, &ii->i_state); set_bit(NILFS_I_BUSY, &ii->i_state);
list_move_tail(&ii->i_dirty, &sci->sc_dirty_files); list_move_tail(&ii->i_dirty, &sci->sc_dirty_files);

View file

@ -455,20 +455,22 @@ TRACE_EVENT(svc_recv,
TP_ARGS(rqst, status), TP_ARGS(rqst, status),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(struct sockaddr *, addr)
__field(__be32, xid) __field(__be32, xid)
__field(int, status) __field(int, status)
__field(unsigned long, flags) __field(unsigned long, flags)
__dynamic_array(unsigned char, addr, rqst->rq_addrlen)
), ),
TP_fast_assign( TP_fast_assign(
__entry->addr = (struct sockaddr *)&rqst->rq_addr;
__entry->xid = status > 0 ? rqst->rq_xid : 0; __entry->xid = status > 0 ? rqst->rq_xid : 0;
__entry->status = status; __entry->status = status;
__entry->flags = rqst->rq_flags; __entry->flags = rqst->rq_flags;
memcpy(__get_dynamic_array(addr),
&rqst->rq_addr, rqst->rq_addrlen);
), ),
TP_printk("addr=%pIScp xid=0x%x status=%d flags=%s", __entry->addr, TP_printk("addr=%pIScp xid=0x%x status=%d flags=%s",
(struct sockaddr *)__get_dynamic_array(addr),
be32_to_cpu(__entry->xid), __entry->status, be32_to_cpu(__entry->xid), __entry->status,
show_rqstp_flags(__entry->flags)) show_rqstp_flags(__entry->flags))
); );
@ -480,22 +482,23 @@ DECLARE_EVENT_CLASS(svc_rqst_status,
TP_ARGS(rqst, status), TP_ARGS(rqst, status),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(struct sockaddr *, addr)
__field(__be32, xid) __field(__be32, xid)
__field(int, dropme)
__field(int, status) __field(int, status)
__field(unsigned long, flags) __field(unsigned long, flags)
__dynamic_array(unsigned char, addr, rqst->rq_addrlen)
), ),
TP_fast_assign( TP_fast_assign(
__entry->addr = (struct sockaddr *)&rqst->rq_addr;
__entry->xid = rqst->rq_xid; __entry->xid = rqst->rq_xid;
__entry->status = status; __entry->status = status;
__entry->flags = rqst->rq_flags; __entry->flags = rqst->rq_flags;
memcpy(__get_dynamic_array(addr),
&rqst->rq_addr, rqst->rq_addrlen);
), ),
TP_printk("addr=%pIScp rq_xid=0x%x status=%d flags=%s", TP_printk("addr=%pIScp rq_xid=0x%x status=%d flags=%s",
__entry->addr, be32_to_cpu(__entry->xid), (struct sockaddr *)__get_dynamic_array(addr),
be32_to_cpu(__entry->xid),
__entry->status, show_rqstp_flags(__entry->flags)) __entry->status, show_rqstp_flags(__entry->flags))
); );

View file

@ -619,8 +619,7 @@ void resched_cpu(int cpu)
struct rq *rq = cpu_rq(cpu); struct rq *rq = cpu_rq(cpu);
unsigned long flags; unsigned long flags;
if (!raw_spin_trylock_irqsave(&rq->lock, flags)) raw_spin_lock_irqsave(&rq->lock, flags);
return;
resched_curr(rq); resched_curr(rq);
raw_spin_unlock_irqrestore(&rq->lock, flags); raw_spin_unlock_irqrestore(&rq->lock, flags);
} }
@ -6106,6 +6105,12 @@ static int init_rootdomain(struct root_domain *rd)
if (!zalloc_cpumask_var(&rd->rto_mask, GFP_KERNEL)) if (!zalloc_cpumask_var(&rd->rto_mask, GFP_KERNEL))
goto free_dlo_mask; goto free_dlo_mask;
#ifdef HAVE_RT_PUSH_IPI
rd->rto_cpu = -1;
raw_spin_lock_init(&rd->rto_lock);
init_irq_work(&rd->rto_push_work, rto_push_irq_work_func);
#endif
init_dl_bw(&rd->dl_bw); init_dl_bw(&rd->dl_bw);
if (cpudl_init(&rd->cpudl) != 0) if (cpudl_init(&rd->cpudl) != 0)
goto free_dlo_mask; goto free_dlo_mask;

View file

@ -67,10 +67,6 @@ static void start_rt_bandwidth(struct rt_bandwidth *rt_b)
raw_spin_unlock(&rt_b->rt_runtime_lock); raw_spin_unlock(&rt_b->rt_runtime_lock);
} }
#if defined(CONFIG_SMP) && defined(HAVE_RT_PUSH_IPI)
static void push_irq_work_func(struct irq_work *work);
#endif
void init_rt_rq(struct rt_rq *rt_rq) void init_rt_rq(struct rt_rq *rt_rq)
{ {
struct rt_prio_array *array; struct rt_prio_array *array;
@ -90,13 +86,6 @@ void init_rt_rq(struct rt_rq *rt_rq)
rt_rq->rt_nr_migratory = 0; rt_rq->rt_nr_migratory = 0;
rt_rq->overloaded = 0; rt_rq->overloaded = 0;
plist_head_init(&rt_rq->pushable_tasks); plist_head_init(&rt_rq->pushable_tasks);
#ifdef HAVE_RT_PUSH_IPI
rt_rq->push_flags = 0;
rt_rq->push_cpu = nr_cpu_ids;
raw_spin_lock_init(&rt_rq->push_lock);
init_irq_work(&rt_rq->push_work, push_irq_work_func);
#endif
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
/* We start is dequeued state, because no RT tasks are queued */ /* We start is dequeued state, because no RT tasks are queued */
rt_rq->rt_queued = 0; rt_rq->rt_queued = 0;
@ -1867,160 +1856,166 @@ static void push_rt_tasks(struct rq *rq)
} }
#ifdef HAVE_RT_PUSH_IPI #ifdef HAVE_RT_PUSH_IPI
/* /*
* The search for the next cpu always starts at rq->cpu and ends * When a high priority task schedules out from a CPU and a lower priority
* when we reach rq->cpu again. It will never return rq->cpu. * task is scheduled in, a check is made to see if there's any RT tasks
* This returns the next cpu to check, or nr_cpu_ids if the loop * on other CPUs that are waiting to run because a higher priority RT task
* is complete. * is currently running on its CPU. In this case, the CPU with multiple RT
* tasks queued on it (overloaded) needs to be notified that a CPU has opened
* up that may be able to run one of its non-running queued RT tasks.
*
* All CPUs with overloaded RT tasks need to be notified as there is currently
* no way to know which of these CPUs have the highest priority task waiting
* to run. Instead of trying to take a spinlock on each of these CPUs,
* which has shown to cause large latency when done on machines with many
* CPUs, sending an IPI to the CPUs to have them push off the overloaded
* RT tasks waiting to run.
*
* Just sending an IPI to each of the CPUs is also an issue, as on large
* count CPU machines, this can cause an IPI storm on a CPU, especially
* if its the only CPU with multiple RT tasks queued, and a large number
* of CPUs scheduling a lower priority task at the same time.
*
* Each root domain has its own irq work function that can iterate over
* all CPUs with RT overloaded tasks. Since all CPUs with overloaded RT
* tassk must be checked if there's one or many CPUs that are lowering
* their priority, there's a single irq work iterator that will try to
* push off RT tasks that are waiting to run.
*
* When a CPU schedules a lower priority task, it will kick off the
* irq work iterator that will jump to each CPU with overloaded RT tasks.
* As it only takes the first CPU that schedules a lower priority task
* to start the process, the rto_start variable is incremented and if
* the atomic result is one, then that CPU will try to take the rto_lock.
* This prevents high contention on the lock as the process handles all
* CPUs scheduling lower priority tasks.
*
* All CPUs that are scheduling a lower priority task will increment the
* rt_loop_next variable. This will make sure that the irq work iterator
* checks all RT overloaded CPUs whenever a CPU schedules a new lower
* priority task, even if the iterator is in the middle of a scan. Incrementing
* the rt_loop_next will cause the iterator to perform another scan.
* *
* rq->rt.push_cpu holds the last cpu returned by this function,
* or if this is the first instance, it must hold rq->cpu.
*/ */
static int rto_next_cpu(struct rq *rq) static int rto_next_cpu(struct rq *rq)
{ {
int prev_cpu = rq->rt.push_cpu; struct root_domain *rd = rq->rd;
int next;
int cpu; int cpu;
cpu = cpumask_next(prev_cpu, rq->rd->rto_mask);
/* /*
* If the previous cpu is less than the rq's CPU, then it already * When starting the IPI RT pushing, the rto_cpu is set to -1,
* passed the end of the mask, and has started from the beginning. * rt_next_cpu() will simply return the first CPU found in
* We end if the next CPU is greater or equal to rq's CPU. * the rto_mask.
*
* If rto_next_cpu() is called with rto_cpu is a valid cpu, it
* will return the next CPU found in the rto_mask.
*
* If there are no more CPUs left in the rto_mask, then a check is made
* against rto_loop and rto_loop_next. rto_loop is only updated with
* the rto_lock held, but any CPU may increment the rto_loop_next
* without any locking.
*/ */
if (prev_cpu < rq->cpu) { for (;;) {
if (cpu >= rq->cpu)
return nr_cpu_ids;
} else if (cpu >= nr_cpu_ids) { /* When rto_cpu is -1 this acts like cpumask_first() */
/* cpu = cpumask_next(rd->rto_cpu, rd->rto_mask);
* We passed the end of the mask, start at the beginning.
* If the result is greater or equal to the rq's CPU, then
* the loop is finished.
*/
cpu = cpumask_first(rq->rd->rto_mask);
if (cpu >= rq->cpu)
return nr_cpu_ids;
}
rq->rt.push_cpu = cpu;
/* Return cpu to let the caller know if the loop is finished or not */ rd->rto_cpu = cpu;
if (cpu < nr_cpu_ids)
return cpu; return cpu;
rd->rto_cpu = -1;
/*
* ACQUIRE ensures we see the @rto_mask changes
* made prior to the @next value observed.
*
* Matches WMB in rt_set_overload().
*/
next = atomic_read_acquire(&rd->rto_loop_next);
if (rd->rto_loop == next)
break;
rd->rto_loop = next;
} }
static int find_next_push_cpu(struct rq *rq) return -1;
}
static inline bool rto_start_trylock(atomic_t *v)
{ {
struct rq *next_rq; return !atomic_cmpxchg_acquire(v, 0, 1);
int cpu;
while (1) {
cpu = rto_next_cpu(rq);
if (cpu >= nr_cpu_ids)
break;
next_rq = cpu_rq(cpu);
/* Make sure the next rq can push to this rq */
if (next_rq->rt.highest_prio.next < rq->rt.highest_prio.curr)
break;
} }
return cpu; static inline void rto_start_unlock(atomic_t *v)
{
atomic_set_release(v, 0);
} }
#define RT_PUSH_IPI_EXECUTING 1
#define RT_PUSH_IPI_RESTART 2
static void tell_cpu_to_push(struct rq *rq) static void tell_cpu_to_push(struct rq *rq)
{ {
int cpu; int cpu = -1;
/* Keep the loop going if the IPI is currently active */
atomic_inc(&rq->rd->rto_loop_next);
/* Only one CPU can initiate a loop at a time */
if (!rto_start_trylock(&rq->rd->rto_loop_start))
return;
raw_spin_lock(&rq->rd->rto_lock);
if (rq->rt.push_flags & RT_PUSH_IPI_EXECUTING) {
raw_spin_lock(&rq->rt.push_lock);
/* Make sure it's still executing */
if (rq->rt.push_flags & RT_PUSH_IPI_EXECUTING) {
/* /*
* Tell the IPI to restart the loop as things have * The rto_cpu is updated under the lock, if it has a valid cpu
* changed since it started. * then the IPI is still running and will continue due to the
* update to loop_next, and nothing needs to be done here.
* Otherwise it is finishing up and an ipi needs to be sent.
*/ */
rq->rt.push_flags |= RT_PUSH_IPI_RESTART; if (rq->rd->rto_cpu < 0)
raw_spin_unlock(&rq->rt.push_lock); cpu = rto_next_cpu(rq);
return;
}
raw_spin_unlock(&rq->rt.push_lock);
}
/* When here, there's no IPI going around */ raw_spin_unlock(&rq->rd->rto_lock);
rq->rt.push_cpu = rq->cpu; rto_start_unlock(&rq->rd->rto_loop_start);
cpu = find_next_push_cpu(rq);
if (cpu >= nr_cpu_ids)
return;
rq->rt.push_flags = RT_PUSH_IPI_EXECUTING; if (cpu >= 0)
irq_work_queue_on(&rq->rd->rto_push_work, cpu);
irq_work_queue_on(&rq->rt.push_work, cpu);
} }
/* Called from hardirq context */ /* Called from hardirq context */
static void try_to_push_tasks(void *arg) void rto_push_irq_work_func(struct irq_work *work)
{ {
struct rt_rq *rt_rq = arg; struct rq *rq;
struct rq *rq, *src_rq;
int this_cpu;
int cpu; int cpu;
this_cpu = rt_rq->push_cpu; rq = this_rq();
/* Paranoid check */ /*
BUG_ON(this_cpu != smp_processor_id()); * We do not need to grab the lock to check for has_pushable_tasks.
* When it gets updated, a check is made if a push is possible.
rq = cpu_rq(this_cpu); */
src_rq = rq_of_rt_rq(rt_rq);
again:
if (has_pushable_tasks(rq)) { if (has_pushable_tasks(rq)) {
raw_spin_lock(&rq->lock); raw_spin_lock(&rq->lock);
push_rt_task(rq); push_rt_tasks(rq);
raw_spin_unlock(&rq->lock); raw_spin_unlock(&rq->lock);
} }
raw_spin_lock(&rq->rd->rto_lock);
/* Pass the IPI to the next rt overloaded queue */ /* Pass the IPI to the next rt overloaded queue */
raw_spin_lock(&rt_rq->push_lock); cpu = rto_next_cpu(rq);
/*
* If the source queue changed since the IPI went out,
* we need to restart the search from that CPU again.
*/
if (rt_rq->push_flags & RT_PUSH_IPI_RESTART) {
rt_rq->push_flags &= ~RT_PUSH_IPI_RESTART;
rt_rq->push_cpu = src_rq->cpu;
}
cpu = find_next_push_cpu(src_rq); raw_spin_unlock(&rq->rd->rto_lock);
if (cpu >= nr_cpu_ids) if (cpu < 0)
rt_rq->push_flags &= ~RT_PUSH_IPI_EXECUTING;
raw_spin_unlock(&rt_rq->push_lock);
if (cpu >= nr_cpu_ids)
return; return;
/*
* It is possible that a restart caused this CPU to be
* chosen again. Don't bother with an IPI, just see if we
* have more to push.
*/
if (unlikely(cpu == rq->cpu))
goto again;
/* Try the next RT overloaded CPU */ /* Try the next RT overloaded CPU */
irq_work_queue_on(&rt_rq->push_work, cpu); irq_work_queue_on(&rq->rd->rto_push_work, cpu);
}
static void push_irq_work_func(struct irq_work *work)
{
struct rt_rq *rt_rq = container_of(work, struct rt_rq, push_work);
try_to_push_tasks(rt_rq);
} }
#endif /* HAVE_RT_PUSH_IPI */ #endif /* HAVE_RT_PUSH_IPI */

View file

@ -444,7 +444,7 @@ static inline int rt_bandwidth_enabled(void)
} }
/* RT IPI pull logic requires IRQ_WORK */ /* RT IPI pull logic requires IRQ_WORK */
#ifdef CONFIG_IRQ_WORK #if defined(CONFIG_IRQ_WORK) && defined(CONFIG_SMP)
# define HAVE_RT_PUSH_IPI # define HAVE_RT_PUSH_IPI
#endif #endif
@ -465,12 +465,6 @@ struct rt_rq {
unsigned long rt_nr_total; unsigned long rt_nr_total;
int overloaded; int overloaded;
struct plist_head pushable_tasks; struct plist_head pushable_tasks;
#ifdef HAVE_RT_PUSH_IPI
int push_flags;
int push_cpu;
struct irq_work push_work;
raw_spinlock_t push_lock;
#endif
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
int rt_queued; int rt_queued;
@ -563,6 +557,19 @@ struct root_domain {
struct dl_bw dl_bw; struct dl_bw dl_bw;
struct cpudl cpudl; struct cpudl cpudl;
#ifdef HAVE_RT_PUSH_IPI
/*
* For IPI pull requests, loop across the rto_mask.
*/
struct irq_work rto_push_work;
raw_spinlock_t rto_lock;
/* These are only updated and read within rto_lock */
int rto_loop;
int rto_cpu;
/* These atomics are updated outside of a lock */
atomic_t rto_loop_next;
atomic_t rto_loop_start;
#endif
/* /*
* The "RT overload" flag: it gets set if a CPU has more than * The "RT overload" flag: it gets set if a CPU has more than
* one runnable RT task. * one runnable RT task.
@ -579,6 +586,9 @@ struct root_domain {
extern struct root_domain def_root_domain; extern struct root_domain def_root_domain;
#ifdef HAVE_RT_PUSH_IPI
extern void rto_push_irq_work_func(struct irq_work *work);
#endif
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
/* /*

View file

@ -26,6 +26,7 @@
* however I decided to publish this code under the plain GPL. * however I decided to publish this code under the plain GPL.
*/ */
#include <linux/sched.h>
#include <linux/string.h> #include <linux/string.h>
#include "mpi-internal.h" #include "mpi-internal.h"
#include "longlong.h" #include "longlong.h"
@ -256,6 +257,7 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod)
} }
e <<= 1; e <<= 1;
c--; c--;
cond_resched();
} }
i--; i--;

View file

@ -749,8 +749,7 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
} }
again: again:
/* Wait for the response */ /* Wait for the response */
err = wait_event_interruptible(*req->wq, err = wait_event_killable(*req->wq, req->status >= REQ_STATUS_RCVD);
req->status >= REQ_STATUS_RCVD);
/* /*
* Make sure our req is coherent with regard to updates in other * Make sure our req is coherent with regard to updates in other

View file

@ -290,7 +290,7 @@ req_retry:
if (err == -ENOSPC) { if (err == -ENOSPC) {
chan->ring_bufs_avail = 0; chan->ring_bufs_avail = 0;
spin_unlock_irqrestore(&chan->lock, flags); spin_unlock_irqrestore(&chan->lock, flags);
err = wait_event_interruptible(*chan->vc_wq, err = wait_event_killable(*chan->vc_wq,
chan->ring_bufs_avail); chan->ring_bufs_avail);
if (err == -ERESTARTSYS) if (err == -ERESTARTSYS)
return err; return err;
@ -331,7 +331,7 @@ static int p9_get_mapped_pages(struct virtio_chan *chan,
* Other zc request to finish here * Other zc request to finish here
*/ */
if (atomic_read(&vp_pinned) >= chan->p9_max_pages) { if (atomic_read(&vp_pinned) >= chan->p9_max_pages) {
err = wait_event_interruptible(vp_wq, err = wait_event_killable(vp_wq,
(atomic_read(&vp_pinned) < chan->p9_max_pages)); (atomic_read(&vp_pinned) < chan->p9_max_pages));
if (err == -ERESTARTSYS) if (err == -ERESTARTSYS)
return err; return err;
@ -475,7 +475,7 @@ req_retry_pinned:
if (err == -ENOSPC) { if (err == -ENOSPC) {
chan->ring_bufs_avail = 0; chan->ring_bufs_avail = 0;
spin_unlock_irqrestore(&chan->lock, flags); spin_unlock_irqrestore(&chan->lock, flags);
err = wait_event_interruptible(*chan->vc_wq, err = wait_event_killable(*chan->vc_wq,
chan->ring_bufs_avail); chan->ring_bufs_avail);
if (err == -ERESTARTSYS) if (err == -ERESTARTSYS)
goto err_out; goto err_out;
@ -493,8 +493,7 @@ req_retry_pinned:
virtqueue_kick(chan->vq); virtqueue_kick(chan->vq);
spin_unlock_irqrestore(&chan->lock, flags); spin_unlock_irqrestore(&chan->lock, flags);
p9_debug(P9_DEBUG_TRANS, "virtio request kicked\n"); p9_debug(P9_DEBUG_TRANS, "virtio request kicked\n");
err = wait_event_interruptible(*req->wq, err = wait_event_killable(*req->wq, req->status >= REQ_STATUS_RCVD);
req->status >= REQ_STATUS_RCVD);
/* /*
* Non kernel buffers are pinned, unpin them * Non kernel buffers are pinned, unpin them
*/ */

View file

@ -808,6 +808,7 @@ static int do_ip_setsockopt(struct sock *sk, int level,
{ {
struct ip_mreqn mreq; struct ip_mreqn mreq;
struct net_device *dev = NULL; struct net_device *dev = NULL;
int midx;
if (sk->sk_type == SOCK_STREAM) if (sk->sk_type == SOCK_STREAM)
goto e_inval; goto e_inval;
@ -852,11 +853,15 @@ static int do_ip_setsockopt(struct sock *sk, int level,
err = -EADDRNOTAVAIL; err = -EADDRNOTAVAIL;
if (!dev) if (!dev)
break; break;
midx = l3mdev_master_ifindex(dev);
dev_put(dev); dev_put(dev);
err = -EINVAL; err = -EINVAL;
if (sk->sk_bound_dev_if && if (sk->sk_bound_dev_if &&
mreq.imr_ifindex != sk->sk_bound_dev_if) mreq.imr_ifindex != sk->sk_bound_dev_if &&
(!midx || midx != sk->sk_bound_dev_if))
break; break;
inet->mc_index = mreq.imr_ifindex; inet->mc_index = mreq.imr_ifindex;

View file

@ -583,16 +583,24 @@ done:
if (val) { if (val) {
struct net_device *dev; struct net_device *dev;
int midx;
if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != val) rcu_read_lock();
goto e_inval;
dev = dev_get_by_index(net, val); dev = dev_get_by_index_rcu(net, val);
if (!dev) { if (!dev) {
rcu_read_unlock();
retv = -ENODEV; retv = -ENODEV;
break; break;
} }
dev_put(dev); midx = l3mdev_master_ifindex_rcu(dev);
rcu_read_unlock();
if (sk->sk_bound_dev_if &&
sk->sk_bound_dev_if != val &&
(!midx || midx != sk->sk_bound_dev_if))
goto e_inval;
} }
np->mcast_oif = val; np->mcast_oif = val;
retv = 0; retv = 0;

View file

@ -3376,7 +3376,11 @@ static int ip6_route_dev_notify(struct notifier_block *this,
net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
#endif #endif
} else if (event == NETDEV_UNREGISTER) { } else if (event == NETDEV_UNREGISTER &&
dev->reg_state != NETREG_UNREGISTERED) {
/* NETDEV_UNREGISTER could be fired for multiple times by
* netdev_wait_allrefs(). Make sure we only call this once.
*/
in6_dev_put(net->ipv6.ip6_null_entry->rt6i_idev); in6_dev_put(net->ipv6.ip6_null_entry->rt6i_idev);
#ifdef CONFIG_IPV6_MULTIPLE_TABLES #ifdef CONFIG_IPV6_MULTIPLE_TABLES
in6_dev_put(net->ipv6.ip6_prohibit_entry->rt6i_idev); in6_dev_put(net->ipv6.ip6_prohibit_entry->rt6i_idev);

View file

@ -682,7 +682,6 @@ struct ieee80211_if_mesh {
const struct ieee80211_mesh_sync_ops *sync_ops; const struct ieee80211_mesh_sync_ops *sync_ops;
s64 sync_offset_clockdrift_max; s64 sync_offset_clockdrift_max;
spinlock_t sync_offset_lock; spinlock_t sync_offset_lock;
bool adjusting_tbtt;
/* mesh power save */ /* mesh power save */
enum nl80211_mesh_power_mode nonpeer_pm; enum nl80211_mesh_power_mode nonpeer_pm;
int ps_peers_light_sleep; int ps_peers_light_sleep;

View file

@ -295,8 +295,6 @@ int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata,
/* Mesh PS mode. See IEEE802.11-2012 8.4.2.100.8 */ /* Mesh PS mode. See IEEE802.11-2012 8.4.2.100.8 */
*pos |= ifmsh->ps_peers_deep_sleep ? *pos |= ifmsh->ps_peers_deep_sleep ?
IEEE80211_MESHCONF_CAPAB_POWER_SAVE_LEVEL : 0x00; IEEE80211_MESHCONF_CAPAB_POWER_SAVE_LEVEL : 0x00;
*pos++ |= ifmsh->adjusting_tbtt ?
IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING : 0x00;
*pos++ = 0x00; *pos++ = 0x00;
return 0; return 0;
@ -866,7 +864,6 @@ int ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
ifmsh->mesh_cc_id = 0; /* Disabled */ ifmsh->mesh_cc_id = 0; /* Disabled */
/* register sync ops from extensible synchronization framework */ /* register sync ops from extensible synchronization framework */
ifmsh->sync_ops = ieee80211_mesh_sync_ops_get(ifmsh->mesh_sp_id); ifmsh->sync_ops = ieee80211_mesh_sync_ops_get(ifmsh->mesh_sp_id);
ifmsh->adjusting_tbtt = false;
ifmsh->sync_offset_clockdrift_max = 0; ifmsh->sync_offset_clockdrift_max = 0;
set_bit(MESH_WORK_HOUSEKEEPING, &ifmsh->wrkq_flags); set_bit(MESH_WORK_HOUSEKEEPING, &ifmsh->wrkq_flags);
ieee80211_mesh_root_setup(ifmsh); ieee80211_mesh_root_setup(ifmsh);

View file

@ -495,12 +495,14 @@ mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *addr,
/* Userspace handles station allocation */ /* Userspace handles station allocation */
if (sdata->u.mesh.user_mpm || if (sdata->u.mesh.user_mpm ||
sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) {
if (mesh_peer_accepts_plinks(elems) &&
mesh_plink_availables(sdata))
cfg80211_notify_new_peer_candidate(sdata->dev, addr, cfg80211_notify_new_peer_candidate(sdata->dev, addr,
elems->ie_start, elems->ie_start,
elems->total_len, elems->total_len,
GFP_KERNEL); GFP_KERNEL);
else } else
sta = __mesh_sta_info_alloc(sdata, addr); sta = __mesh_sta_info_alloc(sdata, addr);
return sta; return sta;

View file

@ -119,7 +119,6 @@ static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
*/ */
if (elems->mesh_config && mesh_peer_tbtt_adjusting(elems)) { if (elems->mesh_config && mesh_peer_tbtt_adjusting(elems)) {
clear_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN);
msync_dbg(sdata, "STA %pM : is adjusting TBTT\n", msync_dbg(sdata, "STA %pM : is adjusting TBTT\n",
sta->sta.addr); sta->sta.addr);
goto no_sync; goto no_sync;
@ -168,11 +167,9 @@ static void mesh_sync_offset_adjust_tbtt(struct ieee80211_sub_if_data *sdata,
struct beacon_data *beacon) struct beacon_data *beacon)
{ {
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
u8 cap;
WARN_ON(ifmsh->mesh_sp_id != IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET); WARN_ON(ifmsh->mesh_sp_id != IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET);
WARN_ON(!rcu_read_lock_held()); WARN_ON(!rcu_read_lock_held());
cap = beacon->meshconf->meshconf_cap;
spin_lock_bh(&ifmsh->sync_offset_lock); spin_lock_bh(&ifmsh->sync_offset_lock);
@ -186,21 +183,13 @@ static void mesh_sync_offset_adjust_tbtt(struct ieee80211_sub_if_data *sdata,
"TBTT : kicking off TBTT adjustment with clockdrift_max=%lld\n", "TBTT : kicking off TBTT adjustment with clockdrift_max=%lld\n",
ifmsh->sync_offset_clockdrift_max); ifmsh->sync_offset_clockdrift_max);
set_bit(MESH_WORK_DRIFT_ADJUST, &ifmsh->wrkq_flags); set_bit(MESH_WORK_DRIFT_ADJUST, &ifmsh->wrkq_flags);
ifmsh->adjusting_tbtt = true;
} else { } else {
msync_dbg(sdata, msync_dbg(sdata,
"TBTT : max clockdrift=%lld; too small to adjust\n", "TBTT : max clockdrift=%lld; too small to adjust\n",
(long long)ifmsh->sync_offset_clockdrift_max); (long long)ifmsh->sync_offset_clockdrift_max);
ifmsh->sync_offset_clockdrift_max = 0; ifmsh->sync_offset_clockdrift_max = 0;
ifmsh->adjusting_tbtt = false;
} }
spin_unlock_bh(&ifmsh->sync_offset_lock); spin_unlock_bh(&ifmsh->sync_offset_lock);
beacon->meshconf->meshconf_cap = ifmsh->adjusting_tbtt ?
IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING | cap :
~IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING & cap;
} }
static const struct sync_method sync_methods[] = { static const struct sync_method sync_methods[] = {

View file

@ -1996,7 +1996,7 @@ static void nf_tables_rule_destroy(const struct nft_ctx *ctx,
* is called on error from nf_tables_newrule(). * is called on error from nf_tables_newrule().
*/ */
expr = nft_expr_first(rule); expr = nft_expr_first(rule);
while (expr->ops && expr != nft_expr_last(rule)) { while (expr != nft_expr_last(rule) && expr->ops) {
nf_tables_expr_destroy(ctx, expr); nf_tables_expr_destroy(ctx, expr);
expr = nft_expr_next(expr); expr = nft_expr_next(expr);
} }

View file

@ -37,7 +37,7 @@ static void nft_queue_eval(const struct nft_expr *expr,
if (priv->queues_total > 1) { if (priv->queues_total > 1) {
if (priv->flags & NFT_QUEUE_FLAG_CPU_FANOUT) { if (priv->flags & NFT_QUEUE_FLAG_CPU_FANOUT) {
int cpu = smp_processor_id(); int cpu = raw_smp_processor_id();
queue = priv->queuenum + cpu % priv->queues_total; queue = priv->queuenum + cpu % priv->queues_total;
} else { } else {

View file

@ -1093,7 +1093,7 @@ struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
err_free_dev: err_free_dev:
kfree(dev); kfree(dev);
return ERR_PTR(rc); return NULL;
} }
EXPORT_SYMBOL(nfc_allocate_device); EXPORT_SYMBOL(nfc_allocate_device);

View file

@ -959,6 +959,11 @@ static int rds_cmsg_send(struct rds_sock *rs, struct rds_message *rm,
ret = rds_cmsg_rdma_map(rs, rm, cmsg); ret = rds_cmsg_rdma_map(rs, rm, cmsg);
if (!ret) if (!ret)
*allocated_mr = 1; *allocated_mr = 1;
else if (ret == -ENODEV)
/* Accommodate the get_mr() case which can fail
* if connection isn't established yet.
*/
ret = -EAGAIN;
break; break;
case RDS_CMSG_ATOMIC_CSWP: case RDS_CMSG_ATOMIC_CSWP:
case RDS_CMSG_ATOMIC_FADD: case RDS_CMSG_ATOMIC_FADD:
@ -1072,8 +1077,12 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
/* Parse any control messages the user may have included. */ /* Parse any control messages the user may have included. */
ret = rds_cmsg_send(rs, rm, msg, &allocated_mr); ret = rds_cmsg_send(rs, rm, msg, &allocated_mr);
if (ret) if (ret) {
/* Trigger connection so that its ready for the next retry */
if (ret == -EAGAIN)
rds_conn_connect_if_down(conn);
goto out; goto out;
}
if (rm->rdma.op_active && !conn->c_trans->xmit_rdma) { if (rm->rdma.op_active && !conn->c_trans->xmit_rdma) {
printk_ratelimited(KERN_NOTICE "rdma_op %p conn xmit_rdma %p\n", printk_ratelimited(KERN_NOTICE "rdma_op %p conn xmit_rdma %p\n",

View file

@ -4453,10 +4453,6 @@ int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp)
struct socket *sock; struct socket *sock;
int err = 0; int err = 0;
/* Do not peel off from one netns to another one. */
if (!net_eq(current->nsproxy->net_ns, sock_net(sk)))
return -EINVAL;
/* Do not peel off from one netns to another one. */ /* Do not peel off from one netns to another one. */
if (!net_eq(current->nsproxy->net_ns, sock_net(sk))) if (!net_eq(current->nsproxy->net_ns, sock_net(sk)))
return -EINVAL; return -EINVAL;

View file

@ -1209,10 +1209,14 @@ static int vsock_stream_connect(struct socket *sock, struct sockaddr *addr,
if (signal_pending(current)) { if (signal_pending(current)) {
err = sock_intr_errno(timeout); err = sock_intr_errno(timeout);
goto out_wait_error; sk->sk_state = SS_UNCONNECTED;
sock->state = SS_UNCONNECTED;
goto out_wait;
} else if (timeout == 0) { } else if (timeout == 0) {
err = -ETIMEDOUT; err = -ETIMEDOUT;
goto out_wait_error; sk->sk_state = SS_UNCONNECTED;
sock->state = SS_UNCONNECTED;
goto out_wait;
} }
prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
@ -1220,20 +1224,17 @@ static int vsock_stream_connect(struct socket *sock, struct sockaddr *addr,
if (sk->sk_err) { if (sk->sk_err) {
err = -sk->sk_err; err = -sk->sk_err;
goto out_wait_error; sk->sk_state = SS_UNCONNECTED;
} else sock->state = SS_UNCONNECTED;
} else {
err = 0; err = 0;
}
out_wait: out_wait:
finish_wait(sk_sleep(sk), &wait); finish_wait(sk_sleep(sk), &wait);
out: out:
release_sock(sk); release_sock(sk);
return err; return err;
out_wait_error:
sk->sk_state = SS_UNCONNECTED;
sock->state = SS_UNCONNECTED;
goto out_wait;
} }
static int vsock_accept(struct socket *sock, struct socket *newsock, int flags) static int vsock_accept(struct socket *sock, struct socket *newsock, int flags)
@ -1270,18 +1271,20 @@ static int vsock_accept(struct socket *sock, struct socket *newsock, int flags)
listener->sk_err == 0) { listener->sk_err == 0) {
release_sock(listener); release_sock(listener);
timeout = schedule_timeout(timeout); timeout = schedule_timeout(timeout);
finish_wait(sk_sleep(listener), &wait);
lock_sock(listener); lock_sock(listener);
if (signal_pending(current)) { if (signal_pending(current)) {
err = sock_intr_errno(timeout); err = sock_intr_errno(timeout);
goto out_wait; goto out;
} else if (timeout == 0) { } else if (timeout == 0) {
err = -EAGAIN; err = -EAGAIN;
goto out_wait; goto out;
} }
prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE); prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE);
} }
finish_wait(sk_sleep(listener), &wait);
if (listener->sk_err) if (listener->sk_err)
err = -listener->sk_err; err = -listener->sk_err;
@ -1301,19 +1304,15 @@ static int vsock_accept(struct socket *sock, struct socket *newsock, int flags)
*/ */
if (err) { if (err) {
vconnected->rejected = true; vconnected->rejected = true;
release_sock(connected); } else {
sock_put(connected);
goto out_wait;
}
newsock->state = SS_CONNECTED; newsock->state = SS_CONNECTED;
sock_graft(connected, newsock); sock_graft(connected, newsock);
}
release_sock(connected); release_sock(connected);
sock_put(connected); sock_put(connected);
} }
out_wait:
finish_wait(sk_sleep(listener), &wait);
out: out:
release_sock(listener); release_sock(listener);
return err; return err;
@ -1513,8 +1512,7 @@ static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg,
long timeout; long timeout;
int err; int err;
struct vsock_transport_send_notify_data send_data; struct vsock_transport_send_notify_data send_data;
DEFINE_WAIT_FUNC(wait, woken_wake_function);
DEFINE_WAIT(wait);
sk = sock->sk; sk = sock->sk;
vsk = vsock_sk(sk); vsk = vsock_sk(sk);
@ -1557,11 +1555,10 @@ static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg,
if (err < 0) if (err < 0)
goto out; goto out;
prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
while (total_written < len) { while (total_written < len) {
ssize_t written; ssize_t written;
add_wait_queue(sk_sleep(sk), &wait);
while (vsock_stream_has_space(vsk) == 0 && while (vsock_stream_has_space(vsk) == 0 &&
sk->sk_err == 0 && sk->sk_err == 0 &&
!(sk->sk_shutdown & SEND_SHUTDOWN) && !(sk->sk_shutdown & SEND_SHUTDOWN) &&
@ -1570,27 +1567,30 @@ static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg,
/* Don't wait for non-blocking sockets. */ /* Don't wait for non-blocking sockets. */
if (timeout == 0) { if (timeout == 0) {
err = -EAGAIN; err = -EAGAIN;
goto out_wait; remove_wait_queue(sk_sleep(sk), &wait);
goto out_err;
} }
err = transport->notify_send_pre_block(vsk, &send_data); err = transport->notify_send_pre_block(vsk, &send_data);
if (err < 0) if (err < 0) {
goto out_wait; remove_wait_queue(sk_sleep(sk), &wait);
goto out_err;
}
release_sock(sk); release_sock(sk);
timeout = schedule_timeout(timeout); timeout = wait_woken(&wait, TASK_INTERRUPTIBLE, timeout);
lock_sock(sk); lock_sock(sk);
if (signal_pending(current)) { if (signal_pending(current)) {
err = sock_intr_errno(timeout); err = sock_intr_errno(timeout);
goto out_wait; remove_wait_queue(sk_sleep(sk), &wait);
goto out_err;
} else if (timeout == 0) { } else if (timeout == 0) {
err = -EAGAIN; err = -EAGAIN;
goto out_wait; remove_wait_queue(sk_sleep(sk), &wait);
goto out_err;
} }
prepare_to_wait(sk_sleep(sk), &wait,
TASK_INTERRUPTIBLE);
} }
remove_wait_queue(sk_sleep(sk), &wait);
/* These checks occur both as part of and after the loop /* These checks occur both as part of and after the loop
* conditional since we need to check before and after * conditional since we need to check before and after
@ -1598,16 +1598,16 @@ static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg,
*/ */
if (sk->sk_err) { if (sk->sk_err) {
err = -sk->sk_err; err = -sk->sk_err;
goto out_wait; goto out_err;
} else if ((sk->sk_shutdown & SEND_SHUTDOWN) || } else if ((sk->sk_shutdown & SEND_SHUTDOWN) ||
(vsk->peer_shutdown & RCV_SHUTDOWN)) { (vsk->peer_shutdown & RCV_SHUTDOWN)) {
err = -EPIPE; err = -EPIPE;
goto out_wait; goto out_err;
} }
err = transport->notify_send_pre_enqueue(vsk, &send_data); err = transport->notify_send_pre_enqueue(vsk, &send_data);
if (err < 0) if (err < 0)
goto out_wait; goto out_err;
/* Note that enqueue will only write as many bytes as are free /* Note that enqueue will only write as many bytes as are free
* in the produce queue, so we don't need to ensure len is * in the produce queue, so we don't need to ensure len is
@ -1620,7 +1620,7 @@ static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg,
len - total_written); len - total_written);
if (written < 0) { if (written < 0) {
err = -ENOMEM; err = -ENOMEM;
goto out_wait; goto out_err;
} }
total_written += written; total_written += written;
@ -1628,14 +1628,13 @@ static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg,
err = transport->notify_send_post_enqueue( err = transport->notify_send_post_enqueue(
vsk, written, &send_data); vsk, written, &send_data);
if (err < 0) if (err < 0)
goto out_wait; goto out_err;
} }
out_wait: out_err:
if (total_written > 0) if (total_written > 0)
err = total_written; err = total_written;
finish_wait(sk_sleep(sk), &wait);
out: out:
release_sock(sk); release_sock(sk);
return err; return err;
@ -1716,20 +1715,60 @@ vsock_stream_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
if (err < 0) if (err < 0)
goto out; goto out;
prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
while (1) { while (1) {
s64 ready = vsock_stream_has_data(vsk); s64 ready;
prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
ready = vsock_stream_has_data(vsk);
if (ready == 0) {
if (sk->sk_err != 0 ||
(sk->sk_shutdown & RCV_SHUTDOWN) ||
(vsk->peer_shutdown & SEND_SHUTDOWN)) {
finish_wait(sk_sleep(sk), &wait);
break;
}
/* Don't wait for non-blocking sockets. */
if (timeout == 0) {
err = -EAGAIN;
finish_wait(sk_sleep(sk), &wait);
break;
}
err = transport->notify_recv_pre_block(
vsk, target, &recv_data);
if (err < 0) {
finish_wait(sk_sleep(sk), &wait);
break;
}
release_sock(sk);
timeout = schedule_timeout(timeout);
lock_sock(sk);
if (signal_pending(current)) {
err = sock_intr_errno(timeout);
finish_wait(sk_sleep(sk), &wait);
break;
} else if (timeout == 0) {
err = -EAGAIN;
finish_wait(sk_sleep(sk), &wait);
break;
}
} else {
ssize_t read;
finish_wait(sk_sleep(sk), &wait);
if (ready < 0) { if (ready < 0) {
/* Invalid queue pair content. XXX This should be /* Invalid queue pair content. XXX This should
* changed to a connection reset in a later change. * be changed to a connection reset in a later
* change.
*/ */
err = -ENOMEM; err = -ENOMEM;
goto out_wait; goto out;
} else if (ready > 0) { }
ssize_t read;
err = transport->notify_recv_pre_dequeue( err = transport->notify_recv_pre_dequeue(
vsk, target, &recv_data); vsk, target, &recv_data);
@ -1750,42 +1789,12 @@ vsock_stream_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
vsk, target, read, vsk, target, read,
!(flags & MSG_PEEK), &recv_data); !(flags & MSG_PEEK), &recv_data);
if (err < 0) if (err < 0)
goto out_wait; goto out;
if (read >= target || flags & MSG_PEEK) if (read >= target || flags & MSG_PEEK)
break; break;
target -= read; target -= read;
} else {
if (sk->sk_err != 0 || (sk->sk_shutdown & RCV_SHUTDOWN)
|| (vsk->peer_shutdown & SEND_SHUTDOWN)) {
break;
}
/* Don't wait for non-blocking sockets. */
if (timeout == 0) {
err = -EAGAIN;
break;
}
err = transport->notify_recv_pre_block(
vsk, target, &recv_data);
if (err < 0)
break;
release_sock(sk);
timeout = schedule_timeout(timeout);
lock_sock(sk);
if (signal_pending(current)) {
err = sock_intr_errno(timeout);
break;
} else if (timeout == 0) {
err = -EAGAIN;
break;
}
prepare_to_wait(sk_sleep(sk), &wait,
TASK_INTERRUPTIBLE);
} }
} }
@ -1797,8 +1806,6 @@ vsock_stream_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
if (copied > 0) if (copied > 0)
err = copied; err = copied;
out_wait:
finish_wait(sk_sleep(sk), &wait);
out: out:
release_sock(sk); release_sock(sk);
return err; return err;

View file

@ -264,8 +264,10 @@ static void update_audio_tstamp(struct snd_pcm_substream *substream,
runtime->rate); runtime->rate);
*audio_tstamp = ns_to_timespec(audio_nsecs); *audio_tstamp = ns_to_timespec(audio_nsecs);
} }
if (!timespec_equal(&runtime->status->audio_tstamp, audio_tstamp)) {
runtime->status->audio_tstamp = *audio_tstamp; runtime->status->audio_tstamp = *audio_tstamp;
runtime->status->tstamp = *curr_tstamp; runtime->status->tstamp = *curr_tstamp;
}
/* /*
* re-take a driver timestamp to let apps detect if the reference tstamp * re-take a driver timestamp to let apps detect if the reference tstamp

View file

@ -40,11 +40,11 @@ static int snd_timer_user_info_compat(struct file *file,
struct snd_timer *t; struct snd_timer *t;
tu = file->private_data; tu = file->private_data;
if (snd_BUG_ON(!tu->timeri)) if (!tu->timeri)
return -ENXIO; return -EBADFD;
t = tu->timeri->timer; t = tu->timeri->timer;
if (snd_BUG_ON(!t)) if (!t)
return -ENXIO; return -EBADFD;
memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof(info));
info.card = t->card ? t->card->number : -1; info.card = t->card ? t->card->number : -1;
if (t->hw.flags & SNDRV_TIMER_HW_SLAVE) if (t->hw.flags & SNDRV_TIMER_HW_SLAVE)
@ -73,8 +73,8 @@ static int snd_timer_user_status_compat(struct file *file,
struct snd_timer_status32 status; struct snd_timer_status32 status;
tu = file->private_data; tu = file->private_data;
if (snd_BUG_ON(!tu->timeri)) if (!tu->timeri)
return -ENXIO; return -EBADFD;
memset(&status, 0, sizeof(status)); memset(&status, 0, sizeof(status));
status.tstamp.tv_sec = tu->tstamp.tv_sec; status.tstamp.tv_sec = tu->tstamp.tv_sec;
status.tstamp.tv_nsec = tu->tstamp.tv_nsec; status.tstamp.tv_nsec = tu->tstamp.tv_nsec;

View file

@ -2316,6 +2316,9 @@ static const struct pci_device_id azx_ids[] = {
/* AMD Hudson */ /* AMD Hudson */
{ PCI_DEVICE(0x1022, 0x780d), { PCI_DEVICE(0x1022, 0x780d),
.driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB }, .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB },
/* AMD Raven */
{ PCI_DEVICE(0x1022, 0x15e3),
.driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB },
/* ATI HDMI */ /* ATI HDMI */
{ PCI_DEVICE(0x1002, 0x0002), { PCI_DEVICE(0x1002, 0x0002),
.driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },

View file

@ -4404,7 +4404,7 @@ static void alc_no_shutup(struct hda_codec *codec)
static void alc_fixup_no_shutup(struct hda_codec *codec, static void alc_fixup_no_shutup(struct hda_codec *codec,
const struct hda_fixup *fix, int action) const struct hda_fixup *fix, int action)
{ {
if (action == HDA_FIXUP_ACT_PRE_PROBE) { if (action == HDA_FIXUP_ACT_PROBE) {
struct alc_spec *spec = codec->spec; struct alc_spec *spec = codec->spec;
spec->shutup = alc_no_shutup; spec->shutup = alc_no_shutup;
} }
@ -6254,7 +6254,7 @@ static int patch_alc269(struct hda_codec *codec)
case 0x10ec0703: case 0x10ec0703:
spec->codec_variant = ALC269_TYPE_ALC700; spec->codec_variant = ALC269_TYPE_ALC700;
spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */ spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
alc_update_coef_idx(codec, 0x4a, 0, 1 << 15); /* Combo jack auto trigger control */ alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
break; break;
} }

View file

@ -1060,7 +1060,7 @@ static int wm_adsp_load(struct wm_adsp *dsp)
const struct wmfw_region *region; const struct wmfw_region *region;
const struct wm_adsp_region *mem; const struct wm_adsp_region *mem;
const char *region_name; const char *region_name;
char *file, *text; char *file, *text = NULL;
struct wm_adsp_buf *buf; struct wm_adsp_buf *buf;
unsigned int reg; unsigned int reg;
int regions = 0; int regions = 0;
@ -1221,10 +1221,21 @@ static int wm_adsp_load(struct wm_adsp *dsp)
regions, le32_to_cpu(region->len), offset, regions, le32_to_cpu(region->len), offset,
region_name); region_name);
if ((pos + le32_to_cpu(region->len) + sizeof(*region)) >
firmware->size) {
adsp_err(dsp,
"%s.%d: %s region len %d bytes exceeds file length %zu\n",
file, regions, region_name,
le32_to_cpu(region->len), firmware->size);
ret = -EINVAL;
goto out_fw;
}
if (text) { if (text) {
memcpy(text, region->data, le32_to_cpu(region->len)); memcpy(text, region->data, le32_to_cpu(region->len));
adsp_info(dsp, "%s: %s\n", file, text); adsp_info(dsp, "%s: %s\n", file, text);
kfree(text); kfree(text);
text = NULL;
} }
if (reg) { if (reg) {
@ -1269,6 +1280,7 @@ out_fw:
regmap_async_complete(regmap); regmap_async_complete(regmap);
wm_adsp_buf_free(&buf_list); wm_adsp_buf_free(&buf_list);
release_firmware(firmware); release_firmware(firmware);
kfree(text);
out: out:
kfree(file); kfree(file);
@ -1730,6 +1742,17 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
} }
if (reg) { if (reg) {
if ((pos + le32_to_cpu(blk->len) + sizeof(*blk)) >
firmware->size) {
adsp_err(dsp,
"%s.%d: %s region len %d bytes exceeds file length %zu\n",
file, blocks, region_name,
le32_to_cpu(blk->len),
firmware->size);
ret = -EINVAL;
goto out_fw;
}
buf = wm_adsp_buf_alloc(blk->data, buf = wm_adsp_buf_alloc(blk->data,
le32_to_cpu(blk->len), le32_to_cpu(blk->len),
&buf_list); &buf_list);

View file

@ -1049,10 +1049,8 @@ static int __rsnd_kctrl_new(struct rsnd_mod *mod,
return -ENOMEM; return -ENOMEM;
ret = snd_ctl_add(card, kctrl); ret = snd_ctl_add(card, kctrl);
if (ret < 0) { if (ret < 0)
snd_ctl_free_one(kctrl);
return ret; return ret;
}
cfg->update = update; cfg->update = update;
cfg->card = card; cfg->card = card;

View file

@ -43,7 +43,7 @@ static struct uac_clock_source_descriptor *
while ((cs = snd_usb_find_csint_desc(ctrl_iface->extra, while ((cs = snd_usb_find_csint_desc(ctrl_iface->extra,
ctrl_iface->extralen, ctrl_iface->extralen,
cs, UAC2_CLOCK_SOURCE))) { cs, UAC2_CLOCK_SOURCE))) {
if (cs->bClockID == clock_id) if (cs->bLength >= sizeof(*cs) && cs->bClockID == clock_id)
return cs; return cs;
} }
@ -59,9 +59,12 @@ static struct uac_clock_selector_descriptor *
while ((cs = snd_usb_find_csint_desc(ctrl_iface->extra, while ((cs = snd_usb_find_csint_desc(ctrl_iface->extra,
ctrl_iface->extralen, ctrl_iface->extralen,
cs, UAC2_CLOCK_SELECTOR))) { cs, UAC2_CLOCK_SELECTOR))) {
if (cs->bClockID == clock_id) if (cs->bLength >= sizeof(*cs) && cs->bClockID == clock_id) {
if (cs->bLength < 5 + cs->bNrInPins)
return NULL;
return cs; return cs;
} }
}
return NULL; return NULL;
} }
@ -75,7 +78,7 @@ static struct uac_clock_multiplier_descriptor *
while ((cs = snd_usb_find_csint_desc(ctrl_iface->extra, while ((cs = snd_usb_find_csint_desc(ctrl_iface->extra,
ctrl_iface->extralen, ctrl_iface->extralen,
cs, UAC2_CLOCK_MULTIPLIER))) { cs, UAC2_CLOCK_MULTIPLIER))) {
if (cs->bClockID == clock_id) if (cs->bLength >= sizeof(*cs) && cs->bClockID == clock_id)
return cs; return cs;
} }

Some files were not shown because too many files have changed in this diff Show more