mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
* linux-linaro-lsk-v4.4-android: (199 commits) Linux 4.4.41 net: mvpp2: fix dma unmapping of TX buffers for fragments sg_write()/bsg_write() is not fit to be called under KERNEL_DS kconfig/nconf: Fix hang when editing symbol with a long prompt target/user: Fix use-after-free of tcmu_cmds if they are expired powerpc: Convert cmp to cmpd in idle enter sequence powerpc/ps3: Fix system hang with GCC 5 builds nfs_write_end(): fix handling of short copies libceph: verify authorize reply on connect PCI: Check for PME in targeted sleep state Input: drv260x - fix input device's parent assignment media: solo6x10: fix lockup by avoiding delayed register write IB/cma: Fix a race condition in iboe_addr_get_sgid() IB/multicast: Check ib_find_pkey() return value IPoIB: Avoid reading an uninitialized member variable IB/mad: Fix an array index check fgraph: Handle a case where a tracer ignores set_graph_notrace platform/x86: asus-nb-wmi.c: Add X45U quirk ftrace/x86_32: Set ftrace_stub to weak to prevent gcc from using short jumps to it kvm: nVMX: Allow L1 to intercept software exceptions (#BP and #OF) ... Change-Id: I8c8467700d5563d9a1121c982737ff0ab6d9cdc9
This commit is contained in:
@@ -1991,6 +1991,7 @@ registers, find a list below:
|
||||
PPC | KVM_REG_PPC_TM_VSCR | 32
|
||||
PPC | KVM_REG_PPC_TM_DSCR | 64
|
||||
PPC | KVM_REG_PPC_TM_TAR | 64
|
||||
PPC | KVM_REG_PPC_TM_XER | 64
|
||||
| |
|
||||
MIPS | KVM_REG_MIPS_R0 | 64
|
||||
...
|
||||
|
||||
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 4
|
||||
SUBLEVEL = 36
|
||||
SUBLEVEL = 41
|
||||
EXTRAVERSION =
|
||||
NAME = Blurry Fish Butt
|
||||
|
||||
|
||||
@@ -139,7 +139,11 @@ CONFIG_PPP_DEFLATE=y
|
||||
CONFIG_PPP_MPPE=y
|
||||
CONFIG_PREEMPT=y
|
||||
CONFIG_PROFILING=y
|
||||
CONFIG_QFMT_V2=y
|
||||
CONFIG_QUOTA=y
|
||||
CONFIG_QUOTA_NETLINK_INTERFACE=y
|
||||
CONFIG_QUOTA_TREE=y
|
||||
CONFIG_QUOTACTL=y
|
||||
CONFIG_RANDOMIZE_BASE=y
|
||||
CONFIG_RTC_CLASS=y
|
||||
CONFIG_RT_GROUP_SCHED=y
|
||||
|
||||
@@ -85,6 +85,10 @@ void flush_anon_page(struct vm_area_struct *vma,
|
||||
*/
|
||||
#define PG_dc_clean PG_arch_1
|
||||
|
||||
#define CACHE_COLORS_NUM 4
|
||||
#define CACHE_COLORS_MSK (CACHE_COLORS_NUM - 1)
|
||||
#define CACHE_COLOR(addr) (((unsigned long)(addr) >> (PAGE_SHIFT)) & CACHE_COLORS_MSK)
|
||||
|
||||
/*
|
||||
* Simple wrapper over config option
|
||||
* Bootup code ensures that hardware matches kernel configuration
|
||||
@@ -94,8 +98,6 @@ static inline int cache_is_vipt_aliasing(void)
|
||||
return IS_ENABLED(CONFIG_ARC_CACHE_VIPT_ALIASING);
|
||||
}
|
||||
|
||||
#define CACHE_COLOR(addr) (((unsigned long)(addr) >> (PAGE_SHIFT)) & 1)
|
||||
|
||||
/*
|
||||
* checks if two addresses (after page aligning) index into same cache set
|
||||
*/
|
||||
|
||||
@@ -22,10 +22,11 @@
|
||||
static inline void __delay(unsigned long loops)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
" lp 1f \n"
|
||||
" nop \n"
|
||||
"1: \n"
|
||||
: "+l"(loops));
|
||||
" mov lp_count, %0 \n"
|
||||
" lp 1f \n"
|
||||
" nop \n"
|
||||
"1: \n"
|
||||
: : "r"(loops));
|
||||
}
|
||||
|
||||
extern void __bad_udelay(void);
|
||||
|
||||
@@ -960,11 +960,16 @@ void arc_cache_init(void)
|
||||
/* check for D-Cache aliasing on ARCompact: ARCv2 has PIPT */
|
||||
if (is_isa_arcompact()) {
|
||||
int handled = IS_ENABLED(CONFIG_ARC_CACHE_VIPT_ALIASING);
|
||||
int num_colors = dc->sz_k/dc->assoc/TO_KB(PAGE_SIZE);
|
||||
|
||||
if (dc->alias && !handled)
|
||||
panic("Enable CONFIG_ARC_CACHE_VIPT_ALIASING\n");
|
||||
else if (!dc->alias && handled)
|
||||
if (dc->alias) {
|
||||
if (!handled)
|
||||
panic("Enable CONFIG_ARC_CACHE_VIPT_ALIASING\n");
|
||||
if (CACHE_COLORS_NUM != num_colors)
|
||||
panic("CACHE_COLORS_NUM not optimized for config\n");
|
||||
} else if (!dc->alias && handled) {
|
||||
panic("Disable CONFIG_ARC_CACHE_VIPT_ALIASING\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ CONFIG_UNIX=y
|
||||
CONFIG_XFRM_USER=y
|
||||
CONFIG_NET_KEY=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_INET_DIAG_DESTROY=y
|
||||
CONFIG_IP_MULTICAST=y
|
||||
CONFIG_IP_ADVANCED_ROUTER=y
|
||||
CONFIG_IP_MULTIPLE_TABLES=y
|
||||
|
||||
@@ -239,8 +239,7 @@ static int __init xen_guest_init(void)
|
||||
* for secondary CPUs as they are brought up.
|
||||
* For uniformity we use VCPUOP_register_vcpu_info even on cpu0.
|
||||
*/
|
||||
xen_vcpu_info = __alloc_percpu(sizeof(struct vcpu_info),
|
||||
sizeof(struct vcpu_info));
|
||||
xen_vcpu_info = alloc_percpu(struct vcpu_info);
|
||||
if (xen_vcpu_info == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -64,13 +64,13 @@ config DEBUG_SET_MODULE_RONX
|
||||
|
||||
config DEBUG_RODATA
|
||||
bool "Make kernel text and rodata read-only"
|
||||
default y
|
||||
help
|
||||
If this is set, kernel text and rodata will be made read-only. This
|
||||
is to help catch accidental or malicious attempts to change the
|
||||
kernel's executable code. Additionally splits rodata from kernel
|
||||
text so it can be made explicitly non-executable.
|
||||
kernel's executable code.
|
||||
|
||||
If in doubt, say Y
|
||||
If in doubt, say Y
|
||||
|
||||
config DEBUG_ALIGN_RODATA
|
||||
depends on DEBUG_RODATA
|
||||
|
||||
@@ -50,6 +50,7 @@ CONFIG_UNIX=y
|
||||
CONFIG_XFRM_USER=y
|
||||
CONFIG_NET_KEY=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_INET_DIAG_DESTROY=y
|
||||
CONFIG_IP_MULTICAST=y
|
||||
CONFIG_IP_ADVANCED_ROUTER=y
|
||||
CONFIG_IP_MULTIPLE_TABLES=y
|
||||
|
||||
@@ -81,7 +81,7 @@ struct arm64_cpu_capabilities {
|
||||
const char *desc;
|
||||
u16 capability;
|
||||
bool (*matches)(const struct arm64_cpu_capabilities *);
|
||||
void (*enable)(void *); /* Called on all active CPUs */
|
||||
int (*enable)(void *); /* Called on all active CPUs */
|
||||
union {
|
||||
struct { /* To be used for erratum handling only */
|
||||
u32 midr_model;
|
||||
|
||||
@@ -190,7 +190,7 @@ static inline void spin_lock_prefetch(const void *ptr)
|
||||
|
||||
#endif
|
||||
|
||||
void cpu_enable_pan(void *__unused);
|
||||
void cpu_enable_uao(void *__unused);
|
||||
int cpu_enable_pan(void *__unused);
|
||||
int cpu_enable_uao(void *__unused);
|
||||
|
||||
#endif /* __ASM_PROCESSOR_H */
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
#define pr_fmt(fmt) "CPU features: " fmt
|
||||
|
||||
#include <linux/bsearch.h>
|
||||
#include <linux/cpumask.h>
|
||||
#include <linux/sort.h>
|
||||
#include <linux/stop_machine.h>
|
||||
#include <linux/types.h>
|
||||
#include <asm/cpu.h>
|
||||
#include <asm/cpufeature.h>
|
||||
@@ -824,7 +826,13 @@ enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps)
|
||||
|
||||
for (i = 0; caps[i].matches; i++)
|
||||
if (caps[i].enable && cpus_have_cap(caps[i].capability))
|
||||
on_each_cpu(caps[i].enable, NULL, true);
|
||||
/*
|
||||
* Use stop_machine() as it schedules the work allowing
|
||||
* us to modify PSTATE, instead of on_each_cpu() which
|
||||
* uses an IPI, giving us a PSTATE that disappears when
|
||||
* we return.
|
||||
*/
|
||||
stop_machine(caps[i].enable, NULL, cpu_online_mask);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include <linux/ftrace.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/slab.h>
|
||||
#include <asm/alternative.h>
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/cpufeature.h>
|
||||
#include <asm/debug-monitors.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/memory.h>
|
||||
@@ -88,11 +90,16 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
|
||||
ret = fn(arg);
|
||||
|
||||
/*
|
||||
* Never gets here, unless the suspend finisher fails.
|
||||
* Successful cpu_suspend() should return from cpu_resume(),
|
||||
* returning through this code path is considered an error
|
||||
* If the return value is set to 0 force ret = -EOPNOTSUPP
|
||||
* to make sure a proper error condition is propagated
|
||||
* PSTATE was not saved over suspend/resume, re-enable any
|
||||
* detected features that might not have been set correctly.
|
||||
*/
|
||||
asm(ALTERNATIVE("nop", SET_PSTATE_PAN(1), ARM64_HAS_PAN,
|
||||
CONFIG_ARM64_PAN));
|
||||
|
||||
/*
|
||||
* Restore HW breakpoint registers to sane values
|
||||
* before debug exceptions are possibly reenabled
|
||||
* through local_dbg_restore.
|
||||
*/
|
||||
if (!ret)
|
||||
ret = -EOPNOTSUPP;
|
||||
|
||||
@@ -29,7 +29,9 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/perf_event.h>
|
||||
#include <linux/preempt.h>
|
||||
|
||||
#include <asm/bug.h>
|
||||
#include <asm/cpufeature.h>
|
||||
#include <asm/exception.h>
|
||||
#include <asm/debug-monitors.h>
|
||||
@@ -660,9 +662,17 @@ asmlinkage int __exception do_debug_exception(unsigned long addr,
|
||||
NOKPROBE_SYMBOL(do_debug_exception);
|
||||
|
||||
#ifdef CONFIG_ARM64_PAN
|
||||
void cpu_enable_pan(void *__unused)
|
||||
int cpu_enable_pan(void *__unused)
|
||||
{
|
||||
/*
|
||||
* We modify PSTATE. This won't work from irq context as the PSTATE
|
||||
* is discarded once we return from the exception.
|
||||
*/
|
||||
WARN_ON_ONCE(in_interrupt());
|
||||
|
||||
config_sctlr_el1(SCTLR_EL1_SPAN, 0);
|
||||
asm(SET_PSTATE_PAN(1));
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_ARM64_PAN */
|
||||
|
||||
@@ -673,8 +683,9 @@ void cpu_enable_pan(void *__unused)
|
||||
* We need to enable the feature at runtime (instead of adding it to
|
||||
* PSR_MODE_EL1h) as the feature may not be implemented by the cpu.
|
||||
*/
|
||||
void cpu_enable_uao(void *__unused)
|
||||
int cpu_enable_uao(void *__unused)
|
||||
{
|
||||
asm(SET_PSTATE_UAO(1));
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_ARM64_UAO */
|
||||
|
||||
@@ -114,6 +114,6 @@ static inline void __udelay(unsigned long usecs)
|
||||
*/
|
||||
#define HZSCALE (268435456 / (1000000 / HZ))
|
||||
|
||||
#define ndelay(n) __delay(DIV_ROUND_UP((n) * ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6), 1000));
|
||||
#define ndelay(n) __delay(DIV_ROUND_UP((n) * ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6), 1000))
|
||||
|
||||
#endif /* defined(_M68K_DELAY_H) */
|
||||
|
||||
@@ -65,9 +65,9 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr)
|
||||
unsigned long flags; \
|
||||
spin_lock_irqsave(&pa_tlb_lock, flags); \
|
||||
old_pte = *ptep; \
|
||||
set_pte(ptep, pteval); \
|
||||
if (pte_inserted(old_pte)) \
|
||||
purge_tlb_entries(mm, addr); \
|
||||
set_pte(ptep, pteval); \
|
||||
spin_unlock_irqrestore(&pa_tlb_lock, flags); \
|
||||
} while (0)
|
||||
|
||||
@@ -478,8 +478,8 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned
|
||||
spin_unlock_irqrestore(&pa_tlb_lock, flags);
|
||||
return 0;
|
||||
}
|
||||
set_pte(ptep, pte_mkold(pte));
|
||||
purge_tlb_entries(vma->vm_mm, addr);
|
||||
set_pte(ptep, pte_mkold(pte));
|
||||
spin_unlock_irqrestore(&pa_tlb_lock, flags);
|
||||
return 1;
|
||||
}
|
||||
@@ -492,9 +492,9 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
|
||||
|
||||
spin_lock_irqsave(&pa_tlb_lock, flags);
|
||||
old_pte = *ptep;
|
||||
set_pte(ptep, __pte(0));
|
||||
if (pte_inserted(old_pte))
|
||||
purge_tlb_entries(mm, addr);
|
||||
set_pte(ptep, __pte(0));
|
||||
spin_unlock_irqrestore(&pa_tlb_lock, flags);
|
||||
|
||||
return old_pte;
|
||||
@@ -504,8 +504,8 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
|
||||
{
|
||||
unsigned long flags;
|
||||
spin_lock_irqsave(&pa_tlb_lock, flags);
|
||||
set_pte(ptep, pte_wrprotect(*ptep));
|
||||
purge_tlb_entries(mm, addr);
|
||||
set_pte(ptep, pte_wrprotect(*ptep));
|
||||
spin_unlock_irqrestore(&pa_tlb_lock, flags);
|
||||
}
|
||||
|
||||
|
||||
@@ -375,6 +375,15 @@ void __init parisc_setup_cache_timing(void)
|
||||
|
||||
/* calculate TLB flush threshold */
|
||||
|
||||
/* On SMP machines, skip the TLB measure of kernel text which
|
||||
* has been mapped as huge pages. */
|
||||
if (num_online_cpus() > 1 && !parisc_requires_coherency()) {
|
||||
threshold = max(cache_info.it_size, cache_info.dt_size);
|
||||
threshold *= PAGE_SIZE;
|
||||
threshold /= num_online_cpus();
|
||||
goto set_tlb_threshold;
|
||||
}
|
||||
|
||||
alltime = mfctl(16);
|
||||
flush_tlb_all();
|
||||
alltime = mfctl(16) - alltime;
|
||||
@@ -393,6 +402,8 @@ void __init parisc_setup_cache_timing(void)
|
||||
alltime, size, rangetime);
|
||||
|
||||
threshold = PAGE_ALIGN(num_online_cpus() * size * alltime / rangetime);
|
||||
|
||||
set_tlb_threshold:
|
||||
if (threshold)
|
||||
parisc_tlb_flush_threshold = threshold;
|
||||
printk(KERN_INFO "TLB flush threshold set to %lu KiB\n",
|
||||
|
||||
@@ -886,19 +886,10 @@ ENTRY(flush_dcache_page_asm)
|
||||
fdc,m r31(%r28)
|
||||
fdc,m r31(%r28)
|
||||
fdc,m r31(%r28)
|
||||
cmpb,COND(<<) %r28, %r25,1b
|
||||
cmpb,COND(<<) %r28, %r25,1b
|
||||
fdc,m r31(%r28)
|
||||
|
||||
sync
|
||||
|
||||
#ifdef CONFIG_PA20
|
||||
pdtlb,l %r0(%r25)
|
||||
#else
|
||||
tlb_lock %r20,%r21,%r22
|
||||
pdtlb %r0(%r25)
|
||||
tlb_unlock %r20,%r21,%r22
|
||||
#endif
|
||||
|
||||
bv %r0(%r2)
|
||||
nop
|
||||
.exit
|
||||
@@ -973,17 +964,6 @@ ENTRY(flush_icache_page_asm)
|
||||
fic,m %r31(%sr4,%r28)
|
||||
|
||||
sync
|
||||
|
||||
#ifdef CONFIG_PA20
|
||||
pdtlb,l %r0(%r28)
|
||||
pitlb,l %r0(%sr4,%r25)
|
||||
#else
|
||||
tlb_lock %r20,%r21,%r22
|
||||
pdtlb %r0(%r28)
|
||||
pitlb %r0(%sr4,%r25)
|
||||
tlb_unlock %r20,%r21,%r22
|
||||
#endif
|
||||
|
||||
bv %r0(%r2)
|
||||
nop
|
||||
.exit
|
||||
|
||||
@@ -57,11 +57,6 @@ __system_reset_overlay:
|
||||
bctr
|
||||
|
||||
1:
|
||||
/* Save the value at addr zero for a null pointer write check later. */
|
||||
|
||||
li r4, 0
|
||||
lwz r3, 0(r4)
|
||||
|
||||
/* Primary delays then goes to _zimage_start in wrapper. */
|
||||
|
||||
or 31, 31, 31 /* db16cyc */
|
||||
|
||||
@@ -119,13 +119,12 @@ void ps3_copy_vectors(void)
|
||||
flush_cache((void *)0x100, 512);
|
||||
}
|
||||
|
||||
void platform_init(unsigned long null_check)
|
||||
void platform_init(void)
|
||||
{
|
||||
const u32 heapsize = 0x1000000 - (u32)_end; /* 16MiB */
|
||||
void *chosen;
|
||||
unsigned long ft_addr;
|
||||
u64 rm_size;
|
||||
unsigned long val;
|
||||
|
||||
console_ops.write = ps3_console_write;
|
||||
platform_ops.exit = ps3_exit;
|
||||
@@ -153,11 +152,6 @@ void platform_init(unsigned long null_check)
|
||||
|
||||
printf(" flat tree at 0x%lx\n\r", ft_addr);
|
||||
|
||||
val = *(unsigned long *)0;
|
||||
|
||||
if (val != null_check)
|
||||
printf("null check failed: %lx != %lx\n\r", val, null_check);
|
||||
|
||||
((kernel_entry_t)0)(ft_addr, 0, NULL);
|
||||
|
||||
ps3_exit();
|
||||
|
||||
@@ -545,6 +545,7 @@ struct kvm_vcpu_arch {
|
||||
u64 tfiar;
|
||||
|
||||
u32 cr_tm;
|
||||
u64 xer_tm;
|
||||
u64 lr_tm;
|
||||
u64 ctr_tm;
|
||||
u64 amr_tm;
|
||||
|
||||
@@ -587,6 +587,7 @@ struct kvm_get_htab_header {
|
||||
#define KVM_REG_PPC_TM_VSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U32 | 0x67)
|
||||
#define KVM_REG_PPC_TM_DSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x68)
|
||||
#define KVM_REG_PPC_TM_TAR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x69)
|
||||
#define KVM_REG_PPC_TM_XER (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x6a)
|
||||
|
||||
/* PPC64 eXternal Interrupt Controller Specification */
|
||||
#define KVM_DEV_XICS_GRP_SOURCES 1 /* 64-bit source attributes */
|
||||
|
||||
@@ -584,6 +584,7 @@ int main(void)
|
||||
DEFINE(VCPU_VRS_TM, offsetof(struct kvm_vcpu, arch.vr_tm.vr));
|
||||
DEFINE(VCPU_VRSAVE_TM, offsetof(struct kvm_vcpu, arch.vrsave_tm));
|
||||
DEFINE(VCPU_CR_TM, offsetof(struct kvm_vcpu, arch.cr_tm));
|
||||
DEFINE(VCPU_XER_TM, offsetof(struct kvm_vcpu, arch.xer_tm));
|
||||
DEFINE(VCPU_LR_TM, offsetof(struct kvm_vcpu, arch.lr_tm));
|
||||
DEFINE(VCPU_CTR_TM, offsetof(struct kvm_vcpu, arch.ctr_tm));
|
||||
DEFINE(VCPU_AMR_TM, offsetof(struct kvm_vcpu, arch.amr_tm));
|
||||
|
||||
@@ -612,8 +612,10 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus)
|
||||
|
||||
/* Clear frozen state */
|
||||
rc = eeh_clear_pe_frozen_state(pe, false);
|
||||
if (rc)
|
||||
if (rc) {
|
||||
pci_unlock_rescan_remove();
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Give the system 5 seconds to finish running the user-space
|
||||
* hotplug shutdown scripts, e.g. ifdown for ethernet. Yes,
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
std r0,0(r1); \
|
||||
ptesync; \
|
||||
ld r0,0(r1); \
|
||||
1: cmp cr0,r0,r0; \
|
||||
1: cmpd cr0,r0,r0; \
|
||||
bne 1b; \
|
||||
IDLE_INST; \
|
||||
b .
|
||||
|
||||
@@ -1186,6 +1186,9 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
|
||||
case KVM_REG_PPC_TM_CR:
|
||||
*val = get_reg_val(id, vcpu->arch.cr_tm);
|
||||
break;
|
||||
case KVM_REG_PPC_TM_XER:
|
||||
*val = get_reg_val(id, vcpu->arch.xer_tm);
|
||||
break;
|
||||
case KVM_REG_PPC_TM_LR:
|
||||
*val = get_reg_val(id, vcpu->arch.lr_tm);
|
||||
break;
|
||||
@@ -1393,6 +1396,9 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
|
||||
case KVM_REG_PPC_TM_CR:
|
||||
vcpu->arch.cr_tm = set_reg_val(id, *val);
|
||||
break;
|
||||
case KVM_REG_PPC_TM_XER:
|
||||
vcpu->arch.xer_tm = set_reg_val(id, *val);
|
||||
break;
|
||||
case KVM_REG_PPC_TM_LR:
|
||||
vcpu->arch.lr_tm = set_reg_val(id, *val);
|
||||
break;
|
||||
|
||||
@@ -653,6 +653,8 @@ long kvmppc_h_protect(struct kvm_vcpu *vcpu, unsigned long flags,
|
||||
HPTE_V_ABSENT);
|
||||
do_tlbies(kvm, &rb, 1, global_invalidates(kvm, flags),
|
||||
true);
|
||||
/* Don't lose R/C bit updates done by hardware */
|
||||
r |= be64_to_cpu(hpte[1]) & (HPTE_R_R | HPTE_R_C);
|
||||
hpte[1] = cpu_to_be64(r);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2514,11 +2514,13 @@ kvmppc_save_tm:
|
||||
mfctr r7
|
||||
mfspr r8, SPRN_AMR
|
||||
mfspr r10, SPRN_TAR
|
||||
mfxer r11
|
||||
std r5, VCPU_LR_TM(r9)
|
||||
stw r6, VCPU_CR_TM(r9)
|
||||
std r7, VCPU_CTR_TM(r9)
|
||||
std r8, VCPU_AMR_TM(r9)
|
||||
std r10, VCPU_TAR_TM(r9)
|
||||
std r11, VCPU_XER_TM(r9)
|
||||
|
||||
/* Restore r12 as trap number. */
|
||||
lwz r12, VCPU_TRAP(r9)
|
||||
@@ -2611,11 +2613,13 @@ kvmppc_restore_tm:
|
||||
ld r7, VCPU_CTR_TM(r4)
|
||||
ld r8, VCPU_AMR_TM(r4)
|
||||
ld r9, VCPU_TAR_TM(r4)
|
||||
ld r10, VCPU_XER_TM(r4)
|
||||
mtlr r5
|
||||
mtcr r6
|
||||
mtctr r7
|
||||
mtspr SPRN_AMR, r8
|
||||
mtspr SPRN_TAR, r9
|
||||
mtxer r10
|
||||
|
||||
/*
|
||||
* Load up PPR and DSCR values but don't put them in the actual SPRs
|
||||
|
||||
@@ -89,7 +89,7 @@ asmlinkage void do_sigreturn(struct pt_regs *regs)
|
||||
sf = (struct signal_frame __user *) regs->u_regs[UREG_FP];
|
||||
|
||||
/* 1. Make sure we are not getting garbage from the user */
|
||||
if (!invalid_frame_pointer(sf, sizeof(*sf)))
|
||||
if (invalid_frame_pointer(sf, sizeof(*sf)))
|
||||
goto segv_and_exit;
|
||||
|
||||
if (get_user(ufp, &sf->info.si_regs.u_regs[UREG_FP]))
|
||||
@@ -150,7 +150,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
|
||||
|
||||
synchronize_user_stack();
|
||||
sf = (struct rt_signal_frame __user *) regs->u_regs[UREG_FP];
|
||||
if (!invalid_frame_pointer(sf, sizeof(*sf)))
|
||||
if (invalid_frame_pointer(sf, sizeof(*sf)))
|
||||
goto segv;
|
||||
|
||||
if (get_user(ufp, &sf->regs.u_regs[UREG_FP]))
|
||||
|
||||
@@ -800,8 +800,10 @@ struct mdesc_mblock {
|
||||
};
|
||||
static struct mdesc_mblock *mblocks;
|
||||
static int num_mblocks;
|
||||
static int find_numa_node_for_addr(unsigned long pa,
|
||||
struct node_mem_mask *pnode_mask);
|
||||
|
||||
static unsigned long ra_to_pa(unsigned long addr)
|
||||
static unsigned long __init ra_to_pa(unsigned long addr)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -817,8 +819,11 @@ static unsigned long ra_to_pa(unsigned long addr)
|
||||
return addr;
|
||||
}
|
||||
|
||||
static int find_node(unsigned long addr)
|
||||
static int __init find_node(unsigned long addr)
|
||||
{
|
||||
static bool search_mdesc = true;
|
||||
static struct node_mem_mask last_mem_mask = { ~0UL, ~0UL };
|
||||
static int last_index;
|
||||
int i;
|
||||
|
||||
addr = ra_to_pa(addr);
|
||||
@@ -828,13 +833,30 @@ static int find_node(unsigned long addr)
|
||||
if ((addr & p->mask) == p->val)
|
||||
return i;
|
||||
}
|
||||
/* The following condition has been observed on LDOM guests.*/
|
||||
WARN_ONCE(1, "find_node: A physical address doesn't match a NUMA node"
|
||||
" rule. Some physical memory will be owned by node 0.");
|
||||
return 0;
|
||||
/* The following condition has been observed on LDOM guests because
|
||||
* node_masks only contains the best latency mask and value.
|
||||
* LDOM guest's mdesc can contain a single latency group to
|
||||
* cover multiple address range. Print warning message only if the
|
||||
* address cannot be found in node_masks nor mdesc.
|
||||
*/
|
||||
if ((search_mdesc) &&
|
||||
((addr & last_mem_mask.mask) != last_mem_mask.val)) {
|
||||
/* find the available node in the mdesc */
|
||||
last_index = find_numa_node_for_addr(addr, &last_mem_mask);
|
||||
numadbg("find_node: latency group for address 0x%lx is %d\n",
|
||||
addr, last_index);
|
||||
if ((last_index < 0) || (last_index >= num_node_masks)) {
|
||||
/* WARN_ONCE() and use default group 0 */
|
||||
WARN_ONCE(1, "find_node: A physical address doesn't match a NUMA node rule. Some physical memory will be owned by node 0.");
|
||||
search_mdesc = false;
|
||||
last_index = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return last_index;
|
||||
}
|
||||
|
||||
static u64 memblock_nid_range(u64 start, u64 end, int *nid)
|
||||
static u64 __init memblock_nid_range(u64 start, u64 end, int *nid)
|
||||
{
|
||||
*nid = find_node(start);
|
||||
start += PAGE_SIZE;
|
||||
@@ -1158,6 +1180,41 @@ int __node_distance(int from, int to)
|
||||
return numa_latency[from][to];
|
||||
}
|
||||
|
||||
static int find_numa_node_for_addr(unsigned long pa,
|
||||
struct node_mem_mask *pnode_mask)
|
||||
{
|
||||
struct mdesc_handle *md = mdesc_grab();
|
||||
u64 node, arc;
|
||||
int i = 0;
|
||||
|
||||
node = mdesc_node_by_name(md, MDESC_NODE_NULL, "latency-groups");
|
||||
if (node == MDESC_NODE_NULL)
|
||||
goto out;
|
||||
|
||||
mdesc_for_each_node_by_name(md, node, "group") {
|
||||
mdesc_for_each_arc(arc, md, node, MDESC_ARC_TYPE_FWD) {
|
||||
u64 target = mdesc_arc_target(md, arc);
|
||||
struct mdesc_mlgroup *m = find_mlgroup(target);
|
||||
|
||||
if (!m)
|
||||
continue;
|
||||
if ((pa & m->mask) == m->match) {
|
||||
if (pnode_mask) {
|
||||
pnode_mask->mask = m->mask;
|
||||
pnode_mask->val = m->match;
|
||||
}
|
||||
mdesc_release(md);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
out:
|
||||
mdesc_release(md);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int find_best_numa_node_for_mlgroup(struct mdesc_mlgroup *grp)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -89,7 +89,7 @@ CONFIG_SYN_COOKIES=y
|
||||
CONFIG_INET_ESP=y
|
||||
# CONFIG_INET_XFRM_MODE_BEET is not set
|
||||
# CONFIG_INET_LRO is not set
|
||||
# CONFIG_INET_DIAG is not set
|
||||
CONFIG_INET_DIAG_DESTROY=y
|
||||
CONFIG_IPV6_ROUTER_PREF=y
|
||||
CONFIG_IPV6_ROUTE_INFO=y
|
||||
CONFIG_IPV6_OPTIMISTIC_DAD=y
|
||||
|
||||
@@ -87,7 +87,7 @@ CONFIG_SYN_COOKIES=y
|
||||
CONFIG_INET_ESP=y
|
||||
# CONFIG_INET_XFRM_MODE_BEET is not set
|
||||
# CONFIG_INET_LRO is not set
|
||||
# CONFIG_INET_DIAG is not set
|
||||
CONFIG_INET_DIAG_DESTROY=y
|
||||
CONFIG_IPV6_ROUTER_PREF=y
|
||||
CONFIG_IPV6_ROUTE_INFO=y
|
||||
CONFIG_IPV6_OPTIMISTIC_DAD=y
|
||||
|
||||
@@ -766,8 +766,8 @@ ftrace_graph_call:
|
||||
jmp ftrace_stub
|
||||
#endif
|
||||
|
||||
.globl ftrace_stub
|
||||
ftrace_stub:
|
||||
/* This is weak to keep gas from relaxing the jumps */
|
||||
WEAK(ftrace_stub)
|
||||
ret
|
||||
END(ftrace_caller)
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ u64 x86_perf_event_update(struct perf_event *event)
|
||||
int shift = 64 - x86_pmu.cntval_bits;
|
||||
u64 prev_raw_count, new_raw_count;
|
||||
int idx = hwc->idx;
|
||||
s64 delta;
|
||||
u64 delta;
|
||||
|
||||
if (idx == INTEL_PMC_IDX_FIXED_BTS)
|
||||
return 0;
|
||||
|
||||
@@ -3636,7 +3636,7 @@ __init int intel_pmu_init(void)
|
||||
|
||||
/* Support full width counters using alternative MSR range */
|
||||
if (x86_pmu.intel_cap.full_width_write) {
|
||||
x86_pmu.max_period = x86_pmu.cntval_mask;
|
||||
x86_pmu.max_period = x86_pmu.cntval_mask >> 1;
|
||||
x86_pmu.perfctr = MSR_IA32_PMC0;
|
||||
pr_cont("full-width counters, ");
|
||||
}
|
||||
|
||||
@@ -571,7 +571,7 @@ early_idt_handler_common:
|
||||
movl %eax,%ds
|
||||
movl %eax,%es
|
||||
|
||||
cmpl $(__KERNEL_CS),32(%esp)
|
||||
cmpw $(__KERNEL_CS),32(%esp)
|
||||
jne 10f
|
||||
|
||||
leal 28(%esp),%eax # Pointer to %eip
|
||||
|
||||
@@ -1247,10 +1247,10 @@ static inline bool nested_cpu_has_posted_intr(struct vmcs12 *vmcs12)
|
||||
return vmcs12->pin_based_vm_exec_control & PIN_BASED_POSTED_INTR;
|
||||
}
|
||||
|
||||
static inline bool is_exception(u32 intr_info)
|
||||
static inline bool is_nmi(u32 intr_info)
|
||||
{
|
||||
return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VALID_MASK))
|
||||
== (INTR_TYPE_HARD_EXCEPTION | INTR_INFO_VALID_MASK);
|
||||
== (INTR_TYPE_NMI_INTR | INTR_INFO_VALID_MASK);
|
||||
}
|
||||
|
||||
static void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 exit_reason,
|
||||
@@ -5234,7 +5234,7 @@ static int handle_exception(struct kvm_vcpu *vcpu)
|
||||
if (is_machine_check(intr_info))
|
||||
return handle_machine_check(vcpu);
|
||||
|
||||
if ((intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI_INTR)
|
||||
if (is_nmi(intr_info))
|
||||
return 1; /* already handled by vmx_vcpu_run() */
|
||||
|
||||
if (is_no_device(intr_info)) {
|
||||
@@ -7722,7 +7722,7 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
|
||||
|
||||
switch (exit_reason) {
|
||||
case EXIT_REASON_EXCEPTION_NMI:
|
||||
if (!is_exception(intr_info))
|
||||
if (is_nmi(intr_info))
|
||||
return false;
|
||||
else if (is_page_fault(intr_info))
|
||||
return enable_ept;
|
||||
@@ -8329,8 +8329,7 @@ static void vmx_complete_atomic_exit(struct vcpu_vmx *vmx)
|
||||
kvm_machine_check();
|
||||
|
||||
/* We need to handle NMIs before interrupts are enabled */
|
||||
if ((exit_intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI_INTR &&
|
||||
(exit_intr_info & INTR_INFO_VALID_MASK)) {
|
||||
if (is_nmi(exit_intr_info)) {
|
||||
kvm_before_handle_nmi(&vmx->vcpu);
|
||||
asm("int $2");
|
||||
kvm_after_handle_nmi(&vmx->vcpu);
|
||||
|
||||
@@ -90,6 +90,9 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
|
||||
if (!iter || !iter->count)
|
||||
return -EINVAL;
|
||||
|
||||
if (!iter_is_iovec(iter))
|
||||
return -EINVAL;
|
||||
|
||||
iov_for_each(iov, i, *iter) {
|
||||
unsigned long uaddr = (unsigned long) iov.iov_base;
|
||||
|
||||
|
||||
@@ -1313,9 +1313,9 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
|
||||
blk_mq_put_ctx(data.ctx);
|
||||
if (!old_rq)
|
||||
goto done;
|
||||
if (!blk_mq_direct_issue_request(old_rq, &cookie))
|
||||
goto done;
|
||||
blk_mq_insert_request(old_rq, false, true, true);
|
||||
if (test_bit(BLK_MQ_S_STOPPED, &data.hctx->state) ||
|
||||
blk_mq_direct_issue_request(old_rq, &cookie) != 0)
|
||||
blk_mq_insert_request(old_rq, false, true, true);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
@@ -655,6 +655,9 @@ bsg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
|
||||
|
||||
dprintk("%s: write %Zd bytes\n", bd->name, count);
|
||||
|
||||
if (unlikely(segment_eq(get_fs(), KERNEL_DS)))
|
||||
return -EINVAL;
|
||||
|
||||
bsg_set_block(bd, file);
|
||||
|
||||
bytes_written = 0;
|
||||
|
||||
@@ -33,6 +33,7 @@ obj-$(CONFIG_CRYPTO_AKCIPHER2) += akcipher.o
|
||||
|
||||
$(obj)/rsapubkey-asn1.o: $(obj)/rsapubkey-asn1.c $(obj)/rsapubkey-asn1.h
|
||||
$(obj)/rsaprivkey-asn1.o: $(obj)/rsaprivkey-asn1.c $(obj)/rsaprivkey-asn1.h
|
||||
$(obj)/rsa_helper.o: $(obj)/rsapubkey-asn1.h $(obj)/rsaprivkey-asn1.h
|
||||
clean-files += rsapubkey-asn1.c rsapubkey-asn1.h
|
||||
clean-files += rsaprivkey-asn1.c rsaprivkey-asn1.h
|
||||
|
||||
|
||||
@@ -258,18 +258,22 @@ out_free_inst:
|
||||
goto out;
|
||||
}
|
||||
|
||||
static inline void mcryptd_check_internal(struct rtattr **tb, u32 *type,
|
||||
static inline bool mcryptd_check_internal(struct rtattr **tb, u32 *type,
|
||||
u32 *mask)
|
||||
{
|
||||
struct crypto_attr_type *algt;
|
||||
|
||||
algt = crypto_get_attr_type(tb);
|
||||
if (IS_ERR(algt))
|
||||
return;
|
||||
if ((algt->type & CRYPTO_ALG_INTERNAL))
|
||||
*type |= CRYPTO_ALG_INTERNAL;
|
||||
if ((algt->mask & CRYPTO_ALG_INTERNAL))
|
||||
*mask |= CRYPTO_ALG_INTERNAL;
|
||||
return false;
|
||||
|
||||
*type |= algt->type & CRYPTO_ALG_INTERNAL;
|
||||
*mask |= algt->mask & CRYPTO_ALG_INTERNAL;
|
||||
|
||||
if (*type & *mask & CRYPTO_ALG_INTERNAL)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
static int mcryptd_hash_init_tfm(struct crypto_tfm *tfm)
|
||||
@@ -498,7 +502,8 @@ static int mcryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb,
|
||||
u32 mask = 0;
|
||||
int err;
|
||||
|
||||
mcryptd_check_internal(tb, &type, &mask);
|
||||
if (!mcryptd_check_internal(tb, &type, &mask))
|
||||
return -EINVAL;
|
||||
|
||||
salg = shash_attr_alg(tb[1], type, mask);
|
||||
if (IS_ERR(salg))
|
||||
|
||||
@@ -271,6 +271,26 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro12,1"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* https://bugzilla.redhat.com/show_bug.cgi?id=1123661 */
|
||||
.callback = video_detect_force_native,
|
||||
.ident = "Dell XPS 17 L702X",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Dell System XPS L702X"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* https://bugzilla.redhat.com/show_bug.cgi?id=1204476 */
|
||||
/* https://bugs.launchpad.net/ubuntu/+source/linux-lts-trusty/+bug/1416940 */
|
||||
.callback = video_detect_force_native,
|
||||
.ident = "HP Pavilion dv6",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv6 Notebook PC"),
|
||||
},
|
||||
},
|
||||
|
||||
{ },
|
||||
};
|
||||
|
||||
|
||||
@@ -836,11 +836,29 @@ static struct kobject *get_device_parent(struct device *dev,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline bool live_in_glue_dir(struct kobject *kobj,
|
||||
struct device *dev)
|
||||
{
|
||||
if (!kobj || !dev->class ||
|
||||
kobj->kset != &dev->class->p->glue_dirs)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline struct kobject *get_glue_dir(struct device *dev)
|
||||
{
|
||||
return dev->kobj.parent;
|
||||
}
|
||||
|
||||
/*
|
||||
* make sure cleaning up dir as the last step, we need to make
|
||||
* sure .release handler of kobject is run with holding the
|
||||
* global lock
|
||||
*/
|
||||
static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
|
||||
{
|
||||
/* see if we live in a "glue" directory */
|
||||
if (!glue_dir || !dev->class ||
|
||||
glue_dir->kset != &dev->class->p->glue_dirs)
|
||||
if (!live_in_glue_dir(glue_dir, dev))
|
||||
return;
|
||||
|
||||
mutex_lock(&gdp_mutex);
|
||||
@@ -848,11 +866,6 @@ static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
|
||||
mutex_unlock(&gdp_mutex);
|
||||
}
|
||||
|
||||
static void cleanup_device_parent(struct device *dev)
|
||||
{
|
||||
cleanup_glue_dir(dev, dev->kobj.parent);
|
||||
}
|
||||
|
||||
static int device_add_class_symlinks(struct device *dev)
|
||||
{
|
||||
struct device_node *of_node = dev_of_node(dev);
|
||||
@@ -1028,6 +1041,7 @@ int device_add(struct device *dev)
|
||||
struct kobject *kobj;
|
||||
struct class_interface *class_intf;
|
||||
int error = -EINVAL;
|
||||
struct kobject *glue_dir = NULL;
|
||||
|
||||
dev = get_device(dev);
|
||||
if (!dev)
|
||||
@@ -1072,8 +1086,10 @@ int device_add(struct device *dev)
|
||||
/* first, register with generic layer. */
|
||||
/* we require the name to be set before, and pass NULL */
|
||||
error = kobject_add(&dev->kobj, dev->kobj.parent, NULL);
|
||||
if (error)
|
||||
if (error) {
|
||||
glue_dir = get_glue_dir(dev);
|
||||
goto Error;
|
||||
}
|
||||
|
||||
/* notify platform of device entry */
|
||||
if (platform_notify)
|
||||
@@ -1154,9 +1170,10 @@ done:
|
||||
device_remove_file(dev, &dev_attr_uevent);
|
||||
attrError:
|
||||
kobject_uevent(&dev->kobj, KOBJ_REMOVE);
|
||||
glue_dir = get_glue_dir(dev);
|
||||
kobject_del(&dev->kobj);
|
||||
Error:
|
||||
cleanup_device_parent(dev);
|
||||
cleanup_glue_dir(dev, glue_dir);
|
||||
put_device(parent);
|
||||
name_error:
|
||||
kfree(dev->p);
|
||||
@@ -1232,6 +1249,7 @@ EXPORT_SYMBOL_GPL(put_device);
|
||||
void device_del(struct device *dev)
|
||||
{
|
||||
struct device *parent = dev->parent;
|
||||
struct kobject *glue_dir = NULL;
|
||||
struct class_interface *class_intf;
|
||||
|
||||
/* Notify clients of device removal. This call must come
|
||||
@@ -1276,8 +1294,9 @@ void device_del(struct device *dev)
|
||||
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
|
||||
BUS_NOTIFY_REMOVED_DEVICE, dev);
|
||||
kobject_uevent(&dev->kobj, KOBJ_REMOVE);
|
||||
cleanup_device_parent(dev);
|
||||
glue_dir = get_glue_dir(dev);
|
||||
kobject_del(&dev->kobj);
|
||||
cleanup_glue_dir(dev, glue_dir);
|
||||
put_device(parent);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(device_del);
|
||||
|
||||
@@ -942,13 +942,14 @@ static int _request_firmware_load(struct firmware_priv *fw_priv,
|
||||
timeout = MAX_JIFFY_OFFSET;
|
||||
}
|
||||
|
||||
retval = wait_for_completion_interruptible_timeout(&buf->completion,
|
||||
timeout = wait_for_completion_interruptible_timeout(&buf->completion,
|
||||
timeout);
|
||||
if (retval == -ERESTARTSYS || !retval) {
|
||||
if (timeout == -ERESTARTSYS || !timeout) {
|
||||
retval = timeout;
|
||||
mutex_lock(&fw_lock);
|
||||
fw_load_abort(fw_priv);
|
||||
mutex_unlock(&fw_lock);
|
||||
} else if (retval > 0) {
|
||||
} else if (timeout > 0) {
|
||||
retval = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1657,7 +1657,7 @@ static int loop_queue_rq(struct blk_mq_hw_ctx *hctx,
|
||||
blk_mq_start_request(bd->rq);
|
||||
|
||||
if (lo->lo_state != Lo_bound)
|
||||
return -EIO;
|
||||
return BLK_MQ_RQ_QUEUE_ERROR;
|
||||
|
||||
if (lo->use_dio && !(cmd->rq->cmd_flags & (REQ_FLUSH |
|
||||
REQ_DISCARD)))
|
||||
|
||||
@@ -1368,7 +1368,8 @@ static ssize_t hot_remove_store(struct class *class,
|
||||
zram = idr_find(&zram_index_idr, dev_id);
|
||||
if (zram) {
|
||||
ret = zram_remove(zram);
|
||||
idr_remove(&zram_index_idr, dev_id);
|
||||
if (!ret)
|
||||
idr_remove(&zram_index_idr, dev_id);
|
||||
} else {
|
||||
ret = -ENODEV;
|
||||
}
|
||||
@@ -1377,8 +1378,14 @@ static ssize_t hot_remove_store(struct class *class,
|
||||
return ret ? ret : count;
|
||||
}
|
||||
|
||||
/*
|
||||
* NOTE: hot_add attribute is not the usual read-only sysfs attribute. In a
|
||||
* sense that reading from this file does alter the state of your system -- it
|
||||
* creates a new un-initialized zram device and returns back this device's
|
||||
* device_id (or an error code if it fails to create a new device).
|
||||
*/
|
||||
static struct class_attribute zram_control_class_attrs[] = {
|
||||
__ATTR_RO(hot_add),
|
||||
__ATTR(hot_add, 0400, hot_add_show, NULL),
|
||||
__ATTR_WO(hot_remove),
|
||||
__ATTR_NULL,
|
||||
};
|
||||
|
||||
@@ -305,7 +305,6 @@ static int tpmfront_probe(struct xenbus_device *dev,
|
||||
rv = setup_ring(dev, priv);
|
||||
if (rv) {
|
||||
chip = dev_get_drvdata(&dev->dev);
|
||||
tpm_chip_unregister(chip);
|
||||
ring_free(priv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -1082,7 +1082,9 @@ static void bcm2835_pll_divider_off(struct clk_hw *hw)
|
||||
cprman_write(cprman, data->cm_reg,
|
||||
(cprman_read(cprman, data->cm_reg) &
|
||||
~data->load_mask) | data->hold_mask);
|
||||
cprman_write(cprman, data->a2w_reg, A2W_PLL_CHANNEL_DISABLE);
|
||||
cprman_write(cprman, data->a2w_reg,
|
||||
cprman_read(cprman, data->a2w_reg) |
|
||||
A2W_PLL_CHANNEL_DISABLE);
|
||||
spin_unlock(&cprman->regs_lock);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,13 +22,6 @@
|
||||
|
||||
#include "clock.h"
|
||||
|
||||
/*
|
||||
* DPLL5_FREQ_FOR_USBHOST: USBHOST and USBTLL are the only clocks
|
||||
* that are sourced by DPLL5, and both of these require this clock
|
||||
* to be at 120 MHz for proper operation.
|
||||
*/
|
||||
#define DPLL5_FREQ_FOR_USBHOST 120000000
|
||||
|
||||
#define OMAP3430ES2_ST_DSS_IDLE_SHIFT 1
|
||||
#define OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT 5
|
||||
#define OMAP3430ES2_ST_SSI_IDLE_SHIFT 8
|
||||
@@ -546,14 +539,21 @@ void __init omap3_clk_lock_dpll5(void)
|
||||
struct clk *dpll5_clk;
|
||||
struct clk *dpll5_m2_clk;
|
||||
|
||||
/*
|
||||
* Errata sprz319f advisory 2.1 documents a USB host clock drift issue
|
||||
* that can be worked around using specially crafted dpll5 settings
|
||||
* with a dpll5_m2 divider set to 8. Set the dpll5 rate to 8x the USB
|
||||
* host clock rate, its .set_rate handler() will detect that frequency
|
||||
* and use the errata settings.
|
||||
*/
|
||||
dpll5_clk = clk_get(NULL, "dpll5_ck");
|
||||
clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST);
|
||||
clk_set_rate(dpll5_clk, OMAP3_DPLL5_FREQ_FOR_USBHOST * 8);
|
||||
clk_prepare_enable(dpll5_clk);
|
||||
|
||||
/* Program dpll5_m2_clk divider for no division */
|
||||
/* Program dpll5_m2_clk divider */
|
||||
dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck");
|
||||
clk_prepare_enable(dpll5_m2_clk);
|
||||
clk_set_rate(dpll5_m2_clk, DPLL5_FREQ_FOR_USBHOST);
|
||||
clk_set_rate(dpll5_m2_clk, OMAP3_DPLL5_FREQ_FOR_USBHOST);
|
||||
|
||||
clk_disable_unprepare(dpll5_m2_clk);
|
||||
clk_disable_unprepare(dpll5_clk);
|
||||
|
||||
@@ -257,11 +257,20 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
|
||||
unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw,
|
||||
unsigned long parent_rate);
|
||||
|
||||
/*
|
||||
* OMAP3_DPLL5_FREQ_FOR_USBHOST: USBHOST and USBTLL are the only clocks
|
||||
* that are sourced by DPLL5, and both of these require this clock
|
||||
* to be at 120 MHz for proper operation.
|
||||
*/
|
||||
#define OMAP3_DPLL5_FREQ_FOR_USBHOST 120000000
|
||||
|
||||
unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate);
|
||||
int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate,
|
||||
unsigned long parent_rate);
|
||||
int omap3_dpll4_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long parent_rate, u8 index);
|
||||
int omap3_dpll5_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long parent_rate);
|
||||
void omap3_clk_lock_dpll5(void);
|
||||
|
||||
unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw,
|
||||
|
||||
@@ -114,6 +114,18 @@ static const struct clk_ops omap3_dpll_ck_ops = {
|
||||
.round_rate = &omap2_dpll_round_rate,
|
||||
};
|
||||
|
||||
static const struct clk_ops omap3_dpll5_ck_ops = {
|
||||
.enable = &omap3_noncore_dpll_enable,
|
||||
.disable = &omap3_noncore_dpll_disable,
|
||||
.get_parent = &omap2_init_dpll_parent,
|
||||
.recalc_rate = &omap3_dpll_recalc,
|
||||
.set_rate = &omap3_dpll5_set_rate,
|
||||
.set_parent = &omap3_noncore_dpll_set_parent,
|
||||
.set_rate_and_parent = &omap3_noncore_dpll_set_rate_and_parent,
|
||||
.determine_rate = &omap3_noncore_dpll_determine_rate,
|
||||
.round_rate = &omap2_dpll_round_rate,
|
||||
};
|
||||
|
||||
static const struct clk_ops omap3_dpll_per_ck_ops = {
|
||||
.enable = &omap3_noncore_dpll_enable,
|
||||
.disable = &omap3_noncore_dpll_disable,
|
||||
@@ -461,7 +473,12 @@ static void __init of_ti_omap3_dpll_setup(struct device_node *node)
|
||||
.modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
|
||||
};
|
||||
|
||||
of_ti_dpll_setup(node, &omap3_dpll_ck_ops, &dd);
|
||||
if ((of_machine_is_compatible("ti,omap3630") ||
|
||||
of_machine_is_compatible("ti,omap36xx")) &&
|
||||
!strcmp(node->name, "dpll5_ck"))
|
||||
of_ti_dpll_setup(node, &omap3_dpll5_ck_ops, &dd);
|
||||
else
|
||||
of_ti_dpll_setup(node, &omap3_dpll_ck_ops, &dd);
|
||||
}
|
||||
CLK_OF_DECLARE(ti_omap3_dpll_clock, "ti,omap3-dpll-clock",
|
||||
of_ti_omap3_dpll_setup);
|
||||
|
||||
@@ -815,3 +815,70 @@ int omap3_dpll4_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
|
||||
return omap3_noncore_dpll_set_rate_and_parent(hw, rate, parent_rate,
|
||||
index);
|
||||
}
|
||||
|
||||
/* Apply DM3730 errata sprz319 advisory 2.1. */
|
||||
static bool omap3_dpll5_apply_errata(struct clk_hw *hw,
|
||||
unsigned long parent_rate)
|
||||
{
|
||||
struct omap3_dpll5_settings {
|
||||
unsigned int rate, m, n;
|
||||
};
|
||||
|
||||
static const struct omap3_dpll5_settings precomputed[] = {
|
||||
/*
|
||||
* From DM3730 errata advisory 2.1, table 35 and 36.
|
||||
* The N value is increased by 1 compared to the tables as the
|
||||
* errata lists register values while last_rounded_field is the
|
||||
* real divider value.
|
||||
*/
|
||||
{ 12000000, 80, 0 + 1 },
|
||||
{ 13000000, 443, 5 + 1 },
|
||||
{ 19200000, 50, 0 + 1 },
|
||||
{ 26000000, 443, 11 + 1 },
|
||||
{ 38400000, 25, 0 + 1 }
|
||||
};
|
||||
|
||||
const struct omap3_dpll5_settings *d;
|
||||
struct clk_hw_omap *clk = to_clk_hw_omap(hw);
|
||||
struct dpll_data *dd;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(precomputed); ++i) {
|
||||
if (parent_rate == precomputed[i].rate)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == ARRAY_SIZE(precomputed))
|
||||
return false;
|
||||
|
||||
d = &precomputed[i];
|
||||
|
||||
/* Update the M, N and rounded rate values and program the DPLL. */
|
||||
dd = clk->dpll_data;
|
||||
dd->last_rounded_m = d->m;
|
||||
dd->last_rounded_n = d->n;
|
||||
dd->last_rounded_rate = div_u64((u64)parent_rate * d->m, d->n);
|
||||
omap3_noncore_dpll_program(clk, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* omap3_dpll5_set_rate - set rate for omap3 dpll5
|
||||
* @hw: clock to change
|
||||
* @rate: target rate for clock
|
||||
* @parent_rate: rate of the parent clock
|
||||
*
|
||||
* Set rate for the DPLL5 clock. Apply the sprz319 advisory 2.1 on OMAP36xx if
|
||||
* the DPLL is used for USB host (detected through the requested rate).
|
||||
*/
|
||||
int omap3_dpll5_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long parent_rate)
|
||||
{
|
||||
if (rate == OMAP3_DPLL5_FREQ_FOR_USBHOST * 8) {
|
||||
if (omap3_dpll5_apply_errata(hw, parent_rate))
|
||||
return 0;
|
||||
}
|
||||
|
||||
return omap3_noncore_dpll_set_rate(hw, rate, parent_rate);
|
||||
}
|
||||
|
||||
@@ -702,7 +702,9 @@ copy_iv:
|
||||
|
||||
/* Will read cryptlen */
|
||||
append_math_add(desc, VARSEQINLEN, SEQINLEN, REG0, CAAM_CMD_SZ);
|
||||
aead_append_src_dst(desc, FIFOLD_TYPE_MSG1OUT2);
|
||||
append_seq_fifo_load(desc, 0, FIFOLD_CLASS_BOTH | KEY_VLF |
|
||||
FIFOLD_TYPE_MSG1OUT2 | FIFOLD_TYPE_LASTBOTH);
|
||||
append_seq_fifo_store(desc, 0, FIFOST_TYPE_MESSAGE_DATA | KEY_VLF);
|
||||
|
||||
/* Write ICV */
|
||||
append_seq_store(desc, ctx->authsize, LDST_CLASS_2_CCB |
|
||||
|
||||
@@ -203,7 +203,19 @@ void __init efi_init(void)
|
||||
|
||||
reserve_regions();
|
||||
early_memunmap(memmap.map, params.mmap_size);
|
||||
memblock_mark_nomap(params.mmap & PAGE_MASK,
|
||||
PAGE_ALIGN(params.mmap_size +
|
||||
(params.mmap & ~PAGE_MASK)));
|
||||
|
||||
if (IS_ENABLED(CONFIG_ARM)) {
|
||||
/*
|
||||
* ARM currently does not allow ioremap_cache() to be called on
|
||||
* memory regions that are covered by struct page. So remove the
|
||||
* UEFI memory map from the linear mapping.
|
||||
*/
|
||||
memblock_mark_nomap(params.mmap & PAGE_MASK,
|
||||
PAGE_ALIGN(params.mmap_size +
|
||||
(params.mmap & ~PAGE_MASK)));
|
||||
} else {
|
||||
memblock_reserve(params.mmap & PAGE_MASK,
|
||||
PAGE_ALIGN(params.mmap_size +
|
||||
(params.mmap & ~PAGE_MASK)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,7 +223,8 @@ static int ast_get_dram_info(struct drm_device *dev)
|
||||
ast_write32(ast, 0x10000, 0xfc600309);
|
||||
|
||||
do {
|
||||
;
|
||||
if (pci_channel_offline(dev->pdev))
|
||||
return -EIO;
|
||||
} while (ast_read32(ast, 0x10000) != 0x01);
|
||||
data = ast_read32(ast, 0x10004);
|
||||
|
||||
@@ -429,7 +430,9 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)
|
||||
ast_detect_chip(dev, &need_post);
|
||||
|
||||
if (ast->chip != AST1180) {
|
||||
ast_get_dram_info(dev);
|
||||
ret = ast_get_dram_info(dev);
|
||||
if (ret)
|
||||
goto out_free;
|
||||
ast->vram_size = ast_get_vram_info(dev);
|
||||
DRM_INFO("dram %d %d %d %08x\n", ast->mclk, ast->dram_type, ast->dram_bus_width, ast->vram_size);
|
||||
}
|
||||
|
||||
@@ -484,6 +484,9 @@ static const struct file_operations psb_gem_fops = {
|
||||
.open = drm_open,
|
||||
.release = drm_release,
|
||||
.unlocked_ioctl = psb_unlocked_ioctl,
|
||||
#ifdef CONFIG_COMPAT
|
||||
.compat_ioctl = drm_compat_ioctl,
|
||||
#endif
|
||||
.mmap = drm_gem_mmap,
|
||||
.poll = drm_poll,
|
||||
.read = drm_read,
|
||||
|
||||
@@ -333,6 +333,9 @@ get_fp_strap(struct drm_device *dev, struct nvbios *bios)
|
||||
if (bios->major_version < 5 && bios->data[0x48] & 0x4)
|
||||
return NVReadVgaCrtc5758(dev, 0, 0xf) & 0xf;
|
||||
|
||||
if (drm->device.info.family >= NV_DEVICE_INFO_V0_MAXWELL)
|
||||
return nvif_rd32(device, 0x001800) & 0x0000000f;
|
||||
else
|
||||
if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA)
|
||||
return (nvif_rd32(device, NV_PEXTDEV_BOOT_0) >> 24) & 0xf;
|
||||
else
|
||||
|
||||
@@ -1833,7 +1833,7 @@ nvf1_chipset = {
|
||||
.fb = gk104_fb_new,
|
||||
.fuse = gf100_fuse_new,
|
||||
.gpio = gk104_gpio_new,
|
||||
.i2c = gf119_i2c_new,
|
||||
.i2c = gk104_i2c_new,
|
||||
.ibus = gk104_ibus_new,
|
||||
.imem = nv50_instmem_new,
|
||||
.ltc = gk104_ltc_new,
|
||||
@@ -1941,7 +1941,7 @@ nv117_chipset = {
|
||||
.fb = gm107_fb_new,
|
||||
.fuse = gm107_fuse_new,
|
||||
.gpio = gk104_gpio_new,
|
||||
.i2c = gf119_i2c_new,
|
||||
.i2c = gk104_i2c_new,
|
||||
.ibus = gk104_ibus_new,
|
||||
.imem = nv50_instmem_new,
|
||||
.ltc = gm107_ltc_new,
|
||||
|
||||
@@ -59,6 +59,7 @@ gf100_fifo_gpfifo_engine_fini(struct nvkm_fifo_chan *base,
|
||||
struct nvkm_gpuobj *inst = chan->base.inst;
|
||||
int ret = 0;
|
||||
|
||||
mutex_lock(&subdev->mutex);
|
||||
nvkm_wr32(device, 0x002634, chan->base.chid);
|
||||
if (nvkm_msec(device, 2000,
|
||||
if (nvkm_rd32(device, 0x002634) == chan->base.chid)
|
||||
@@ -66,10 +67,12 @@ gf100_fifo_gpfifo_engine_fini(struct nvkm_fifo_chan *base,
|
||||
) < 0) {
|
||||
nvkm_error(subdev, "channel %d [%s] kick timeout\n",
|
||||
chan->base.chid, chan->base.object.client->name);
|
||||
ret = -EBUSY;
|
||||
if (suspend)
|
||||
return ret;
|
||||
ret = -ETIMEDOUT;
|
||||
}
|
||||
mutex_unlock(&subdev->mutex);
|
||||
|
||||
if (ret && suspend)
|
||||
return ret;
|
||||
|
||||
if (offset) {
|
||||
nvkm_kmap(inst);
|
||||
|
||||
@@ -39,7 +39,9 @@ gk104_fifo_gpfifo_kick(struct gk104_fifo_chan *chan)
|
||||
struct nvkm_subdev *subdev = &fifo->base.engine.subdev;
|
||||
struct nvkm_device *device = subdev->device;
|
||||
struct nvkm_client *client = chan->base.object.client;
|
||||
int ret = 0;
|
||||
|
||||
mutex_lock(&subdev->mutex);
|
||||
nvkm_wr32(device, 0x002634, chan->base.chid);
|
||||
if (nvkm_msec(device, 2000,
|
||||
if (!(nvkm_rd32(device, 0x002634) & 0x00100000))
|
||||
@@ -47,10 +49,10 @@ gk104_fifo_gpfifo_kick(struct gk104_fifo_chan *chan)
|
||||
) < 0) {
|
||||
nvkm_error(subdev, "channel %d [%s] kick timeout\n",
|
||||
chan->base.chid, client->name);
|
||||
return -EBUSY;
|
||||
ret = -ETIMEDOUT;
|
||||
}
|
||||
|
||||
return 0;
|
||||
mutex_unlock(&subdev->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static u32
|
||||
|
||||
@@ -12,6 +12,7 @@ struct nvbios_source {
|
||||
bool rw;
|
||||
bool ignore_checksum;
|
||||
bool no_pcir;
|
||||
bool require_checksum;
|
||||
};
|
||||
|
||||
int nvbios_extend(struct nvkm_bios *, u32 length);
|
||||
|
||||
@@ -86,9 +86,12 @@ shadow_image(struct nvkm_bios *bios, int idx, u32 offset, struct shadow *mthd)
|
||||
nvbios_checksum(&bios->data[image.base], image.size)) {
|
||||
nvkm_debug(subdev, "%08x: checksum failed\n",
|
||||
image.base);
|
||||
if (mthd->func->rw)
|
||||
if (!mthd->func->require_checksum) {
|
||||
if (mthd->func->rw)
|
||||
score += 1;
|
||||
score += 1;
|
||||
score += 1;
|
||||
} else
|
||||
return 0;
|
||||
} else {
|
||||
score += 3;
|
||||
}
|
||||
|
||||
@@ -99,6 +99,7 @@ nvbios_acpi_fast = {
|
||||
.init = acpi_init,
|
||||
.read = acpi_read_fast,
|
||||
.rw = false,
|
||||
.require_checksum = true,
|
||||
};
|
||||
|
||||
const struct nvbios_source
|
||||
|
||||
@@ -47,8 +47,10 @@ nvkm_ltc_tags_clear(struct nvkm_ltc *ltc, u32 first, u32 count)
|
||||
|
||||
BUG_ON((first > limit) || (limit >= ltc->num_tags));
|
||||
|
||||
mutex_lock(<c->subdev.mutex);
|
||||
ltc->func->cbc_clear(ltc, first, limit);
|
||||
ltc->func->cbc_wait(ltc);
|
||||
mutex_unlock(<c->subdev.mutex);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -90,6 +90,9 @@ static void radeon_show_cursor(struct drm_crtc *crtc)
|
||||
struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
|
||||
struct radeon_device *rdev = crtc->dev->dev_private;
|
||||
|
||||
if (radeon_crtc->cursor_out_of_bounds)
|
||||
return;
|
||||
|
||||
if (ASIC_IS_DCE4(rdev)) {
|
||||
WREG32(EVERGREEN_CUR_SURFACE_ADDRESS_HIGH + radeon_crtc->crtc_offset,
|
||||
upper_32_bits(radeon_crtc->cursor_addr));
|
||||
@@ -148,16 +151,17 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y)
|
||||
x += crtc->x;
|
||||
y += crtc->y;
|
||||
}
|
||||
DRM_DEBUG("x %d y %d c->x %d c->y %d\n", x, y, crtc->x, crtc->y);
|
||||
|
||||
if (x < 0) {
|
||||
if (x < 0)
|
||||
xorigin = min(-x, radeon_crtc->max_cursor_width - 1);
|
||||
x = 0;
|
||||
}
|
||||
if (y < 0) {
|
||||
if (y < 0)
|
||||
yorigin = min(-y, radeon_crtc->max_cursor_height - 1);
|
||||
y = 0;
|
||||
|
||||
if (!ASIC_IS_AVIVO(rdev)) {
|
||||
x += crtc->x;
|
||||
y += crtc->y;
|
||||
}
|
||||
DRM_DEBUG("x %d y %d c->x %d c->y %d\n", x, y, crtc->x, crtc->y);
|
||||
|
||||
/* fixed on DCE6 and newer */
|
||||
if (ASIC_IS_AVIVO(rdev) && !ASIC_IS_DCE6(rdev)) {
|
||||
@@ -180,27 +184,31 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y)
|
||||
if (i > 1) {
|
||||
int cursor_end, frame_end;
|
||||
|
||||
cursor_end = x - xorigin + w;
|
||||
cursor_end = x + w;
|
||||
frame_end = crtc->x + crtc->mode.crtc_hdisplay;
|
||||
if (cursor_end >= frame_end) {
|
||||
w = w - (cursor_end - frame_end);
|
||||
if (!(frame_end & 0x7f))
|
||||
w--;
|
||||
} else {
|
||||
if (!(cursor_end & 0x7f))
|
||||
w--;
|
||||
} else if (cursor_end <= 0) {
|
||||
goto out_of_bounds;
|
||||
} else if (!(cursor_end & 0x7f)) {
|
||||
w--;
|
||||
}
|
||||
if (w <= 0) {
|
||||
w = 1;
|
||||
cursor_end = x - xorigin + w;
|
||||
if (!(cursor_end & 0x7f)) {
|
||||
x--;
|
||||
WARN_ON_ONCE(x < 0);
|
||||
}
|
||||
goto out_of_bounds;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (x <= (crtc->x - w) || y <= (crtc->y - radeon_crtc->cursor_height) ||
|
||||
x >= (crtc->x + crtc->mode.crtc_hdisplay) ||
|
||||
y >= (crtc->y + crtc->mode.crtc_vdisplay))
|
||||
goto out_of_bounds;
|
||||
|
||||
x += xorigin;
|
||||
y += yorigin;
|
||||
|
||||
if (ASIC_IS_DCE4(rdev)) {
|
||||
WREG32(EVERGREEN_CUR_POSITION + radeon_crtc->crtc_offset, (x << 16) | y);
|
||||
WREG32(EVERGREEN_CUR_HOT_SPOT + radeon_crtc->crtc_offset, (xorigin << 16) | yorigin);
|
||||
@@ -212,6 +220,9 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y)
|
||||
WREG32(AVIVO_D1CUR_SIZE + radeon_crtc->crtc_offset,
|
||||
((w - 1) << 16) | (radeon_crtc->cursor_height - 1));
|
||||
} else {
|
||||
x -= crtc->x;
|
||||
y -= crtc->y;
|
||||
|
||||
if (crtc->mode.flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
y *= 2;
|
||||
|
||||
@@ -232,6 +243,19 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y)
|
||||
radeon_crtc->cursor_x = x;
|
||||
radeon_crtc->cursor_y = y;
|
||||
|
||||
if (radeon_crtc->cursor_out_of_bounds) {
|
||||
radeon_crtc->cursor_out_of_bounds = false;
|
||||
if (radeon_crtc->cursor_bo)
|
||||
radeon_show_cursor(crtc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
out_of_bounds:
|
||||
if (!radeon_crtc->cursor_out_of_bounds) {
|
||||
radeon_hide_cursor(crtc);
|
||||
radeon_crtc->cursor_out_of_bounds = true;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -297,22 +321,23 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc,
|
||||
return ret;
|
||||
}
|
||||
|
||||
radeon_crtc->cursor_width = width;
|
||||
radeon_crtc->cursor_height = height;
|
||||
|
||||
radeon_lock_cursor(crtc, true);
|
||||
|
||||
if (hot_x != radeon_crtc->cursor_hot_x ||
|
||||
if (width != radeon_crtc->cursor_width ||
|
||||
height != radeon_crtc->cursor_height ||
|
||||
hot_x != radeon_crtc->cursor_hot_x ||
|
||||
hot_y != radeon_crtc->cursor_hot_y) {
|
||||
int x, y;
|
||||
|
||||
x = radeon_crtc->cursor_x + radeon_crtc->cursor_hot_x - hot_x;
|
||||
y = radeon_crtc->cursor_y + radeon_crtc->cursor_hot_y - hot_y;
|
||||
|
||||
radeon_cursor_move_locked(crtc, x, y);
|
||||
|
||||
radeon_crtc->cursor_width = width;
|
||||
radeon_crtc->cursor_height = height;
|
||||
radeon_crtc->cursor_hot_x = hot_x;
|
||||
radeon_crtc->cursor_hot_y = hot_y;
|
||||
|
||||
radeon_cursor_move_locked(crtc, x, y);
|
||||
}
|
||||
|
||||
radeon_show_cursor(crtc);
|
||||
|
||||
@@ -330,6 +330,7 @@ struct radeon_crtc {
|
||||
u16 lut_r[256], lut_g[256], lut_b[256];
|
||||
bool enabled;
|
||||
bool can_tile;
|
||||
bool cursor_out_of_bounds;
|
||||
uint32_t crtc_offset;
|
||||
struct drm_gem_object *cursor_bo;
|
||||
uint64_t cursor_addr;
|
||||
|
||||
@@ -3026,6 +3026,7 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev,
|
||||
(rdev->pdev->revision == 0x80) ||
|
||||
(rdev->pdev->revision == 0x81) ||
|
||||
(rdev->pdev->revision == 0x83) ||
|
||||
(rdev->pdev->revision == 0x87) ||
|
||||
(rdev->pdev->device == 0x6604) ||
|
||||
(rdev->pdev->device == 0x6605)) {
|
||||
max_sclk = 75000;
|
||||
|
||||
@@ -1745,7 +1745,7 @@ find_mad_agent(struct ib_mad_port_private *port_priv,
|
||||
if (!class)
|
||||
goto out;
|
||||
if (convert_mgmt_class(mad_hdr->mgmt_class) >=
|
||||
IB_MGMT_MAX_METHODS)
|
||||
ARRAY_SIZE(class->method_table))
|
||||
goto out;
|
||||
method = class->method_table[convert_mgmt_class(
|
||||
mad_hdr->mgmt_class)];
|
||||
|
||||
@@ -517,8 +517,11 @@ static void join_handler(int status, struct ib_sa_mcmember_rec *rec,
|
||||
process_join_error(group, status);
|
||||
else {
|
||||
int mgids_changed, is_mgid0;
|
||||
ib_find_pkey(group->port->dev->device, group->port->port_num,
|
||||
be16_to_cpu(rec->pkey), &pkey_index);
|
||||
|
||||
if (ib_find_pkey(group->port->dev->device,
|
||||
group->port->port_num, be16_to_cpu(rec->pkey),
|
||||
&pkey_index))
|
||||
pkey_index = MCAST_INVALID_PKEY_INDEX;
|
||||
|
||||
spin_lock_irq(&group->port->lock);
|
||||
if (group->state == MCAST_BUSY &&
|
||||
|
||||
@@ -563,8 +563,11 @@ void ipoib_mcast_join_task(struct work_struct *work)
|
||||
if (!test_bit(IPOIB_FLAG_OPER_UP, &priv->flags))
|
||||
return;
|
||||
|
||||
if (ib_query_port(priv->ca, priv->port, &port_attr) ||
|
||||
port_attr.state != IB_PORT_ACTIVE) {
|
||||
if (ib_query_port(priv->ca, priv->port, &port_attr)) {
|
||||
ipoib_dbg(priv, "ib_query_port() failed\n");
|
||||
return;
|
||||
}
|
||||
if (port_attr.state != IB_PORT_ACTIVE) {
|
||||
ipoib_dbg(priv, "port state is not ACTIVE (state = %d) suspending join task\n",
|
||||
port_attr.state);
|
||||
return;
|
||||
|
||||
@@ -592,7 +592,6 @@ static int drv260x_probe(struct i2c_client *client,
|
||||
}
|
||||
|
||||
haptics->input_dev->name = "drv260x:haptics";
|
||||
haptics->input_dev->dev.parent = client->dev.parent;
|
||||
haptics->input_dev->close = drv260x_close;
|
||||
input_set_drvdata(haptics->input_dev, haptics);
|
||||
input_set_capability(haptics->input_dev, EV_FF, FF_RUMBLE);
|
||||
|
||||
@@ -458,6 +458,21 @@ config DM_VERITY
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config DM_VERITY_HASH_PREFETCH_MIN_SIZE_128
|
||||
bool "Prefetch size 128"
|
||||
|
||||
config DM_VERITY_HASH_PREFETCH_MIN_SIZE
|
||||
int "Verity hash prefetch minimum size"
|
||||
depends on DM_VERITY
|
||||
range 1 4096
|
||||
default 128 if DM_VERITY_HASH_PREFETCH_MIN_SIZE_128
|
||||
default 1
|
||||
---help---
|
||||
This sets minimum number of hash blocks to prefetch for dm-verity.
|
||||
For devices like eMMC, having larger prefetch size like 128 can improve
|
||||
performance with increased memory consumption for keeping more hashes
|
||||
in RAM.
|
||||
|
||||
config DM_VERITY_FEC
|
||||
bool "Verity forward error correction support"
|
||||
depends on DM_VERITY
|
||||
@@ -510,6 +525,7 @@ config DM_ANDROID_VERITY
|
||||
depends on ASYMMETRIC_KEY_TYPE
|
||||
depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE
|
||||
depends on MD_LINEAR
|
||||
select DM_VERITY_HASH_PREFETCH_MIN_SIZE_128
|
||||
---help---
|
||||
This device-mapper target is virtually a VERITY target. This
|
||||
target is setup by reading the metadata contents piggybacked
|
||||
|
||||
@@ -1500,12 +1500,15 @@ static int crypt_set_key(struct crypt_config *cc, char *key)
|
||||
if (!cc->key_size && strcmp(key, "-"))
|
||||
goto out;
|
||||
|
||||
/* clear the flag since following operations may invalidate previously valid key */
|
||||
clear_bit(DM_CRYPT_KEY_VALID, &cc->flags);
|
||||
|
||||
if (cc->key_size && crypt_decode_key(cc->key, key, cc->key_size) < 0)
|
||||
goto out;
|
||||
|
||||
set_bit(DM_CRYPT_KEY_VALID, &cc->flags);
|
||||
|
||||
r = crypt_setkey_allcpus(cc);
|
||||
if (!r)
|
||||
set_bit(DM_CRYPT_KEY_VALID, &cc->flags);
|
||||
|
||||
out:
|
||||
/* Hex key string not needed after here, so wipe it. */
|
||||
|
||||
@@ -200,11 +200,13 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)
|
||||
|
||||
if (!(fc->up_interval + fc->down_interval)) {
|
||||
ti->error = "Total (up + down) interval is zero";
|
||||
r = -EINVAL;
|
||||
goto bad;
|
||||
}
|
||||
|
||||
if (fc->up_interval + fc->down_interval < fc->up_interval) {
|
||||
ti->error = "Interval overflow";
|
||||
r = -EINVAL;
|
||||
goto bad;
|
||||
}
|
||||
|
||||
|
||||
@@ -501,6 +501,7 @@ static void verity_prefetch_io(struct work_struct *work)
|
||||
container_of(work, struct dm_verity_prefetch_work, work);
|
||||
struct dm_verity *v = pw->v;
|
||||
int i;
|
||||
sector_t prefetch_size;
|
||||
|
||||
for (i = v->levels - 2; i >= 0; i--) {
|
||||
sector_t hash_block_start;
|
||||
@@ -523,8 +524,14 @@ static void verity_prefetch_io(struct work_struct *work)
|
||||
hash_block_end = v->hash_blocks - 1;
|
||||
}
|
||||
no_prefetch_cluster:
|
||||
// for emmc, it is more efficient to send bigger read
|
||||
prefetch_size = max((sector_t)CONFIG_DM_VERITY_HASH_PREFETCH_MIN_SIZE,
|
||||
hash_block_end - hash_block_start + 1);
|
||||
if ((hash_block_start + prefetch_size) >= (v->hash_start + v->hash_blocks)) {
|
||||
prefetch_size = hash_block_end - hash_block_start + 1;
|
||||
}
|
||||
dm_bufio_prefetch(v->bufio, hash_block_start,
|
||||
hash_block_end - hash_block_start + 1);
|
||||
prefetch_size);
|
||||
}
|
||||
|
||||
kfree(pw);
|
||||
|
||||
@@ -775,16 +775,14 @@ int dm_sm_metadata_create(struct dm_space_map *sm,
|
||||
memcpy(&smm->sm, &bootstrap_ops, sizeof(smm->sm));
|
||||
|
||||
r = sm_ll_new_metadata(&smm->ll, tm);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
if (nr_blocks > DM_SM_METADATA_MAX_BLOCKS)
|
||||
nr_blocks = DM_SM_METADATA_MAX_BLOCKS;
|
||||
r = sm_ll_extend(&smm->ll, nr_blocks);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
if (!r) {
|
||||
if (nr_blocks > DM_SM_METADATA_MAX_BLOCKS)
|
||||
nr_blocks = DM_SM_METADATA_MAX_BLOCKS;
|
||||
r = sm_ll_extend(&smm->ll, nr_blocks);
|
||||
}
|
||||
memcpy(&smm->sm, &ops, sizeof(smm->sm));
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
/*
|
||||
* Now we need to update the newly created data structures with the
|
||||
|
||||
@@ -6980,6 +6980,15 @@ static int run(struct mddev *mddev)
|
||||
stripe = (stripe | (stripe-1)) + 1;
|
||||
mddev->queue->limits.discard_alignment = stripe;
|
||||
mddev->queue->limits.discard_granularity = stripe;
|
||||
|
||||
/*
|
||||
* We use 16-bit counter of active stripes in bi_phys_segments
|
||||
* (minus one for over-loaded initialization)
|
||||
*/
|
||||
blk_queue_max_hw_sectors(mddev->queue, 0xfffe * STRIPE_SECTORS);
|
||||
blk_queue_max_discard_sectors(mddev->queue,
|
||||
0xfffe * STRIPE_SECTORS);
|
||||
|
||||
/*
|
||||
* unaligned part of discard request will be ignored, so can't
|
||||
* guarantee discard_zeroes_data
|
||||
|
||||
@@ -286,7 +286,10 @@ static inline u32 solo_reg_read(struct solo_dev *solo_dev, int reg)
|
||||
static inline void solo_reg_write(struct solo_dev *solo_dev, int reg,
|
||||
u32 data)
|
||||
{
|
||||
u16 val;
|
||||
|
||||
writel(data, solo_dev->reg_base + reg);
|
||||
pci_read_config_word(solo_dev->pdev, PCI_STATUS, &val);
|
||||
}
|
||||
|
||||
static inline void solo_irq_on(struct solo_dev *dev, u32 mask)
|
||||
|
||||
@@ -698,7 +698,7 @@ void mei_host_client_init(struct work_struct *work)
|
||||
|
||||
pm_runtime_mark_last_busy(dev->dev);
|
||||
dev_dbg(dev->dev, "rpm: autosuspend\n");
|
||||
pm_runtime_autosuspend(dev->dev);
|
||||
pm_request_autosuspend(dev->dev);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2040,7 +2040,27 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
|
||||
ctrl &= ~SDHCI_CTRL_EXEC_TUNING;
|
||||
sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2);
|
||||
|
||||
sdhci_do_reset(host, SDHCI_RESET_CMD);
|
||||
sdhci_do_reset(host, SDHCI_RESET_DATA);
|
||||
|
||||
err = -EIO;
|
||||
|
||||
if (cmd.opcode != MMC_SEND_TUNING_BLOCK_HS200)
|
||||
goto out;
|
||||
|
||||
sdhci_writel(host, host->ier, SDHCI_INT_ENABLE);
|
||||
sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);
|
||||
|
||||
spin_unlock_irqrestore(&host->lock, flags);
|
||||
|
||||
memset(&cmd, 0, sizeof(cmd));
|
||||
cmd.opcode = MMC_STOP_TRANSMISSION;
|
||||
cmd.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC;
|
||||
cmd.busy_timeout = 50;
|
||||
mmc_wait_for_cmd(mmc, &cmd, 0);
|
||||
|
||||
spin_lock_irqsave(&host->lock, flags);
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -872,23 +872,25 @@ lbl_free_candev:
|
||||
static void peak_usb_disconnect(struct usb_interface *intf)
|
||||
{
|
||||
struct peak_usb_device *dev;
|
||||
struct peak_usb_device *dev_prev_siblings;
|
||||
|
||||
/* unregister as many netdev devices as siblings */
|
||||
for (dev = usb_get_intfdata(intf); dev; dev = dev->prev_siblings) {
|
||||
for (dev = usb_get_intfdata(intf); dev; dev = dev_prev_siblings) {
|
||||
struct net_device *netdev = dev->netdev;
|
||||
char name[IFNAMSIZ];
|
||||
|
||||
dev_prev_siblings = dev->prev_siblings;
|
||||
dev->state &= ~PCAN_USB_STATE_CONNECTED;
|
||||
strncpy(name, netdev->name, IFNAMSIZ);
|
||||
|
||||
unregister_netdev(netdev);
|
||||
free_candev(netdev);
|
||||
|
||||
kfree(dev->cmd_buf);
|
||||
dev->next_siblings = NULL;
|
||||
if (dev->adapter->dev_free)
|
||||
dev->adapter->dev_free(dev);
|
||||
|
||||
free_candev(netdev);
|
||||
dev_info(&intf->dev, "%s removed\n", name);
|
||||
}
|
||||
|
||||
|
||||
@@ -1137,6 +1137,7 @@ static void bcm_sf2_sw_adjust_link(struct dsa_switch *ds, int port,
|
||||
struct phy_device *phydev)
|
||||
{
|
||||
struct bcm_sf2_priv *priv = ds_to_priv(ds);
|
||||
struct ethtool_eee *p = &priv->port_sts[port].eee;
|
||||
u32 id_mode_dis = 0, port_mode;
|
||||
const char *str = NULL;
|
||||
u32 reg;
|
||||
@@ -1211,6 +1212,9 @@ force_link:
|
||||
reg |= DUPLX_MODE;
|
||||
|
||||
core_writel(priv, reg, CORE_STS_OVERRIDE_GMIIP_PORT(port));
|
||||
|
||||
if (!phydev->is_pseudo_fixed_link)
|
||||
p->eee_enabled = bcm_sf2_eee_init(ds, port, phydev);
|
||||
}
|
||||
|
||||
static void bcm_sf2_sw_fixed_link_update(struct dsa_switch *ds, int port,
|
||||
|
||||
@@ -1168,6 +1168,7 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev,
|
||||
struct bcmgenet_tx_ring *ring)
|
||||
{
|
||||
struct bcmgenet_priv *priv = netdev_priv(dev);
|
||||
struct device *kdev = &priv->pdev->dev;
|
||||
struct enet_cb *tx_cb_ptr;
|
||||
struct netdev_queue *txq;
|
||||
unsigned int pkts_compl = 0;
|
||||
@@ -1195,7 +1196,7 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev,
|
||||
pkts_compl++;
|
||||
dev->stats.tx_packets++;
|
||||
dev->stats.tx_bytes += tx_cb_ptr->skb->len;
|
||||
dma_unmap_single(&dev->dev,
|
||||
dma_unmap_single(kdev,
|
||||
dma_unmap_addr(tx_cb_ptr, dma_addr),
|
||||
dma_unmap_len(tx_cb_ptr, dma_len),
|
||||
DMA_TO_DEVICE);
|
||||
@@ -1203,7 +1204,7 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev,
|
||||
} else if (dma_unmap_addr(tx_cb_ptr, dma_addr)) {
|
||||
dev->stats.tx_bytes +=
|
||||
dma_unmap_len(tx_cb_ptr, dma_len);
|
||||
dma_unmap_page(&dev->dev,
|
||||
dma_unmap_page(kdev,
|
||||
dma_unmap_addr(tx_cb_ptr, dma_addr),
|
||||
dma_unmap_len(tx_cb_ptr, dma_len),
|
||||
DMA_TO_DEVICE);
|
||||
@@ -1754,6 +1755,7 @@ static int bcmgenet_alloc_rx_buffers(struct bcmgenet_priv *priv,
|
||||
|
||||
static void bcmgenet_free_rx_buffers(struct bcmgenet_priv *priv)
|
||||
{
|
||||
struct device *kdev = &priv->pdev->dev;
|
||||
struct enet_cb *cb;
|
||||
int i;
|
||||
|
||||
@@ -1761,7 +1763,7 @@ static void bcmgenet_free_rx_buffers(struct bcmgenet_priv *priv)
|
||||
cb = &priv->rx_cbs[i];
|
||||
|
||||
if (dma_unmap_addr(cb, dma_addr)) {
|
||||
dma_unmap_single(&priv->dev->dev,
|
||||
dma_unmap_single(kdev,
|
||||
dma_unmap_addr(cb, dma_addr),
|
||||
priv->rx_buf_len, DMA_FROM_DEVICE);
|
||||
dma_unmap_addr_set(cb, dma_addr, 0);
|
||||
|
||||
@@ -772,6 +772,17 @@ struct mvpp2_rx_desc {
|
||||
u32 reserved8;
|
||||
};
|
||||
|
||||
struct mvpp2_txq_pcpu_buf {
|
||||
/* Transmitted SKB */
|
||||
struct sk_buff *skb;
|
||||
|
||||
/* Physical address of transmitted buffer */
|
||||
dma_addr_t phys;
|
||||
|
||||
/* Size transmitted */
|
||||
size_t size;
|
||||
};
|
||||
|
||||
/* Per-CPU Tx queue control */
|
||||
struct mvpp2_txq_pcpu {
|
||||
int cpu;
|
||||
@@ -787,11 +798,8 @@ struct mvpp2_txq_pcpu {
|
||||
/* Number of Tx DMA descriptors reserved for each CPU */
|
||||
int reserved_num;
|
||||
|
||||
/* Array of transmitted skb */
|
||||
struct sk_buff **tx_skb;
|
||||
|
||||
/* Array of transmitted buffers' physical addresses */
|
||||
dma_addr_t *tx_buffs;
|
||||
/* Infos about transmitted buffers */
|
||||
struct mvpp2_txq_pcpu_buf *buffs;
|
||||
|
||||
/* Index of last TX DMA descriptor that was inserted */
|
||||
int txq_put_index;
|
||||
@@ -981,10 +989,11 @@ static void mvpp2_txq_inc_put(struct mvpp2_txq_pcpu *txq_pcpu,
|
||||
struct sk_buff *skb,
|
||||
struct mvpp2_tx_desc *tx_desc)
|
||||
{
|
||||
txq_pcpu->tx_skb[txq_pcpu->txq_put_index] = skb;
|
||||
if (skb)
|
||||
txq_pcpu->tx_buffs[txq_pcpu->txq_put_index] =
|
||||
tx_desc->buf_phys_addr;
|
||||
struct mvpp2_txq_pcpu_buf *tx_buf =
|
||||
txq_pcpu->buffs + txq_pcpu->txq_put_index;
|
||||
tx_buf->skb = skb;
|
||||
tx_buf->size = tx_desc->data_size;
|
||||
tx_buf->phys = tx_desc->buf_phys_addr;
|
||||
txq_pcpu->txq_put_index++;
|
||||
if (txq_pcpu->txq_put_index == txq_pcpu->size)
|
||||
txq_pcpu->txq_put_index = 0;
|
||||
@@ -4403,17 +4412,16 @@ static void mvpp2_txq_bufs_free(struct mvpp2_port *port,
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
dma_addr_t buf_phys_addr =
|
||||
txq_pcpu->tx_buffs[txq_pcpu->txq_get_index];
|
||||
struct sk_buff *skb = txq_pcpu->tx_skb[txq_pcpu->txq_get_index];
|
||||
struct mvpp2_txq_pcpu_buf *tx_buf =
|
||||
txq_pcpu->buffs + txq_pcpu->txq_get_index;
|
||||
|
||||
mvpp2_txq_inc_get(txq_pcpu);
|
||||
|
||||
dma_unmap_single(port->dev->dev.parent, buf_phys_addr,
|
||||
skb_headlen(skb), DMA_TO_DEVICE);
|
||||
if (!skb)
|
||||
dma_unmap_single(port->dev->dev.parent, tx_buf->phys,
|
||||
tx_buf->size, DMA_TO_DEVICE);
|
||||
if (!tx_buf->skb)
|
||||
continue;
|
||||
dev_kfree_skb_any(skb);
|
||||
dev_kfree_skb_any(tx_buf->skb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4664,15 +4672,10 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
|
||||
for_each_present_cpu(cpu) {
|
||||
txq_pcpu = per_cpu_ptr(txq->pcpu, cpu);
|
||||
txq_pcpu->size = txq->size;
|
||||
txq_pcpu->tx_skb = kmalloc(txq_pcpu->size *
|
||||
sizeof(*txq_pcpu->tx_skb),
|
||||
GFP_KERNEL);
|
||||
if (!txq_pcpu->tx_skb)
|
||||
goto error;
|
||||
|
||||
txq_pcpu->tx_buffs = kmalloc(txq_pcpu->size *
|
||||
sizeof(dma_addr_t), GFP_KERNEL);
|
||||
if (!txq_pcpu->tx_buffs)
|
||||
txq_pcpu->buffs = kmalloc(txq_pcpu->size *
|
||||
sizeof(struct mvpp2_txq_pcpu_buf),
|
||||
GFP_KERNEL);
|
||||
if (!txq_pcpu->buffs)
|
||||
goto error;
|
||||
|
||||
txq_pcpu->count = 0;
|
||||
@@ -4686,8 +4689,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
|
||||
error:
|
||||
for_each_present_cpu(cpu) {
|
||||
txq_pcpu = per_cpu_ptr(txq->pcpu, cpu);
|
||||
kfree(txq_pcpu->tx_skb);
|
||||
kfree(txq_pcpu->tx_buffs);
|
||||
kfree(txq_pcpu->buffs);
|
||||
}
|
||||
|
||||
dma_free_coherent(port->dev->dev.parent,
|
||||
@@ -4706,8 +4708,7 @@ static void mvpp2_txq_deinit(struct mvpp2_port *port,
|
||||
|
||||
for_each_present_cpu(cpu) {
|
||||
txq_pcpu = per_cpu_ptr(txq->pcpu, cpu);
|
||||
kfree(txq_pcpu->tx_skb);
|
||||
kfree(txq_pcpu->tx_buffs);
|
||||
kfree(txq_pcpu->buffs);
|
||||
}
|
||||
|
||||
if (txq->descs)
|
||||
|
||||
@@ -5220,6 +5220,19 @@ static SIMPLE_DEV_PM_OPS(sky2_pm_ops, sky2_suspend, sky2_resume);
|
||||
|
||||
static void sky2_shutdown(struct pci_dev *pdev)
|
||||
{
|
||||
struct sky2_hw *hw = pci_get_drvdata(pdev);
|
||||
int port;
|
||||
|
||||
for (port = 0; port < hw->ports; port++) {
|
||||
struct net_device *ndev = hw->dev[port];
|
||||
|
||||
rtnl_lock();
|
||||
if (netif_running(ndev)) {
|
||||
dev_close(ndev);
|
||||
netif_device_detach(ndev);
|
||||
}
|
||||
rtnl_unlock();
|
||||
}
|
||||
sky2_suspend(&pdev->dev);
|
||||
pci_wake_from_d3(pdev, device_may_wakeup(&pdev->dev));
|
||||
pci_set_power_state(pdev, PCI_D3hot);
|
||||
|
||||
@@ -832,7 +832,7 @@ static struct sh_eth_cpu_data r7s72100_data = {
|
||||
|
||||
.ecsr_value = ECSR_ICD,
|
||||
.ecsipr_value = ECSIPR_ICDIP,
|
||||
.eesipr_value = 0xff7f009f,
|
||||
.eesipr_value = 0xe77f009f,
|
||||
|
||||
.tx_check = EESR_TC1 | EESR_FTC,
|
||||
.eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT |
|
||||
|
||||
@@ -815,7 +815,6 @@ static netdev_tx_t geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
|
||||
struct geneve_dev *geneve = netdev_priv(dev);
|
||||
struct geneve_sock *gs4 = geneve->sock4;
|
||||
struct rtable *rt = NULL;
|
||||
const struct iphdr *iip; /* interior IP header */
|
||||
int err = -EINVAL;
|
||||
struct flowi4 fl4;
|
||||
__u8 tos, ttl;
|
||||
@@ -842,8 +841,6 @@ static netdev_tx_t geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
|
||||
sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
|
||||
skb_reset_mac_header(skb);
|
||||
|
||||
iip = ip_hdr(skb);
|
||||
|
||||
if (info) {
|
||||
const struct ip_tunnel_key *key = &info->key;
|
||||
u8 *opts = NULL;
|
||||
@@ -859,7 +856,7 @@ static netdev_tx_t geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
|
||||
if (unlikely(err))
|
||||
goto err;
|
||||
|
||||
tos = ip_tunnel_ecn_encap(key->tos, iip, skb);
|
||||
tos = ip_tunnel_ecn_encap(key->tos, ip_hdr(skb), skb);
|
||||
ttl = key->ttl;
|
||||
df = key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0;
|
||||
} else {
|
||||
@@ -869,7 +866,7 @@ static netdev_tx_t geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
|
||||
if (unlikely(err))
|
||||
goto err;
|
||||
|
||||
tos = ip_tunnel_ecn_encap(fl4.flowi4_tos, iip, skb);
|
||||
tos = ip_tunnel_ecn_encap(fl4.flowi4_tos, ip_hdr(skb), skb);
|
||||
ttl = geneve->ttl;
|
||||
if (!ttl && IN_MULTICAST(ntohl(fl4.daddr)))
|
||||
ttl = 1;
|
||||
@@ -903,7 +900,6 @@ static netdev_tx_t geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
|
||||
struct geneve_dev *geneve = netdev_priv(dev);
|
||||
struct geneve_sock *gs6 = geneve->sock6;
|
||||
struct dst_entry *dst = NULL;
|
||||
const struct iphdr *iip; /* interior IP header */
|
||||
int err = -EINVAL;
|
||||
struct flowi6 fl6;
|
||||
__u8 prio, ttl;
|
||||
@@ -927,8 +923,6 @@ static netdev_tx_t geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
|
||||
sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
|
||||
skb_reset_mac_header(skb);
|
||||
|
||||
iip = ip_hdr(skb);
|
||||
|
||||
if (info) {
|
||||
const struct ip_tunnel_key *key = &info->key;
|
||||
u8 *opts = NULL;
|
||||
@@ -945,7 +939,7 @@ static netdev_tx_t geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
|
||||
if (unlikely(err))
|
||||
goto err;
|
||||
|
||||
prio = ip_tunnel_ecn_encap(key->tos, iip, skb);
|
||||
prio = ip_tunnel_ecn_encap(key->tos, ip_hdr(skb), skb);
|
||||
ttl = key->ttl;
|
||||
} else {
|
||||
udp_csum = false;
|
||||
@@ -954,7 +948,7 @@ static netdev_tx_t geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
|
||||
if (unlikely(err))
|
||||
goto err;
|
||||
|
||||
prio = ip_tunnel_ecn_encap(fl6.flowi6_tos, iip, skb);
|
||||
prio = ip_tunnel_ecn_encap(fl6.flowi6_tos, ip_hdr(skb), skb);
|
||||
ttl = geneve->ttl;
|
||||
if (!ttl && ipv6_addr_is_multicast(&fl6.daddr))
|
||||
ttl = 1;
|
||||
|
||||
@@ -1465,6 +1465,11 @@ static void virtnet_free_queues(struct virtnet_info *vi)
|
||||
netif_napi_del(&vi->rq[i].napi);
|
||||
}
|
||||
|
||||
/* We called napi_hash_del() before netif_napi_del(),
|
||||
* we need to respect an RCU grace period before freeing vi->rq
|
||||
*/
|
||||
synchronize_net();
|
||||
|
||||
kfree(vi->rq);
|
||||
kfree(vi->sq);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ static const struct pci_device_id ath_pci_id_table[] = {
|
||||
{ PCI_VDEVICE(ATHEROS, 0x0023) }, /* PCI */
|
||||
{ PCI_VDEVICE(ATHEROS, 0x0024) }, /* PCI-E */
|
||||
{ PCI_VDEVICE(ATHEROS, 0x0027) }, /* PCI */
|
||||
{ PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */
|
||||
|
||||
#ifdef CONFIG_ATH9K_PCOEM
|
||||
/* Mini PCI AR9220 MB92 cards: Compex WLM200NX, Wistron DNMA-92 */
|
||||
@@ -38,7 +37,7 @@ static const struct pci_device_id ath_pci_id_table[] = {
|
||||
.driver_data = ATH9K_PCI_LED_ACT_HI },
|
||||
#endif
|
||||
|
||||
{ PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */
|
||||
{ PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */
|
||||
|
||||
#ifdef CONFIG_ATH9K_PCOEM
|
||||
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
|
||||
@@ -86,7 +85,11 @@ static const struct pci_device_id ath_pci_id_table[] = {
|
||||
0x10CF, /* Fujitsu */
|
||||
0x1536),
|
||||
.driver_data = ATH9K_PCI_D3_L1_WAR },
|
||||
#endif
|
||||
|
||||
{ PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */
|
||||
|
||||
#ifdef CONFIG_ATH9K_PCOEM
|
||||
/* AR9285 card for Asus */
|
||||
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
|
||||
0x002B,
|
||||
|
||||
@@ -2144,8 +2144,9 @@ done:
|
||||
is_scanning_required = 1;
|
||||
} else {
|
||||
mwifiex_dbg(priv->adapter, MSG,
|
||||
"info: trying to associate to '%s' bssid %pM\n",
|
||||
(char *)req_ssid.ssid, bss->bssid);
|
||||
"info: trying to associate to '%.*s' bssid %pM\n",
|
||||
req_ssid.ssid_len, (char *)req_ssid.ssid,
|
||||
bss->bssid);
|
||||
memcpy(&priv->cfg_bssid, bss->bssid, ETH_ALEN);
|
||||
break;
|
||||
}
|
||||
@@ -2202,8 +2203,8 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
|
||||
}
|
||||
|
||||
mwifiex_dbg(adapter, INFO,
|
||||
"info: Trying to associate to %s and bssid %pM\n",
|
||||
(char *)sme->ssid, sme->bssid);
|
||||
"info: Trying to associate to %.*s and bssid %pM\n",
|
||||
(int)sme->ssid_len, (char *)sme->ssid, sme->bssid);
|
||||
|
||||
ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid,
|
||||
priv->bss_mode, sme->channel, sme, 0);
|
||||
@@ -2333,8 +2334,8 @@ mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
|
||||
}
|
||||
|
||||
mwifiex_dbg(priv->adapter, MSG,
|
||||
"info: trying to join to %s and bssid %pM\n",
|
||||
(char *)params->ssid, params->bssid);
|
||||
"info: trying to join to %.*s and bssid %pM\n",
|
||||
params->ssid_len, (char *)params->ssid, params->bssid);
|
||||
|
||||
mwifiex_set_ibss_params(priv, params);
|
||||
|
||||
|
||||
@@ -1303,12 +1303,13 @@ EXPORT_SYMBOL_GPL(rtl_action_proc);
|
||||
|
||||
static void setup_arp_tx(struct rtl_priv *rtlpriv, struct rtl_ps_ctl *ppsc)
|
||||
{
|
||||
struct ieee80211_hw *hw = rtlpriv->hw;
|
||||
|
||||
rtlpriv->ra.is_special_data = true;
|
||||
if (rtlpriv->cfg->ops->get_btc_status())
|
||||
rtlpriv->btcoexist.btc_ops->btc_special_packet_notify(
|
||||
rtlpriv, 1);
|
||||
rtlpriv->enter_ps = false;
|
||||
schedule_work(&rtlpriv->works.lps_change_work);
|
||||
rtl_lps_leave(hw);
|
||||
ppsc->last_delaylps_stamp_jiffies = jiffies;
|
||||
}
|
||||
|
||||
@@ -1381,8 +1382,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx,
|
||||
|
||||
if (is_tx) {
|
||||
rtlpriv->ra.is_special_data = true;
|
||||
rtlpriv->enter_ps = false;
|
||||
schedule_work(&rtlpriv->works.lps_change_work);
|
||||
rtl_lps_leave(hw);
|
||||
ppsc->last_delaylps_stamp_jiffies = jiffies;
|
||||
}
|
||||
|
||||
|
||||
@@ -1153,10 +1153,8 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
|
||||
} else {
|
||||
mstatus = RT_MEDIA_DISCONNECT;
|
||||
|
||||
if (mac->link_state == MAC80211_LINKED) {
|
||||
rtlpriv->enter_ps = false;
|
||||
schedule_work(&rtlpriv->works.lps_change_work);
|
||||
}
|
||||
if (mac->link_state == MAC80211_LINKED)
|
||||
rtl_lps_leave(hw);
|
||||
if (ppsc->p2p_ps_info.p2p_ps_mode > P2P_PS_NONE)
|
||||
rtl_p2p_ps_cmd(hw, P2P_PS_DISABLE);
|
||||
mac->link_state = MAC80211_NOLINK;
|
||||
@@ -1432,8 +1430,7 @@ static void rtl_op_sw_scan_start(struct ieee80211_hw *hw,
|
||||
}
|
||||
|
||||
if (mac->link_state == MAC80211_LINKED) {
|
||||
rtlpriv->enter_ps = false;
|
||||
schedule_work(&rtlpriv->works.lps_change_work);
|
||||
rtl_lps_leave(hw);
|
||||
mac->link_state = MAC80211_LINKED_SCANNING;
|
||||
} else {
|
||||
rtl_ips_nic_on(hw);
|
||||
|
||||
@@ -664,11 +664,9 @@ tx_status_ok:
|
||||
}
|
||||
|
||||
if (((rtlpriv->link_info.num_rx_inperiod +
|
||||
rtlpriv->link_info.num_tx_inperiod) > 8) ||
|
||||
(rtlpriv->link_info.num_rx_inperiod > 2)) {
|
||||
rtlpriv->enter_ps = false;
|
||||
schedule_work(&rtlpriv->works.lps_change_work);
|
||||
}
|
||||
rtlpriv->link_info.num_tx_inperiod) > 8) ||
|
||||
(rtlpriv->link_info.num_rx_inperiod > 2))
|
||||
rtl_lps_leave(hw);
|
||||
}
|
||||
|
||||
static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw,
|
||||
@@ -919,10 +917,8 @@ new_trx_end:
|
||||
}
|
||||
if (((rtlpriv->link_info.num_rx_inperiod +
|
||||
rtlpriv->link_info.num_tx_inperiod) > 8) ||
|
||||
(rtlpriv->link_info.num_rx_inperiod > 2)) {
|
||||
rtlpriv->enter_ps = false;
|
||||
schedule_work(&rtlpriv->works.lps_change_work);
|
||||
}
|
||||
(rtlpriv->link_info.num_rx_inperiod > 2))
|
||||
rtl_lps_leave(hw);
|
||||
skb = new_skb;
|
||||
no_new:
|
||||
if (rtlpriv->use_new_trx_flow) {
|
||||
|
||||
@@ -414,8 +414,8 @@ void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode)
|
||||
}
|
||||
}
|
||||
|
||||
/*Enter the leisure power save mode.*/
|
||||
void rtl_lps_enter(struct ieee80211_hw *hw)
|
||||
/* Interrupt safe routine to enter the leisure power save mode.*/
|
||||
static void rtl_lps_enter_core(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
|
||||
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
|
||||
@@ -455,10 +455,9 @@ void rtl_lps_enter(struct ieee80211_hw *hw)
|
||||
|
||||
spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flag);
|
||||
}
|
||||
EXPORT_SYMBOL(rtl_lps_enter);
|
||||
|
||||
/*Leave the leisure power save mode.*/
|
||||
void rtl_lps_leave(struct ieee80211_hw *hw)
|
||||
/* Interrupt safe routine to leave the leisure power save mode.*/
|
||||
static void rtl_lps_leave_core(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
|
||||
@@ -488,7 +487,6 @@ void rtl_lps_leave(struct ieee80211_hw *hw)
|
||||
}
|
||||
spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flag);
|
||||
}
|
||||
EXPORT_SYMBOL(rtl_lps_leave);
|
||||
|
||||
/* For sw LPS*/
|
||||
void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len)
|
||||
@@ -681,12 +679,34 @@ void rtl_lps_change_work_callback(struct work_struct *work)
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
|
||||
if (rtlpriv->enter_ps)
|
||||
rtl_lps_enter(hw);
|
||||
rtl_lps_enter_core(hw);
|
||||
else
|
||||
rtl_lps_leave(hw);
|
||||
rtl_lps_leave_core(hw);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rtl_lps_change_work_callback);
|
||||
|
||||
void rtl_lps_enter(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
|
||||
if (!in_interrupt())
|
||||
return rtl_lps_enter_core(hw);
|
||||
rtlpriv->enter_ps = true;
|
||||
schedule_work(&rtlpriv->works.lps_change_work);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rtl_lps_enter);
|
||||
|
||||
void rtl_lps_leave(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
|
||||
if (!in_interrupt())
|
||||
return rtl_lps_leave_core(hw);
|
||||
rtlpriv->enter_ps = false;
|
||||
schedule_work(&rtlpriv->works.lps_change_work);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rtl_lps_leave);
|
||||
|
||||
void rtl_swlps_wq_callback(void *data)
|
||||
{
|
||||
struct rtl_works *rtlworks = container_of_dwork_rtl(data,
|
||||
|
||||
@@ -2043,6 +2043,10 @@ bool pci_dev_run_wake(struct pci_dev *dev)
|
||||
if (!dev->pme_support)
|
||||
return false;
|
||||
|
||||
/* PME-capable in principle, but not from the intended sleep state */
|
||||
if (!pci_pme_capable(dev, pci_target_state(dev)))
|
||||
return false;
|
||||
|
||||
while (bus->parent) {
|
||||
struct pci_dev *bridge = bus->self;
|
||||
|
||||
|
||||
@@ -283,20 +283,6 @@ out:
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct pci_dev *pcie_find_root_port(struct pci_dev *dev)
|
||||
{
|
||||
while (1) {
|
||||
if (!pci_is_pcie(dev))
|
||||
break;
|
||||
if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
|
||||
return dev;
|
||||
if (!dev->bus->self)
|
||||
break;
|
||||
dev = dev->bus->self;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int find_aer_device_iter(struct device *device, void *data)
|
||||
{
|
||||
struct pcie_device **result = data;
|
||||
|
||||
@@ -1415,6 +1415,21 @@ static void program_hpp_type1(struct pci_dev *dev, struct hpp_type1 *hpp)
|
||||
dev_warn(&dev->dev, "PCI-X settings not supported\n");
|
||||
}
|
||||
|
||||
static bool pcie_root_rcb_set(struct pci_dev *dev)
|
||||
{
|
||||
struct pci_dev *rp = pcie_find_root_port(dev);
|
||||
u16 lnkctl;
|
||||
|
||||
if (!rp)
|
||||
return false;
|
||||
|
||||
pcie_capability_read_word(rp, PCI_EXP_LNKCTL, &lnkctl);
|
||||
if (lnkctl & PCI_EXP_LNKCTL_RCB)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
|
||||
{
|
||||
int pos;
|
||||
@@ -1444,9 +1459,20 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
|
||||
~hpp->pci_exp_devctl_and, hpp->pci_exp_devctl_or);
|
||||
|
||||
/* Initialize Link Control Register */
|
||||
if (pcie_cap_has_lnkctl(dev))
|
||||
if (pcie_cap_has_lnkctl(dev)) {
|
||||
|
||||
/*
|
||||
* If the Root Port supports Read Completion Boundary of
|
||||
* 128, set RCB to 128. Otherwise, clear it.
|
||||
*/
|
||||
hpp->pci_exp_lnkctl_and |= PCI_EXP_LNKCTL_RCB;
|
||||
hpp->pci_exp_lnkctl_or &= ~PCI_EXP_LNKCTL_RCB;
|
||||
if (pcie_root_rcb_set(dev))
|
||||
hpp->pci_exp_lnkctl_or |= PCI_EXP_LNKCTL_RCB;
|
||||
|
||||
pcie_capability_clear_and_set_word(dev, PCI_EXP_LNKCTL,
|
||||
~hpp->pci_exp_lnkctl_and, hpp->pci_exp_lnkctl_or);
|
||||
}
|
||||
|
||||
/* Find Advanced Error Reporting Enhanced Capability */
|
||||
pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
|
||||
|
||||
@@ -126,6 +126,15 @@ static const struct dmi_system_id asus_quirks[] = {
|
||||
},
|
||||
.driver_data = &quirk_asus_wapf4,
|
||||
},
|
||||
{
|
||||
.callback = dmi_matched,
|
||||
.ident = "ASUSTeK COMPUTER INC. X45U",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "X45U"),
|
||||
},
|
||||
.driver_data = &quirk_asus_wapf4,
|
||||
},
|
||||
{
|
||||
.callback = dmi_matched,
|
||||
.ident = "ASUSTeK COMPUTER INC. X456UA",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user