This is the 4.4.154 stable release

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAluPg1EACgkQONu9yGCS
 aT537Q/+O5bk1aabRFnyL9hsPlL/fRi9uHkpyvO6/upcu+J0Vrx6NQPGDEGLsbc1
 V1yk0V8bzDBdpfIHzqd3ttSzMdlL/ozKesUtG5Eg9gtyo3YDGf5vkrL2A4PRAI3R
 TbwxnPfmy5C2hgAn/N4XXLJj0k95IKrs0HteOS3R1Jyt0FQ0sdHxlfFwE5FoPMGX
 oL1zC/vDq8dNBuf9slVBwaq0QTtFl/cy1yoDKtybOkFOP7NSmXUIkHqhZthDodCu
 kHYAe/E6lxspsZ2GgE+3hyI+UApqMhpqFO53EIFMom9eH6FgVi6nLewDZybm7Wgj
 Oc1S1eo/8WNeoVjCjKNwcBPv4UMX6gsuBZQ3akmv2ib5Qkxe94+DQLcGputKZhQ6
 XxuaTmiY7A4moALGpAt5lJaJ6NQdEl8HlgjKhxhtYnAPsNTOTLH91NY/ND30y02o
 /W2LBf3ossbsWQJuzamldGSAstkbK/+JAw0CMTGhCS4V7bzfFhIo3y169/xb5ReV
 edsMsnXanYXNTyn8jpCb4keCY9mMGwp9SPqhlQ+Kyh6E0mDPvTVQPyd5h4NTkmvN
 881MIwkMmufM8MQhNsTrMSFhr94z6H1kARbzoK3AUd/nJtkCJfl0Zp3wQZjiOUy/
 0kpso+xDmMMmB1Pu7c0Wevt40jadhMrxxREgjFUaN7KzD/PyLtA=
 =GkQW
 -----END PGP SIGNATURE-----

Merge 4.4.154 into android-4.4

Changes in 4.4.154
	sched/sysctl: Check user input value of sysctl_sched_time_avg
	Cipso: cipso_v4_optptr enter infinite loop
	vti6: fix PMTU caching and reporting on xmit
	xfrm: fix missing dst_release() after policy blocking lbcast and multicast
	xfrm: free skb if nlsk pointer is NULL
	mac80211: add stations tied to AP_VLANs during hw reconfig
	nl80211: Add a missing break in parse_station_flags
	drm/bridge: adv7511: Reset registers on hotplug
	scsi: libiscsi: fix possible NULL pointer dereference in case of TMF
	drm/imx: imx-ldb: disable LDB on driver bind
	drm/imx: imx-ldb: check if channel is enabled before printing warning
	usb: gadget: r8a66597: Fix two possible sleep-in-atomic-context bugs in init_controller()
	usb: gadget: r8a66597: Fix a possible sleep-in-atomic-context bugs in r8a66597_queue()
	usb/phy: fix PPC64 build errors in phy-fsl-usb.c
	tools: usb: ffs-test: Fix build on big endian systems
	usb: gadget: f_uac2: fix endianness of 'struct cntrl_*_lay3'
	tools/power turbostat: fix -S on UP systems
	net: caif: Add a missing rcu_read_unlock() in caif_flow_cb
	qed: Fix possible race for the link state value.
	atl1c: reserve min skb headroom
	net: prevent ISA drivers from building on PPC32
	can: mpc5xxx_can: check of_iomap return before use
	i2c: davinci: Avoid zero value of CLKH
	media: staging: omap4iss: Include asm/cacheflush.h after generic includes
	bnx2x: Fix invalid memory access in rss hash config path.
	net: axienet: Fix double deregister of mdio
	fscache: Allow cancelled operations to be enqueued
	cachefiles: Fix refcounting bug in backing-file read monitoring
	cachefiles: Wait rather than BUG'ing on "Unexpected object collision"
	selftests/ftrace: Add snapshot and tracing_on test case
	zswap: re-check zswap_is_full() after do zswap_shrink()
	tools/power turbostat: Read extended processor family from CPUID
	Revert "MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum"
	enic: handle mtu change for vf properly
	arc: fix build errors in arc/include/asm/delay.h
	arc: fix type warnings in arc/mm/cache.c
	drivers: net: lmc: fix case value for target abort error
	scsi: fcoe: drop frames in ELS LOGO error path
	scsi: vmw_pvscsi: Return DID_RESET for status SAM_STAT_COMMAND_TERMINATED
	mm/memory.c: check return value of ioremap_prot
	cifs: add missing debug entries for kconfig options
	cifs: check kmalloc before use
	smb3: Do not send SMB3 SET_INFO if nothing changed
	smb3: don't request leases in symlink creation and query
	btrfs: don't leak ret from do_chunk_alloc
	s390/kvm: fix deadlock when killed by oom
	ext4: check for NUL characters in extended attribute's name
	ext4: sysfs: print ext4_super_block fields as little-endian
	ext4: reset error code in ext4_find_entry in fallback
	arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()
	KVM: arm/arm64: Skip updating PTE entry if no change
	KVM: arm/arm64: Skip updating PMD entry if no change
	x86/speculation/l1tf: Fix overflow in l1tf_pfn_limit() on 32bit
	x86/speculation/l1tf: Fix off-by-one error when warning that system has too much RAM
	x86/speculation/l1tf: Suggest what to do on systems with too much RAM
	x86/process: Re-export start_thread()
	fuse: Don't access pipe->buffers without pipe_lock()
	fuse: fix double request_end()
	fuse: fix unlocked access to processing queue
	fuse: umount should wait for all requests
	fuse: Fix oops at process_init_reply()
	fuse: Add missed unlock_page() to fuse_readpages_fill()
	udl-kms: change down_interruptible to down
	udl-kms: handle allocation failure
	udl-kms: fix crash due to uninitialized memory
	ASoC: dpcm: don't merge format from invalid codec dai
	ASoC: sirf: Fix potential NULL pointer dereference
	pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show()
	x86/irqflags: Mark native_restore_fl extern inline
	x86/spectre: Add missing family 6 check to microcode check
	s390: fix br_r1_trampoline for machines without exrl
	s390/qdio: reset old sbal_state flags
	s390/pci: fix out of bounds access during irq setup
	kprobes: Make list and blacklist root user read only
	MIPS: Correct the 64-bit DSP accumulator register size
	MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7
	scsi: sysfs: Introduce sysfs_{un,}break_active_protection()
	scsi: core: Avoid that SCSI device removal through sysfs triggers a deadlock
	iscsi target: fix session creation failure handling
	cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status
	Linux 4.4.154

Change-Id: Ia008eef23c91fbd095f7b3343737cb2864875c52
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2018-09-05 11:09:59 +02:00
commit d762e28031
83 changed files with 515 additions and 239 deletions

View file

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

View file

