mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
Merge tag 'v3.8.13.7' of git://kernel.ubuntu.com/ubuntu/linux into odroid-3.8.y
v3.8.13.7
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
||||
VERSION = 3
|
||||
PATCHLEVEL = 8
|
||||
SUBLEVEL = 13
|
||||
EXTRAVERSION = .6
|
||||
EXTRAVERSION = .7
|
||||
NAME = Remoralised Urchins Update
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
||||
@@ -373,4 +373,10 @@ config CLONE_BACKWARDS2
|
||||
help
|
||||
Architecture has the first two arguments of clone(2) swapped.
|
||||
|
||||
config CLONE_BACKWARDS3
|
||||
bool
|
||||
help
|
||||
Architecture has tls passed as the 3rd argument of clone(2),
|
||||
not the 5th one.
|
||||
|
||||
source "kernel/gcov/Kconfig"
|
||||
|
||||
@@ -17,7 +17,6 @@ config ARM
|
||||
select GENERIC_STRNCPY_FROM_USER
|
||||
select GENERIC_STRNLEN_USER
|
||||
select HARDIRQS_SW_RESEND
|
||||
select HAVE_AOUT
|
||||
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
|
||||
select HAVE_ARCH_KGDB
|
||||
select HAVE_ARCH_SECCOMP_FILTER
|
||||
@@ -190,7 +189,8 @@ config VECTORS_BASE
|
||||
default DRAM_BASE if REMAP_VECTORS_TO_RAM
|
||||
default 0x00000000
|
||||
help
|
||||
The base address of exception vectors.
|
||||
The base address of exception vectors. This must be two pages
|
||||
in size.
|
||||
|
||||
config ARM_PATCH_PHYS_VIRT
|
||||
bool "Patch physical to virtual translations at runtime" if EMBEDDED
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/* a.out coredump register dumper
|
||||
*
|
||||
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
|
||||
* Written by David Howells (dhowells@redhat.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public Licence
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the Licence, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef _ASM_A_OUT_CORE_H
|
||||
#define _ASM_A_OUT_CORE_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/user.h>
|
||||
#include <linux/elfcore.h>
|
||||
|
||||
/*
|
||||
* fill in the user structure for an a.out core dump
|
||||
*/
|
||||
static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
|
||||
{
|
||||
struct task_struct *tsk = current;
|
||||
|
||||
dump->magic = CMAGIC;
|
||||
dump->start_code = tsk->mm->start_code;
|
||||
dump->start_stack = regs->ARM_sp & ~(PAGE_SIZE - 1);
|
||||
|
||||
dump->u_tsize = (tsk->mm->end_code - tsk->mm->start_code) >> PAGE_SHIFT;
|
||||
dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data + PAGE_SIZE - 1) >> PAGE_SHIFT;
|
||||
dump->u_ssize = 0;
|
||||
|
||||
memset(dump->u_debugreg, 0, sizeof(dump->u_debugreg));
|
||||
|
||||
if (dump->start_stack < 0x04000000)
|
||||
dump->u_ssize = (0x04000000 - dump->start_stack) >> PAGE_SHIFT;
|
||||
|
||||
dump->regs = *regs;
|
||||
dump->u_fpvalid = dump_fpu (regs, &dump->u_fp);
|
||||
}
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _ASM_A_OUT_CORE_H */
|
||||
@@ -6,6 +6,8 @@
|
||||
typedef struct {
|
||||
#ifdef CONFIG_CPU_HAS_ASID
|
||||
atomic64_t id;
|
||||
#else
|
||||
int switch_pending;
|
||||
#endif
|
||||
unsigned int vmalloc_seq;
|
||||
} mm_context_t;
|
||||
|
||||
@@ -45,7 +45,7 @@ static inline void check_and_switch_context(struct mm_struct *mm,
|
||||
* on non-ASID CPUs, the old mm will remain valid until the
|
||||
* finish_arch_post_lock_switch() call.
|
||||
*/
|
||||
set_ti_thread_flag(task_thread_info(tsk), TIF_SWITCH_MM);
|
||||
mm->context.switch_pending = 1;
|
||||
else
|
||||
cpu_switch_mm(mm->pgd, mm);
|
||||
}
|
||||
@@ -54,9 +54,21 @@ static inline void check_and_switch_context(struct mm_struct *mm,
|
||||
finish_arch_post_lock_switch
|
||||
static inline void finish_arch_post_lock_switch(void)
|
||||
{
|
||||
if (test_and_clear_thread_flag(TIF_SWITCH_MM)) {
|
||||
struct mm_struct *mm = current->mm;
|
||||
cpu_switch_mm(mm->pgd, mm);
|
||||
struct mm_struct *mm = current->mm;
|
||||
|
||||
if (mm && mm->context.switch_pending) {
|
||||
/*
|
||||
* Preemption must be disabled during cpu_switch_mm() as we
|
||||
* have some stateful cache flush implementations. Check
|
||||
* switch_pending again in case we were preempted and the
|
||||
* switch to this mm was already done.
|
||||
*/
|
||||
preempt_disable();
|
||||
if (mm->context.switch_pending) {
|
||||
mm->context.switch_pending = 0;
|
||||
cpu_switch_mm(mm->pgd, mm);
|
||||
}
|
||||
preempt_enable_no_resched();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ struct thread_struct {
|
||||
|
||||
#define start_thread(regs,pc,sp) \
|
||||
({ \
|
||||
unsigned long *stack = (unsigned long *)sp; \
|
||||
memset(regs->uregs, 0, sizeof(regs->uregs)); \
|
||||
if (current->personality & ADDR_LIMIT_32BIT) \
|
||||
regs->ARM_cpsr = USR_MODE; \
|
||||
@@ -65,9 +64,6 @@ struct thread_struct {
|
||||
regs->ARM_cpsr |= PSR_ENDSTATE; \
|
||||
regs->ARM_pc = pc & ~1; /* pc */ \
|
||||
regs->ARM_sp = sp; /* sp */ \
|
||||
regs->ARM_r2 = stack[2]; /* r2 (envp) */ \
|
||||
regs->ARM_r1 = stack[1]; /* r1 (argv) */ \
|
||||
regs->ARM_r0 = stack[0]; /* r0 (argc) */ \
|
||||
nommu_start_thread(regs); \
|
||||
})
|
||||
|
||||
|
||||
@@ -155,7 +155,6 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
|
||||
#define TIF_USING_IWMMXT 17
|
||||
#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
|
||||
#define TIF_RESTORE_SIGMASK 20
|
||||
#define TIF_SWITCH_MM 22 /* deferred switch_mm */
|
||||
|
||||
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
|
||||
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# UAPI Header export list
|
||||
include include/uapi/asm-generic/Kbuild.asm
|
||||
|
||||
header-y += a.out.h
|
||||
header-y += byteorder.h
|
||||
header-y += fcntl.h
|
||||
header-y += hwcap.h
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
#ifndef __ARM_A_OUT_H__
|
||||
#define __ARM_A_OUT_H__
|
||||
|
||||
#include <linux/personality.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct exec
|
||||
{
|
||||
__u32 a_info; /* Use macros N_MAGIC, etc for access */
|
||||
__u32 a_text; /* length of text, in bytes */
|
||||
__u32 a_data; /* length of data, in bytes */
|
||||
__u32 a_bss; /* length of uninitialized data area for file, in bytes */
|
||||
__u32 a_syms; /* length of symbol table data in file, in bytes */
|
||||
__u32 a_entry; /* start address */
|
||||
__u32 a_trsize; /* length of relocation info for text, in bytes */
|
||||
__u32 a_drsize; /* length of relocation info for data, in bytes */
|
||||
};
|
||||
|
||||
/*
|
||||
* This is always the same
|
||||
*/
|
||||
#define N_TXTADDR(a) (0x00008000)
|
||||
|
||||
#define N_TRSIZE(a) ((a).a_trsize)
|
||||
#define N_DRSIZE(a) ((a).a_drsize)
|
||||
#define N_SYMSIZE(a) ((a).a_syms)
|
||||
|
||||
#define M_ARM 103
|
||||
|
||||
#ifndef LIBRARY_START_TEXT
|
||||
#define LIBRARY_START_TEXT (0x00c00000)
|
||||
#endif
|
||||
|
||||
#endif /* __A_OUT_GNU_H__ */
|
||||
@@ -784,6 +784,17 @@ ENDPROC(__switch_to)
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro kuser_pad, sym, size
|
||||
.if (. - \sym) & 3
|
||||
.rept 4 - (. - \sym) & 3
|
||||
.byte 0
|
||||
.endr
|
||||
.endif
|
||||
.rept (\size - (. - \sym)) / 4
|
||||
.word 0xe7fddef1
|
||||
.endr
|
||||
.endm
|
||||
|
||||
.align 5
|
||||
.globl __kuser_helper_start
|
||||
__kuser_helper_start:
|
||||
@@ -874,18 +885,13 @@ kuser_cmpxchg64_fixup:
|
||||
#error "incoherent kernel configuration"
|
||||
#endif
|
||||
|
||||
/* pad to next slot */
|
||||
.rept (16 - (. - __kuser_cmpxchg64)/4)
|
||||
.word 0
|
||||
.endr
|
||||
|
||||
.align 5
|
||||
kuser_pad __kuser_cmpxchg64, 64
|
||||
|
||||
__kuser_memory_barrier: @ 0xffff0fa0
|
||||
smp_dmb arm
|
||||
usr_ret lr
|
||||
|
||||
.align 5
|
||||
kuser_pad __kuser_memory_barrier, 32
|
||||
|
||||
__kuser_cmpxchg: @ 0xffff0fc0
|
||||
|
||||
@@ -958,13 +964,14 @@ kuser_cmpxchg32_fixup:
|
||||
|
||||
#endif
|
||||
|
||||
.align 5
|
||||
kuser_pad __kuser_cmpxchg, 32
|
||||
|
||||
__kuser_get_tls: @ 0xffff0fe0
|
||||
ldr r0, [pc, #(16 - 8)] @ read TLS, set in kuser_get_tls_init
|
||||
usr_ret lr
|
||||
mrc p15, 0, r0, c13, c0, 3 @ 0xffff0fe8 hardware TLS code
|
||||
.rep 4
|
||||
kuser_pad __kuser_get_tls, 16
|
||||
.rep 3
|
||||
.word 0 @ 0xffff0ff0 software TLS value, then
|
||||
.endr @ pad up to __kuser_helper_version
|
||||
|
||||
@@ -979,9 +986,9 @@ __kuser_helper_end:
|
||||
/*
|
||||
* Vector stubs.
|
||||
*
|
||||
* This code is copied to 0xffff0200 so we can use branches in the
|
||||
* vectors, rather than ldr's. Note that this code must not
|
||||
* exceed 0x300 bytes.
|
||||
* This code is copied to 0xffff1000 so we can use branches in the
|
||||
* vectors, rather than ldr's. Note that this code must not exceed
|
||||
* a page size.
|
||||
*
|
||||
* Common stub entry macro:
|
||||
* Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
|
||||
@@ -1028,8 +1035,17 @@ ENDPROC(vector_\name)
|
||||
1:
|
||||
.endm
|
||||
|
||||
.globl __stubs_start
|
||||
.section .stubs, "ax", %progbits
|
||||
__stubs_start:
|
||||
@ This must be the first word
|
||||
.word vector_swi
|
||||
|
||||
vector_rst:
|
||||
ARM( swi SYS_ERROR0 )
|
||||
THUMB( svc #0 )
|
||||
THUMB( nop )
|
||||
b vector_und
|
||||
|
||||
/*
|
||||
* Interrupt dispatcher
|
||||
*/
|
||||
@@ -1123,6 +1139,16 @@ __stubs_start:
|
||||
|
||||
.align 5
|
||||
|
||||
/*=============================================================================
|
||||
* Address exception handler
|
||||
*-----------------------------------------------------------------------------
|
||||
* These aren't too critical.
|
||||
* (they're not supposed to happen, and won't happen in 32-bit data mode).
|
||||
*/
|
||||
|
||||
vector_addrexcptn:
|
||||
b vector_addrexcptn
|
||||
|
||||
/*=============================================================================
|
||||
* Undefined FIQs
|
||||
*-----------------------------------------------------------------------------
|
||||
@@ -1136,45 +1162,16 @@ __stubs_start:
|
||||
vector_fiq:
|
||||
subs pc, lr, #4
|
||||
|
||||
/*=============================================================================
|
||||
* Address exception handler
|
||||
*-----------------------------------------------------------------------------
|
||||
* These aren't too critical.
|
||||
* (they're not supposed to happen, and won't happen in 32-bit data mode).
|
||||
*/
|
||||
|
||||
vector_addrexcptn:
|
||||
b vector_addrexcptn
|
||||
|
||||
/*
|
||||
* We group all the following data together to optimise
|
||||
* for CPUs with separate I & D caches.
|
||||
*/
|
||||
.align 5
|
||||
|
||||
.LCvswi:
|
||||
.word vector_swi
|
||||
|
||||
.globl __stubs_end
|
||||
__stubs_end:
|
||||
|
||||
.equ stubs_offset, __vectors_start + 0x200 - __stubs_start
|
||||
|
||||
.globl __vectors_start
|
||||
.section .vectors, "ax", %progbits
|
||||
__vectors_start:
|
||||
ARM( swi SYS_ERROR0 )
|
||||
THUMB( svc #0 )
|
||||
THUMB( nop )
|
||||
W(b) vector_und + stubs_offset
|
||||
W(ldr) pc, .LCvswi + stubs_offset
|
||||
W(b) vector_pabt + stubs_offset
|
||||
W(b) vector_dabt + stubs_offset
|
||||
W(b) vector_addrexcptn + stubs_offset
|
||||
W(b) vector_irq + stubs_offset
|
||||
W(b) vector_fiq + stubs_offset
|
||||
|
||||
.globl __vectors_end
|
||||
__vectors_end:
|
||||
W(b) vector_rst
|
||||
W(b) vector_und
|
||||
W(ldr) pc, __vectors_start + 0x1000
|
||||
W(b) vector_pabt
|
||||
W(b) vector_dabt
|
||||
W(b) vector_addrexcptn
|
||||
W(b) vector_irq
|
||||
W(b) vector_fiq
|
||||
|
||||
.data
|
||||
|
||||
|
||||
@@ -53,7 +53,12 @@ armpmu_map_cache_event(const unsigned (*cache_map)
|
||||
static int
|
||||
armpmu_map_hw_event(const unsigned (*event_map)[PERF_COUNT_HW_MAX], u64 config)
|
||||
{
|
||||
int mapping = (*event_map)[config];
|
||||
int mapping;
|
||||
|
||||
if (config >= PERF_COUNT_HW_MAX)
|
||||
return -ENOENT;
|
||||
|
||||
mapping = (*event_map)[config];
|
||||
return mapping == HW_OP_UNSUPPORTED ? -ENOENT : mapping;
|
||||
}
|
||||
|
||||
|
||||
@@ -824,16 +824,26 @@ void __init early_trap_init(void *vectors_base)
|
||||
extern char __vectors_start[], __vectors_end[];
|
||||
extern char __kuser_helper_start[], __kuser_helper_end[];
|
||||
int kuser_sz = __kuser_helper_end - __kuser_helper_start;
|
||||
unsigned i;
|
||||
|
||||
vectors_page = vectors_base;
|
||||
|
||||
/*
|
||||
* Poison the vectors page with an undefined instruction. This
|
||||
* instruction is chosen to be undefined for both ARM and Thumb
|
||||
* ISAs. The Thumb version is an undefined instruction with a
|
||||
* branch back to the undefined instruction.
|
||||
*/
|
||||
for (i = 0; i < PAGE_SIZE / sizeof(u32); i++)
|
||||
((u32 *)vectors_base)[i] = 0xe7fddef1;
|
||||
|
||||
/*
|
||||
* Copy the vectors, stubs and kuser helpers (in entry-armv.S)
|
||||
* into the vector page, mapped at 0xffff0000, and ensure these
|
||||
* are visible to the instruction stream.
|
||||
*/
|
||||
memcpy((void *)vectors, __vectors_start, __vectors_end - __vectors_start);
|
||||
memcpy((void *)vectors + 0x200, __stubs_start, __stubs_end - __stubs_start);
|
||||
memcpy((void *)vectors + 0x1000, __stubs_start, __stubs_end - __stubs_start);
|
||||
memcpy((void *)vectors + 0x1000 - kuser_sz, __kuser_helper_start, kuser_sz);
|
||||
|
||||
/*
|
||||
@@ -848,6 +858,6 @@ void __init early_trap_init(void *vectors_base)
|
||||
memcpy((void *)(vectors + KERN_SIGRETURN_CODE - CONFIG_VECTORS_BASE),
|
||||
sigreturn_codes, sizeof(sigreturn_codes));
|
||||
|
||||
flush_icache_range(vectors, vectors + PAGE_SIZE);
|
||||
flush_icache_range(vectors, vectors + PAGE_SIZE * 2);
|
||||
modify_domain(DOMAIN_USER, DOMAIN_CLIENT);
|
||||
}
|
||||
|
||||
@@ -148,6 +148,23 @@ SECTIONS
|
||||
. = ALIGN(PAGE_SIZE);
|
||||
__init_begin = .;
|
||||
#endif
|
||||
/*
|
||||
* The vectors and stubs are relocatable code, and the
|
||||
* only thing that matters is their relative offsets
|
||||
*/
|
||||
__vectors_start = .;
|
||||
.vectors 0 : AT(__vectors_start) {
|
||||
*(.vectors)
|
||||
}
|
||||
. = __vectors_start + SIZEOF(.vectors);
|
||||
__vectors_end = .;
|
||||
|
||||
__stubs_start = .;
|
||||
.stubs 0x1000 : AT(__stubs_start) {
|
||||
*(.stubs)
|
||||
}
|
||||
. = __stubs_start + SIZEOF(.stubs);
|
||||
__stubs_end = .;
|
||||
|
||||
INIT_TEXT_SECTION(8)
|
||||
.exit.text : {
|
||||
|
||||
@@ -276,8 +276,6 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys)
|
||||
|
||||
sys->mem_offset = DC21285_PCI_MEM;
|
||||
|
||||
pci_ioremap_io(0, DC21285_PCI_IO);
|
||||
|
||||
pci_add_resource_offset(&sys->resources, &res[0], sys->mem_offset);
|
||||
pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset);
|
||||
|
||||
|
||||
@@ -1114,7 +1114,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
|
||||
/*
|
||||
* Allocate the vector page early.
|
||||
*/
|
||||
vectors = early_alloc(PAGE_SIZE);
|
||||
vectors = early_alloc(PAGE_SIZE * 2);
|
||||
|
||||
early_trap_init(vectors);
|
||||
|
||||
@@ -1164,10 +1164,18 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
|
||||
|
||||
if (!vectors_high()) {
|
||||
map.virtual = 0;
|
||||
map.length = PAGE_SIZE * 2;
|
||||
map.type = MT_LOW_VECTORS;
|
||||
create_mapping(&map);
|
||||
}
|
||||
|
||||
/* Now create a kernel read-only mapping */
|
||||
map.pfn += 1;
|
||||
map.virtual = 0xffff0000 + PAGE_SIZE;
|
||||
map.length = PAGE_SIZE;
|
||||
map.type = MT_LOW_VECTORS;
|
||||
create_mapping(&map);
|
||||
|
||||
/*
|
||||
* Ask the machine support to map in the statically mapped devices.
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ config MICROBLAZE
|
||||
select GENERIC_ATOMIC64
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select MODULES_USE_ELF_RELA
|
||||
select CLONE_BACKWARDS
|
||||
select CLONE_BACKWARDS3
|
||||
|
||||
config SWAP
|
||||
def_bool n
|
||||
|
||||
@@ -574,7 +574,7 @@ config SCHED_SMT
|
||||
config PPC_DENORMALISATION
|
||||
bool "PowerPC denormalisation exception handling"
|
||||
depends on PPC_BOOK3S_64
|
||||
default "n"
|
||||
default "y" if PPC_POWERNV
|
||||
---help---
|
||||
Add support for handling denormalisation of single precision
|
||||
values. Useful for bare metal only. If unsure say Y here.
|
||||
|
||||
@@ -698,7 +698,7 @@ static inline int find_next_bit_left(const unsigned long *addr,
|
||||
size -= offset;
|
||||
p = addr + offset / __BITOPS_WORDSIZE;
|
||||
if (bit) {
|
||||
set = __flo_word(0, *p & (~0UL << bit));
|
||||
set = __flo_word(0, *p & (~0UL >> bit));
|
||||
if (set >= size)
|
||||
return size + offset;
|
||||
if (set < __BITOPS_WORDSIZE)
|
||||
|
||||
@@ -613,14 +613,25 @@ static int __vcpu_run(struct kvm_vcpu *vcpu)
|
||||
kvm_s390_deliver_pending_interrupts(vcpu);
|
||||
|
||||
vcpu->arch.sie_block->icptcode = 0;
|
||||
preempt_disable();
|
||||
kvm_guest_enter();
|
||||
preempt_enable();
|
||||
VCPU_EVENT(vcpu, 6, "entering sie flags %x",
|
||||
atomic_read(&vcpu->arch.sie_block->cpuflags));
|
||||
trace_kvm_s390_sie_enter(vcpu,
|
||||
atomic_read(&vcpu->arch.sie_block->cpuflags));
|
||||
|
||||
/*
|
||||
* As PF_VCPU will be used in fault handler, between guest_enter
|
||||
* and guest_exit should be no uaccess.
|
||||
*/
|
||||
preempt_disable();
|
||||
kvm_guest_enter();
|
||||
preempt_enable();
|
||||
rc = sie64a(vcpu->arch.sie_block, vcpu->run->s.regs.gprs);
|
||||
kvm_guest_exit();
|
||||
|
||||
VCPU_EVENT(vcpu, 6, "exit sie icptcode %d",
|
||||
vcpu->arch.sie_block->icptcode);
|
||||
trace_kvm_s390_sie_exit(vcpu, vcpu->arch.sie_block->icptcode);
|
||||
|
||||
if (rc) {
|
||||
if (kvm_is_ucontrol(vcpu->kvm)) {
|
||||
rc = SIE_INTERCEPT_UCONTROL;
|
||||
@@ -631,10 +642,6 @@ static int __vcpu_run(struct kvm_vcpu *vcpu)
|
||||
rc = 0;
|
||||
}
|
||||
}
|
||||
VCPU_EVENT(vcpu, 6, "exit sie icptcode %d",
|
||||
vcpu->arch.sie_block->icptcode);
|
||||
trace_kvm_s390_sie_exit(vcpu, vcpu->arch.sie_block->icptcode);
|
||||
kvm_guest_exit();
|
||||
|
||||
memcpy(&vcpu->run->s.regs.gprs[14], &vcpu->arch.sie_block->gg14, 16);
|
||||
return rc;
|
||||
|
||||
@@ -315,8 +315,8 @@ static struct uncore_event_desc snbep_uncore_imc_events[] = {
|
||||
static struct uncore_event_desc snbep_uncore_qpi_events[] = {
|
||||
INTEL_UNCORE_EVENT_DESC(clockticks, "event=0x14"),
|
||||
INTEL_UNCORE_EVENT_DESC(txl_flits_active, "event=0x00,umask=0x06"),
|
||||
INTEL_UNCORE_EVENT_DESC(drs_data, "event=0x02,umask=0x08"),
|
||||
INTEL_UNCORE_EVENT_DESC(ncb_data, "event=0x03,umask=0x04"),
|
||||
INTEL_UNCORE_EVENT_DESC(drs_data, "event=0x102,umask=0x08"),
|
||||
INTEL_UNCORE_EVENT_DESC(ncb_data, "event=0x103,umask=0x04"),
|
||||
{ /* end: all zeroes */ },
|
||||
};
|
||||
|
||||
|
||||
@@ -196,15 +196,23 @@ static void __init ati_bugs_contd(int num, int slot, int func)
|
||||
static void __init intel_remapping_check(int num, int slot, int func)
|
||||
{
|
||||
u8 revision;
|
||||
u16 device;
|
||||
|
||||
device = read_pci_config_16(num, slot, func, PCI_DEVICE_ID);
|
||||
revision = read_pci_config_byte(num, slot, func, PCI_REVISION_ID);
|
||||
|
||||
/*
|
||||
* Revision 0x13 of this chipset supports irq remapping
|
||||
* but has an erratum that breaks its behavior, flag it as such
|
||||
* Revision 13 of all triggering devices id in this quirk have
|
||||
* a problem draining interrupts when irq remapping is enabled,
|
||||
* and should be flagged as broken. Additionally revisions 0x12
|
||||
* and 0x22 of device id 0x3405 has this problem.
|
||||
*/
|
||||
if (revision == 0x13)
|
||||
set_irq_remapping_broken();
|
||||
else if ((device == 0x3405) &&
|
||||
((revision == 0x12) ||
|
||||
(revision == 0x22)))
|
||||
set_irq_remapping_broken();
|
||||
|
||||
}
|
||||
|
||||
@@ -239,6 +247,8 @@ static struct chipset early_qrk[] __initdata = {
|
||||
PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs_contd },
|
||||
{ PCI_VENDOR_ID_INTEL, 0x3403, PCI_CLASS_BRIDGE_HOST,
|
||||
PCI_BASE_CLASS_BRIDGE, 0, intel_remapping_check },
|
||||
{ PCI_VENDOR_ID_INTEL, 0x3405, PCI_CLASS_BRIDGE_HOST,
|
||||
PCI_BASE_CLASS_BRIDGE, 0, intel_remapping_check },
|
||||
{ PCI_VENDOR_ID_INTEL, 0x3406, PCI_CLASS_BRIDGE_HOST,
|
||||
PCI_BASE_CLASS_BRIDGE, 0, intel_remapping_check },
|
||||
{}
|
||||
|
||||
@@ -116,7 +116,7 @@ static void __cpuinit mxcsr_feature_mask_init(void)
|
||||
|
||||
if (cpu_has_fxsr) {
|
||||
memset(&fx_scratch, 0, sizeof(struct i387_fxsave_struct));
|
||||
asm volatile("fxsave %0" : : "m" (fx_scratch));
|
||||
asm volatile("fxsave %0" : "+m" (fx_scratch));
|
||||
mask = fx_scratch.mxcsr_mask;
|
||||
if (mask == 0)
|
||||
mask = 0x0000ffbf;
|
||||
|
||||
@@ -117,6 +117,7 @@ struct acpi_battery {
|
||||
struct acpi_device *device;
|
||||
struct notifier_block pm_nb;
|
||||
unsigned long update_time;
|
||||
int revision;
|
||||
int rate_now;
|
||||
int capacity_now;
|
||||
int voltage_now;
|
||||
@@ -359,6 +360,7 @@ static struct acpi_offsets info_offsets[] = {
|
||||
};
|
||||
|
||||
static struct acpi_offsets extended_info_offsets[] = {
|
||||
{offsetof(struct acpi_battery, revision), 0},
|
||||
{offsetof(struct acpi_battery, power_unit), 0},
|
||||
{offsetof(struct acpi_battery, design_capacity), 0},
|
||||
{offsetof(struct acpi_battery, full_charge_capacity), 0},
|
||||
|
||||
@@ -311,11 +311,14 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset)
|
||||
dev->pnp.bus_id,
|
||||
(u32) dev->wakeup.sleep_state);
|
||||
|
||||
if (!dev->physical_node_count)
|
||||
mutex_lock(&dev->physical_node_lock);
|
||||
|
||||
if (!dev->physical_node_count) {
|
||||
seq_printf(seq, "%c%-8s\n",
|
||||
dev->wakeup.flags.run_wake ?
|
||||
'*' : ' ', "disabled");
|
||||
else {
|
||||
dev->wakeup.flags.run_wake ? '*' : ' ',
|
||||
device_may_wakeup(&dev->dev) ?
|
||||
"enabled" : "disabled");
|
||||
} else {
|
||||
struct device *ldev;
|
||||
list_for_each_entry(entry, &dev->physical_node_list,
|
||||
node) {
|
||||
@@ -337,6 +340,8 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset)
|
||||
put_device(ldev);
|
||||
}
|
||||
}
|
||||
|
||||
mutex_unlock(&dev->physical_node_lock);
|
||||
}
|
||||
mutex_unlock(&acpi_device_lock);
|
||||
return 0;
|
||||
@@ -346,12 +351,16 @@ static void physical_device_enable_wakeup(struct acpi_device *adev)
|
||||
{
|
||||
struct acpi_device_physical_node *entry;
|
||||
|
||||
mutex_lock(&adev->physical_node_lock);
|
||||
|
||||
list_for_each_entry(entry,
|
||||
&adev->physical_node_list, node)
|
||||
if (entry->dev && device_can_wakeup(entry->dev)) {
|
||||
bool enable = !device_may_wakeup(entry->dev);
|
||||
device_set_wakeup_enable(entry->dev, enable);
|
||||
}
|
||||
|
||||
mutex_unlock(&adev->physical_node_lock);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
|
||||
@@ -330,7 +330,7 @@ static const struct pci_device_id piix_pci_tbl[] = {
|
||||
/* SATA Controller IDE (Wellsburg) */
|
||||
{ 0x8086, 0x8d00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
|
||||
/* SATA Controller IDE (Wellsburg) */
|
||||
{ 0x8086, 0x8d08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
|
||||
{ 0x8086, 0x8d08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_snb },
|
||||
/* SATA Controller IDE (Wellsburg) */
|
||||
{ 0x8086, 0x8d60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
|
||||
/* SATA Controller IDE (Wellsburg) */
|
||||
|
||||
@@ -278,9 +278,12 @@ static struct port *find_port_by_devt_in_portdev(struct ports_device *portdev,
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&portdev->ports_lock, flags);
|
||||
list_for_each_entry(port, &portdev->ports, list)
|
||||
if (port->cdev->dev == dev)
|
||||
list_for_each_entry(port, &portdev->ports, list) {
|
||||
if (port->cdev->dev == dev) {
|
||||
kref_get(&port->kref);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
port = NULL;
|
||||
out:
|
||||
spin_unlock_irqrestore(&portdev->ports_lock, flags);
|
||||
@@ -752,6 +755,10 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf,
|
||||
|
||||
port = filp->private_data;
|
||||
|
||||
/* Port is hot-unplugged. */
|
||||
if (!port->guest_connected)
|
||||
return -ENODEV;
|
||||
|
||||
if (!port_has_data(port)) {
|
||||
/*
|
||||
* If nothing's connected on the host just return 0 in
|
||||
@@ -768,7 +775,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
/* Port got hot-unplugged. */
|
||||
/* Port got hot-unplugged while we were waiting above. */
|
||||
if (!port->guest_connected)
|
||||
return -ENODEV;
|
||||
/*
|
||||
@@ -938,13 +945,25 @@ static ssize_t port_fops_splice_write(struct pipe_inode_info *pipe,
|
||||
if (is_rproc_serial(port->out_vq->vdev))
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* pipe->nrbufs == 0 means there are no data to transfer,
|
||||
* so this returns just 0 for no data.
|
||||
*/
|
||||
pipe_lock(pipe);
|
||||
if (!pipe->nrbufs) {
|
||||
ret = 0;
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
ret = wait_port_writable(port, filp->f_flags & O_NONBLOCK);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
goto error_out;
|
||||
|
||||
buf = alloc_buf(port->out_vq, 0, pipe->nrbufs);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
if (!buf) {
|
||||
ret = -ENOMEM;
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
sgl.n = 0;
|
||||
sgl.len = 0;
|
||||
@@ -952,12 +971,17 @@ static ssize_t port_fops_splice_write(struct pipe_inode_info *pipe,
|
||||
sgl.sg = buf->sg;
|
||||
sg_init_table(sgl.sg, sgl.size);
|
||||
ret = __splice_from_pipe(pipe, &sd, pipe_to_sg);
|
||||
pipe_unlock(pipe);
|
||||
if (likely(ret > 0))
|
||||
ret = __send_to_port(port, buf->sg, sgl.n, sgl.len, buf, true);
|
||||
|
||||
if (unlikely(ret <= 0))
|
||||
free_buf(buf, true);
|
||||
return ret;
|
||||
|
||||
error_out:
|
||||
pipe_unlock(pipe);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static unsigned int port_fops_poll(struct file *filp, poll_table *wait)
|
||||
@@ -1025,14 +1049,14 @@ static int port_fops_open(struct inode *inode, struct file *filp)
|
||||
struct port *port;
|
||||
int ret;
|
||||
|
||||
/* We get the port with a kref here */
|
||||
port = find_port_by_devt(cdev->dev);
|
||||
if (!port) {
|
||||
/* Port was unplugged before we could proceed */
|
||||
return -ENXIO;
|
||||
}
|
||||
filp->private_data = port;
|
||||
|
||||
/* Prevent against a port getting hot-unplugged at the same time */
|
||||
spin_lock_irq(&port->portdev->ports_lock);
|
||||
kref_get(&port->kref);
|
||||
spin_unlock_irq(&port->portdev->ports_lock);
|
||||
|
||||
/*
|
||||
* Don't allow opening of console port devices -- that's done
|
||||
* via /dev/hvc
|
||||
@@ -1504,14 +1528,6 @@ static void remove_port(struct kref *kref)
|
||||
|
||||
port = container_of(kref, struct port, kref);
|
||||
|
||||
sysfs_remove_group(&port->dev->kobj, &port_attribute_group);
|
||||
device_destroy(pdrvdata.class, port->dev->devt);
|
||||
cdev_del(port->cdev);
|
||||
|
||||
kfree(port->name);
|
||||
|
||||
debugfs_remove(port->debugfs_file);
|
||||
|
||||
kfree(port);
|
||||
}
|
||||
|
||||
@@ -1545,12 +1561,14 @@ static void unplug_port(struct port *port)
|
||||
spin_unlock_irq(&port->portdev->ports_lock);
|
||||
|
||||
if (port->guest_connected) {
|
||||
port->guest_connected = false;
|
||||
port->host_connected = false;
|
||||
wake_up_interruptible(&port->waitqueue);
|
||||
|
||||
/* Let the app know the port is going down. */
|
||||
send_sigio_to_port(port);
|
||||
|
||||
/* Do this after sigio is actually sent */
|
||||
port->guest_connected = false;
|
||||
port->host_connected = false;
|
||||
|
||||
wake_up_interruptible(&port->waitqueue);
|
||||
}
|
||||
|
||||
if (is_console_port(port)) {
|
||||
@@ -1569,6 +1587,14 @@ static void unplug_port(struct port *port)
|
||||
*/
|
||||
port->portdev = NULL;
|
||||
|
||||
sysfs_remove_group(&port->dev->kobj, &port_attribute_group);
|
||||
device_destroy(pdrvdata.class, port->dev->devt);
|
||||
cdev_del(port->cdev);
|
||||
|
||||
kfree(port->name);
|
||||
|
||||
debugfs_remove(port->debugfs_file);
|
||||
|
||||
/*
|
||||
* Locks around here are not necessary - a port can't be
|
||||
* opened after we removed the port struct from ports_list
|
||||
|
||||
@@ -28,13 +28,6 @@
|
||||
#define MAX_INTERESTING 50000
|
||||
#define STDDEV_THRESH 400
|
||||
|
||||
/* 60 * 60 > STDDEV_THRESH * INTERVALS = 400 * 8 */
|
||||
#define MAX_DEVIATION 60
|
||||
|
||||
static DEFINE_PER_CPU(struct hrtimer, menu_hrtimer);
|
||||
static DEFINE_PER_CPU(int, hrtimer_status);
|
||||
/* menu hrtimer mode */
|
||||
enum {MENU_HRTIMER_STOP, MENU_HRTIMER_REPEAT, MENU_HRTIMER_GENERAL};
|
||||
|
||||
/*
|
||||
* Concepts and ideas behind the menu governor
|
||||
@@ -116,13 +109,6 @@ enum {MENU_HRTIMER_STOP, MENU_HRTIMER_REPEAT, MENU_HRTIMER_GENERAL};
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The C-state residency is so long that is is worthwhile to exit
|
||||
* from the shallow C-state and re-enter into a deeper C-state.
|
||||
*/
|
||||
static unsigned int perfect_cstate_ms __read_mostly = 30;
|
||||
module_param(perfect_cstate_ms, uint, 0000);
|
||||
|
||||
struct menu_device {
|
||||
int last_state_idx;
|
||||
int needs_update;
|
||||
@@ -205,40 +191,6 @@ static u64 div_round64(u64 dividend, u32 divisor)
|
||||
return div_u64(dividend + (divisor / 2), divisor);
|
||||
}
|
||||
|
||||
/* Cancel the hrtimer if it is not triggered yet */
|
||||
void menu_hrtimer_cancel(void)
|
||||
{
|
||||
int cpu = smp_processor_id();
|
||||
struct hrtimer *hrtmr = &per_cpu(menu_hrtimer, cpu);
|
||||
|
||||
/* The timer is still not time out*/
|
||||
if (per_cpu(hrtimer_status, cpu)) {
|
||||
hrtimer_cancel(hrtmr);
|
||||
per_cpu(hrtimer_status, cpu) = MENU_HRTIMER_STOP;
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(menu_hrtimer_cancel);
|
||||
|
||||
/* Call back for hrtimer is triggered */
|
||||
static enum hrtimer_restart menu_hrtimer_notify(struct hrtimer *hrtimer)
|
||||
{
|
||||
int cpu = smp_processor_id();
|
||||
struct menu_device *data = &per_cpu(menu_devices, cpu);
|
||||
|
||||
/* In general case, the expected residency is much larger than
|
||||
* deepest C-state target residency, but prediction logic still
|
||||
* predicts a small predicted residency, so the prediction
|
||||
* history is totally broken if the timer is triggered.
|
||||
* So reset the correction factor.
|
||||
*/
|
||||
if (per_cpu(hrtimer_status, cpu) == MENU_HRTIMER_GENERAL)
|
||||
data->correction_factor[data->bucket] = RESOLUTION * DECAY;
|
||||
|
||||
per_cpu(hrtimer_status, cpu) = MENU_HRTIMER_STOP;
|
||||
|
||||
return HRTIMER_NORESTART;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try detecting repeating patterns by keeping track of the last 8
|
||||
* intervals, and checking if the standard deviation of that set
|
||||
@@ -315,9 +267,6 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
|
||||
int i;
|
||||
int multiplier;
|
||||
struct timespec t;
|
||||
int repeat = 0, low_predicted = 0;
|
||||
int cpu = smp_processor_id();
|
||||
struct hrtimer *hrtmr = &per_cpu(menu_hrtimer, cpu);
|
||||
|
||||
if (data->needs_update) {
|
||||
menu_update(drv, dev);
|
||||
@@ -352,7 +301,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
|
||||
data->predicted_us = div_round64(data->expected_us * data->correction_factor[data->bucket],
|
||||
RESOLUTION * DECAY);
|
||||
|
||||
repeat = get_typical_interval(data);
|
||||
get_typical_interval(data);
|
||||
|
||||
/*
|
||||
* We want to default to C1 (hlt), not to busy polling
|
||||
@@ -373,10 +322,8 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
|
||||
|
||||
if (s->disabled || su->disable)
|
||||
continue;
|
||||
if (s->target_residency > data->predicted_us) {
|
||||
low_predicted = 1;
|
||||
if (s->target_residency > data->predicted_us)
|
||||
continue;
|
||||
}
|
||||
if (s->exit_latency > latency_req)
|
||||
continue;
|
||||
if (s->exit_latency * multiplier > data->predicted_us)
|
||||
@@ -386,44 +333,6 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
|
||||
data->exit_us = s->exit_latency;
|
||||
}
|
||||
|
||||
/* not deepest C-state chosen for low predicted residency */
|
||||
if (low_predicted) {
|
||||
unsigned int timer_us = 0;
|
||||
unsigned int perfect_us = 0;
|
||||
|
||||
/*
|
||||
* Set a timer to detect whether this sleep is much
|
||||
* longer than repeat mode predicted. If the timer
|
||||
* triggers, the code will evaluate whether to put
|
||||
* the CPU into a deeper C-state.
|
||||
* The timer is cancelled on CPU wakeup.
|
||||
*/
|
||||
timer_us = 2 * (data->predicted_us + MAX_DEVIATION);
|
||||
|
||||
perfect_us = perfect_cstate_ms * 1000;
|
||||
|
||||
if (repeat && (4 * timer_us < data->expected_us)) {
|
||||
RCU_NONIDLE(hrtimer_start(hrtmr,
|
||||
ns_to_ktime(1000 * timer_us),
|
||||
HRTIMER_MODE_REL_PINNED));
|
||||
/* In repeat case, menu hrtimer is started */
|
||||
per_cpu(hrtimer_status, cpu) = MENU_HRTIMER_REPEAT;
|
||||
} else if (perfect_us < data->expected_us) {
|
||||
/*
|
||||
* The next timer is long. This could be because
|
||||
* we did not make a useful prediction.
|
||||
* In that case, it makes sense to re-enter
|
||||
* into a deeper C-state after some time.
|
||||
*/
|
||||
RCU_NONIDLE(hrtimer_start(hrtmr,
|
||||
ns_to_ktime(1000 * timer_us),
|
||||
HRTIMER_MODE_REL_PINNED));
|
||||
/* In general case, menu hrtimer is started */
|
||||
per_cpu(hrtimer_status, cpu) = MENU_HRTIMER_GENERAL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return data->last_state_idx;
|
||||
}
|
||||
|
||||
@@ -514,9 +423,6 @@ static int menu_enable_device(struct cpuidle_driver *drv,
|
||||
struct cpuidle_device *dev)
|
||||
{
|
||||
struct menu_device *data = &per_cpu(menu_devices, dev->cpu);
|
||||
struct hrtimer *t = &per_cpu(menu_hrtimer, dev->cpu);
|
||||
hrtimer_init(t, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
|
||||
t->function = menu_hrtimer_notify;
|
||||
|
||||
memset(data, 0, sizeof(struct menu_device));
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#define FW_CDEV_KERNEL_VERSION 5
|
||||
#define FW_CDEV_VERSION_EVENT_REQUEST2 4
|
||||
#define FW_CDEV_VERSION_ALLOCATE_REGION_END 4
|
||||
#define FW_CDEV_VERSION_AUTO_FLUSH_ISO_OVERFLOW 5
|
||||
|
||||
struct client {
|
||||
u32 version;
|
||||
@@ -1009,6 +1010,8 @@ static int ioctl_create_iso_context(struct client *client, union ioctl_arg *arg)
|
||||
a->channel, a->speed, a->header_size, cb, client);
|
||||
if (IS_ERR(context))
|
||||
return PTR_ERR(context);
|
||||
if (client->version < FW_CDEV_VERSION_AUTO_FLUSH_ISO_OVERFLOW)
|
||||
context->drop_overflow_headers = true;
|
||||
|
||||
/* We only support one context at this time. */
|
||||
spin_lock_irq(&client->lock);
|
||||
|
||||
@@ -2729,8 +2729,11 @@ static void copy_iso_headers(struct iso_context *ctx, const u32 *dma_hdr)
|
||||
{
|
||||
u32 *ctx_hdr;
|
||||
|
||||
if (ctx->header_length + ctx->base.header_size > PAGE_SIZE)
|
||||
if (ctx->header_length + ctx->base.header_size > PAGE_SIZE) {
|
||||
if (ctx->base.drop_overflow_headers)
|
||||
return;
|
||||
flush_iso_completions(ctx);
|
||||
}
|
||||
|
||||
ctx_hdr = ctx->header + ctx->header_length;
|
||||
ctx->last_timestamp = (u16)le32_to_cpu((__force __le32)dma_hdr[0]);
|
||||
@@ -2890,8 +2893,11 @@ static int handle_it_packet(struct context *context,
|
||||
|
||||
sync_it_packet_for_cpu(context, d);
|
||||
|
||||
if (ctx->header_length + 4 > PAGE_SIZE)
|
||||
if (ctx->header_length + 4 > PAGE_SIZE) {
|
||||
if (ctx->base.drop_overflow_headers)
|
||||
return 1;
|
||||
flush_iso_completions(ctx);
|
||||
}
|
||||
|
||||
ctx_hdr = ctx->header + ctx->header_length;
|
||||
ctx->last_timestamp = le16_to_cpu(last->res_count);
|
||||
|
||||
@@ -348,6 +348,7 @@ int ast_bo_create(struct drm_device *dev, int size, int align,
|
||||
|
||||
astbo->gem.driver_private = NULL;
|
||||
astbo->bo.bdev = &ast->ttm.bdev;
|
||||
astbo->bo.bdev->dev_mapping = dev->dev_mapping;
|
||||
|
||||
ast_ttm_placement(astbo, TTM_PL_FLAG_VRAM | TTM_PL_FLAG_SYSTEM);
|
||||
|
||||
|
||||
@@ -353,6 +353,7 @@ int cirrus_bo_create(struct drm_device *dev, int size, int align,
|
||||
|
||||
cirrusbo->gem.driver_private = NULL;
|
||||
cirrusbo->bo.bdev = &cirrus->ttm.bdev;
|
||||
cirrusbo->bo.bdev->dev_mapping = dev->dev_mapping;
|
||||
|
||||
cirrus_ttm_placement(cirrusbo, TTM_PL_FLAG_VRAM | TTM_PL_FLAG_SYSTEM);
|
||||
|
||||
|
||||
@@ -704,7 +704,10 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
|
||||
/* Subtract time delta from raw timestamp to get final
|
||||
* vblank_time timestamp for end of vblank.
|
||||
*/
|
||||
etime = ktime_sub_ns(etime, delta_ns);
|
||||
if (delta_ns < 0)
|
||||
etime = ktime_add_ns(etime, -delta_ns);
|
||||
else
|
||||
etime = ktime_sub_ns(etime, delta_ns);
|
||||
*vblank_time = ktime_to_timeval(etime);
|
||||
|
||||
DRM_DEBUG("crtc %d : v %d p(%d,%d)@ %ld.%ld -> %ld.%ld [e %d us, %d rep]\n",
|
||||
|
||||
@@ -1469,6 +1469,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
|
||||
spin_lock_init(&dev_priv->error_lock);
|
||||
spin_lock_init(&dev_priv->rps.lock);
|
||||
spin_lock_init(&dev_priv->dpio_lock);
|
||||
spin_lock_init(&dev_priv->gt_lock);
|
||||
mutex_init(&dev_priv->rps.hw_lock);
|
||||
|
||||
i915_dump_device_info(dev_priv);
|
||||
@@ -1560,6 +1561,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
|
||||
intel_detect_pch(dev);
|
||||
|
||||
intel_irq_init(dev);
|
||||
intel_pm_init(dev);
|
||||
intel_gt_sanitize(dev);
|
||||
intel_gt_init(dev);
|
||||
|
||||
|
||||
@@ -1328,6 +1328,7 @@ void i915_hangcheck_elapsed(unsigned long data);
|
||||
void i915_handle_error(struct drm_device *dev, bool wedged);
|
||||
|
||||
extern void intel_irq_init(struct drm_device *dev);
|
||||
extern void intel_pm_init(struct drm_device *dev);
|
||||
extern void intel_gt_init(struct drm_device *dev);
|
||||
extern void intel_gt_sanitize(struct drm_device *dev);
|
||||
|
||||
|
||||
@@ -2602,14 +2602,14 @@
|
||||
#define _PIPEB_GMCH_DATA_M 0x71050
|
||||
|
||||
/* Transfer unit size for display port - 1, default is 0x3f (for TU size 64) */
|
||||
#define PIPE_GMCH_DATA_M_TU_SIZE_MASK (0x3f << 25)
|
||||
#define PIPE_GMCH_DATA_M_TU_SIZE_SHIFT 25
|
||||
#define TU_SIZE(x) (((x)-1) << 25) /* default size 64 */
|
||||
#define TU_SIZE_MASK (0x3f << 25)
|
||||
|
||||
#define PIPE_GMCH_DATA_M_MASK (0xffffff)
|
||||
#define DATA_LINK_M_N_MASK (0xffffff)
|
||||
#define DATA_LINK_N_MAX (0x800000)
|
||||
|
||||
#define _PIPEA_GMCH_DATA_N 0x70054
|
||||
#define _PIPEB_GMCH_DATA_N 0x71054
|
||||
#define PIPE_GMCH_DATA_N_MASK (0xffffff)
|
||||
|
||||
/*
|
||||
* Computing Link M and N values for the Display Port link
|
||||
@@ -2624,11 +2624,9 @@
|
||||
|
||||
#define _PIPEA_DP_LINK_M 0x70060
|
||||
#define _PIPEB_DP_LINK_M 0x71060
|
||||
#define PIPEA_DP_LINK_M_MASK (0xffffff)
|
||||
|
||||
#define _PIPEA_DP_LINK_N 0x70064
|
||||
#define _PIPEB_DP_LINK_N 0x71064
|
||||
#define PIPEA_DP_LINK_N_MASK (0xffffff)
|
||||
|
||||
#define PIPE_GMCH_DATA_M(pipe) _PIPE(pipe, _PIPEA_GMCH_DATA_M, _PIPEB_GMCH_DATA_M)
|
||||
#define PIPE_GMCH_DATA_N(pipe) _PIPE(pipe, _PIPEA_GMCH_DATA_N, _PIPEB_GMCH_DATA_N)
|
||||
@@ -3294,8 +3292,6 @@
|
||||
|
||||
|
||||
#define _PIPEA_DATA_M1 0x60030
|
||||
#define TU_SIZE(x) (((x)-1) << 25) /* default size 64 */
|
||||
#define TU_SIZE_MASK 0x7e000000
|
||||
#define PIPE_DATA_M1_OFFSET 0
|
||||
#define _PIPEA_DATA_N1 0x60034
|
||||
#define PIPE_DATA_N1_OFFSET 0
|
||||
|
||||
@@ -4045,26 +4045,33 @@ struct fdi_m_n {
|
||||
static void
|
||||
fdi_reduce_ratio(u32 *num, u32 *den)
|
||||
{
|
||||
while (*num > 0xffffff || *den > 0xffffff) {
|
||||
while (*num > DATA_LINK_M_N_MASK ||
|
||||
*den > DATA_LINK_M_N_MASK) {
|
||||
*num >>= 1;
|
||||
*den >>= 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void compute_m_n(unsigned int m, unsigned int n,
|
||||
uint32_t *ret_m, uint32_t *ret_n)
|
||||
{
|
||||
*ret_n = min_t(unsigned int, roundup_pow_of_two(n), DATA_LINK_N_MAX);
|
||||
*ret_m = div_u64((uint64_t) m * *ret_n, n);
|
||||
fdi_reduce_ratio(ret_m, ret_n);
|
||||
}
|
||||
|
||||
static void
|
||||
ironlake_compute_m_n(int bits_per_pixel, int nlanes, int pixel_clock,
|
||||
int link_clock, struct fdi_m_n *m_n)
|
||||
{
|
||||
m_n->tu = 64; /* default size */
|
||||
|
||||
/* BUG_ON(pixel_clock > INT_MAX / 36); */
|
||||
m_n->gmch_m = bits_per_pixel * pixel_clock;
|
||||
m_n->gmch_n = link_clock * nlanes * 8;
|
||||
fdi_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n);
|
||||
compute_m_n(bits_per_pixel * pixel_clock,
|
||||
link_clock * nlanes * 8,
|
||||
&m_n->gmch_m, &m_n->gmch_n);
|
||||
|
||||
m_n->link_m = pixel_clock;
|
||||
m_n->link_n = link_clock;
|
||||
fdi_reduce_ratio(&m_n->link_m, &m_n->link_n);
|
||||
compute_m_n(pixel_clock, link_clock,
|
||||
&m_n->link_m, &m_n->link_n);
|
||||
}
|
||||
|
||||
static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
|
||||
|
||||
@@ -295,6 +295,17 @@ void intel_panel_disable_backlight(struct drm_device *dev)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
/*
|
||||
* Do not disable backlight on the vgaswitcheroo path. When switching
|
||||
* away from i915, the other client may depend on i915 to handle the
|
||||
* backlight. This will leave the backlight on unnecessarily when
|
||||
* another client is not activated.
|
||||
*/
|
||||
if (dev->switch_power_state == DRM_SWITCH_POWER_CHANGING) {
|
||||
DRM_DEBUG_DRIVER("Skipping backlight disable on vga switch\n");
|
||||
return;
|
||||
}
|
||||
|
||||
dev_priv->backlight_enabled = false;
|
||||
intel_panel_actually_set_backlight(dev, 0);
|
||||
|
||||
|
||||
@@ -4408,8 +4408,6 @@ void intel_gt_init(struct drm_device *dev)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
spin_lock_init(&dev_priv->gt_lock);
|
||||
|
||||
if (IS_VALLEYVIEW(dev)) {
|
||||
dev_priv->gt.force_wake_get = vlv_force_wake_get;
|
||||
dev_priv->gt.force_wake_put = vlv_force_wake_put;
|
||||
@@ -4449,6 +4447,12 @@ void intel_gt_init(struct drm_device *dev)
|
||||
dev_priv->gt.force_wake_get = __gen6_gt_force_wake_get;
|
||||
dev_priv->gt.force_wake_put = __gen6_gt_force_wake_put;
|
||||
}
|
||||
}
|
||||
|
||||
void intel_pm_init(struct drm_device *dev)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
INIT_DELAYED_WORK(&dev_priv->rps.delayed_resume_work,
|
||||
intel_gen6_powersave_work);
|
||||
}
|
||||
|
||||
@@ -347,6 +347,7 @@ int mgag200_bo_create(struct drm_device *dev, int size, int align,
|
||||
|
||||
mgabo->gem.driver_private = NULL;
|
||||
mgabo->bo.bdev = &mdev->ttm.bdev;
|
||||
mgabo->bo.bdev->dev_mapping = dev->dev_mapping;
|
||||
|
||||
mgag200_ttm_placement(mgabo, TTM_PL_FLAG_VRAM | TTM_PL_FLAG_SYSTEM);
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ nv10_fence_context_new(struct nouveau_channel *chan)
|
||||
struct ttm_mem_reg *mem = &priv->bo->bo.mem;
|
||||
struct nouveau_object *object;
|
||||
u32 start = mem->start * PAGE_SIZE;
|
||||
u32 limit = mem->start + mem->size - 1;
|
||||
u32 limit = start + mem->size - 1;
|
||||
|
||||
ret = nouveau_object_new(nv_object(chan->cli), chan->handle,
|
||||
NvSema, 0x0002,
|
||||
|
||||
@@ -50,6 +50,8 @@ nv50_fence_context_new(struct nouveau_channel *chan)
|
||||
struct nv50_fence_chan *fctx;
|
||||
struct ttm_mem_reg *mem = &priv->bo->bo.mem;
|
||||
struct nouveau_object *object;
|
||||
u32 start = mem->start * PAGE_SIZE;
|
||||
u32 limit = start + mem->size - 1;
|
||||
int ret, i;
|
||||
|
||||
fctx = chan->fence = kzalloc(sizeof(*fctx), GFP_KERNEL);
|
||||
@@ -59,26 +61,28 @@ nv50_fence_context_new(struct nouveau_channel *chan)
|
||||
nouveau_fence_context_new(&fctx->base);
|
||||
|
||||
ret = nouveau_object_new(nv_object(chan->cli), chan->handle,
|
||||
NvSema, 0x0002,
|
||||
NvSema, 0x003d,
|
||||
&(struct nv_dma_class) {
|
||||
.flags = NV_DMA_TARGET_VRAM |
|
||||
NV_DMA_ACCESS_RDWR,
|
||||
.start = mem->start * PAGE_SIZE,
|
||||
.limit = mem->size - 1,
|
||||
.start = start,
|
||||
.limit = limit,
|
||||
}, sizeof(struct nv_dma_class),
|
||||
&object);
|
||||
|
||||
/* dma objects for display sync channel semaphore blocks */
|
||||
for (i = 0; !ret && i < dev->mode_config.num_crtc; i++) {
|
||||
struct nouveau_bo *bo = nv50_display_crtc_sema(dev, i);
|
||||
u32 start = bo->bo.mem.start * PAGE_SIZE;
|
||||
u32 limit = start + bo->bo.mem.size - 1;
|
||||
|
||||
ret = nouveau_object_new(nv_object(chan->cli), chan->handle,
|
||||
NvEvoSema0 + i, 0x003d,
|
||||
&(struct nv_dma_class) {
|
||||
.flags = NV_DMA_TARGET_VRAM |
|
||||
NV_DMA_ACCESS_RDWR,
|
||||
.start = bo->bo.offset,
|
||||
.limit = bo->bo.offset + 0xfff,
|
||||
.start = start,
|
||||
.limit = limit,
|
||||
}, sizeof(struct nv_dma_class),
|
||||
&object);
|
||||
}
|
||||
|
||||
@@ -1222,12 +1222,17 @@ int atom_execute_table(struct atom_context *ctx, int index, uint32_t * params)
|
||||
int r;
|
||||
|
||||
mutex_lock(&ctx->mutex);
|
||||
/* reset data block */
|
||||
ctx->data_block = 0;
|
||||
/* reset reg block */
|
||||
ctx->reg_block = 0;
|
||||
/* reset fb window */
|
||||
ctx->fb_base = 0;
|
||||
/* reset io mode */
|
||||
ctx->io_mode = ATOM_IO_MM;
|
||||
/* reset divmul */
|
||||
ctx->divmul[0] = 0;
|
||||
ctx->divmul[1] = 0;
|
||||
r = atom_execute_table_locked(ctx, index, params);
|
||||
mutex_unlock(&ctx->mutex);
|
||||
return r;
|
||||
|
||||
@@ -44,6 +44,41 @@ static char *pre_emph_names[] = {
|
||||
};
|
||||
|
||||
/***** radeon AUX functions *****/
|
||||
|
||||
/* Atom needs data in little endian format
|
||||
* so swap as appropriate when copying data to
|
||||
* or from atom. Note that atom operates on
|
||||
* dw units.
|
||||
*/
|
||||
static void radeon_copy_swap(u8 *dst, u8 *src, u8 num_bytes, bool to_le)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
u8 src_tmp[20], dst_tmp[20]; /* used for byteswapping */
|
||||
u32 *dst32, *src32;
|
||||
int i;
|
||||
|
||||
memcpy(src_tmp, src, num_bytes);
|
||||
src32 = (u32 *)src_tmp;
|
||||
dst32 = (u32 *)dst_tmp;
|
||||
if (to_le) {
|
||||
for (i = 0; i < ((num_bytes + 3) / 4); i++)
|
||||
dst32[i] = cpu_to_le32(src32[i]);
|
||||
memcpy(dst, dst_tmp, num_bytes);
|
||||
} else {
|
||||
u8 dws = num_bytes & ~3;
|
||||
for (i = 0; i < ((num_bytes + 3) / 4); i++)
|
||||
dst32[i] = le32_to_cpu(src32[i]);
|
||||
memcpy(dst, dst_tmp, dws);
|
||||
if (num_bytes % 4) {
|
||||
for (i = 0; i < (num_bytes % 4); i++)
|
||||
dst[dws+i] = dst_tmp[dws+i];
|
||||
}
|
||||
}
|
||||
#else
|
||||
memcpy(dst, src, num_bytes);
|
||||
#endif
|
||||
}
|
||||
|
||||
union aux_channel_transaction {
|
||||
PROCESS_AUX_CHANNEL_TRANSACTION_PS_ALLOCATION v1;
|
||||
PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS_V2 v2;
|
||||
@@ -65,10 +100,10 @@ static int radeon_process_aux_ch(struct radeon_i2c_chan *chan,
|
||||
|
||||
base = (unsigned char *)(rdev->mode_info.atom_context->scratch + 1);
|
||||
|
||||
memcpy(base, send, send_bytes);
|
||||
radeon_copy_swap(base, send, send_bytes, true);
|
||||
|
||||
args.v1.lpAuxRequest = 0 + 4;
|
||||
args.v1.lpDataOut = 16 + 4;
|
||||
args.v1.lpAuxRequest = cpu_to_le16((u16)(0 + 4));
|
||||
args.v1.lpDataOut = cpu_to_le16((u16)(16 + 4));
|
||||
args.v1.ucDataOutLen = 0;
|
||||
args.v1.ucChannelID = chan->rec.i2c_id;
|
||||
args.v1.ucDelay = delay / 10;
|
||||
@@ -102,7 +137,7 @@ static int radeon_process_aux_ch(struct radeon_i2c_chan *chan,
|
||||
recv_bytes = recv_size;
|
||||
|
||||
if (recv && recv_size)
|
||||
memcpy(recv, base + 16, recv_bytes);
|
||||
radeon_copy_swap(recv, base + 16, recv_bytes, false);
|
||||
|
||||
return recv_bytes;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ static uint16_t combios_get_table_offset(struct drm_device *dev,
|
||||
enum radeon_combios_table_offset table)
|
||||
{
|
||||
struct radeon_device *rdev = dev->dev_private;
|
||||
int rev;
|
||||
int rev, size;
|
||||
uint16_t offset = 0, check_offset;
|
||||
|
||||
if (!rdev->bios)
|
||||
@@ -156,174 +156,106 @@ static uint16_t combios_get_table_offset(struct drm_device *dev,
|
||||
switch (table) {
|
||||
/* absolute offset tables */
|
||||
case COMBIOS_ASIC_INIT_1_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0xc);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0xc;
|
||||
break;
|
||||
case COMBIOS_BIOS_SUPPORT_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x14);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x14;
|
||||
break;
|
||||
case COMBIOS_DAC_PROGRAMMING_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x2a);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x2a;
|
||||
break;
|
||||
case COMBIOS_MAX_COLOR_DEPTH_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x2c);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x2c;
|
||||
break;
|
||||
case COMBIOS_CRTC_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x2e);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x2e;
|
||||
break;
|
||||
case COMBIOS_PLL_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x30);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x30;
|
||||
break;
|
||||
case COMBIOS_TV_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x32);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x32;
|
||||
break;
|
||||
case COMBIOS_DFP_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x34);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x34;
|
||||
break;
|
||||
case COMBIOS_HW_CONFIG_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x36);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x36;
|
||||
break;
|
||||
case COMBIOS_MULTIMEDIA_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x38);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x38;
|
||||
break;
|
||||
case COMBIOS_TV_STD_PATCH_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x3e);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x3e;
|
||||
break;
|
||||
case COMBIOS_LCD_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x40);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x40;
|
||||
break;
|
||||
case COMBIOS_MOBILE_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x42);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x42;
|
||||
break;
|
||||
case COMBIOS_PLL_INIT_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x46);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x46;
|
||||
break;
|
||||
case COMBIOS_MEM_CONFIG_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x48);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x48;
|
||||
break;
|
||||
case COMBIOS_SAVE_MASK_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x4a);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x4a;
|
||||
break;
|
||||
case COMBIOS_HARDCODED_EDID_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x4c);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x4c;
|
||||
break;
|
||||
case COMBIOS_ASIC_INIT_2_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x4e);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x4e;
|
||||
break;
|
||||
case COMBIOS_CONNECTOR_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x50);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x50;
|
||||
break;
|
||||
case COMBIOS_DYN_CLK_1_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x52);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x52;
|
||||
break;
|
||||
case COMBIOS_RESERVED_MEM_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x54);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x54;
|
||||
break;
|
||||
case COMBIOS_EXT_TMDS_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x58);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x58;
|
||||
break;
|
||||
case COMBIOS_MEM_CLK_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x5a);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x5a;
|
||||
break;
|
||||
case COMBIOS_EXT_DAC_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x5c);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x5c;
|
||||
break;
|
||||
case COMBIOS_MISC_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x5e);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x5e;
|
||||
break;
|
||||
case COMBIOS_CRT_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x60);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x60;
|
||||
break;
|
||||
case COMBIOS_INTEGRATED_SYSTEM_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x62);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x62;
|
||||
break;
|
||||
case COMBIOS_COMPONENT_VIDEO_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x64);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x64;
|
||||
break;
|
||||
case COMBIOS_FAN_SPEED_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x66);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x66;
|
||||
break;
|
||||
case COMBIOS_OVERDRIVE_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x68);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x68;
|
||||
break;
|
||||
case COMBIOS_OEM_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x6a);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x6a;
|
||||
break;
|
||||
case COMBIOS_DYN_CLK_2_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x6c);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x6c;
|
||||
break;
|
||||
case COMBIOS_POWER_CONNECTOR_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x6e);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x6e;
|
||||
break;
|
||||
case COMBIOS_I2C_INFO_TABLE:
|
||||
check_offset = RBIOS16(rdev->bios_header_start + 0x70);
|
||||
if (check_offset)
|
||||
offset = check_offset;
|
||||
check_offset = 0x70;
|
||||
break;
|
||||
/* relative offset tables */
|
||||
case COMBIOS_ASIC_INIT_3_TABLE: /* offset from misc info */
|
||||
@@ -439,11 +371,16 @@ static uint16_t combios_get_table_offset(struct drm_device *dev,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
check_offset = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return offset;
|
||||
size = RBIOS8(rdev->bios_header_start + 0x6);
|
||||
/* check absolute offset tables */
|
||||
if (table < COMBIOS_ASIC_INIT_3_TABLE && check_offset && check_offset < size)
|
||||
offset = RBIOS16(rdev->bios_header_start + check_offset);
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
bool radeon_combios_check_hardcoded_edid(struct radeon_device *rdev)
|
||||
@@ -965,16 +902,22 @@ struct radeon_encoder_primary_dac *radeon_combios_get_primary_dac_info(struct
|
||||
dac = RBIOS8(dac_info + 0x3) & 0xf;
|
||||
p_dac->ps2_pdac_adj = (bg << 8) | (dac);
|
||||
}
|
||||
/* if the values are all zeros, use the table */
|
||||
if (p_dac->ps2_pdac_adj)
|
||||
/* if the values are zeros, use the table */
|
||||
if ((dac == 0) || (bg == 0))
|
||||
found = 0;
|
||||
else
|
||||
found = 1;
|
||||
}
|
||||
|
||||
/* quirks */
|
||||
/* Radeon 9100 (R200) */
|
||||
if ((dev->pdev->device == 0x514D) &&
|
||||
/* Radeon 7000 (RV100) */
|
||||
if (((dev->pdev->device == 0x5159) &&
|
||||
(dev->pdev->subsystem_vendor == 0x174B) &&
|
||||
(dev->pdev->subsystem_device == 0x7149)) {
|
||||
(dev->pdev->subsystem_device == 0x7c28)) ||
|
||||
/* Radeon 9100 (R200) */
|
||||
((dev->pdev->device == 0x514D) &&
|
||||
(dev->pdev->subsystem_vendor == 0x174B) &&
|
||||
(dev->pdev->subsystem_device == 0x7149))) {
|
||||
/* vbios value is bad, use the default */
|
||||
found = 0;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ static inline int adt7470_write_word_data(struct i2c_client *client, u8 reg,
|
||||
u16 value)
|
||||
{
|
||||
return i2c_smbus_write_byte_data(client, reg, value & 0xFF)
|
||||
&& i2c_smbus_write_byte_data(client, reg + 1, value >> 8);
|
||||
|| i2c_smbus_write_byte_data(client, reg + 1, value >> 8);
|
||||
}
|
||||
|
||||
static void adt7470_init_client(struct i2c_client *client)
|
||||
|
||||
@@ -694,18 +694,18 @@ static int elantech_packet_check_v3(struct psmouse *psmouse)
|
||||
static int elantech_packet_check_v4(struct psmouse *psmouse)
|
||||
{
|
||||
unsigned char *packet = psmouse->packet;
|
||||
unsigned char packet_type = packet[3] & 0x03;
|
||||
|
||||
if ((packet[0] & 0x0c) == 0x04 &&
|
||||
(packet[3] & 0x1f) == 0x11)
|
||||
switch (packet_type) {
|
||||
case 0:
|
||||
return PACKET_V4_STATUS;
|
||||
|
||||
case 1:
|
||||
return PACKET_V4_HEAD;
|
||||
|
||||
if ((packet[0] & 0x0c) == 0x04 &&
|
||||
(packet[3] & 0x1f) == 0x12)
|
||||
case 2:
|
||||
return PACKET_V4_MOTION;
|
||||
|
||||
if ((packet[0] & 0x0c) == 0x04 &&
|
||||
(packet[3] & 0x1f) == 0x10)
|
||||
return PACKET_V4_STATUS;
|
||||
}
|
||||
|
||||
return PACKET_UNKNOWN;
|
||||
}
|
||||
@@ -1282,6 +1282,7 @@ static int elantech_set_properties(struct elantech_data *etd)
|
||||
etd->hw_version = 3;
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
etd->hw_version = 4;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -439,15 +439,15 @@ static void backside_setup_pid(void)
|
||||
|
||||
/* Slots fan */
|
||||
static const struct wf_pid_param slots_param = {
|
||||
.interval = 5,
|
||||
.history_len = 2,
|
||||
.gd = 30 << 20,
|
||||
.gp = 5 << 20,
|
||||
.gr = 0,
|
||||
.itarget = 40 << 16,
|
||||
.additive = 1,
|
||||
.min = 300,
|
||||
.max = 4000,
|
||||
.interval = 1,
|
||||
.history_len = 20,
|
||||
.gd = 0,
|
||||
.gp = 0,
|
||||
.gr = 0x00100000,
|
||||
.itarget = 3200000,
|
||||
.additive = 0,
|
||||
.min = 20,
|
||||
.max = 100,
|
||||
};
|
||||
|
||||
static void slots_fan_tick(void)
|
||||
|
||||
@@ -2221,12 +2221,18 @@ static void recovery_request_write(struct mddev *mddev, struct r10bio *r10_bio)
|
||||
d = r10_bio->devs[1].devnum;
|
||||
wbio = r10_bio->devs[1].bio;
|
||||
wbio2 = r10_bio->devs[1].repl_bio;
|
||||
/* Need to test wbio2->bi_end_io before we call
|
||||
* generic_make_request as if the former is NULL,
|
||||
* the latter is free to free wbio2.
|
||||
*/
|
||||
if (wbio2 && !wbio2->bi_end_io)
|
||||
wbio2 = NULL;
|
||||
if (wbio->bi_end_io) {
|
||||
atomic_inc(&conf->mirrors[d].rdev->nr_pending);
|
||||
md_sync_acct(conf->mirrors[d].rdev->bdev, wbio->bi_size >> 9);
|
||||
generic_make_request(wbio);
|
||||
}
|
||||
if (wbio2 && wbio2->bi_end_io) {
|
||||
if (wbio2) {
|
||||
atomic_inc(&conf->mirrors[d].replacement->nr_pending);
|
||||
md_sync_acct(conf->mirrors[d].replacement->bdev,
|
||||
wbio2->bi_size >> 9);
|
||||
|
||||
@@ -3491,6 +3491,7 @@ static void handle_stripe(struct stripe_head *sh)
|
||||
test_and_clear_bit(STRIPE_SYNC_REQUESTED, &sh->state)) {
|
||||
set_bit(STRIPE_SYNCING, &sh->state);
|
||||
clear_bit(STRIPE_INSYNC, &sh->state);
|
||||
clear_bit(STRIPE_REPLACED, &sh->state);
|
||||
}
|
||||
spin_unlock(&sh->stripe_lock);
|
||||
}
|
||||
@@ -3636,19 +3637,23 @@ static void handle_stripe(struct stripe_head *sh)
|
||||
handle_parity_checks5(conf, sh, &s, disks);
|
||||
}
|
||||
|
||||
if (s.replacing && s.locked == 0
|
||||
&& !test_bit(STRIPE_INSYNC, &sh->state)) {
|
||||
if ((s.replacing || s.syncing) && s.locked == 0
|
||||
&& !test_bit(STRIPE_COMPUTE_RUN, &sh->state)
|
||||
&& !test_bit(STRIPE_REPLACED, &sh->state)) {
|
||||
/* Write out to replacement devices where possible */
|
||||
for (i = 0; i < conf->raid_disks; i++)
|
||||
if (test_bit(R5_UPTODATE, &sh->dev[i].flags) &&
|
||||
test_bit(R5_NeedReplace, &sh->dev[i].flags)) {
|
||||
if (test_bit(R5_NeedReplace, &sh->dev[i].flags)) {
|
||||
WARN_ON(!test_bit(R5_UPTODATE, &sh->dev[i].flags));
|
||||
set_bit(R5_WantReplace, &sh->dev[i].flags);
|
||||
set_bit(R5_LOCKED, &sh->dev[i].flags);
|
||||
s.locked++;
|
||||
}
|
||||
set_bit(STRIPE_INSYNC, &sh->state);
|
||||
if (s.replacing)
|
||||
set_bit(STRIPE_INSYNC, &sh->state);
|
||||
set_bit(STRIPE_REPLACED, &sh->state);
|
||||
}
|
||||
if ((s.syncing || s.replacing) && s.locked == 0 &&
|
||||
!test_bit(STRIPE_COMPUTE_RUN, &sh->state) &&
|
||||
test_bit(STRIPE_INSYNC, &sh->state)) {
|
||||
md_done_sync(conf->mddev, STRIPE_SECTORS, 1);
|
||||
clear_bit(STRIPE_SYNCING, &sh->state);
|
||||
|
||||
@@ -310,6 +310,7 @@ enum {
|
||||
STRIPE_SYNC_REQUESTED,
|
||||
STRIPE_SYNCING,
|
||||
STRIPE_INSYNC,
|
||||
STRIPE_REPLACED,
|
||||
STRIPE_PREREAD_ACTIVE,
|
||||
STRIPE_DELAYED,
|
||||
STRIPE_DEGRADED,
|
||||
|
||||
@@ -1007,7 +1007,7 @@ static void arcnet_rx(struct net_device *dev, int bufnum)
|
||||
|
||||
soft = &pkt.soft.rfc1201;
|
||||
|
||||
lp->hw.copy_from_card(dev, bufnum, 0, &pkt, sizeof(ARC_HDR_SIZE));
|
||||
lp->hw.copy_from_card(dev, bufnum, 0, &pkt, ARC_HDR_SIZE);
|
||||
if (pkt.hard.offset[0]) {
|
||||
ofs = pkt.hard.offset[0];
|
||||
length = 256 - ofs;
|
||||
|
||||
@@ -520,6 +520,9 @@ struct atl1c_adapter {
|
||||
struct net_device *netdev;
|
||||
struct pci_dev *pdev;
|
||||
struct napi_struct napi;
|
||||
struct page *rx_page;
|
||||
unsigned int rx_page_offset;
|
||||
unsigned int rx_frag_size;
|
||||
struct atl1c_hw hw;
|
||||
struct atl1c_hw_stats hw_stats;
|
||||
struct mii_if_info mii; /* MII interface info */
|
||||
|
||||
@@ -482,10 +482,15 @@ static int atl1c_set_mac_addr(struct net_device *netdev, void *p)
|
||||
static void atl1c_set_rxbufsize(struct atl1c_adapter *adapter,
|
||||
struct net_device *dev)
|
||||
{
|
||||
unsigned int head_size;
|
||||
int mtu = dev->mtu;
|
||||
|
||||
adapter->rx_buffer_len = mtu > AT_RX_BUF_SIZE ?
|
||||
roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE;
|
||||
|
||||
head_size = SKB_DATA_ALIGN(adapter->rx_buffer_len + NET_SKB_PAD) +
|
||||
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
|
||||
adapter->rx_frag_size = roundup_pow_of_two(head_size);
|
||||
}
|
||||
|
||||
static netdev_features_t atl1c_fix_features(struct net_device *netdev,
|
||||
@@ -953,6 +958,10 @@ static void atl1c_free_ring_resources(struct atl1c_adapter *adapter)
|
||||
kfree(adapter->tpd_ring[0].buffer_info);
|
||||
adapter->tpd_ring[0].buffer_info = NULL;
|
||||
}
|
||||
if (adapter->rx_page) {
|
||||
put_page(adapter->rx_page);
|
||||
adapter->rx_page = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1642,6 +1651,35 @@ static inline void atl1c_rx_checksum(struct atl1c_adapter *adapter,
|
||||
skb_checksum_none_assert(skb);
|
||||
}
|
||||
|
||||
static struct sk_buff *atl1c_alloc_skb(struct atl1c_adapter *adapter)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
struct page *page;
|
||||
|
||||
if (adapter->rx_frag_size > PAGE_SIZE)
|
||||
return netdev_alloc_skb(adapter->netdev,
|
||||
adapter->rx_buffer_len);
|
||||
|
||||
page = adapter->rx_page;
|
||||
if (!page) {
|
||||
adapter->rx_page = page = alloc_page(GFP_ATOMIC);
|
||||
if (unlikely(!page))
|
||||
return NULL;
|
||||
adapter->rx_page_offset = 0;
|
||||
}
|
||||
|
||||
skb = build_skb(page_address(page) + adapter->rx_page_offset,
|
||||
adapter->rx_frag_size);
|
||||
if (likely(skb)) {
|
||||
adapter->rx_page_offset += adapter->rx_frag_size;
|
||||
if (adapter->rx_page_offset >= PAGE_SIZE)
|
||||
adapter->rx_page = NULL;
|
||||
else
|
||||
get_page(page);
|
||||
}
|
||||
return skb;
|
||||
}
|
||||
|
||||
static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter)
|
||||
{
|
||||
struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring;
|
||||
@@ -1663,7 +1701,7 @@ static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter)
|
||||
while (next_info->flags & ATL1C_BUFFER_FREE) {
|
||||
rfd_desc = ATL1C_RFD_DESC(rfd_ring, rfd_next_to_use);
|
||||
|
||||
skb = netdev_alloc_skb(adapter->netdev, adapter->rx_buffer_len);
|
||||
skb = atl1c_alloc_skb(adapter);
|
||||
if (unlikely(!skb)) {
|
||||
if (netif_msg_rx_err(adapter))
|
||||
dev_warn(&pdev->dev, "alloc rx buffer failed\n");
|
||||
|
||||
@@ -108,9 +108,8 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_82598(struct ixgbe_hw *hw,
|
||||
|
||||
/* Enable arbiter */
|
||||
reg &= ~IXGBE_DPMCS_ARBDIS;
|
||||
/* Enable DFP and Recycle mode */
|
||||
reg |= (IXGBE_DPMCS_TDPAC | IXGBE_DPMCS_TRM);
|
||||
reg |= IXGBE_DPMCS_TSOEF;
|
||||
|
||||
/* Configure Max TSO packet size 34KB including payload and headers */
|
||||
reg |= (0x4 << IXGBE_DPMCS_MTSOS_SHIFT);
|
||||
|
||||
|
||||
@@ -371,7 +371,7 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
|
||||
|
||||
dev->caps.sqp_demux = (mlx4_is_master(dev)) ? MLX4_MAX_NUM_SLAVES : 0;
|
||||
|
||||
if (!enable_64b_cqe_eqe) {
|
||||
if (!enable_64b_cqe_eqe && !mlx4_is_slave(dev)) {
|
||||
if (dev_cap->flags &
|
||||
(MLX4_DEV_CAP_FLAG_64B_CQE | MLX4_DEV_CAP_FLAG_64B_EQE)) {
|
||||
mlx4_warn(dev, "64B EQEs/CQEs supported by the device but not enabled\n");
|
||||
|
||||
@@ -478,7 +478,7 @@ rx_status_loop:
|
||||
|
||||
while (1) {
|
||||
u32 status, len;
|
||||
dma_addr_t mapping;
|
||||
dma_addr_t mapping, new_mapping;
|
||||
struct sk_buff *skb, *new_skb;
|
||||
struct cp_desc *desc;
|
||||
const unsigned buflen = cp->rx_buf_sz;
|
||||
@@ -520,6 +520,13 @@ rx_status_loop:
|
||||
goto rx_next;
|
||||
}
|
||||
|
||||
new_mapping = dma_map_single(&cp->pdev->dev, new_skb->data, buflen,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
if (dma_mapping_error(&cp->pdev->dev, new_mapping)) {
|
||||
dev->stats.rx_dropped++;
|
||||
goto rx_next;
|
||||
}
|
||||
|
||||
dma_unmap_single(&cp->pdev->dev, mapping,
|
||||
buflen, PCI_DMA_FROMDEVICE);
|
||||
|
||||
@@ -531,12 +538,11 @@ rx_status_loop:
|
||||
|
||||
skb_put(skb, len);
|
||||
|
||||
mapping = dma_map_single(&cp->pdev->dev, new_skb->data, buflen,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
cp->rx_skb[rx_tail] = new_skb;
|
||||
|
||||
cp_rx_skb(cp, skb, desc);
|
||||
rx++;
|
||||
mapping = new_mapping;
|
||||
|
||||
rx_next:
|
||||
cp->rx_ring[rx_tail].opts2 = 0;
|
||||
@@ -716,6 +722,22 @@ static inline u32 cp_tx_vlan_tag(struct sk_buff *skb)
|
||||
TxVlanTag | swab16(vlan_tx_tag_get(skb)) : 0x00;
|
||||
}
|
||||
|
||||
static void unwind_tx_frag_mapping(struct cp_private *cp, struct sk_buff *skb,
|
||||
int first, int entry_last)
|
||||
{
|
||||
int frag, index;
|
||||
struct cp_desc *txd;
|
||||
skb_frag_t *this_frag;
|
||||
for (frag = 0; frag+first < entry_last; frag++) {
|
||||
index = first+frag;
|
||||
cp->tx_skb[index] = NULL;
|
||||
txd = &cp->tx_ring[index];
|
||||
this_frag = &skb_shinfo(skb)->frags[frag];
|
||||
dma_unmap_single(&cp->pdev->dev, le64_to_cpu(txd->addr),
|
||||
skb_frag_size(this_frag), PCI_DMA_TODEVICE);
|
||||
}
|
||||
}
|
||||
|
||||
static netdev_tx_t cp_start_xmit (struct sk_buff *skb,
|
||||
struct net_device *dev)
|
||||
{
|
||||
@@ -749,6 +771,9 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb,
|
||||
|
||||
len = skb->len;
|
||||
mapping = dma_map_single(&cp->pdev->dev, skb->data, len, PCI_DMA_TODEVICE);
|
||||
if (dma_mapping_error(&cp->pdev->dev, mapping))
|
||||
goto out_dma_error;
|
||||
|
||||
txd->opts2 = opts2;
|
||||
txd->addr = cpu_to_le64(mapping);
|
||||
wmb();
|
||||
@@ -786,6 +811,9 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb,
|
||||
first_len = skb_headlen(skb);
|
||||
first_mapping = dma_map_single(&cp->pdev->dev, skb->data,
|
||||
first_len, PCI_DMA_TODEVICE);
|
||||
if (dma_mapping_error(&cp->pdev->dev, first_mapping))
|
||||
goto out_dma_error;
|
||||
|
||||
cp->tx_skb[entry] = skb;
|
||||
entry = NEXT_TX(entry);
|
||||
|
||||
@@ -799,6 +827,11 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb,
|
||||
mapping = dma_map_single(&cp->pdev->dev,
|
||||
skb_frag_address(this_frag),
|
||||
len, PCI_DMA_TODEVICE);
|
||||
if (dma_mapping_error(&cp->pdev->dev, mapping)) {
|
||||
unwind_tx_frag_mapping(cp, skb, first_entry, entry);
|
||||
goto out_dma_error;
|
||||
}
|
||||
|
||||
eor = (entry == (CP_TX_RING_SIZE - 1)) ? RingEnd : 0;
|
||||
|
||||
ctrl = eor | len | DescOwn;
|
||||
@@ -859,11 +892,16 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb,
|
||||
if (TX_BUFFS_AVAIL(cp) <= (MAX_SKB_FRAGS + 1))
|
||||
netif_stop_queue(dev);
|
||||
|
||||
out_unlock:
|
||||
spin_unlock_irqrestore(&cp->lock, intr_flags);
|
||||
|
||||
cpw8(TxPoll, NormalTxPoll);
|
||||
|
||||
return NETDEV_TX_OK;
|
||||
out_dma_error:
|
||||
kfree_skb(skb);
|
||||
cp->dev->stats.tx_dropped++;
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
/* Set or clear the multicast filter for this adaptor.
|
||||
@@ -1054,6 +1092,10 @@ static int cp_refill_rx(struct cp_private *cp)
|
||||
|
||||
mapping = dma_map_single(&cp->pdev->dev, skb->data,
|
||||
cp->rx_buf_sz, PCI_DMA_FROMDEVICE);
|
||||
if (dma_mapping_error(&cp->pdev->dev, mapping)) {
|
||||
kfree_skb(skb);
|
||||
goto err_out;
|
||||
}
|
||||
cp->rx_skb[i] = skb;
|
||||
|
||||
cp->rx_ring[i].opts2 = 0;
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
#define EEPROM_MAC_OFFSET (0x01)
|
||||
#define DEFAULT_TX_CSUM_ENABLE (true)
|
||||
#define DEFAULT_RX_CSUM_ENABLE (true)
|
||||
#define DEFAULT_TSO_ENABLE (true)
|
||||
#define SMSC75XX_INTERNAL_PHY_ID (1)
|
||||
#define SMSC75XX_TX_OVERHEAD (8)
|
||||
#define MAX_RX_FIFO_SIZE (20 * 1024)
|
||||
@@ -1412,17 +1411,14 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf)
|
||||
|
||||
INIT_WORK(&pdata->set_multicast, smsc75xx_deferred_multicast_write);
|
||||
|
||||
if (DEFAULT_TX_CSUM_ENABLE) {
|
||||
if (DEFAULT_TX_CSUM_ENABLE)
|
||||
dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
|
||||
if (DEFAULT_TSO_ENABLE)
|
||||
dev->net->features |= NETIF_F_SG |
|
||||
NETIF_F_TSO | NETIF_F_TSO6;
|
||||
}
|
||||
|
||||
if (DEFAULT_RX_CSUM_ENABLE)
|
||||
dev->net->features |= NETIF_F_RXCSUM;
|
||||
|
||||
dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
|
||||
NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_RXCSUM;
|
||||
NETIF_F_RXCSUM;
|
||||
|
||||
ret = smsc75xx_wait_ready(dev, 0);
|
||||
if (ret < 0) {
|
||||
@@ -2198,8 +2194,6 @@ static struct sk_buff *smsc75xx_tx_fixup(struct usbnet *dev,
|
||||
{
|
||||
u32 tx_cmd_a, tx_cmd_b;
|
||||
|
||||
skb_linearize(skb);
|
||||
|
||||
if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) {
|
||||
struct sk_buff *skb2 =
|
||||
skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags);
|
||||
|
||||
@@ -1289,7 +1289,9 @@ static void ath9k_hif_usb_disconnect(struct usb_interface *interface)
|
||||
|
||||
usb_set_intfdata(interface, NULL);
|
||||
|
||||
if (!unplugged && (hif_dev->flags & HIF_USB_START))
|
||||
/* If firmware was loaded we should drop it
|
||||
* go back to first stage bootloader. */
|
||||
if (!unplugged && (hif_dev->flags & HIF_USB_READY))
|
||||
ath9k_hif_usb_reboot(udev);
|
||||
|
||||
kfree(hif_dev);
|
||||
|
||||
@@ -846,6 +846,7 @@ static int ath9k_init_device(struct ath9k_htc_priv *priv,
|
||||
if (error != 0)
|
||||
goto err_rx;
|
||||
|
||||
ath9k_hw_disable(priv->ah);
|
||||
#ifdef CONFIG_MAC80211_LEDS
|
||||
/* must be initialized before ieee80211_register_hw */
|
||||
priv->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(priv->hw,
|
||||
|
||||
@@ -786,9 +786,23 @@ static int iwlagn_mac_sta_state(struct ieee80211_hw *hw,
|
||||
mutex_lock(&priv->mutex);
|
||||
if (vif->type == NL80211_IFTYPE_STATION) {
|
||||
if (old_state == IEEE80211_STA_NOTEXIST &&
|
||||
new_state == IEEE80211_STA_NONE)
|
||||
new_state == IEEE80211_STA_NONE) {
|
||||
/*
|
||||
* Firmware bug - it'll crash if the beacon interval is less
|
||||
* than 16. We can't avoid connecting at all, so refuse the
|
||||
* station state change, this will cause mac80211 to abandon
|
||||
* attempts to connect to this AP, and eventually wpa_s will
|
||||
* blacklist the AP...
|
||||
*/
|
||||
if (vif->bss_conf.beacon_int < 16) {
|
||||
IWL_ERR(priv,
|
||||
"AP %pM beacon interval is %d, refusing due to firmware bug!\n",
|
||||
sta->addr, vif->bss_conf.beacon_int);
|
||||
ret = -EINVAL;
|
||||
goto out_unlock;
|
||||
}
|
||||
op = ADD;
|
||||
else if (old_state == IEEE80211_STA_NONE &&
|
||||
} else if (old_state == IEEE80211_STA_NONE &&
|
||||
new_state == IEEE80211_STA_NOTEXIST)
|
||||
op = REMOVE;
|
||||
else if (old_state == IEEE80211_STA_AUTH &&
|
||||
@@ -856,6 +870,7 @@ static int iwlagn_mac_sta_state(struct ieee80211_hw *hw,
|
||||
if (iwl_is_rfkill(priv))
|
||||
ret = 0;
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&priv->mutex);
|
||||
IWL_DEBUG_MAC80211(priv, "leave\n");
|
||||
|
||||
|
||||
@@ -131,6 +131,7 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = {
|
||||
{IWL_PCI_DEVICE(0x423C, 0x1306, iwl5150_abg_cfg)}, /* Half Mini Card */
|
||||
{IWL_PCI_DEVICE(0x423C, 0x1221, iwl5150_agn_cfg)}, /* Mini Card */
|
||||
{IWL_PCI_DEVICE(0x423C, 0x1321, iwl5150_agn_cfg)}, /* Half Mini Card */
|
||||
{IWL_PCI_DEVICE(0x423C, 0x1326, iwl5150_abg_cfg)}, /* Half Mini Card */
|
||||
|
||||
{IWL_PCI_DEVICE(0x423D, 0x1211, iwl5150_agn_cfg)}, /* Mini Card */
|
||||
{IWL_PCI_DEVICE(0x423D, 0x1311, iwl5150_agn_cfg)}, /* Half Mini Card */
|
||||
|
||||
@@ -1455,8 +1455,8 @@ static int mwifiex_sdio_host_to_card(struct mwifiex_adapter *adapter,
|
||||
/* Allocate buffer and copy payload */
|
||||
blk_size = MWIFIEX_SDIO_BLOCK_SIZE;
|
||||
buf_block_len = (pkt_len + blk_size - 1) / blk_size;
|
||||
*(u16 *) &payload[0] = (u16) pkt_len;
|
||||
*(u16 *) &payload[2] = type;
|
||||
*(__le16 *)&payload[0] = cpu_to_le16((u16)pkt_len);
|
||||
*(__le16 *)&payload[2] = cpu_to_le16(type);
|
||||
|
||||
/*
|
||||
* This is SDIO specific header
|
||||
|
||||
@@ -877,13 +877,8 @@ void rt2x00queue_index_inc(struct queue_entry *entry, enum queue_index index)
|
||||
spin_unlock_irqrestore(&queue->index_lock, irqflags);
|
||||
}
|
||||
|
||||
void rt2x00queue_pause_queue(struct data_queue *queue)
|
||||
void rt2x00queue_pause_queue_nocheck(struct data_queue *queue)
|
||||
{
|
||||
if (!test_bit(DEVICE_STATE_PRESENT, &queue->rt2x00dev->flags) ||
|
||||
!test_bit(QUEUE_STARTED, &queue->flags) ||
|
||||
test_and_set_bit(QUEUE_PAUSED, &queue->flags))
|
||||
return;
|
||||
|
||||
switch (queue->qid) {
|
||||
case QID_AC_VO:
|
||||
case QID_AC_VI:
|
||||
@@ -899,6 +894,15 @@ void rt2x00queue_pause_queue(struct data_queue *queue)
|
||||
break;
|
||||
}
|
||||
}
|
||||
void rt2x00queue_pause_queue(struct data_queue *queue)
|
||||
{
|
||||
if (!test_bit(DEVICE_STATE_PRESENT, &queue->rt2x00dev->flags) ||
|
||||
!test_bit(QUEUE_STARTED, &queue->flags) ||
|
||||
test_and_set_bit(QUEUE_PAUSED, &queue->flags))
|
||||
return;
|
||||
|
||||
rt2x00queue_pause_queue_nocheck(queue);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rt2x00queue_pause_queue);
|
||||
|
||||
void rt2x00queue_unpause_queue(struct data_queue *queue)
|
||||
@@ -960,7 +964,7 @@ void rt2x00queue_stop_queue(struct data_queue *queue)
|
||||
return;
|
||||
}
|
||||
|
||||
rt2x00queue_pause_queue(queue);
|
||||
rt2x00queue_pause_queue_nocheck(queue);
|
||||
|
||||
queue->rt2x00dev->ops->lib->stop_queue(queue);
|
||||
|
||||
|
||||
@@ -491,6 +491,7 @@ int isci_task_abort_task(struct sas_task *task)
|
||||
struct isci_tmf tmf;
|
||||
int ret = TMF_RESP_FUNC_FAILED;
|
||||
unsigned long flags;
|
||||
int target_done_already = 0;
|
||||
|
||||
/* Get the isci_request reference from the task. Note that
|
||||
* this check does not depend on the pending request list
|
||||
@@ -505,9 +506,11 @@ int isci_task_abort_task(struct sas_task *task)
|
||||
/* If task is already done, the request isn't valid */
|
||||
if (!(task->task_state_flags & SAS_TASK_STATE_DONE) &&
|
||||
(task->task_state_flags & SAS_TASK_AT_INITIATOR) &&
|
||||
old_request)
|
||||
old_request) {
|
||||
idev = isci_get_device(task->dev->lldd_dev);
|
||||
|
||||
target_done_already = test_bit(IREQ_COMPLETE_IN_TARGET,
|
||||
&old_request->flags);
|
||||
}
|
||||
spin_unlock(&task->task_state_lock);
|
||||
spin_unlock_irqrestore(&ihost->scic_lock, flags);
|
||||
|
||||
@@ -561,7 +564,7 @@ int isci_task_abort_task(struct sas_task *task)
|
||||
|
||||
if (task->task_proto == SAS_PROTOCOL_SMP ||
|
||||
sas_protocol_ata(task->task_proto) ||
|
||||
test_bit(IREQ_COMPLETE_IN_TARGET, &old_request->flags) ||
|
||||
target_done_already ||
|
||||
test_bit(IDEV_GONE, &idev->flags)) {
|
||||
|
||||
spin_unlock_irqrestore(&ihost->scic_lock, flags);
|
||||
|
||||
@@ -3508,11 +3508,21 @@ static int megasas_init_fw(struct megasas_instance *instance)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* We expect the FW state to be READY
|
||||
*/
|
||||
if (megasas_transition_to_ready(instance, 0))
|
||||
goto fail_ready_state;
|
||||
if (megasas_transition_to_ready(instance, 0)) {
|
||||
atomic_set(&instance->fw_reset_no_pci_access, 1);
|
||||
instance->instancet->adp_reset
|
||||
(instance, instance->reg_set);
|
||||
atomic_set(&instance->fw_reset_no_pci_access, 0);
|
||||
dev_info(&instance->pdev->dev,
|
||||
"megasas: FW restarted successfully from %s!\n",
|
||||
__func__);
|
||||
|
||||
/*waitting for about 30 second before retry*/
|
||||
ssleep(30);
|
||||
|
||||
if (megasas_transition_to_ready(instance, 0))
|
||||
goto fail_ready_state;
|
||||
}
|
||||
|
||||
/* Check if MSI-X is supported while in ready state */
|
||||
msix_enable = (instance->instancet->read_fw_status_reg(reg_set) &
|
||||
|
||||
@@ -418,6 +418,8 @@ qla2x00_start_scsi(srb_t *sp)
|
||||
__constant_cpu_to_le16(CF_SIMPLE_TAG);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
cmd_pkt->control_flags = __constant_cpu_to_le16(CF_SIMPLE_TAG);
|
||||
}
|
||||
|
||||
/* Load SCSI command packet. */
|
||||
@@ -1316,11 +1318,11 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,
|
||||
fcp_cmnd->task_attribute = TSK_ORDERED;
|
||||
break;
|
||||
default:
|
||||
fcp_cmnd->task_attribute = 0;
|
||||
fcp_cmnd->task_attribute = TSK_SIMPLE;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
fcp_cmnd->task_attribute = 0;
|
||||
fcp_cmnd->task_attribute = TSK_SIMPLE;
|
||||
}
|
||||
|
||||
cmd_pkt->fcp_rsp_dseg_len = 0; /* Let response come in status iocb */
|
||||
@@ -1536,7 +1538,12 @@ qla24xx_start_scsi(srb_t *sp)
|
||||
case ORDERED_QUEUE_TAG:
|
||||
cmd_pkt->task = TSK_ORDERED;
|
||||
break;
|
||||
default:
|
||||
cmd_pkt->task = TSK_SIMPLE;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
cmd_pkt->task = TSK_SIMPLE;
|
||||
}
|
||||
|
||||
/* Load SCSI command packet. */
|
||||
|
||||
@@ -1031,6 +1031,9 @@ int scsi_get_vpd_page(struct scsi_device *sdev, u8 page, unsigned char *buf,
|
||||
{
|
||||
int i, result;
|
||||
|
||||
if (sdev->skip_vpd_pages)
|
||||
goto fail;
|
||||
|
||||
/* Ask for all the pages supported by this device */
|
||||
result = scsi_vpd_inquiry(sdev, buf, 0, buf_len);
|
||||
if (result)
|
||||
|
||||
@@ -828,10 +828,17 @@ static int scsi_setup_flush_cmnd(struct scsi_device *sdp, struct request *rq)
|
||||
|
||||
static void sd_unprep_fn(struct request_queue *q, struct request *rq)
|
||||
{
|
||||
struct scsi_cmnd *SCpnt = rq->special;
|
||||
|
||||
if (rq->cmd_flags & REQ_DISCARD) {
|
||||
free_page((unsigned long)rq->buffer);
|
||||
rq->buffer = NULL;
|
||||
}
|
||||
if (SCpnt->cmnd != rq->cmd) {
|
||||
mempool_free(SCpnt->cmnd, sd_cdb_pool);
|
||||
SCpnt->cmnd = NULL;
|
||||
SCpnt->cmd_len = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1722,21 +1729,6 @@ static int sd_done(struct scsi_cmnd *SCpnt)
|
||||
if (rq_data_dir(SCpnt->request) == READ && scsi_prot_sg_count(SCpnt))
|
||||
sd_dif_complete(SCpnt, good_bytes);
|
||||
|
||||
if (scsi_host_dif_capable(sdkp->device->host, sdkp->protection_type)
|
||||
== SD_DIF_TYPE2_PROTECTION && SCpnt->cmnd != SCpnt->request->cmd) {
|
||||
|
||||
/* We have to print a failed command here as the
|
||||
* extended CDB gets freed before scsi_io_completion()
|
||||
* is called.
|
||||
*/
|
||||
if (result)
|
||||
scsi_print_command(SCpnt);
|
||||
|
||||
mempool_free(SCpnt->cmnd, sd_cdb_pool);
|
||||
SCpnt->cmnd = NULL;
|
||||
SCpnt->cmd_len = 0;
|
||||
}
|
||||
|
||||
return good_bytes;
|
||||
}
|
||||
|
||||
|
||||
@@ -608,7 +608,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
|
||||
else
|
||||
buf = (void *)t->tx_buf;
|
||||
t->tx_dma = dma_map_single(&spi->dev, buf,
|
||||
t->len, DMA_FROM_DEVICE);
|
||||
t->len, DMA_TO_DEVICE);
|
||||
if (!t->tx_dma) {
|
||||
ret = -EFAULT;
|
||||
goto err_tx_map;
|
||||
|
||||
@@ -371,7 +371,7 @@ static ssize_t logger_aio_write(struct kiocb *iocb, const struct iovec *iov,
|
||||
unsigned long nr_segs, loff_t ppos)
|
||||
{
|
||||
struct logger_log *log = file_get_log(iocb->ki_filp);
|
||||
size_t orig = log->w_off;
|
||||
size_t orig;
|
||||
struct logger_entry header;
|
||||
struct timespec now;
|
||||
ssize_t ret = 0;
|
||||
@@ -390,6 +390,8 @@ static ssize_t logger_aio_write(struct kiocb *iocb, const struct iovec *iov,
|
||||
|
||||
mutex_lock(&log->mutex);
|
||||
|
||||
orig = log->w_off;
|
||||
|
||||
/*
|
||||
* Fix up any readers, pulling them forward to the first readable
|
||||
* entry after (what will be) the new write offset. We do this now
|
||||
|
||||
@@ -1180,22 +1180,19 @@ static int do_cmd_ioctl(struct comedi_device *dev,
|
||||
DPRINTK("subdevice busy\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
s->busy = file;
|
||||
|
||||
/* make sure channel/gain list isn't too long */
|
||||
if (cmd.chanlist_len > s->len_chanlist) {
|
||||
DPRINTK("channel/gain list too long %u > %d\n",
|
||||
cmd.chanlist_len, s->len_chanlist);
|
||||
ret = -EINVAL;
|
||||
goto cleanup;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* make sure channel/gain list isn't too short */
|
||||
if (cmd.chanlist_len < 1) {
|
||||
DPRINTK("channel/gain list too short %u < 1\n",
|
||||
cmd.chanlist_len);
|
||||
ret = -EINVAL;
|
||||
goto cleanup;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
async->cmd = cmd;
|
||||
@@ -1205,8 +1202,7 @@ static int do_cmd_ioctl(struct comedi_device *dev,
|
||||
kmalloc(async->cmd.chanlist_len * sizeof(int), GFP_KERNEL);
|
||||
if (!async->cmd.chanlist) {
|
||||
DPRINTK("allocation failed\n");
|
||||
ret = -ENOMEM;
|
||||
goto cleanup;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (copy_from_user(async->cmd.chanlist, user_chanlist,
|
||||
@@ -1258,6 +1254,9 @@ static int do_cmd_ioctl(struct comedi_device *dev,
|
||||
|
||||
comedi_set_subdevice_runflags(s, ~0, SRF_USER | SRF_RUNNING);
|
||||
|
||||
/* set s->busy _after_ setting SRF_RUNNING flag to avoid race with
|
||||
* comedi_read() or comedi_write() */
|
||||
s->busy = file;
|
||||
ret = s->do_cmd(dev, s);
|
||||
if (ret == 0)
|
||||
return 0;
|
||||
@@ -1472,6 +1471,7 @@ static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg,
|
||||
void *file)
|
||||
{
|
||||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
if (arg >= dev->n_subdevices)
|
||||
return -EINVAL;
|
||||
@@ -1488,7 +1488,11 @@ static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg,
|
||||
if (s->busy != file)
|
||||
return -EBUSY;
|
||||
|
||||
return do_cancel(dev, s);
|
||||
ret = do_cancel(dev, s);
|
||||
if (comedi_get_subdevice_runflags(s) & SRF_USER)
|
||||
wake_up_interruptible(&s->async->wait_head);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1855,6 +1859,7 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
|
||||
|
||||
if (!(comedi_get_subdevice_runflags(s) & SRF_RUNNING)) {
|
||||
if (count == 0) {
|
||||
mutex_lock(&dev->mutex);
|
||||
if (comedi_get_subdevice_runflags(s) &
|
||||
SRF_ERROR) {
|
||||
retval = -EPIPE;
|
||||
@@ -1862,6 +1867,7 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
|
||||
retval = 0;
|
||||
}
|
||||
do_become_nonbusy(dev, s);
|
||||
mutex_unlock(&dev->mutex);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1976,6 +1982,7 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
|
||||
|
||||
if (n == 0) {
|
||||
if (!(comedi_get_subdevice_runflags(s) & SRF_RUNNING)) {
|
||||
mutex_lock(&dev->mutex);
|
||||
do_become_nonbusy(dev, s);
|
||||
if (comedi_get_subdevice_runflags(s) &
|
||||
SRF_ERROR) {
|
||||
@@ -1983,6 +1990,7 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
|
||||
} else {
|
||||
retval = 0;
|
||||
}
|
||||
mutex_unlock(&dev->mutex);
|
||||
break;
|
||||
}
|
||||
if (file->f_flags & O_NONBLOCK) {
|
||||
@@ -2020,9 +2028,11 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
|
||||
buf += n;
|
||||
break; /* makes device work like a pipe */
|
||||
}
|
||||
if (!(comedi_get_subdevice_runflags(s) & (SRF_ERROR | SRF_RUNNING)) &&
|
||||
async->buf_read_count - async->buf_write_count == 0) {
|
||||
do_become_nonbusy(dev, s);
|
||||
if (!(comedi_get_subdevice_runflags(s) & (SRF_ERROR | SRF_RUNNING))) {
|
||||
mutex_lock(&dev->mutex);
|
||||
if (async->buf_read_count - async->buf_write_count == 0)
|
||||
do_become_nonbusy(dev, s);
|
||||
mutex_unlock(&dev->mutex);
|
||||
}
|
||||
set_current_state(TASK_RUNNING);
|
||||
remove_wait_queue(&async->wait_head, &wait);
|
||||
|
||||
@@ -741,6 +741,6 @@ module_init(arc_serial_init);
|
||||
module_exit(arc_serial_exit);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("plat-arcfpga/uart");
|
||||
MODULE_ALIAS("platform:" DRIVER_NAME);
|
||||
MODULE_AUTHOR("Vineet Gupta");
|
||||
MODULE_DESCRIPTION("ARC(Synopsys) On-Chip(fpga) serial driver");
|
||||
|
||||
@@ -710,11 +710,18 @@ static void mxs_auart_settermios(struct uart_port *u,
|
||||
|
||||
static irqreturn_t mxs_auart_irq_handle(int irq, void *context)
|
||||
{
|
||||
u32 istatus, istat;
|
||||
u32 istat;
|
||||
struct mxs_auart_port *s = context;
|
||||
u32 stat = readl(s->port.membase + AUART_STAT);
|
||||
|
||||
istatus = istat = readl(s->port.membase + AUART_INTR);
|
||||
istat = readl(s->port.membase + AUART_INTR);
|
||||
|
||||
/* ack irq */
|
||||
writel(istat & (AUART_INTR_RTIS
|
||||
| AUART_INTR_TXIS
|
||||
| AUART_INTR_RXIS
|
||||
| AUART_INTR_CTSMIS),
|
||||
s->port.membase + AUART_INTR_CLR);
|
||||
|
||||
if (istat & AUART_INTR_CTSMIS) {
|
||||
uart_handle_cts_change(&s->port, stat & AUART_STAT_CTS);
|
||||
@@ -734,12 +741,6 @@ static irqreturn_t mxs_auart_irq_handle(int irq, void *context)
|
||||
istat &= ~AUART_INTR_TXIS;
|
||||
}
|
||||
|
||||
writel(istatus & (AUART_INTR_RTIS
|
||||
| AUART_INTR_TXIS
|
||||
| AUART_INTR_RXIS
|
||||
| AUART_INTR_CTSMIS),
|
||||
s->port.membase + AUART_INTR_CLR);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
@@ -882,9 +883,9 @@ auart_console_write(struct console *co, const char *str, unsigned int count)
|
||||
struct mxs_auart_port *s;
|
||||
struct uart_port *port;
|
||||
unsigned int old_ctrl0, old_ctrl2;
|
||||
unsigned int to = 1000;
|
||||
unsigned int to = 20000;
|
||||
|
||||
if (co->index > MXS_AUART_PORTS || co->index < 0)
|
||||
if (co->index >= MXS_AUART_PORTS || co->index < 0)
|
||||
return;
|
||||
|
||||
s = auart_port[co->index];
|
||||
@@ -903,18 +904,23 @@ auart_console_write(struct console *co, const char *str, unsigned int count)
|
||||
|
||||
uart_console_write(port, str, count, mxs_auart_console_putchar);
|
||||
|
||||
/*
|
||||
* Finally, wait for transmitter to become empty
|
||||
* and restore the TCR
|
||||
*/
|
||||
/* Finally, wait for transmitter to become empty ... */
|
||||
while (readl(port->membase + AUART_STAT) & AUART_STAT_BUSY) {
|
||||
udelay(1);
|
||||
if (!to--)
|
||||
break;
|
||||
udelay(1);
|
||||
}
|
||||
|
||||
writel(old_ctrl0, port->membase + AUART_CTRL0);
|
||||
writel(old_ctrl2, port->membase + AUART_CTRL2);
|
||||
/*
|
||||
* ... and restore the TCR if we waited long enough for the transmitter
|
||||
* to be idle. This might keep the transmitter enabled although it is
|
||||
* unused, but that is better than to disable it while it is still
|
||||
* transmitting.
|
||||
*/
|
||||
if (!(readl(port->membase + AUART_STAT) & AUART_STAT_BUSY)) {
|
||||
writel(old_ctrl0, port->membase + AUART_CTRL0);
|
||||
writel(old_ctrl2, port->membase + AUART_CTRL2);
|
||||
}
|
||||
|
||||
clk_disable(s->clk);
|
||||
}
|
||||
|
||||
@@ -667,6 +667,15 @@ resubmit:
|
||||
static inline int
|
||||
hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt)
|
||||
{
|
||||
/* Need to clear both directions for control ep */
|
||||
if (((devinfo >> 11) & USB_ENDPOINT_XFERTYPE_MASK) ==
|
||||
USB_ENDPOINT_XFER_CONTROL) {
|
||||
int status = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
|
||||
HUB_CLEAR_TT_BUFFER, USB_RT_PORT,
|
||||
devinfo ^ 0x8000, tt, NULL, 0, 1000);
|
||||
if (status)
|
||||
return status;
|
||||
}
|
||||
return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
|
||||
HUB_CLEAR_TT_BUFFER, USB_RT_PORT, devinfo,
|
||||
tt, NULL, 0, 1000);
|
||||
|
||||
@@ -730,8 +730,8 @@ struct dwc3 {
|
||||
|
||||
struct dwc3_event_type {
|
||||
u32 is_devspec:1;
|
||||
u32 type:6;
|
||||
u32 reserved8_31:25;
|
||||
u32 type:7;
|
||||
u32 reserved8_31:24;
|
||||
} __packed;
|
||||
|
||||
#define DWC3_DEPEVT_XFERCOMPLETE 0x01
|
||||
|
||||
@@ -1535,6 +1535,7 @@ err1:
|
||||
__dwc3_gadget_ep_disable(dwc->eps[0]);
|
||||
|
||||
err0:
|
||||
dwc->gadget_driver = NULL;
|
||||
spin_unlock_irqrestore(&dwc->lock, flags);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -856,6 +856,7 @@ static int ehci_hub_control (
|
||||
ehci->reset_done[wIndex] = jiffies
|
||||
+ msecs_to_jiffies(20);
|
||||
usb_hcd_start_port_resume(&hcd->self, wIndex);
|
||||
set_bit(wIndex, &ehci->resuming_ports);
|
||||
/* check the port again */
|
||||
mod_timer(&ehci_to_hcd(ehci)->rh_timer,
|
||||
ehci->reset_done[wIndex]);
|
||||
|
||||
@@ -93,7 +93,6 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
|
||||
}
|
||||
if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
|
||||
pdev->device == PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI) {
|
||||
xhci->quirks |= XHCI_SPURIOUS_SUCCESS;
|
||||
xhci->quirks |= XHCI_EP_LIMIT_QUIRK;
|
||||
xhci->limit_active_eps = 64;
|
||||
xhci->quirks |= XHCI_SW_BW_CHECKING;
|
||||
|
||||
@@ -434,7 +434,7 @@ static void ring_doorbell_for_active_rings(struct xhci_hcd *xhci,
|
||||
|
||||
/* A ring has pending URBs if its TD list is not empty */
|
||||
if (!(ep->ep_state & EP_HAS_STREAMS)) {
|
||||
if (!(list_empty(&ep->ring->td_list)))
|
||||
if (ep->ring && !(list_empty(&ep->ring->td_list)))
|
||||
xhci_ring_ep_doorbell(xhci, slot_id, ep_index, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1167,9 +1167,6 @@ static int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev,
|
||||
}
|
||||
|
||||
xhci = hcd_to_xhci(hcd);
|
||||
if (xhci->xhc_state & XHCI_STATE_HALTED)
|
||||
return -ENODEV;
|
||||
|
||||
if (check_virt_dev) {
|
||||
if (!udev->slot_id || !xhci->devs[udev->slot_id]) {
|
||||
printk(KERN_DEBUG "xHCI %s called with unaddressed "
|
||||
@@ -1185,6 +1182,9 @@ static int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev,
|
||||
}
|
||||
}
|
||||
|
||||
if (xhci->xhc_state & XHCI_STATE_HALTED)
|
||||
return -ENODEV;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -4671,6 +4671,13 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
|
||||
|
||||
get_quirks(dev, xhci);
|
||||
|
||||
/* In xhci controllers which follow xhci 1.0 spec gives a spurious
|
||||
* success event after a short transfer. This quirk will ignore such
|
||||
* spurious event.
|
||||
*/
|
||||
if (xhci->hci_version > 0x96)
|
||||
xhci->quirks |= XHCI_SPURIOUS_SUCCESS;
|
||||
|
||||
/* Make sure the HC is halted. */
|
||||
retval = xhci_halt(xhci);
|
||||
if (retval)
|
||||
|
||||
@@ -3247,6 +3247,7 @@ static const struct usb_device_id sisusb_table[] = {
|
||||
{ USB_DEVICE(0x0711, 0x0903) },
|
||||
{ USB_DEVICE(0x0711, 0x0918) },
|
||||
{ USB_DEVICE(0x0711, 0x0920) },
|
||||
{ USB_DEVICE(0x0711, 0x0950) },
|
||||
{ USB_DEVICE(0x182d, 0x021c) },
|
||||
{ USB_DEVICE(0x182d, 0x0269) },
|
||||
{ }
|
||||
|
||||
@@ -53,6 +53,7 @@ static const struct usb_device_id id_table[] = {
|
||||
{ USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
|
||||
{ USB_DEVICE(0x0489, 0xE003) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
|
||||
{ USB_DEVICE(0x0745, 0x1000) }, /* CipherLab USB CCD Barcode Scanner 1000 */
|
||||
{ USB_DEVICE(0x0846, 0x1100) }, /* NetGear Managed Switch M4100 series, M5300 series, M7100 series */
|
||||
{ USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */
|
||||
{ USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */
|
||||
{ USB_DEVICE(0x0BED, 0x1100) }, /* MEI (TM) Cashflow-SC Bill/Voucher Acceptor */
|
||||
@@ -118,6 +119,8 @@ static const struct usb_device_id id_table[] = {
|
||||
{ USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
|
||||
{ USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
|
||||
{ USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
|
||||
{ USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */
|
||||
{ USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
|
||||
{ USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
|
||||
{ USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
|
||||
{ USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */
|
||||
@@ -148,6 +151,7 @@ static const struct usb_device_id id_table[] = {
|
||||
{ USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
|
||||
{ USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
|
||||
{ USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
|
||||
{ USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */
|
||||
{ USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
|
||||
{ USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */
|
||||
{ USB_DEVICE(0x1E29, 0x0501) }, /* Festo CMSP */
|
||||
|
||||
@@ -737,9 +737,34 @@ static struct usb_device_id id_table_combined [] = {
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID),
|
||||
.driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
|
||||
{ USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_CT29B_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_RTS01_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S03_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_59_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57A_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57B_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29A_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29B_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29F_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_62B_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S01_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_63_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29C_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_81B_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_82B_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K5D_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K4Y_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K5G_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S05_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_60_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_61_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_62_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_63B_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_64_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_65_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_92_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_92D_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_W5R_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_A5R_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_PW1_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) },
|
||||
{ USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) },
|
||||
|
||||
@@ -815,11 +815,35 @@
|
||||
/*
|
||||
* RT Systems programming cables for various ham radios
|
||||
*/
|
||||
#define RTSYSTEMS_VID 0x2100 /* Vendor ID */
|
||||
#define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */
|
||||
#define RTSYSTEMS_CT29B_PID 0x9e54 /* CT29B Radio Cable */
|
||||
#define RTSYSTEMS_RTS01_PID 0x9e57 /* USB-RTS01 Radio Cable */
|
||||
|
||||
#define RTSYSTEMS_VID 0x2100 /* Vendor ID */
|
||||
#define RTSYSTEMS_USB_S03_PID 0x9001 /* RTS-03 USB to Serial Adapter */
|
||||
#define RTSYSTEMS_USB_59_PID 0x9e50 /* USB-59 USB to 8 pin plug */
|
||||
#define RTSYSTEMS_USB_57A_PID 0x9e51 /* USB-57A USB to 4pin 3.5mm plug */
|
||||
#define RTSYSTEMS_USB_57B_PID 0x9e52 /* USB-57B USB to extended 4pin 3.5mm plug */
|
||||
#define RTSYSTEMS_USB_29A_PID 0x9e53 /* USB-29A USB to 3.5mm stereo plug */
|
||||
#define RTSYSTEMS_USB_29B_PID 0x9e54 /* USB-29B USB to 6 pin mini din */
|
||||
#define RTSYSTEMS_USB_29F_PID 0x9e55 /* USB-29F USB to 6 pin modular plug */
|
||||
#define RTSYSTEMS_USB_62B_PID 0x9e56 /* USB-62B USB to 8 pin mini din plug*/
|
||||
#define RTSYSTEMS_USB_S01_PID 0x9e57 /* USB-RTS01 USB to 3.5 mm stereo plug*/
|
||||
#define RTSYSTEMS_USB_63_PID 0x9e58 /* USB-63 USB to 9 pin female*/
|
||||
#define RTSYSTEMS_USB_29C_PID 0x9e59 /* USB-29C USB to 4 pin modular plug*/
|
||||
#define RTSYSTEMS_USB_81B_PID 0x9e5A /* USB-81 USB to 8 pin mini din plug*/
|
||||
#define RTSYSTEMS_USB_82B_PID 0x9e5B /* USB-82 USB to 2.5 mm stereo plug*/
|
||||
#define RTSYSTEMS_USB_K5D_PID 0x9e5C /* USB-K5D USB to 8 pin modular plug*/
|
||||
#define RTSYSTEMS_USB_K4Y_PID 0x9e5D /* USB-K4Y USB to 2.5/3.5 mm plugs*/
|
||||
#define RTSYSTEMS_USB_K5G_PID 0x9e5E /* USB-K5G USB to 8 pin modular plug*/
|
||||
#define RTSYSTEMS_USB_S05_PID 0x9e5F /* USB-RTS05 USB to 2.5 mm stereo plug*/
|
||||
#define RTSYSTEMS_USB_60_PID 0x9e60 /* USB-60 USB to 6 pin din*/
|
||||
#define RTSYSTEMS_USB_61_PID 0x9e61 /* USB-61 USB to 6 pin mini din*/
|
||||
#define RTSYSTEMS_USB_62_PID 0x9e62 /* USB-62 USB to 8 pin mini din*/
|
||||
#define RTSYSTEMS_USB_63B_PID 0x9e63 /* USB-63 USB to 9 pin female*/
|
||||
#define RTSYSTEMS_USB_64_PID 0x9e64 /* USB-64 USB to 9 pin male*/
|
||||
#define RTSYSTEMS_USB_65_PID 0x9e65 /* USB-65 USB to 9 pin female null modem*/
|
||||
#define RTSYSTEMS_USB_92_PID 0x9e66 /* USB-92 USB to 12 pin plug*/
|
||||
#define RTSYSTEMS_USB_92D_PID 0x9e67 /* USB-92D USB to 12 pin plug data*/
|
||||
#define RTSYSTEMS_USB_W5R_PID 0x9e68 /* USB-W5R USB to 8 pin modular plug*/
|
||||
#define RTSYSTEMS_USB_A5R_PID 0x9e69 /* USB-A5R USB to 8 pin modular plug*/
|
||||
#define RTSYSTEMS_USB_PW1_PID 0x9e6A /* USB-PW1 USB to 8 pin modular plug*/
|
||||
|
||||
/*
|
||||
* Physik Instrumente
|
||||
|
||||
@@ -183,7 +183,10 @@
|
||||
#define LED_ON_MS 500
|
||||
#define LED_OFF_MS 500
|
||||
|
||||
static int device_type;
|
||||
enum mos7840_flag {
|
||||
MOS7840_FLAG_CTRL_BUSY,
|
||||
MOS7840_FLAG_LED_BUSY,
|
||||
};
|
||||
|
||||
static const struct usb_device_id id_table[] = {
|
||||
{USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)},
|
||||
@@ -240,9 +243,12 @@ struct moschip_port {
|
||||
|
||||
/* For device(s) with LED indicator */
|
||||
bool has_led;
|
||||
bool led_flag;
|
||||
struct timer_list led_timer1; /* Timer for LED on */
|
||||
struct timer_list led_timer2; /* Timer for LED off */
|
||||
struct urb *led_urb;
|
||||
struct usb_ctrlrequest *led_dr;
|
||||
|
||||
unsigned long flags;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -487,10 +493,10 @@ static void mos7840_control_callback(struct urb *urb)
|
||||
case -ESHUTDOWN:
|
||||
/* this urb is terminated, clean up */
|
||||
dev_dbg(dev, "%s - urb shutting down with status: %d\n", __func__, status);
|
||||
return;
|
||||
goto out;
|
||||
default:
|
||||
dev_dbg(dev, "%s - nonzero urb status received: %d\n", __func__, status);
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
|
||||
dev_dbg(dev, "%s urb buffer size is %d\n", __func__, urb->actual_length);
|
||||
@@ -503,6 +509,8 @@ static void mos7840_control_callback(struct urb *urb)
|
||||
mos7840_handle_new_msr(mos7840_port, regval);
|
||||
else if (mos7840_port->MsrLsr == 1)
|
||||
mos7840_handle_new_lsr(mos7840_port, regval);
|
||||
out:
|
||||
clear_bit_unlock(MOS7840_FLAG_CTRL_BUSY, &mos7840_port->flags);
|
||||
}
|
||||
|
||||
static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg,
|
||||
@@ -513,6 +521,9 @@ static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg,
|
||||
unsigned char *buffer = mcs->ctrl_buf;
|
||||
int ret;
|
||||
|
||||
if (test_and_set_bit_lock(MOS7840_FLAG_CTRL_BUSY, &mcs->flags))
|
||||
return -EBUSY;
|
||||
|
||||
dr->bRequestType = MCS_RD_RTYPE;
|
||||
dr->bRequest = MCS_RDREQ;
|
||||
dr->wValue = cpu_to_le16(Wval); /* 0 */
|
||||
@@ -524,6 +535,9 @@ static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg,
|
||||
mos7840_control_callback, mcs);
|
||||
mcs->control_urb->transfer_buffer_length = 2;
|
||||
ret = usb_submit_urb(mcs->control_urb, GFP_ATOMIC);
|
||||
if (ret)
|
||||
clear_bit_unlock(MOS7840_FLAG_CTRL_BUSY, &mcs->flags);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -550,7 +564,7 @@ static void mos7840_set_led_async(struct moschip_port *mcs, __u16 wval,
|
||||
__u16 reg)
|
||||
{
|
||||
struct usb_device *dev = mcs->port->serial->dev;
|
||||
struct usb_ctrlrequest *dr = mcs->dr;
|
||||
struct usb_ctrlrequest *dr = mcs->led_dr;
|
||||
|
||||
dr->bRequestType = MCS_WR_RTYPE;
|
||||
dr->bRequest = MCS_WRREQ;
|
||||
@@ -558,10 +572,10 @@ static void mos7840_set_led_async(struct moschip_port *mcs, __u16 wval,
|
||||
dr->wIndex = cpu_to_le16(reg);
|
||||
dr->wLength = cpu_to_le16(0);
|
||||
|
||||
usb_fill_control_urb(mcs->control_urb, dev, usb_sndctrlpipe(dev, 0),
|
||||
usb_fill_control_urb(mcs->led_urb, dev, usb_sndctrlpipe(dev, 0),
|
||||
(unsigned char *)dr, NULL, 0, mos7840_set_led_callback, NULL);
|
||||
|
||||
usb_submit_urb(mcs->control_urb, GFP_ATOMIC);
|
||||
usb_submit_urb(mcs->led_urb, GFP_ATOMIC);
|
||||
}
|
||||
|
||||
static void mos7840_set_led_sync(struct usb_serial_port *port, __u16 reg,
|
||||
@@ -587,7 +601,19 @@ static void mos7840_led_flag_off(unsigned long arg)
|
||||
{
|
||||
struct moschip_port *mcs = (struct moschip_port *) arg;
|
||||
|
||||
mcs->led_flag = false;
|
||||
clear_bit_unlock(MOS7840_FLAG_LED_BUSY, &mcs->flags);
|
||||
}
|
||||
|
||||
static void mos7840_led_activity(struct usb_serial_port *port)
|
||||
{
|
||||
struct moschip_port *mos7840_port = usb_get_serial_port_data(port);
|
||||
|
||||
if (test_and_set_bit_lock(MOS7840_FLAG_LED_BUSY, &mos7840_port->flags))
|
||||
return;
|
||||
|
||||
mos7840_set_led_async(mos7840_port, 0x0301, MODEM_CONTROL_REGISTER);
|
||||
mod_timer(&mos7840_port->led_timer1,
|
||||
jiffies + msecs_to_jiffies(LED_ON_MS));
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -792,14 +818,8 @@ static void mos7840_bulk_in_callback(struct urb *urb)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Turn on LED */
|
||||
if (mos7840_port->has_led && !mos7840_port->led_flag) {
|
||||
mos7840_port->led_flag = true;
|
||||
mos7840_set_led_async(mos7840_port, 0x0301,
|
||||
MODEM_CONTROL_REGISTER);
|
||||
mod_timer(&mos7840_port->led_timer1,
|
||||
jiffies + msecs_to_jiffies(LED_ON_MS));
|
||||
}
|
||||
if (mos7840_port->has_led)
|
||||
mos7840_led_activity(port);
|
||||
|
||||
mos7840_port->read_urb_busy = true;
|
||||
retval = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC);
|
||||
@@ -853,18 +873,6 @@ static void mos7840_bulk_out_data_callback(struct urb *urb)
|
||||
/************************************************************************/
|
||||
/* D R I V E R T T Y I N T E R F A C E F U N C T I O N S */
|
||||
/************************************************************************/
|
||||
#ifdef MCSSerialProbe
|
||||
static int mos7840_serial_probe(struct usb_serial *serial,
|
||||
const struct usb_device_id *id)
|
||||
{
|
||||
|
||||
/*need to implement the mode_reg reading and updating\
|
||||
structures usb_serial_ device_type\
|
||||
(i.e num_ports, num_bulkin,bulkout etc) */
|
||||
/* Also we can update the changes attach */
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
* mos7840_open
|
||||
@@ -942,20 +950,20 @@ static int mos7840_open(struct tty_struct *tty, struct usb_serial_port *port)
|
||||
status = mos7840_get_reg_sync(port, mos7840_port->SpRegOffset, &Data);
|
||||
if (status < 0) {
|
||||
dev_dbg(&port->dev, "Reading Spreg failed\n");
|
||||
return -1;
|
||||
goto err;
|
||||
}
|
||||
Data |= 0x80;
|
||||
status = mos7840_set_reg_sync(port, mos7840_port->SpRegOffset, Data);
|
||||
if (status < 0) {
|
||||
dev_dbg(&port->dev, "writing Spreg failed\n");
|
||||
return -1;
|
||||
goto err;
|
||||
}
|
||||
|
||||
Data &= ~0x80;
|
||||
status = mos7840_set_reg_sync(port, mos7840_port->SpRegOffset, Data);
|
||||
if (status < 0) {
|
||||
dev_dbg(&port->dev, "writing Spreg failed\n");
|
||||
return -1;
|
||||
goto err;
|
||||
}
|
||||
/* End of block to be checked */
|
||||
|
||||
@@ -964,7 +972,7 @@ static int mos7840_open(struct tty_struct *tty, struct usb_serial_port *port)
|
||||
&Data);
|
||||
if (status < 0) {
|
||||
dev_dbg(&port->dev, "Reading Controlreg failed\n");
|
||||
return -1;
|
||||
goto err;
|
||||
}
|
||||
Data |= 0x08; /* Driver done bit */
|
||||
Data |= 0x20; /* rx_disable */
|
||||
@@ -972,7 +980,7 @@ static int mos7840_open(struct tty_struct *tty, struct usb_serial_port *port)
|
||||
mos7840_port->ControlRegOffset, Data);
|
||||
if (status < 0) {
|
||||
dev_dbg(&port->dev, "writing Controlreg failed\n");
|
||||
return -1;
|
||||
goto err;
|
||||
}
|
||||
/* do register settings here */
|
||||
/* Set all regs to the device default values. */
|
||||
@@ -983,21 +991,21 @@ static int mos7840_open(struct tty_struct *tty, struct usb_serial_port *port)
|
||||
status = mos7840_set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data);
|
||||
if (status < 0) {
|
||||
dev_dbg(&port->dev, "disabling interrupts failed\n");
|
||||
return -1;
|
||||
goto err;
|
||||
}
|
||||
/* Set FIFO_CONTROL_REGISTER to the default value */
|
||||
Data = 0x00;
|
||||
status = mos7840_set_uart_reg(port, FIFO_CONTROL_REGISTER, Data);
|
||||
if (status < 0) {
|
||||
dev_dbg(&port->dev, "Writing FIFO_CONTROL_REGISTER failed\n");
|
||||
return -1;
|
||||
goto err;
|
||||
}
|
||||
|
||||
Data = 0xcf;
|
||||
status = mos7840_set_uart_reg(port, FIFO_CONTROL_REGISTER, Data);
|
||||
if (status < 0) {
|
||||
dev_dbg(&port->dev, "Writing FIFO_CONTROL_REGISTER failed\n");
|
||||
return -1;
|
||||
goto err;
|
||||
}
|
||||
|
||||
Data = 0x03;
|
||||
@@ -1147,6 +1155,15 @@ static int mos7840_open(struct tty_struct *tty, struct usb_serial_port *port)
|
||||
mos7840_port->icount.rx = 0;
|
||||
|
||||
return 0;
|
||||
err:
|
||||
for (j = 0; j < NUM_URBS; ++j) {
|
||||
urb = mos7840_port->write_urb_pool[j];
|
||||
if (!urb)
|
||||
continue;
|
||||
kfree(urb->transfer_buffer);
|
||||
usb_free_urb(urb);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -1508,13 +1525,8 @@ static int mos7840_write(struct tty_struct *tty, struct usb_serial_port *port,
|
||||
data1 = urb->transfer_buffer;
|
||||
dev_dbg(&port->dev, "bulkout endpoint is %d\n", port->bulk_out_endpointAddress);
|
||||
|
||||
/* Turn on LED */
|
||||
if (mos7840_port->has_led && !mos7840_port->led_flag) {
|
||||
mos7840_port->led_flag = true;
|
||||
mos7840_set_led_sync(port, MODEM_CONTROL_REGISTER, 0x0301);
|
||||
mod_timer(&mos7840_port->led_timer1,
|
||||
jiffies + msecs_to_jiffies(LED_ON_MS));
|
||||
}
|
||||
if (mos7840_port->has_led)
|
||||
mos7840_led_activity(port);
|
||||
|
||||
/* send it down the pipe */
|
||||
status = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
@@ -2310,38 +2322,48 @@ static int mos7810_check(struct usb_serial *serial)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mos7840_calc_num_ports(struct usb_serial *serial)
|
||||
static int mos7840_probe(struct usb_serial *serial,
|
||||
const struct usb_device_id *id)
|
||||
{
|
||||
__u16 data = 0x00;
|
||||
u16 product = serial->dev->descriptor.idProduct;
|
||||
u8 *buf;
|
||||
int mos7840_num_ports;
|
||||
int device_type;
|
||||
|
||||
if (product == MOSCHIP_DEVICE_ID_7810 ||
|
||||
product == MOSCHIP_DEVICE_ID_7820) {
|
||||
device_type = product;
|
||||
goto out;
|
||||
}
|
||||
|
||||
buf = kzalloc(VENDOR_READ_LENGTH, GFP_KERNEL);
|
||||
if (buf) {
|
||||
usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
|
||||
MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, buf,
|
||||
VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT);
|
||||
data = *buf;
|
||||
kfree(buf);
|
||||
}
|
||||
|
||||
if (serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7810 ||
|
||||
serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7820) {
|
||||
device_type = serial->dev->descriptor.idProduct;
|
||||
} else {
|
||||
/* For a MCS7840 device GPIO0 must be set to 1 */
|
||||
if ((data & 0x01) == 1)
|
||||
device_type = MOSCHIP_DEVICE_ID_7840;
|
||||
else if (mos7810_check(serial))
|
||||
device_type = MOSCHIP_DEVICE_ID_7810;
|
||||
else
|
||||
device_type = MOSCHIP_DEVICE_ID_7820;
|
||||
}
|
||||
/* For a MCS7840 device GPIO0 must be set to 1 */
|
||||
if (buf[0] & 0x01)
|
||||
device_type = MOSCHIP_DEVICE_ID_7840;
|
||||
else if (mos7810_check(serial))
|
||||
device_type = MOSCHIP_DEVICE_ID_7810;
|
||||
else
|
||||
device_type = MOSCHIP_DEVICE_ID_7820;
|
||||
|
||||
kfree(buf);
|
||||
out:
|
||||
usb_set_serial_data(serial, (void *)(unsigned long)device_type);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mos7840_calc_num_ports(struct usb_serial *serial)
|
||||
{
|
||||
int device_type = (unsigned long)usb_get_serial_data(serial);
|
||||
int mos7840_num_ports;
|
||||
|
||||
mos7840_num_ports = (device_type >> 4) & 0x000F;
|
||||
serial->num_bulk_in = mos7840_num_ports;
|
||||
serial->num_bulk_out = mos7840_num_ports;
|
||||
serial->num_ports = mos7840_num_ports;
|
||||
|
||||
return mos7840_num_ports;
|
||||
}
|
||||
@@ -2349,6 +2371,7 @@ static int mos7840_calc_num_ports(struct usb_serial *serial)
|
||||
static int mos7840_port_probe(struct usb_serial_port *port)
|
||||
{
|
||||
struct usb_serial *serial = port->serial;
|
||||
int device_type = (unsigned long)usb_get_serial_data(serial);
|
||||
struct moschip_port *mos7840_port;
|
||||
int status;
|
||||
int pnum;
|
||||
@@ -2526,6 +2549,14 @@ static int mos7840_port_probe(struct usb_serial_port *port)
|
||||
if (device_type == MOSCHIP_DEVICE_ID_7810) {
|
||||
mos7840_port->has_led = true;
|
||||
|
||||
mos7840_port->led_urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||
mos7840_port->led_dr = kmalloc(sizeof(*mos7840_port->led_dr),
|
||||
GFP_KERNEL);
|
||||
if (!mos7840_port->led_urb || !mos7840_port->led_dr) {
|
||||
status = -ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
|
||||
init_timer(&mos7840_port->led_timer1);
|
||||
mos7840_port->led_timer1.function = mos7840_led_off;
|
||||
mos7840_port->led_timer1.expires =
|
||||
@@ -2538,8 +2569,6 @@ static int mos7840_port_probe(struct usb_serial_port *port)
|
||||
jiffies + msecs_to_jiffies(LED_OFF_MS);
|
||||
mos7840_port->led_timer2.data = (unsigned long)mos7840_port;
|
||||
|
||||
mos7840_port->led_flag = false;
|
||||
|
||||
/* Turn off LED */
|
||||
mos7840_set_led_sync(port, MODEM_CONTROL_REGISTER, 0x0300);
|
||||
}
|
||||
@@ -2561,6 +2590,8 @@ out:
|
||||
}
|
||||
return 0;
|
||||
error:
|
||||
kfree(mos7840_port->led_dr);
|
||||
usb_free_urb(mos7840_port->led_urb);
|
||||
kfree(mos7840_port->dr);
|
||||
kfree(mos7840_port->ctrl_buf);
|
||||
usb_free_urb(mos7840_port->control_urb);
|
||||
@@ -2581,6 +2612,10 @@ static int mos7840_port_remove(struct usb_serial_port *port)
|
||||
|
||||
del_timer_sync(&mos7840_port->led_timer1);
|
||||
del_timer_sync(&mos7840_port->led_timer2);
|
||||
|
||||
usb_kill_urb(mos7840_port->led_urb);
|
||||
usb_free_urb(mos7840_port->led_urb);
|
||||
kfree(mos7840_port->led_dr);
|
||||
}
|
||||
usb_kill_urb(mos7840_port->control_urb);
|
||||
usb_free_urb(mos7840_port->control_urb);
|
||||
@@ -2607,9 +2642,7 @@ static struct usb_serial_driver moschip7840_4port_device = {
|
||||
.throttle = mos7840_throttle,
|
||||
.unthrottle = mos7840_unthrottle,
|
||||
.calc_num_ports = mos7840_calc_num_ports,
|
||||
#ifdef MCSSerialProbe
|
||||
.probe = mos7840_serial_probe,
|
||||
#endif
|
||||
.probe = mos7840_probe,
|
||||
.ioctl = mos7840_ioctl,
|
||||
.set_termios = mos7840_set_termios,
|
||||
.break_ctl = mos7840_break,
|
||||
|
||||
@@ -341,17 +341,12 @@ static void option_instat_callback(struct urb *urb);
|
||||
#define OLIVETTI_VENDOR_ID 0x0b3c
|
||||
#define OLIVETTI_PRODUCT_OLICARD100 0xc000
|
||||
#define OLIVETTI_PRODUCT_OLICARD145 0xc003
|
||||
#define OLIVETTI_PRODUCT_OLICARD200 0xc005
|
||||
|
||||
/* Celot products */
|
||||
#define CELOT_VENDOR_ID 0x211f
|
||||
#define CELOT_PRODUCT_CT680M 0x6801
|
||||
|
||||
/* ONDA Communication vendor id */
|
||||
#define ONDA_VENDOR_ID 0x1ee8
|
||||
|
||||
/* ONDA MT825UP HSDPA 14.2 modem */
|
||||
#define ONDA_MT825UP 0x000b
|
||||
|
||||
/* Samsung products */
|
||||
#define SAMSUNG_VENDOR_ID 0x04e8
|
||||
#define SAMSUNG_PRODUCT_GT_B3730 0x6889
|
||||
@@ -444,7 +439,8 @@ static void option_instat_callback(struct urb *urb);
|
||||
|
||||
/* Hyundai Petatel Inc. products */
|
||||
#define PETATEL_VENDOR_ID 0x1ff4
|
||||
#define PETATEL_PRODUCT_NP10T 0x600e
|
||||
#define PETATEL_PRODUCT_NP10T_600A 0x600a
|
||||
#define PETATEL_PRODUCT_NP10T_600E 0x600e
|
||||
|
||||
/* TP-LINK Incorporated products */
|
||||
#define TPLINK_VENDOR_ID 0x2357
|
||||
@@ -782,6 +778,7 @@ static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) },
|
||||
{ USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) },
|
||||
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
|
||||
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */
|
||||
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */
|
||||
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */
|
||||
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6008) },
|
||||
@@ -817,7 +814,8 @@ static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff),
|
||||
.driver_info = (kernel_ulong_t)&net_intf3_blacklist },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0018, 0xff, 0xff, 0xff) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0019, 0xff, 0xff, 0xff) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0019, 0xff, 0xff, 0xff),
|
||||
.driver_info = (kernel_ulong_t)&net_intf3_blacklist },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0020, 0xff, 0xff, 0xff) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0021, 0xff, 0xff, 0xff),
|
||||
.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
|
||||
@@ -1256,8 +1254,8 @@ static const struct usb_device_id option_ids[] = {
|
||||
|
||||
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) },
|
||||
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) },
|
||||
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200) },
|
||||
{ USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */
|
||||
{ USB_DEVICE(ONDA_VENDOR_ID, ONDA_MT825UP) }, /* ONDA MT825UP modem */
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/
|
||||
{ USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) },
|
||||
{ USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM610) },
|
||||
@@ -1329,9 +1327,12 @@ static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) },
|
||||
{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
|
||||
{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) },
|
||||
{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) },
|
||||
{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) },
|
||||
{ USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180),
|
||||
.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
|
||||
{ USB_DEVICE(TPLINK_VENDOR_ID, 0x9000), /* TP-Link MA260 */
|
||||
.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
|
||||
{ USB_DEVICE(CHANGHONG_VENDOR_ID, CHANGHONG_PRODUCT_CH690) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d01, 0xff, 0x02, 0x01) }, /* D-Link DWM-156 (variant) */
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d01, 0xff, 0x00, 0x00) }, /* D-Link DWM-156 (variant) */
|
||||
@@ -1339,6 +1340,8 @@ static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x00, 0x00) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
MODULE_DEVICE_TABLE(usb, option_ids);
|
||||
|
||||
@@ -373,7 +373,7 @@ static int ti_startup(struct usb_serial *serial)
|
||||
usb_set_serial_data(serial, tdev);
|
||||
|
||||
/* determine device type */
|
||||
if (usb_match_id(serial->interface, ti_id_table_3410))
|
||||
if (serial->type == &ti_1port_device)
|
||||
tdev->td_is_3410 = 1;
|
||||
dev_dbg(&dev->dev, "%s - device type is %s\n", __func__,
|
||||
tdev->td_is_3410 ? "3410" : "5052");
|
||||
|
||||
@@ -657,6 +657,13 @@ UNUSUAL_DEV( 0x054c, 0x016a, 0x0000, 0x9999,
|
||||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||
US_FL_FIX_INQUIRY ),
|
||||
|
||||
/* Submitted by Ren Bigcren <bigcren.ren@sonymobile.com> */
|
||||
UNUSUAL_DEV( 0x054c, 0x02a5, 0x0100, 0x0100,
|
||||
"Sony Corp.",
|
||||
"MicroVault Flash Drive",
|
||||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||
US_FL_NO_READ_CAPACITY_16 ),
|
||||
|
||||
/* floppy reports multiple luns */
|
||||
UNUSUAL_DEV( 0x055d, 0x2020, 0x0000, 0x0210,
|
||||
"SAMSUNG",
|
||||
|
||||
@@ -3684,8 +3684,9 @@ next_slot:
|
||||
}
|
||||
|
||||
log_extents:
|
||||
btrfs_release_path(path);
|
||||
btrfs_release_path(dst_path);
|
||||
if (fast_search) {
|
||||
btrfs_release_path(dst_path);
|
||||
ret = btrfs_log_changed_extents(trans, root, inode, dst_path);
|
||||
if (ret) {
|
||||
err = ret;
|
||||
@@ -3702,8 +3703,6 @@ log_extents:
|
||||
}
|
||||
|
||||
if (inode_only == LOG_INODE_ALL && S_ISDIR(inode->i_mode)) {
|
||||
btrfs_release_path(path);
|
||||
btrfs_release_path(dst_path);
|
||||
ret = log_directory_changes(trans, root, inode, path, dst_path);
|
||||
if (ret) {
|
||||
err = ret;
|
||||
|
||||
@@ -390,7 +390,7 @@ find_domain_name(struct cifs_ses *ses, const struct nls_table *nls_cp)
|
||||
if (blobptr + attrsize > blobend)
|
||||
break;
|
||||
if (type == NTLMSSP_AV_NB_DOMAIN_NAME) {
|
||||
if (!attrsize)
|
||||
if (!attrsize || attrsize >= CIFS_MAX_DOMAINNAME_LEN)
|
||||
break;
|
||||
if (!ses->domainName) {
|
||||
ses->domainName =
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#define MAX_TREE_SIZE (2 + MAX_SERVER_SIZE + 1 + MAX_SHARE_SIZE + 1)
|
||||
#define MAX_SERVER_SIZE 15
|
||||
#define MAX_SHARE_SIZE 80
|
||||
#define CIFS_MAX_DOMAINNAME_LEN 256 /* max domain name length */
|
||||
#define MAX_USERNAME_SIZE 256 /* reasonable maximum for current servers */
|
||||
#define MAX_PASSWORD_SIZE 512 /* max for windows seems to be 256 wide chars */
|
||||
|
||||
|
||||
@@ -1660,7 +1660,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
|
||||
if (string == NULL)
|
||||
goto out_nomem;
|
||||
|
||||
if (strnlen(string, 256) == 256) {
|
||||
if (strnlen(string, CIFS_MAX_DOMAINNAME_LEN)
|
||||
== CIFS_MAX_DOMAINNAME_LEN) {
|
||||
printk(KERN_WARNING "CIFS: domain name too"
|
||||
" long\n");
|
||||
goto cifs_parse_mount_err;
|
||||
@@ -2321,8 +2322,8 @@ cifs_put_smb_ses(struct cifs_ses *ses)
|
||||
|
||||
#ifdef CONFIG_KEYS
|
||||
|
||||
/* strlen("cifs:a:") + INET6_ADDRSTRLEN + 1 */
|
||||
#define CIFSCREDS_DESC_SIZE (7 + INET6_ADDRSTRLEN + 1)
|
||||
/* strlen("cifs:a:") + CIFS_MAX_DOMAINNAME_LEN + 1 */
|
||||
#define CIFSCREDS_DESC_SIZE (7 + CIFS_MAX_DOMAINNAME_LEN + 1)
|
||||
|
||||
/* Populate username and pw fields from keyring if possible */
|
||||
static int
|
||||
|
||||
@@ -113,6 +113,14 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we know that the inode will need to be revalidated immediately,
|
||||
* then don't create a new dentry for it. We'll end up doing an on
|
||||
* the wire call either way and this spares us an invalidation.
|
||||
*/
|
||||
if (fattr->cf_flags & CIFS_FATTR_NEED_REVAL)
|
||||
return;
|
||||
|
||||
dentry = d_alloc(parent, name);
|
||||
if (!dentry)
|
||||
return;
|
||||
|
||||
@@ -198,7 +198,7 @@ static void unicode_domain_string(char **pbcc_area, struct cifs_ses *ses,
|
||||
bytes_ret = 0;
|
||||
} else
|
||||
bytes_ret = cifs_strtoUTF16((__le16 *) bcc_ptr, ses->domainName,
|
||||
256, nls_cp);
|
||||
CIFS_MAX_DOMAINNAME_LEN, nls_cp);
|
||||
bcc_ptr += 2 * bytes_ret;
|
||||
bcc_ptr += 2; /* account for null terminator */
|
||||
|
||||
@@ -256,8 +256,8 @@ static void ascii_ssetup_strings(char **pbcc_area, struct cifs_ses *ses,
|
||||
|
||||
/* copy domain */
|
||||
if (ses->domainName != NULL) {
|
||||
strncpy(bcc_ptr, ses->domainName, 256);
|
||||
bcc_ptr += strnlen(ses->domainName, 256);
|
||||
strncpy(bcc_ptr, ses->domainName, CIFS_MAX_DOMAINNAME_LEN);
|
||||
bcc_ptr += strnlen(ses->domainName, CIFS_MAX_DOMAINNAME_LEN);
|
||||
} /* else we will send a null domain name
|
||||
so the server will default to its own domain */
|
||||
*bcc_ptr = 0;
|
||||
|
||||
@@ -4329,7 +4329,7 @@ void ext4_ext_truncate(struct inode *inode)
|
||||
retry:
|
||||
err = ext4_es_remove_extent(inode, last_block,
|
||||
EXT_MAX_BLOCKS - last_block);
|
||||
if (err == ENOMEM) {
|
||||
if (err == -ENOMEM) {
|
||||
cond_resched();
|
||||
congestion_wait(BLK_RW_ASYNC, HZ/50);
|
||||
goto retry;
|
||||
|
||||
@@ -715,11 +715,8 @@ repeat_in_this_group:
|
||||
ino = ext4_find_next_zero_bit((unsigned long *)
|
||||
inode_bitmap_bh->b_data,
|
||||
EXT4_INODES_PER_GROUP(sb), ino);
|
||||
if (ino >= EXT4_INODES_PER_GROUP(sb)) {
|
||||
if (++group == ngroups)
|
||||
group = 0;
|
||||
continue;
|
||||
}
|
||||
if (ino >= EXT4_INODES_PER_GROUP(sb))
|
||||
goto next_group;
|
||||
if (group == 0 && (ino+1) < EXT4_FIRST_INO(sb)) {
|
||||
ext4_error(sb, "reserved inode found cleared - "
|
||||
"inode=%lu", ino + 1);
|
||||
@@ -737,6 +734,9 @@ repeat_in_this_group:
|
||||
goto got; /* we grabbed the inode! */
|
||||
if (ino < EXT4_INODES_PER_GROUP(sb))
|
||||
goto repeat_in_this_group;
|
||||
next_group:
|
||||
if (++group == ngroups)
|
||||
group = 0;
|
||||
}
|
||||
err = -ENOSPC;
|
||||
goto out;
|
||||
|
||||
@@ -1426,7 +1426,7 @@ static const struct mount_opts {
|
||||
{Opt_discard, EXT4_MOUNT_DISCARD, MOPT_SET},
|
||||
{Opt_nodiscard, EXT4_MOUNT_DISCARD, MOPT_CLEAR},
|
||||
{Opt_delalloc, EXT4_MOUNT_DELALLOC, MOPT_SET | MOPT_EXPLICIT},
|
||||
{Opt_nodelalloc, EXT4_MOUNT_DELALLOC, MOPT_CLEAR | MOPT_EXPLICIT},
|
||||
{Opt_nodelalloc, EXT4_MOUNT_DELALLOC, MOPT_CLEAR},
|
||||
{Opt_journal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM, MOPT_SET},
|
||||
{Opt_journal_async_commit, (EXT4_MOUNT_JOURNAL_ASYNC_COMMIT |
|
||||
EXT4_MOUNT_JOURNAL_CHECKSUM), MOPT_SET},
|
||||
@@ -3440,7 +3440,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
|
||||
}
|
||||
if (test_opt(sb, DIOREAD_NOLOCK)) {
|
||||
ext4_msg(sb, KERN_ERR, "can't mount with "
|
||||
"both data=journal and delalloc");
|
||||
"both data=journal and dioread_nolock");
|
||||
goto failed_mount;
|
||||
}
|
||||
if (test_opt(sb, DELALLOC))
|
||||
@@ -4618,6 +4618,21 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
|
||||
goto restore_opts;
|
||||
}
|
||||
|
||||
if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
|
||||
if (test_opt2(sb, EXPLICIT_DELALLOC)) {
|
||||
ext4_msg(sb, KERN_ERR, "can't mount with "
|
||||
"both data=journal and delalloc");
|
||||
err = -EINVAL;
|
||||
goto restore_opts;
|
||||
}
|
||||
if (test_opt(sb, DIOREAD_NOLOCK)) {
|
||||
ext4_msg(sb, KERN_ERR, "can't mount with "
|
||||
"both data=journal and dioread_nolock");
|
||||
err = -EINVAL;
|
||||
goto restore_opts;
|
||||
}
|
||||
}
|
||||
|
||||
if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED)
|
||||
ext4_abort(sb, "Abort forced by user");
|
||||
|
||||
@@ -5370,6 +5385,7 @@ static void __exit ext4_exit_fs(void)
|
||||
kset_unregister(ext4_kset);
|
||||
ext4_exit_system_zone();
|
||||
ext4_exit_pageio();
|
||||
ext4_exit_es();
|
||||
}
|
||||
|
||||
MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
|
||||
|
||||
@@ -802,9 +802,10 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
|
||||
flags = O_WRONLY|O_LARGEFILE;
|
||||
}
|
||||
*filp = dentry_open(&path, flags, current_cred());
|
||||
if (IS_ERR(*filp))
|
||||
if (IS_ERR(*filp)) {
|
||||
host_err = PTR_ERR(*filp);
|
||||
else {
|
||||
*filp = NULL;
|
||||
} else {
|
||||
host_err = ima_file_check(*filp, may_flags);
|
||||
|
||||
if (may_flags & NFSD_MAY_64BIT_COOKIE)
|
||||
|
||||
@@ -792,14 +792,14 @@ typedef struct {
|
||||
} pagemap_entry_t;
|
||||
|
||||
struct pagemapread {
|
||||
int pos, len;
|
||||
int pos, len; /* units: PM_ENTRY_BYTES, not bytes */
|
||||
pagemap_entry_t *buffer;
|
||||
};
|
||||
|
||||
#define PAGEMAP_WALK_SIZE (PMD_SIZE)
|
||||
#define PAGEMAP_WALK_MASK (PMD_MASK)
|
||||
|
||||
#define PM_ENTRY_BYTES sizeof(u64)
|
||||
#define PM_ENTRY_BYTES sizeof(pagemap_entry_t)
|
||||
#define PM_STATUS_BITS 3
|
||||
#define PM_STATUS_OFFSET (64 - PM_STATUS_BITS)
|
||||
#define PM_STATUS_MASK (((1LL << PM_STATUS_BITS) - 1) << PM_STATUS_OFFSET)
|
||||
@@ -1038,8 +1038,8 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
|
||||
if (!count)
|
||||
goto out_task;
|
||||
|
||||
pm.len = PM_ENTRY_BYTES * (PAGEMAP_WALK_SIZE >> PAGE_SHIFT);
|
||||
pm.buffer = kmalloc(pm.len, GFP_TEMPORARY);
|
||||
pm.len = (PAGEMAP_WALK_SIZE >> PAGE_SHIFT);
|
||||
pm.buffer = kmalloc(pm.len * PM_ENTRY_BYTES, GFP_TEMPORARY);
|
||||
ret = -ENOMEM;
|
||||
if (!pm.buffer)
|
||||
goto out_task;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user