Merge android-4.14-p.105 (e742253) into msm-4.14
* refs/heads/tmp-e742253: Linux 4.14.105 x86/uaccess: Don't leak the AC flag into __put_user() value evaluation MIPS: eBPF: Fix icache flush end address MIPS: fix truncation in __cmpxchg_small for short values mm: enforce min addr even if capable() in expand_downwards() mmc: sdhci-esdhc-imx: correct the fix of ERR004536 mmc: tmio: fix access width of Block Count Register mmc: tmio_mmc_core: don't claim spurious interrupts mmc: spi: Fix card detection during probe powerpc: Always initialize input array when calling epapr_hypercall() KVM: nSVM: clear events pending from svm_complete_interrupts() when exiting to L1 svm: Fix AVIC incomplete IPI emulation cfg80211: extend range deviation for DMG mac80211: Add attribute aligned(2) to struct 'action' mac80211: don't initiate TDLS connection if station is not associated to AP ibmveth: Do not process frames after calling napi_reschedule net: dev_is_mac_header_xmit() true for ARPHRD_RAWIP net: usb: asix: ax88772_bind return error when hw_reset fail hv_netvsc: Fix ethtool change hash key error net: altera_tse: fix connect_local_phy error path scsi: csiostor: fix NULL pointer dereference in csio_vport_set_state() writeback: synchronize sync(2) against cgroup writeback membership switches direct-io: allow direct writes to empty inodes staging: android: ion: Support cpu access during dma_buf_detach serial: fsl_lpuart: fix maximum acceptable baud rate with over-sampling drm/amd/powerplay: OD setting fix on Vega10 locking/rwsem: Fix (possible) missed wakeup futex: Fix (possible) missed wakeup sched/wait: Fix rcuwait_wake_up() ordering mac80211: fix miscounting of ttl-dropped frames staging: rtl8723bs: Fix build error with Clang when inlining is disabled drivers: thermal: int340x_thermal: Fix sysfs race condition ARC: fix __ffs return value to avoid build warnings selftests: gpio-mockup-chardev: Check asprintf() for error selftests: seccomp: use LDLIBS instead of LDFLAGS ASoC: imx-audmux: change snprintf to scnprintf for possible overflow ASoC: dapm: change snprintf to scnprintf for possible overflow genirq: Make sure the initial affinity is not empty usb: gadget: Potential NULL dereference on allocation error usb: dwc3: gadget: Fix the uninitialized link_state when udc starts usb: dwc3: gadget: synchronize_irq dwc irq in suspend thermal: int340x_thermal: Fix a NULL vs IS_ERR() check clk: vc5: Abort clock configuration without upstream clock ASoC: Variable "val" in function rt274_i2c_probe() could be uninitialized ALSA: compress: prevent potential divide by zero bugs ASoC: Intel: Haswell/Broadwell: fix setting for .dynamic field drm/msm: Unblock writer if reader closes file scsi: libsas: Fix rphy phy_identifier for PHYs with end devices attached net: stmmac: Disable ACS Feature for GMAC >= 4 net: stmmac: Fix reception of Broadcom switches tags Revert "loop: Fold __loop_release into loop_release" Revert "loop: Get rid of loop_index_mutex" Revert "loop: Fix double mutex_unlock(&loop_ctl_mutex) in loop_control_ioctl()" FROMGIT: binder: create node flag to request sender's security context Modify include/uapi/linux/android/binder.h, as commit: FROMGIT: binder: create node flag to request sender's security context introduces enums and structures, which are already defined in other userspace files that include the binder uapi file. Thus, the redeclaration of these enums and structures can lead to build errors. To avoid this, guard the redundant declarations in the uapi header with the __KERNEL__ header guard, so they are not exported to userspace. Conflicts: drivers/gpu/drm/msm/msm_rd.c drivers/staging/android/ion/ion.c include/uapi/linux/android/binder.h sound/core/compress_offload.c Change-Id: I5d470f222a6a1baa284813a11f847cfcbe6ee0a6 Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org> Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 14
|
||||
SUBLEVEL = 104
|
||||
SUBLEVEL = 105
|
||||
EXTRAVERSION =
|
||||
NAME = Petit Gorille
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ static inline __attribute__ ((const)) int __fls(unsigned long x)
|
||||
/*
|
||||
* __ffs: Similar to ffs, but zero based (0-31)
|
||||
*/
|
||||
static inline __attribute__ ((const)) int __ffs(unsigned long word)
|
||||
static inline __attribute__ ((const)) unsigned long __ffs(unsigned long word)
|
||||
{
|
||||
if (!word)
|
||||
return word;
|
||||
@@ -400,9 +400,9 @@ static inline __attribute__ ((const)) int ffs(unsigned long x)
|
||||
/*
|
||||
* __ffs: Similar to ffs, but zero based (0-31)
|
||||
*/
|
||||
static inline __attribute__ ((const)) int __ffs(unsigned long x)
|
||||
static inline __attribute__ ((const)) unsigned long __ffs(unsigned long x)
|
||||
{
|
||||
int n;
|
||||
unsigned long n;
|
||||
|
||||
asm volatile(
|
||||
" ffs.f %0, %1 \n" /* 0:31; 31(Z) if src 0 */
|
||||
|
||||
@@ -54,10 +54,9 @@ unsigned long __xchg_small(volatile void *ptr, unsigned long val, unsigned int s
|
||||
unsigned long __cmpxchg_small(volatile void *ptr, unsigned long old,
|
||||
unsigned long new, unsigned int size)
|
||||
{
|
||||
u32 mask, old32, new32, load32;
|
||||
u32 mask, old32, new32, load32, load;
|
||||
volatile u32 *ptr32;
|
||||
unsigned int shift;
|
||||
u8 load;
|
||||
|
||||
/* Check that ptr is naturally aligned */
|
||||
WARN_ON((unsigned long)ptr & (size - 1));
|
||||
|
||||
@@ -1971,7 +1971,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
|
||||
|
||||
/* Update the icache */
|
||||
flush_icache_range((unsigned long)ctx.target,
|
||||
(unsigned long)(ctx.target + ctx.idx * sizeof(u32)));
|
||||
(unsigned long)&ctx.target[ctx.idx]);
|
||||
|
||||
if (bpf_jit_enable > 1)
|
||||
/* Dump JIT code */
|
||||
|
||||
@@ -508,7 +508,7 @@ static unsigned long epapr_hypercall(unsigned long *in,
|
||||
|
||||
static inline long epapr_hypercall0_1(unsigned int nr, unsigned long *r2)
|
||||
{
|
||||
unsigned long in[8];
|
||||
unsigned long in[8] = {0};
|
||||
unsigned long out[8];
|
||||
unsigned long r;
|
||||
|
||||
@@ -520,7 +520,7 @@ static inline long epapr_hypercall0_1(unsigned int nr, unsigned long *r2)
|
||||
|
||||
static inline long epapr_hypercall0(unsigned int nr)
|
||||
{
|
||||
unsigned long in[8];
|
||||
unsigned long in[8] = {0};
|
||||
unsigned long out[8];
|
||||
|
||||
return epapr_hypercall(in, out, nr);
|
||||
@@ -528,7 +528,7 @@ static inline long epapr_hypercall0(unsigned int nr)
|
||||
|
||||
static inline long epapr_hypercall1(unsigned int nr, unsigned long p1)
|
||||
{
|
||||
unsigned long in[8];
|
||||
unsigned long in[8] = {0};
|
||||
unsigned long out[8];
|
||||
|
||||
in[0] = p1;
|
||||
@@ -538,7 +538,7 @@ static inline long epapr_hypercall1(unsigned int nr, unsigned long p1)
|
||||
static inline long epapr_hypercall2(unsigned int nr, unsigned long p1,
|
||||
unsigned long p2)
|
||||
{
|
||||
unsigned long in[8];
|
||||
unsigned long in[8] = {0};
|
||||
unsigned long out[8];
|
||||
|
||||
in[0] = p1;
|
||||
@@ -549,7 +549,7 @@ static inline long epapr_hypercall2(unsigned int nr, unsigned long p1,
|
||||
static inline long epapr_hypercall3(unsigned int nr, unsigned long p1,
|
||||
unsigned long p2, unsigned long p3)
|
||||
{
|
||||
unsigned long in[8];
|
||||
unsigned long in[8] = {0};
|
||||
unsigned long out[8];
|
||||
|
||||
in[0] = p1;
|
||||
@@ -562,7 +562,7 @@ static inline long epapr_hypercall4(unsigned int nr, unsigned long p1,
|
||||
unsigned long p2, unsigned long p3,
|
||||
unsigned long p4)
|
||||
{
|
||||
unsigned long in[8];
|
||||
unsigned long in[8] = {0};
|
||||
unsigned long out[8];
|
||||
|
||||
in[0] = p1;
|
||||
|
||||
@@ -293,8 +293,7 @@ do { \
|
||||
__put_user_asm(x, ptr, retval, "l", "k", "ir", errret); \
|
||||
break; \
|
||||
case 8: \
|
||||
__put_user_asm_u64((__typeof__(*ptr))(x), ptr, retval, \
|
||||
errret); \
|
||||
__put_user_asm_u64(x, ptr, retval, errret); \
|
||||
break; \
|
||||
default: \
|
||||
__put_user_bad(); \
|
||||
@@ -440,8 +439,10 @@ do { \
|
||||
#define __put_user_nocheck(x, ptr, size) \
|
||||
({ \
|
||||
int __pu_err; \
|
||||
__typeof__(*(ptr)) __pu_val; \
|
||||
__pu_val = x; \
|
||||
__uaccess_begin(); \
|
||||
__put_user_size((x), (ptr), (size), __pu_err, -EFAULT); \
|
||||
__put_user_size(__pu_val, (ptr), (size), __pu_err, -EFAULT);\
|
||||
__uaccess_end(); \
|
||||
__builtin_expect(__pu_err, 0); \
|
||||
})
|
||||
|
||||
@@ -2929,6 +2929,14 @@ static int nested_svm_vmexit(struct vcpu_svm *svm)
|
||||
kvm_mmu_reset_context(&svm->vcpu);
|
||||
kvm_mmu_load(&svm->vcpu);
|
||||
|
||||
/*
|
||||
* Drop what we picked up for L2 via svm_complete_interrupts() so it
|
||||
* doesn't end up in L1.
|
||||
*/
|
||||
svm->vcpu.arch.nmi_injected = false;
|
||||
kvm_clear_exception_queue(&svm->vcpu);
|
||||
kvm_clear_interrupt_queue(&svm->vcpu);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4006,25 +4014,14 @@ static int avic_incomplete_ipi_interception(struct vcpu_svm *svm)
|
||||
kvm_lapic_reg_write(apic, APIC_ICR, icrl);
|
||||
break;
|
||||
case AVIC_IPI_FAILURE_TARGET_NOT_RUNNING: {
|
||||
int i;
|
||||
struct kvm_vcpu *vcpu;
|
||||
struct kvm *kvm = svm->vcpu.kvm;
|
||||
struct kvm_lapic *apic = svm->vcpu.arch.apic;
|
||||
|
||||
/*
|
||||
* At this point, we expect that the AVIC HW has already
|
||||
* set the appropriate IRR bits on the valid target
|
||||
* vcpus. So, we just need to kick the appropriate vcpu.
|
||||
* Update ICR high and low, then emulate sending IPI,
|
||||
* which is handled when writing APIC_ICR.
|
||||
*/
|
||||
kvm_for_each_vcpu(i, vcpu, kvm) {
|
||||
bool m = kvm_apic_match_dest(vcpu, apic,
|
||||
icrl & KVM_APIC_SHORT_MASK,
|
||||
GET_APIC_DEST_FIELD(icrh),
|
||||
icrl & KVM_APIC_DEST_MASK);
|
||||
|
||||
if (m && !avic_vcpu_is_running(vcpu))
|
||||
kvm_vcpu_wake_up(vcpu);
|
||||
}
|
||||
kvm_lapic_reg_write(apic, APIC_ICR2, icrh);
|
||||
kvm_lapic_reg_write(apic, APIC_ICR, icrl);
|
||||
break;
|
||||
}
|
||||
case AVIC_IPI_FAILURE_INVALID_TARGET:
|
||||
|
||||
@@ -355,6 +355,7 @@ struct binder_error {
|
||||
* @min_priority: minimum scheduling priority
|
||||
* (invariant after initialized)
|
||||
* @inherit_rt: inherit RT scheduling policy from caller
|
||||
* @txn_security_ctx: require sender's security context
|
||||
* (invariant after initialized)
|
||||
* @async_todo: list of async work items
|
||||
* (protected by @proc->inner_lock)
|
||||
@@ -394,6 +395,7 @@ struct binder_node {
|
||||
u8 sched_policy:2;
|
||||
u8 inherit_rt:1;
|
||||
u8 accept_fds:1;
|
||||
u8 txn_security_ctx:1;
|
||||
u8 min_priority;
|
||||
};
|
||||
bool has_async_transaction;
|
||||
@@ -651,6 +653,7 @@ struct binder_transaction {
|
||||
struct binder_priority saved_priority;
|
||||
bool set_priority_called;
|
||||
kuid_t sender_euid;
|
||||
binder_uintptr_t security_ctx;
|
||||
/**
|
||||
* @lock: protects @from, @to_proc, and @to_thread
|
||||
*
|
||||
@@ -1360,6 +1363,7 @@ static struct binder_node *binder_init_node_ilocked(
|
||||
node->min_priority = to_kernel_prio(node->sched_policy, priority);
|
||||
node->accept_fds = !!(flags & FLAT_BINDER_FLAG_ACCEPTS_FDS);
|
||||
node->inherit_rt = !!(flags & FLAT_BINDER_FLAG_INHERIT_RT);
|
||||
node->txn_security_ctx = !!(flags & FLAT_BINDER_FLAG_TXN_SECURITY_CTX);
|
||||
spin_lock_init(&node->lock);
|
||||
INIT_LIST_HEAD(&node->work.entry);
|
||||
INIT_LIST_HEAD(&node->async_todo);
|
||||
@@ -2897,6 +2901,8 @@ static void binder_transaction(struct binder_proc *proc,
|
||||
binder_size_t last_fixup_min_off = 0;
|
||||
struct binder_context *context = proc->context;
|
||||
int t_debug_id = atomic_inc_return(&binder_last_id);
|
||||
char *secctx = NULL;
|
||||
u32 secctx_sz = 0;
|
||||
|
||||
e = binder_transaction_log_add(&binder_transaction_log);
|
||||
e->debug_id = t_debug_id;
|
||||
@@ -3120,6 +3126,20 @@ static void binder_transaction(struct binder_proc *proc,
|
||||
t->priority = target_proc->default_priority;
|
||||
}
|
||||
|
||||
if (target_node && target_node->txn_security_ctx) {
|
||||
u32 secid;
|
||||
|
||||
security_task_getsecid(proc->tsk, &secid);
|
||||
ret = security_secid_to_secctx(secid, &secctx, &secctx_sz);
|
||||
if (ret) {
|
||||
return_error = BR_FAILED_REPLY;
|
||||
return_error_param = ret;
|
||||
return_error_line = __LINE__;
|
||||
goto err_get_secctx_failed;
|
||||
}
|
||||
extra_buffers_size += ALIGN(secctx_sz, sizeof(u64));
|
||||
}
|
||||
|
||||
trace_binder_transaction(reply, t, target_node);
|
||||
|
||||
t->buffer = binder_alloc_new_buf(&target_proc->alloc, tr->data_size,
|
||||
@@ -3136,6 +3156,19 @@ static void binder_transaction(struct binder_proc *proc,
|
||||
t->buffer = NULL;
|
||||
goto err_binder_alloc_buf_failed;
|
||||
}
|
||||
if (secctx) {
|
||||
size_t buf_offset = ALIGN(tr->data_size, sizeof(void *)) +
|
||||
ALIGN(tr->offsets_size, sizeof(void *)) +
|
||||
ALIGN(extra_buffers_size, sizeof(void *)) -
|
||||
ALIGN(secctx_sz, sizeof(u64));
|
||||
char *kptr = t->buffer->data + buf_offset;
|
||||
|
||||
t->security_ctx = (uintptr_t)kptr +
|
||||
binder_alloc_get_user_buffer_offset(&target_proc->alloc);
|
||||
memcpy(kptr, secctx, secctx_sz);
|
||||
security_release_secctx(secctx, secctx_sz);
|
||||
secctx = NULL;
|
||||
}
|
||||
t->buffer->debug_id = t->debug_id;
|
||||
t->buffer->transaction = t;
|
||||
t->buffer->target_node = target_node;
|
||||
@@ -3406,6 +3439,9 @@ err_copy_data_failed:
|
||||
t->buffer->transaction = NULL;
|
||||
binder_alloc_free_buf(&target_proc->alloc, t->buffer);
|
||||
err_binder_alloc_buf_failed:
|
||||
if (secctx)
|
||||
security_release_secctx(secctx, secctx_sz);
|
||||
err_get_secctx_failed:
|
||||
kfree(tcomplete);
|
||||
binder_stats_deleted(BINDER_STAT_TRANSACTION_COMPLETE);
|
||||
err_alloc_tcomplete_failed:
|
||||
@@ -4052,11 +4088,13 @@ retry:
|
||||
|
||||
while (1) {
|
||||
uint32_t cmd;
|
||||
struct binder_transaction_data tr;
|
||||
struct binder_transaction_data_secctx tr;
|
||||
struct binder_transaction_data *trd = &tr.transaction_data;
|
||||
struct binder_work *w = NULL;
|
||||
struct list_head *list = NULL;
|
||||
struct binder_transaction *t = NULL;
|
||||
struct binder_thread *t_from;
|
||||
size_t trsize = sizeof(*trd);
|
||||
|
||||
binder_inner_proc_lock(proc);
|
||||
if (!binder_worklist_empty_ilocked(&thread->todo))
|
||||
@@ -4252,41 +4290,47 @@ retry:
|
||||
struct binder_node *target_node = t->buffer->target_node;
|
||||
struct binder_priority node_prio;
|
||||
|
||||
tr.target.ptr = target_node->ptr;
|
||||
tr.cookie = target_node->cookie;
|
||||
trd->target.ptr = target_node->ptr;
|
||||
trd->cookie = target_node->cookie;
|
||||
node_prio.sched_policy = target_node->sched_policy;
|
||||
node_prio.prio = target_node->min_priority;
|
||||
binder_transaction_priority(current, t, node_prio,
|
||||
target_node->inherit_rt);
|
||||
cmd = BR_TRANSACTION;
|
||||
} else {
|
||||
tr.target.ptr = 0;
|
||||
tr.cookie = 0;
|
||||
trd->target.ptr = 0;
|
||||
trd->cookie = 0;
|
||||
cmd = BR_REPLY;
|
||||
}
|
||||
tr.code = t->code;
|
||||
tr.flags = t->flags;
|
||||
tr.sender_euid = from_kuid(current_user_ns(), t->sender_euid);
|
||||
trd->code = t->code;
|
||||
trd->flags = t->flags;
|
||||
trd->sender_euid = from_kuid(current_user_ns(), t->sender_euid);
|
||||
|
||||
t_from = binder_get_txn_from(t);
|
||||
if (t_from) {
|
||||
struct task_struct *sender = t_from->proc->tsk;
|
||||
|
||||
tr.sender_pid = task_tgid_nr_ns(sender,
|
||||
task_active_pid_ns(current));
|
||||
trd->sender_pid =
|
||||
task_tgid_nr_ns(sender,
|
||||
task_active_pid_ns(current));
|
||||
} else {
|
||||
tr.sender_pid = 0;
|
||||
trd->sender_pid = 0;
|
||||
}
|
||||
|
||||
tr.data_size = t->buffer->data_size;
|
||||
tr.offsets_size = t->buffer->offsets_size;
|
||||
tr.data.ptr.buffer = (binder_uintptr_t)
|
||||
trd->data_size = t->buffer->data_size;
|
||||
trd->offsets_size = t->buffer->offsets_size;
|
||||
trd->data.ptr.buffer = (binder_uintptr_t)
|
||||
((uintptr_t)t->buffer->data +
|
||||
binder_alloc_get_user_buffer_offset(&proc->alloc));
|
||||
tr.data.ptr.offsets = tr.data.ptr.buffer +
|
||||
trd->data.ptr.offsets = trd->data.ptr.buffer +
|
||||
ALIGN(t->buffer->data_size,
|
||||
sizeof(void *));
|
||||
|
||||
tr.secctx = t->security_ctx;
|
||||
if (t->security_ctx) {
|
||||
cmd = BR_TRANSACTION_SEC_CTX;
|
||||
trsize = sizeof(tr);
|
||||
}
|
||||
if (put_user(cmd, (uint32_t __user *)ptr)) {
|
||||
if (t_from)
|
||||
binder_thread_dec_tmpref(t_from);
|
||||
@@ -4297,7 +4341,7 @@ retry:
|
||||
return -EFAULT;
|
||||
}
|
||||
ptr += sizeof(uint32_t);
|
||||
if (copy_to_user(ptr, &tr, sizeof(tr))) {
|
||||
if (copy_to_user(ptr, &tr, trsize)) {
|
||||
if (t_from)
|
||||
binder_thread_dec_tmpref(t_from);
|
||||
|
||||
@@ -4306,7 +4350,7 @@ retry:
|
||||
|
||||
return -EFAULT;
|
||||
}
|
||||
ptr += sizeof(tr);
|
||||
ptr += trsize;
|
||||
|
||||
trace_binder_transaction_received(t);
|
||||
binder_stat_br(proc, thread, cmd);
|
||||
@@ -4314,16 +4358,18 @@ retry:
|
||||
"%d:%d %s %d %d:%d, cmd %d size %zd-%zd ptr %016llx-%016llx\n",
|
||||
proc->pid, thread->pid,
|
||||
(cmd == BR_TRANSACTION) ? "BR_TRANSACTION" :
|
||||
"BR_REPLY",
|
||||
(cmd == BR_TRANSACTION_SEC_CTX) ?
|
||||
"BR_TRANSACTION_SEC_CTX" : "BR_REPLY",
|
||||
t->debug_id, t_from ? t_from->proc->pid : 0,
|
||||
t_from ? t_from->pid : 0, cmd,
|
||||
t->buffer->data_size, t->buffer->offsets_size,
|
||||
(u64)tr.data.ptr.buffer, (u64)tr.data.ptr.offsets);
|
||||
(u64)trd->data.ptr.buffer,
|
||||
(u64)trd->data.ptr.offsets);
|
||||
|
||||
if (t_from)
|
||||
binder_thread_dec_tmpref(t_from);
|
||||
t->buffer->allow_user_free = 1;
|
||||
if (cmd == BR_TRANSACTION && !(t->flags & TF_ONE_WAY)) {
|
||||
if (cmd != BR_REPLY && !(t->flags & TF_ONE_WAY)) {
|
||||
binder_inner_proc_lock(thread->proc);
|
||||
t->to_parent = thread->transaction_stack;
|
||||
t->to_thread = thread;
|
||||
@@ -4668,7 +4714,8 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int binder_ioctl_set_ctx_mgr(struct file *filp)
|
||||
static int binder_ioctl_set_ctx_mgr(struct file *filp,
|
||||
struct flat_binder_object *fbo)
|
||||
{
|
||||
int ret = 0;
|
||||
struct binder_proc *proc = filp->private_data;
|
||||
@@ -4697,7 +4744,7 @@ static int binder_ioctl_set_ctx_mgr(struct file *filp)
|
||||
} else {
|
||||
context->binder_context_mgr_uid = curr_euid;
|
||||
}
|
||||
new_node = binder_new_node(proc, NULL);
|
||||
new_node = binder_new_node(proc, fbo);
|
||||
if (!new_node) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
@@ -4820,8 +4867,20 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
binder_inner_proc_unlock(proc);
|
||||
break;
|
||||
}
|
||||
case BINDER_SET_CONTEXT_MGR_EXT: {
|
||||
struct flat_binder_object fbo;
|
||||
|
||||
if (copy_from_user(&fbo, ubuf, sizeof(fbo))) {
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
ret = binder_ioctl_set_ctx_mgr(filp, &fbo);
|
||||
if (ret)
|
||||
goto err;
|
||||
break;
|
||||
}
|
||||
case BINDER_SET_CONTEXT_MGR:
|
||||
ret = binder_ioctl_set_ctx_mgr(filp);
|
||||
ret = binder_ioctl_set_ctx_mgr(filp, NULL);
|
||||
if (ret)
|
||||
goto err;
|
||||
break;
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
static DEFINE_IDR(loop_index_idr);
|
||||
static DEFINE_MUTEX(loop_index_mutex);
|
||||
static DEFINE_MUTEX(loop_ctl_mutex);
|
||||
|
||||
static int max_part;
|
||||
@@ -1618,11 +1619,9 @@ static int lo_compat_ioctl(struct block_device *bdev, fmode_t mode,
|
||||
static int lo_open(struct block_device *bdev, fmode_t mode)
|
||||
{
|
||||
struct loop_device *lo;
|
||||
int err;
|
||||
int err = 0;
|
||||
|
||||
err = mutex_lock_killable(&loop_ctl_mutex);
|
||||
if (err)
|
||||
return err;
|
||||
mutex_lock(&loop_index_mutex);
|
||||
lo = bdev->bd_disk->private_data;
|
||||
if (!lo) {
|
||||
err = -ENXIO;
|
||||
@@ -1631,20 +1630,18 @@ static int lo_open(struct block_device *bdev, fmode_t mode)
|
||||
|
||||
atomic_inc(&lo->lo_refcnt);
|
||||
out:
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
mutex_unlock(&loop_index_mutex);
|
||||
return err;
|
||||
}
|
||||
|
||||
static void lo_release(struct gendisk *disk, fmode_t mode)
|
||||
static void __lo_release(struct loop_device *lo)
|
||||
{
|
||||
struct loop_device *lo;
|
||||
int err;
|
||||
|
||||
mutex_lock(&loop_ctl_mutex);
|
||||
lo = disk->private_data;
|
||||
if (atomic_dec_return(&lo->lo_refcnt))
|
||||
goto out_unlock;
|
||||
return;
|
||||
|
||||
mutex_lock(&loop_ctl_mutex);
|
||||
if (lo->lo_flags & LO_FLAGS_AUTOCLEAR) {
|
||||
/*
|
||||
* In autoclear mode, stop the loop thread
|
||||
@@ -1662,10 +1659,16 @@ static void lo_release(struct gendisk *disk, fmode_t mode)
|
||||
blk_mq_unfreeze_queue(lo->lo_queue);
|
||||
}
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
}
|
||||
|
||||
static void lo_release(struct gendisk *disk, fmode_t mode)
|
||||
{
|
||||
mutex_lock(&loop_index_mutex);
|
||||
__lo_release(disk->private_data);
|
||||
mutex_unlock(&loop_index_mutex);
|
||||
}
|
||||
|
||||
static const struct block_device_operations lo_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = lo_open,
|
||||
@@ -1956,7 +1959,7 @@ static struct kobject *loop_probe(dev_t dev, int *part, void *data)
|
||||
struct kobject *kobj;
|
||||
int err;
|
||||
|
||||
mutex_lock(&loop_ctl_mutex);
|
||||
mutex_lock(&loop_index_mutex);
|
||||
err = loop_lookup(&lo, MINOR(dev) >> part_shift);
|
||||
if (err < 0)
|
||||
err = loop_add(&lo, MINOR(dev) >> part_shift);
|
||||
@@ -1964,7 +1967,7 @@ static struct kobject *loop_probe(dev_t dev, int *part, void *data)
|
||||
kobj = NULL;
|
||||
else
|
||||
kobj = get_disk(lo->lo_disk);
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
mutex_unlock(&loop_index_mutex);
|
||||
|
||||
*part = 0;
|
||||
return kobj;
|
||||
@@ -1974,13 +1977,9 @@ static long loop_control_ioctl(struct file *file, unsigned int cmd,
|
||||
unsigned long parm)
|
||||
{
|
||||
struct loop_device *lo;
|
||||
int ret;
|
||||
int ret = -ENOSYS;
|
||||
|
||||
ret = mutex_lock_killable(&loop_ctl_mutex);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = -ENOSYS;
|
||||
mutex_lock(&loop_index_mutex);
|
||||
switch (cmd) {
|
||||
case LOOP_CTL_ADD:
|
||||
ret = loop_lookup(&lo, parm);
|
||||
@@ -1994,15 +1993,19 @@ static long loop_control_ioctl(struct file *file, unsigned int cmd,
|
||||
ret = loop_lookup(&lo, parm);
|
||||
if (ret < 0)
|
||||
break;
|
||||
mutex_lock(&loop_ctl_mutex);
|
||||
if (lo->lo_state != Lo_unbound) {
|
||||
ret = -EBUSY;
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
break;
|
||||
}
|
||||
if (atomic_read(&lo->lo_refcnt) > 0) {
|
||||
ret = -EBUSY;
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
break;
|
||||
}
|
||||
lo->lo_disk->private_data = NULL;
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
idr_remove(&loop_index_idr, lo->lo_number);
|
||||
loop_remove(lo);
|
||||
break;
|
||||
@@ -2012,7 +2015,7 @@ static long loop_control_ioctl(struct file *file, unsigned int cmd,
|
||||
break;
|
||||
ret = loop_add(&lo, -1);
|
||||
}
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
mutex_unlock(&loop_index_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -2096,10 +2099,10 @@ static int __init loop_init(void)
|
||||
THIS_MODULE, loop_probe, NULL, NULL);
|
||||
|
||||
/* pre-create number of devices given by config or max_loop */
|
||||
mutex_lock(&loop_ctl_mutex);
|
||||
mutex_lock(&loop_index_mutex);
|
||||
for (i = 0; i < nr; i++)
|
||||
loop_add(&lo, i);
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
mutex_unlock(&loop_index_mutex);
|
||||
|
||||
printk(KERN_INFO "loop: module loaded\n");
|
||||
return 0;
|
||||
|
||||
@@ -262,8 +262,10 @@ static int vc5_mux_set_parent(struct clk_hw *hw, u8 index)
|
||||
|
||||
if (vc5->clk_mux_ins == VC5_MUX_IN_XIN)
|
||||
src = VC5_PRIM_SRC_SHDN_EN_XTAL;
|
||||
if (vc5->clk_mux_ins == VC5_MUX_IN_CLKIN)
|
||||
else if (vc5->clk_mux_ins == VC5_MUX_IN_CLKIN)
|
||||
src = VC5_PRIM_SRC_SHDN_EN_CLKIN;
|
||||
else /* Invalid; should have been caught by vc5_probe() */
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return regmap_update_bits(vc5->regmap, VC5_PRIM_SRC_SHDN, mask, src);
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "vega10_pptable.h"
|
||||
|
||||
#define NUM_DSPCLK_LEVELS 8
|
||||
#define VEGA10_ENGINECLOCK_HARDMAX 198000
|
||||
|
||||
static void set_hw_cap(struct pp_hwmgr *hwmgr, bool enable,
|
||||
enum phm_platform_caps cap)
|
||||
@@ -258,7 +259,26 @@ static int init_over_drive_limits(
|
||||
struct pp_hwmgr *hwmgr,
|
||||
const ATOM_Vega10_POWERPLAYTABLE *powerplay_table)
|
||||
{
|
||||
hwmgr->platform_descriptor.overdriveLimit.engineClock =
|
||||
const ATOM_Vega10_GFXCLK_Dependency_Table *gfxclk_dep_table =
|
||||
(const ATOM_Vega10_GFXCLK_Dependency_Table *)
|
||||
(((unsigned long) powerplay_table) +
|
||||
le16_to_cpu(powerplay_table->usGfxclkDependencyTableOffset));
|
||||
bool is_acg_enabled = false;
|
||||
ATOM_Vega10_GFXCLK_Dependency_Record_V2 *patom_record_v2;
|
||||
|
||||
if (gfxclk_dep_table->ucRevId == 1) {
|
||||
patom_record_v2 =
|
||||
(ATOM_Vega10_GFXCLK_Dependency_Record_V2 *)gfxclk_dep_table->entries;
|
||||
is_acg_enabled =
|
||||
(bool)patom_record_v2[gfxclk_dep_table->ucNumEntries-1].ucACGEnable;
|
||||
}
|
||||
|
||||
if (powerplay_table->ulMaxODEngineClock > VEGA10_ENGINECLOCK_HARDMAX &&
|
||||
!is_acg_enabled)
|
||||
hwmgr->platform_descriptor.overdriveLimit.engineClock =
|
||||
VEGA10_ENGINECLOCK_HARDMAX;
|
||||
else
|
||||
hwmgr->platform_descriptor.overdriveLimit.engineClock =
|
||||
le32_to_cpu(powerplay_table->ulMaxODEngineClock);
|
||||
hwmgr->platform_descriptor.overdriveLimit.memoryClock =
|
||||
le32_to_cpu(powerplay_table->ulMaxODMemoryClock);
|
||||
|
||||
@@ -113,7 +113,9 @@ static void rd_write(struct msm_rd_state *rd, const void *buf, int sz)
|
||||
char *fptr = &fifo->buf[fifo->head];
|
||||
int n;
|
||||
|
||||
wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0);
|
||||
wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0 || !rd->open);
|
||||
if (!rd->open)
|
||||
return;
|
||||
|
||||
/* Note that smp_load_acquire() is not strictly required
|
||||
* as CIRC_SPACE_TO_END() does not access the tail more
|
||||
@@ -238,7 +240,10 @@ static int rd_release(struct inode *inode, struct file *file)
|
||||
return -EINVAL;
|
||||
|
||||
rd = inode->i_private;
|
||||
|
||||
rd->open = false;
|
||||
wake_up_all(&rd->fifo_event);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1447,6 +1447,7 @@ static int mmc_spi_probe(struct spi_device *spi)
|
||||
mmc->caps &= ~MMC_CAP_NEEDS_POLL;
|
||||
mmc_gpiod_request_cd_irq(mmc);
|
||||
}
|
||||
mmc_detect_change(mmc, 0);
|
||||
|
||||
if (host->pdata && host->pdata->flags & MMC_SPI_USE_RO_GPIO) {
|
||||
has_ro = true;
|
||||
|
||||
@@ -68,6 +68,7 @@ static const struct renesas_sdhi_of_data of_rcar_gen2_compatible = {
|
||||
.scc_offset = 0x0300,
|
||||
.taps = rcar_gen2_scc_taps,
|
||||
.taps_num = ARRAY_SIZE(rcar_gen2_scc_taps),
|
||||
.max_blk_count = 0xffffffff,
|
||||
};
|
||||
|
||||
/* Definitions for sampling clocks */
|
||||
|
||||
@@ -1077,11 +1077,12 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host *host)
|
||||
writel(readl(host->ioaddr + SDHCI_HOST_CONTROL)
|
||||
| ESDHC_BURST_LEN_EN_INCR,
|
||||
host->ioaddr + SDHCI_HOST_CONTROL);
|
||||
|
||||
/*
|
||||
* erratum ESDHC_FLAG_ERR004536 fix for MX6Q TO1.2 and MX6DL
|
||||
* TO1.1, it's harmless for MX6SL
|
||||
*/
|
||||
writel(readl(host->ioaddr + 0x6c) | BIT(7),
|
||||
* erratum ESDHC_FLAG_ERR004536 fix for MX6Q TO1.2 and MX6DL
|
||||
* TO1.1, it's harmless for MX6SL
|
||||
*/
|
||||
writel(readl(host->ioaddr + 0x6c) & ~BIT(7),
|
||||
host->ioaddr + 0x6c);
|
||||
|
||||
/* disable DLL_CTRL delay line settings */
|
||||
|
||||
@@ -286,6 +286,11 @@ static inline void sd_ctrl_write32_as_16_and_16(struct tmio_mmc_host *host,
|
||||
writew(val >> 16, host->ctl + ((addr + 2) << host->bus_shift));
|
||||
}
|
||||
|
||||
static inline void sd_ctrl_write32(struct tmio_mmc_host *host, int addr, u32 val)
|
||||
{
|
||||
iowrite32(val, host->ctl + (addr << host->bus_shift));
|
||||
}
|
||||
|
||||
static inline void sd_ctrl_write32_rep(struct tmio_mmc_host *host, int addr,
|
||||
const u32 *buf, int count)
|
||||
{
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/mmc/sdio.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <linux/sizes.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/swiotlb.h>
|
||||
#include <linux/workqueue.h>
|
||||
@@ -688,7 +689,7 @@ static bool __tmio_mmc_sdcard_irq(struct tmio_mmc_host *host, int ireg,
|
||||
return false;
|
||||
}
|
||||
|
||||
static void __tmio_mmc_sdio_irq(struct tmio_mmc_host *host)
|
||||
static bool __tmio_mmc_sdio_irq(struct tmio_mmc_host *host)
|
||||
{
|
||||
struct mmc_host *mmc = host->mmc;
|
||||
struct tmio_mmc_data *pdata = host->pdata;
|
||||
@@ -696,7 +697,7 @@ static void __tmio_mmc_sdio_irq(struct tmio_mmc_host *host)
|
||||
unsigned int sdio_status;
|
||||
|
||||
if (!(pdata->flags & TMIO_MMC_SDIO_IRQ))
|
||||
return;
|
||||
return false;
|
||||
|
||||
status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
|
||||
ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdio_irq_mask;
|
||||
@@ -709,6 +710,8 @@ static void __tmio_mmc_sdio_irq(struct tmio_mmc_host *host)
|
||||
|
||||
if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ)
|
||||
mmc_signal_sdio_irq(mmc);
|
||||
|
||||
return ireg;
|
||||
}
|
||||
|
||||
irqreturn_t tmio_mmc_irq(int irq, void *devid)
|
||||
@@ -727,9 +730,10 @@ irqreturn_t tmio_mmc_irq(int irq, void *devid)
|
||||
if (__tmio_mmc_sdcard_irq(host, ireg, status))
|
||||
return IRQ_HANDLED;
|
||||
|
||||
__tmio_mmc_sdio_irq(host);
|
||||
if (__tmio_mmc_sdio_irq(host))
|
||||
return IRQ_HANDLED;
|
||||
|
||||
return IRQ_HANDLED;
|
||||
return IRQ_NONE;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(tmio_mmc_irq);
|
||||
|
||||
@@ -758,7 +762,10 @@ static int tmio_mmc_start_data(struct tmio_mmc_host *host,
|
||||
|
||||
/* Set transfer length / blocksize */
|
||||
sd_ctrl_write16(host, CTL_SD_XFER_LEN, data->blksz);
|
||||
sd_ctrl_write16(host, CTL_XFER_BLK_COUNT, data->blocks);
|
||||
if (host->mmc->max_blk_count >= SZ_64K)
|
||||
sd_ctrl_write32(host, CTL_XFER_BLK_COUNT, data->blocks);
|
||||
else
|
||||
sd_ctrl_write16(host, CTL_XFER_BLK_COUNT, data->blocks);
|
||||
|
||||
tmio_mmc_start_dma(host, data);
|
||||
|
||||
|
||||
@@ -714,8 +714,10 @@ static struct phy_device *connect_local_phy(struct net_device *dev)
|
||||
|
||||
phydev = phy_connect(dev, phy_id_fmt, &altera_tse_adjust_link,
|
||||
priv->phy_iface);
|
||||
if (IS_ERR(phydev))
|
||||
if (IS_ERR(phydev)) {
|
||||
netdev_err(dev, "Could not attach to PHY\n");
|
||||
phydev = NULL;
|
||||
}
|
||||
|
||||
} else {
|
||||
int ret;
|
||||
|
||||
@@ -1314,7 +1314,6 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
|
||||
unsigned long lpar_rc;
|
||||
u16 mss = 0;
|
||||
|
||||
restart_poll:
|
||||
while (frames_processed < budget) {
|
||||
if (!ibmveth_rxq_pending_buffer(adapter))
|
||||
break;
|
||||
@@ -1402,7 +1401,6 @@ restart_poll:
|
||||
napi_reschedule(napi)) {
|
||||
lpar_rc = h_vio_signal(adapter->vdev->unit_address,
|
||||
VIO_IRQ_DISABLE);
|
||||
goto restart_poll;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -475,7 +475,7 @@ struct mac_device_info;
|
||||
/* Helpers to program the MAC core */
|
||||
struct stmmac_ops {
|
||||
/* MAC core initialization */
|
||||
void (*core_init)(struct mac_device_info *hw, int mtu);
|
||||
void (*core_init)(struct mac_device_info *hw, struct net_device *dev);
|
||||
/* Enable the MAC RX/TX */
|
||||
void (*set_mac)(void __iomem *ioaddr, bool enable);
|
||||
/* Enable and verify that the IPC module is supported */
|
||||
|
||||
@@ -477,7 +477,8 @@ static int sun8i_dwmac_init(struct platform_device *pdev, void *priv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sun8i_dwmac_core_init(struct mac_device_info *hw, int mtu)
|
||||
static void sun8i_dwmac_core_init(struct mac_device_info *hw,
|
||||
struct net_device *dev)
|
||||
{
|
||||
void __iomem *ioaddr = hw->pcsr;
|
||||
u32 v;
|
||||
|
||||
@@ -25,18 +25,28 @@
|
||||
#include <linux/crc32.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/ethtool.h>
|
||||
#include <net/dsa.h>
|
||||
#include <asm/io.h>
|
||||
#include "stmmac_pcs.h"
|
||||
#include "dwmac1000.h"
|
||||
|
||||
static void dwmac1000_core_init(struct mac_device_info *hw, int mtu)
|
||||
static void dwmac1000_core_init(struct mac_device_info *hw,
|
||||
struct net_device *dev)
|
||||
{
|
||||
void __iomem *ioaddr = hw->pcsr;
|
||||
u32 value = readl(ioaddr + GMAC_CONTROL);
|
||||
int mtu = dev->mtu;
|
||||
|
||||
/* Configure GMAC core */
|
||||
value |= GMAC_CORE_INIT;
|
||||
|
||||
/* Clear ACS bit because Ethernet switch tagging formats such as
|
||||
* Broadcom tags can look like invalid LLC/SNAP packets and cause the
|
||||
* hardware to truncate packets on reception.
|
||||
*/
|
||||
if (netdev_uses_dsa(dev))
|
||||
value &= ~GMAC_CONTROL_ACS;
|
||||
|
||||
if (mtu > 1500)
|
||||
value |= GMAC_CONTROL_2K;
|
||||
if (mtu > 2000)
|
||||
|
||||
@@ -25,15 +25,26 @@
|
||||
*******************************************************************************/
|
||||
|
||||
#include <linux/crc32.h>
|
||||
#include <net/dsa.h>
|
||||
#include <asm/io.h>
|
||||
#include "dwmac100.h"
|
||||
|
||||
static void dwmac100_core_init(struct mac_device_info *hw, int mtu)
|
||||
static void dwmac100_core_init(struct mac_device_info *hw,
|
||||
struct net_device *dev)
|
||||
{
|
||||
void __iomem *ioaddr = hw->pcsr;
|
||||
u32 value = readl(ioaddr + MAC_CONTROL);
|
||||
|
||||
writel((value | MAC_CORE_INIT), ioaddr + MAC_CONTROL);
|
||||
value |= MAC_CORE_INIT;
|
||||
|
||||
/* Clear ASTP bit because Ethernet switch tagging formats such as
|
||||
* Broadcom tags can look like invalid LLC/SNAP packets and cause the
|
||||
* hardware to truncate packets on reception.
|
||||
*/
|
||||
if (netdev_uses_dsa(dev))
|
||||
value &= ~MAC_CONTROL_ASTP;
|
||||
|
||||
writel(value, ioaddr + MAC_CONTROL);
|
||||
|
||||
#ifdef STMMAC_VLAN_TAG_USED
|
||||
writel(ETH_P_8021Q, ioaddr + MAC_VLAN1);
|
||||
|
||||
@@ -336,7 +336,7 @@ enum power_event {
|
||||
#define MTL_RX_OVERFLOW_INT BIT(16)
|
||||
|
||||
/* Default operating mode of the MAC */
|
||||
#define GMAC_CORE_INIT (GMAC_CONFIG_JD | GMAC_CONFIG_PS | GMAC_CONFIG_ACS | \
|
||||
#define GMAC_CORE_INIT (GMAC_CONFIG_JD | GMAC_CONFIG_PS | \
|
||||
GMAC_CONFIG_BE | GMAC_CONFIG_DCRS)
|
||||
|
||||
/* To dump the core regs excluding the Address Registers */
|
||||
|
||||
@@ -17,13 +17,16 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/ethtool.h>
|
||||
#include <linux/io.h>
|
||||
#include <net/dsa.h>
|
||||
#include "stmmac_pcs.h"
|
||||
#include "dwmac4.h"
|
||||
|
||||
static void dwmac4_core_init(struct mac_device_info *hw, int mtu)
|
||||
static void dwmac4_core_init(struct mac_device_info *hw,
|
||||
struct net_device *dev)
|
||||
{
|
||||
void __iomem *ioaddr = hw->pcsr;
|
||||
u32 value = readl(ioaddr + GMAC_CONFIG);
|
||||
int mtu = dev->mtu;
|
||||
|
||||
value |= GMAC_CORE_INIT;
|
||||
|
||||
|
||||
@@ -2497,7 +2497,7 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
|
||||
}
|
||||
|
||||
/* Initialize the MAC Core */
|
||||
priv->hw->mac->core_init(priv->hw, dev->mtu);
|
||||
priv->hw->mac->core_init(priv->hw, dev);
|
||||
|
||||
/* Initialize MTL*/
|
||||
if (priv->synopsys_id >= DWMAC_CORE_4_00)
|
||||
@@ -3415,8 +3415,13 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
|
||||
|
||||
/* ACS is set; GMAC core strips PAD/FCS for IEEE 802.3
|
||||
* Type frames (LLC/LLC-SNAP)
|
||||
*
|
||||
* llc_snap is never checked in GMAC >= 4, so this ACS
|
||||
* feature is always disabled and packets need to be
|
||||
* stripped manually.
|
||||
*/
|
||||
if (unlikely(status != llc_snap))
|
||||
if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00) ||
|
||||
unlikely(status != llc_snap))
|
||||
frame_len -= ETH_FCS_LEN;
|
||||
|
||||
if (netif_msg_rx_status(priv)) {
|
||||
|
||||
@@ -711,8 +711,8 @@ cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rndis_filter_set_rss_param(struct rndis_device *rdev,
|
||||
const u8 *rss_key)
|
||||
static int rndis_set_rss_param_msg(struct rndis_device *rdev,
|
||||
const u8 *rss_key, u16 flag)
|
||||
{
|
||||
struct net_device *ndev = rdev->ndev;
|
||||
struct rndis_request *request;
|
||||
@@ -741,7 +741,7 @@ int rndis_filter_set_rss_param(struct rndis_device *rdev,
|
||||
rssp->hdr.type = NDIS_OBJECT_TYPE_RSS_PARAMETERS;
|
||||
rssp->hdr.rev = NDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2;
|
||||
rssp->hdr.size = sizeof(struct ndis_recv_scale_param);
|
||||
rssp->flag = 0;
|
||||
rssp->flag = flag;
|
||||
rssp->hashinfo = NDIS_HASH_FUNC_TOEPLITZ | NDIS_HASH_IPV4 |
|
||||
NDIS_HASH_TCP_IPV4 | NDIS_HASH_IPV6 |
|
||||
NDIS_HASH_TCP_IPV6;
|
||||
@@ -766,9 +766,12 @@ int rndis_filter_set_rss_param(struct rndis_device *rdev,
|
||||
|
||||
wait_for_completion(&request->wait_event);
|
||||
set_complete = &request->response_msg.msg.set_complete;
|
||||
if (set_complete->status == RNDIS_STATUS_SUCCESS)
|
||||
memcpy(rdev->rss_key, rss_key, NETVSC_HASH_KEYLEN);
|
||||
else {
|
||||
if (set_complete->status == RNDIS_STATUS_SUCCESS) {
|
||||
if (!(flag & NDIS_RSS_PARAM_FLAG_DISABLE_RSS) &&
|
||||
!(flag & NDIS_RSS_PARAM_FLAG_HASH_KEY_UNCHANGED))
|
||||
memcpy(rdev->rss_key, rss_key, NETVSC_HASH_KEYLEN);
|
||||
|
||||
} else {
|
||||
netdev_err(ndev, "Fail to set RSS parameters:0x%x\n",
|
||||
set_complete->status);
|
||||
ret = -EINVAL;
|
||||
@@ -779,6 +782,16 @@ cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rndis_filter_set_rss_param(struct rndis_device *rdev,
|
||||
const u8 *rss_key)
|
||||
{
|
||||
/* Disable RSS before change */
|
||||
rndis_set_rss_param_msg(rdev, rss_key,
|
||||
NDIS_RSS_PARAM_FLAG_DISABLE_RSS);
|
||||
|
||||
return rndis_set_rss_param_msg(rdev, rss_key, 0);
|
||||
}
|
||||
|
||||
static int rndis_filter_query_device_link_status(struct rndis_device *dev,
|
||||
struct netvsc_device *net_device)
|
||||
{
|
||||
|
||||
@@ -731,8 +731,13 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
|
||||
asix_read_cmd(dev, AX_CMD_STATMNGSTS_REG, 0, 0, 1, &chipcode, 0);
|
||||
chipcode &= AX_CHIPCODE_MASK;
|
||||
|
||||
(chipcode == AX_AX88772_CHIPCODE) ? ax88772_hw_reset(dev, 0) :
|
||||
ax88772a_hw_reset(dev, 0);
|
||||
ret = (chipcode == AX_AX88772_CHIPCODE) ? ax88772_hw_reset(dev, 0) :
|
||||
ax88772a_hw_reset(dev, 0);
|
||||
|
||||
if (ret < 0) {
|
||||
netdev_dbg(dev->net, "Failed to reset AX88772: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Read PHYID register *AFTER* the PHY was reset properly */
|
||||
phyid = asix_get_phyid(dev);
|
||||
|
||||
@@ -582,12 +582,12 @@ csio_vport_create(struct fc_vport *fc_vport, bool disable)
|
||||
}
|
||||
|
||||
fc_vport_set_state(fc_vport, FC_VPORT_INITIALIZING);
|
||||
ln->fc_vport = fc_vport;
|
||||
|
||||
if (csio_fcoe_alloc_vnp(hw, ln))
|
||||
goto error;
|
||||
|
||||
*(struct csio_lnode **)fc_vport->dd_data = ln;
|
||||
ln->fc_vport = fc_vport;
|
||||
if (!fc_vport->node_name)
|
||||
fc_vport->node_name = wwn_to_u64(csio_ln_wwnn(ln));
|
||||
if (!fc_vport->port_name)
|
||||
|
||||
@@ -829,6 +829,7 @@ static struct domain_device *sas_ex_discover_end_dev(
|
||||
rphy = sas_end_device_alloc(phy->port);
|
||||
if (!rphy)
|
||||
goto out_free;
|
||||
rphy->identify.phy_identifier = phy_id;
|
||||
|
||||
child->rphy = rphy;
|
||||
get_device(&rphy->dev);
|
||||
@@ -856,6 +857,7 @@ static struct domain_device *sas_ex_discover_end_dev(
|
||||
|
||||
child->rphy = rphy;
|
||||
get_device(&rphy->dev);
|
||||
rphy->identify.phy_identifier = phy_id;
|
||||
sas_fill_in_rphy(child, rphy);
|
||||
|
||||
list_add_tail(&child->disco_list_node, &parent->port->disco_list);
|
||||
|
||||
@@ -321,9 +321,9 @@ static void ion_dma_buf_detatch(struct dma_buf *dmabuf,
|
||||
struct ion_buffer *buffer = dmabuf->priv;
|
||||
|
||||
mutex_lock(&buffer->lock);
|
||||
free_duped_table(a->table);
|
||||
list_del(&a->list);
|
||||
mutex_unlock(&buffer->lock);
|
||||
free_duped_table(a->table);
|
||||
|
||||
kfree(a);
|
||||
}
|
||||
|
||||
@@ -1008,18 +1008,18 @@ enum ieee80211_state {
|
||||
#define IP_FMT "%pI4"
|
||||
#define IP_ARG(x) (x)
|
||||
|
||||
extern __inline int is_multicast_mac_addr(const u8 *addr)
|
||||
static inline int is_multicast_mac_addr(const u8 *addr)
|
||||
{
|
||||
return ((addr[0] != 0xff) && (0x01 & addr[0]));
|
||||
}
|
||||
|
||||
extern __inline int is_broadcast_mac_addr(const u8 *addr)
|
||||
static inline int is_broadcast_mac_addr(const u8 *addr)
|
||||
{
|
||||
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
|
||||
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
|
||||
}
|
||||
|
||||
extern __inline int is_zero_mac_addr(const u8 *addr)
|
||||
static inline int is_zero_mac_addr(const u8 *addr)
|
||||
{
|
||||
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
|
||||
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));
|
||||
|
||||
@@ -77,7 +77,12 @@ static ssize_t power_limit_##index##_##suffix##_show(struct device *dev, \
|
||||
struct pci_dev *pci_dev; \
|
||||
struct platform_device *pdev; \
|
||||
struct proc_thermal_device *proc_dev; \
|
||||
\
|
||||
\
|
||||
if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \
|
||||
dev_warn(dev, "Attempted to get power limit before device was initialized!\n"); \
|
||||
return 0; \
|
||||
} \
|
||||
\
|
||||
if (proc_thermal_emum_mode == PROC_THERMAL_PLATFORM_DEV) { \
|
||||
pdev = to_platform_device(dev); \
|
||||
proc_dev = platform_get_drvdata(pdev); \
|
||||
@@ -291,11 +296,6 @@ static int proc_thermal_add(struct device *dev,
|
||||
*priv = proc_priv;
|
||||
|
||||
ret = proc_thermal_read_ppcc(proc_priv);
|
||||
if (!ret) {
|
||||
ret = sysfs_create_group(&dev->kobj,
|
||||
&power_limit_attribute_group);
|
||||
|
||||
}
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -309,8 +309,7 @@ static int proc_thermal_add(struct device *dev,
|
||||
|
||||
proc_priv->int340x_zone = int340x_thermal_zone_add(adev, ops);
|
||||
if (IS_ERR(proc_priv->int340x_zone)) {
|
||||
ret = PTR_ERR(proc_priv->int340x_zone);
|
||||
goto remove_group;
|
||||
return PTR_ERR(proc_priv->int340x_zone);
|
||||
} else
|
||||
ret = 0;
|
||||
|
||||
@@ -324,9 +323,6 @@ static int proc_thermal_add(struct device *dev,
|
||||
|
||||
remove_zone:
|
||||
int340x_thermal_zone_remove(proc_priv->int340x_zone);
|
||||
remove_group:
|
||||
sysfs_remove_group(&proc_priv->dev->kobj,
|
||||
&power_limit_attribute_group);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -357,7 +353,10 @@ static int int3401_add(struct platform_device *pdev)
|
||||
platform_set_drvdata(pdev, proc_priv);
|
||||
proc_thermal_emum_mode = PROC_THERMAL_PLATFORM_DEV;
|
||||
|
||||
return 0;
|
||||
dev_info(&pdev->dev, "Creating sysfs group for PROC_THERMAL_PLATFORM_DEV\n");
|
||||
|
||||
return sysfs_create_group(&pdev->dev.kobj,
|
||||
&power_limit_attribute_group);
|
||||
}
|
||||
|
||||
static int int3401_remove(struct platform_device *pdev)
|
||||
@@ -416,7 +415,7 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev,
|
||||
proc_priv->soc_dts = intel_soc_dts_iosf_init(
|
||||
INTEL_SOC_DTS_INTERRUPT_MSI, 2, 0);
|
||||
|
||||
if (proc_priv->soc_dts && pdev->irq) {
|
||||
if (!IS_ERR(proc_priv->soc_dts) && pdev->irq) {
|
||||
ret = pci_enable_msi(pdev);
|
||||
if (!ret) {
|
||||
ret = request_threaded_irq(pdev->irq, NULL,
|
||||
@@ -434,7 +433,10 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev,
|
||||
dev_err(&pdev->dev, "No auxiliary DTSs enabled\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
dev_info(&pdev->dev, "Creating sysfs group for PROC_THERMAL_PCI\n");
|
||||
|
||||
return sysfs_create_group(&pdev->dev.kobj,
|
||||
&power_limit_attribute_group);
|
||||
}
|
||||
|
||||
static void proc_thermal_pci_remove(struct pci_dev *pdev)
|
||||
|
||||
@@ -1701,7 +1701,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
|
||||
}
|
||||
|
||||
/* ask the core to calculate the divisor */
|
||||
baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 16);
|
||||
baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 4);
|
||||
|
||||
spin_lock_irqsave(&sport->port.lock, flags);
|
||||
|
||||
|
||||
@@ -2380,6 +2380,7 @@ static int __dwc3_gadget_start(struct dwc3 *dwc)
|
||||
|
||||
/* begin to receive SETUP packets */
|
||||
dwc->ep0state = EP0_SETUP_PHASE;
|
||||
dwc->link_state = DWC3_LINK_STATE_SS_DIS;
|
||||
dwc3_ep0_out_start(dwc);
|
||||
|
||||
dwc3_gadget_enable_irq(dwc);
|
||||
@@ -3957,6 +3958,8 @@ int dwc3_gadget_suspend(struct dwc3 *dwc)
|
||||
dwc3_disconnect_gadget(dwc);
|
||||
__dwc3_gadget_stop(dwc);
|
||||
|
||||
synchronize_irq(dwc->irq_gadget);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -842,7 +842,7 @@ static struct usb_function *source_sink_alloc_func(
|
||||
|
||||
ss = kzalloc(sizeof(*ss), GFP_KERNEL);
|
||||
if (!ss)
|
||||
return NULL;
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
ss_opts = container_of(fi, struct f_ss_opts, func_inst);
|
||||
|
||||
|
||||
@@ -699,6 +699,7 @@ static int get_more_blocks(struct dio *dio, struct dio_submit *sdio,
|
||||
unsigned long fs_count; /* Number of filesystem-sized blocks */
|
||||
int create;
|
||||
unsigned int i_blkbits = sdio->blkbits + sdio->blkfactor;
|
||||
loff_t i_size;
|
||||
|
||||
/*
|
||||
* If there was a memory error and we've overwritten all the
|
||||
@@ -728,8 +729,8 @@ static int get_more_blocks(struct dio *dio, struct dio_submit *sdio,
|
||||
*/
|
||||
create = dio->op == REQ_OP_WRITE;
|
||||
if (dio->flags & DIO_SKIP_HOLES) {
|
||||
if (fs_startblk <= ((i_size_read(dio->inode) - 1) >>
|
||||
i_blkbits))
|
||||
i_size = i_size_read(dio->inode);
|
||||
if (i_size && fs_startblk <= (i_size - 1) >> i_blkbits)
|
||||
create = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -331,11 +331,22 @@ struct inode_switch_wbs_context {
|
||||
struct work_struct work;
|
||||
};
|
||||
|
||||
static void bdi_down_write_wb_switch_rwsem(struct backing_dev_info *bdi)
|
||||
{
|
||||
down_write(&bdi->wb_switch_rwsem);
|
||||
}
|
||||
|
||||
static void bdi_up_write_wb_switch_rwsem(struct backing_dev_info *bdi)
|
||||
{
|
||||
up_write(&bdi->wb_switch_rwsem);
|
||||
}
|
||||
|
||||
static void inode_switch_wbs_work_fn(struct work_struct *work)
|
||||
{
|
||||
struct inode_switch_wbs_context *isw =
|
||||
container_of(work, struct inode_switch_wbs_context, work);
|
||||
struct inode *inode = isw->inode;
|
||||
struct backing_dev_info *bdi = inode_to_bdi(inode);
|
||||
struct address_space *mapping = inode->i_mapping;
|
||||
struct bdi_writeback *old_wb = inode->i_wb;
|
||||
struct bdi_writeback *new_wb = isw->new_wb;
|
||||
@@ -343,6 +354,12 @@ static void inode_switch_wbs_work_fn(struct work_struct *work)
|
||||
bool switched = false;
|
||||
void **slot;
|
||||
|
||||
/*
|
||||
* If @inode switches cgwb membership while sync_inodes_sb() is
|
||||
* being issued, sync_inodes_sb() might miss it. Synchronize.
|
||||
*/
|
||||
down_read(&bdi->wb_switch_rwsem);
|
||||
|
||||
/*
|
||||
* By the time control reaches here, RCU grace period has passed
|
||||
* since I_WB_SWITCH assertion and all wb stat update transactions
|
||||
@@ -435,6 +452,8 @@ skip_switch:
|
||||
spin_unlock(&new_wb->list_lock);
|
||||
spin_unlock(&old_wb->list_lock);
|
||||
|
||||
up_read(&bdi->wb_switch_rwsem);
|
||||
|
||||
if (switched) {
|
||||
wb_wakeup(new_wb);
|
||||
wb_put(old_wb);
|
||||
@@ -475,9 +494,18 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id)
|
||||
if (inode->i_state & I_WB_SWITCH)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Avoid starting new switches while sync_inodes_sb() is in
|
||||
* progress. Otherwise, if the down_write protected issue path
|
||||
* blocks heavily, we might end up starting a large number of
|
||||
* switches which will block on the rwsem.
|
||||
*/
|
||||
if (!down_read_trylock(&bdi->wb_switch_rwsem))
|
||||
return;
|
||||
|
||||
isw = kzalloc(sizeof(*isw), GFP_ATOMIC);
|
||||
if (!isw)
|
||||
return;
|
||||
goto out_unlock;
|
||||
|
||||
/* find and pin the new wb */
|
||||
rcu_read_lock();
|
||||
@@ -511,12 +539,14 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id)
|
||||
* Let's continue after I_WB_SWITCH is guaranteed to be visible.
|
||||
*/
|
||||
call_rcu(&isw->rcu_head, inode_switch_wbs_rcu_fn);
|
||||
return;
|
||||
goto out_unlock;
|
||||
|
||||
out_free:
|
||||
if (isw->new_wb)
|
||||
wb_put(isw->new_wb);
|
||||
kfree(isw);
|
||||
out_unlock:
|
||||
up_read(&bdi->wb_switch_rwsem);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -894,6 +924,9 @@ fs_initcall(cgroup_writeback_init);
|
||||
|
||||
#else /* CONFIG_CGROUP_WRITEBACK */
|
||||
|
||||
static void bdi_down_write_wb_switch_rwsem(struct backing_dev_info *bdi) { }
|
||||
static void bdi_up_write_wb_switch_rwsem(struct backing_dev_info *bdi) { }
|
||||
|
||||
static struct bdi_writeback *
|
||||
locked_inode_to_wb_and_lock_list(struct inode *inode)
|
||||
__releases(&inode->i_lock)
|
||||
@@ -2408,8 +2441,11 @@ void sync_inodes_sb(struct super_block *sb)
|
||||
return;
|
||||
WARN_ON(!rwsem_is_locked(&sb->s_umount));
|
||||
|
||||
/* protect against inode wb switch, see inode_switch_wbs_work_fn() */
|
||||
bdi_down_write_wb_switch_rwsem(bdi);
|
||||
bdi_split_work_to_wbs(bdi, &work, false);
|
||||
wb_wait_for_completion(bdi, &done);
|
||||
bdi_up_write_wb_switch_rwsem(bdi);
|
||||
|
||||
wait_sb_inodes(sb);
|
||||
}
|
||||
|
||||
@@ -165,6 +165,7 @@ struct backing_dev_info {
|
||||
struct radix_tree_root cgwb_tree; /* radix tree of active cgroup wbs */
|
||||
struct rb_root cgwb_congested_tree; /* their congested states */
|
||||
struct mutex cgwb_release_mutex; /* protect shutdown of wb structs */
|
||||
struct rw_semaphore wb_switch_rwsem; /* no cgwb switch while syncing */
|
||||
#else
|
||||
struct bdi_writeback_congested *wb_congested;
|
||||
#endif
|
||||
|
||||
@@ -54,6 +54,7 @@ static inline bool dev_is_mac_header_xmit(const struct net_device *dev)
|
||||
case ARPHRD_IPGRE:
|
||||
case ARPHRD_VOID:
|
||||
case ARPHRD_NONE:
|
||||
case ARPHRD_RAWIP:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
|
||||
@@ -88,6 +88,16 @@ enum flat_binder_object_flags {
|
||||
* scheduling policy from the caller (for synchronous transactions).
|
||||
*/
|
||||
FLAT_BINDER_FLAG_INHERIT_RT = 0x800,
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/**
|
||||
* @FLAT_BINDER_FLAG_TXN_SECURITY_CTX: request security contexts
|
||||
*
|
||||
* Only when set, causes senders to include their security
|
||||
* context
|
||||
*/
|
||||
FLAT_BINDER_FLAG_TXN_SECURITY_CTX = 0x1000,
|
||||
#endif /* __KERNEL__ */
|
||||
};
|
||||
|
||||
#ifdef BINDER_IPC_32BIT
|
||||
@@ -265,6 +275,7 @@ struct binder_node_info_for_ref {
|
||||
#define BINDER_VERSION _IOWR('b', 9, struct binder_version)
|
||||
#define BINDER_GET_NODE_DEBUG_INFO _IOWR('b', 11, struct binder_node_debug_info)
|
||||
#define BINDER_GET_NODE_INFO_FOR_REF _IOWR('b', 12, struct binder_node_info_for_ref)
|
||||
#define BINDER_SET_CONTEXT_MGR_EXT _IOW('b', 13, struct flat_binder_object)
|
||||
|
||||
/*
|
||||
* NOTE: Two special error codes you should check for when calling
|
||||
@@ -323,6 +334,13 @@ struct binder_transaction_data {
|
||||
} data;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
struct binder_transaction_data_secctx {
|
||||
struct binder_transaction_data transaction_data;
|
||||
binder_uintptr_t secctx;
|
||||
};
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
struct binder_transaction_data_sg {
|
||||
struct binder_transaction_data transaction_data;
|
||||
binder_size_t buffers_size;
|
||||
@@ -358,6 +376,13 @@ enum binder_driver_return_protocol {
|
||||
BR_OK = _IO('r', 1),
|
||||
/* No parameters! */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
BR_TRANSACTION_SEC_CTX = _IOR('r', 2,
|
||||
struct binder_transaction_data_secctx),
|
||||
/*
|
||||
* binder_transaction_data_secctx: the received command.
|
||||
*/
|
||||
#endif /* __KERNEL__ */
|
||||
BR_TRANSACTION = _IOR('r', 2, struct binder_transaction_data),
|
||||
BR_REPLY = _IOR('r', 3, struct binder_transaction_data),
|
||||
/*
|
||||
|
||||
@@ -306,7 +306,7 @@ void rcuwait_wake_up(struct rcuwait *w)
|
||||
* MB (A) MB (B)
|
||||
* [L] cond [L] tsk
|
||||
*/
|
||||
smp_rmb(); /* (B) */
|
||||
smp_mb(); /* (B) */
|
||||
|
||||
/*
|
||||
* Avoid using task_rcu_dereference() magic as long as we are careful,
|
||||
|
||||
@@ -1462,11 +1462,7 @@ static void mark_wake_futex(struct wake_q_head *wake_q, struct futex_q *q)
|
||||
if (WARN(q->pi_state || q->rt_waiter, "refusing to wake PI futex\n"))
|
||||
return;
|
||||
|
||||
/*
|
||||
* Queue the task for later wakeup for after we've released
|
||||
* the hb->lock. wake_q_add() grabs reference to p.
|
||||
*/
|
||||
wake_q_add(wake_q, p);
|
||||
get_task_struct(p);
|
||||
__unqueue_futex(q);
|
||||
/*
|
||||
* The waiting task can free the futex_q as soon as q->lock_ptr = NULL
|
||||
@@ -1476,6 +1472,13 @@ static void mark_wake_futex(struct wake_q_head *wake_q, struct futex_q *q)
|
||||
* plist_del in __unqueue_futex().
|
||||
*/
|
||||
smp_store_release(&q->lock_ptr, NULL);
|
||||
|
||||
/*
|
||||
* Queue the task for later wakeup for after we've released
|
||||
* the hb->lock. wake_q_add() grabs reference to p.
|
||||
*/
|
||||
wake_q_add(wake_q, p);
|
||||
put_task_struct(p);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -190,15 +190,22 @@ static void __rwsem_mark_wake(struct rw_semaphore *sem,
|
||||
woken++;
|
||||
tsk = waiter->task;
|
||||
|
||||
wake_q_add(wake_q, tsk);
|
||||
get_task_struct(tsk);
|
||||
list_del(&waiter->list);
|
||||
/*
|
||||
* Ensure that the last operation is setting the reader
|
||||
* Ensure calling get_task_struct() before setting the reader
|
||||
* waiter to nil such that rwsem_down_read_failed() cannot
|
||||
* race with do_exit() by always holding a reference count
|
||||
* to the task to wakeup.
|
||||
*/
|
||||
smp_store_release(&waiter->task, NULL);
|
||||
/*
|
||||
* Ensure issuing the wakeup (either by us or someone else)
|
||||
* after setting the reader waiter to nil.
|
||||
*/
|
||||
wake_q_add(wake_q, tsk);
|
||||
/* wake_q_add() already take the task ref */
|
||||
put_task_struct(tsk);
|
||||
}
|
||||
|
||||
adjustment = woken * RWSEM_ACTIVE_READ_BIAS - adjustment;
|
||||
|
||||
@@ -684,6 +684,7 @@ static int cgwb_bdi_init(struct backing_dev_info *bdi)
|
||||
INIT_RADIX_TREE(&bdi->cgwb_tree, GFP_ATOMIC);
|
||||
bdi->cgwb_congested_tree = RB_ROOT;
|
||||
mutex_init(&bdi->cgwb_release_mutex);
|
||||
init_rwsem(&bdi->wb_switch_rwsem);
|
||||
|
||||
ret = wb_init(&bdi->wb, bdi, 1, GFP_KERNEL);
|
||||
if (!ret) {
|
||||
|
||||
@@ -2459,12 +2459,11 @@ int expand_downwards(struct vm_area_struct *vma,
|
||||
{
|
||||
struct mm_struct *mm = vma->vm_mm;
|
||||
struct vm_area_struct *prev;
|
||||
int error;
|
||||
int error = 0;
|
||||
|
||||
address &= PAGE_MASK;
|
||||
error = security_mmap_addr(address);
|
||||
if (error)
|
||||
return error;
|
||||
if (address < mmap_min_addr)
|
||||
return -EPERM;
|
||||
|
||||
/* Enforce stack_guard_gap */
|
||||
prev = vma->vm_prev;
|
||||
|
||||
@@ -1466,6 +1466,10 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
|
||||
if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))
|
||||
sta->sta.tdls = true;
|
||||
|
||||
if (sta->sta.tdls && sdata->vif.type == NL80211_IFTYPE_STATION &&
|
||||
!sdata->u.mgd.associated)
|
||||
return -EINVAL;
|
||||
|
||||
err = sta_apply_parameters(local, sta, params);
|
||||
if (err) {
|
||||
sta_info_free(local, sta);
|
||||
|
||||
@@ -206,7 +206,7 @@ static void ieee80211_handle_mu_mimo_mon(struct ieee80211_sub_if_data *sdata,
|
||||
struct ieee80211_hdr_3addr hdr;
|
||||
u8 category;
|
||||
u8 action_code;
|
||||
} __packed action;
|
||||
} __packed __aligned(2) action;
|
||||
|
||||
if (!sdata)
|
||||
return;
|
||||
@@ -2533,7 +2533,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
|
||||
skb_set_queue_mapping(skb, q);
|
||||
|
||||
if (!--mesh_hdr->ttl) {
|
||||
IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl);
|
||||
if (!is_multicast_ether_addr(hdr->addr1))
|
||||
IEEE80211_IFSTA_MESH_CTR_INC(ifmsh,
|
||||
dropped_frames_ttl);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -764,7 +764,7 @@ static bool is_valid_rd(const struct ieee80211_regdomain *rd)
|
||||
* definitions (the "2.4 GHz band", the "5 GHz band" and the "60GHz band"),
|
||||
* however it is safe for now to assume that a frequency rule should not be
|
||||
* part of a frequency's band if the start freq or end freq are off by more
|
||||
* than 2 GHz for the 2.4 and 5 GHz bands, and by more than 10 GHz for the
|
||||
* than 2 GHz for the 2.4 and 5 GHz bands, and by more than 20 GHz for the
|
||||
* 60 GHz band.
|
||||
* This resolution can be lowered and should be considered as we add
|
||||
* regulatory rule support for other "bands".
|
||||
@@ -779,7 +779,7 @@ static bool freq_in_rule_band(const struct ieee80211_freq_range *freq_range,
|
||||
* with the Channel starting frequency above 45 GHz.
|
||||
*/
|
||||
u32 limit = freq_khz > 45 * ONE_GHZ_IN_KHZ ?
|
||||
10 * ONE_GHZ_IN_KHZ : 2 * ONE_GHZ_IN_KHZ;
|
||||
20 * ONE_GHZ_IN_KHZ : 2 * ONE_GHZ_IN_KHZ;
|
||||
if (abs(freq_khz - freq_range->start_freq_khz) <= limit)
|
||||
return true;
|
||||
if (abs(freq_khz - freq_range->end_freq_khz) <= limit)
|
||||
|
||||
@@ -532,7 +532,8 @@ static int snd_compress_check_input(struct snd_compr_params *params)
|
||||
{
|
||||
/* first let's check the buffer parameter's */
|
||||
if (params->buffer.fragment_size == 0 ||
|
||||
params->buffer.fragments > U32_MAX / params->buffer.fragment_size)
|
||||
params->buffer.fragments > U32_MAX / params->buffer.fragment_size ||
|
||||
params->buffer.fragments == 0)
|
||||
return -EINVAL;
|
||||
|
||||
/* now codec parameters */
|
||||
|
||||
@@ -1128,8 +1128,11 @@ static int rt274_i2c_probe(struct i2c_client *i2c,
|
||||
return ret;
|
||||
}
|
||||
|
||||
regmap_read(rt274->regmap,
|
||||
ret = regmap_read(rt274->regmap,
|
||||
RT274_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (val != RT274_VENDOR_ID) {
|
||||
dev_err(&i2c->dev,
|
||||
"Device with ID register %#x is not rt274\n", val);
|
||||
|
||||
@@ -86,49 +86,49 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n",
|
||||
ret = scnprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n",
|
||||
pdcr, ptcr);
|
||||
|
||||
if (ptcr & IMX_AUDMUX_V2_PTCR_TFSDIR)
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret,
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret,
|
||||
"TxFS output from %s, ",
|
||||
audmux_port_string((ptcr >> 27) & 0x7));
|
||||
else
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret,
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret,
|
||||
"TxFS input, ");
|
||||
|
||||
if (ptcr & IMX_AUDMUX_V2_PTCR_TCLKDIR)
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret,
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret,
|
||||
"TxClk output from %s",
|
||||
audmux_port_string((ptcr >> 22) & 0x7));
|
||||
else
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret,
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret,
|
||||
"TxClk input");
|
||||
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret, "\n");
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret, "\n");
|
||||
|
||||
if (ptcr & IMX_AUDMUX_V2_PTCR_SYN) {
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret,
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret,
|
||||
"Port is symmetric");
|
||||
} else {
|
||||
if (ptcr & IMX_AUDMUX_V2_PTCR_RFSDIR)
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret,
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret,
|
||||
"RxFS output from %s, ",
|
||||
audmux_port_string((ptcr >> 17) & 0x7));
|
||||
else
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret,
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret,
|
||||
"RxFS input, ");
|
||||
|
||||
if (ptcr & IMX_AUDMUX_V2_PTCR_RCLKDIR)
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret,
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret,
|
||||
"RxClk output from %s",
|
||||
audmux_port_string((ptcr >> 12) & 0x7));
|
||||
else
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret,
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret,
|
||||
"RxClk input");
|
||||
}
|
||||
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret,
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret,
|
||||
"\nData received from %s\n",
|
||||
audmux_port_string((pdcr >> 13) & 0x7));
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = {
|
||||
.stream_name = "Loopback",
|
||||
.cpu_dai_name = "Loopback Pin",
|
||||
.platform_name = "haswell-pcm-audio",
|
||||
.dynamic = 0,
|
||||
.dynamic = 1,
|
||||
.codec_name = "snd-soc-dummy",
|
||||
.codec_dai_name = "snd-soc-dummy-dai",
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
|
||||
|
||||
@@ -145,7 +145,7 @@ static struct snd_soc_dai_link haswell_rt5640_dais[] = {
|
||||
.stream_name = "Loopback",
|
||||
.cpu_dai_name = "Loopback Pin",
|
||||
.platform_name = "haswell-pcm-audio",
|
||||
.dynamic = 0,
|
||||
.dynamic = 1,
|
||||
.codec_name = "snd-soc-dummy",
|
||||
.codec_dai_name = "snd-soc-dummy-dai",
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
|
||||
|
||||
@@ -2026,19 +2026,19 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
|
||||
out = is_connected_output_ep(w, NULL, NULL);
|
||||
}
|
||||
|
||||
ret = snprintf(buf, PAGE_SIZE, "%s: %s%s in %d out %d",
|
||||
ret = scnprintf(buf, PAGE_SIZE, "%s: %s%s in %d out %d",
|
||||
w->name, w->power ? "On" : "Off",
|
||||
w->force ? " (forced)" : "", in, out);
|
||||
|
||||
if (w->reg >= 0)
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret,
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret,
|
||||
" - R%d(0x%x) mask 0x%x",
|
||||
w->reg, w->reg, w->mask << w->shift);
|
||||
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret, "\n");
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret, "\n");
|
||||
|
||||
if (w->sname)
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret, " stream %s %s\n",
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret, " stream %s %s\n",
|
||||
w->sname,
|
||||
w->active ? "active" : "inactive");
|
||||
|
||||
@@ -2051,7 +2051,7 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
|
||||
if (!p->connect)
|
||||
continue;
|
||||
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret,
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret,
|
||||
" %s \"%s\" \"%s\"\n",
|
||||
(rdir == SND_SOC_DAPM_DIR_IN) ? "in" : "out",
|
||||
p->name ? p->name : "static",
|
||||
|
||||
@@ -37,7 +37,7 @@ static int get_debugfs(char **path)
|
||||
struct libmnt_table *tb;
|
||||
struct libmnt_iter *itr = NULL;
|
||||
struct libmnt_fs *fs;
|
||||
int found = 0;
|
||||
int found = 0, ret;
|
||||
|
||||
cxt = mnt_new_context();
|
||||
if (!cxt)
|
||||
@@ -58,8 +58,11 @@ static int get_debugfs(char **path)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
asprintf(path, "%s/gpio", mnt_fs_get_target(fs));
|
||||
if (found) {
|
||||
ret = asprintf(path, "%s/gpio", mnt_fs_get_target(fs));
|
||||
if (ret < 0)
|
||||
err(EXIT_FAILURE, "failed to format string");
|
||||
}
|
||||
|
||||
mnt_free_iter(itr);
|
||||
mnt_free_context(cxt);
|
||||
|
||||
@@ -9,7 +9,7 @@ BINARIES := seccomp_bpf seccomp_benchmark
|
||||
CFLAGS += -Wl,-no-as-needed -Wall
|
||||
|
||||
seccomp_bpf: seccomp_bpf.c ../kselftest_harness.h
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -lpthread $< -o $@
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $< -lpthread -o $@
|
||||
|
||||
TEST_PROGS += $(BINARIES)
|
||||
EXTRA_CLEAN := $(BINARIES)
|
||||
|
||||
Reference in New Issue
Block a user