@ -17,8 +17,11 @@
#ifndef __ASM_ARC_UDELAY_H #ifndef __ASM_ARC_UDELAY_H
#define __ASM_ARC_UDELAY_H #define __ASM_ARC_UDELAY_H
#include <asm-generic/types.h>
#include <asm/param.h> /* HZ */ #include <asm/param.h> /* HZ */
extern unsigned long loops_per_jiffy;
static inline void __delay(unsigned long loops) static inline void __delay(unsigned long loops)
{ {
__asm__ __volatile__( __asm__ __volatile__(

View file

@ -821,7 +821,7 @@ void flush_cache_mm(struct mm_struct *mm)
void flush_cache_page(struct vm_area_struct *vma, unsigned long u_vaddr, void flush_cache_page(struct vm_area_struct *vma, unsigned long u_vaddr,
unsigned long pfn) unsigned long pfn)
{ {
unsigned int paddr = pfn << PAGE_SHIFT; phys_addr_t paddr = pfn << PAGE_SHIFT;
u_vaddr &= PAGE_MASK; u_vaddr &= PAGE_MASK;
@ -841,8 +841,9 @@ void flush_anon_page(struct vm_area_struct *vma, struct page *page,
unsigned long u_vaddr) unsigned long u_vaddr)
{ {
/* TBD: do we really need to clear the kernel mapping */ /* TBD: do we really need to clear the kernel mapping */
__flush_dcache_page(page_address(page), u_vaddr); __flush_dcache_page((phys_addr_t)page_address(page), u_vaddr);
__flush_dcache_page(page_address(page), page_address(page)); __flush_dcache_page((phys_addr_t)page_address(page),
(phys_addr_t)page_address(page));
} }

View file

@ -892,19 +892,35 @@ static int stage2_set_pmd_huge(struct kvm *kvm, struct kvm_mmu_memory_cache
pmd = stage2_get_pmd(kvm, cache, addr); pmd = stage2_get_pmd(kvm, cache, addr);
VM_BUG_ON(!pmd); VM_BUG_ON(!pmd);
/*
* Mapping in huge pages should only happen through a fault. If a
* page is merged into a transparent huge page, the individual
* subpages of that huge page should be unmapped through MMU
* notifiers before we get here.
*
* Merging of CompoundPages is not supported; they should become
* splitting first, unmapped, merged, and mapped back in on-demand.
*/
VM_BUG_ON(pmd_present(*pmd) && pmd_pfn(*pmd) != pmd_pfn(*new_pmd));
old_pmd = *pmd; old_pmd = *pmd;
if (pmd_present(old_pmd)) { if (pmd_present(old_pmd)) {
/*
* Multiple vcpus faulting on the same PMD entry, can
* lead to them sequentially updating the PMD with the
* same value. Following the break-before-make
* (pmd_clear() followed by tlb_flush()) process can
* hinder forward progress due to refaults generated
* on missing translations.
*
* Skip updating the page table if the entry is
* unchanged.
*/
if (pmd_val(old_pmd) == pmd_val(*new_pmd))
return 0;
/*
* Mapping in huge pages should only happen through a
* fault. If a page is merged into a transparent huge
* page, the individual subpages of that huge page
* should be unmapped through MMU notifiers before we
* get here.
*
* Merging of CompoundPages is not supported; they
* should become splitting first, unmapped, merged,
* and mapped back in on-demand.
*/
VM_BUG_ON(pmd_pfn(old_pmd) != pmd_pfn(*new_pmd));
pmd_clear(pmd); pmd_clear(pmd);
kvm_tlb_flush_vmid_ipa(kvm, addr); kvm_tlb_flush_vmid_ipa(kvm, addr);
} else { } else {
@ -961,6 +977,10 @@ static int stage2_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
/* Create 2nd stage page table mapping - Level 3 */ /* Create 2nd stage page table mapping - Level 3 */
old_pte = *pte; old_pte = *pte;
if (pte_present(old_pte)) { if (pte_present(old_pte)) {
/* Skip page table update if there is no change */
if (pte_val(old_pte) == pte_val(*new_pte))
return 0;
kvm_set_pte(pte, __pte(0)); kvm_set_pte(pte, __pte(0));
kvm_tlb_flush_vmid_ipa(kvm, addr); kvm_tlb_flush_vmid_ipa(kvm, addr);
} else { } else {

View file

@ -128,11 +128,13 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
} }
#ifdef CONFIG_HAVE_ARCH_PFN_VALID #ifdef CONFIG_HAVE_ARCH_PFN_VALID
#define PFN_MASK ((1UL << (64 - PAGE_SHIFT)) - 1)
int pfn_valid(unsigned long pfn) int pfn_valid(unsigned long pfn)
{ {
return (pfn & PFN_MASK) == pfn && memblock_is_map_memory(pfn << PAGE_SHIFT); phys_addr_t addr = pfn << PAGE_SHIFT;
if ((addr >> PAGE_SHIFT) != pfn)
return 0;
return memblock_is_memory(addr);
} }
EXPORT_SYMBOL(pfn_valid); EXPORT_SYMBOL(pfn_valid);
#endif #endif

View file

@ -249,12 +249,6 @@ static int __init bcm47xx_cpu_fixes(void)
*/ */
if (bcm47xx_bus.bcma.bus.chipinfo.id == BCMA_CHIP_ID_BCM4706) if (bcm47xx_bus.bcma.bus.chipinfo.id == BCMA_CHIP_ID_BCM4706)
cpu_wait = NULL; cpu_wait = NULL;
/*
* BCM47XX Erratum "R10: PCIe Transactions Periodically Fail"
* Enable ExternalSync for sync instruction to take effect
*/
set_c0_config7(MIPS_CONF7_ES);
break; break;
#endif #endif
} }

View file

@ -606,8 +606,6 @@
#define MIPS_CONF7_WII (_ULCAST_(1) << 31) #define MIPS_CONF7_WII (_ULCAST_(1) << 31)
#define MIPS_CONF7_RPS (_ULCAST_(1) << 2) #define MIPS_CONF7_RPS (_ULCAST_(1) << 2)
/* ExternalSync */
#define MIPS_CONF7_ES (_ULCAST_(1) << 8)
#define MIPS_CONF7_IAR (_ULCAST_(1) << 10) #define MIPS_CONF7_IAR (_ULCAST_(1) << 10)
#define MIPS_CONF7_AR (_ULCAST_(1) << 16) #define MIPS_CONF7_AR (_ULCAST_(1) << 16)
@ -2015,7 +2013,6 @@ __BUILD_SET_C0(status)
__BUILD_SET_C0(cause) __BUILD_SET_C0(cause)
__BUILD_SET_C0(config) __BUILD_SET_C0(config)
__BUILD_SET_C0(config5) __BUILD_SET_C0(config5)
__BUILD_SET_C0(config7)
__BUILD_SET_C0(intcontrol) __BUILD_SET_C0(intcontrol)
__BUILD_SET_C0(intctl) __BUILD_SET_C0(intctl)
__BUILD_SET_C0(srsmap) __BUILD_SET_C0(srsmap)

View file

@ -137,7 +137,7 @@ struct mips_fpu_struct {
#define NUM_DSP_REGS 6 #define NUM_DSP_REGS 6
typedef __u32 dspreg_t; typedef unsigned long dspreg_t;
struct mips_dsp_state { struct mips_dsp_state {
dspreg_t dspr[NUM_DSP_REGS]; dspreg_t dspr[NUM_DSP_REGS];

View file

@ -878,7 +878,7 @@ long arch_ptrace(struct task_struct *child, long request,
goto out; goto out;
} }
dregs = __get_dsp_regs(child); dregs = __get_dsp_regs(child);
tmp = (unsigned long) (dregs[addr - DSP_BASE]); tmp = dregs[addr - DSP_BASE];
break; break;
} }
case DSP_CONTROL: case DSP_CONTROL:

View file

@ -140,7 +140,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
goto out; goto out;
} }
dregs = __get_dsp_regs(child); dregs = __get_dsp_regs(child);
tmp = (unsigned long) (dregs[addr - DSP_BASE]); tmp = dregs[addr - DSP_BASE];
break; break;
} }
case DSP_CONTROL: case DSP_CONTROL:

View file

@ -4,12 +4,12 @@
#include "libgcc.h" #include "libgcc.h"
/* /*
* GCC 7 suboptimally generates __multi3 calls for mips64r6, so for that * GCC 7 & older can suboptimally generate __multi3 calls for mips64r6, so for
* specific case only we'll implement it here. * that specific case only we implement that intrinsic here.
* *
* See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82981 * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82981
*/ */
#if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6) && (__GNUC__ == 7) #if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6) && (__GNUC__ < 8)
/* multiply 64-bit values, low 64-bits returned */ /* multiply 64-bit values, low 64-bits returned */
static inline long long notrace dmulu(long long a, long long b) static inline long long notrace dmulu(long long a, long long b)

View file

@ -261,7 +261,6 @@ struct qdio_outbuf_state {
void *user; void *user;
}; };
#define QDIO_OUTBUF_STATE_FLAG_NONE 0x00
#define QDIO_OUTBUF_STATE_FLAG_PENDING 0x01 #define QDIO_OUTBUF_STATE_FLAG_PENDING 0x01
#define CHSC_AC1_INITIATE_INPUTQ 0x80 #define CHSC_AC1_INITIATE_INPUTQ 0x80

View file

@ -459,6 +459,8 @@ retry:
/* No reason to continue if interrupted by SIGKILL. */ /* No reason to continue if interrupted by SIGKILL. */
if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) { if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) {
fault = VM_FAULT_SIGNAL; fault = VM_FAULT_SIGNAL;
if (flags & FAULT_FLAG_RETRY_NOWAIT)
goto out_up;
goto out; goto out;
} }
if (unlikely(fault & VM_FAULT_ERROR)) if (unlikely(fault & VM_FAULT_ERROR))

View file

