mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 09:41:54 +09:00
Merge tag 'v3.10.60' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidc-3.10.y
This is the 3.10.60 stable release
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
||||
VERSION = 3
|
||||
PATCHLEVEL = 10
|
||||
SUBLEVEL = 59
|
||||
SUBLEVEL = 60
|
||||
EXTRAVERSION =
|
||||
NAME = TOSSUG Baby Fish
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/* this is for console on PGU */
|
||||
/* bootargs = "console=tty0 consoleblank=0"; */
|
||||
/* this is for console on serial */
|
||||
bootargs = "earlycon=uart8250,mmio32,0xc0000000,115200n8 console=ttyS0,115200n8 consoleblank=0 debug";
|
||||
bootargs = "earlycon=uart8250,mmio32,0xc0000000,115200n8 console=tty0 console=ttyS0,115200n8 consoleblank=0 debug";
|
||||
};
|
||||
|
||||
aliases {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* register API yet */
|
||||
#undef DBG_MAX_REG_NUM
|
||||
|
||||
#define GDB_MAX_REGS 39
|
||||
#define GDB_MAX_REGS 87
|
||||
|
||||
#define BREAK_INSTR_SIZE 2
|
||||
#define CACHE_FLUSH_IS_SAFE 1
|
||||
@@ -33,23 +33,27 @@ static inline void arch_kgdb_breakpoint(void)
|
||||
|
||||
extern void kgdb_trap(struct pt_regs *regs, int param);
|
||||
|
||||
enum arc700_linux_regnums {
|
||||
/* This is the numbering of registers according to the GDB. See GDB's
|
||||
* arc-tdep.h for details.
|
||||
*
|
||||
* Registers are ordered for GDB 7.5. It is incompatible with GDB 6.8. */
|
||||
enum arc_linux_regnums {
|
||||
_R0 = 0,
|
||||
_R1, _R2, _R3, _R4, _R5, _R6, _R7, _R8, _R9, _R10, _R11, _R12, _R13,
|
||||
_R14, _R15, _R16, _R17, _R18, _R19, _R20, _R21, _R22, _R23, _R24,
|
||||
_R25, _R26,
|
||||
_BTA = 27,
|
||||
_LP_START = 28,
|
||||
_LP_END = 29,
|
||||
_LP_COUNT = 30,
|
||||
_STATUS32 = 31,
|
||||
_BLINK = 32,
|
||||
_FP = 33,
|
||||
__SP = 34,
|
||||
_EFA = 35,
|
||||
_RET = 36,
|
||||
_ORIG_R8 = 37,
|
||||
_STOP_PC = 38
|
||||
_FP = 27,
|
||||
__SP = 28,
|
||||
_R30 = 30,
|
||||
_BLINK = 31,
|
||||
_LP_COUNT = 60,
|
||||
_STOP_PC = 64,
|
||||
_RET = 64,
|
||||
_LP_START = 65,
|
||||
_LP_END = 66,
|
||||
_STATUS32 = 67,
|
||||
_ECR = 76,
|
||||
_BTA = 82,
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
@@ -1091,6 +1091,7 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
|
||||
struct mips_huge_tlb_info {
|
||||
int huge_pte;
|
||||
int restore_scratch;
|
||||
bool need_reload_pte;
|
||||
};
|
||||
|
||||
static struct mips_huge_tlb_info __cpuinit
|
||||
@@ -1105,6 +1106,7 @@ build_fast_tlb_refill_handler (u32 **p, struct uasm_label **l,
|
||||
|
||||
rv.huge_pte = scratch;
|
||||
rv.restore_scratch = 0;
|
||||
rv.need_reload_pte = false;
|
||||
|
||||
if (check_for_high_segbits) {
|
||||
UASM_i_MFC0(p, tmp, C0_BADVADDR);
|
||||
@@ -1293,6 +1295,7 @@ static void __cpuinit build_r4000_tlb_refill_handler(void)
|
||||
} else {
|
||||
htlb_info.huge_pte = K0;
|
||||
htlb_info.restore_scratch = 0;
|
||||
htlb_info.need_reload_pte = true;
|
||||
vmalloc_mode = refill_noscratch;
|
||||
/*
|
||||
* create the plain linear handler
|
||||
@@ -1329,7 +1332,8 @@ static void __cpuinit build_r4000_tlb_refill_handler(void)
|
||||
}
|
||||
#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
|
||||
uasm_l_tlb_huge_update(&l, p);
|
||||
UASM_i_LW(&p, K0, 0, K1);
|
||||
if (htlb_info.need_reload_pte)
|
||||
UASM_i_LW(&p, htlb_info.huge_pte, 0, K1);
|
||||
build_huge_update_entries(&p, htlb_info.huge_pte, K1);
|
||||
build_huge_tlb_write_entry(&p, &l, &r, K0, tlb_random,
|
||||
htlb_info.restore_scratch);
|
||||
|
||||
@@ -151,6 +151,16 @@ ENTRY(ia32_sysenter_target)
|
||||
1: movl (%rbp),%ebp
|
||||
_ASM_EXTABLE(1b,ia32_badarg)
|
||||
ASM_CLAC
|
||||
|
||||
/*
|
||||
* Sysenter doesn't filter flags, so we need to clear NT
|
||||
* ourselves. To save a few cycles, we can check whether
|
||||
* NT was set instead of doing an unconditional popfq.
|
||||
*/
|
||||
testl $X86_EFLAGS_NT,EFLAGS-ARGOFFSET(%rsp)
|
||||
jnz sysenter_fix_flags
|
||||
sysenter_flags_fixed:
|
||||
|
||||
orl $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
|
||||
testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
|
||||
CFI_REMEMBER_STATE
|
||||
@@ -184,6 +194,8 @@ sysexit_from_sys_call:
|
||||
TRACE_IRQS_ON
|
||||
ENABLE_INTERRUPTS_SYSEXIT32
|
||||
|
||||
CFI_RESTORE_STATE
|
||||
|
||||
#ifdef CONFIG_AUDITSYSCALL
|
||||
.macro auditsys_entry_common
|
||||
movl %esi,%r9d /* 6th arg: 4th syscall arg */
|
||||
@@ -226,7 +238,6 @@ sysexit_from_sys_call:
|
||||
.endm
|
||||
|
||||
sysenter_auditsys:
|
||||
CFI_RESTORE_STATE
|
||||
auditsys_entry_common
|
||||
movl %ebp,%r9d /* reload 6th syscall arg */
|
||||
jmp sysenter_dispatch
|
||||
@@ -235,6 +246,11 @@ sysexit_audit:
|
||||
auditsys_exit sysexit_from_sys_call
|
||||
#endif
|
||||
|
||||
sysenter_fix_flags:
|
||||
pushq_cfi $(X86_EFLAGS_IF|X86_EFLAGS_FIXED)
|
||||
popfq_cfi
|
||||
jmp sysenter_flags_fixed
|
||||
|
||||
sysenter_tracesys:
|
||||
#ifdef CONFIG_AUDITSYSCALL
|
||||
testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
|
||||
|
||||
@@ -155,8 +155,9 @@ do { \
|
||||
#define elf_check_arch(x) \
|
||||
((x)->e_machine == EM_X86_64)
|
||||
|
||||
#define compat_elf_check_arch(x) \
|
||||
(elf_check_arch_ia32(x) || (x)->e_machine == EM_X86_64)
|
||||
#define compat_elf_check_arch(x) \
|
||||
(elf_check_arch_ia32(x) || \
|
||||
(IS_ENABLED(CONFIG_X86_X32_ABI) && (x)->e_machine == EM_X86_64))
|
||||
|
||||
#if __USER32_DS != __USER_DS
|
||||
# error "The following code assumes __USER32_DS == __USER_DS"
|
||||
|
||||
@@ -953,6 +953,20 @@ static inline void kvm_inject_gp(struct kvm_vcpu *vcpu, u32 error_code)
|
||||
kvm_queue_exception_e(vcpu, GP_VECTOR, error_code);
|
||||
}
|
||||
|
||||
static inline u64 get_canonical(u64 la)
|
||||
{
|
||||
return ((int64_t)la << 16) >> 16;
|
||||
}
|
||||
|
||||
static inline bool is_noncanonical_address(u64 la)
|
||||
{
|
||||
#ifdef CONFIG_X86_64
|
||||
return get_canonical(la) != la;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define TSS_IOPB_BASE_OFFSET 0x66
|
||||
#define TSS_BASE_SIZE 0x68
|
||||
#define TSS_IOPB_SIZE (65536 / 8)
|
||||
@@ -1011,7 +1025,7 @@ int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
|
||||
void kvm_vcpu_reset(struct kvm_vcpu *vcpu);
|
||||
|
||||
void kvm_define_shared_msr(unsigned index, u32 msr);
|
||||
void kvm_set_shared_msr(unsigned index, u64 val, u64 mask);
|
||||
int kvm_set_shared_msr(unsigned index, u64 val, u64 mask);
|
||||
|
||||
bool kvm_is_linear_rip(struct kvm_vcpu *vcpu, unsigned long linear_rip);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* EFLAGS bits
|
||||
*/
|
||||
#define X86_EFLAGS_CF 0x00000001 /* Carry Flag */
|
||||
#define X86_EFLAGS_BIT1 0x00000002 /* Bit 1 - always on */
|
||||
#define X86_EFLAGS_FIXED 0x00000002 /* Bit 1 - always on */
|
||||
#define X86_EFLAGS_PF 0x00000004 /* Parity Flag */
|
||||
#define X86_EFLAGS_AF 0x00000010 /* Auxiliary carry Flag */
|
||||
#define X86_EFLAGS_ZF 0x00000040 /* Zero Flag */
|
||||
|
||||
@@ -1263,7 +1263,7 @@ void __cpuinit setup_local_APIC(void)
|
||||
unsigned int value, queued;
|
||||
int i, j, acked = 0;
|
||||
unsigned long long tsc = 0, ntsc;
|
||||
long long max_loops = cpu_khz;
|
||||
long long max_loops = cpu_khz ? cpu_khz : 1000000;
|
||||
|
||||
if (cpu_has_tsc)
|
||||
rdtscll(tsc);
|
||||
@@ -1360,7 +1360,7 @@ void __cpuinit setup_local_APIC(void)
|
||||
break;
|
||||
}
|
||||
if (queued) {
|
||||
if (cpu_has_tsc) {
|
||||
if (cpu_has_tsc && cpu_khz) {
|
||||
rdtscll(ntsc);
|
||||
max_loops = (cpu_khz << 10) - (ntsc - tsc);
|
||||
} else
|
||||
|
||||
@@ -1134,7 +1134,7 @@ void syscall_init(void)
|
||||
/* Flags to clear on syscall */
|
||||
wrmsrl(MSR_SYSCALL_MASK,
|
||||
X86_EFLAGS_TF|X86_EFLAGS_DF|X86_EFLAGS_IF|
|
||||
X86_EFLAGS_IOPL|X86_EFLAGS_AC);
|
||||
X86_EFLAGS_IOPL|X86_EFLAGS_AC|X86_EFLAGS_NT);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -366,7 +366,7 @@ ENDPROC(native_usergs_sysret64)
|
||||
/*CFI_REL_OFFSET ss,0*/
|
||||
pushq_cfi %rax /* rsp */
|
||||
CFI_REL_OFFSET rsp,0
|
||||
pushq_cfi $(X86_EFLAGS_IF|X86_EFLAGS_BIT1) /* eflags - interrupts on */
|
||||
pushq_cfi $(X86_EFLAGS_IF|X86_EFLAGS_FIXED) /* eflags - interrupts on */
|
||||
/*CFI_REL_OFFSET rflags,0*/
|
||||
pushq_cfi $__KERNEL_CS /* cs */
|
||||
/*CFI_REL_OFFSET cs,0*/
|
||||
|
||||
@@ -147,7 +147,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
|
||||
childregs->bp = arg;
|
||||
childregs->orig_ax = -1;
|
||||
childregs->cs = __KERNEL_CS | get_kernel_rpl();
|
||||
childregs->flags = X86_EFLAGS_IF | X86_EFLAGS_BIT1;
|
||||
childregs->flags = X86_EFLAGS_IF | X86_EFLAGS_FIXED;
|
||||
p->fpu_counter = 0;
|
||||
p->thread.io_bitmap_ptr = NULL;
|
||||
memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps));
|
||||
|
||||
@@ -176,7 +176,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
|
||||
childregs->bp = arg;
|
||||
childregs->orig_ax = -1;
|
||||
childregs->cs = __KERNEL_CS | get_kernel_rpl();
|
||||
childregs->flags = X86_EFLAGS_IF | X86_EFLAGS_BIT1;
|
||||
childregs->flags = X86_EFLAGS_IF | X86_EFLAGS_FIXED;
|
||||
return 0;
|
||||
}
|
||||
*childregs = *current_pt_regs();
|
||||
|
||||
@@ -677,6 +677,11 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs)
|
||||
* handler too.
|
||||
*/
|
||||
regs->flags &= ~X86_EFLAGS_TF;
|
||||
/*
|
||||
* Ensure the signal handler starts with the new fpu state.
|
||||
*/
|
||||
if (used_math())
|
||||
drop_init_fpu(current);
|
||||
}
|
||||
signal_setup_done(failed, ksig, test_thread_flag(TIF_SINGLESTEP));
|
||||
}
|
||||
|
||||
@@ -968,14 +968,17 @@ void __init tsc_init(void)
|
||||
|
||||
x86_init.timers.tsc_pre_init();
|
||||
|
||||
if (!cpu_has_tsc)
|
||||
if (!cpu_has_tsc) {
|
||||
setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER);
|
||||
return;
|
||||
}
|
||||
|
||||
tsc_khz = x86_platform.calibrate_tsc();
|
||||
cpu_khz = tsc_khz;
|
||||
|
||||
if (!tsc_khz) {
|
||||
mark_tsc_unstable("could not calculate TSC khz");
|
||||
setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -268,8 +268,6 @@ int save_xstate_sig(void __user *buf, void __user *buf_fx, int size)
|
||||
if (use_fxsr() && save_xstate_epilog(buf_fx, ia32_fxstate))
|
||||
return -1;
|
||||
|
||||
drop_init_fpu(tsk); /* trigger finit */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -400,8 +398,11 @@ int __restore_xstate_sig(void __user *buf, void __user *buf_fx, int size)
|
||||
set_used_math();
|
||||
}
|
||||
|
||||
if (use_eager_fpu())
|
||||
if (use_eager_fpu()) {
|
||||
preempt_disable();
|
||||
math_state_restore();
|
||||
preempt_enable();
|
||||
}
|
||||
|
||||
return err;
|
||||
} else {
|
||||
|
||||
@@ -663,11 +663,6 @@ static void rsp_increment(struct x86_emulate_ctxt *ctxt, int inc)
|
||||
masked_increment(reg_rmw(ctxt, VCPU_REGS_RSP), stack_mask(ctxt), inc);
|
||||
}
|
||||
|
||||
static inline void jmp_rel(struct x86_emulate_ctxt *ctxt, int rel)
|
||||
{
|
||||
register_address_increment(ctxt, &ctxt->_eip, rel);
|
||||
}
|
||||
|
||||
static u32 desc_limit_scaled(struct desc_struct *desc)
|
||||
{
|
||||
u32 limit = get_desc_limit(desc);
|
||||
@@ -741,6 +736,38 @@ static int emulate_nm(struct x86_emulate_ctxt *ctxt)
|
||||
return emulate_exception(ctxt, NM_VECTOR, 0, false);
|
||||
}
|
||||
|
||||
static inline int assign_eip_far(struct x86_emulate_ctxt *ctxt, ulong dst,
|
||||
int cs_l)
|
||||
{
|
||||
switch (ctxt->op_bytes) {
|
||||
case 2:
|
||||
ctxt->_eip = (u16)dst;
|
||||
break;
|
||||
case 4:
|
||||
ctxt->_eip = (u32)dst;
|
||||
break;
|
||||
case 8:
|
||||
if ((cs_l && is_noncanonical_address(dst)) ||
|
||||
(!cs_l && (dst & ~(u32)-1)))
|
||||
return emulate_gp(ctxt, 0);
|
||||
ctxt->_eip = dst;
|
||||
break;
|
||||
default:
|
||||
WARN(1, "unsupported eip assignment size\n");
|
||||
}
|
||||
return X86EMUL_CONTINUE;
|
||||
}
|
||||
|
||||
static inline int assign_eip_near(struct x86_emulate_ctxt *ctxt, ulong dst)
|
||||
{
|
||||
return assign_eip_far(ctxt, dst, ctxt->mode == X86EMUL_MODE_PROT64);
|
||||
}
|
||||
|
||||
static inline int jmp_rel(struct x86_emulate_ctxt *ctxt, int rel)
|
||||
{
|
||||
return assign_eip_near(ctxt, ctxt->_eip + rel);
|
||||
}
|
||||
|
||||
static u16 get_segment_selector(struct x86_emulate_ctxt *ctxt, unsigned seg)
|
||||
{
|
||||
u16 selector;
|
||||
@@ -2161,13 +2188,15 @@ static int em_grp45(struct x86_emulate_ctxt *ctxt)
|
||||
case 2: /* call near abs */ {
|
||||
long int old_eip;
|
||||
old_eip = ctxt->_eip;
|
||||
ctxt->_eip = ctxt->src.val;
|
||||
rc = assign_eip_near(ctxt, ctxt->src.val);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
break;
|
||||
ctxt->src.val = old_eip;
|
||||
rc = em_push(ctxt);
|
||||
break;
|
||||
}
|
||||
case 4: /* jmp abs */
|
||||
ctxt->_eip = ctxt->src.val;
|
||||
rc = assign_eip_near(ctxt, ctxt->src.val);
|
||||
break;
|
||||
case 5: /* jmp far */
|
||||
rc = em_jmp_far(ctxt);
|
||||
@@ -2199,10 +2228,14 @@ static int em_cmpxchg8b(struct x86_emulate_ctxt *ctxt)
|
||||
|
||||
static int em_ret(struct x86_emulate_ctxt *ctxt)
|
||||
{
|
||||
ctxt->dst.type = OP_REG;
|
||||
ctxt->dst.addr.reg = &ctxt->_eip;
|
||||
ctxt->dst.bytes = ctxt->op_bytes;
|
||||
return em_pop(ctxt);
|
||||
int rc;
|
||||
unsigned long eip;
|
||||
|
||||
rc = emulate_pop(ctxt, &eip, ctxt->op_bytes);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
return rc;
|
||||
|
||||
return assign_eip_near(ctxt, eip);
|
||||
}
|
||||
|
||||
static int em_ret_far(struct x86_emulate_ctxt *ctxt)
|
||||
@@ -2469,7 +2502,7 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt)
|
||||
{
|
||||
const struct x86_emulate_ops *ops = ctxt->ops;
|
||||
struct desc_struct cs, ss;
|
||||
u64 msr_data;
|
||||
u64 msr_data, rcx, rdx;
|
||||
int usermode;
|
||||
u16 cs_sel = 0, ss_sel = 0;
|
||||
|
||||
@@ -2485,6 +2518,9 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt)
|
||||
else
|
||||
usermode = X86EMUL_MODE_PROT32;
|
||||
|
||||
rcx = reg_read(ctxt, VCPU_REGS_RCX);
|
||||
rdx = reg_read(ctxt, VCPU_REGS_RDX);
|
||||
|
||||
cs.dpl = 3;
|
||||
ss.dpl = 3;
|
||||
ops->get_msr(ctxt, MSR_IA32_SYSENTER_CS, &msr_data);
|
||||
@@ -2502,6 +2538,9 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt)
|
||||
ss_sel = cs_sel + 8;
|
||||
cs.d = 0;
|
||||
cs.l = 1;
|
||||
if (is_noncanonical_address(rcx) ||
|
||||
is_noncanonical_address(rdx))
|
||||
return emulate_gp(ctxt, 0);
|
||||
break;
|
||||
}
|
||||
cs_sel |= SELECTOR_RPL_MASK;
|
||||
@@ -2510,8 +2549,8 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt)
|
||||
ops->set_segment(ctxt, cs_sel, &cs, 0, VCPU_SREG_CS);
|
||||
ops->set_segment(ctxt, ss_sel, &ss, 0, VCPU_SREG_SS);
|
||||
|
||||
ctxt->_eip = reg_read(ctxt, VCPU_REGS_RDX);
|
||||
*reg_write(ctxt, VCPU_REGS_RSP) = reg_read(ctxt, VCPU_REGS_RCX);
|
||||
ctxt->_eip = rdx;
|
||||
*reg_write(ctxt, VCPU_REGS_RSP) = rcx;
|
||||
|
||||
return X86EMUL_CONTINUE;
|
||||
}
|
||||
@@ -3050,10 +3089,13 @@ static int em_aad(struct x86_emulate_ctxt *ctxt)
|
||||
|
||||
static int em_call(struct x86_emulate_ctxt *ctxt)
|
||||
{
|
||||
int rc;
|
||||
long rel = ctxt->src.val;
|
||||
|
||||
ctxt->src.val = (unsigned long)ctxt->_eip;
|
||||
jmp_rel(ctxt, rel);
|
||||
rc = jmp_rel(ctxt, rel);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
return rc;
|
||||
return em_push(ctxt);
|
||||
}
|
||||
|
||||
@@ -3085,11 +3127,12 @@ static int em_call_far(struct x86_emulate_ctxt *ctxt)
|
||||
static int em_ret_near_imm(struct x86_emulate_ctxt *ctxt)
|
||||
{
|
||||
int rc;
|
||||
unsigned long eip;
|
||||
|
||||
ctxt->dst.type = OP_REG;
|
||||
ctxt->dst.addr.reg = &ctxt->_eip;
|
||||
ctxt->dst.bytes = ctxt->op_bytes;
|
||||
rc = emulate_pop(ctxt, &ctxt->dst.val, ctxt->op_bytes);
|
||||
rc = emulate_pop(ctxt, &eip, ctxt->op_bytes);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
return rc;
|
||||
rc = assign_eip_near(ctxt, eip);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
return rc;
|
||||
rsp_increment(ctxt, ctxt->src.val);
|
||||
@@ -3379,20 +3422,24 @@ static int em_lmsw(struct x86_emulate_ctxt *ctxt)
|
||||
|
||||
static int em_loop(struct x86_emulate_ctxt *ctxt)
|
||||
{
|
||||
int rc = X86EMUL_CONTINUE;
|
||||
|
||||
register_address_increment(ctxt, reg_rmw(ctxt, VCPU_REGS_RCX), -1);
|
||||
if ((address_mask(ctxt, reg_read(ctxt, VCPU_REGS_RCX)) != 0) &&
|
||||
(ctxt->b == 0xe2 || test_cc(ctxt->b ^ 0x5, ctxt->eflags)))
|
||||
jmp_rel(ctxt, ctxt->src.val);
|
||||
rc = jmp_rel(ctxt, ctxt->src.val);
|
||||
|
||||
return X86EMUL_CONTINUE;
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int em_jcxz(struct x86_emulate_ctxt *ctxt)
|
||||
{
|
||||
if (address_mask(ctxt, reg_read(ctxt, VCPU_REGS_RCX)) == 0)
|
||||
jmp_rel(ctxt, ctxt->src.val);
|
||||
int rc = X86EMUL_CONTINUE;
|
||||
|
||||
return X86EMUL_CONTINUE;
|
||||
if (address_mask(ctxt, reg_read(ctxt, VCPU_REGS_RCX)) == 0)
|
||||
rc = jmp_rel(ctxt, ctxt->src.val);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int em_in(struct x86_emulate_ctxt *ctxt)
|
||||
@@ -4721,7 +4768,7 @@ special_insn:
|
||||
break;
|
||||
case 0x70 ... 0x7f: /* jcc (short) */
|
||||
if (test_cc(ctxt->b, ctxt->eflags))
|
||||
jmp_rel(ctxt, ctxt->src.val);
|
||||
rc = jmp_rel(ctxt, ctxt->src.val);
|
||||
break;
|
||||
case 0x8d: /* lea r16/r32, m */
|
||||
ctxt->dst.val = ctxt->src.addr.mem.ea;
|
||||
@@ -4750,7 +4797,7 @@ special_insn:
|
||||
break;
|
||||
case 0xe9: /* jmp rel */
|
||||
case 0xeb: /* jmp rel short */
|
||||
jmp_rel(ctxt, ctxt->src.val);
|
||||
rc = jmp_rel(ctxt, ctxt->src.val);
|
||||
ctxt->dst.type = OP_NONE; /* Disable writeback. */
|
||||
break;
|
||||
case 0xf4: /* hlt */
|
||||
@@ -4862,7 +4909,7 @@ twobyte_insn:
|
||||
break;
|
||||
case 0x80 ... 0x8f: /* jnz rel, etc*/
|
||||
if (test_cc(ctxt->b, ctxt->eflags))
|
||||
jmp_rel(ctxt, ctxt->src.val);
|
||||
rc = jmp_rel(ctxt, ctxt->src.val);
|
||||
break;
|
||||
case 0x90 ... 0x9f: /* setcc r/m8 */
|
||||
ctxt->dst.val = test_cc(ctxt->b, ctxt->eflags);
|
||||
|
||||
@@ -262,8 +262,10 @@ void __kvm_migrate_pit_timer(struct kvm_vcpu *vcpu)
|
||||
return;
|
||||
|
||||
timer = &pit->pit_state.timer;
|
||||
mutex_lock(&pit->pit_state.lock);
|
||||
if (hrtimer_cancel(timer))
|
||||
hrtimer_start_expires(timer, HRTIMER_MODE_ABS);
|
||||
mutex_unlock(&pit->pit_state.lock);
|
||||
}
|
||||
|
||||
static void destroy_pit_timer(struct kvm_pit *pit)
|
||||
|
||||
@@ -3196,7 +3196,7 @@ static int wrmsr_interception(struct vcpu_svm *svm)
|
||||
msr.host_initiated = false;
|
||||
|
||||
svm->next_rip = kvm_rip_read(&svm->vcpu) + 2;
|
||||
if (svm_set_msr(&svm->vcpu, &msr)) {
|
||||
if (kvm_set_msr(&svm->vcpu, &msr)) {
|
||||
trace_kvm_msr_write_ex(ecx, data);
|
||||
kvm_inject_gp(&svm->vcpu, 0);
|
||||
} else {
|
||||
@@ -3478,9 +3478,9 @@ static int handle_exit(struct kvm_vcpu *vcpu)
|
||||
|
||||
if (exit_code >= ARRAY_SIZE(svm_exit_handlers)
|
||||
|| !svm_exit_handlers[exit_code]) {
|
||||
kvm_run->exit_reason = KVM_EXIT_UNKNOWN;
|
||||
kvm_run->hw.hardware_exit_reason = exit_code;
|
||||
return 0;
|
||||
WARN_ONCE(1, "vmx: unexpected exit reason 0x%x\n", exit_code);
|
||||
kvm_queue_exception(vcpu, UD_VECTOR);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return svm_exit_handlers[exit_code](svm);
|
||||
|
||||
@@ -2493,12 +2493,15 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
|
||||
break;
|
||||
msr = find_msr_entry(vmx, msr_index);
|
||||
if (msr) {
|
||||
u64 old_msr_data = msr->data;
|
||||
msr->data = data;
|
||||
if (msr - vmx->guest_msrs < vmx->save_nmsrs) {
|
||||
preempt_disable();
|
||||
kvm_set_shared_msr(msr->index, msr->data,
|
||||
msr->mask);
|
||||
ret = kvm_set_shared_msr(msr->index, msr->data,
|
||||
msr->mask);
|
||||
preempt_enable();
|
||||
if (ret)
|
||||
msr->data = old_msr_data;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -5062,7 +5065,7 @@ static int handle_wrmsr(struct kvm_vcpu *vcpu)
|
||||
msr.data = data;
|
||||
msr.index = ecx;
|
||||
msr.host_initiated = false;
|
||||
if (vmx_set_msr(vcpu, &msr) != 0) {
|
||||
if (kvm_set_msr(vcpu, &msr) != 0) {
|
||||
trace_kvm_msr_write_ex(ecx, data);
|
||||
kvm_inject_gp(vcpu, 0);
|
||||
return 1;
|
||||
@@ -6651,10 +6654,10 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu)
|
||||
&& kvm_vmx_exit_handlers[exit_reason])
|
||||
return kvm_vmx_exit_handlers[exit_reason](vcpu);
|
||||
else {
|
||||
vcpu->run->exit_reason = KVM_EXIT_UNKNOWN;
|
||||
vcpu->run->hw.hardware_exit_reason = exit_reason;
|
||||
WARN_ONCE(1, "vmx: unexpected exit reason 0x%x\n", exit_reason);
|
||||
kvm_queue_exception(vcpu, UD_VECTOR);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr)
|
||||
@@ -7949,7 +7952,7 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,
|
||||
|
||||
kvm_register_write(vcpu, VCPU_REGS_RSP, vmcs12->host_rsp);
|
||||
kvm_register_write(vcpu, VCPU_REGS_RIP, vmcs12->host_rip);
|
||||
vmx_set_rflags(vcpu, X86_EFLAGS_BIT1);
|
||||
vmx_set_rflags(vcpu, X86_EFLAGS_FIXED);
|
||||
/*
|
||||
* Note that calling vmx_set_cr0 is important, even if cr0 hasn't
|
||||
* actually changed, because it depends on the current state of
|
||||
|
||||
@@ -225,20 +225,25 @@ static void kvm_shared_msr_cpu_online(void)
|
||||
shared_msr_update(i, shared_msrs_global.msrs[i]);
|
||||
}
|
||||
|
||||
void kvm_set_shared_msr(unsigned slot, u64 value, u64 mask)
|
||||
int kvm_set_shared_msr(unsigned slot, u64 value, u64 mask)
|
||||
{
|
||||
unsigned int cpu = smp_processor_id();
|
||||
struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu);
|
||||
int err;
|
||||
|
||||
if (((value ^ smsr->values[slot].curr) & mask) == 0)
|
||||
return;
|
||||
return 0;
|
||||
smsr->values[slot].curr = value;
|
||||
wrmsrl(shared_msrs_global.msrs[slot], value);
|
||||
err = wrmsrl_safe(shared_msrs_global.msrs[slot], value);
|
||||
if (err)
|
||||
return 1;
|
||||
|
||||
if (!smsr->registered) {
|
||||
smsr->urn.on_user_return = kvm_on_user_return;
|
||||
user_return_notifier_register(&smsr->urn);
|
||||
smsr->registered = true;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_set_shared_msr);
|
||||
|
||||
@@ -920,7 +925,6 @@ void kvm_enable_efer_bits(u64 mask)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_enable_efer_bits);
|
||||
|
||||
|
||||
/*
|
||||
* Writes msr value into into the appropriate "register".
|
||||
* Returns 0 on success, non-0 otherwise.
|
||||
@@ -928,8 +932,34 @@ EXPORT_SYMBOL_GPL(kvm_enable_efer_bits);
|
||||
*/
|
||||
int kvm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
|
||||
{
|
||||
switch (msr->index) {
|
||||
case MSR_FS_BASE:
|
||||
case MSR_GS_BASE:
|
||||
case MSR_KERNEL_GS_BASE:
|
||||
case MSR_CSTAR:
|
||||
case MSR_LSTAR:
|
||||
if (is_noncanonical_address(msr->data))
|
||||
return 1;
|
||||
break;
|
||||
case MSR_IA32_SYSENTER_EIP:
|
||||
case MSR_IA32_SYSENTER_ESP:
|
||||
/*
|
||||
* IA32_SYSENTER_ESP and IA32_SYSENTER_EIP cause #GP if
|
||||
* non-canonical address is written on Intel but not on
|
||||
* AMD (which ignores the top 32-bits, because it does
|
||||
* not implement 64-bit SYSENTER).
|
||||
*
|
||||
* 64-bit code should hence be able to write a non-canonical
|
||||
* value on AMD. Making the address canonical ensures that
|
||||
* vmentry does not fail on Intel after writing a non-canonical
|
||||
* value, and that something deterministic happens if the guest
|
||||
* invokes 64-bit SYSENTER.
|
||||
*/
|
||||
msr->data = get_canonical(msr->data);
|
||||
}
|
||||
return kvm_x86_ops->set_msr(vcpu, msr);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_set_msr);
|
||||
|
||||
/*
|
||||
* Adapt set_msr() to msr_io()'s calling convention
|
||||
|
||||
@@ -389,7 +389,7 @@ phys_addr_t slow_virt_to_phys(void *__virt_addr)
|
||||
psize = page_level_size(level);
|
||||
pmask = page_level_mask(level);
|
||||
offset = virt_addr & ~pmask;
|
||||
phys_addr = pte_pfn(*pte) << PAGE_SHIFT;
|
||||
phys_addr = (phys_addr_t)pte_pfn(*pte) << PAGE_SHIFT;
|
||||
return (phys_addr | offset);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(slow_virt_to_phys);
|
||||
|
||||
@@ -553,7 +553,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
|
||||
bottom = max(b->physical_block_size, b->io_min) + alignment;
|
||||
|
||||
/* Verify that top and bottom intervals line up */
|
||||
if (max(top, bottom) & (min(top, bottom) - 1)) {
|
||||
if (max(top, bottom) % min(top, bottom)) {
|
||||
t->misaligned = 1;
|
||||
ret = -1;
|
||||
}
|
||||
@@ -594,7 +594,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
|
||||
|
||||
/* Find lowest common alignment_offset */
|
||||
t->alignment_offset = lcm(t->alignment_offset, alignment)
|
||||
& (max(t->physical_block_size, t->io_min) - 1);
|
||||
% max(t->physical_block_size, t->io_min);
|
||||
|
||||
/* Verify that new alignment_offset is on a logical block boundary */
|
||||
if (t->alignment_offset & (t->logical_block_size - 1)) {
|
||||
|
||||
@@ -506,7 +506,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
|
||||
|
||||
if (bytes && blk_rq_map_kern(q, rq, buffer, bytes, __GFP_WAIT)) {
|
||||
err = DRIVER_ERROR << 24;
|
||||
goto out;
|
||||
goto error;
|
||||
}
|
||||
|
||||
memset(sense, 0, sizeof(sense));
|
||||
@@ -516,7 +516,6 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
|
||||
|
||||
blk_execute_rq(q, disk, rq, 0);
|
||||
|
||||
out:
|
||||
err = rq->errors & 0xff; /* only 8 bit SCSI status */
|
||||
if (err) {
|
||||
if (rq->sense_len && rq->sense) {
|
||||
|
||||
@@ -49,7 +49,7 @@ struct skcipher_ctx {
|
||||
struct ablkcipher_request req;
|
||||
};
|
||||
|
||||
#define MAX_SGL_ENTS ((PAGE_SIZE - sizeof(struct skcipher_sg_list)) / \
|
||||
#define MAX_SGL_ENTS ((4096 - sizeof(struct skcipher_sg_list)) / \
|
||||
sizeof(struct scatterlist) - 1)
|
||||
|
||||
static inline int skcipher_sndbuf(struct sock *sk)
|
||||
|
||||
@@ -2008,13 +2008,15 @@ static int ata_bus_softreset(struct ata_port *ap, unsigned int devmask,
|
||||
|
||||
DPRINTK("ata%u: bus reset via SRST\n", ap->print_id);
|
||||
|
||||
/* software reset. causes dev0 to be selected */
|
||||
iowrite8(ap->ctl, ioaddr->ctl_addr);
|
||||
udelay(20); /* FIXME: flush */
|
||||
iowrite8(ap->ctl | ATA_SRST, ioaddr->ctl_addr);
|
||||
udelay(20); /* FIXME: flush */
|
||||
iowrite8(ap->ctl, ioaddr->ctl_addr);
|
||||
ap->last_ctl = ap->ctl;
|
||||
if (ap->ioaddr.ctl_addr) {
|
||||
/* software reset. causes dev0 to be selected */
|
||||
iowrite8(ap->ctl, ioaddr->ctl_addr);
|
||||
udelay(20); /* FIXME: flush */
|
||||
iowrite8(ap->ctl | ATA_SRST, ioaddr->ctl_addr);
|
||||
udelay(20); /* FIXME: flush */
|
||||
iowrite8(ap->ctl, ioaddr->ctl_addr);
|
||||
ap->last_ctl = ap->ctl;
|
||||
}
|
||||
|
||||
/* wait the port to become ready */
|
||||
return ata_sff_wait_after_reset(&ap->link, devmask, deadline);
|
||||
@@ -2215,10 +2217,6 @@ void ata_sff_error_handler(struct ata_port *ap)
|
||||
|
||||
spin_unlock_irqrestore(ap->lock, flags);
|
||||
|
||||
/* ignore ata_sff_softreset if ctl isn't accessible */
|
||||
if (softreset == ata_sff_softreset && !ap->ioaddr.ctl_addr)
|
||||
softreset = NULL;
|
||||
|
||||
/* ignore built-in hardresets if SCR access is not available */
|
||||
if ((hardreset == sata_std_hardreset ||
|
||||
hardreset == sata_sff_hardreset) && !sata_scr_valid(&ap->link))
|
||||
|
||||
@@ -252,12 +252,18 @@ static void serverworks_set_dmamode(struct ata_port *ap, struct ata_device *adev
|
||||
pci_write_config_byte(pdev, 0x54, ultra_cfg);
|
||||
}
|
||||
|
||||
static struct scsi_host_template serverworks_sht = {
|
||||
static struct scsi_host_template serverworks_osb4_sht = {
|
||||
ATA_BMDMA_SHT(DRV_NAME),
|
||||
.sg_tablesize = LIBATA_DUMB_MAX_PRD,
|
||||
};
|
||||
|
||||
static struct scsi_host_template serverworks_csb_sht = {
|
||||
ATA_BMDMA_SHT(DRV_NAME),
|
||||
};
|
||||
|
||||
static struct ata_port_operations serverworks_osb4_port_ops = {
|
||||
.inherits = &ata_bmdma_port_ops,
|
||||
.qc_prep = ata_bmdma_dumb_qc_prep,
|
||||
.cable_detect = serverworks_cable_detect,
|
||||
.mode_filter = serverworks_osb4_filter,
|
||||
.set_piomode = serverworks_set_piomode,
|
||||
@@ -266,6 +272,7 @@ static struct ata_port_operations serverworks_osb4_port_ops = {
|
||||
|
||||
static struct ata_port_operations serverworks_csb_port_ops = {
|
||||
.inherits = &serverworks_osb4_port_ops,
|
||||
.qc_prep = ata_bmdma_qc_prep,
|
||||
.mode_filter = serverworks_csb_filter,
|
||||
};
|
||||
|
||||
@@ -405,6 +412,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
|
||||
}
|
||||
};
|
||||
const struct ata_port_info *ppi[] = { &info[id->driver_data], NULL };
|
||||
struct scsi_host_template *sht = &serverworks_csb_sht;
|
||||
int rc;
|
||||
|
||||
rc = pcim_enable_device(pdev);
|
||||
@@ -418,6 +426,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
|
||||
/* Select non UDMA capable OSB4 if we can't do fixups */
|
||||
if (rc < 0)
|
||||
ppi[0] = &info[1];
|
||||
sht = &serverworks_osb4_sht;
|
||||
}
|
||||
/* setup CSB5/CSB6 : South Bridge and IDE option RAID */
|
||||
else if ((pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) ||
|
||||
@@ -434,7 +443,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
|
||||
ppi[1] = &ata_dummy_port_info;
|
||||
}
|
||||
|
||||
return ata_pci_bmdma_init_one(pdev, ppi, &serverworks_sht, NULL, 0);
|
||||
return ata_pci_bmdma_init_one(pdev, ppi, sht, NULL, 0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
@@ -766,12 +766,12 @@ class_dir_create_and_add(struct class *class, struct kobject *parent_kobj)
|
||||
return &dir->kobj;
|
||||
}
|
||||
|
||||
static DEFINE_MUTEX(gdp_mutex);
|
||||
|
||||
static struct kobject *get_device_parent(struct device *dev,
|
||||
struct device *parent)
|
||||
{
|
||||
if (dev->class) {
|
||||
static DEFINE_MUTEX(gdp_mutex);
|
||||
struct kobject *kobj = NULL;
|
||||
struct kobject *parent_kobj;
|
||||
struct kobject *k;
|
||||
@@ -835,7 +835,9 @@ static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
|
||||
glue_dir->kset != &dev->class->p->glue_dirs)
|
||||
return;
|
||||
|
||||
mutex_lock(&gdp_mutex);
|
||||
kobject_put(glue_dir);
|
||||
mutex_unlock(&gdp_mutex);
|
||||
}
|
||||
|
||||
static void cleanup_device_parent(struct device *dev)
|
||||
|
||||
@@ -79,6 +79,7 @@ bool
|
||||
drbd_insert_interval(struct rb_root *root, struct drbd_interval *this)
|
||||
{
|
||||
struct rb_node **new = &root->rb_node, *parent = NULL;
|
||||
sector_t this_end = this->sector + (this->size >> 9);
|
||||
|
||||
BUG_ON(!IS_ALIGNED(this->size, 512));
|
||||
|
||||
@@ -87,6 +88,8 @@ drbd_insert_interval(struct rb_root *root, struct drbd_interval *this)
|
||||
rb_entry(*new, struct drbd_interval, rb);
|
||||
|
||||
parent = *new;
|
||||
if (here->end < this_end)
|
||||
here->end = this_end;
|
||||
if (this->sector < here->sector)
|
||||
new = &(*new)->rb_left;
|
||||
else if (this->sector > here->sector)
|
||||
@@ -99,6 +102,7 @@ drbd_insert_interval(struct rb_root *root, struct drbd_interval *this)
|
||||
return false;
|
||||
}
|
||||
|
||||
this->end = this_end;
|
||||
rb_link_node(&this->rb, parent, new);
|
||||
rb_insert_augmented(&this->rb, root, &augment_callbacks);
|
||||
return true;
|
||||
|
||||
@@ -3227,7 +3227,7 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev,
|
||||
page_count = (u32) calc_pages_for(offset, length);
|
||||
pages = ceph_alloc_page_vector(page_count, GFP_KERNEL);
|
||||
if (IS_ERR(pages))
|
||||
ret = PTR_ERR(pages);
|
||||
return PTR_ERR(pages);
|
||||
|
||||
ret = -ENOMEM;
|
||||
obj_request = rbd_obj_request_create(object_name, offset, length,
|
||||
|
||||
@@ -933,8 +933,8 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
|
||||
* pool while mixing, and hash one final time.
|
||||
*/
|
||||
sha_transform(hash.w, extract, workspace);
|
||||
memset(extract, 0, sizeof(extract));
|
||||
memset(workspace, 0, sizeof(workspace));
|
||||
memzero_explicit(extract, sizeof(extract));
|
||||
memzero_explicit(workspace, sizeof(workspace));
|
||||
|
||||
/*
|
||||
* In case the hash function has some recognizable output
|
||||
@@ -957,7 +957,7 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
|
||||
}
|
||||
|
||||
memcpy(out, &hash, EXTRACT_SIZE);
|
||||
memset(&hash, 0, sizeof(hash));
|
||||
memzero_explicit(&hash, sizeof(hash));
|
||||
}
|
||||
|
||||
static ssize_t extract_entropy(struct entropy_store *r, void *buf,
|
||||
@@ -1005,7 +1005,7 @@ static ssize_t extract_entropy(struct entropy_store *r, void *buf,
|
||||
}
|
||||
|
||||
/* Wipe data just returned from memory */
|
||||
memset(tmp, 0, sizeof(tmp));
|
||||
memzero_explicit(tmp, sizeof(tmp));
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1043,7 +1043,7 @@ static ssize_t extract_entropy_user(struct entropy_store *r, void __user *buf,
|
||||
}
|
||||
|
||||
/* Wipe data just returned from memory */
|
||||
memset(tmp, 0, sizeof(tmp));
|
||||
memzero_explicit(tmp, sizeof(tmp));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -599,6 +599,7 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
|
||||
if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) {
|
||||
limits.min_perf_pct = 100;
|
||||
limits.min_perf = int_tofp(1);
|
||||
limits.max_policy_pct = 100;
|
||||
limits.max_perf_pct = 100;
|
||||
limits.max_perf = int_tofp(1);
|
||||
limits.no_turbo = 0;
|
||||
|
||||
@@ -562,7 +562,7 @@ static void cpc925_mc_check(struct mem_ctl_info *mci)
|
||||
|
||||
if (apiexcp & UECC_EXCP_DETECTED) {
|
||||
cpc925_mc_printk(mci, KERN_INFO, "DRAM UECC Fault\n");
|
||||
edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, 1,
|
||||
edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1,
|
||||
pfn, offset, 0,
|
||||
csrow, -1, -1,
|
||||
mci->ctl_name, "");
|
||||
|
||||
@@ -226,7 +226,7 @@ static void process_ce(struct mem_ctl_info *mci, struct e7xxx_error_info *info)
|
||||
static void process_ce_no_info(struct mem_ctl_info *mci)
|
||||
{
|
||||
edac_dbg(3, "\n");
|
||||
edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1, 0, 0, 0, -1, -1, -1,
|
||||
edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, 1, 0, 0, 0, -1, -1, -1,
|
||||
"e7xxx CE log register overflow", "");
|
||||
}
|
||||
|
||||
|
||||
@@ -242,11 +242,11 @@ static void i3200_process_error_info(struct mem_ctl_info *mci,
|
||||
-1, -1,
|
||||
"i3000 UE", "");
|
||||
} else if (log & I3200_ECCERRLOG_CE) {
|
||||
edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1,
|
||||
edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, 1,
|
||||
0, 0, eccerrlog_syndrome(log),
|
||||
eccerrlog_row(channel, log),
|
||||
-1, -1,
|
||||
"i3000 UE", "");
|
||||
"i3000 CE", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ static int i82860_process_error_info(struct mem_ctl_info *mci,
|
||||
dimm->location[0], dimm->location[1], -1,
|
||||
"i82860 UE", "");
|
||||
else
|
||||
edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1,
|
||||
edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, 1,
|
||||
info->eap, 0, info->derrsyn,
|
||||
dimm->location[0], dimm->location[1], -1,
|
||||
"i82860 CE", "");
|
||||
|
||||
@@ -1012,8 +1012,8 @@ static u32 copy_cursor_image(u8 *src, u8 *dst, int width, int height)
|
||||
srcdata32[1].ul = *((u32 *)(srcxor + 4)) & 0xf0f0f0f0;
|
||||
data32.b[0] = srcdata32[0].b[1] | (srcdata32[0].b[0] >> 4);
|
||||
data32.b[1] = srcdata32[0].b[3] | (srcdata32[0].b[2] >> 4);
|
||||
data32.b[2] = srcdata32[0].b[1] | (srcdata32[1].b[0] >> 4);
|
||||
data32.b[3] = srcdata32[0].b[3] | (srcdata32[1].b[2] >> 4);
|
||||
data32.b[2] = srcdata32[1].b[1] | (srcdata32[1].b[0] >> 4);
|
||||
data32.b[3] = srcdata32[1].b[3] | (srcdata32[1].b[2] >> 4);
|
||||
|
||||
writel(data32.ul, dstxor);
|
||||
csum += data32.ul;
|
||||
|
||||
@@ -124,6 +124,7 @@ dcb_outp_parse(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len,
|
||||
struct dcb_output *outp)
|
||||
{
|
||||
u16 dcb = dcb_outp(bios, idx, ver, len);
|
||||
memset(outp, 0x00, sizeof(*outp));
|
||||
if (dcb) {
|
||||
if (*ver >= 0x20) {
|
||||
u32 conn = nv_ro32(bios, dcb + 0x00);
|
||||
|
||||
@@ -78,6 +78,7 @@ static int modeset_init(struct drm_device *dev)
|
||||
if ((priv->num_encoders == 0) || (priv->num_connectors == 0)) {
|
||||
/* oh nos! */
|
||||
dev_err(dev->dev, "no encoders/connectors found\n");
|
||||
drm_mode_config_cleanup(dev);
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
@@ -170,33 +171,37 @@ static int tilcdc_load(struct drm_device *dev, unsigned long flags)
|
||||
dev->dev_private = priv;
|
||||
|
||||
priv->wq = alloc_ordered_workqueue("tilcdc", 0);
|
||||
if (!priv->wq) {
|
||||
ret = -ENOMEM;
|
||||
goto fail_free_priv;
|
||||
}
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!res) {
|
||||
dev_err(dev->dev, "failed to get memory resource\n");
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
goto fail_free_wq;
|
||||
}
|
||||
|
||||
priv->mmio = ioremap_nocache(res->start, resource_size(res));
|
||||
if (!priv->mmio) {
|
||||
dev_err(dev->dev, "failed to ioremap\n");
|
||||
ret = -ENOMEM;
|
||||
goto fail;
|
||||
goto fail_free_wq;
|
||||
}
|
||||
|
||||
priv->clk = clk_get(dev->dev, "fck");
|
||||
if (IS_ERR(priv->clk)) {
|
||||
dev_err(dev->dev, "failed to get functional clock\n");
|
||||
ret = -ENODEV;
|
||||
goto fail;
|
||||
goto fail_iounmap;
|
||||
}
|
||||
|
||||
priv->disp_clk = clk_get(dev->dev, "dpll_disp_ck");
|
||||
if (IS_ERR(priv->clk)) {
|
||||
dev_err(dev->dev, "failed to get display clock\n");
|
||||
ret = -ENODEV;
|
||||
goto fail;
|
||||
goto fail_put_clk;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CPU_FREQ
|
||||
@@ -206,7 +211,7 @@ static int tilcdc_load(struct drm_device *dev, unsigned long flags)
|
||||
CPUFREQ_TRANSITION_NOTIFIER);
|
||||
if (ret) {
|
||||
dev_err(dev->dev, "failed to register cpufreq notifier\n");
|
||||
goto fail;
|
||||
goto fail_put_disp_clk;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -238,13 +243,13 @@ static int tilcdc_load(struct drm_device *dev, unsigned long flags)
|
||||
ret = modeset_init(dev);
|
||||
if (ret < 0) {
|
||||
dev_err(dev->dev, "failed to initialize mode setting\n");
|
||||
goto fail;
|
||||
goto fail_cpufreq_unregister;
|
||||
}
|
||||
|
||||
ret = drm_vblank_init(dev, 1);
|
||||
if (ret < 0) {
|
||||
dev_err(dev->dev, "failed to initialize vblank\n");
|
||||
goto fail;
|
||||
goto fail_mode_config_cleanup;
|
||||
}
|
||||
|
||||
pm_runtime_get_sync(dev->dev);
|
||||
@@ -252,7 +257,7 @@ static int tilcdc_load(struct drm_device *dev, unsigned long flags)
|
||||
pm_runtime_put_sync(dev->dev);
|
||||
if (ret < 0) {
|
||||
dev_err(dev->dev, "failed to install IRQ handler\n");
|
||||
goto fail;
|
||||
goto fail_vblank_cleanup;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, dev);
|
||||
@@ -260,13 +265,48 @@ static int tilcdc_load(struct drm_device *dev, unsigned long flags)
|
||||
priv->fbdev = drm_fbdev_cma_init(dev, 16,
|
||||
dev->mode_config.num_crtc,
|
||||
dev->mode_config.num_connector);
|
||||
if (IS_ERR(priv->fbdev)) {
|
||||
ret = PTR_ERR(priv->fbdev);
|
||||
goto fail_irq_uninstall;
|
||||
}
|
||||
|
||||
drm_kms_helper_poll_init(dev);
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
tilcdc_unload(dev);
|
||||
fail_irq_uninstall:
|
||||
pm_runtime_get_sync(dev->dev);
|
||||
drm_irq_uninstall(dev);
|
||||
pm_runtime_put_sync(dev->dev);
|
||||
|
||||
fail_vblank_cleanup:
|
||||
drm_vblank_cleanup(dev);
|
||||
|
||||
fail_mode_config_cleanup:
|
||||
drm_mode_config_cleanup(dev);
|
||||
|
||||
fail_cpufreq_unregister:
|
||||
pm_runtime_disable(dev->dev);
|
||||
#ifdef CONFIG_CPU_FREQ
|
||||
cpufreq_unregister_notifier(&priv->freq_transition,
|
||||
CPUFREQ_TRANSITION_NOTIFIER);
|
||||
fail_put_disp_clk:
|
||||
clk_put(priv->disp_clk);
|
||||
#endif
|
||||
|
||||
fail_put_clk:
|
||||
clk_put(priv->clk);
|
||||
|
||||
fail_iounmap:
|
||||
iounmap(priv->mmio);
|
||||
|
||||
fail_free_wq:
|
||||
flush_workqueue(priv->wq);
|
||||
destroy_workqueue(priv->wq);
|
||||
|
||||
fail_free_priv:
|
||||
dev->dev_private = NULL;
|
||||
kfree(priv);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -435,7 +435,7 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev)
|
||||
}
|
||||
}
|
||||
|
||||
ret = wait_for_completion_io_timeout(&dev->cmd_complete,
|
||||
ret = wait_for_completion_timeout(&dev->cmd_complete,
|
||||
dev->adapter.timeout);
|
||||
if (ret == 0) {
|
||||
dev_err(dev->dev, "controller timed out\n");
|
||||
|
||||
@@ -99,6 +99,12 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
|
||||
DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "X750LN"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
|
||||
@@ -608,6 +614,22 @@ static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Fujitsu A544 laptop */
|
||||
/* https://bugzilla.redhat.com/show_bug.cgi?id=1111138 */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK A544"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Fujitsu AH544 laptop */
|
||||
/* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK AH544"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Fujitsu U574 laptop */
|
||||
/* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
|
||||
|
||||
@@ -700,7 +700,7 @@ void lguest_arch_setup_regs(struct lg_cpu *cpu, unsigned long start)
|
||||
* interrupts are enabled. We always leave interrupts enabled while
|
||||
* running the Guest.
|
||||
*/
|
||||
regs->eflags = X86_EFLAGS_IF | X86_EFLAGS_BIT1;
|
||||
regs->eflags = X86_EFLAGS_IF | X86_EFLAGS_FIXED;
|
||||
|
||||
/*
|
||||
* The "Extended Instruction Pointer" register says where the Guest is
|
||||
|
||||
@@ -462,6 +462,7 @@ static void __relink_lru(struct dm_buffer *b, int dirty)
|
||||
c->n_buffers[dirty]++;
|
||||
b->list_mode = dirty;
|
||||
list_move(&b->lru_list, &c->lru[dirty]);
|
||||
b->last_accessed = jiffies;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
|
||||
@@ -272,7 +272,7 @@ int dm_ulog_tfr_init(void)
|
||||
|
||||
r = cn_add_callback(&ulog_cn_id, "dmlogusr", cn_ulog_callback);
|
||||
if (r) {
|
||||
cn_del_callback(&ulog_cn_id);
|
||||
kfree(prealloced_cn_msg);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
@@ -864,6 +864,13 @@ struct dvb_frontend *ds3000_attach(const struct ds3000_config *config,
|
||||
memcpy(&state->frontend.ops, &ds3000_ops,
|
||||
sizeof(struct dvb_frontend_ops));
|
||||
state->frontend.demodulator_priv = state;
|
||||
|
||||
/*
|
||||
* Some devices like T480 starts with voltage on. Be sure
|
||||
* to turn voltage off during init, as this can otherwise
|
||||
* interfere with Unicable SCR systems.
|
||||
*/
|
||||
ds3000_set_voltage(&state->frontend, SEC_VOLTAGE_OFF);
|
||||
return &state->frontend;
|
||||
|
||||
error3:
|
||||
|
||||
@@ -293,7 +293,7 @@ static int tda7432_s_ctrl(struct v4l2_ctrl *ctrl)
|
||||
if (t->mute->val) {
|
||||
lf |= TDA7432_MUTE;
|
||||
lr |= TDA7432_MUTE;
|
||||
lf |= TDA7432_MUTE;
|
||||
rf |= TDA7432_MUTE;
|
||||
rr |= TDA7432_MUTE;
|
||||
}
|
||||
/* Mute & update balance*/
|
||||
|
||||
@@ -696,13 +696,16 @@ static int em28xx_stop_streaming(struct vb2_queue *vq)
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&dev->slock, flags);
|
||||
if (dev->usb_ctl.vid_buf != NULL) {
|
||||
vb2_buffer_done(&dev->usb_ctl.vid_buf->vb, VB2_BUF_STATE_ERROR);
|
||||
dev->usb_ctl.vid_buf = NULL;
|
||||
}
|
||||
while (!list_empty(&vidq->active)) {
|
||||
struct em28xx_buffer *buf;
|
||||
buf = list_entry(vidq->active.next, struct em28xx_buffer, list);
|
||||
list_del(&buf->list);
|
||||
vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
|
||||
}
|
||||
dev->usb_ctl.vid_buf = NULL;
|
||||
spin_unlock_irqrestore(&dev->slock, flags);
|
||||
|
||||
return 0;
|
||||
@@ -724,13 +727,16 @@ int em28xx_stop_vbi_streaming(struct vb2_queue *vq)
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&dev->slock, flags);
|
||||
if (dev->usb_ctl.vbi_buf != NULL) {
|
||||
vb2_buffer_done(&dev->usb_ctl.vbi_buf->vb, VB2_BUF_STATE_ERROR);
|
||||
dev->usb_ctl.vbi_buf = NULL;
|
||||
}
|
||||
while (!list_empty(&vbiq->active)) {
|
||||
struct em28xx_buffer *buf;
|
||||
buf = list_entry(vbiq->active.next, struct em28xx_buffer, list);
|
||||
list_del(&buf->list);
|
||||
vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
|
||||
}
|
||||
dev->usb_ctl.vbi_buf = NULL;
|
||||
spin_unlock_irqrestore(&dev->slock, flags);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -485,16 +485,13 @@ static unsigned int clamp_align(unsigned int x, unsigned int min,
|
||||
/* Bits that must be zero to be aligned */
|
||||
unsigned int mask = ~((1 << align) - 1);
|
||||
|
||||
/* Clamp to aligned min and max */
|
||||
x = clamp(x, (min + ~mask) & mask, max & mask);
|
||||
|
||||
/* Round to nearest aligned value */
|
||||
if (align)
|
||||
x = (x + (1 << (align - 1))) & mask;
|
||||
|
||||
/* Clamp to aligned value of min and max */
|
||||
if (x < min)
|
||||
x = (min + ~mask) & mask;
|
||||
else if (x > max)
|
||||
x = max & mask;
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
@@ -1137,7 +1137,7 @@ static int rtsx_pci_probe(struct pci_dev *pcidev,
|
||||
pcr->msi_en = msi_en;
|
||||
if (pcr->msi_en) {
|
||||
ret = pci_enable_msi(pcidev);
|
||||
if (ret < 0)
|
||||
if (ret)
|
||||
pcr->msi_en = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -341,6 +341,13 @@ static void sd_send_cmd_get_rsp(struct realtek_pci_sdmmc *host,
|
||||
}
|
||||
|
||||
if (rsp_type == SD_RSP_TYPE_R2) {
|
||||
/*
|
||||
* The controller offloads the last byte {CRC-7, end bit 1'b1}
|
||||
* of response type R2. Assign dummy CRC, 0, and end bit to the
|
||||
* byte(ptr[16], goes into the LSB of resp[3] later).
|
||||
*/
|
||||
ptr[16] = 1;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
cmd->resp[i] = get_unaligned_be32(ptr + 1 + i * 4);
|
||||
dev_dbg(sdmmc_dev(host), "cmd->resp[%d] = 0x%08x\n",
|
||||
|
||||
@@ -330,6 +330,7 @@ static int process_pool_aeb(struct ubi_device *ubi, struct ubi_attach_info *ai,
|
||||
av = tmp_av;
|
||||
else {
|
||||
ubi_err("orphaned volume in fastmap pool!");
|
||||
kmem_cache_free(ai->aeb_slab_cache, new_aeb);
|
||||
return UBI_BAD_FASTMAP;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,6 +139,7 @@ config MACVLAN
|
||||
config MACVTAP
|
||||
tristate "MAC-VLAN based tap driver"
|
||||
depends on MACVLAN
|
||||
depends on INET
|
||||
help
|
||||
This adds a specialized tap character device driver that is based
|
||||
on the MAC-VLAN network interface, called macvtap. A macvtap device
|
||||
@@ -209,6 +210,7 @@ config RIONET_RX_SIZE
|
||||
|
||||
config TUN
|
||||
tristate "Universal TUN/TAP device driver support"
|
||||
depends on INET
|
||||
select CRC32
|
||||
---help---
|
||||
TUN/TAP provides packet reception and transmission for user space
|
||||
|
||||
@@ -601,7 +601,7 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
if (file == ppp->owner)
|
||||
ppp_shutdown_interface(ppp);
|
||||
}
|
||||
if (atomic_long_read(&file->f_count) <= 2) {
|
||||
if (atomic_long_read(&file->f_count) < 2) {
|
||||
ppp_release(NULL, file);
|
||||
err = 0;
|
||||
} else
|
||||
|
||||
@@ -695,6 +695,7 @@ static int ax88179_set_mac_addr(struct net_device *net, void *p)
|
||||
{
|
||||
struct usbnet *dev = netdev_priv(net);
|
||||
struct sockaddr *addr = p;
|
||||
int ret;
|
||||
|
||||
if (netif_running(net))
|
||||
return -EBUSY;
|
||||
@@ -704,8 +705,12 @@ static int ax88179_set_mac_addr(struct net_device *net, void *p)
|
||||
memcpy(net->dev_addr, addr->sa_data, ETH_ALEN);
|
||||
|
||||
/* Set the MAC address */
|
||||
return ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN,
|
||||
ret = ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN,
|
||||
ETH_ALEN, net->dev_addr);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct net_device_ops ax88179_netdev_ops = {
|
||||
|
||||
@@ -1091,6 +1091,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
|
||||
/* Ovislink */
|
||||
{ USB_DEVICE(0x1b75, 0x3071) },
|
||||
{ USB_DEVICE(0x1b75, 0x3072) },
|
||||
{ USB_DEVICE(0x1b75, 0xa200) },
|
||||
/* Para */
|
||||
{ USB_DEVICE(0x20b8, 0x8888) },
|
||||
/* Pegatron */
|
||||
|
||||
@@ -962,52 +962,6 @@ int of_property_read_string(struct device_node *np, const char *propname,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(of_property_read_string);
|
||||
|
||||
/**
|
||||
* of_property_read_string_index - Find and read a string from a multiple
|
||||
* strings property.
|
||||
* @np: device node from which the property value is to be read.
|
||||
* @propname: name of the property to be searched.
|
||||
* @index: index of the string in the list of strings
|
||||
* @out_string: pointer to null terminated return string, modified only if
|
||||
* return value is 0.
|
||||
*
|
||||
* Search for a property in a device tree node and retrieve a null
|
||||
* terminated string value (pointer to data, not a copy) in the list of strings
|
||||
* contained in that property.
|
||||
* Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if
|
||||
* property does not have a value, and -EILSEQ if the string is not
|
||||
* null-terminated within the length of the property data.
|
||||
*
|
||||
* The out_string pointer is modified only if a valid string can be decoded.
|
||||
*/
|
||||
int of_property_read_string_index(struct device_node *np, const char *propname,
|
||||
int index, const char **output)
|
||||
{
|
||||
struct property *prop = of_find_property(np, propname, NULL);
|
||||
int i = 0;
|
||||
size_t l = 0, total = 0;
|
||||
const char *p;
|
||||
|
||||
if (!prop)
|
||||
return -EINVAL;
|
||||
if (!prop->value)
|
||||
return -ENODATA;
|
||||
if (strnlen(prop->value, prop->length) >= prop->length)
|
||||
return -EILSEQ;
|
||||
|
||||
p = prop->value;
|
||||
|
||||
for (i = 0; total < prop->length; total += l, p += l) {
|
||||
l = strlen(p) + 1;
|
||||
if (i++ == index) {
|
||||
*output = p;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return -ENODATA;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(of_property_read_string_index);
|
||||
|
||||
/**
|
||||
* of_property_match_string() - Find string in a list and return index
|
||||
* @np: pointer to node containing string list property
|
||||
@@ -1034,7 +988,7 @@ int of_property_match_string(struct device_node *np, const char *propname,
|
||||
end = p + prop->length;
|
||||
|
||||
for (i = 0; p < end; i++, p += l) {
|
||||
l = strlen(p) + 1;
|
||||
l = strnlen(p, end - p) + 1;
|
||||
if (p + l > end)
|
||||
return -EILSEQ;
|
||||
pr_debug("comparing %s with %s\n", string, p);
|
||||
@@ -1046,39 +1000,41 @@ int of_property_match_string(struct device_node *np, const char *propname,
|
||||
EXPORT_SYMBOL_GPL(of_property_match_string);
|
||||
|
||||
/**
|
||||
* of_property_count_strings - Find and return the number of strings from a
|
||||
* multiple strings property.
|
||||
* of_property_read_string_util() - Utility helper for parsing string properties
|
||||
* @np: device node from which the property value is to be read.
|
||||
* @propname: name of the property to be searched.
|
||||
* @out_strs: output array of string pointers.
|
||||
* @sz: number of array elements to read.
|
||||
* @skip: Number of strings to skip over at beginning of list.
|
||||
*
|
||||
* Search for a property in a device tree node and retrieve the number of null
|
||||
* terminated string contain in it. Returns the number of strings on
|
||||
* success, -EINVAL if the property does not exist, -ENODATA if property
|
||||
* does not have a value, and -EILSEQ if the string is not null-terminated
|
||||
* within the length of the property data.
|
||||
* Don't call this function directly. It is a utility helper for the
|
||||
* of_property_read_string*() family of functions.
|
||||
*/
|
||||
int of_property_count_strings(struct device_node *np, const char *propname)
|
||||
int of_property_read_string_helper(struct device_node *np, const char *propname,
|
||||
const char **out_strs, size_t sz, int skip)
|
||||
{
|
||||
struct property *prop = of_find_property(np, propname, NULL);
|
||||
int i = 0;
|
||||
size_t l = 0, total = 0;
|
||||
const char *p;
|
||||
int l = 0, i = 0;
|
||||
const char *p, *end;
|
||||
|
||||
if (!prop)
|
||||
return -EINVAL;
|
||||
if (!prop->value)
|
||||
return -ENODATA;
|
||||
if (strnlen(prop->value, prop->length) >= prop->length)
|
||||
return -EILSEQ;
|
||||
|
||||
p = prop->value;
|
||||
end = p + prop->length;
|
||||
|
||||
for (i = 0; total < prop->length; total += l, p += l, i++)
|
||||
l = strlen(p) + 1;
|
||||
|
||||
return i;
|
||||
for (i = 0; p < end && (!out_strs || i < skip + sz); i++, p += l) {
|
||||
l = strnlen(p, end - p) + 1;
|
||||
if (p + l > end)
|
||||
return -EILSEQ;
|
||||
if (out_strs && i >= skip)
|
||||
*out_strs++ = p;
|
||||
}
|
||||
i -= skip;
|
||||
return i <= 0 ? -ENODATA : i;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(of_property_count_strings);
|
||||
EXPORT_SYMBOL_GPL(of_property_read_string_helper);
|
||||
|
||||
/**
|
||||
* of_parse_phandle - Resolve a phandle property to a device_node pointer
|
||||
|
||||
@@ -126,8 +126,9 @@ static void __init of_selftest_parse_phandle_with_args(void)
|
||||
selftest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
|
||||
}
|
||||
|
||||
static void __init of_selftest_property_match_string(void)
|
||||
static void __init of_selftest_property_string(void)
|
||||
{
|
||||
const char *strings[4];
|
||||
struct device_node *np;
|
||||
int rc;
|
||||
|
||||
@@ -145,13 +146,66 @@ static void __init of_selftest_property_match_string(void)
|
||||
rc = of_property_match_string(np, "phandle-list-names", "third");
|
||||
selftest(rc == 2, "third expected:0 got:%i\n", rc);
|
||||
rc = of_property_match_string(np, "phandle-list-names", "fourth");
|
||||
selftest(rc == -ENODATA, "unmatched string; rc=%i", rc);
|
||||
selftest(rc == -ENODATA, "unmatched string; rc=%i\n", rc);
|
||||
rc = of_property_match_string(np, "missing-property", "blah");
|
||||
selftest(rc == -EINVAL, "missing property; rc=%i", rc);
|
||||
selftest(rc == -EINVAL, "missing property; rc=%i\n", rc);
|
||||
rc = of_property_match_string(np, "empty-property", "blah");
|
||||
selftest(rc == -ENODATA, "empty property; rc=%i", rc);
|
||||
selftest(rc == -ENODATA, "empty property; rc=%i\n", rc);
|
||||
rc = of_property_match_string(np, "unterminated-string", "blah");
|
||||
selftest(rc == -EILSEQ, "unterminated string; rc=%i", rc);
|
||||
selftest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc);
|
||||
|
||||
/* of_property_count_strings() tests */
|
||||
rc = of_property_count_strings(np, "string-property");
|
||||
selftest(rc == 1, "Incorrect string count; rc=%i\n", rc);
|
||||
rc = of_property_count_strings(np, "phandle-list-names");
|
||||
selftest(rc == 3, "Incorrect string count; rc=%i\n", rc);
|
||||
rc = of_property_count_strings(np, "unterminated-string");
|
||||
selftest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc);
|
||||
rc = of_property_count_strings(np, "unterminated-string-list");
|
||||
selftest(rc == -EILSEQ, "unterminated string array; rc=%i\n", rc);
|
||||
|
||||
/* of_property_read_string_index() tests */
|
||||
rc = of_property_read_string_index(np, "string-property", 0, strings);
|
||||
selftest(rc == 0 && !strcmp(strings[0], "foobar"), "of_property_read_string_index() failure; rc=%i\n", rc);
|
||||
strings[0] = NULL;
|
||||
rc = of_property_read_string_index(np, "string-property", 1, strings);
|
||||
selftest(rc == -ENODATA && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
|
||||
rc = of_property_read_string_index(np, "phandle-list-names", 0, strings);
|
||||
selftest(rc == 0 && !strcmp(strings[0], "first"), "of_property_read_string_index() failure; rc=%i\n", rc);
|
||||
rc = of_property_read_string_index(np, "phandle-list-names", 1, strings);
|
||||
selftest(rc == 0 && !strcmp(strings[0], "second"), "of_property_read_string_index() failure; rc=%i\n", rc);
|
||||
rc = of_property_read_string_index(np, "phandle-list-names", 2, strings);
|
||||
selftest(rc == 0 && !strcmp(strings[0], "third"), "of_property_read_string_index() failure; rc=%i\n", rc);
|
||||
strings[0] = NULL;
|
||||
rc = of_property_read_string_index(np, "phandle-list-names", 3, strings);
|
||||
selftest(rc == -ENODATA && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
|
||||
strings[0] = NULL;
|
||||
rc = of_property_read_string_index(np, "unterminated-string", 0, strings);
|
||||
selftest(rc == -EILSEQ && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
|
||||
rc = of_property_read_string_index(np, "unterminated-string-list", 0, strings);
|
||||
selftest(rc == 0 && !strcmp(strings[0], "first"), "of_property_read_string_index() failure; rc=%i\n", rc);
|
||||
strings[0] = NULL;
|
||||
rc = of_property_read_string_index(np, "unterminated-string-list", 2, strings); /* should fail */
|
||||
selftest(rc == -EILSEQ && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
|
||||
strings[1] = NULL;
|
||||
|
||||
/* of_property_read_string_array() tests */
|
||||
rc = of_property_read_string_array(np, "string-property", strings, 4);
|
||||
selftest(rc == 1, "Incorrect string count; rc=%i\n", rc);
|
||||
rc = of_property_read_string_array(np, "phandle-list-names", strings, 4);
|
||||
selftest(rc == 3, "Incorrect string count; rc=%i\n", rc);
|
||||
rc = of_property_read_string_array(np, "unterminated-string", strings, 4);
|
||||
selftest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc);
|
||||
/* -- An incorrectly formed string should cause a failure */
|
||||
rc = of_property_read_string_array(np, "unterminated-string-list", strings, 4);
|
||||
selftest(rc == -EILSEQ, "unterminated string array; rc=%i\n", rc);
|
||||
/* -- parsing the correctly formed strings should still work: */
|
||||
strings[2] = NULL;
|
||||
rc = of_property_read_string_array(np, "unterminated-string-list", strings, 2);
|
||||
selftest(rc == 2 && strings[2] == NULL, "of_property_read_string_array() failure; rc=%i\n", rc);
|
||||
strings[1] = NULL;
|
||||
rc = of_property_read_string_array(np, "phandle-list-names", strings, 1);
|
||||
selftest(rc == 1 && strings[1] == NULL, "Overwrote end of string array; rc=%i, str='%s'\n", rc, strings[1]);
|
||||
}
|
||||
|
||||
static int __init of_selftest(void)
|
||||
@@ -167,7 +221,7 @@ static int __init of_selftest(void)
|
||||
|
||||
pr_info("start of selftest - you will see error messages\n");
|
||||
of_selftest_parse_phandle_with_args();
|
||||
of_selftest_property_match_string();
|
||||
of_selftest_property_string();
|
||||
pr_info("end of selftest - %s\n", selftest_passed ? "PASS" : "FAIL");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -572,6 +572,17 @@ static const struct dmi_system_id video_vendor_dmi_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5750"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/*
|
||||
* Note no video_set_backlight_video_vendor, we must use the
|
||||
* acer interface, as there is no native backlight interface.
|
||||
*/
|
||||
.ident = "Acer KAV80",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "KAV80"),
|
||||
},
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -762,7 +762,16 @@ static void tcm_qla2xxx_clear_nacl_from_fcport_map(struct qla_tgt_sess *sess)
|
||||
pr_debug("fc_rport domain: port_id 0x%06x\n", nacl->nport_id);
|
||||
|
||||
node = btree_remove32(&lport->lport_fcport_map, nacl->nport_id);
|
||||
WARN_ON(node && (node != se_nacl));
|
||||
if (WARN_ON(node && (node != se_nacl))) {
|
||||
/*
|
||||
* The nacl no longer matches what we think it should be.
|
||||
* Most likely a new dynamic acl has been added while
|
||||
* someone dropped the hardware lock. It clearly is a
|
||||
* bug elsewhere, but this bit can't make things worse.
|
||||
*/
|
||||
btree_insert32(&lport->lport_fcport_map, nacl->nport_id,
|
||||
node, GFP_ATOMIC);
|
||||
}
|
||||
|
||||
pr_debug("Removed from fcport_map: %p for WWNN: 0x%016LX, port_id: 0x%06x\n",
|
||||
se_nacl, nacl->nport_wwnn, nacl->nport_id);
|
||||
|
||||
@@ -1080,7 +1080,7 @@ err_rxdesc:
|
||||
pl022->sgt_tx.nents, DMA_TO_DEVICE);
|
||||
err_tx_sgmap:
|
||||
dma_unmap_sg(rxchan->device->dev, pl022->sgt_rx.sgl,
|
||||
pl022->sgt_tx.nents, DMA_FROM_DEVICE);
|
||||
pl022->sgt_rx.nents, DMA_FROM_DEVICE);
|
||||
err_rx_sgmap:
|
||||
sg_free_table(&pl022->sgt_tx);
|
||||
err_alloc_tx_sg:
|
||||
|
||||
@@ -1324,7 +1324,9 @@ static int pxa2xx_spi_suspend(struct device *dev)
|
||||
if (status != 0)
|
||||
return status;
|
||||
write_SSCR0(0, drv_data->ioaddr);
|
||||
clk_disable_unprepare(ssp->clk);
|
||||
|
||||
if (!pm_runtime_suspended(dev))
|
||||
clk_disable_unprepare(ssp->clk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1338,7 +1340,8 @@ static int pxa2xx_spi_resume(struct device *dev)
|
||||
pxa2xx_spi_dma_resume(drv_data);
|
||||
|
||||
/* Enable the SSP clock */
|
||||
clk_prepare_enable(ssp->clk);
|
||||
if (!pm_runtime_suspended(dev))
|
||||
clk_prepare_enable(ssp->clk);
|
||||
|
||||
/* Start the queue running */
|
||||
status = spi_master_resume(drv_data->master);
|
||||
|
||||
@@ -115,6 +115,7 @@ static const struct iio_chan_spec ad5933_channels[] = {
|
||||
.channel = 0,
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED),
|
||||
.address = AD5933_REG_TEMP_DATA,
|
||||
.scan_index = -1,
|
||||
.scan_type = {
|
||||
.sign = 's',
|
||||
.realbits = 14,
|
||||
@@ -124,9 +125,7 @@ static const struct iio_chan_spec ad5933_channels[] = {
|
||||
.type = IIO_VOLTAGE,
|
||||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.extend_name = "real_raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
|
||||
BIT(IIO_CHAN_INFO_SCALE),
|
||||
.extend_name = "real",
|
||||
.address = AD5933_REG_REAL_DATA,
|
||||
.scan_index = 0,
|
||||
.scan_type = {
|
||||
@@ -138,9 +137,7 @@ static const struct iio_chan_spec ad5933_channels[] = {
|
||||
.type = IIO_VOLTAGE,
|
||||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.extend_name = "imag_raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
|
||||
BIT(IIO_CHAN_INFO_SCALE),
|
||||
.extend_name = "imag",
|
||||
.address = AD5933_REG_IMAG_DATA,
|
||||
.scan_index = 1,
|
||||
.scan_type = {
|
||||
@@ -746,14 +743,14 @@ static int ad5933_probe(struct i2c_client *client,
|
||||
indio_dev->name = id->name;
|
||||
indio_dev->modes = INDIO_DIRECT_MODE;
|
||||
indio_dev->channels = ad5933_channels;
|
||||
indio_dev->num_channels = 1; /* only register temp0_input */
|
||||
indio_dev->num_channels = ARRAY_SIZE(ad5933_channels);
|
||||
|
||||
ret = ad5933_register_ring_funcs_and_init(indio_dev);
|
||||
if (ret)
|
||||
goto error_disable_reg;
|
||||
|
||||
/* skip temp0_input, register in0_(real|imag)_raw */
|
||||
ret = iio_buffer_register(indio_dev, &ad5933_channels[1], 2);
|
||||
ret = iio_buffer_register(indio_dev, ad5933_channels,
|
||||
ARRAY_SIZE(ad5933_channels));
|
||||
if (ret)
|
||||
goto error_unreg_ring;
|
||||
|
||||
|
||||
@@ -119,7 +119,6 @@ struct ade7758_state {
|
||||
u8 *tx;
|
||||
u8 *rx;
|
||||
struct mutex buf_lock;
|
||||
const struct iio_chan_spec *ade7758_ring_channels;
|
||||
struct spi_transfer ring_xfer[4];
|
||||
struct spi_message ring_msg;
|
||||
/*
|
||||
|
||||
@@ -648,9 +648,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_VOLTAGE,
|
||||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.extend_name = "raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.address = AD7758_WT(AD7758_PHASE_A, AD7758_VOLTAGE),
|
||||
.scan_index = 0,
|
||||
.scan_type = {
|
||||
@@ -662,9 +659,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_CURRENT,
|
||||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.extend_name = "raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.address = AD7758_WT(AD7758_PHASE_A, AD7758_CURRENT),
|
||||
.scan_index = 1,
|
||||
.scan_type = {
|
||||
@@ -676,9 +670,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_POWER,
|
||||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.extend_name = "apparent_raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.extend_name = "apparent",
|
||||
.address = AD7758_WT(AD7758_PHASE_A, AD7758_APP_PWR),
|
||||
.scan_index = 2,
|
||||
.scan_type = {
|
||||
@@ -690,9 +682,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_POWER,
|
||||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.extend_name = "active_raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.extend_name = "active",
|
||||
.address = AD7758_WT(AD7758_PHASE_A, AD7758_ACT_PWR),
|
||||
.scan_index = 3,
|
||||
.scan_type = {
|
||||
@@ -704,9 +694,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_POWER,
|
||||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.extend_name = "reactive_raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.extend_name = "reactive",
|
||||
.address = AD7758_WT(AD7758_PHASE_A, AD7758_REACT_PWR),
|
||||
.scan_index = 4,
|
||||
.scan_type = {
|
||||
@@ -718,9 +706,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_VOLTAGE,
|
||||
.indexed = 1,
|
||||
.channel = 1,
|
||||
.extend_name = "raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.address = AD7758_WT(AD7758_PHASE_B, AD7758_VOLTAGE),
|
||||
.scan_index = 5,
|
||||
.scan_type = {
|
||||
@@ -732,9 +717,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_CURRENT,
|
||||
.indexed = 1,
|
||||
.channel = 1,
|
||||
.extend_name = "raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.address = AD7758_WT(AD7758_PHASE_B, AD7758_CURRENT),
|
||||
.scan_index = 6,
|
||||
.scan_type = {
|
||||
@@ -746,9 +728,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_POWER,
|
||||
.indexed = 1,
|
||||
.channel = 1,
|
||||
.extend_name = "apparent_raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.extend_name = "apparent",
|
||||
.address = AD7758_WT(AD7758_PHASE_B, AD7758_APP_PWR),
|
||||
.scan_index = 7,
|
||||
.scan_type = {
|
||||
@@ -760,9 +740,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_POWER,
|
||||
.indexed = 1,
|
||||
.channel = 1,
|
||||
.extend_name = "active_raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.extend_name = "active",
|
||||
.address = AD7758_WT(AD7758_PHASE_B, AD7758_ACT_PWR),
|
||||
.scan_index = 8,
|
||||
.scan_type = {
|
||||
@@ -774,9 +752,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_POWER,
|
||||
.indexed = 1,
|
||||
.channel = 1,
|
||||
.extend_name = "reactive_raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.extend_name = "reactive",
|
||||
.address = AD7758_WT(AD7758_PHASE_B, AD7758_REACT_PWR),
|
||||
.scan_index = 9,
|
||||
.scan_type = {
|
||||
@@ -788,9 +764,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_VOLTAGE,
|
||||
.indexed = 1,
|
||||
.channel = 2,
|
||||
.extend_name = "raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.address = AD7758_WT(AD7758_PHASE_C, AD7758_VOLTAGE),
|
||||
.scan_index = 10,
|
||||
.scan_type = {
|
||||
@@ -802,9 +775,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_CURRENT,
|
||||
.indexed = 1,
|
||||
.channel = 2,
|
||||
.extend_name = "raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.address = AD7758_WT(AD7758_PHASE_C, AD7758_CURRENT),
|
||||
.scan_index = 11,
|
||||
.scan_type = {
|
||||
@@ -816,9 +786,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_POWER,
|
||||
.indexed = 1,
|
||||
.channel = 2,
|
||||
.extend_name = "apparent_raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.extend_name = "apparent",
|
||||
.address = AD7758_WT(AD7758_PHASE_C, AD7758_APP_PWR),
|
||||
.scan_index = 12,
|
||||
.scan_type = {
|
||||
@@ -830,9 +798,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_POWER,
|
||||
.indexed = 1,
|
||||
.channel = 2,
|
||||
.extend_name = "active_raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.extend_name = "active",
|
||||
.address = AD7758_WT(AD7758_PHASE_C, AD7758_ACT_PWR),
|
||||
.scan_index = 13,
|
||||
.scan_type = {
|
||||
@@ -844,9 +810,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
|
||||
.type = IIO_POWER,
|
||||
.indexed = 1,
|
||||
.channel = 2,
|
||||
.extend_name = "reactive_raw",
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
|
||||
.extend_name = "reactive",
|
||||
.address = AD7758_WT(AD7758_PHASE_C, AD7758_REACT_PWR),
|
||||
.scan_index = 14,
|
||||
.scan_type = {
|
||||
@@ -890,13 +854,14 @@ static int ade7758_probe(struct spi_device *spi)
|
||||
goto error_free_rx;
|
||||
}
|
||||
st->us = spi;
|
||||
st->ade7758_ring_channels = &ade7758_channels[0];
|
||||
mutex_init(&st->buf_lock);
|
||||
|
||||
indio_dev->name = spi->dev.driver->name;
|
||||
indio_dev->dev.parent = &spi->dev;
|
||||
indio_dev->info = &ade7758_info;
|
||||
indio_dev->modes = INDIO_DIRECT_MODE;
|
||||
indio_dev->channels = ade7758_channels;
|
||||
indio_dev->num_channels = ARRAY_SIZE(ade7758_channels);
|
||||
|
||||
ret = ade7758_configure_ring(indio_dev);
|
||||
if (ret)
|
||||
|
||||
@@ -89,11 +89,10 @@ static irqreturn_t ade7758_trigger_handler(int irq, void *p)
|
||||
**/
|
||||
static int ade7758_ring_preenable(struct iio_dev *indio_dev)
|
||||
{
|
||||
struct ade7758_state *st = iio_priv(indio_dev);
|
||||
unsigned channel;
|
||||
int ret;
|
||||
|
||||
if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength))
|
||||
if (bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength))
|
||||
return -EINVAL;
|
||||
|
||||
ret = iio_sw_buffer_preenable(indio_dev);
|
||||
@@ -104,7 +103,7 @@ static int ade7758_ring_preenable(struct iio_dev *indio_dev)
|
||||
indio_dev->masklength);
|
||||
|
||||
ade7758_write_waveform_type(&indio_dev->dev,
|
||||
st->ade7758_ring_channels[channel].address);
|
||||
indio_dev->channels[channel].address);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1293,7 +1293,8 @@ int core_dev_add_initiator_node_lun_acl(
|
||||
* Check to see if there are any existing persistent reservation APTPL
|
||||
* pre-registrations that need to be enabled for this LUN ACL..
|
||||
*/
|
||||
core_scsi3_check_aptpl_registration(lun->lun_se_dev, tpg, lun, lacl);
|
||||
core_scsi3_check_aptpl_registration(lun->lun_se_dev, tpg, lun, nacl,
|
||||
lacl->mapped_lun);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -945,10 +945,10 @@ int core_scsi3_check_aptpl_registration(
|
||||
struct se_device *dev,
|
||||
struct se_portal_group *tpg,
|
||||
struct se_lun *lun,
|
||||
struct se_lun_acl *lun_acl)
|
||||
struct se_node_acl *nacl,
|
||||
u32 mapped_lun)
|
||||
{
|
||||
struct se_node_acl *nacl = lun_acl->se_lun_nacl;
|
||||
struct se_dev_entry *deve = nacl->device_list[lun_acl->mapped_lun];
|
||||
struct se_dev_entry *deve = nacl->device_list[mapped_lun];
|
||||
|
||||
if (dev->dev_reservation_flags & DRF_SPC2_RESERVATIONS)
|
||||
return 0;
|
||||
|
||||
@@ -55,7 +55,7 @@ extern int core_scsi3_alloc_aptpl_registration(
|
||||
unsigned char *, u16, u32, int, int, u8);
|
||||
extern int core_scsi3_check_aptpl_registration(struct se_device *,
|
||||
struct se_portal_group *, struct se_lun *,
|
||||
struct se_lun_acl *);
|
||||
struct se_node_acl *, u32);
|
||||
extern void core_scsi3_free_pr_reg_from_nacl(struct se_device *,
|
||||
struct se_node_acl *);
|
||||
extern void core_scsi3_free_all_registrations(struct se_device *);
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <target/target_core_fabric.h>
|
||||
|
||||
#include "target_core_internal.h"
|
||||
#include "target_core_pr.h"
|
||||
|
||||
extern struct se_device *g_lun0_dev;
|
||||
|
||||
@@ -165,6 +166,13 @@ void core_tpg_add_node_to_devs(
|
||||
|
||||
core_enable_device_list_for_node(lun, NULL, lun->unpacked_lun,
|
||||
lun_access, acl, tpg);
|
||||
/*
|
||||
* Check to see if there are any existing persistent reservation
|
||||
* APTPL pre-registrations that need to be enabled for this dynamic
|
||||
* LUN ACL now..
|
||||
*/
|
||||
core_scsi3_check_aptpl_registration(dev, tpg, lun, acl,
|
||||
lun->unpacked_lun);
|
||||
spin_lock(&tpg->tpg_lun_lock);
|
||||
}
|
||||
spin_unlock(&tpg->tpg_lun_lock);
|
||||
|
||||
@@ -1788,8 +1788,7 @@ static void transport_complete_qf(struct se_cmd *cmd)
|
||||
|
||||
if (cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) {
|
||||
ret = cmd->se_tfo->queue_status(cmd);
|
||||
if (ret)
|
||||
goto out;
|
||||
goto out;
|
||||
}
|
||||
|
||||
switch (cmd->data_direction) {
|
||||
|
||||
@@ -362,7 +362,7 @@ uart_get_baud_rate(struct uart_port *port, struct ktermios *termios,
|
||||
* The spd_hi, spd_vhi, spd_shi, spd_warp kludge...
|
||||
* Die! Die! Die!
|
||||
*/
|
||||
if (baud == 38400)
|
||||
if (try == 0 && baud == 38400)
|
||||
baud = altbaud;
|
||||
|
||||
/*
|
||||
|
||||
@@ -1698,6 +1698,7 @@ int tty_release(struct inode *inode, struct file *filp)
|
||||
int pty_master, tty_closing, o_tty_closing, do_sleep;
|
||||
int idx;
|
||||
char buf[64];
|
||||
long timeout = 0;
|
||||
|
||||
if (tty_paranoia_check(tty, inode, __func__))
|
||||
return 0;
|
||||
@@ -1782,7 +1783,11 @@ int tty_release(struct inode *inode, struct file *filp)
|
||||
__func__, tty_name(tty, buf));
|
||||
tty_unlock_pair(tty, o_tty);
|
||||
mutex_unlock(&tty_mutex);
|
||||
schedule();
|
||||
schedule_timeout_killable(timeout);
|
||||
if (timeout < 120 * HZ)
|
||||
timeout = 2 * timeout + 1;
|
||||
else
|
||||
timeout = MAX_SCHEDULE_TIMEOUT;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -883,11 +883,12 @@ static void acm_tty_set_termios(struct tty_struct *tty,
|
||||
/* FIXME: Needs to clear unsupported bits in the termios */
|
||||
acm->clocal = ((termios->c_cflag & CLOCAL) != 0);
|
||||
|
||||
if (!newline.dwDTERate) {
|
||||
if (C_BAUD(tty) == B0) {
|
||||
newline.dwDTERate = acm->line.dwDTERate;
|
||||
newctrl &= ~ACM_CTRL_DTR;
|
||||
} else
|
||||
} else if (termios_old && (termios_old->c_cflag & CBAUD) == B0) {
|
||||
newctrl |= ACM_CTRL_DTR;
|
||||
}
|
||||
|
||||
if (newctrl != acm->ctrlout)
|
||||
acm_set_control(acm, acm->ctrlout = newctrl);
|
||||
@@ -1588,6 +1589,7 @@ static const struct usb_device_id acm_ids[] = {
|
||||
{ USB_DEVICE(0x0572, 0x1328), /* Shiro / Aztech USB MODEM UM-3100 */
|
||||
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
|
||||
},
|
||||
{ USB_DEVICE(0x2184, 0x001c) }, /* GW Instek AFG-2225 */
|
||||
{ USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */
|
||||
},
|
||||
/* Motorola H24 HSPA module: */
|
||||
|
||||
@@ -1960,6 +1960,8 @@ int usb_alloc_streams(struct usb_interface *interface,
|
||||
return -EINVAL;
|
||||
if (dev->speed != USB_SPEED_SUPER)
|
||||
return -EINVAL;
|
||||
if (dev->state < USB_STATE_CONFIGURED)
|
||||
return -ENODEV;
|
||||
|
||||
/* Streams only apply to bulk endpoints. */
|
||||
for (i = 0; i < num_eps; i++)
|
||||
|
||||
@@ -270,7 +270,7 @@ static void dwc3_ep0_stall_and_restart(struct dwc3 *dwc)
|
||||
|
||||
/* stall is always issued on EP0 */
|
||||
dep = dwc->eps[0];
|
||||
__dwc3_gadget_ep_set_halt(dep, 1);
|
||||
__dwc3_gadget_ep_set_halt(dep, 1, false);
|
||||
dep->flags = DWC3_EP_ENABLED;
|
||||
dwc->delayed_status = false;
|
||||
|
||||
@@ -480,7 +480,7 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
|
||||
return -EINVAL;
|
||||
if (set == 0 && (dep->flags & DWC3_EP_WEDGE))
|
||||
break;
|
||||
ret = __dwc3_gadget_ep_set_halt(dep, set);
|
||||
ret = __dwc3_gadget_ep_set_halt(dep, set, true);
|
||||
if (ret)
|
||||
return -EINVAL;
|
||||
break;
|
||||
|
||||
@@ -550,12 +550,11 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep,
|
||||
if (!usb_endpoint_xfer_isoc(desc))
|
||||
return 0;
|
||||
|
||||
memset(&trb_link, 0, sizeof(trb_link));
|
||||
|
||||
/* Link TRB for ISOC. The HWO bit is never reset */
|
||||
trb_st_hw = &dep->trb_pool[0];
|
||||
|
||||
trb_link = &dep->trb_pool[DWC3_TRB_NUM - 1];
|
||||
memset(trb_link, 0, sizeof(*trb_link));
|
||||
|
||||
trb_link->bpl = lower_32_bits(dwc3_trb_dma_offset(dep, trb_st_hw));
|
||||
trb_link->bph = upper_32_bits(dwc3_trb_dma_offset(dep, trb_st_hw));
|
||||
@@ -606,7 +605,7 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep)
|
||||
|
||||
/* make sure HW endpoint isn't stalled */
|
||||
if (dep->flags & DWC3_EP_STALL)
|
||||
__dwc3_gadget_ep_set_halt(dep, 0);
|
||||
__dwc3_gadget_ep_set_halt(dep, 0, false);
|
||||
|
||||
reg = dwc3_readl(dwc->regs, DWC3_DALEPENA);
|
||||
reg &= ~DWC3_DALEPENA_EP(dep->number);
|
||||
@@ -1206,7 +1205,7 @@ out0:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value)
|
||||
int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol)
|
||||
{
|
||||
struct dwc3_gadget_ep_cmd_params params;
|
||||
struct dwc3 *dwc = dep->dwc;
|
||||
@@ -1215,6 +1214,14 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value)
|
||||
memset(¶ms, 0x00, sizeof(params));
|
||||
|
||||
if (value) {
|
||||
if (!protocol && ((dep->direction && dep->flags & DWC3_EP_BUSY) ||
|
||||
(!list_empty(&dep->req_queued) ||
|
||||
!list_empty(&dep->request_list)))) {
|
||||
dev_dbg(dwc->dev, "%s: pending request, cannot halt\n",
|
||||
dep->name);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
ret = dwc3_send_gadget_ep_cmd(dwc, dep->number,
|
||||
DWC3_DEPCMD_SETSTALL, ¶ms);
|
||||
if (ret)
|
||||
@@ -1254,7 +1261,7 @@ static int dwc3_gadget_ep_set_halt(struct usb_ep *ep, int value)
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = __dwc3_gadget_ep_set_halt(dep, value);
|
||||
ret = __dwc3_gadget_ep_set_halt(dep, value, false);
|
||||
out:
|
||||
spin_unlock_irqrestore(&dwc->lock, flags);
|
||||
|
||||
@@ -1274,7 +1281,7 @@ static int dwc3_gadget_ep_set_wedge(struct usb_ep *ep)
|
||||
if (dep->number == 0 || dep->number == 1)
|
||||
return dwc3_gadget_ep0_set_halt(ep, 1);
|
||||
else
|
||||
return dwc3_gadget_ep_set_halt(ep, 1);
|
||||
return __dwc3_gadget_ep_set_halt(dep, 1, false);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
@@ -114,7 +114,7 @@ void dwc3_ep0_out_start(struct dwc3 *dwc);
|
||||
int dwc3_gadget_ep0_set_halt(struct usb_ep *ep, int value);
|
||||
int dwc3_gadget_ep0_queue(struct usb_ep *ep, struct usb_request *request,
|
||||
gfp_t gfp_flags);
|
||||
int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value);
|
||||
int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol);
|
||||
int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
|
||||
unsigned cmd, struct dwc3_gadget_ep_cmd_params *params);
|
||||
int dwc3_send_gadget_generic_command(struct dwc3 *dwc, int cmd, u32 param);
|
||||
|
||||
@@ -430,11 +430,12 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
|
||||
if (acm->notify->driver_data) {
|
||||
VDBG(cdev, "reset acm control interface %d\n", intf);
|
||||
usb_ep_disable(acm->notify);
|
||||
} else {
|
||||
VDBG(cdev, "init acm ctrl interface %d\n", intf);
|
||||
}
|
||||
|
||||
if (!acm->notify->desc)
|
||||
if (config_ep_by_speed(cdev->gadget, f, acm->notify))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
usb_ep_enable(acm->notify);
|
||||
acm->notify->driver_data = acm;
|
||||
|
||||
|
||||
@@ -447,6 +447,11 @@ static ssize_t usb_udc_softconn_store(struct device *dev,
|
||||
{
|
||||
struct usb_udc *udc = container_of(dev, struct usb_udc, dev);
|
||||
|
||||
if (!udc->driver) {
|
||||
dev_err(dev, "soft-connect without a gadget driver\n");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
if (sysfs_streq(buf, "connect")) {
|
||||
usb_gadget_udc_start(udc->gadget, udc->driver);
|
||||
usb_gadget_connect(udc->gadget);
|
||||
|
||||
@@ -155,6 +155,7 @@ static const struct usb_device_id id_table[] = {
|
||||
{ USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
|
||||
{ USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */
|
||||
{ USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */
|
||||
{ USB_DEVICE(0x1BA4, 0x0002) }, /* Silicon Labs 358x factory default */
|
||||
{ USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
|
||||
{ USB_DEVICE(0x1D6F, 0x0010) }, /* Seluxit ApS RF Dongle */
|
||||
{ USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */
|
||||
|
||||
@@ -148,6 +148,7 @@ static struct ftdi_sio_quirk ftdi_8u2232c_quirk = {
|
||||
* /sys/bus/usb/ftdi_sio/new_id, then send patch/report!
|
||||
*/
|
||||
static struct usb_device_id id_table_combined [] = {
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_BRICK_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_ZEITCONTROL_TAGTRACE_MIFARE_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_CTI_MINI_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_CTI_NANO_PID) },
|
||||
@@ -677,6 +678,8 @@ static struct usb_device_id id_table_combined [] = {
|
||||
{ USB_DEVICE(FTDI_VID, XSENS_CONVERTER_5_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, XSENS_CONVERTER_6_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) },
|
||||
{ USB_DEVICE(XSENS_VID, XSENS_AWINDA_DONGLE_PID) },
|
||||
{ USB_DEVICE(XSENS_VID, XSENS_AWINDA_STATION_PID) },
|
||||
{ USB_DEVICE(XSENS_VID, XSENS_CONVERTER_PID) },
|
||||
{ USB_DEVICE(XSENS_VID, XSENS_MTW_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_OMNI1509) },
|
||||
|
||||
@@ -30,6 +30,12 @@
|
||||
|
||||
/*** third-party PIDs (using FTDI_VID) ***/
|
||||
|
||||
/*
|
||||
* Certain versions of the official Windows FTDI driver reprogrammed
|
||||
* counterfeit FTDI devices to PID 0. Support these devices anyway.
|
||||
*/
|
||||
#define FTDI_BRICK_PID 0x0000
|
||||
|
||||
#define FTDI_LUMEL_PD12_PID 0x6002
|
||||
|
||||
/*
|
||||
@@ -143,8 +149,12 @@
|
||||
* Xsens Technologies BV products (http://www.xsens.com).
|
||||
*/
|
||||
#define XSENS_VID 0x2639
|
||||
#define XSENS_CONVERTER_PID 0xD00D /* Xsens USB-serial converter */
|
||||
#define XSENS_AWINDA_STATION_PID 0x0101
|
||||
#define XSENS_AWINDA_DONGLE_PID 0x0102
|
||||
#define XSENS_MTW_PID 0x0200 /* Xsens MTw */
|
||||
#define XSENS_CONVERTER_PID 0xD00D /* Xsens USB-serial converter */
|
||||
|
||||
/* Xsens devices using FTDI VID */
|
||||
#define XSENS_CONVERTER_0_PID 0xD388 /* Xsens USB converter */
|
||||
#define XSENS_CONVERTER_1_PID 0xD389 /* Xsens Wireless Receiver */
|
||||
#define XSENS_CONVERTER_2_PID 0xD38A
|
||||
|
||||
@@ -219,7 +219,7 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port,
|
||||
|
||||
/* The conncected devices do not have a bulk write endpoint,
|
||||
* to transmit data to de barcode device the control endpoint is used */
|
||||
dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO);
|
||||
dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
|
||||
if (!dr) {
|
||||
dev_err(&port->dev, "out of memory\n");
|
||||
count = -ENOMEM;
|
||||
|
||||
@@ -269,6 +269,7 @@ static void option_instat_callback(struct urb *urb);
|
||||
#define TELIT_PRODUCT_DE910_DUAL 0x1010
|
||||
#define TELIT_PRODUCT_UE910_V2 0x1012
|
||||
#define TELIT_PRODUCT_LE920 0x1200
|
||||
#define TELIT_PRODUCT_LE910 0x1201
|
||||
|
||||
/* ZTE PRODUCTS */
|
||||
#define ZTE_VENDOR_ID 0x19d2
|
||||
@@ -361,6 +362,7 @@ static void option_instat_callback(struct urb *urb);
|
||||
|
||||
/* Haier products */
|
||||
#define HAIER_VENDOR_ID 0x201e
|
||||
#define HAIER_PRODUCT_CE81B 0x10f8
|
||||
#define HAIER_PRODUCT_CE100 0x2009
|
||||
|
||||
/* Cinterion (formerly Siemens) products */
|
||||
@@ -588,6 +590,11 @@ static const struct option_blacklist_info zte_1255_blacklist = {
|
||||
.reserved = BIT(3) | BIT(4),
|
||||
};
|
||||
|
||||
static const struct option_blacklist_info telit_le910_blacklist = {
|
||||
.sendsetup = BIT(0),
|
||||
.reserved = BIT(1) | BIT(2),
|
||||
};
|
||||
|
||||
static const struct option_blacklist_info telit_le920_blacklist = {
|
||||
.sendsetup = BIT(0),
|
||||
.reserved = BIT(1) | BIT(5),
|
||||
@@ -1137,6 +1144,8 @@ static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UE910_V2) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910),
|
||||
.driver_info = (kernel_ulong_t)&telit_le910_blacklist },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920),
|
||||
.driver_info = (kernel_ulong_t)&telit_le920_blacklist },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */
|
||||
@@ -1612,6 +1621,7 @@ static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) },
|
||||
{ USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) },
|
||||
{ USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(HAIER_VENDOR_ID, HAIER_PRODUCT_CE81B, 0xff, 0xff, 0xff) },
|
||||
/* Pirelli */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1, 0xff) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_2, 0xff) },
|
||||
|
||||
@@ -1118,6 +1118,31 @@ int usb_stor_Bulk_transport(struct scsi_cmnd *srb, struct us_data *us)
|
||||
*/
|
||||
if (result == USB_STOR_XFER_LONG)
|
||||
fake_sense = 1;
|
||||
|
||||
/*
|
||||
* Sometimes a device will mistakenly skip the data phase
|
||||
* and go directly to the status phase without sending a
|
||||
* zero-length packet. If we get a 13-byte response here,
|
||||
* check whether it really is a CSW.
|
||||
*/
|
||||
if (result == USB_STOR_XFER_SHORT &&
|
||||
srb->sc_data_direction == DMA_FROM_DEVICE &&
|
||||
transfer_length - scsi_get_resid(srb) ==
|
||||
US_BULK_CS_WRAP_LEN) {
|
||||
struct scatterlist *sg = NULL;
|
||||
unsigned int offset = 0;
|
||||
|
||||
if (usb_stor_access_xfer_buf((unsigned char *) bcs,
|
||||
US_BULK_CS_WRAP_LEN, srb, &sg,
|
||||
&offset, FROM_XFER_BUF) ==
|
||||
US_BULK_CS_WRAP_LEN &&
|
||||
bcs->Signature ==
|
||||
cpu_to_le32(US_BULK_CS_SIGN)) {
|
||||
usb_stor_dbg(us, "Device skipped data phase\n");
|
||||
scsi_set_resid(srb, transfer_length);
|
||||
goto skipped_data_phase;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* See flow chart on pg 15 of the Bulk Only Transport spec for
|
||||
@@ -1153,6 +1178,7 @@ int usb_stor_Bulk_transport(struct scsi_cmnd *srb, struct us_data *us)
|
||||
if (result != USB_STOR_XFER_GOOD)
|
||||
return USB_STOR_TRANSPORT_ERROR;
|
||||
|
||||
skipped_data_phase:
|
||||
/* check bulk status */
|
||||
residue = le32_to_cpu(bcs->Residue);
|
||||
usb_stor_dbg(us, "Bulk Status S 0x%x T 0x%x R %u Stat 0x%x\n",
|
||||
|
||||
@@ -205,7 +205,6 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info,
|
||||
static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
|
||||
int bottom_only)
|
||||
{
|
||||
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
|
||||
unsigned int cw = vc->vc_font.width;
|
||||
unsigned int ch = vc->vc_font.height;
|
||||
unsigned int rw = info->var.xres - (vc->vc_cols*cw);
|
||||
@@ -214,7 +213,7 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
|
||||
unsigned int bs = info->var.yres - bh;
|
||||
struct fb_fillrect region;
|
||||
|
||||
region.color = attr_bgcol_ec(bgshift, vc, info);
|
||||
region.color = 0;
|
||||
region.rop = ROP_COPY;
|
||||
|
||||
if (rw && !bottom_only) {
|
||||
|
||||
@@ -197,9 +197,8 @@ static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info,
|
||||
unsigned int bh = info->var.xres - (vc->vc_rows*ch);
|
||||
unsigned int bs = vc->vc_rows*ch;
|
||||
struct fb_fillrect region;
|
||||
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
|
||||
|
||||
region.color = attr_bgcol_ec(bgshift,vc,info);
|
||||
region.color = 0;
|
||||
region.rop = ROP_COPY;
|
||||
|
||||
if (rw && !bottom_only) {
|
||||
|
||||
@@ -180,9 +180,8 @@ static void cw_clear_margins(struct vc_data *vc, struct fb_info *info,
|
||||
unsigned int bh = info->var.xres - (vc->vc_rows*ch);
|
||||
unsigned int rs = info->var.yres - rw;
|
||||
struct fb_fillrect region;
|
||||
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
|
||||
|
||||
region.color = attr_bgcol_ec(bgshift,vc,info);
|
||||
region.color = 0;
|
||||
region.rop = ROP_COPY;
|
||||
|
||||
if (rw && !bottom_only) {
|
||||
|
||||
@@ -227,9 +227,8 @@ static void ud_clear_margins(struct vc_data *vc, struct fb_info *info,
|
||||
unsigned int rw = info->var.xres - (vc->vc_cols*cw);
|
||||
unsigned int bh = info->var.yres - (vc->vc_rows*ch);
|
||||
struct fb_fillrect region;
|
||||
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
|
||||
|
||||
region.color = attr_bgcol_ec(bgshift,vc,info);
|
||||
region.color = 0;
|
||||
region.rop = ROP_COPY;
|
||||
|
||||
if (rw && !bottom_only) {
|
||||
|
||||
@@ -791,6 +791,7 @@ static int virtio_pci_restore(struct device *dev)
|
||||
struct pci_dev *pci_dev = to_pci_dev(dev);
|
||||
struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
|
||||
struct virtio_driver *drv;
|
||||
unsigned status = 0;
|
||||
int ret;
|
||||
|
||||
drv = container_of(vp_dev->vdev.dev.driver,
|
||||
@@ -801,14 +802,40 @@ static int virtio_pci_restore(struct device *dev)
|
||||
return ret;
|
||||
|
||||
pci_set_master(pci_dev);
|
||||
/* We always start by resetting the device, in case a previous
|
||||
* driver messed it up. */
|
||||
vp_reset(&vp_dev->vdev);
|
||||
|
||||
/* Acknowledge that we've seen the device. */
|
||||
status |= VIRTIO_CONFIG_S_ACKNOWLEDGE;
|
||||
vp_set_status(&vp_dev->vdev, status);
|
||||
|
||||
/* Maybe driver failed before freeze.
|
||||
* Restore the failed status, for debugging. */
|
||||
status |= vp_dev->saved_status & VIRTIO_CONFIG_S_FAILED;
|
||||
vp_set_status(&vp_dev->vdev, status);
|
||||
|
||||
if (!drv)
|
||||
return 0;
|
||||
|
||||
/* We have a driver! */
|
||||
status |= VIRTIO_CONFIG_S_DRIVER;
|
||||
vp_set_status(&vp_dev->vdev, status);
|
||||
|
||||
vp_finalize_features(&vp_dev->vdev);
|
||||
|
||||
if (drv && drv->restore)
|
||||
if (drv->restore) {
|
||||
ret = drv->restore(&vp_dev->vdev);
|
||||
if (ret) {
|
||||
status |= VIRTIO_CONFIG_S_FAILED;
|
||||
vp_set_status(&vp_dev->vdev, status);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* Finally, tell the device we're all set */
|
||||
if (!ret)
|
||||
vp_set_status(&vp_dev->vdev, vp_dev->saved_status);
|
||||
status |= VIRTIO_CONFIG_S_DRIVER_OK;
|
||||
vp_set_status(&vp_dev->vdev, status);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -403,7 +403,7 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
|
||||
ret = 0;
|
||||
fail:
|
||||
while (ret < 0 && !list_empty(&tmplist)) {
|
||||
sums = list_entry(&tmplist, struct btrfs_ordered_sum, list);
|
||||
sums = list_entry(tmplist.next, struct btrfs_ordered_sum, list);
|
||||
list_del(&sums->list);
|
||||
kfree(sums);
|
||||
}
|
||||
|
||||
@@ -2018,6 +2018,7 @@ int generic_write_end(struct file *file, struct address_space *mapping,
|
||||
struct page *page, void *fsdata)
|
||||
{
|
||||
struct inode *inode = mapping->host;
|
||||
loff_t old_size = inode->i_size;
|
||||
int i_size_changed = 0;
|
||||
|
||||
copied = block_write_end(file, mapping, pos, len, copied, page, fsdata);
|
||||
@@ -2037,6 +2038,8 @@ int generic_write_end(struct file *file, struct address_space *mapping,
|
||||
unlock_page(page);
|
||||
page_cache_release(page);
|
||||
|
||||
if (old_size < pos)
|
||||
pagecache_isize_extended(inode, old_size, pos);
|
||||
/*
|
||||
* Don't mark the inode dirty under page lock. First, it unnecessarily
|
||||
* makes the holding time of page lock longer. Second, it forces lock
|
||||
@@ -2254,6 +2257,11 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
|
||||
err = 0;
|
||||
|
||||
balance_dirty_pages_ratelimited(mapping);
|
||||
|
||||
if (unlikely(fatal_signal_pending(current))) {
|
||||
err = -EINTR;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/* page covers the boundary, find the boundary offset */
|
||||
|
||||
@@ -1300,13 +1300,6 @@ set_qf_format:
|
||||
"not specified.");
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (sbi->s_jquota_fmt) {
|
||||
ext3_msg(sb, KERN_ERR, "error: journaled quota format "
|
||||
"specified with no journaling "
|
||||
"enabled.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
|
||||
@@ -2088,6 +2088,7 @@ int do_journal_get_write_access(handle_t *handle,
|
||||
#define CONVERT_INLINE_DATA 2
|
||||
|
||||
extern struct inode *ext4_iget(struct super_block *, unsigned long);
|
||||
extern struct inode *ext4_iget_normal(struct super_block *, unsigned long);
|
||||
extern int ext4_write_inode(struct inode *, struct writeback_control *);
|
||||
extern int ext4_setattr(struct dentry *, struct iattr *);
|
||||
extern int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
||||
@@ -2260,8 +2261,8 @@ extern int ext4_register_li_request(struct super_block *sb,
|
||||
static inline int ext4_has_group_desc_csum(struct super_block *sb)
|
||||
{
|
||||
return EXT4_HAS_RO_COMPAT_FEATURE(sb,
|
||||
EXT4_FEATURE_RO_COMPAT_GDT_CSUM |
|
||||
EXT4_FEATURE_RO_COMPAT_METADATA_CSUM);
|
||||
EXT4_FEATURE_RO_COMPAT_GDT_CSUM) ||
|
||||
(EXT4_SB(sb)->s_chksum_driver != NULL);
|
||||
}
|
||||
|
||||
static inline ext4_fsblk_t ext4_blocks_count(struct ext4_super_block *es)
|
||||
|
||||
@@ -793,6 +793,10 @@ got:
|
||||
struct buffer_head *block_bitmap_bh;
|
||||
|
||||
block_bitmap_bh = ext4_read_block_bitmap(sb, group);
|
||||
if (!block_bitmap_bh) {
|
||||
err = -EIO;
|
||||
goto out;
|
||||
}
|
||||
BUFFER_TRACE(block_bitmap_bh, "get block bitmap access");
|
||||
err = ext4_journal_get_write_access(handle, block_bitmap_bh);
|
||||
if (err) {
|
||||
|
||||
@@ -2647,6 +2647,20 @@ static int ext4_nonda_switch(struct super_block *sb)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* We always reserve for an inode update; the superblock could be there too */
|
||||
static int ext4_da_write_credits(struct inode *inode, loff_t pos, unsigned len)
|
||||
{
|
||||
if (likely(EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
|
||||
EXT4_FEATURE_RO_COMPAT_LARGE_FILE)))
|
||||
return 1;
|
||||
|
||||
if (pos + len <= 0x7fffffffULL)
|
||||
return 1;
|
||||
|
||||
/* We might need to update the superblock to set LARGE_FILE */
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int ext4_da_write_begin(struct file *file, struct address_space *mapping,
|
||||
loff_t pos, unsigned len, unsigned flags,
|
||||
struct page **pagep, void **fsdata)
|
||||
@@ -2697,7 +2711,8 @@ retry_grab:
|
||||
* of file which has an already mapped buffer.
|
||||
*/
|
||||
retry_journal:
|
||||
handle = ext4_journal_start(inode, EXT4_HT_WRITE_PAGE, 1);
|
||||
handle = ext4_journal_start(inode, EXT4_HT_WRITE_PAGE,
|
||||
ext4_da_write_credits(inode, pos, len));
|
||||
if (IS_ERR(handle)) {
|
||||
page_cache_release(page);
|
||||
return PTR_ERR(handle);
|
||||
@@ -4351,6 +4366,13 @@ bad_inode:
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
struct inode *ext4_iget_normal(struct super_block *sb, unsigned long ino)
|
||||
{
|
||||
if (ino < EXT4_FIRST_INO(sb) && ino != EXT4_ROOT_INO)
|
||||
return ERR_PTR(-EIO);
|
||||
return ext4_iget(sb, ino);
|
||||
}
|
||||
|
||||
static int ext4_inode_blocks_set(handle_t *handle,
|
||||
struct ext4_inode *raw_inode,
|
||||
struct ext4_inode_info *ei)
|
||||
|
||||
@@ -549,9 +549,17 @@ group_add_out:
|
||||
}
|
||||
|
||||
case EXT4_IOC_SWAP_BOOT:
|
||||
{
|
||||
int err;
|
||||
if (!(filp->f_mode & FMODE_WRITE))
|
||||
return -EBADF;
|
||||
return swap_inode_boot_loader(sb, inode);
|
||||
err = mnt_want_write_file(filp);
|
||||
if (err)
|
||||
return err;
|
||||
err = swap_inode_boot_loader(sb, inode);
|
||||
mnt_drop_write_file(filp);
|
||||
return err;
|
||||
}
|
||||
|
||||
case EXT4_IOC_RESIZE_FS: {
|
||||
ext4_fsblk_t n_blocks_count;
|
||||
|
||||
@@ -1430,7 +1430,7 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsi
|
||||
dentry->d_name.name);
|
||||
return ERR_PTR(-EIO);
|
||||
}
|
||||
inode = ext4_iget(dir->i_sb, ino);
|
||||
inode = ext4_iget_normal(dir->i_sb, ino);
|
||||
if (inode == ERR_PTR(-ESTALE)) {
|
||||
EXT4_ERROR_INODE(dir,
|
||||
"deleted inode referenced: %u",
|
||||
@@ -1461,7 +1461,7 @@ struct dentry *ext4_get_parent(struct dentry *child)
|
||||
return ERR_PTR(-EIO);
|
||||
}
|
||||
|
||||
return d_obtain_alias(ext4_iget(child->d_inode->i_sb, ino));
|
||||
return d_obtain_alias(ext4_iget_normal(child->d_inode->i_sb, ino));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1066,7 +1066,7 @@ static void update_backups(struct super_block *sb, int blk_off, char *data,
|
||||
break;
|
||||
|
||||
if (meta_bg == 0)
|
||||
backup_block = group * bpg + blk_off;
|
||||
backup_block = ((ext4_fsblk_t)group) * bpg + blk_off;
|
||||
else
|
||||
backup_block = (ext4_group_first_block_no(sb, group) +
|
||||
ext4_bg_has_super(sb, group));
|
||||
|
||||
@@ -964,7 +964,7 @@ static struct inode *ext4_nfs_get_inode(struct super_block *sb,
|
||||
* Currently we don't know the generation for parent directory, so
|
||||
* a generation of 0 means "accept any"
|
||||
*/
|
||||
inode = ext4_iget(sb, ino);
|
||||
inode = ext4_iget_normal(sb, ino);
|
||||
if (IS_ERR(inode))
|
||||
return ERR_CAST(inode);
|
||||
if (generation && inode->i_generation != generation) {
|
||||
@@ -1632,13 +1632,6 @@ static int parse_options(char *options, struct super_block *sb,
|
||||
"not specified");
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (sbi->s_jquota_fmt) {
|
||||
ext4_msg(sb, KERN_ERR, "journaled quota format "
|
||||
"specified with no journaling "
|
||||
"enabled");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (test_opt(sb, DIOREAD_NOLOCK)) {
|
||||
@@ -1957,6 +1950,10 @@ static __le16 ext4_group_desc_csum(struct ext4_sb_info *sbi, __u32 block_group,
|
||||
}
|
||||
|
||||
/* old crc16 code */
|
||||
if (!(sbi->s_es->s_feature_ro_compat &
|
||||
cpu_to_le32(EXT4_FEATURE_RO_COMPAT_GDT_CSUM)))
|
||||
return 0;
|
||||
|
||||
offset = offsetof(struct ext4_group_desc, bg_checksum);
|
||||
|
||||
crc = crc16(~0, sbi->s_es->s_uuid, sizeof(sbi->s_es->s_uuid));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user