@ -522,8 +522,6 @@ static void bpf_jit_epilogue(struct bpf_jit *jit)
/* br %r1 */ /* br %r1 */
_EMIT2(0x07f1); _EMIT2(0x07f1);
} else { } else {
/* larl %r1,.+14 */
EMIT6_PCREL_RILB(0xc0000000, REG_1, jit->prg + 14);
/* ex 0,S390_lowcore.br_r1_tampoline */ /* ex 0,S390_lowcore.br_r1_tampoline */
EMIT4_DISP(0x44000000, REG_0, REG_0, EMIT4_DISP(0x44000000, REG_0, REG_0,
offsetof(struct _lowcore, br_r1_trampoline)); offsetof(struct _lowcore, br_r1_trampoline));

View file

@ -412,6 +412,8 @@ int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
hwirq = 0; hwirq = 0;
for_each_pci_msi_entry(msi, pdev) { for_each_pci_msi_entry(msi, pdev) {
rc = -EIO; rc = -EIO;
if (hwirq >= msi_vecs)
break;
irq = irq_alloc_desc(0); /* Alloc irq on node 0 */ irq = irq_alloc_desc(0); /* Alloc irq on node 0 */
if (irq < 0) if (irq < 0)
goto out_msi; goto out_msi;

View file

@ -28,7 +28,8 @@ extern inline unsigned long native_save_fl(void)
return flags; return flags;
} }
static inline void native_restore_fl(unsigned long flags) extern inline void native_restore_fl(unsigned long flags);
extern inline void native_restore_fl(unsigned long flags)
{ {
asm volatile("push %0 ; popf" asm volatile("push %0 ; popf"
: /* no output */ : /* no output */

View file

@ -172,9 +172,9 @@ extern const struct seq_operations cpuinfo_op;
extern void cpu_detect(struct cpuinfo_x86 *c); extern void cpu_detect(struct cpuinfo_x86 *c);
static inline unsigned long l1tf_pfn_limit(void) static inline unsigned long long l1tf_pfn_limit(void)
{ {
return BIT(boot_cpu_data.x86_phys_bits - 1 - PAGE_SHIFT) - 1; return BIT_ULL(boot_cpu_data.x86_phys_bits - 1 - PAGE_SHIFT);
} }
extern void early_cpu_init(void); extern void early_cpu_init(void);

View file

@ -654,6 +654,10 @@ static void __init l1tf_select_mitigation(void)
half_pa = (u64)l1tf_pfn_limit() << PAGE_SHIFT; half_pa = (u64)l1tf_pfn_limit() << PAGE_SHIFT;
if (e820_any_mapped(half_pa, ULLONG_MAX - half_pa, E820_RAM)) { if (e820_any_mapped(half_pa, ULLONG_MAX - half_pa, E820_RAM)) {
pr_warn("System has more than MAX_PA/2 memory. L1TF mitigation not effective.\n"); pr_warn("System has more than MAX_PA/2 memory. L1TF mitigation not effective.\n");
pr_info("You may make it effective by booting the kernel with mem=%llu parameter.\n",
half_pa);
pr_info("However, doing so will make a part of your RAM unusable.\n");
pr_info("Reading https://www.kernel.org/doc/html/latest/admin-guide/l1tf.html might help you decide.\n");
return; return;
} }

View file

@ -74,6 +74,9 @@ static bool bad_spectre_microcode(struct cpuinfo_x86 *c)
if (cpu_has(c, X86_FEATURE_HYPERVISOR)) if (cpu_has(c, X86_FEATURE_HYPERVISOR))
return false; return false;
if (c->x86 != 6)
return false;
for (i = 0; i < ARRAY_SIZE(spectre_bad_microcodes); i++) { for (i = 0; i < ARRAY_SIZE(spectre_bad_microcodes); i++) {
if (c->x86_model == spectre_bad_microcodes[i].model && if (c->x86_model == spectre_bad_microcodes[i].model &&
c->x86_mask == spectre_bad_microcodes[i].stepping) c->x86_mask == spectre_bad_microcodes[i].stepping)

View file

@ -250,6 +250,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
start_thread_common(regs, new_ip, new_sp, start_thread_common(regs, new_ip, new_sp,
__USER_CS, __USER_DS, 0); __USER_CS, __USER_DS, 0);
} }
EXPORT_SYMBOL_GPL(start_thread);
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
void compat_start_thread(struct pt_regs *regs, u32 new_ip, u32 new_sp) void compat_start_thread(struct pt_regs *regs, u32 new_ip, u32 new_sp)

View file

@ -779,7 +779,7 @@ unsigned long max_swapfile_size(void)
if (boot_cpu_has_bug(X86_BUG_L1TF)) { if (boot_cpu_has_bug(X86_BUG_L1TF)) {
/* Limit the swap file size to MAX_PA/2 for L1TF workaround */ /* Limit the swap file size to MAX_PA/2 for L1TF workaround */
unsigned long l1tf_limit = l1tf_pfn_limit() + 1; unsigned long long l1tf_limit = l1tf_pfn_limit();
/* /*
* We encode swap offsets also with 3 bits below those for pfn * We encode swap offsets also with 3 bits below those for pfn
* which makes the usable limit higher. * which makes the usable limit higher.
@ -787,7 +787,7 @@ unsigned long max_swapfile_size(void)
#if CONFIG_PGTABLE_LEVELS > 2 #if CONFIG_PGTABLE_LEVELS > 2
l1tf_limit <<= PAGE_SHIFT - SWP_OFFSET_FIRST_BIT; l1tf_limit <<= PAGE_SHIFT - SWP_OFFSET_FIRST_BIT;
#endif #endif
pages = min_t(unsigned long, l1tf_limit, pages); pages = min_t(unsigned long long, l1tf_limit, pages);
} }
return pages; return pages;
} }

View file

@ -138,7 +138,7 @@ bool pfn_modify_allowed(unsigned long pfn, pgprot_t prot)
/* If it's real memory always allow */ /* If it's real memory always allow */
if (pfn_valid(pfn)) if (pfn_valid(pfn))
return true; return true;
if (pfn > l1tf_pfn_limit() && !capable(CAP_SYS_ADMIN)) if (pfn >= l1tf_pfn_limit() && !capable(CAP_SYS_ADMIN))
return false; return false;
return true; return true;
} }

View file

@ -2526,7 +2526,7 @@ static int cdrom_ioctl_drive_status(struct cdrom_device_info *cdi,
if (!CDROM_CAN(CDC_SELECT_DISC) || if (!CDROM_CAN(CDC_SELECT_DISC) ||
(arg == CDSL_CURRENT || arg == CDSL_NONE)) (arg == CDSL_CURRENT || arg == CDSL_NONE))
return cdi->ops->drive_status(cdi, CDSL_CURRENT); return cdi->ops->drive_status(cdi, CDSL_CURRENT);
if (((int)arg >= cdi->capacity)) if (arg >= cdi->capacity)
return -EINVAL; return -EINVAL;
return cdrom_slot_status(cdi, arg); return cdrom_slot_status(cdi, arg);
} }

View file

@ -450,6 +450,18 @@ static void adv7511_hpd_work(struct work_struct *work)
else else
status = connector_status_disconnected; status = connector_status_disconnected;
/*
* The bridge resets its registers on unplug. So when we get a plug
* event and we're already supposed to be powered, cycle the bridge to
* restore its state.
*/
if (status == connector_status_connected &&
adv7511->connector.status == connector_status_disconnected &&
adv7511->powered) {
regcache_mark_dirty(adv7511->regmap);
adv7511_power_on(adv7511);
}
if (adv7511->connector.status != status) { if (adv7511->connector.status != status) {
adv7511->connector.status = status; adv7511->connector.status = status;
drm_kms_helper_hotplug_event(adv7511->connector.dev); drm_kms_helper_hotplug_event(adv7511->connector.dev);

View file

@ -526,6 +526,9 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
return PTR_ERR(imx_ldb->regmap); return PTR_ERR(imx_ldb->regmap);
} }
/* disable LDB by resetting the control register to POR default */
regmap_write(imx_ldb->regmap, IOMUXC_GPR2, 0);
imx_ldb->dev = dev; imx_ldb->dev = dev;
if (of_id) if (of_id)
@ -566,14 +569,14 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
if (ret || i < 0 || i > 1) if (ret || i < 0 || i > 1)
return -EINVAL; return -EINVAL;
if (!of_device_is_available(child))
continue;
if (dual && i > 0) { if (dual && i > 0) {
dev_warn(dev, "dual-channel mode, ignoring second output\n"); dev_warn(dev, "dual-channel mode, ignoring second output\n");
continue; continue;
} }
if (!of_device_is_available(child))
continue;
channel = &imx_ldb->channel[i]; channel = &imx_ldb->channel[i];
channel->ldb = imx_ldb; channel->ldb = imx_ldb;
channel->chno = i; channel->chno = i;

View file

@ -341,7 +341,7 @@ static int udl_fb_open(struct fb_info *info, int user)
struct fb_deferred_io *fbdefio; struct fb_deferred_io *fbdefio;
fbdefio = kmalloc(sizeof(struct fb_deferred_io), GFP_KERNEL); fbdefio = kzalloc(sizeof(struct fb_deferred_io), GFP_KERNEL);
if (fbdefio) { if (fbdefio) {
fbdefio->delay = DL_DEFIO_WRITE_DELAY; fbdefio->delay = DL_DEFIO_WRITE_DELAY;

View file

@ -141,18 +141,13 @@ static void udl_free_urb_list(struct drm_device *dev)
struct list_head *node; struct list_head *node;
struct urb_node *unode; struct urb_node *unode;
struct urb *urb; struct urb *urb;
int ret;
unsigned long flags; unsigned long flags;
DRM_DEBUG("Waiting for completes and freeing all render urbs\n"); DRM_DEBUG("Waiting for completes and freeing all render urbs\n");
/* keep waiting and freeing, until we've got 'em all */ /* keep waiting and freeing, until we've got 'em all */
while (count--) { while (count--) {
down(&udl->urbs.limit_sem);
/* Getting interrupted means a leak, but ok at shutdown*/
ret = down_interruptible(&udl->urbs.limit_sem);
if (ret)
break;
spin_lock_irqsave(&udl->urbs.lock, flags); spin_lock_irqsave(&udl->urbs.lock, flags);
@ -176,17 +171,22 @@ static void udl_free_urb_list(struct drm_device *dev)
static int udl_alloc_urb_list(struct drm_device *dev, int count, size_t size) static int udl_alloc_urb_list(struct drm_device *dev, int count, size_t size)
{ {
struct udl_device *udl = dev->dev_private; struct udl_device *udl = dev->dev_private;
int i = 0;
struct urb *urb; struct urb *urb;
struct urb_node *unode; struct urb_node *unode;
char *buf; char *buf;
size_t wanted_size = count * size;
spin_lock_init(&udl->urbs.lock); spin_lock_init(&udl->urbs.lock);
retry:
udl->urbs.size = size; udl->urbs.size = size;
INIT_LIST_HEAD(&udl->urbs.list); INIT_LIST_HEAD(&udl->urbs.list);
while (i < count) { sema_init(&udl->urbs.limit_sem, 0);
udl->urbs.count = 0;
udl->urbs.available = 0;
while (udl->urbs.count * size < wanted_size) {
unode = kzalloc(sizeof(struct urb_node), GFP_KERNEL); unode = kzalloc(sizeof(struct urb_node), GFP_KERNEL);
if (!unode) if (!unode)
break; break;
@ -202,11 +202,16 @@ static int udl_alloc_urb_list(struct drm_device *dev, int count, size_t size)
} }
unode->urb = urb; unode->urb = urb;
buf = usb_alloc_coherent(udl->udev, MAX_TRANSFER, GFP_KERNEL, buf = usb_alloc_coherent(udl->udev, size, GFP_KERNEL,
&urb->transfer_dma); &urb->transfer_dma);
if (!buf) { if (!buf) {
kfree(unode); kfree(unode);
usb_free_urb(urb); usb_free_urb(urb);
if (size > PAGE_SIZE) {
size /= 2;
udl_free_urb_list(dev);
goto retry;
}
break; break;
} }
@ -217,16 +222,14 @@ static int udl_alloc_urb_list(struct drm_device *dev, int count, size_t size)
list_add_tail(&unode->entry, &udl->urbs.list); list_add_tail(&unode->entry, &udl->urbs.list);
i++; up(&udl->urbs.limit_sem);
udl->urbs.count++;
udl->urbs.available++;
} }
sema_init(&udl->urbs.limit_sem, i); DRM_DEBUG("allocated %d %d byte urbs\n", udl->urbs.count, (int) size);
udl->urbs.count = i;
udl->urbs.available = i;
DRM_DEBUG("allocated %d %d byte urbs\n", i, (int) size); return udl->urbs.count;
return i;
} }
struct urb *udl_get_urb(struct drm_device *dev) struct urb *udl_get_urb(struct drm_device *dev)

View file

@ -234,12 +234,16 @@ static void i2c_davinci_calc_clk_dividers(struct davinci_i2c_dev *dev)
/* /*
* It's not always possible to have 1 to 2 ratio when d=7, so fall back * It's not always possible to have 1 to 2 ratio when d=7, so fall back
* to minimal possible clkh in this case. * to minimal possible clkh in this case.
*
* Note:
* CLKH is not allowed to be 0, in this case I2C clock is not generated
* at all
*/ */
if (clk >= clkl + d) { if (clk > clkl + d) {
clkh = clk - clkl - d; clkh = clk - clkl - d;
clkl -= d; clkl -= d;
} else { } else {
clkh = 0; clkh = 1;
clkl = clk - (d << 1); clkl = clk - (d << 1);
} }

View file

@ -86,6 +86,11 @@ static u32 mpc52xx_can_get_clock(struct platform_device *ofdev,
return 0; return 0;
} }
cdm = of_iomap(np_cdm, 0); cdm = of_iomap(np_cdm, 0);
if (!cdm) {
of_node_put(np_cdm);
dev_err(&ofdev->dev, "can't map clock node!\n");
return 0;
}
if (in_8(&cdm->ipb_clk_sel) & 0x1) if (in_8(&cdm->ipb_clk_sel) & 0x1)
freq *= 2; freq *= 2;

View file

@ -32,7 +32,7 @@ config EL3
config 3C515 config 3C515
tristate "3c515 ISA \"Fast EtherLink\"" tristate "3c515 ISA \"Fast EtherLink\""
depends on ISA && ISA_DMA_API depends on ISA && ISA_DMA_API && !PPC32
---help--- ---help---
If you have a 3Com ISA EtherLink XL "Corkscrew" 3c515 Fast Ethernet If you have a 3Com ISA EtherLink XL "Corkscrew" 3c515 Fast Ethernet
network card, say Y here. network card, say Y here.

View file

@ -44,7 +44,7 @@ config AMD8111_ETH
config LANCE config LANCE
tristate "AMD LANCE and PCnet (AT1500 and NE2100) support" tristate "AMD LANCE and PCnet (AT1500 and NE2100) support"
depends on ISA && ISA_DMA_API && !ARM depends on ISA && ISA_DMA_API && !ARM && !PPC32
---help--- ---help---
If you have a network (Ethernet) card of this type, say Y here. If you have a network (Ethernet) card of this type, say Y here.
Some LinkSys cards are of this type. Some LinkSys cards are of this type.
@ -138,7 +138,7 @@ config PCMCIA_NMCLAN
config NI65 config NI65
tristate "NI6510 support" tristate "NI6510 support"
depends on ISA && ISA_DMA_API && !ARM depends on ISA && ISA_DMA_API && !ARM && !PPC32
---help--- ---help---
If you have a network (Ethernet) card of this type, say Y here. If you have a network (Ethernet) card of this type, say Y here.

View file

@ -1683,6 +1683,7 @@ static struct sk_buff *atl1c_alloc_skb(struct atl1c_adapter *adapter)
skb = build_skb(page_address(page) + adapter->rx_page_offset, skb = build_skb(page_address(page) + adapter->rx_page_offset,
adapter->rx_frag_size); adapter->rx_frag_size);
if (likely(skb)) { if (likely(skb)) {
skb_reserve(skb, NET_SKB_PAD);
adapter->rx_page_offset += adapter->rx_frag_size; adapter->rx_page_offset += adapter->rx_frag_size;
if (adapter->rx_page_offset >= PAGE_SIZE) if (adapter->rx_page_offset >= PAGE_SIZE)
adapter->rx_page = NULL; adapter->rx_page = NULL;

View file

@ -3360,14 +3360,18 @@ static int bnx2x_set_rss_flags(struct bnx2x *bp, struct ethtool_rxnfc *info)
DP(BNX2X_MSG_ETHTOOL, DP(BNX2X_MSG_ETHTOOL,
"rss re-configured, UDP 4-tupple %s\n", "rss re-configured, UDP 4-tupple %s\n",
udp_rss_requested ? "enabled" : "disabled"); udp_rss_requested ? "enabled" : "disabled");
return bnx2x_rss(bp, &bp->rss_conf_obj, false, true); if (bp->state == BNX2X_STATE_OPEN)
return bnx2x_rss(bp, &bp->rss_conf_obj, false,
true);
} else if ((info->flow_type == UDP_V6_FLOW) && } else if ((info->flow_type == UDP_V6_FLOW) &&
(bp->rss_conf_obj.udp_rss_v6 != udp_rss_requested)) { (bp->rss_conf_obj.udp_rss_v6 != udp_rss_requested)) {
bp->rss_conf_obj.udp_rss_v6 = udp_rss_requested; bp->rss_conf_obj.udp_rss_v6 = udp_rss_requested;
DP(BNX2X_MSG_ETHTOOL, DP(BNX2X_MSG_ETHTOOL,
"rss re-configured, UDP 4-tupple %s\n", "rss re-configured, UDP 4-tupple %s\n",
udp_rss_requested ? "enabled" : "disabled"); udp_rss_requested ? "enabled" : "disabled");
return bnx2x_rss(bp, &bp->rss_conf_obj, false, true); if (bp->state == BNX2X_STATE_OPEN)
return bnx2x_rss(bp, &bp->rss_conf_obj, false,
true);
} }
return 0; return 0;
@ -3481,7 +3485,10 @@ static int bnx2x_set_rxfh(struct net_device *dev, const u32 *indir,
bp->rss_conf_obj.ind_table[i] = indir[i] + bp->fp->cl_id; bp->rss_conf_obj.ind_table[i] = indir[i] + bp->fp->cl_id;
} }
return bnx2x_config_rss_eth(bp, false); if (bp->state == BNX2X_STATE_OPEN)
return bnx2x_config_rss_eth(bp, false);
return 0;
} }
/** /**

View file

@ -19,6 +19,7 @@ if NET_VENDOR_CIRRUS
config CS89x0 config CS89x0
tristate "CS89x0 support" tristate "CS89x0 support"
depends on ISA || EISA || ARM depends on ISA || EISA || ARM
depends on !PPC32
---help--- ---help---
Support for CS89x0 chipset based Ethernet cards. If you have a Support for CS89x0 chipset based Ethernet cards. If you have a
network (Ethernet) card of this type, say Y and read the file network (Ethernet) card of this type, say Y and read the file

View file

@ -1842,10 +1842,32 @@ static int enic_stop(struct net_device *netdev)
return 0; return 0;
} }
static int _enic_change_mtu(struct net_device *netdev, int new_mtu)
{
bool running = netif_running(netdev);
int err = 0;
ASSERT_RTNL();
if (running) {
err = enic_stop(netdev);
if (err)
return err;
}
netdev->mtu = new_mtu;
if (running) {
err = enic_open(netdev);
if (err)
return err;
}
return 0;
}
static int enic_change_mtu(struct net_device *netdev, int new_mtu) static int enic_change_mtu(struct net_device *netdev, int new_mtu)
{ {
struct enic *enic = netdev_priv(netdev); struct enic *enic = netdev_priv(netdev);
int running = netif_running(netdev);
if (new_mtu < ENIC_MIN_MTU || new_mtu > ENIC_MAX_MTU) if (new_mtu < ENIC_MIN_MTU || new_mtu > ENIC_MAX_MTU)
return -EINVAL; return -EINVAL;
@ -1853,20 +1875,12 @@ static int enic_change_mtu(struct net_device *netdev, int new_mtu)
if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic)) if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic))
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (running)
enic_stop(netdev);
netdev->mtu = new_mtu;
if (netdev->mtu > enic->port_mtu) if (netdev->mtu > enic->port_mtu)
netdev_warn(netdev, netdev_warn(netdev,
"interface MTU (%d) set higher than port MTU (%d)\n", "interface MTU (%d) set higher than port MTU (%d)\n",
netdev->mtu, enic->port_mtu); netdev->mtu, enic->port_mtu);
if (running) return _enic_change_mtu(netdev, new_mtu);
enic_open(netdev);
return 0;
} }
static void enic_change_mtu_work(struct work_struct *work) static void enic_change_mtu_work(struct work_struct *work)
@ -1874,47 +1888,9 @@ static void enic_change_mtu_work(struct work_struct *work)
struct enic *enic = container_of(work, struct enic, change_mtu_work); struct enic *enic = container_of(work, struct enic, change_mtu_work);
struct net_device *netdev = enic->netdev; struct net_device *netdev = enic->netdev;
int new_mtu = vnic_dev_mtu(enic->vdev); int new_mtu = vnic_dev_mtu(enic->vdev);
int err;
unsigned int i;
new_mtu = max_t(int, ENIC_MIN_MTU, min_t(int, ENIC_MAX_MTU, new_mtu));
rtnl_lock(); rtnl_lock();
(void)_enic_change_mtu(netdev, new_mtu);
/* Stop RQ */
del_timer_sync(&enic->notify_timer);
for (i = 0; i < enic->rq_count; i++)
napi_disable(&enic->napi[i]);
vnic_intr_mask(&enic->intr[0]);
enic_synchronize_irqs(enic);
err = vnic_rq_disable(&enic->rq[0]);
if (err) {
rtnl_unlock();
netdev_err(netdev, "Unable to disable RQ.\n");
return;
}
vnic_rq_clean(&enic->rq[0], enic_free_rq_buf);
vnic_cq_clean(&enic->cq[0]);
vnic_intr_clean(&enic->intr[0]);
/* Fill RQ with new_mtu-sized buffers */
netdev->mtu = new_mtu;
vnic_rq_fill(&enic->rq[0], enic_rq_alloc_buf);
/* Need at least one buffer on ring to get going */
if (vnic_rq_desc_used(&enic->rq[0]) == 0) {
rtnl_unlock();
netdev_err(netdev, "Unable to alloc receive buffers.\n");
return;
}
/* Start RQ */
vnic_rq_enable(&enic->rq[0]);
napi_enable(&enic->napi[0]);
vnic_intr_unmask(&enic->intr[0]);
enic_notify_timer_start(enic);
rtnl_unlock(); rtnl_unlock();
netdev_info(netdev, "interface MTU set as %d\n", netdev->mtu); netdev_info(netdev, "interface MTU set as %d\n", netdev->mtu);

View file

@ -420,6 +420,7 @@ static void qed_mcp_handle_link_change(struct qed_hwfn *p_hwfn,
break; break;
default: default:
p_link->speed = 0; p_link->speed = 0;
p_link->link_up = 0;
} }
/* Correct speed according to bandwidth allocation */ /* Correct speed according to bandwidth allocation */

View file

@ -218,6 +218,7 @@ issue:
ret = of_mdiobus_register(bus, np1); ret = of_mdiobus_register(bus, np1);
if (ret) { if (ret) {
mdiobus_free(bus); mdiobus_free(bus);
lp->mii_bus = NULL;
return ret; return ret;
} }
return 0; return 0;

View file

@ -1385,7 +1385,7 @@ static irqreturn_t lmc_interrupt (int irq, void *dev_instance) /*fold00*/
case 0x001: case 0x001:
printk(KERN_WARNING "%s: Master Abort (naughty)\n", dev->name); printk(KERN_WARNING "%s: Master Abort (naughty)\n", dev->name);
break; break;
case 0x010: case 0x002:
printk(KERN_WARNING "%s: Target Abort (not so naughty)\n", dev->name); printk(KERN_WARNING "%s: Target Abort (not so naughty)\n", dev->name);
break; break;
default: default:

View file

@ -434,7 +434,7 @@ static void imx1_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
const char *name; const char *name;
int i, ret; int i, ret;
if (group > info->ngroups) if (group >= info->ngroups)
return; return;
seq_puts(s, "\n"); seq_puts(s, "\n");

View file

@ -640,21 +640,20 @@ static inline unsigned long qdio_aob_for_buffer(struct qdio_output_q *q,
unsigned long phys_aob = 0; unsigned long phys_aob = 0;
if (!q->use_cq) if (!q->use_cq)
goto out; return 0;
if (!q->aobs[bufnr]) { if (!q->aobs[bufnr]) {
struct qaob *aob = qdio_allocate_aob(); struct qaob *aob = qdio_allocate_aob();
q->aobs[bufnr] = aob; q->aobs[bufnr] = aob;
} }
if (q->aobs[bufnr]) { if (q->aobs[bufnr]) {
q->sbal_state[bufnr].flags = QDIO_OUTBUF_STATE_FLAG_NONE;
q->sbal_state[bufnr].aob = q->aobs[bufnr]; q->sbal_state[bufnr].aob = q->aobs[bufnr];
q->aobs[bufnr]->user1 = (u64) q->sbal_state[bufnr].user; q->aobs[bufnr]->user1 = (u64) q->sbal_state[bufnr].user;
phys_aob = virt_to_phys(q->aobs[bufnr]); phys_aob = virt_to_phys(q->aobs[bufnr]);
WARN_ON_ONCE(phys_aob & 0xFF); WARN_ON_ONCE(phys_aob & 0xFF);
} }
out: q->sbal_state[bufnr].flags = 0;
return phys_aob; return phys_aob;
} }

View file

@ -752,9 +752,9 @@ int fcoe_ctlr_els_send(struct fcoe_ctlr *fip, struct fc_lport *lport,
case ELS_LOGO: case ELS_LOGO:
if (fip->mode == FIP_MODE_VN2VN) { if (fip->mode == FIP_MODE_VN2VN) {
if (fip->state != FIP_ST_VNMP_UP) if (fip->state != FIP_ST_VNMP_UP)
return -EINVAL; goto drop;
if (ntoh24(fh->fh_d_id) == FC_FID_FLOGI) if (ntoh24(fh->fh_d_id) == FC_FID_FLOGI)
return -EINVAL; goto drop;
} else { } else {
if (fip->state != FIP_ST_ENABLED) if (fip->state != FIP_ST_ENABLED)
return 0; return 0;

View file

@ -283,11 +283,11 @@ static int iscsi_check_tmf_restrictions(struct iscsi_task *task, int opcode)
*/ */
if (opcode != ISCSI_OP_SCSI_DATA_OUT) { if (opcode != ISCSI_OP_SCSI_DATA_OUT) {
iscsi_conn_printk(KERN_INFO, conn, iscsi_conn_printk(KERN_INFO, conn,
"task [op %x/%x itt " "task [op %x itt "
"0x%x/0x%x] " "0x%x/0x%x] "
"rejected.\n", "rejected.\n",
task->hdr->opcode, opcode, opcode, task->itt,
task->itt, task->hdr_itt); task->hdr_itt);
return -EACCES; return -EACCES;
} }
/* /*
@ -296,10 +296,10 @@ static int iscsi_check_tmf_restrictions(struct iscsi_task *task, int opcode)
*/ */
if (conn->session->fast_abort) { if (conn->session->fast_abort) {
iscsi_conn_printk(KERN_INFO, conn, iscsi_conn_printk(KERN_INFO, conn,
"task [op %x/%x itt " "task [op %x itt "
"0x%x/0x%x] fast abort.\n", "0x%x/0x%x] fast abort.\n",
task->hdr->opcode, opcode, opcode, task->itt,
task->itt, task->hdr_itt); task->hdr_itt);
return -EACCES; return -EACCES;
} }
break; break;

View file

@ -678,8 +678,24 @@ static ssize_t
sdev_store_delete(struct device *dev, struct device_attribute *attr, sdev_store_delete(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
if (device_remove_file_self(dev, attr)) struct kernfs_node *kn;
scsi_remove_device(to_scsi_device(dev));
kn = sysfs_break_active_protection(&dev->kobj, &attr->attr);
WARN_ON_ONCE(!kn);
/*
* Concurrent writes into the "delete" sysfs attribute may trigger
* concurrent calls to device_remove_file() and scsi_remove_device().
* device_remove_file() handles concurrent removal calls by
* serializing these and by ignoring the second and later removal
* attempts. Concurrent calls of scsi_remove_device() are
* serialized. The second and later calls of scsi_remove_device() are
* ignored because the first call of that function changes the device
* state into SDEV_DEL.
*/
device_remove_file(dev, attr);
scsi_remove_device(to_scsi_device(dev));
if (kn)
sysfs_unbreak_active_protection(kn);
return count; return count;
}; };
static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete); static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete);

View file

@ -545,9 +545,14 @@ static void pvscsi_complete_request(struct pvscsi_adapter *adapter,
(btstat == BTSTAT_SUCCESS || (btstat == BTSTAT_SUCCESS ||
btstat == BTSTAT_LINKED_COMMAND_COMPLETED || btstat == BTSTAT_LINKED_COMMAND_COMPLETED ||
btstat == BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG)) { btstat == BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG)) {
cmd->result = (DID_OK << 16) | sdstat; if (sdstat == SAM_STAT_COMMAND_TERMINATED) {
if (sdstat == SAM_STAT_CHECK_CONDITION && cmd->sense_buffer) cmd->result = (DID_RESET << 16);
cmd->result |= (DRIVER_SENSE << 24); } else {
cmd->result = (DID_OK << 16) | sdstat;
if (sdstat == SAM_STAT_CHECK_CONDITION &&
cmd->sense_buffer)
cmd->result |= (DRIVER_SENSE << 24);
}
} else } else
switch (btstat) { switch (btstat) {
case BTSTAT_SUCCESS: case BTSTAT_SUCCESS:

View file

@ -11,7 +11,6 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#include <asm/cacheflush.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
@ -22,6 +21,8 @@
#include <media/v4l2-dev.h> #include <media/v4l2-dev.h>
#include <media/v4l2-ioctl.h> #include <media/v4l2-ioctl.h>
#include <asm/cacheflush.h>
#include "iss_video.h" #include "iss_video.h"
#include "iss.h" #include "iss.h"

View file

@ -323,8 +323,7 @@ static int iscsi_login_zero_tsih_s1(
pr_err("idr_alloc() for sess_idr failed\n"); pr_err("idr_alloc() for sess_idr failed\n");
iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR,
ISCSI_LOGIN_STATUS_NO_RESOURCES); ISCSI_LOGIN_STATUS_NO_RESOURCES);
kfree(sess); goto free_sess;
return -ENOMEM;
} }
sess->creation_time = get_jiffies_64(); sess->creation_time = get_jiffies_64();
@ -340,20 +339,28 @@ static int iscsi_login_zero_tsih_s1(
ISCSI_LOGIN_STATUS_NO_RESOURCES); ISCSI_LOGIN_STATUS_NO_RESOURCES);
pr_err("Unable to allocate memory for" pr_err("Unable to allocate memory for"
" struct iscsi_sess_ops.\n"); " struct iscsi_sess_ops.\n");
kfree(sess); goto remove_idr;
return -ENOMEM;
} }
sess->se_sess = transport_init_session(TARGET_PROT_NORMAL); sess->se_sess = transport_init_session(TARGET_PROT_NORMAL);
if (IS_ERR(sess->se_sess)) { if (IS_ERR(sess->se_sess)) {
iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR,
ISCSI_LOGIN_STATUS_NO_RESOURCES); ISCSI_LOGIN_STATUS_NO_RESOURCES);
kfree(sess->sess_ops); goto free_ops;
kfree(sess);
return -ENOMEM;
} }
return 0; return 0;
free_ops:
kfree(sess->sess_ops);
remove_idr:
spin_lock_bh(&sess_idr_lock);
idr_remove(&sess_idr, sess->session_index);
spin_unlock_bh(&sess_idr_lock);
free_sess:
kfree(sess);
conn->sess = NULL;
return -ENOMEM;
} }
static int iscsi_login_zero_tsih_s2( static int iscsi_login_zero_tsih_s2(
@ -1142,13 +1149,13 @@ void iscsi_target_login_sess_out(struct iscsi_conn *conn,
ISCSI_LOGIN_STATUS_INIT_ERR); ISCSI_LOGIN_STATUS_INIT_ERR);
if (!zero_tsih || !conn->sess) if (!zero_tsih || !conn->sess)
goto old_sess_out; goto old_sess_out;
if (conn->sess->se_sess)
transport_free_session(conn->sess->se_sess); transport_free_session(conn->sess->se_sess);
if (conn->sess->session_index != 0) {
spin_lock_bh(&sess_idr_lock); spin_lock_bh(&sess_idr_lock);
idr_remove(&sess_idr, conn->sess->session_index); idr_remove(&sess_idr, conn->sess->session_index);
spin_unlock_bh(&sess_idr_lock); spin_unlock_bh(&sess_idr_lock);
}
kfree(conn->sess->sess_ops); kfree(conn->sess->sess_ops);
kfree(conn->sess); kfree(conn->sess);
conn->sess = NULL; conn->sess = NULL;

View file

@ -941,14 +941,14 @@ static struct usb_descriptor_header *hs_audio_desc[] = {
}; };
struct cntrl_cur_lay3 { struct cntrl_cur_lay3 {
__u32 dCUR; __le32 dCUR;
}; };
struct cntrl_range_lay3 { struct cntrl_range_lay3 {
__u16 wNumSubRanges; __le16 wNumSubRanges;
__u32 dMIN; __le32 dMIN;
__u32 dMAX; __le32 dMAX;
__u32 dRES; __le32 dRES;
} __packed; } __packed;
static inline void static inline void
@ -1296,9 +1296,9 @@ in_rq_cur(struct usb_function *fn, const struct usb_ctrlrequest *cr)
memset(&c, 0, sizeof(struct cntrl_cur_lay3)); memset(&c, 0, sizeof(struct cntrl_cur_lay3));
if (entity_id == USB_IN_CLK_ID) if (entity_id == USB_IN_CLK_ID)
c.dCUR = p_srate; c.dCUR = cpu_to_le32(p_srate);
else if (entity_id == USB_OUT_CLK_ID) else if (entity_id == USB_OUT_CLK_ID)
c.dCUR = c_srate; c.dCUR = cpu_to_le32(c_srate);
value = min_t(unsigned, w_length, sizeof c); value = min_t(unsigned, w_length, sizeof c);
memcpy(req->buf, &c, value); memcpy(req->buf, &c, value);
@ -1336,15 +1336,15 @@ in_rq_range(struct usb_function *fn, const struct usb_ctrlrequest *cr)
if (control_selector == UAC2_CS_CONTROL_SAM_FREQ) { if (control_selector == UAC2_CS_CONTROL_SAM_FREQ) {
if (entity_id == USB_IN_CLK_ID) if (entity_id == USB_IN_CLK_ID)
r.dMIN = p_srate; r.dMIN = cpu_to_le32(p_srate);
else if (entity_id == USB_OUT_CLK_ID) else if (entity_id == USB_OUT_CLK_ID)
r.dMIN = c_srate; r.dMIN = cpu_to_le32(c_srate);
else else
return -EOPNOTSUPP; return -EOPNOTSUPP;
r.dMAX = r.dMIN; r.dMAX = r.dMIN;
r.dRES = 0; r.dRES = 0;
r.wNumSubRanges = 1; r.wNumSubRanges = cpu_to_le16(1);
value = min_t(unsigned, w_length, sizeof r); value = min_t(unsigned, w_length, sizeof r);
memcpy(req->buf, &r, value); memcpy(req->buf, &r, value);

View file

@ -835,11 +835,11 @@ static void init_controller(struct r8a66597 *r8a66597)
r8a66597_bset(r8a66597, XCKE, SYSCFG0); r8a66597_bset(r8a66597, XCKE, SYSCFG0);
msleep(3); mdelay(3);
r8a66597_bset(r8a66597, PLLC, SYSCFG0); r8a66597_bset(r8a66597, PLLC, SYSCFG0);
msleep(1); mdelay(1);
r8a66597_bset(r8a66597, SCKE, SYSCFG0); r8a66597_bset(r8a66597, SCKE, SYSCFG0);
@ -1193,7 +1193,7 @@ __acquires(r8a66597->lock)
r8a66597->ep0_req->length = 2; r8a66597->ep0_req->length = 2;
/* AV: what happens if we get called again before that gets through? */ /* AV: what happens if we get called again before that gets through? */
spin_unlock(&r8a66597->lock); spin_unlock(&r8a66597->lock);
r8a66597_queue(r8a66597->gadget.ep0, r8a66597->ep0_req, GFP_KERNEL); r8a66597_queue(r8a66597->gadget.ep0, r8a66597->ep0_req, GFP_ATOMIC);
spin_lock(&r8a66597->lock); spin_lock(&r8a66597->lock);
} }

View file

@ -879,6 +879,7 @@ int usb_otg_start(struct platform_device *pdev)
if (pdata->init && pdata->init(pdev) != 0) if (pdata->init && pdata->init(pdev) != 0)
return -EINVAL; return -EINVAL;
#ifdef CONFIG_PPC32
if (pdata->big_endian_mmio) { if (pdata->big_endian_mmio) {
_fsl_readl = _fsl_readl_be; _fsl_readl = _fsl_readl_be;
_fsl_writel = _fsl_writel_be; _fsl_writel = _fsl_writel_be;
@ -886,6 +887,7 @@ int usb_otg_start(struct platform_device *pdev)
_fsl_readl = _fsl_readl_le; _fsl_readl = _fsl_readl_le;
_fsl_writel = _fsl_writel_le; _fsl_writel = _fsl_writel_le;
} }
#endif
/* request irq */ /* request irq */
p_otg->irq = platform_get_irq(pdev, 0); p_otg->irq = platform_get_irq(pdev, 0);
@ -976,7 +978,7 @@ int usb_otg_start(struct platform_device *pdev)
/* /*
* state file in sysfs * state file in sysfs
*/ */
static int show_fsl_usb2_otg_state(struct device *dev, static ssize_t show_fsl_usb2_otg_state(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct otg_fsm *fsm = &fsl_otg_dev->fsm; struct otg_fsm *fsm = &fsl_otg_dev->fsm;

View file

@ -4128,7 +4128,7 @@ commit_trans:
data_sinfo->flags, bytes, 1); data_sinfo->flags, bytes, 1);
spin_unlock(&data_sinfo->lock); spin_unlock(&data_sinfo->lock);
return ret; return 0;
} }
/* /*

View file

@ -194,7 +194,6 @@ wait_for_old_object:
pr_err("\n"); pr_err("\n");
pr_err("Error: Unexpected object collision\n"); pr_err("Error: Unexpected object collision\n");
cachefiles_printk_object(object, xobject); cachefiles_printk_object(object, xobject);
BUG();
} }
atomic_inc(&xobject->usage); atomic_inc(&xobject->usage);
write_unlock(&cache->active_lock); write_unlock(&cache->active_lock);

View file

@ -27,6 +27,7 @@ static int cachefiles_read_waiter(wait_queue_t *wait, unsigned mode,
struct cachefiles_one_read *monitor = struct cachefiles_one_read *monitor =
container_of(wait, struct cachefiles_one_read, monitor); container_of(wait, struct cachefiles_one_read, monitor);
struct cachefiles_object *object; struct cachefiles_object *object;
struct fscache_retrieval *op = monitor->op;
struct wait_bit_key *key = _key; struct wait_bit_key *key = _key;
struct page *page = wait->private; struct page *page = wait->private;
@ -51,16 +52,22 @@ static int cachefiles_read_waiter(wait_queue_t *wait, unsigned mode,
list_del(&wait->task_list); list_del(&wait->task_list);
/* move onto the action list and queue for FS-Cache thread pool */ /* move onto the action list and queue for FS-Cache thread pool */
ASSERT(monitor->op); ASSERT(op);
object = container_of(monitor->op->op.object, /* We need to temporarily bump the usage count as we don't own a ref
struct cachefiles_object, fscache); * here otherwise cachefiles_read_copier() may free the op between the
* monitor being enqueued on the op->to_do list and the op getting
* enqueued on the work queue.
*/
fscache_get_retrieval(op);
object = container_of(op->op.object, struct cachefiles_object, fscache);
spin_lock(&object->work_lock); spin_lock(&object->work_lock);
list_add_tail(&monitor->op_link, &monitor->op->to_do); list_add_tail(&monitor->op_link, &op->to_do);
spin_unlock(&object->work_lock); spin_unlock(&object->work_lock);
fscache_enqueue_retrieval(monitor->op); fscache_enqueue_retrieval(op);
fscache_put_retrieval(op);
return 0; return 0;
} }

View file

@ -123,25 +123,41 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
seq_printf(m, "CIFS Version %s\n", CIFS_VERSION); seq_printf(m, "CIFS Version %s\n", CIFS_VERSION);
seq_printf(m, "Features:"); seq_printf(m, "Features:");
#ifdef CONFIG_CIFS_DFS_UPCALL #ifdef CONFIG_CIFS_DFS_UPCALL
seq_printf(m, " dfs"); seq_printf(m, " DFS");
#endif #endif
#ifdef CONFIG_CIFS_FSCACHE #ifdef CONFIG_CIFS_FSCACHE
seq_printf(m, " fscache"); seq_printf(m, ",FSCACHE");
#endif
#ifdef CONFIG_CIFS_SMB_DIRECT
seq_printf(m, ",SMB_DIRECT");
#endif
#ifdef CONFIG_CIFS_STATS2
seq_printf(m, ",STATS2");
#elif defined(CONFIG_CIFS_STATS)
seq_printf(m, ",STATS");
#endif
#ifdef CONFIG_CIFS_DEBUG2
seq_printf(m, ",DEBUG2");
#elif defined(CONFIG_CIFS_DEBUG)
seq_printf(m, ",DEBUG");
#endif
#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
seq_printf(m, ",ALLOW_INSECURE_LEGACY");
#endif #endif
#ifdef CONFIG_CIFS_WEAK_PW_HASH #ifdef CONFIG_CIFS_WEAK_PW_HASH
seq_printf(m, " lanman"); seq_printf(m, ",WEAK_PW_HASH");
#endif #endif
#ifdef CONFIG_CIFS_POSIX #ifdef CONFIG_CIFS_POSIX
seq_printf(m, " posix"); seq_printf(m, ",CIFS_POSIX");
#endif #endif
#ifdef CONFIG_CIFS_UPCALL #ifdef CONFIG_CIFS_UPCALL
seq_printf(m, " spnego"); seq_printf(m, ",UPCALL(SPNEGO)");
#endif #endif
#ifdef CONFIG_CIFS_XATTR #ifdef CONFIG_CIFS_XATTR
seq_printf(m, " xattr"); seq_printf(m, ",XATTR");
#endif #endif
#ifdef CONFIG_CIFS_ACL #ifdef CONFIG_CIFS_ACL
seq_printf(m, " acl"); seq_printf(m, ",ACL");
#endif #endif
seq_putc(m, '\n'); seq_putc(m, '\n');
seq_printf(m, "Active VFS Requests: %d\n", GlobalTotalActiveXid); seq_printf(m, "Active VFS Requests: %d\n", GlobalTotalActiveXid);

View file

@ -1063,6 +1063,8 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid,
if (!server->ops->set_file_info) if (!server->ops->set_file_info)
return -ENOSYS; return -ENOSYS;
info_buf.Pad = 0;
if (attrs->ia_valid & ATTR_ATIME) { if (attrs->ia_valid & ATTR_ATIME) {
set_time = true; set_time = true;
info_buf.LastAccessTime = info_buf.LastAccessTime =

View file

@ -419,7 +419,7 @@ smb3_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
struct cifs_io_parms io_parms; struct cifs_io_parms io_parms;
int buf_type = CIFS_NO_BUFFER; int buf_type = CIFS_NO_BUFFER;
__le16 *utf16_path; __le16 *utf16_path;
__u8 oplock = SMB2_OPLOCK_LEVEL_II; __u8 oplock = SMB2_OPLOCK_LEVEL_NONE;
struct smb2_file_all_info *pfile_info = NULL; struct smb2_file_all_info *pfile_info = NULL;
oparms.tcon = tcon; oparms.tcon = tcon;
@ -481,7 +481,7 @@ smb3_create_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
struct cifs_io_parms io_parms; struct cifs_io_parms io_parms;
int create_options = CREATE_NOT_DIR; int create_options = CREATE_NOT_DIR;
__le16 *utf16_path; __le16 *utf16_path;
__u8 oplock = SMB2_OPLOCK_LEVEL_EXCLUSIVE; __u8 oplock = SMB2_OPLOCK_LEVEL_NONE;
struct kvec iov[2]; struct kvec iov[2];
if (backup_cred(cifs_sb)) if (backup_cred(cifs_sb))

View file

@ -398,6 +398,12 @@ int build_ntlmssp_auth_blob(unsigned char **pbuffer,
goto setup_ntlmv2_ret; goto setup_ntlmv2_ret;
} }
*pbuffer = kmalloc(size_of_ntlmssp_blob(ses), GFP_KERNEL); *pbuffer = kmalloc(size_of_ntlmssp_blob(ses), GFP_KERNEL);
if (!*pbuffer) {
rc = -ENOMEM;
cifs_dbg(VFS, "Error %d during NTLMSSP allocation\n", rc);
*buflen = 0;
goto setup_ntlmv2_ret;
}
sec_blob = (AUTHENTICATE_MESSAGE *)*pbuffer; sec_blob = (AUTHENTICATE_MESSAGE *)*pbuffer;
memcpy(sec_blob->Signature, NTLMSSP_SIGNATURE, 8); memcpy(sec_blob->Signature, NTLMSSP_SIGNATURE, 8);

View file

@ -267,7 +267,7 @@ smb2_set_file_info(struct inode *inode, const char *full_path,
int rc; int rc;
if ((buf->CreationTime == 0) && (buf->LastAccessTime == 0) && if ((buf->CreationTime == 0) && (buf->LastAccessTime == 0) &&
(buf->LastWriteTime == 0) && (buf->ChangeTime) && (buf->LastWriteTime == 0) && (buf->ChangeTime == 0) &&
(buf->Attributes == 0)) (buf->Attributes == 0))
return 0; /* would be a no op, no sense sending this */ return 0; /* would be a no op, no sense sending this */

View file

@ -1401,6 +1401,7 @@ static struct buffer_head * ext4_find_entry (struct inode *dir,
goto cleanup_and_exit; goto cleanup_and_exit;
dxtrace(printk(KERN_DEBUG "ext4_find_entry: dx failed, " dxtrace(printk(KERN_DEBUG "ext4_find_entry: dx failed, "
"falling back\n")); "falling back\n"));
ret = NULL;
} }
nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb); nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb);
if (!nblocks) { if (!nblocks) {

View file

@ -277,8 +277,12 @@ static ssize_t ext4_attr_show(struct kobject *kobj,
case attr_pointer_ui: case attr_pointer_ui:
if (!ptr) if (!ptr)
return 0; return 0;
return snprintf(buf, PAGE_SIZE, "%u\n", if (a->attr_ptr == ptr_ext4_super_block_offset)
*((unsigned int *) ptr)); return snprintf(buf, PAGE_SIZE, "%u\n",
le32_to_cpup(ptr));
else
return snprintf(buf, PAGE_SIZE, "%u\n",
*((unsigned int *) ptr));
case attr_pointer_atomic: case attr_pointer_atomic:
if (!ptr) if (!ptr)
return 0; return 0;
@ -311,7 +315,10 @@ static ssize_t ext4_attr_store(struct kobject *kobj,
ret = kstrtoul(skip_spaces(buf), 0, &t); ret = kstrtoul(skip_spaces(buf), 0, &t);
if (ret) if (ret)
return ret; return ret;
*((unsigned int *) ptr) = t; if (a->attr_ptr == ptr_ext4_super_block_offset)
*((__le32 *) ptr) = cpu_to_le32(t);
else
*((unsigned int *) ptr) = t;
return len; return len;
case attr_inode_readahead: case attr_inode_readahead:
return inode_readahead_blks_store(a, sbi, buf, len); return inode_readahead_blks_store(a, sbi, buf, len);

View file

@ -197,6 +197,8 @@ ext4_xattr_check_names(struct ext4_xattr_entry *entry, void *end,
struct ext4_xattr_entry *next = EXT4_XATTR_NEXT(e); struct ext4_xattr_entry *next = EXT4_XATTR_NEXT(e);
if ((void *)next >= end) if ((void *)next >= end)
return -EFSCORRUPTED; return -EFSCORRUPTED;
if (strnlen(e->e_name, e->e_name_len) != e->e_name_len)
return -EFSCORRUPTED;
e = next; e = next;
} }

View file

@ -66,7 +66,8 @@ void fscache_enqueue_operation(struct fscache_operation *op)
ASSERT(op->processor != NULL); ASSERT(op->processor != NULL);
ASSERT(fscache_object_is_available(op->object)); ASSERT(fscache_object_is_available(op->object));
ASSERTCMP(atomic_read(&op->usage), >, 0); ASSERTCMP(atomic_read(&op->usage), >, 0);
ASSERTCMP(op->state, ==, FSCACHE_OP_ST_IN_PROGRESS); ASSERTIFCMP(op->state != FSCACHE_OP_ST_IN_PROGRESS,
op->state, ==, FSCACHE_OP_ST_CANCELLED);
fscache_stat(&fscache_n_op_enqueue); fscache_stat(&fscache_n_op_enqueue);
switch (op->flags & FSCACHE_OP_TYPE) { switch (op->flags & FSCACHE_OP_TYPE) {
@ -481,7 +482,8 @@ void fscache_put_operation(struct fscache_operation *op)
struct fscache_cache *cache; struct fscache_cache *cache;
_enter("{OBJ%x OP%x,%d}", _enter("{OBJ%x OP%x,%d}",
op->object->debug_id, op->debug_id, atomic_read(&op->usage)); op->object ? op->object->debug_id : 0,
op->debug_id, atomic_read(&op->usage));
ASSERTCMP(atomic_read(&op->usage), >, 0); ASSERTCMP(atomic_read(&op->usage), >, 0);

View file

@ -145,6 +145,16 @@ static bool fuse_block_alloc(struct fuse_conn *fc, bool for_background)
return !fc->initialized || (for_background && fc->blocked); return !fc->initialized || (for_background && fc->blocked);
} }
static void fuse_drop_waiting(struct fuse_conn *fc)
{
if (fc->connected) {
atomic_dec(&fc->num_waiting);
} else if (atomic_dec_and_test(&fc->num_waiting)) {
/* wake up aborters */
wake_up_all(&fc->blocked_waitq);
}
}
static struct fuse_req *__fuse_get_req(struct fuse_conn *fc, unsigned npages, static struct fuse_req *__fuse_get_req(struct fuse_conn *fc, unsigned npages,
bool for_background) bool for_background)
{ {
@ -191,7 +201,7 @@ static struct fuse_req *__fuse_get_req(struct fuse_conn *fc, unsigned npages,
return req; return req;
out: out:
atomic_dec(&fc->num_waiting); fuse_drop_waiting(fc);
return ERR_PTR(err); return ERR_PTR(err);
} }
@ -298,7 +308,7 @@ void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req)
if (test_bit(FR_WAITING, &req->flags)) { if (test_bit(FR_WAITING, &req->flags)) {
__clear_bit(FR_WAITING, &req->flags); __clear_bit(FR_WAITING, &req->flags);
atomic_dec(&fc->num_waiting); fuse_drop_waiting(fc);
} }
if (req->stolen_file) if (req->stolen_file)
@ -384,7 +394,7 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
struct fuse_iqueue *fiq = &fc->iq; struct fuse_iqueue *fiq = &fc->iq;
if (test_and_set_bit(FR_FINISHED, &req->flags)) if (test_and_set_bit(FR_FINISHED, &req->flags))
return; goto put_request;
spin_lock(&fiq->waitq.lock); spin_lock(&fiq->waitq.lock);
list_del_init(&req->intr_entry); list_del_init(&req->intr_entry);
@ -414,6 +424,7 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
wake_up(&req->waitq); wake_up(&req->waitq);
if (req->end) if (req->end)
req->end(fc, req); req->end(fc, req);
put_request:
fuse_put_request(fc, req); fuse_put_request(fc, req);
} }
@ -2001,11 +2012,14 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe,
if (!fud) if (!fud)
return -EPERM; return -EPERM;
bufs = kmalloc(pipe->buffers * sizeof(struct pipe_buffer), GFP_KERNEL);
if (!bufs)
return -ENOMEM;
pipe_lock(pipe); pipe_lock(pipe);
bufs = kmalloc(pipe->buffers * sizeof(struct pipe_buffer), GFP_KERNEL);
if (!bufs) {
pipe_unlock(pipe);
return -ENOMEM;
}
nbuf = 0; nbuf = 0;
rem = 0; rem = 0;
for (idx = 0; idx < pipe->nrbufs && rem < len; idx++) for (idx = 0; idx < pipe->nrbufs && rem < len; idx++)
@ -2161,6 +2175,7 @@ void fuse_abort_conn(struct fuse_conn *fc)
set_bit(FR_ABORTED, &req->flags); set_bit(FR_ABORTED, &req->flags);
if (!test_bit(FR_LOCKED, &req->flags)) { if (!test_bit(FR_LOCKED, &req->flags)) {
set_bit(FR_PRIVATE, &req->flags); set_bit(FR_PRIVATE, &req->flags);
__fuse_get_request(req);
list_move(&req->list, &to_end1); list_move(&req->list, &to_end1);
} }
spin_unlock(&req->waitq.lock); spin_unlock(&req->waitq.lock);
@ -2187,7 +2202,6 @@ void fuse_abort_conn(struct fuse_conn *fc)
while (!list_empty(&to_end1)) { while (!list_empty(&to_end1)) {
req = list_first_entry(&to_end1, struct fuse_req, list); req = list_first_entry(&to_end1, struct fuse_req, list);
__fuse_get_request(req);
list_del_init(&req->list); list_del_init(&req->list);
request_end(fc, req); request_end(fc, req);
} }
@ -2198,6 +2212,11 @@ void fuse_abort_conn(struct fuse_conn *fc)
} }
EXPORT_SYMBOL_GPL(fuse_abort_conn); EXPORT_SYMBOL_GPL(fuse_abort_conn);
void fuse_wait_aborted(struct fuse_conn *fc)
{
wait_event(fc->blocked_waitq, atomic_read(&fc->num_waiting) == 0);
}
int fuse_dev_release(struct inode *inode, struct file *file) int fuse_dev_release(struct inode *inode, struct file *file)
{ {
struct fuse_dev *fud = fuse_get_dev(file); struct fuse_dev *fud = fuse_get_dev(file);
@ -2205,9 +2224,15 @@ int fuse_dev_release(struct inode *inode, struct file *file)
if (fud) { if (fud) {
struct fuse_conn *fc = fud->fc; struct fuse_conn *fc = fud->fc;
struct fuse_pqueue *fpq = &fud->pq; struct fuse_pqueue *fpq = &fud->pq;
LIST_HEAD(to_end);
spin_lock(&fpq->lock);
WARN_ON(!list_empty(&fpq->io)); WARN_ON(!list_empty(&fpq->io));
end_requests(fc, &fpq->processing); list_splice_init(&fpq->processing, &to_end);
spin_unlock(&fpq->lock);
end_requests(fc, &to_end);
/* Are we the last open device? */ /* Are we the last open device? */
if (atomic_dec_and_test(&fc->dev_count)) { if (atomic_dec_and_test(&fc->dev_count)) {
WARN_ON(fc->iq.fasync != NULL); WARN_ON(fc->iq.fasync != NULL);

View file

@ -879,6 +879,7 @@ static int fuse_readpages_fill(void *_data, struct page *page)
} }
if (WARN_ON(req->num_pages >= req->max_pages)) { if (WARN_ON(req->num_pages >= req->max_pages)) {
unlock_page(page);
fuse_put_request(fc, req); fuse_put_request(fc, req);
return -EIO; return -EIO;
} }

View file

@ -845,6 +845,7 @@ void fuse_request_send_background_locked(struct fuse_conn *fc,
/* Abort all requests */ /* Abort all requests */
void fuse_abort_conn(struct fuse_conn *fc); void fuse_abort_conn(struct fuse_conn *fc);
void fuse_wait_aborted(struct fuse_conn *fc);
/** /**
* Invalidate inode attributes * Invalidate inode attributes

View file

@ -379,9 +379,6 @@ static void fuse_put_super(struct super_block *sb)
{ {
struct fuse_conn *fc = get_fuse_conn_super(sb); struct fuse_conn *fc = get_fuse_conn_super(sb);
fuse_send_destroy(fc);
fuse_abort_conn(fc);
mutex_lock(&fuse_mutex); mutex_lock(&fuse_mutex);
list_del(&fc->entry); list_del(&fc->entry);
fuse_ctl_remove_conn(fc); fuse_ctl_remove_conn(fc);
@ -1172,16 +1169,25 @@ static struct dentry *fuse_mount(struct file_system_type *fs_type,
return mount_nodev(fs_type, flags, raw_data, fuse_fill_super); return mount_nodev(fs_type, flags, raw_data, fuse_fill_super);
} }
static void fuse_kill_sb_anon(struct super_block *sb) static void fuse_sb_destroy(struct super_block *sb)
{ {
struct fuse_conn *fc = get_fuse_conn_super(sb); struct fuse_conn *fc = get_fuse_conn_super(sb);
if (fc) { if (fc) {
fuse_send_destroy(fc);
fuse_abort_conn(fc);
fuse_wait_aborted(fc);
down_write(&fc->killsb); down_write(&fc->killsb);
fc->sb = NULL; fc->sb = NULL;
up_write(&fc->killsb); up_write(&fc->killsb);
} }
}
static void fuse_kill_sb_anon(struct super_block *sb)
{
fuse_sb_destroy(sb);
kill_anon_super(sb); kill_anon_super(sb);
} }
@ -1204,14 +1210,7 @@ static struct dentry *fuse_mount_blk(struct file_system_type *fs_type,
static void fuse_kill_sb_blk(struct super_block *sb) static void fuse_kill_sb_blk(struct super_block *sb)
{ {
struct fuse_conn *fc = get_fuse_conn_super(sb); fuse_sb_destroy(sb);
if (fc) {
down_write(&fc->killsb);
fc->sb = NULL;
up_write(&fc->killsb);
}
kill_block_super(sb); kill_block_super(sb);
} }

View file

@ -407,6 +407,50 @@ int sysfs_chmod_file(struct kobject *kobj, const struct attribute *attr,
} }
EXPORT_SYMBOL_GPL(sysfs_chmod_file); EXPORT_SYMBOL_GPL(sysfs_chmod_file);
/**
* sysfs_break_active_protection - break "active" protection
* @kobj: The kernel object @attr is associated with.
* @attr: The attribute to break the "active" protection for.
*
* With sysfs, just like kernfs, deletion of an attribute is postponed until
* all active .show() and .store() callbacks have finished unless this function
* is called. Hence this function is useful in methods that implement self
* deletion.
*/
struct kernfs_node *sysfs_break_active_protection(struct kobject *kobj,
const struct attribute *attr)
{
struct kernfs_node *kn;
kobject_get(kobj);
kn = kernfs_find_and_get(kobj->sd, attr->name);
if (kn)
kernfs_break_active_protection(kn);
return kn;
}
EXPORT_SYMBOL_GPL(sysfs_break_active_protection);
/**
* sysfs_unbreak_active_protection - restore "active" protection
* @kn: Pointer returned by sysfs_break_active_protection().
*
* Undo the effects of sysfs_break_active_protection(). Since this function
* calls kernfs_put() on the kernfs node that corresponds to the 'attr'
* argument passed to sysfs_break_active_protection() that attribute may have
* been removed between the sysfs_break_active_protection() and
* sysfs_unbreak_active_protection() calls, it is not safe to access @kn after
* this function has returned.
*/
void sysfs_unbreak_active_protection(struct kernfs_node *kn)
{
struct kobject *kobj = kn->parent->priv;
kernfs_unbreak_active_protection(kn);
kernfs_put(kn);
kobject_put(kobj);
}
EXPORT_SYMBOL_GPL(sysfs_unbreak_active_protection);
/** /**
* sysfs_remove_file_ns - remove an object attribute with a custom ns tag * sysfs_remove_file_ns - remove an object attribute with a custom ns tag
* @kobj: object we're acting for * @kobj: object we're acting for

View file

@ -238,6 +238,9 @@ int __must_check sysfs_create_files(struct kobject *kobj,
const struct attribute **attr); const struct attribute **attr);
int __must_check sysfs_chmod_file(struct kobject *kobj, int __must_check sysfs_chmod_file(struct kobject *kobj,
const struct attribute *attr, umode_t mode); const struct attribute *attr, umode_t mode);
struct kernfs_node *sysfs_break_active_protection(struct kobject *kobj,
const struct attribute *attr);
void sysfs_unbreak_active_protection(struct kernfs_node *kn);
void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr, void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr,
const void *ns); const void *ns);
bool sysfs_remove_file_self(struct kobject *kobj, const struct attribute *attr); bool sysfs_remove_file_self(struct kobject *kobj, const struct attribute *attr);
@ -351,6 +354,17 @@ static inline int sysfs_chmod_file(struct kobject *kobj,
return 0; return 0;
} }
static inline struct kernfs_node *
sysfs_break_active_protection(struct kobject *kobj,
const struct attribute *attr)
{
return NULL;
}
static inline void sysfs_unbreak_active_protection(struct kernfs_node *kn)
{
}
static inline void sysfs_remove_file_ns(struct kobject *kobj, static inline void sysfs_remove_file_ns(struct kobject *kobj,
const struct attribute *attr, const struct attribute *attr,
const void *ns) const void *ns)

View file

@ -2441,7 +2441,7 @@ static int __init debugfs_kprobe_init(void)
if (!dir) if (!dir)
return -ENOMEM; return -ENOMEM;
file = debugfs_create_file("list", 0444, dir, NULL, file = debugfs_create_file("list", 0400, dir, NULL,
&debugfs_kprobes_operations); &debugfs_kprobes_operations);
if (!file) if (!file)
goto error; goto error;
@ -2451,7 +2451,7 @@ static int __init debugfs_kprobe_init(void)
if (!file) if (!file)
goto error; goto error;
file = debugfs_create_file("blacklist", 0444, dir, NULL, file = debugfs_create_file("blacklist", 0400, dir, NULL,
&debugfs_kprobe_blacklist_ops); &debugfs_kprobe_blacklist_ops);
if (!file) if (!file)
goto error; goto error;

View file

@ -387,7 +387,8 @@ static struct ctl_table kern_table[] = {
.data = &sysctl_sched_time_avg, .data = &sysctl_sched_time_avg,
.maxlen = sizeof(unsigned int), .maxlen = sizeof(unsigned int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec_minmax,
.extra1 = &one,
}, },
{ {
.procname = "sched_shares_window_ns", .procname = "sched_shares_window_ns",

View file

@ -3701,6 +3701,9 @@ int generic_access_phys(struct vm_area_struct *vma, unsigned long addr,
return -EINVAL; return -EINVAL;
maddr = ioremap_prot(phys_addr, PAGE_ALIGN(len + offset), prot); maddr = ioremap_prot(phys_addr, PAGE_ALIGN(len + offset), prot);
if (!maddr)
return -ENOMEM;
if (write) if (write)
memcpy_toio(maddr + offset, buf, len); memcpy_toio(maddr + offset, buf, len);
else else

View file

@ -1018,6 +1018,15 @@ static int zswap_frontswap_store(unsigned type, pgoff_t offset,
ret = -ENOMEM; ret = -ENOMEM;
goto reject; goto reject;
} }
/* A second zswap_is_full() check after
* zswap_shrink() to make sure it's now
* under the max_pool_percent
*/
if (zswap_is_full()) {
ret = -ENOMEM;
goto reject;
}
} }
/* allocate entry */ /* allocate entry */

View file

@ -131,8 +131,10 @@ static void caif_flow_cb(struct sk_buff *skb)
caifd = caif_get(skb->dev); caifd = caif_get(skb->dev);
WARN_ON(caifd == NULL); WARN_ON(caifd == NULL);
if (caifd == NULL) if (!caifd) {
rcu_read_unlock();
return; return;
}
caifd_hold(caifd); caifd_hold(caifd);
rcu_read_unlock(); rcu_read_unlock();

View file

@ -1593,9 +1593,17 @@ unsigned char *cipso_v4_optptr(const struct sk_buff *skb)
int taglen; int taglen;
for (optlen = iph->ihl*4 - sizeof(struct iphdr); optlen > 0; ) { for (optlen = iph->ihl*4 - sizeof(struct iphdr); optlen > 0; ) {
if (optptr[0] == IPOPT_CIPSO) switch (optptr[0]) {
case IPOPT_CIPSO:
return optptr; return optptr;
taglen = optptr[1]; case IPOPT_END:
return NULL;
case IPOPT_NOOP:
taglen = 1;
break;
default:
taglen = optptr[1];
}
optlen -= taglen; optlen -= taglen;
optptr += taglen; optptr += taglen;
} }

View file

@ -469,10 +469,6 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
goto tx_err_dst_release; goto tx_err_dst_release;
} }
skb_scrub_packet(skb, !net_eq(t->net, dev_net(dev)));
skb_dst_set(skb, dst);
skb->dev = skb_dst(skb)->dev;
mtu = dst_mtu(dst); mtu = dst_mtu(dst);
if (!skb->ignore_df && skb->len > mtu) { if (!skb->ignore_df && skb->len > mtu) {
skb_dst(skb)->ops->update_pmtu(dst, NULL, skb, mtu); skb_dst(skb)->ops->update_pmtu(dst, NULL, skb, mtu);
@ -487,9 +483,14 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
htonl(mtu)); htonl(mtu));
} }
return -EMSGSIZE; err = -EMSGSIZE;
goto tx_err_dst_release;
} }
skb_scrub_packet(skb, !net_eq(t->net, dev_net(dev)));
skb_dst_set(skb, dst);
skb->dev = skb_dst(skb)->dev;
err = dst_output(t->net, skb->sk, skb); err = dst_output(t->net, skb->sk, skb);
if (net_xmit_eval(err) == 0) { if (net_xmit_eval(err) == 0) {
struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats); struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);

View file

@ -2006,7 +2006,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)
if (!sta->uploaded) if (!sta->uploaded)
continue; continue;
if (sta->sdata->vif.type != NL80211_IFTYPE_AP) if (sta->sdata->vif.type != NL80211_IFTYPE_AP &&
sta->sdata->vif.type != NL80211_IFTYPE_AP_VLAN)
continue; continue;
for (state = IEEE80211_STA_NOTEXIST; for (state = IEEE80211_STA_NOTEXIST;

View file

@ -3578,6 +3578,7 @@ static int parse_station_flags(struct genl_info *info,
params->sta_flags_mask = BIT(NL80211_STA_FLAG_AUTHENTICATED) | params->sta_flags_mask = BIT(NL80211_STA_FLAG_AUTHENTICATED) |
BIT(NL80211_STA_FLAG_MFP) | BIT(NL80211_STA_FLAG_MFP) |
BIT(NL80211_STA_FLAG_AUTHORIZED); BIT(NL80211_STA_FLAG_AUTHORIZED);
break;
default: default:
return -EINVAL; return -EINVAL;
} }

View file

@ -2327,6 +2327,9 @@ struct dst_entry *xfrm_lookup_route(struct net *net, struct dst_entry *dst_orig,
if (IS_ERR(dst) && PTR_ERR(dst) == -EREMOTE) if (IS_ERR(dst) && PTR_ERR(dst) == -EREMOTE)
return make_blackhole(net, dst_orig->ops->family, dst_orig); return make_blackhole(net, dst_orig->ops->family, dst_orig);
if (IS_ERR(dst))
dst_release(dst_orig);
return dst; return dst;
} }
EXPORT_SYMBOL(xfrm_lookup_route); EXPORT_SYMBOL(xfrm_lookup_route);

View file

@ -988,10 +988,12 @@ static inline int xfrm_nlmsg_multicast(struct net *net, struct sk_buff *skb,
{ {
struct sock *nlsk = rcu_dereference(net->xfrm.nlsk); struct sock *nlsk = rcu_dereference(net->xfrm.nlsk);
if (nlsk) if (!nlsk) {
return nlmsg_multicast(nlsk, skb, pid, group, GFP_ATOMIC); kfree_skb(skb);
else return -EPIPE;
return -1; }
return nlmsg_multicast(nlsk, skb, pid, group, GFP_ATOMIC);
} }
static inline size_t xfrm_spdinfo_msgsize(void) static inline size_t xfrm_spdinfo_msgsize(void)

View file

@ -367,10 +367,9 @@ static int sirf_usp_pcm_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, usp); platform_set_drvdata(pdev, usp);
mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap(&pdev->dev, mem_res->start, base = devm_ioremap_resource(&pdev->dev, mem_res);
resource_size(mem_res)); if (IS_ERR(base))
if (base == NULL) return PTR_ERR(base);
return -ENOMEM;
usp->regmap = devm_regmap_init_mmio(&pdev->dev, base, usp->regmap = devm_regmap_init_mmio(&pdev->dev, base,
&sirf_usp_regmap_config); &sirf_usp_regmap_config);
if (IS_ERR(usp->regmap)) if (IS_ERR(usp->regmap))

View file

@ -1570,6 +1570,14 @@ static u64 dpcm_runtime_base_format(struct snd_pcm_substream *substream)
int i; int i;
for (i = 0; i < be->num_codecs; i++) { for (i = 0; i < be->num_codecs; i++) {
/*
* Skip CODECs which don't support the current stream
* type. See soc_pcm_init_runtime_hw() for more details
*/
if (!snd_soc_dai_stream_valid(be->codec_dais[i],
stream))
continue;
codec_dai_drv = be->codec_dais[i]->driver; codec_dai_drv = be->codec_dais[i]->driver;
if (stream == SNDRV_PCM_STREAM_PLAYBACK) if (stream == SNDRV_PCM_STREAM_PLAYBACK)
codec_stream = &codec_dai_drv->playback; codec_stream = &codec_dai_drv->playback;

View file

@ -663,9 +663,7 @@ void format_all_counters(struct thread_data *t, struct core_data *c, struct pkg_
if (!printed || !summary_only) if (!printed || !summary_only)
print_header(); print_header();
if (topo.num_cpus > 1) format_counters(&average.threads, &average.cores, &average.packages);
format_counters(&average.threads, &average.cores,
&average.packages);
printed = 1; printed = 1;
@ -2693,7 +2691,9 @@ void process_cpuid()
family = (fms >> 8) & 0xf; family = (fms >> 8) & 0xf;
model = (fms >> 4) & 0xf; model = (fms >> 4) & 0xf;
stepping = fms & 0xf; stepping = fms & 0xf;
if (family == 6 || family == 0xf) if (family == 0xf)
family += (fms >> 20) & 0xff;
if (family >= 6)
model += ((fms >> 16) & 0xf) << 4; model += ((fms >> 16) & 0xf) << 4;
if (debug) if (debug)

View file

@ -0,0 +1,28 @@
#!/bin/sh
# description: Snapshot and tracing setting
# flags: instance
[ ! -f snapshot ] && exit_unsupported
echo "Set tracing off"
echo 0 > tracing_on
echo "Allocate and take a snapshot"
echo 1 > snapshot
# Since trace buffer is empty, snapshot is also empty, but allocated
grep -q "Snapshot is allocated" snapshot
echo "Ensure keep tracing off"
test `cat tracing_on` -eq 0
echo "Set tracing on"
echo 1 > tracing_on
echo "Take a snapshot again"
echo 1 > snapshot
echo "Ensure keep tracing on"
test `cat tracing_on` -eq 1
exit 0

View file

@ -44,12 +44,25 @@
/******************** Little Endian Handling ********************************/ /******************** Little Endian Handling ********************************/
#define cpu_to_le16(x) htole16(x) /*
#define cpu_to_le32(x) htole32(x) * cpu_to_le16/32 are used when initializing structures, a context where a
* function call is not allowed. To solve this, we code cpu_to_le16/32 in a way
* that allows them to be used when initializing structures.
*/
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define cpu_to_le16(x) (x)
#define cpu_to_le32(x) (x)
#else
#define cpu_to_le16(x) ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
#define cpu_to_le32(x) \
((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | \
(((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
#endif
#define le32_to_cpu(x) le32toh(x) #define le32_to_cpu(x) le32toh(x)
#define le16_to_cpu(x) le16toh(x) #define le16_to_cpu(x) le16toh(x)
/******************** Messages and Errors ***********************************/ /******************** Messages and Errors ***********************************/
static const char argv0[] = "ffs-test"; static const char argv0[] = "ffs-test";