Linux 5.5-rc6
-----BEGIN PGP SIGNATURE----- iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAl4bv/IeHHRvcnZhbGRz QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGKWEIAImoqyoGKU+ZcBPI PCrqWtNgrZvVDs/K/IinETZSwclvuQCJicN9DYu9g//3uxf9z+i4c5/Oq9veP1lw ikVjfwgo74SqNwO9L+78oUG+2rzUDwf/LTVhlqO17fxmT5WumJjC7Y6/TejwpOd5 xmZ5NopLQTx95OJWaK0rrDUTkG1LzlQZINGbu1K8sRpbppcSc31Egh2n09kaOnmn 6xRRuxFnk2dXuCCdcCdb6rW1vNzd1IRbPjqAktRCalp04hzIFDgXbj9pfOl/iu6O nl+xDSwziW3DzKxdkw3WZTYbPPK8e7s16qF23QLVgwlIKE0qL1h6uiEnAMARGfLm bVFIUbo= =Tdp+ -----END PGP SIGNATURE----- Merge 5.5-rc6 into android-mainline Linux 5.5-rc6 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ia5c01da275dd15897fee4222ce0a01ebd7df3236
This commit is contained in:
commit
18c5ac37c8
@ -18,8 +18,10 @@ Optional properties:
|
||||
- dma-names: should contain "tx" and "rx".
|
||||
- atmel,fifo-size: maximum number of data the RX and TX FIFOs can store for FIFO
|
||||
capable I2C controllers.
|
||||
- i2c-sda-hold-time-ns: TWD hold time, only available for "atmel,sama5d4-i2c"
|
||||
and "atmel,sama5d2-i2c".
|
||||
- i2c-sda-hold-time-ns: TWD hold time, only available for:
|
||||
"atmel,sama5d4-i2c",
|
||||
"atmel,sama5d2-i2c",
|
||||
"microchip,sam9x60-i2c".
|
||||
- Child nodes conforming to i2c bus binding
|
||||
|
||||
Examples :
|
||||
|
@ -111,7 +111,7 @@ patternProperties:
|
||||
spi-rx-bus-width:
|
||||
allOf:
|
||||
- $ref: /schemas/types.yaml#/definitions/uint32
|
||||
- enum: [ 1, 2, 4 ]
|
||||
- enum: [ 1, 2, 4, 8 ]
|
||||
- default: 1
|
||||
description:
|
||||
Bus width to the SPI bus used for MISO.
|
||||
@ -123,7 +123,7 @@ patternProperties:
|
||||
spi-tx-bus-width:
|
||||
allOf:
|
||||
- $ref: /schemas/types.yaml#/definitions/uint32
|
||||
- enum: [ 1, 2, 4 ]
|
||||
- enum: [ 1, 2, 4, 8 ]
|
||||
- default: 1
|
||||
description:
|
||||
Bus width to the SPI bus used for MOSI.
|
||||
|
@ -603,7 +603,7 @@ tcp_synack_retries - INTEGER
|
||||
with the current initial RTO of 1second. With this the final timeout
|
||||
for a passive TCP connection will happen after 63seconds.
|
||||
|
||||
tcp_syncookies - BOOLEAN
|
||||
tcp_syncookies - INTEGER
|
||||
Only valid when the kernel was compiled with CONFIG_SYN_COOKIES
|
||||
Send out syncookies when the syn backlog queue of a socket
|
||||
overflows. This is to prevent against the common 'SYN flood attack'
|
||||
|
@ -34,8 +34,8 @@ the names, the ``net`` tree is for fixes to existing code already in the
|
||||
mainline tree from Linus, and ``net-next`` is where the new code goes
|
||||
for the future release. You can find the trees here:
|
||||
|
||||
- https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
|
||||
- https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
|
||||
- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
|
||||
- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
|
||||
|
||||
Q: How often do changes from these trees make it to the mainline Linus tree?
|
||||
----------------------------------------------------------------------------
|
||||
|
13
MAINTAINERS
13
MAINTAINERS
@ -11460,8 +11460,8 @@ M: "David S. Miller" <davem@davemloft.net>
|
||||
L: netdev@vger.kernel.org
|
||||
W: http://www.linuxfoundation.org/en/Net
|
||||
Q: http://patchwork.ozlabs.org/project/netdev/list/
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
|
||||
S: Odd Fixes
|
||||
F: Documentation/devicetree/bindings/net/
|
||||
F: drivers/net/
|
||||
@ -11502,8 +11502,8 @@ M: "David S. Miller" <davem@davemloft.net>
|
||||
L: netdev@vger.kernel.org
|
||||
W: http://www.linuxfoundation.org/en/Net
|
||||
Q: http://patchwork.ozlabs.org/project/netdev/list/
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
|
||||
B: mailto:netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
F: net/
|
||||
@ -11548,7 +11548,7 @@ M: "David S. Miller" <davem@davemloft.net>
|
||||
M: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
|
||||
M: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
|
||||
L: netdev@vger.kernel.org
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
|
||||
S: Maintained
|
||||
F: net/ipv4/
|
||||
F: net/ipv6/
|
||||
@ -13679,7 +13679,6 @@ F: drivers/net/ethernet/qualcomm/emac/
|
||||
|
||||
QUALCOMM ETHQOS ETHERNET DRIVER
|
||||
M: Vinod Koul <vkoul@kernel.org>
|
||||
M: Niklas Cassel <niklas.cassel@linaro.org>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
|
||||
@ -14549,8 +14548,6 @@ F: include/linux/platform_data/spi-s3c64xx.h
|
||||
|
||||
SAMSUNG SXGBE DRIVERS
|
||||
M: Byungho An <bh74.an@samsung.com>
|
||||
M: Girish K S <ks.giri@samsung.com>
|
||||
M: Vipul Pandya <vipul.pandya@samsung.com>
|
||||
S: Supported
|
||||
L: netdev@vger.kernel.org
|
||||
F: drivers/net/ethernet/samsung/sxgbe/
|
||||
|
2
Makefile
2
Makefile
@ -2,7 +2,7 @@
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 5
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc5
|
||||
EXTRAVERSION = -rc6
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
@ -162,7 +162,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARC_HAS_ACCL_REGS
|
||||
ST2 r58, r59, PT_sp + 12
|
||||
ST2 r58, r59, PT_r58
|
||||
#endif
|
||||
|
||||
.endm
|
||||
@ -172,8 +172,8 @@
|
||||
|
||||
LD2 gp, fp, PT_r26 ; gp (r26), fp (r27)
|
||||
|
||||
ld r12, [sp, PT_sp + 4]
|
||||
ld r30, [sp, PT_sp + 8]
|
||||
ld r12, [sp, PT_r12]
|
||||
ld r30, [sp, PT_r30]
|
||||
|
||||
; Restore SP (into AUX_USER_SP) only if returning to U mode
|
||||
; - for K mode, it will be implicitly restored as stack is unwound
|
||||
@ -190,7 +190,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARC_HAS_ACCL_REGS
|
||||
LD2 r58, r59, PT_sp + 12
|
||||
LD2 r58, r59, PT_r58
|
||||
#endif
|
||||
.endm
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
#define _ASM_ARC_HUGEPAGE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
static inline pte_t pmd_pte(pmd_t pmd)
|
||||
|
@ -66,7 +66,15 @@ int main(void)
|
||||
|
||||
DEFINE(SZ_CALLEE_REGS, sizeof(struct callee_regs));
|
||||
DEFINE(SZ_PT_REGS, sizeof(struct pt_regs));
|
||||
DEFINE(PT_user_r25, offsetof(struct pt_regs, user_r25));
|
||||
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
OFFSET(PT_r12, pt_regs, r12);
|
||||
OFFSET(PT_r30, pt_regs, r30);
|
||||
#endif
|
||||
#ifdef CONFIG_ARC_HAS_ACCL_REGS
|
||||
OFFSET(PT_r58, pt_regs, r58);
|
||||
OFFSET(PT_r59, pt_regs, r59);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
menuconfig ARC_PLAT_EZNPS
|
||||
bool "\"EZchip\" ARC dev platform"
|
||||
select CPU_BIG_ENDIAN
|
||||
select CLKSRC_NPS
|
||||
select CLKSRC_NPS if !PHYS_ADDR_T_64BIT
|
||||
select EZNPS_GIC
|
||||
select EZCHIP_NPS_MANAGEMENT_ENET if ETHERNET
|
||||
help
|
||||
|
@ -72,6 +72,7 @@ config ARM
|
||||
select HAVE_ARM_SMCCC if CPU_V7
|
||||
select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32
|
||||
select HAVE_CONTEXT_TRACKING
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select HAVE_C_RECORDMCOUNT
|
||||
select HAVE_DEBUG_KMEMLEAK
|
||||
select HAVE_DMA_CONTIGUOUS if MMU
|
||||
|
@ -226,8 +226,8 @@ void release_thread(struct task_struct *dead_task)
|
||||
asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
|
||||
|
||||
int
|
||||
copy_thread(unsigned long clone_flags, unsigned long stack_start,
|
||||
unsigned long stk_sz, struct task_struct *p)
|
||||
copy_thread_tls(unsigned long clone_flags, unsigned long stack_start,
|
||||
unsigned long stk_sz, struct task_struct *p, unsigned long tls)
|
||||
{
|
||||
struct thread_info *thread = task_thread_info(p);
|
||||
struct pt_regs *childregs = task_pt_regs(p);
|
||||
@ -261,7 +261,7 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start,
|
||||
clear_ptrace_hw_breakpoint(p);
|
||||
|
||||
if (clone_flags & CLONE_SETTLS)
|
||||
thread->tp_value[0] = childregs->ARM_r3;
|
||||
thread->tp_value[0] = tls;
|
||||
thread->tp_value[1] = get_tpuser();
|
||||
|
||||
thread_notify(THREAD_NOTIFY_COPY, thread);
|
||||
|
@ -141,6 +141,7 @@ config ARM64
|
||||
select HAVE_CMPXCHG_DOUBLE
|
||||
select HAVE_CMPXCHG_LOCAL
|
||||
select HAVE_CONTEXT_TRACKING
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select HAVE_DEBUG_BUGVERBOSE
|
||||
select HAVE_DEBUG_KMEMLEAK
|
||||
select HAVE_DMA_CONTIGUOUS
|
||||
|
@ -85,13 +85,12 @@
|
||||
#define PAGE_SHARED_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_WRITE)
|
||||
#define PAGE_READONLY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_UXN)
|
||||
#define PAGE_READONLY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN)
|
||||
#define PAGE_EXECONLY __pgprot(_PAGE_DEFAULT | PTE_RDONLY | PTE_NG | PTE_PXN)
|
||||
|
||||
#define __P000 PAGE_NONE
|
||||
#define __P001 PAGE_READONLY
|
||||
#define __P010 PAGE_READONLY
|
||||
#define __P011 PAGE_READONLY
|
||||
#define __P100 PAGE_EXECONLY
|
||||
#define __P100 PAGE_READONLY_EXEC
|
||||
#define __P101 PAGE_READONLY_EXEC
|
||||
#define __P110 PAGE_READONLY_EXEC
|
||||
#define __P111 PAGE_READONLY_EXEC
|
||||
@ -100,7 +99,7 @@
|
||||
#define __S001 PAGE_READONLY
|
||||
#define __S010 PAGE_SHARED
|
||||
#define __S011 PAGE_SHARED
|
||||
#define __S100 PAGE_EXECONLY
|
||||
#define __S100 PAGE_READONLY_EXEC
|
||||
#define __S101 PAGE_READONLY_EXEC
|
||||
#define __S110 PAGE_SHARED_EXEC
|
||||
#define __S111 PAGE_SHARED_EXEC
|
||||
|
@ -96,12 +96,8 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
|
||||
#define pte_dirty(pte) (pte_sw_dirty(pte) || pte_hw_dirty(pte))
|
||||
|
||||
#define pte_valid(pte) (!!(pte_val(pte) & PTE_VALID))
|
||||
/*
|
||||
* Execute-only user mappings do not have the PTE_USER bit set. All valid
|
||||
* kernel mappings have the PTE_UXN bit set.
|
||||
*/
|
||||
#define pte_valid_not_user(pte) \
|
||||
((pte_val(pte) & (PTE_VALID | PTE_USER | PTE_UXN)) == (PTE_VALID | PTE_UXN))
|
||||
((pte_val(pte) & (PTE_VALID | PTE_USER)) == PTE_VALID)
|
||||
#define pte_valid_young(pte) \
|
||||
((pte_val(pte) & (PTE_VALID | PTE_AF)) == (PTE_VALID | PTE_AF))
|
||||
#define pte_valid_user(pte) \
|
||||
@ -117,8 +113,8 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
|
||||
|
||||
/*
|
||||
* p??_access_permitted() is true for valid user mappings (subject to the
|
||||
* write permission check) other than user execute-only which do not have the
|
||||
* PTE_USER bit set. PROT_NONE mappings do not have the PTE_VALID bit set.
|
||||
* write permission check). PROT_NONE mappings do not have the PTE_VALID bit
|
||||
* set.
|
||||
*/
|
||||
#define pte_access_permitted(pte, write) \
|
||||
(pte_valid_user(pte) && (!(write) || pte_write(pte)))
|
||||
|
@ -42,7 +42,6 @@
|
||||
#endif
|
||||
|
||||
#define __ARCH_WANT_SYS_CLONE
|
||||
#define __ARCH_WANT_SYS_CLONE3
|
||||
|
||||
#ifndef __COMPAT_SYSCALL_NR
|
||||
#include <uapi/asm/unistd.h>
|
||||
|
@ -19,5 +19,6 @@
|
||||
#define __ARCH_WANT_NEW_STAT
|
||||
#define __ARCH_WANT_SET_GET_RLIMIT
|
||||
#define __ARCH_WANT_TIME32_SYSCALLS
|
||||
#define __ARCH_WANT_SYS_CLONE3
|
||||
|
||||
#include <asm-generic/unistd.h>
|
||||
|
@ -361,8 +361,8 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
|
||||
|
||||
asmlinkage void ret_from_fork(void) asm("ret_from_fork");
|
||||
|
||||
int copy_thread(unsigned long clone_flags, unsigned long stack_start,
|
||||
unsigned long stk_sz, struct task_struct *p)
|
||||
int copy_thread_tls(unsigned long clone_flags, unsigned long stack_start,
|
||||
unsigned long stk_sz, struct task_struct *p, unsigned long tls)
|
||||
{
|
||||
struct pt_regs *childregs = task_pt_regs(p);
|
||||
|
||||
@ -395,11 +395,11 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start,
|
||||
}
|
||||
|
||||
/*
|
||||
* If a TLS pointer was passed to clone (4th argument), use it
|
||||
* for the new thread.
|
||||
* If a TLS pointer was passed to clone, use it for the new
|
||||
* thread.
|
||||
*/
|
||||
if (clone_flags & CLONE_SETTLS)
|
||||
p->thread.uw.tp_value = childregs->regs[3];
|
||||
p->thread.uw.tp_value = tls;
|
||||
} else {
|
||||
memset(childregs, 0, sizeof(struct pt_regs));
|
||||
childregs->pstate = PSR_MODE_EL1h;
|
||||
|
@ -445,7 +445,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
|
||||
const struct fault_info *inf;
|
||||
struct mm_struct *mm = current->mm;
|
||||
vm_fault_t fault, major = 0;
|
||||
unsigned long vm_flags = VM_READ | VM_WRITE;
|
||||
unsigned long vm_flags = VM_READ | VM_WRITE | VM_EXEC;
|
||||
unsigned int mm_flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
|
||||
|
||||
if (kprobe_page_fault(regs, esr))
|
||||
|
@ -62,6 +62,7 @@ config PARISC
|
||||
select HAVE_FTRACE_MCOUNT_RECORD if HAVE_DYNAMIC_FTRACE
|
||||
select HAVE_KPROBES_ON_FTRACE
|
||||
select HAVE_DYNAMIC_FTRACE_WITH_REGS
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
|
||||
help
|
||||
The PA-RISC microprocessor is designed by Hewlett-Packard and used
|
||||
|
@ -208,8 +208,8 @@ arch_initcall(parisc_idle_init);
|
||||
* Copy architecture-specific thread state
|
||||
*/
|
||||
int
|
||||
copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||
unsigned long kthread_arg, struct task_struct *p)
|
||||
copy_thread_tls(unsigned long clone_flags, unsigned long usp,
|
||||
unsigned long kthread_arg, struct task_struct *p, unsigned long tls)
|
||||
{
|
||||
struct pt_regs *cregs = &(p->thread.regs);
|
||||
void *stack = task_stack_page(p);
|
||||
@ -254,9 +254,9 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||
cregs->ksp = (unsigned long)stack + THREAD_SZ_ALGN + FRAME_SIZE;
|
||||
cregs->kpc = (unsigned long) &child_return;
|
||||
|
||||
/* Setup thread TLS area from the 4th parameter in clone */
|
||||
/* Setup thread TLS area */
|
||||
if (clone_flags & CLONE_SETTLS)
|
||||
cregs->cr27 = cregs->gr[23];
|
||||
cregs->cr27 = tls;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -65,6 +65,7 @@ config RISCV
|
||||
select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
|
||||
select HAVE_ARCH_MMAP_RND_BITS if MMU
|
||||
select ARCH_HAS_GCOV_PROFILE_ALL
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
|
||||
config ARCH_MMAP_RND_BITS_MIN
|
||||
default 18 if 64BIT
|
||||
|
@ -251,7 +251,7 @@ ENTRY(reset_regs)
|
||||
#ifdef CONFIG_FPU
|
||||
csrr t0, CSR_MISA
|
||||
andi t0, t0, (COMPAT_HWCAP_ISA_F | COMPAT_HWCAP_ISA_D)
|
||||
bnez t0, .Lreset_regs_done
|
||||
beqz t0, .Lreset_regs_done
|
||||
|
||||
li t1, SR_FS
|
||||
csrs CSR_STATUS, t1
|
||||
|
@ -99,8 +99,8 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||
unsigned long arg, struct task_struct *p)
|
||||
int copy_thread_tls(unsigned long clone_flags, unsigned long usp,
|
||||
unsigned long arg, struct task_struct *p, unsigned long tls)
|
||||
{
|
||||
struct pt_regs *childregs = task_pt_regs(p);
|
||||
|
||||
@ -121,7 +121,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||
if (usp) /* User fork */
|
||||
childregs->sp = usp;
|
||||
if (clone_flags & CLONE_SETTLS)
|
||||
childregs->tp = childregs->a5;
|
||||
childregs->tp = tls;
|
||||
childregs->a0 = 0; /* Return value of fork() */
|
||||
p->thread.ra = (unsigned long)ret_from_fork;
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ config UML
|
||||
select HAVE_FUTEX_CMPXCHG if FUTEX
|
||||
select HAVE_DEBUG_KMEMLEAK
|
||||
select HAVE_DEBUG_BUGVERBOSE
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select GENERIC_IRQ_SHOW
|
||||
select GENERIC_CPU_DEVICES
|
||||
select GENERIC_CLOCKEVENTS
|
||||
|
@ -36,7 +36,7 @@ extern long subarch_ptrace(struct task_struct *child, long request,
|
||||
extern unsigned long getreg(struct task_struct *child, int regno);
|
||||
extern int putreg(struct task_struct *child, int regno, unsigned long value);
|
||||
|
||||
extern int arch_copy_tls(struct task_struct *new);
|
||||
extern int arch_set_tls(struct task_struct *new, unsigned long tls);
|
||||
extern void clear_flushed_tls(struct task_struct *task);
|
||||
extern int syscall_trace_enter(struct pt_regs *regs);
|
||||
extern void syscall_trace_leave(struct pt_regs *regs);
|
||||
|
@ -153,8 +153,8 @@ void fork_handler(void)
|
||||
userspace(¤t->thread.regs.regs, current_thread_info()->aux_fp_regs);
|
||||
}
|
||||
|
||||
int copy_thread(unsigned long clone_flags, unsigned long sp,
|
||||
unsigned long arg, struct task_struct * p)
|
||||
int copy_thread_tls(unsigned long clone_flags, unsigned long sp,
|
||||
unsigned long arg, struct task_struct * p, unsigned long tls)
|
||||
{
|
||||
void (*handler)(void);
|
||||
int kthread = current->flags & PF_KTHREAD;
|
||||
@ -188,7 +188,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
|
||||
* Set a new TLS for the child thread?
|
||||
*/
|
||||
if (clone_flags & CLONE_SETTLS)
|
||||
ret = arch_copy_tls(p);
|
||||
ret = arch_set_tls(p, tls);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -215,14 +215,12 @@ static int set_tls_entry(struct task_struct* task, struct user_desc *info,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int arch_copy_tls(struct task_struct *new)
|
||||
int arch_set_tls(struct task_struct *new, unsigned long tls)
|
||||
{
|
||||
struct user_desc info;
|
||||
int idx, ret = -EFAULT;
|
||||
|
||||
if (copy_from_user(&info,
|
||||
(void __user *) UPT_SI(&new->thread.regs.regs),
|
||||
sizeof(info)))
|
||||
if (copy_from_user(&info, (void __user *) tls, sizeof(info)))
|
||||
goto out;
|
||||
|
||||
ret = -EINVAL;
|
||||
|
@ -6,14 +6,13 @@ void clear_flushed_tls(struct task_struct *task)
|
||||
{
|
||||
}
|
||||
|
||||
int arch_copy_tls(struct task_struct *t)
|
||||
int arch_set_tls(struct task_struct *t, unsigned long tls)
|
||||
{
|
||||
/*
|
||||
* If CLONE_SETTLS is set, we need to save the thread id
|
||||
* (which is argument 5, child_tid, of clone) so it can be set
|
||||
* during context switches.
|
||||
* so it can be set during context switches.
|
||||
*/
|
||||
t->thread.arch.fs = t->thread.regs.regs.gp[R8 / sizeof(long)];
|
||||
t->thread.arch.fs = tls;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ config XTENSA
|
||||
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
|
||||
select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL
|
||||
select HAVE_ARCH_TRACEHOOK
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select HAVE_DEBUG_KMEMLEAK
|
||||
select HAVE_DMA_CONTIGUOUS
|
||||
select HAVE_EXIT_THREAD
|
||||
|
@ -202,8 +202,9 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
|
||||
* involved. Much simpler to just not copy those live frames across.
|
||||
*/
|
||||
|
||||
int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn,
|
||||
unsigned long thread_fn_arg, struct task_struct *p)
|
||||
int copy_thread_tls(unsigned long clone_flags, unsigned long usp_thread_fn,
|
||||
unsigned long thread_fn_arg, struct task_struct *p,
|
||||
unsigned long tls)
|
||||
{
|
||||
struct pt_regs *childregs = task_pt_regs(p);
|
||||
|
||||
@ -266,9 +267,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn,
|
||||
|
||||
childregs->syscall = regs->syscall;
|
||||
|
||||
/* The thread pointer is passed in the '4th argument' (= a5) */
|
||||
if (clone_flags & CLONE_SETTLS)
|
||||
childregs->threadptr = childregs->areg[5];
|
||||
childregs->threadptr = tls;
|
||||
} else {
|
||||
p->thread.ra = MAKE_RA_FOR_CALL(
|
||||
(unsigned long)ret_from_kernel_thread, 1);
|
||||
|
12
block/bio.c
12
block/bio.c
@ -540,6 +540,16 @@ void zero_fill_bio_iter(struct bio *bio, struct bvec_iter start)
|
||||
}
|
||||
EXPORT_SYMBOL(zero_fill_bio_iter);
|
||||
|
||||
/**
|
||||
* bio_truncate - truncate the bio to small size of @new_size
|
||||
* @bio: the bio to be truncated
|
||||
* @new_size: new size for truncating the bio
|
||||
*
|
||||
* Description:
|
||||
* Truncate the bio to new size of @new_size. If bio_op(bio) is
|
||||
* REQ_OP_READ, zero the truncated part. This function should only
|
||||
* be used for handling corner cases, such as bio eod.
|
||||
*/
|
||||
void bio_truncate(struct bio *bio, unsigned new_size)
|
||||
{
|
||||
struct bio_vec bv;
|
||||
@ -550,7 +560,7 @@ void bio_truncate(struct bio *bio, unsigned new_size)
|
||||
if (new_size >= bio->bi_iter.bi_size)
|
||||
return;
|
||||
|
||||
if (bio_data_dir(bio) != READ)
|
||||
if (bio_op(bio) != REQ_OP_READ)
|
||||
goto exit;
|
||||
|
||||
bio_for_each_segment(bv, bio, iter) {
|
||||
|
@ -374,7 +374,7 @@ static int do_rx_dma(struct atm_vcc *vcc,struct sk_buff *skb,
|
||||
here = (eni_vcc->descr+skip) & (eni_vcc->words-1);
|
||||
dma[j++] = (here << MID_DMA_COUNT_SHIFT) | (vcc->vci
|
||||
<< MID_DMA_VCI_SHIFT) | MID_DT_JK;
|
||||
j++;
|
||||
dma[j++] = 0;
|
||||
}
|
||||
here = (eni_vcc->descr+size+skip) & (eni_vcc->words-1);
|
||||
if (!eff) size += skip;
|
||||
@ -447,7 +447,7 @@ static int do_rx_dma(struct atm_vcc *vcc,struct sk_buff *skb,
|
||||
if (size != eff) {
|
||||
dma[j++] = (here << MID_DMA_COUNT_SHIFT) |
|
||||
(vcc->vci << MID_DMA_VCI_SHIFT) | MID_DT_JK;
|
||||
j++;
|
||||
dma[j++] = 0;
|
||||
}
|
||||
if (!j || j > 2*RX_DMA_BUF) {
|
||||
printk(KERN_CRIT DEV_LABEL "!j or j too big!!!\n");
|
||||
|
@ -130,7 +130,7 @@ ssize_t tpm_common_read(struct file *file, char __user *buf,
|
||||
priv->response_read = true;
|
||||
|
||||
ret_size = min_t(ssize_t, size, priv->response_length);
|
||||
if (!ret_size) {
|
||||
if (ret_size <= 0) {
|
||||
priv->response_length = 0;
|
||||
goto out;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ struct file_priv {
|
||||
struct work_struct timeout_work;
|
||||
struct work_struct async_work;
|
||||
wait_queue_head_t async_wait;
|
||||
size_t response_length;
|
||||
ssize_t response_length;
|
||||
bool response_read;
|
||||
bool command_enqueued;
|
||||
|
||||
|
@ -978,13 +978,13 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
|
||||
|
||||
if (wait_startup(chip, 0) != 0) {
|
||||
rc = -ENODEV;
|
||||
goto err_start;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
/* Take control of the TPM's interrupt hardware and shut it off */
|
||||
rc = tpm_tis_read32(priv, TPM_INT_ENABLE(priv->locality), &intmask);
|
||||
if (rc < 0)
|
||||
goto err_start;
|
||||
goto out_err;
|
||||
|
||||
intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT |
|
||||
TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT;
|
||||
@ -993,21 +993,21 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
|
||||
|
||||
rc = tpm_chip_start(chip);
|
||||
if (rc)
|
||||
goto err_start;
|
||||
|
||||
goto out_err;
|
||||
rc = tpm2_probe(chip);
|
||||
tpm_chip_stop(chip);
|
||||
if (rc)
|
||||
goto err_probe;
|
||||
goto out_err;
|
||||
|
||||
rc = tpm_tis_read32(priv, TPM_DID_VID(0), &vendor);
|
||||
if (rc < 0)
|
||||
goto err_probe;
|
||||
goto out_err;
|
||||
|
||||
priv->manufacturer_id = vendor;
|
||||
|
||||
rc = tpm_tis_read8(priv, TPM_RID(0), &rid);
|
||||
if (rc < 0)
|
||||
goto err_probe;
|
||||
goto out_err;
|
||||
|
||||
dev_info(dev, "%s TPM (device-id 0x%X, rev-id %d)\n",
|
||||
(chip->flags & TPM_CHIP_FLAG_TPM2) ? "2.0" : "1.2",
|
||||
@ -1016,13 +1016,13 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
|
||||
probe = probe_itpm(chip);
|
||||
if (probe < 0) {
|
||||
rc = -ENODEV;
|
||||
goto err_probe;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
/* Figure out the capabilities */
|
||||
rc = tpm_tis_read32(priv, TPM_INTF_CAPS(priv->locality), &intfcaps);
|
||||
if (rc < 0)
|
||||
goto err_probe;
|
||||
goto out_err;
|
||||
|
||||
dev_dbg(dev, "TPM interface capabilities (0x%x):\n",
|
||||
intfcaps);
|
||||
@ -1056,10 +1056,9 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
|
||||
if (tpm_get_timeouts(chip)) {
|
||||
dev_err(dev, "Could not get TPM timeouts and durations\n");
|
||||
rc = -ENODEV;
|
||||
goto err_probe;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
chip->flags |= TPM_CHIP_FLAG_IRQ;
|
||||
if (irq) {
|
||||
tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
|
||||
irq);
|
||||
@ -1071,18 +1070,15 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
|
||||
}
|
||||
}
|
||||
|
||||
tpm_chip_stop(chip);
|
||||
|
||||
rc = tpm_chip_register(chip);
|
||||
if (rc)
|
||||
goto err_start;
|
||||
goto out_err;
|
||||
|
||||
if (chip->ops->clk_enable != NULL)
|
||||
chip->ops->clk_enable(chip, false);
|
||||
|
||||
return 0;
|
||||
|
||||
err_probe:
|
||||
tpm_chip_stop(chip);
|
||||
|
||||
err_start:
|
||||
out_err:
|
||||
if ((chip->ops != NULL) && (chip->ops->clk_enable != NULL))
|
||||
chip->ops->clk_enable(chip, false);
|
||||
|
||||
|
@ -121,6 +121,8 @@ static const struct of_device_id blacklist[] __initconst = {
|
||||
{ .compatible = "mediatek,mt8176", },
|
||||
{ .compatible = "mediatek,mt8183", },
|
||||
|
||||
{ .compatible = "nvidia,tegra20", },
|
||||
{ .compatible = "nvidia,tegra30", },
|
||||
{ .compatible = "nvidia,tegra124", },
|
||||
{ .compatible = "nvidia,tegra210", },
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <linux/edac.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include "edac_module.h"
|
||||
#include <asm/sifive_l2_cache.h>
|
||||
#include <soc/sifive/sifive_l2_cache.h>
|
||||
|
||||
#define DRVNAME "sifive_edac"
|
||||
|
||||
|
@ -215,7 +215,6 @@ static int tee_bnxt_fw_probe(struct device *dev)
|
||||
fw_shm_pool = tee_shm_alloc(pvt_data.ctx, MAX_SHM_MEM_SZ,
|
||||
TEE_SHM_MAPPED | TEE_SHM_DMA_BUF);
|
||||
if (IS_ERR(fw_shm_pool)) {
|
||||
tee_client_close_context(pvt_data.ctx);
|
||||
dev_err(pvt_data.dev, "tee_shm_alloc failed\n");
|
||||
err = PTR_ERR(fw_shm_pool);
|
||||
goto out_sess;
|
||||
|
@ -1148,6 +1148,7 @@ config GPIO_MADERA
|
||||
config GPIO_MAX77620
|
||||
tristate "GPIO support for PMIC MAX77620 and MAX20024"
|
||||
depends on MFD_MAX77620
|
||||
select GPIOLIB_IRQCHIP
|
||||
help
|
||||
GPIO driver for MAX77620 and MAX20024 PMIC from Maxim Semiconductor.
|
||||
MAX77620 PMIC has 8 pins that can be configured as GPIOs. The
|
||||
|
@ -156,7 +156,7 @@ static int gpio_mockup_apply_pull(struct gpio_mockup_chip *chip,
|
||||
mutex_lock(&chip->lock);
|
||||
|
||||
if (test_bit(FLAG_REQUESTED, &desc->flags) &&
|
||||
!test_bit(FLAG_IS_OUT, &desc->flags)) {
|
||||
!test_bit(FLAG_IS_OUT, &desc->flags)) {
|
||||
curr = __gpio_mockup_get(chip, offset);
|
||||
if (curr == value)
|
||||
goto out;
|
||||
@ -165,7 +165,7 @@ static int gpio_mockup_apply_pull(struct gpio_mockup_chip *chip,
|
||||
irq_type = irq_get_trigger_type(irq);
|
||||
|
||||
if ((value == 1 && (irq_type & IRQ_TYPE_EDGE_RISING)) ||
|
||||
(value == 0 && (irq_type & IRQ_TYPE_EDGE_FALLING)))
|
||||
(value == 0 && (irq_type & IRQ_TYPE_EDGE_FALLING)))
|
||||
irq_sim_fire(sim, offset);
|
||||
}
|
||||
|
||||
|
@ -684,6 +684,8 @@ static void zynq_gpio_restore_context(struct zynq_gpio *gpio)
|
||||
unsigned int bank_num;
|
||||
|
||||
for (bank_num = 0; bank_num < gpio->p_data->max_bank; bank_num++) {
|
||||
writel_relaxed(ZYNQ_GPIO_IXR_DISABLE_ALL, gpio->base_addr +
|
||||
ZYNQ_GPIO_INTDIS_OFFSET(bank_num));
|
||||
writel_relaxed(gpio->context.datalsw[bank_num],
|
||||
gpio->base_addr +
|
||||
ZYNQ_GPIO_DATA_LSW_OFFSET(bank_num));
|
||||
@ -693,9 +695,6 @@ static void zynq_gpio_restore_context(struct zynq_gpio *gpio)
|
||||
writel_relaxed(gpio->context.dirm[bank_num],
|
||||
gpio->base_addr +
|
||||
ZYNQ_GPIO_DIRM_OFFSET(bank_num));
|
||||
writel_relaxed(gpio->context.int_en[bank_num],
|
||||
gpio->base_addr +
|
||||
ZYNQ_GPIO_INTEN_OFFSET(bank_num));
|
||||
writel_relaxed(gpio->context.int_type[bank_num],
|
||||
gpio->base_addr +
|
||||
ZYNQ_GPIO_INTTYPE_OFFSET(bank_num));
|
||||
@ -705,6 +704,9 @@ static void zynq_gpio_restore_context(struct zynq_gpio *gpio)
|
||||
writel_relaxed(gpio->context.int_any[bank_num],
|
||||
gpio->base_addr +
|
||||
ZYNQ_GPIO_INTANY_OFFSET(bank_num));
|
||||
writel_relaxed(~(gpio->context.int_en[bank_num]),
|
||||
gpio->base_addr +
|
||||
ZYNQ_GPIO_INTEN_OFFSET(bank_num));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,11 +21,19 @@
|
||||
#include "gpiolib.h"
|
||||
#include "gpiolib-acpi.h"
|
||||
|
||||
#define QUIRK_NO_EDGE_EVENTS_ON_BOOT 0x01l
|
||||
#define QUIRK_NO_WAKEUP 0x02l
|
||||
|
||||
static int run_edge_events_on_boot = -1;
|
||||
module_param(run_edge_events_on_boot, int, 0444);
|
||||
MODULE_PARM_DESC(run_edge_events_on_boot,
|
||||
"Run edge _AEI event-handlers at boot: 0=no, 1=yes, -1=auto");
|
||||
|
||||
static int honor_wakeup = -1;
|
||||
module_param(honor_wakeup, int, 0444);
|
||||
MODULE_PARM_DESC(honor_wakeup,
|
||||
"Honor the ACPI wake-capable flag: 0=no, 1=yes, -1=auto");
|
||||
|
||||
/**
|
||||
* struct acpi_gpio_event - ACPI GPIO event handler data
|
||||
*
|
||||
@ -281,7 +289,7 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares,
|
||||
event->handle = evt_handle;
|
||||
event->handler = handler;
|
||||
event->irq = irq;
|
||||
event->irq_is_wake = agpio->wake_capable == ACPI_WAKE_CAPABLE;
|
||||
event->irq_is_wake = honor_wakeup && agpio->wake_capable == ACPI_WAKE_CAPABLE;
|
||||
event->pin = pin;
|
||||
event->desc = desc;
|
||||
|
||||
@ -1309,7 +1317,7 @@ static int acpi_gpio_handle_deferred_request_irqs(void)
|
||||
/* We must use _sync so that this runs after the first deferred_probe run */
|
||||
late_initcall_sync(acpi_gpio_handle_deferred_request_irqs);
|
||||
|
||||
static const struct dmi_system_id run_edge_events_on_boot_blacklist[] = {
|
||||
static const struct dmi_system_id gpiolib_acpi_quirks[] = {
|
||||
{
|
||||
/*
|
||||
* The Minix Neo Z83-4 has a micro-USB-B id-pin handler for
|
||||
@ -1319,7 +1327,8 @@ static const struct dmi_system_id run_edge_events_on_boot_blacklist[] = {
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "MINIX"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"),
|
||||
}
|
||||
},
|
||||
.driver_data = (void *)QUIRK_NO_EDGE_EVENTS_ON_BOOT,
|
||||
},
|
||||
{
|
||||
/*
|
||||
@ -1331,20 +1340,52 @@ static const struct dmi_system_id run_edge_events_on_boot_blacklist[] = {
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Wortmann_AG"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "TERRA_PAD_1061"),
|
||||
}
|
||||
},
|
||||
.driver_data = (void *)QUIRK_NO_EDGE_EVENTS_ON_BOOT,
|
||||
},
|
||||
{
|
||||
/*
|
||||
* Various HP X2 10 Cherry Trail models use an external
|
||||
* embedded-controller connected via I2C + an ACPI GPIO
|
||||
* event handler. The embedded controller generates various
|
||||
* spurious wakeup events when suspended. So disable wakeup
|
||||
* for its handler (it uses the only ACPI GPIO event handler).
|
||||
* This breaks wakeup when opening the lid, the user needs
|
||||
* to press the power-button to wakeup the system. The
|
||||
* alternative is suspend simply not working, which is worse.
|
||||
*/
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "HP x2 Detachable 10-p0XX"),
|
||||
},
|
||||
.driver_data = (void *)QUIRK_NO_WAKEUP,
|
||||
},
|
||||
{} /* Terminating entry */
|
||||
};
|
||||
|
||||
static int acpi_gpio_setup_params(void)
|
||||
{
|
||||
const struct dmi_system_id *id;
|
||||
long quirks = 0;
|
||||
|
||||
id = dmi_first_match(gpiolib_acpi_quirks);
|
||||
if (id)
|
||||
quirks = (long)id->driver_data;
|
||||
|
||||
if (run_edge_events_on_boot < 0) {
|
||||
if (dmi_check_system(run_edge_events_on_boot_blacklist))
|
||||
if (quirks & QUIRK_NO_EDGE_EVENTS_ON_BOOT)
|
||||
run_edge_events_on_boot = 0;
|
||||
else
|
||||
run_edge_events_on_boot = 1;
|
||||
}
|
||||
|
||||
if (honor_wakeup < 0) {
|
||||
if (quirks & QUIRK_NO_WAKEUP)
|
||||
honor_wakeup = 0;
|
||||
else
|
||||
honor_wakeup = 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ int amdgpu_async_gfx_ring = 1;
|
||||
int amdgpu_mcbp = 0;
|
||||
int amdgpu_discovery = -1;
|
||||
int amdgpu_mes = 0;
|
||||
int amdgpu_noretry = 1;
|
||||
int amdgpu_noretry;
|
||||
int amdgpu_force_asic_type = -1;
|
||||
|
||||
struct amdgpu_mgpu_info mgpu_info = {
|
||||
@ -588,7 +588,7 @@ MODULE_PARM_DESC(mes,
|
||||
module_param_named(mes, amdgpu_mes, int, 0444);
|
||||
|
||||
MODULE_PARM_DESC(noretry,
|
||||
"Disable retry faults (0 = retry enabled, 1 = retry disabled (default))");
|
||||
"Disable retry faults (0 = retry enabled (default), 1 = retry disabled)");
|
||||
module_param_named(noretry, amdgpu_noretry, int, 0644);
|
||||
|
||||
/**
|
||||
@ -1359,7 +1359,8 @@ static struct drm_driver kms_driver = {
|
||||
.driver_features =
|
||||
DRIVER_USE_AGP | DRIVER_ATOMIC |
|
||||
DRIVER_GEM |
|
||||
DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ,
|
||||
DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ |
|
||||
DRIVER_SYNCOBJ_TIMELINE,
|
||||
.load = amdgpu_driver_load_kms,
|
||||
.open = amdgpu_driver_open_kms,
|
||||
.postclose = amdgpu_driver_postclose_kms,
|
||||
|
@ -3356,27 +3356,21 @@ get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing)
|
||||
return color_space;
|
||||
}
|
||||
|
||||
static void reduce_mode_colour_depth(struct dc_crtc_timing *timing_out)
|
||||
{
|
||||
if (timing_out->display_color_depth <= COLOR_DEPTH_888)
|
||||
return;
|
||||
|
||||
timing_out->display_color_depth--;
|
||||
}
|
||||
|
||||
static void adjust_colour_depth_from_display_info(struct dc_crtc_timing *timing_out,
|
||||
const struct drm_display_info *info)
|
||||
static bool adjust_colour_depth_from_display_info(
|
||||
struct dc_crtc_timing *timing_out,
|
||||
const struct drm_display_info *info)
|
||||
{
|
||||
enum dc_color_depth depth = timing_out->display_color_depth;
|
||||
int normalized_clk;
|
||||
if (timing_out->display_color_depth <= COLOR_DEPTH_888)
|
||||
return;
|
||||
do {
|
||||
normalized_clk = timing_out->pix_clk_100hz / 10;
|
||||
/* YCbCr 4:2:0 requires additional adjustment of 1/2 */
|
||||
if (timing_out->pixel_encoding == PIXEL_ENCODING_YCBCR420)
|
||||
normalized_clk /= 2;
|
||||
/* Adjusting pix clock following on HDMI spec based on colour depth */
|
||||
switch (timing_out->display_color_depth) {
|
||||
switch (depth) {
|
||||
case COLOR_DEPTH_888:
|
||||
break;
|
||||
case COLOR_DEPTH_101010:
|
||||
normalized_clk = (normalized_clk * 30) / 24;
|
||||
break;
|
||||
@ -3387,14 +3381,15 @@ static void adjust_colour_depth_from_display_info(struct dc_crtc_timing *timing_
|
||||
normalized_clk = (normalized_clk * 48) / 24;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
/* The above depths are the only ones valid for HDMI. */
|
||||
return false;
|
||||
}
|
||||
if (normalized_clk <= info->max_tmds_clock)
|
||||
return;
|
||||
reduce_mode_colour_depth(timing_out);
|
||||
|
||||
} while (timing_out->display_color_depth > COLOR_DEPTH_888);
|
||||
|
||||
if (normalized_clk <= info->max_tmds_clock) {
|
||||
timing_out->display_color_depth = depth;
|
||||
return true;
|
||||
}
|
||||
} while (--depth > COLOR_DEPTH_666);
|
||||
return false;
|
||||
}
|
||||
|
||||
static void fill_stream_properties_from_drm_display_mode(
|
||||
@ -3474,8 +3469,14 @@ static void fill_stream_properties_from_drm_display_mode(
|
||||
|
||||
stream->out_transfer_func->type = TF_TYPE_PREDEFINED;
|
||||
stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB;
|
||||
if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A)
|
||||
adjust_colour_depth_from_display_info(timing_out, info);
|
||||
if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) {
|
||||
if (!adjust_colour_depth_from_display_info(timing_out, info) &&
|
||||
drm_mode_is_420_also(info, mode_in) &&
|
||||
timing_out->pixel_encoding != PIXEL_ENCODING_YCBCR420) {
|
||||
timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR420;
|
||||
adjust_colour_depth_from_display_info(timing_out, info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void fill_audio_info(struct audio_info *audio_info,
|
||||
|
@ -393,7 +393,7 @@ drm_dp_encode_sideband_req(const struct drm_dp_sideband_msg_req_body *req,
|
||||
memcpy(&buf[idx], req->u.i2c_read.transactions[i].bytes, req->u.i2c_read.transactions[i].num_bytes);
|
||||
idx += req->u.i2c_read.transactions[i].num_bytes;
|
||||
|
||||
buf[idx] = (req->u.i2c_read.transactions[i].no_stop_bit & 0x1) << 5;
|
||||
buf[idx] = (req->u.i2c_read.transactions[i].no_stop_bit & 0x1) << 4;
|
||||
buf[idx] |= (req->u.i2c_read.transactions[i].i2c_transaction_delay & 0xf);
|
||||
idx++;
|
||||
}
|
||||
|
@ -1283,7 +1283,7 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
|
||||
* Changes struct fb_var_screeninfo are currently not pushed back
|
||||
* to KMS, hence fail if different settings are requested.
|
||||
*/
|
||||
if (var->bits_per_pixel != fb->format->cpp[0] * 8 ||
|
||||
if (var->bits_per_pixel > fb->format->cpp[0] * 8 ||
|
||||
var->xres > fb->width || var->yres > fb->height ||
|
||||
var->xres_virtual > fb->width || var->yres_virtual > fb->height) {
|
||||
DRM_DEBUG("fb requested width/height/bpp can't fit in current fb "
|
||||
@ -1308,6 +1308,11 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
|
||||
drm_fb_helper_fill_pixel_fmt(var, fb->format->depth);
|
||||
}
|
||||
|
||||
/*
|
||||
* Likewise, bits_per_pixel should be rounded up to a supported value.
|
||||
*/
|
||||
var->bits_per_pixel = fb->format->cpp[0] * 8;
|
||||
|
||||
/*
|
||||
* drm fbdev emulation doesn't support changing the pixel format at all,
|
||||
* so reject all pixel format changing requests.
|
||||
|
@ -856,7 +856,7 @@ static unsigned long i915_audio_component_get_power(struct device *kdev)
|
||||
}
|
||||
|
||||
/* Force CDCLK to 2*BCLK as long as we need audio powered. */
|
||||
if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
|
||||
if (IS_GEMINILAKE(dev_priv))
|
||||
glk_force_audio_cdclk(dev_priv, true);
|
||||
|
||||
if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
|
||||
@ -875,7 +875,7 @@ static void i915_audio_component_put_power(struct device *kdev,
|
||||
|
||||
/* Stop forcing CDCLK to 2*BCLK if no need for audio to be powered. */
|
||||
if (--dev_priv->audio_power_refcount == 0)
|
||||
if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
|
||||
if (IS_GEMINILAKE(dev_priv))
|
||||
glk_force_audio_cdclk(dev_priv, false);
|
||||
|
||||
intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO, cookie);
|
||||
|
@ -4515,8 +4515,6 @@ static void icl_disable_transcoder_port_sync(const struct intel_crtc_state *old_
|
||||
{
|
||||
struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->base.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
i915_reg_t reg;
|
||||
u32 trans_ddi_func_ctl2_val;
|
||||
|
||||
if (old_crtc_state->master_transcoder == INVALID_TRANSCODER)
|
||||
return;
|
||||
@ -4524,10 +4522,7 @@ static void icl_disable_transcoder_port_sync(const struct intel_crtc_state *old_
|
||||
DRM_DEBUG_KMS("Disabling Transcoder Port Sync on Slave Transcoder %s\n",
|
||||
transcoder_name(old_crtc_state->cpu_transcoder));
|
||||
|
||||
reg = TRANS_DDI_FUNC_CTL2(old_crtc_state->cpu_transcoder);
|
||||
trans_ddi_func_ctl2_val = ~(PORT_SYNC_MODE_ENABLE |
|
||||
PORT_SYNC_MODE_MASTER_SELECT_MASK);
|
||||
I915_WRITE(reg, trans_ddi_func_ctl2_val);
|
||||
I915_WRITE(TRANS_DDI_FUNC_CTL2(old_crtc_state->cpu_transcoder), 0);
|
||||
}
|
||||
|
||||
static void intel_fdi_normal_train(struct intel_crtc *crtc)
|
||||
|
@ -4416,9 +4416,11 @@ intel_execlists_create_virtual(struct i915_gem_context *ctx,
|
||||
ve->base.gt = siblings[0]->gt;
|
||||
ve->base.uncore = siblings[0]->uncore;
|
||||
ve->base.id = -1;
|
||||
|
||||
ve->base.class = OTHER_CLASS;
|
||||
ve->base.uabi_class = I915_ENGINE_CLASS_INVALID;
|
||||
ve->base.instance = I915_ENGINE_CLASS_INVALID_VIRTUAL;
|
||||
ve->base.uabi_instance = I915_ENGINE_CLASS_INVALID_VIRTUAL;
|
||||
|
||||
/*
|
||||
* The decision on whether to submit a request using semaphores
|
||||
|
@ -1413,14 +1413,6 @@ static inline int mi_set_context(struct i915_request *rq, u32 flags)
|
||||
int len;
|
||||
u32 *cs;
|
||||
|
||||
flags |= MI_MM_SPACE_GTT;
|
||||
if (IS_HASWELL(i915))
|
||||
/* These flags are for resource streamer on HSW+ */
|
||||
flags |= HSW_MI_RS_SAVE_STATE_EN | HSW_MI_RS_RESTORE_STATE_EN;
|
||||
else
|
||||
/* We need to save the extended state for powersaving modes */
|
||||
flags |= MI_SAVE_EXT_STATE_EN | MI_RESTORE_EXT_STATE_EN;
|
||||
|
||||
len = 4;
|
||||
if (IS_GEN(i915, 7))
|
||||
len += 2 + (num_engines ? 4 * num_engines + 6 : 0);
|
||||
@ -1589,22 +1581,21 @@ static int switch_context(struct i915_request *rq)
|
||||
}
|
||||
|
||||
if (ce->state) {
|
||||
u32 hw_flags;
|
||||
u32 flags;
|
||||
|
||||
GEM_BUG_ON(rq->engine->id != RCS0);
|
||||
|
||||
/*
|
||||
* The kernel context(s) is treated as pure scratch and is not
|
||||
* expected to retain any state (as we sacrifice it during
|
||||
* suspend and on resume it may be corrupted). This is ok,
|
||||
* as nothing actually executes using the kernel context; it
|
||||
* is purely used for flushing user contexts.
|
||||
*/
|
||||
hw_flags = 0;
|
||||
if (i915_gem_context_is_kernel(rq->gem_context))
|
||||
hw_flags = MI_RESTORE_INHIBIT;
|
||||
/* For resource streamer on HSW+ and power context elsewhere */
|
||||
BUILD_BUG_ON(HSW_MI_RS_SAVE_STATE_EN != MI_SAVE_EXT_STATE_EN);
|
||||
BUILD_BUG_ON(HSW_MI_RS_RESTORE_STATE_EN != MI_RESTORE_EXT_STATE_EN);
|
||||
|
||||
ret = mi_set_context(rq, hw_flags);
|
||||
flags = MI_SAVE_EXT_STATE_EN | MI_MM_SPACE_GTT;
|
||||
if (!i915_gem_context_is_kernel(rq->gem_context))
|
||||
flags |= MI_RESTORE_EXT_STATE_EN;
|
||||
else
|
||||
flags |= MI_RESTORE_INHIBIT;
|
||||
|
||||
ret = mi_set_context(rq, flags);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
@ -1660,8 +1660,10 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
|
||||
(IS_BROADWELL(dev_priv) || IS_GEN(dev_priv, 9))
|
||||
|
||||
/* WaRsDisableCoarsePowerGating:skl,cnl */
|
||||
#define NEEDS_WaRsDisableCoarsePowerGating(dev_priv) \
|
||||
(IS_CANNONLAKE(dev_priv) || IS_GEN(dev_priv, 9))
|
||||
#define NEEDS_WaRsDisableCoarsePowerGating(dev_priv) \
|
||||
(IS_CANNONLAKE(dev_priv) || \
|
||||
IS_SKL_GT3(dev_priv) || \
|
||||
IS_SKL_GT4(dev_priv))
|
||||
|
||||
#define HAS_GMBUS_IRQ(dev_priv) (INTEL_GEN(dev_priv) >= 4)
|
||||
#define HAS_GMBUS_BURST_READ(dev_priv) (INTEL_GEN(dev_priv) >= 10 || \
|
||||
|
@ -4177,7 +4177,13 @@ enum {
|
||||
#define CPSSUNIT_CLKGATE_DIS REG_BIT(9)
|
||||
|
||||
#define UNSLICE_UNIT_LEVEL_CLKGATE _MMIO(0x9434)
|
||||
#define VFUNIT_CLKGATE_DIS (1 << 20)
|
||||
#define VFUNIT_CLKGATE_DIS REG_BIT(20)
|
||||
#define HSUNIT_CLKGATE_DIS REG_BIT(8)
|
||||
#define VSUNIT_CLKGATE_DIS REG_BIT(3)
|
||||
|
||||
#define UNSLICE_UNIT_LEVEL_CLKGATE2 _MMIO(0x94e4)
|
||||
#define VSUNIT_CLKGATE_DIS_TGL REG_BIT(19)
|
||||
#define PSDUNIT_CLKGATE_DIS REG_BIT(5)
|
||||
|
||||
#define INF_UNIT_LEVEL_CLKGATE _MMIO(0x9560)
|
||||
#define CGPSF_CLKGATE_DIS (1 << 3)
|
||||
|
@ -6565,6 +6565,17 @@ static void icl_init_clock_gating(struct drm_i915_private *dev_priv)
|
||||
/* WaEnable32PlaneMode:icl */
|
||||
I915_WRITE(GEN9_CSFE_CHICKEN1_RCS,
|
||||
_MASKED_BIT_ENABLE(GEN11_ENABLE_32_PLANE_MODE));
|
||||
|
||||
/*
|
||||
* Wa_1408615072:icl,ehl (vsunit)
|
||||
* Wa_1407596294:icl,ehl (hsunit)
|
||||
*/
|
||||
intel_uncore_rmw(&dev_priv->uncore, UNSLICE_UNIT_LEVEL_CLKGATE,
|
||||
0, VSUNIT_CLKGATE_DIS | HSUNIT_CLKGATE_DIS);
|
||||
|
||||
/* Wa_1407352427:icl,ehl */
|
||||
intel_uncore_rmw(&dev_priv->uncore, UNSLICE_UNIT_LEVEL_CLKGATE2,
|
||||
0, PSDUNIT_CLKGATE_DIS);
|
||||
}
|
||||
|
||||
static void tgl_init_clock_gating(struct drm_i915_private *dev_priv)
|
||||
|
@ -489,7 +489,7 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
|
||||
|
||||
WARN_ON(!tcon->quirks->has_channel_0);
|
||||
|
||||
tcon->dclk_min_div = 1;
|
||||
tcon->dclk_min_div = tcon->quirks->dclk_min_div;
|
||||
tcon->dclk_max_div = 127;
|
||||
sun4i_tcon0_mode_set_common(tcon, mode);
|
||||
|
||||
@ -1426,12 +1426,14 @@ static int sun8i_r40_tcon_tv_set_mux(struct sun4i_tcon *tcon,
|
||||
static const struct sun4i_tcon_quirks sun4i_a10_quirks = {
|
||||
.has_channel_0 = true,
|
||||
.has_channel_1 = true,
|
||||
.dclk_min_div = 4,
|
||||
.set_mux = sun4i_a10_tcon_set_mux,
|
||||
};
|
||||
|
||||
static const struct sun4i_tcon_quirks sun5i_a13_quirks = {
|
||||
.has_channel_0 = true,
|
||||
.has_channel_1 = true,
|
||||
.dclk_min_div = 4,
|
||||
.set_mux = sun5i_a13_tcon_set_mux,
|
||||
};
|
||||
|
||||
@ -1440,6 +1442,7 @@ static const struct sun4i_tcon_quirks sun6i_a31_quirks = {
|
||||
.has_channel_1 = true,
|
||||
.has_lvds_alt = true,
|
||||
.needs_de_be_mux = true,
|
||||
.dclk_min_div = 1,
|
||||
.set_mux = sun6i_tcon_set_mux,
|
||||
};
|
||||
|
||||
@ -1447,11 +1450,13 @@ static const struct sun4i_tcon_quirks sun6i_a31s_quirks = {
|
||||
.has_channel_0 = true,
|
||||
.has_channel_1 = true,
|
||||
.needs_de_be_mux = true,
|
||||
.dclk_min_div = 1,
|
||||
};
|
||||
|
||||
static const struct sun4i_tcon_quirks sun7i_a20_quirks = {
|
||||
.has_channel_0 = true,
|
||||
.has_channel_1 = true,
|
||||
.dclk_min_div = 4,
|
||||
/* Same display pipeline structure as A10 */
|
||||
.set_mux = sun4i_a10_tcon_set_mux,
|
||||
};
|
||||
@ -1459,11 +1464,13 @@ static const struct sun4i_tcon_quirks sun7i_a20_quirks = {
|
||||
static const struct sun4i_tcon_quirks sun8i_a33_quirks = {
|
||||
.has_channel_0 = true,
|
||||
.has_lvds_alt = true,
|
||||
.dclk_min_div = 1,
|
||||
};
|
||||
|
||||
static const struct sun4i_tcon_quirks sun8i_a83t_lcd_quirks = {
|
||||
.supports_lvds = true,
|
||||
.has_channel_0 = true,
|
||||
.dclk_min_div = 1,
|
||||
};
|
||||
|
||||
static const struct sun4i_tcon_quirks sun8i_a83t_tv_quirks = {
|
||||
@ -1477,11 +1484,13 @@ static const struct sun4i_tcon_quirks sun8i_r40_tv_quirks = {
|
||||
|
||||
static const struct sun4i_tcon_quirks sun8i_v3s_quirks = {
|
||||
.has_channel_0 = true,
|
||||
.dclk_min_div = 1,
|
||||
};
|
||||
|
||||
static const struct sun4i_tcon_quirks sun9i_a80_tcon_lcd_quirks = {
|
||||
.has_channel_0 = true,
|
||||
.needs_edp_reset = true,
|
||||
.has_channel_0 = true,
|
||||
.needs_edp_reset = true,
|
||||
.dclk_min_div = 1,
|
||||
};
|
||||
|
||||
static const struct sun4i_tcon_quirks sun9i_a80_tcon_tv_quirks = {
|
||||
|
@ -224,6 +224,7 @@ struct sun4i_tcon_quirks {
|
||||
bool needs_de_be_mux; /* sun6i needs mux to select backend */
|
||||
bool needs_edp_reset; /* a80 edp reset needed for tcon0 access */
|
||||
bool supports_lvds; /* Does the TCON support an LVDS output? */
|
||||
u8 dclk_min_div; /* minimum divider for TCON0 DCLK */
|
||||
|
||||
/* callback to handle tcon muxing options */
|
||||
int (*set_mux)(struct sun4i_tcon *, const struct drm_encoder *);
|
||||
|
@ -261,7 +261,8 @@ static int asus_event(struct hid_device *hdev, struct hid_field *field,
|
||||
struct hid_usage *usage, __s32 value)
|
||||
{
|
||||
if ((usage->hid & HID_USAGE_PAGE) == 0xff310000 &&
|
||||
(usage->hid & HID_USAGE) != 0x00 && !usage->type) {
|
||||
(usage->hid & HID_USAGE) != 0x00 &&
|
||||
(usage->hid & HID_USAGE) != 0xff && !usage->type) {
|
||||
hid_warn(hdev, "Unmapped Asus vendor usagepage code 0x%02x\n",
|
||||
usage->hid & HID_USAGE);
|
||||
}
|
||||
|
@ -288,6 +288,12 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign
|
||||
offset = report->size;
|
||||
report->size += parser->global.report_size * parser->global.report_count;
|
||||
|
||||
/* Total size check: Allow for possible report index byte */
|
||||
if (report->size > (HID_MAX_BUFFER_SIZE - 1) << 3) {
|
||||
hid_err(parser->device, "report is too long\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!parser->local.usage_index) /* Ignore padding fields */
|
||||
return 0;
|
||||
|
||||
|
@ -631,6 +631,7 @@
|
||||
#define USB_VENDOR_ID_ITE 0x048d
|
||||
#define USB_DEVICE_ID_ITE_LENOVO_YOGA 0x8386
|
||||
#define USB_DEVICE_ID_ITE_LENOVO_YOGA2 0x8350
|
||||
#define I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720 0x837a
|
||||
#define USB_DEVICE_ID_ITE_LENOVO_YOGA900 0x8396
|
||||
#define USB_DEVICE_ID_ITE8595 0x8595
|
||||
|
||||
@ -730,6 +731,7 @@
|
||||
#define USB_DEVICE_ID_LG_MULTITOUCH 0x0064
|
||||
#define USB_DEVICE_ID_LG_MELFAS_MT 0x6007
|
||||
#define I2C_DEVICE_ID_LG_8001 0x8001
|
||||
#define I2C_DEVICE_ID_LG_7010 0x7010
|
||||
|
||||
#define USB_VENDOR_ID_LOGITECH 0x046d
|
||||
#define USB_DEVICE_ID_LOGITECH_AUDIOHUB 0x0a0e
|
||||
@ -1102,6 +1104,7 @@
|
||||
#define USB_DEVICE_ID_SYNAPTICS_LTS2 0x1d10
|
||||
#define USB_DEVICE_ID_SYNAPTICS_HD 0x0ac3
|
||||
#define USB_DEVICE_ID_SYNAPTICS_QUAD_HD 0x1ac3
|
||||
#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012 0x2968
|
||||
#define USB_DEVICE_ID_SYNAPTICS_TP_V103 0x5710
|
||||
#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5 0x81a7
|
||||
|
||||
|
@ -1132,9 +1132,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
|
||||
}
|
||||
|
||||
mapped:
|
||||
if (device->driver->input_mapped && device->driver->input_mapped(device,
|
||||
hidinput, field, usage, &bit, &max) < 0)
|
||||
goto ignore;
|
||||
if (device->driver->input_mapped &&
|
||||
device->driver->input_mapped(device, hidinput, field, usage,
|
||||
&bit, &max) < 0) {
|
||||
/*
|
||||
* The driver indicated that no further generic handling
|
||||
* of the usage is desired.
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
set_bit(usage->type, input->evbit);
|
||||
|
||||
@ -1215,9 +1221,11 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
|
||||
set_bit(MSC_SCAN, input->mscbit);
|
||||
}
|
||||
|
||||
ignore:
|
||||
return;
|
||||
|
||||
ignore:
|
||||
usage->type = 0;
|
||||
usage->code = 0;
|
||||
}
|
||||
|
||||
static void hidinput_handle_scroll(struct hid_usage *usage,
|
||||
|
@ -40,6 +40,9 @@ static int ite_event(struct hid_device *hdev, struct hid_field *field,
|
||||
static const struct hid_device_id ite_devices[] = {
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ITE, USB_DEVICE_ID_ITE8595) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_258A, USB_DEVICE_ID_258A_6A88) },
|
||||
/* ITE8595 USB kbd ctlr, with Synaptics touchpad connected to it. */
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS,
|
||||
USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012) },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(hid, ite_devices);
|
||||
|
@ -1019,7 +1019,7 @@ static int mt_process_slot(struct mt_device *td, struct input_dev *input,
|
||||
tool = MT_TOOL_DIAL;
|
||||
else if (unlikely(!confidence_state)) {
|
||||
tool = MT_TOOL_PALM;
|
||||
if (!active &&
|
||||
if (!active && mt &&
|
||||
input_mt_is_active(&mt->slots[slotnum])) {
|
||||
/*
|
||||
* The non-confidence was reported for
|
||||
@ -1985,6 +1985,9 @@ static const struct hid_device_id mt_devices[] = {
|
||||
{ .driver_data = MT_CLS_LG,
|
||||
HID_USB_DEVICE(USB_VENDOR_ID_LG,
|
||||
USB_DEVICE_ID_LG_MELFAS_MT) },
|
||||
{ .driver_data = MT_CLS_LG,
|
||||
HID_DEVICE(BUS_I2C, HID_GROUP_GENERIC,
|
||||
USB_VENDOR_ID_LG, I2C_DEVICE_ID_LG_7010) },
|
||||
|
||||
/* MosArt panels */
|
||||
{ .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
|
||||
|
@ -174,6 +174,7 @@ static const struct hid_device_id hid_quirks[] = {
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET), HID_QUIRK_MULTI_INPUT },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD2, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE), HID_QUIRK_MULTI_INPUT },
|
||||
|
||||
{ 0 }
|
||||
};
|
||||
|
@ -768,8 +768,12 @@ static int steam_probe(struct hid_device *hdev,
|
||||
|
||||
if (steam->quirks & STEAM_QUIRK_WIRELESS) {
|
||||
hid_info(hdev, "Steam wireless receiver connected");
|
||||
/* If using a wireless adaptor ask for connection status */
|
||||
steam->connected = false;
|
||||
steam_request_conn_status(steam);
|
||||
} else {
|
||||
/* A wired connection is always present */
|
||||
steam->connected = true;
|
||||
ret = steam_register(steam);
|
||||
if (ret) {
|
||||
hid_err(hdev,
|
||||
|
@ -249,13 +249,14 @@ static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t
|
||||
static __poll_t hidraw_poll(struct file *file, poll_table *wait)
|
||||
{
|
||||
struct hidraw_list *list = file->private_data;
|
||||
__poll_t mask = EPOLLOUT | EPOLLWRNORM; /* hidraw is always writable */
|
||||
|
||||
poll_wait(file, &list->hidraw->wait, wait);
|
||||
if (list->head != list->tail)
|
||||
return EPOLLIN | EPOLLRDNORM | EPOLLOUT;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
if (!list->hidraw->exist)
|
||||
return EPOLLERR | EPOLLHUP;
|
||||
return 0;
|
||||
mask |= EPOLLERR | EPOLLHUP;
|
||||
return mask;
|
||||
}
|
||||
|
||||
static int hidraw_open(struct inode *inode, struct file *file)
|
||||
|
@ -49,6 +49,8 @@
|
||||
#define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1)
|
||||
#define I2C_HID_QUIRK_BOGUS_IRQ BIT(4)
|
||||
#define I2C_HID_QUIRK_RESET_ON_RESUME BIT(5)
|
||||
#define I2C_HID_QUIRK_BAD_INPUT_SIZE BIT(6)
|
||||
|
||||
|
||||
/* flags */
|
||||
#define I2C_HID_STARTED 0
|
||||
@ -175,6 +177,8 @@ static const struct i2c_hid_quirks {
|
||||
I2C_HID_QUIRK_BOGUS_IRQ },
|
||||
{ USB_VENDOR_ID_ALPS_JP, HID_ANY_ID,
|
||||
I2C_HID_QUIRK_RESET_ON_RESUME },
|
||||
{ USB_VENDOR_ID_ITE, I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720,
|
||||
I2C_HID_QUIRK_BAD_INPUT_SIZE },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
@ -496,9 +500,15 @@ static void i2c_hid_get_input(struct i2c_hid *ihid)
|
||||
}
|
||||
|
||||
if ((ret_size > size) || (ret_size < 2)) {
|
||||
dev_err(&ihid->client->dev, "%s: incomplete report (%d/%d)\n",
|
||||
__func__, size, ret_size);
|
||||
return;
|
||||
if (ihid->quirks & I2C_HID_QUIRK_BAD_INPUT_SIZE) {
|
||||
ihid->inbuf[0] = size & 0xff;
|
||||
ihid->inbuf[1] = size >> 8;
|
||||
ret_size = size;
|
||||
} else {
|
||||
dev_err(&ihid->client->dev, "%s: incomplete report (%d/%d)\n",
|
||||
__func__, size, ret_size);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
i2c_hid_dbg(ihid, "input: %*ph\n", ret_size, ihid->inbuf);
|
||||
|
@ -24,7 +24,9 @@
|
||||
#define ICL_MOBILE_DEVICE_ID 0x34FC
|
||||
#define SPT_H_DEVICE_ID 0xA135
|
||||
#define CML_LP_DEVICE_ID 0x02FC
|
||||
#define CMP_H_DEVICE_ID 0x06FC
|
||||
#define EHL_Ax_DEVICE_ID 0x4BB3
|
||||
#define TGL_LP_DEVICE_ID 0xA0FC
|
||||
|
||||
#define REVISION_ID_CHT_A0 0x6
|
||||
#define REVISION_ID_CHT_Ax_SI 0x0
|
||||
|
@ -34,7 +34,9 @@ static const struct pci_device_id ish_pci_tbl[] = {
|
||||
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, ICL_MOBILE_DEVICE_ID)},
|
||||
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, SPT_H_DEVICE_ID)},
|
||||
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, CML_LP_DEVICE_ID)},
|
||||
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, CMP_H_DEVICE_ID)},
|
||||
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, EHL_Ax_DEVICE_ID)},
|
||||
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, TGL_LP_DEVICE_ID)},
|
||||
{0, }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, ish_pci_tbl);
|
||||
|
@ -766,13 +766,14 @@ static ssize_t uhid_char_write(struct file *file, const char __user *buffer,
|
||||
static __poll_t uhid_char_poll(struct file *file, poll_table *wait)
|
||||
{
|
||||
struct uhid_device *uhid = file->private_data;
|
||||
__poll_t mask = EPOLLOUT | EPOLLWRNORM; /* uhid is always writable */
|
||||
|
||||
poll_wait(file, &uhid->waitq, wait);
|
||||
|
||||
if (uhid->head != uhid->tail)
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return 0;
|
||||
return mask;
|
||||
}
|
||||
|
||||
static const struct file_operations uhid_fops = {
|
||||
|
@ -241,12 +241,51 @@ static int hiddev_release(struct inode * inode, struct file * file)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __hiddev_open(struct hiddev *hiddev, struct file *file)
|
||||
{
|
||||
struct hiddev_list *list;
|
||||
int error;
|
||||
|
||||
lockdep_assert_held(&hiddev->existancelock);
|
||||
|
||||
list = vzalloc(sizeof(*list));
|
||||
if (!list)
|
||||
return -ENOMEM;
|
||||
|
||||
mutex_init(&list->thread_lock);
|
||||
list->hiddev = hiddev;
|
||||
|
||||
if (!hiddev->open++) {
|
||||
error = hid_hw_power(hiddev->hid, PM_HINT_FULLON);
|
||||
if (error < 0)
|
||||
goto err_drop_count;
|
||||
|
||||
error = hid_hw_open(hiddev->hid);
|
||||
if (error < 0)
|
||||
goto err_normal_power;
|
||||
}
|
||||
|
||||
spin_lock_irq(&hiddev->list_lock);
|
||||
list_add_tail(&list->node, &hiddev->list);
|
||||
spin_unlock_irq(&hiddev->list_lock);
|
||||
|
||||
file->private_data = list;
|
||||
|
||||
return 0;
|
||||
|
||||
err_normal_power:
|
||||
hid_hw_power(hiddev->hid, PM_HINT_NORMAL);
|
||||
err_drop_count:
|
||||
hiddev->open--;
|
||||
vfree(list);
|
||||
return error;
|
||||
}
|
||||
|
||||
/*
|
||||
* open file op
|
||||
*/
|
||||
static int hiddev_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct hiddev_list *list;
|
||||
struct usb_interface *intf;
|
||||
struct hid_device *hid;
|
||||
struct hiddev *hiddev;
|
||||
@ -255,66 +294,14 @@ static int hiddev_open(struct inode *inode, struct file *file)
|
||||
intf = usbhid_find_interface(iminor(inode));
|
||||
if (!intf)
|
||||
return -ENODEV;
|
||||
|
||||
hid = usb_get_intfdata(intf);
|
||||
hiddev = hid->hiddev;
|
||||
|
||||
if (!(list = vzalloc(sizeof(struct hiddev_list))))
|
||||
return -ENOMEM;
|
||||
mutex_init(&list->thread_lock);
|
||||
list->hiddev = hiddev;
|
||||
file->private_data = list;
|
||||
|
||||
/*
|
||||
* no need for locking because the USB major number
|
||||
* is shared which usbcore guards against disconnect
|
||||
*/
|
||||
if (list->hiddev->exist) {
|
||||
if (!list->hiddev->open++) {
|
||||
res = hid_hw_open(hiddev->hid);
|
||||
if (res < 0)
|
||||
goto bail;
|
||||
}
|
||||
} else {
|
||||
res = -ENODEV;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
spin_lock_irq(&list->hiddev->list_lock);
|
||||
list_add_tail(&list->node, &hiddev->list);
|
||||
spin_unlock_irq(&list->hiddev->list_lock);
|
||||
|
||||
mutex_lock(&hiddev->existancelock);
|
||||
/*
|
||||
* recheck exist with existance lock held to
|
||||
* avoid opening a disconnected device
|
||||
*/
|
||||
if (!list->hiddev->exist) {
|
||||
res = -ENODEV;
|
||||
goto bail_unlock;
|
||||
}
|
||||
if (!list->hiddev->open++)
|
||||
if (list->hiddev->exist) {
|
||||
struct hid_device *hid = hiddev->hid;
|
||||
res = hid_hw_power(hid, PM_HINT_FULLON);
|
||||
if (res < 0)
|
||||
goto bail_unlock;
|
||||
res = hid_hw_open(hid);
|
||||
if (res < 0)
|
||||
goto bail_normal_power;
|
||||
}
|
||||
mutex_unlock(&hiddev->existancelock);
|
||||
return 0;
|
||||
bail_normal_power:
|
||||
hid_hw_power(hid, PM_HINT_NORMAL);
|
||||
bail_unlock:
|
||||
res = hiddev->exist ? __hiddev_open(hiddev, file) : -ENODEV;
|
||||
mutex_unlock(&hiddev->existancelock);
|
||||
|
||||
spin_lock_irq(&list->hiddev->list_lock);
|
||||
list_del(&list->node);
|
||||
spin_unlock_irq(&list->hiddev->list_lock);
|
||||
bail:
|
||||
file->private_data = NULL;
|
||||
vfree(list);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -2096,14 +2096,16 @@ static void wacom_wac_pad_event(struct hid_device *hdev, struct hid_field *field
|
||||
(hdev->product == 0x34d || hdev->product == 0x34e || /* MobileStudio Pro */
|
||||
hdev->product == 0x357 || hdev->product == 0x358 || /* Intuos Pro 2 */
|
||||
hdev->product == 0x392 || /* Intuos Pro 2 */
|
||||
hdev->product == 0x398 || hdev->product == 0x399)) { /* MobileStudio Pro */
|
||||
hdev->product == 0x398 || hdev->product == 0x399 || /* MobileStudio Pro */
|
||||
hdev->product == 0x3AA)) { /* MobileStudio Pro */
|
||||
value = (field->logical_maximum - value);
|
||||
|
||||
if (hdev->product == 0x357 || hdev->product == 0x358 ||
|
||||
hdev->product == 0x392)
|
||||
value = wacom_offset_rotation(input, usage, value, 3, 16);
|
||||
else if (hdev->product == 0x34d || hdev->product == 0x34e ||
|
||||
hdev->product == 0x398 || hdev->product == 0x399)
|
||||
hdev->product == 0x398 || hdev->product == 0x399 ||
|
||||
hdev->product == 0x3AA)
|
||||
value = wacom_offset_rotation(input, usage, value, 1, 2);
|
||||
}
|
||||
else {
|
||||
|
@ -174,7 +174,7 @@ static struct at91_twi_pdata sama5d2_config = {
|
||||
|
||||
static struct at91_twi_pdata sam9x60_config = {
|
||||
.clk_max_div = 7,
|
||||
.clk_offset = 4,
|
||||
.clk_offset = 3,
|
||||
.has_unre_flag = true,
|
||||
.has_alt_cmd = true,
|
||||
.has_hold_field = true,
|
||||
|
@ -58,6 +58,7 @@ struct bcm2835_i2c_dev {
|
||||
struct i2c_adapter adapter;
|
||||
struct completion completion;
|
||||
struct i2c_msg *curr_msg;
|
||||
struct clk *bus_clk;
|
||||
int num_msgs;
|
||||
u32 msg_err;
|
||||
u8 *msg_buf;
|
||||
@ -404,7 +405,6 @@ static int bcm2835_i2c_probe(struct platform_device *pdev)
|
||||
struct resource *mem, *irq;
|
||||
int ret;
|
||||
struct i2c_adapter *adap;
|
||||
struct clk *bus_clk;
|
||||
struct clk *mclk;
|
||||
u32 bus_clk_rate;
|
||||
|
||||
@ -427,11 +427,11 @@ static int bcm2835_i2c_probe(struct platform_device *pdev)
|
||||
return PTR_ERR(mclk);
|
||||
}
|
||||
|
||||
bus_clk = bcm2835_i2c_register_div(&pdev->dev, mclk, i2c_dev);
|
||||
i2c_dev->bus_clk = bcm2835_i2c_register_div(&pdev->dev, mclk, i2c_dev);
|
||||
|
||||
if (IS_ERR(bus_clk)) {
|
||||
if (IS_ERR(i2c_dev->bus_clk)) {
|
||||
dev_err(&pdev->dev, "Could not register clock\n");
|
||||
return PTR_ERR(bus_clk);
|
||||
return PTR_ERR(i2c_dev->bus_clk);
|
||||
}
|
||||
|
||||
ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency",
|
||||
@ -442,13 +442,13 @@ static int bcm2835_i2c_probe(struct platform_device *pdev)
|
||||
bus_clk_rate = 100000;
|
||||
}
|
||||
|
||||
ret = clk_set_rate_exclusive(bus_clk, bus_clk_rate);
|
||||
ret = clk_set_rate_exclusive(i2c_dev->bus_clk, bus_clk_rate);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "Could not set clock frequency\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = clk_prepare_enable(bus_clk);
|
||||
ret = clk_prepare_enable(i2c_dev->bus_clk);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Couldn't prepare clock");
|
||||
return ret;
|
||||
@ -491,10 +491,9 @@ static int bcm2835_i2c_probe(struct platform_device *pdev)
|
||||
static int bcm2835_i2c_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct bcm2835_i2c_dev *i2c_dev = platform_get_drvdata(pdev);
|
||||
struct clk *bus_clk = devm_clk_get(i2c_dev->dev, "div");
|
||||
|
||||
clk_rate_exclusive_put(bus_clk);
|
||||
clk_disable_unprepare(bus_clk);
|
||||
clk_rate_exclusive_put(i2c_dev->bus_clk);
|
||||
clk_disable_unprepare(i2c_dev->bus_clk);
|
||||
|
||||
free_irq(i2c_dev->irq, i2c_dev);
|
||||
i2c_del_adapter(&i2c_dev->adapter);
|
||||
|
@ -186,10 +186,11 @@ int i2c_generic_scl_recovery(struct i2c_adapter *adap)
|
||||
* If we can set SDA, we will always create a STOP to ensure additional
|
||||
* pulses will do no harm. This is achieved by letting SDA follow SCL
|
||||
* half a cycle later. Check the 'incomplete_write_byte' fault injector
|
||||
* for details.
|
||||
* for details. Note that we must honour tsu:sto, 4us, but lets use 5us
|
||||
* here for simplicity.
|
||||
*/
|
||||
bri->set_scl(adap, scl);
|
||||
ndelay(RECOVERY_NDELAY / 2);
|
||||
ndelay(RECOVERY_NDELAY);
|
||||
if (bri->set_sda)
|
||||
bri->set_sda(adap, scl);
|
||||
ndelay(RECOVERY_NDELAY / 2);
|
||||
@ -211,7 +212,13 @@ int i2c_generic_scl_recovery(struct i2c_adapter *adap)
|
||||
scl = !scl;
|
||||
bri->set_scl(adap, scl);
|
||||
/* Creating STOP again, see above */
|
||||
ndelay(RECOVERY_NDELAY / 2);
|
||||
if (scl) {
|
||||
/* Honour minimum tsu:sto */
|
||||
ndelay(RECOVERY_NDELAY);
|
||||
} else {
|
||||
/* Honour minimum tf and thd:dat */
|
||||
ndelay(RECOVERY_NDELAY / 2);
|
||||
}
|
||||
if (bri->set_sda)
|
||||
bri->set_sda(adap, scl);
|
||||
ndelay(RECOVERY_NDELAY / 2);
|
||||
|
@ -3305,8 +3305,10 @@ int bnxt_re_dereg_mr(struct ib_mr *ib_mr, struct ib_udata *udata)
|
||||
int rc;
|
||||
|
||||
rc = bnxt_qplib_free_mrw(&rdev->qplib_res, &mr->qplib_mr);
|
||||
if (rc)
|
||||
if (rc) {
|
||||
dev_err(rdev_to_dev(rdev), "Dereg MR failed: %#x\n", rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (mr->pages) {
|
||||
rc = bnxt_qplib_free_fast_reg_page_list(&rdev->qplib_res,
|
||||
|
@ -2283,13 +2283,13 @@ static int bnxt_qplib_cq_process_req(struct bnxt_qplib_cq *cq,
|
||||
/* Add qp to flush list of the CQ */
|
||||
bnxt_qplib_add_flush_qp(qp);
|
||||
} else {
|
||||
/* Before we complete, do WA 9060 */
|
||||
if (do_wa9060(qp, cq, cq_cons, sw_sq_cons,
|
||||
cqe_sq_cons)) {
|
||||
*lib_qp = qp;
|
||||
goto out;
|
||||
}
|
||||
if (swq->flags & SQ_SEND_FLAGS_SIGNAL_COMP) {
|
||||
/* Before we complete, do WA 9060 */
|
||||
if (do_wa9060(qp, cq, cq_cons, sw_sq_cons,
|
||||
cqe_sq_cons)) {
|
||||
*lib_qp = qp;
|
||||
goto out;
|
||||
}
|
||||
cqe->status = CQ_REQ_STATUS_OK;
|
||||
cqe++;
|
||||
(*budget)--;
|
||||
|
@ -81,7 +81,9 @@ void iowait_init(struct iowait *wait, u32 tx_limit,
|
||||
void iowait_cancel_work(struct iowait *w)
|
||||
{
|
||||
cancel_work_sync(&iowait_get_ib_work(w)->iowork);
|
||||
cancel_work_sync(&iowait_get_tid_work(w)->iowork);
|
||||
/* Make sure that the iowork for TID RDMA is used */
|
||||
if (iowait_get_tid_work(w)->iowork.func)
|
||||
cancel_work_sync(&iowait_get_tid_work(w)->iowork);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4633,6 +4633,15 @@ void hfi1_rc_rcv_tid_rdma_ack(struct hfi1_packet *packet)
|
||||
*/
|
||||
fpsn = full_flow_psn(flow, flow->flow_state.spsn);
|
||||
req->r_ack_psn = psn;
|
||||
/*
|
||||
* If resync_psn points to the last flow PSN for a
|
||||
* segment and the new segment (likely from a new
|
||||
* request) starts with a new generation number, we
|
||||
* need to adjust resync_psn accordingly.
|
||||
*/
|
||||
if (flow->flow_state.generation !=
|
||||
(resync_psn >> HFI1_KDETH_BTH_SEQ_SHIFT))
|
||||
resync_psn = mask_psn(fpsn - 1);
|
||||
flow->resync_npkts +=
|
||||
delta_psn(mask_psn(resync_psn + 1), fpsn);
|
||||
/*
|
||||
|
@ -169,8 +169,7 @@ static void i40iw_dealloc_ucontext(struct ib_ucontext *context)
|
||||
static int i40iw_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
|
||||
{
|
||||
struct i40iw_ucontext *ucontext;
|
||||
u64 db_addr_offset;
|
||||
u64 push_offset;
|
||||
u64 db_addr_offset, push_offset, pfn;
|
||||
|
||||
ucontext = to_ucontext(context);
|
||||
if (ucontext->iwdev->sc_dev.is_pf) {
|
||||
@ -189,7 +188,6 @@ static int i40iw_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
|
||||
|
||||
if (vma->vm_pgoff == (db_addr_offset >> PAGE_SHIFT)) {
|
||||
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
||||
vma->vm_private_data = ucontext;
|
||||
} else {
|
||||
if ((vma->vm_pgoff - (push_offset >> PAGE_SHIFT)) % 2)
|
||||
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
||||
@ -197,12 +195,12 @@ static int i40iw_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
|
||||
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
|
||||
}
|
||||
|
||||
if (io_remap_pfn_range(vma, vma->vm_start,
|
||||
vma->vm_pgoff + (pci_resource_start(ucontext->iwdev->ldev->pcidev, 0) >> PAGE_SHIFT),
|
||||
PAGE_SIZE, vma->vm_page_prot))
|
||||
return -EAGAIN;
|
||||
pfn = vma->vm_pgoff +
|
||||
(pci_resource_start(ucontext->iwdev->ldev->pcidev, 0) >>
|
||||
PAGE_SHIFT);
|
||||
|
||||
return 0;
|
||||
return rdma_user_mmap_io(context, vma, pfn, PAGE_SIZE,
|
||||
vma->vm_page_prot, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -224,13 +224,13 @@ static void __pass_event(struct evdev_client *client,
|
||||
*/
|
||||
client->tail = (client->head - 2) & (client->bufsize - 1);
|
||||
|
||||
client->buffer[client->tail].input_event_sec =
|
||||
event->input_event_sec;
|
||||
client->buffer[client->tail].input_event_usec =
|
||||
event->input_event_usec;
|
||||
client->buffer[client->tail].type = EV_SYN;
|
||||
client->buffer[client->tail].code = SYN_DROPPED;
|
||||
client->buffer[client->tail].value = 0;
|
||||
client->buffer[client->tail] = (struct input_event) {
|
||||
.input_event_sec = event->input_event_sec,
|
||||
.input_event_usec = event->input_event_usec,
|
||||
.type = EV_SYN,
|
||||
.code = SYN_DROPPED,
|
||||
.value = 0,
|
||||
};
|
||||
|
||||
client->packet_head = client->tail;
|
||||
}
|
||||
|
@ -878,16 +878,18 @@ static int input_default_setkeycode(struct input_dev *dev,
|
||||
}
|
||||
}
|
||||
|
||||
__clear_bit(*old_keycode, dev->keybit);
|
||||
__set_bit(ke->keycode, dev->keybit);
|
||||
|
||||
for (i = 0; i < dev->keycodemax; i++) {
|
||||
if (input_fetch_keycode(dev, i) == *old_keycode) {
|
||||
__set_bit(*old_keycode, dev->keybit);
|
||||
break; /* Setting the bit twice is useless, so break */
|
||||
if (*old_keycode <= KEY_MAX) {
|
||||
__clear_bit(*old_keycode, dev->keybit);
|
||||
for (i = 0; i < dev->keycodemax; i++) {
|
||||
if (input_fetch_keycode(dev, i) == *old_keycode) {
|
||||
__set_bit(*old_keycode, dev->keybit);
|
||||
/* Setting the bit twice is useless, so break */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
__set_bit(ke->keycode, dev->keybit);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -943,9 +945,13 @@ int input_set_keycode(struct input_dev *dev,
|
||||
* Simulate keyup event if keycode is not present
|
||||
* in the keymap anymore
|
||||
*/
|
||||
if (test_bit(EV_KEY, dev->evbit) &&
|
||||
!is_event_supported(old_keycode, dev->keybit, KEY_MAX) &&
|
||||
__test_and_clear_bit(old_keycode, dev->key)) {
|
||||
if (old_keycode > KEY_MAX) {
|
||||
dev_warn(dev->dev.parent ?: &dev->dev,
|
||||
"%s: got too big old keycode %#x\n",
|
||||
__func__, old_keycode);
|
||||
} else if (test_bit(EV_KEY, dev->evbit) &&
|
||||
!is_event_supported(old_keycode, dev->keybit, KEY_MAX) &&
|
||||
__test_and_clear_bit(old_keycode, dev->key)) {
|
||||
struct input_value vals[] = {
|
||||
{ EV_KEY, old_keycode, 0 },
|
||||
input_value_sync
|
||||
|
@ -78,7 +78,13 @@ static void imx_sc_check_for_events(struct work_struct *work)
|
||||
return;
|
||||
}
|
||||
|
||||
state = (bool)msg.state;
|
||||
/*
|
||||
* The response data from SCU firmware is 4 bytes,
|
||||
* but ONLY the first byte is the key state, other
|
||||
* 3 bytes could be some dirty data, so we should
|
||||
* ONLY take the first byte as key state.
|
||||
*/
|
||||
state = (bool)(msg.state & 0xff);
|
||||
|
||||
if (state ^ priv->keystate) {
|
||||
priv->keystate = state;
|
||||
|
@ -74,12 +74,16 @@ static int uinput_dev_event(struct input_dev *dev,
|
||||
struct uinput_device *udev = input_get_drvdata(dev);
|
||||
struct timespec64 ts;
|
||||
|
||||
udev->buff[udev->head].type = type;
|
||||
udev->buff[udev->head].code = code;
|
||||
udev->buff[udev->head].value = value;
|
||||
ktime_get_ts64(&ts);
|
||||
udev->buff[udev->head].input_event_sec = ts.tv_sec;
|
||||
udev->buff[udev->head].input_event_usec = ts.tv_nsec / NSEC_PER_USEC;
|
||||
|
||||
udev->buff[udev->head] = (struct input_event) {
|
||||
.input_event_sec = ts.tv_sec,
|
||||
.input_event_usec = ts.tv_nsec / NSEC_PER_USEC,
|
||||
.type = type,
|
||||
.code = code,
|
||||
.value = value,
|
||||
};
|
||||
|
||||
udev->head = (udev->head + 1) % UINPUT_BUFFER_SIZE;
|
||||
|
||||
wake_up_interruptible(&udev->waitq);
|
||||
@ -689,13 +693,14 @@ static ssize_t uinput_read(struct file *file, char __user *buffer,
|
||||
static __poll_t uinput_poll(struct file *file, poll_table *wait)
|
||||
{
|
||||
struct uinput_device *udev = file->private_data;
|
||||
__poll_t mask = EPOLLOUT | EPOLLWRNORM; /* uinput is always writable */
|
||||
|
||||
poll_wait(file, &udev->waitq, wait);
|
||||
|
||||
if (udev->head != udev->tail)
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return EPOLLOUT | EPOLLWRNORM;
|
||||
return mask;
|
||||
}
|
||||
|
||||
static int uinput_release(struct inode *inode, struct file *file)
|
||||
|
@ -1203,7 +1203,6 @@ int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr)
|
||||
{
|
||||
struct device *dev = msi_desc_to_dev(desc);
|
||||
struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
|
||||
struct iommu_dma_cookie *cookie;
|
||||
struct iommu_dma_msi_page *msi_page;
|
||||
static DEFINE_MUTEX(msi_prepare_lock); /* see below */
|
||||
|
||||
@ -1212,8 +1211,6 @@ int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
cookie = domain->iova_cookie;
|
||||
|
||||
/*
|
||||
* In fact the whole prepare operation should already be serialised by
|
||||
* irq_domain_mutex further up the callchain, but that's pretty subtle
|
||||
|
@ -5624,8 +5624,10 @@ static int intel_iommu_add_device(struct device *dev)
|
||||
|
||||
group = iommu_group_get_for_dev(dev);
|
||||
|
||||
if (IS_ERR(group))
|
||||
return PTR_ERR(group);
|
||||
if (IS_ERR(group)) {
|
||||
ret = PTR_ERR(group);
|
||||
goto unlink;
|
||||
}
|
||||
|
||||
iommu_group_put(group);
|
||||
|
||||
@ -5651,7 +5653,8 @@ static int intel_iommu_add_device(struct device *dev)
|
||||
if (!get_private_domain_for_dev(dev)) {
|
||||
dev_warn(dev,
|
||||
"Failed to get a private domain.\n");
|
||||
return -ENOMEM;
|
||||
ret = -ENOMEM;
|
||||
goto unlink;
|
||||
}
|
||||
|
||||
dev_info(dev,
|
||||
@ -5666,6 +5669,10 @@ static int intel_iommu_add_device(struct device *dev)
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
unlink:
|
||||
iommu_device_unlink(&iommu->iommu, dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void intel_iommu_remove_device(struct device *dev)
|
||||
@ -5817,6 +5824,13 @@ static void intel_iommu_apply_resv_region(struct device *dev,
|
||||
WARN_ON_ONCE(!reserve_iova(&dmar_domain->iovad, start, end));
|
||||
}
|
||||
|
||||
static struct iommu_group *intel_iommu_device_group(struct device *dev)
|
||||
{
|
||||
if (dev_is_pci(dev))
|
||||
return pci_device_group(dev);
|
||||
return generic_device_group(dev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_INTEL_IOMMU_SVM
|
||||
struct intel_iommu *intel_svm_device_to_iommu(struct device *dev)
|
||||
{
|
||||
@ -5989,7 +6003,7 @@ const struct iommu_ops intel_iommu_ops = {
|
||||
.get_resv_regions = intel_iommu_get_resv_regions,
|
||||
.put_resv_regions = intel_iommu_put_resv_regions,
|
||||
.apply_resv_region = intel_iommu_apply_resv_region,
|
||||
.device_group = pci_device_group,
|
||||
.device_group = intel_iommu_device_group,
|
||||
.dev_has_feat = intel_iommu_dev_has_feat,
|
||||
.dev_feat_enabled = intel_iommu_dev_feat_enabled,
|
||||
.dev_enable_feat = intel_iommu_dev_enable_feat,
|
||||
|
@ -768,6 +768,7 @@ int iommu_group_add_device(struct iommu_group *group, struct device *dev)
|
||||
mutex_unlock(&group->mutex);
|
||||
dev->iommu_group = NULL;
|
||||
kobject_put(group->devices_kobj);
|
||||
sysfs_remove_link(group->devices_kobj, device->name);
|
||||
err_free_name:
|
||||
kfree(device->name);
|
||||
err_remove_link:
|
||||
|
@ -148,13 +148,13 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
|
||||
unsigned long timeout;
|
||||
u32 syscfg;
|
||||
|
||||
if (state == FL_RESETING || state == FL_PREPARING_ERASE ||
|
||||
if (state == FL_RESETTING || state == FL_PREPARING_ERASE ||
|
||||
state == FL_VERIFYING_ERASE) {
|
||||
int i = 21;
|
||||
unsigned int intr_flags = ONENAND_INT_MASTER;
|
||||
|
||||
switch (state) {
|
||||
case FL_RESETING:
|
||||
case FL_RESETTING:
|
||||
intr_flags |= ONENAND_INT_RESET;
|
||||
break;
|
||||
case FL_PREPARING_ERASE:
|
||||
@ -328,7 +328,8 @@ static inline int omap2_onenand_dma_transfer(struct omap2_onenand *c,
|
||||
struct dma_async_tx_descriptor *tx;
|
||||
dma_cookie_t cookie;
|
||||
|
||||
tx = dmaengine_prep_dma_memcpy(c->dma_chan, dst, src, count, 0);
|
||||
tx = dmaengine_prep_dma_memcpy(c->dma_chan, dst, src, count,
|
||||
DMA_CTRL_ACK | DMA_PREP_INTERRUPT);
|
||||
if (!tx) {
|
||||
dev_err(&c->pdev->dev, "Failed to prepare DMA memcpy\n");
|
||||
return -EIO;
|
||||
@ -375,7 +376,7 @@ static int omap2_onenand_read_bufferram(struct mtd_info *mtd, int area,
|
||||
* context fallback to PIO mode.
|
||||
*/
|
||||
if (!virt_addr_valid(buf) || bram_offset & 3 || (size_t)buf & 3 ||
|
||||
count < 384 || in_interrupt() || oops_in_progress )
|
||||
count < 384 || in_interrupt() || oops_in_progress)
|
||||
goto out_copy;
|
||||
|
||||
xtra = count & 3;
|
||||
@ -422,7 +423,7 @@ static int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area,
|
||||
* context fallback to PIO mode.
|
||||
*/
|
||||
if (!virt_addr_valid(buf) || bram_offset & 3 || (size_t)buf & 3 ||
|
||||
count < 384 || in_interrupt() || oops_in_progress )
|
||||
count < 384 || in_interrupt() || oops_in_progress)
|
||||
goto out_copy;
|
||||
|
||||
dma_src = dma_map_single(dev, buf, count, DMA_TO_DEVICE);
|
||||
@ -528,7 +529,8 @@ static int omap2_onenand_probe(struct platform_device *pdev)
|
||||
c->gpmc_cs, c->phys_base, c->onenand.base,
|
||||
c->dma_chan ? "DMA" : "PIO");
|
||||
|
||||
if ((r = onenand_scan(&c->mtd, 1)) < 0)
|
||||
r = onenand_scan(&c->mtd, 1);
|
||||
if (r < 0)
|
||||
goto err_release_dma;
|
||||
|
||||
freq = omap2_onenand_get_freq(c->onenand.version_id);
|
||||
|
@ -2853,7 +2853,7 @@ static int onenand_otp_write_oob_nolock(struct mtd_info *mtd, loff_t to,
|
||||
|
||||
/* Exit OTP access mode */
|
||||
this->command(mtd, ONENAND_CMD_RESET, 0, 0);
|
||||
this->wait(mtd, FL_RESETING);
|
||||
this->wait(mtd, FL_RESETTING);
|
||||
|
||||
status = this->read_word(this->base + ONENAND_REG_CTRL_STATUS);
|
||||
status &= 0x60;
|
||||
@ -2924,7 +2924,7 @@ static int do_otp_read(struct mtd_info *mtd, loff_t from, size_t len,
|
||||
|
||||
/* Exit OTP access mode */
|
||||
this->command(mtd, ONENAND_CMD_RESET, 0, 0);
|
||||
this->wait(mtd, FL_RESETING);
|
||||
this->wait(mtd, FL_RESETTING);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -2968,7 +2968,7 @@ static int do_otp_write(struct mtd_info *mtd, loff_t to, size_t len,
|
||||
|
||||
/* Exit OTP access mode */
|
||||
this->command(mtd, ONENAND_CMD_RESET, 0, 0);
|
||||
this->wait(mtd, FL_RESETING);
|
||||
this->wait(mtd, FL_RESETTING);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -3008,7 +3008,7 @@ static int do_otp_lock(struct mtd_info *mtd, loff_t from, size_t len,
|
||||
|
||||
/* Exit OTP access mode */
|
||||
this->command(mtd, ONENAND_CMD_RESET, 0, 0);
|
||||
this->wait(mtd, FL_RESETING);
|
||||
this->wait(mtd, FL_RESETTING);
|
||||
} else {
|
||||
ops.mode = MTD_OPS_PLACE_OOB;
|
||||
ops.ooblen = len;
|
||||
@ -3413,7 +3413,7 @@ static int flexonenand_get_boundary(struct mtd_info *mtd)
|
||||
this->boundary[die] = bdry & FLEXONENAND_PI_MASK;
|
||||
|
||||
this->command(mtd, ONENAND_CMD_RESET, 0, 0);
|
||||
this->wait(mtd, FL_RESETING);
|
||||
this->wait(mtd, FL_RESETTING);
|
||||
|
||||
printk(KERN_INFO "Die %d boundary: %d%s\n", die,
|
||||
this->boundary[die], locked ? "(Locked)" : "(Unlocked)");
|
||||
@ -3635,7 +3635,7 @@ static int flexonenand_set_boundary(struct mtd_info *mtd, int die,
|
||||
ret = this->wait(mtd, FL_WRITING);
|
||||
out:
|
||||
this->write_word(ONENAND_CMD_RESET, this->base + ONENAND_REG_COMMAND);
|
||||
this->wait(mtd, FL_RESETING);
|
||||
this->wait(mtd, FL_RESETTING);
|
||||
if (!ret)
|
||||
/* Recalculate device size on boundary change*/
|
||||
flexonenand_get_size(mtd);
|
||||
@ -3671,7 +3671,7 @@ static int onenand_chip_probe(struct mtd_info *mtd)
|
||||
/* Reset OneNAND to read default register values */
|
||||
this->write_word(ONENAND_CMD_RESET, this->base + ONENAND_BOOTRAM);
|
||||
/* Wait reset */
|
||||
this->wait(mtd, FL_RESETING);
|
||||
this->wait(mtd, FL_RESETTING);
|
||||
|
||||
/* Restore system configuration 1 */
|
||||
this->write_word(syscfg, this->base + ONENAND_REG_SYS_CFG1);
|
||||
|
@ -675,12 +675,12 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area,
|
||||
normal:
|
||||
if (count != mtd->writesize) {
|
||||
/* Copy the bufferram to memory to prevent unaligned access */
|
||||
memcpy(this->page_buf, p, mtd->writesize);
|
||||
p = this->page_buf + offset;
|
||||
memcpy_fromio(this->page_buf, p, mtd->writesize);
|
||||
memcpy(buffer, this->page_buf + offset, count);
|
||||
} else {
|
||||
memcpy_fromio(buffer, p, count);
|
||||
}
|
||||
|
||||
memcpy(buffer, p, count);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -914,8 +914,8 @@ static void cadence_nand_get_caps(struct cdns_nand_ctrl *cdns_ctrl)
|
||||
/* Prepare CDMA descriptor. */
|
||||
static void
|
||||
cadence_nand_cdma_desc_prepare(struct cdns_nand_ctrl *cdns_ctrl,
|
||||
char nf_mem, u32 flash_ptr, char *mem_ptr,
|
||||
char *ctrl_data_ptr, u16 ctype)
|
||||
char nf_mem, u32 flash_ptr, dma_addr_t mem_ptr,
|
||||
dma_addr_t ctrl_data_ptr, u16 ctype)
|
||||
{
|
||||
struct cadence_nand_cdma_desc *cdma_desc = cdns_ctrl->cdma_desc;
|
||||
|
||||
@ -931,13 +931,13 @@ cadence_nand_cdma_desc_prepare(struct cdns_nand_ctrl *cdns_ctrl,
|
||||
cdma_desc->command_flags |= CDMA_CF_DMA_MASTER;
|
||||
cdma_desc->command_flags |= CDMA_CF_INT;
|
||||
|
||||
cdma_desc->memory_pointer = (uintptr_t)mem_ptr;
|
||||
cdma_desc->memory_pointer = mem_ptr;
|
||||
cdma_desc->status = 0;
|
||||
cdma_desc->sync_flag_pointer = 0;
|
||||
cdma_desc->sync_arguments = 0;
|
||||
|
||||
cdma_desc->command_type = ctype;
|
||||
cdma_desc->ctrl_data_ptr = (uintptr_t)ctrl_data_ptr;
|
||||
cdma_desc->ctrl_data_ptr = ctrl_data_ptr;
|
||||
}
|
||||
|
||||
static u8 cadence_nand_check_desc_error(struct cdns_nand_ctrl *cdns_ctrl,
|
||||
@ -1280,8 +1280,7 @@ cadence_nand_cdma_transfer(struct cdns_nand_ctrl *cdns_ctrl, u8 chip_nr,
|
||||
}
|
||||
|
||||
cadence_nand_cdma_desc_prepare(cdns_ctrl, chip_nr, page,
|
||||
(void *)dma_buf, (void *)dma_ctrl_dat,
|
||||
ctype);
|
||||
dma_buf, dma_ctrl_dat, ctype);
|
||||
|
||||
status = cadence_nand_cdma_send_and_wait(cdns_ctrl, thread_nr);
|
||||
|
||||
@ -1360,7 +1359,7 @@ static int cadence_nand_erase(struct nand_chip *chip, u32 page)
|
||||
|
||||
cadence_nand_cdma_desc_prepare(cdns_ctrl,
|
||||
cdns_chip->cs[chip->cur_cs],
|
||||
page, NULL, NULL,
|
||||
page, 0, 0,
|
||||
CDMA_CT_ERASE);
|
||||
status = cadence_nand_cdma_send_and_wait(cdns_ctrl, thread_nr);
|
||||
if (status) {
|
||||
|
@ -37,6 +37,7 @@
|
||||
/* Max ECC buffer length */
|
||||
#define FMC2_MAX_ECC_BUF_LEN (FMC2_BCHDSRS_LEN * FMC2_MAX_SG)
|
||||
|
||||
#define FMC2_TIMEOUT_US 1000
|
||||
#define FMC2_TIMEOUT_MS 1000
|
||||
|
||||
/* Timings */
|
||||
@ -53,6 +54,8 @@
|
||||
#define FMC2_PMEM 0x88
|
||||
#define FMC2_PATT 0x8c
|
||||
#define FMC2_HECCR 0x94
|
||||
#define FMC2_ISR 0x184
|
||||
#define FMC2_ICR 0x188
|
||||
#define FMC2_CSQCR 0x200
|
||||
#define FMC2_CSQCFGR1 0x204
|
||||
#define FMC2_CSQCFGR2 0x208
|
||||
@ -118,6 +121,12 @@
|
||||
#define FMC2_PATT_ATTHIZ(x) (((x) & 0xff) << 24)
|
||||
#define FMC2_PATT_DEFAULT 0x0a0a0a0a
|
||||
|
||||
/* Register: FMC2_ISR */
|
||||
#define FMC2_ISR_IHLF BIT(1)
|
||||
|
||||
/* Register: FMC2_ICR */
|
||||
#define FMC2_ICR_CIHLF BIT(1)
|
||||
|
||||
/* Register: FMC2_CSQCR */
|
||||
#define FMC2_CSQCR_CSQSTART BIT(0)
|
||||
|
||||
@ -1322,6 +1331,31 @@ static void stm32_fmc2_write_data(struct nand_chip *chip, const void *buf,
|
||||
stm32_fmc2_set_buswidth_16(fmc2, true);
|
||||
}
|
||||
|
||||
static int stm32_fmc2_waitrdy(struct nand_chip *chip, unsigned long timeout_ms)
|
||||
{
|
||||
struct stm32_fmc2_nfc *fmc2 = to_stm32_nfc(chip->controller);
|
||||
const struct nand_sdr_timings *timings;
|
||||
u32 isr, sr;
|
||||
|
||||
/* Check if there is no pending requests to the NAND flash */
|
||||
if (readl_relaxed_poll_timeout_atomic(fmc2->io_base + FMC2_SR, sr,
|
||||
sr & FMC2_SR_NWRF, 1,
|
||||
FMC2_TIMEOUT_US))
|
||||
dev_warn(fmc2->dev, "Waitrdy timeout\n");
|
||||
|
||||
/* Wait tWB before R/B# signal is low */
|
||||
timings = nand_get_sdr_timings(&chip->data_interface);
|
||||
ndelay(PSEC_TO_NSEC(timings->tWB_max));
|
||||
|
||||
/* R/B# signal is low, clear high level flag */
|
||||
writel_relaxed(FMC2_ICR_CIHLF, fmc2->io_base + FMC2_ICR);
|
||||
|
||||
/* Wait R/B# signal is high */
|
||||
return readl_relaxed_poll_timeout_atomic(fmc2->io_base + FMC2_ISR,
|
||||
isr, isr & FMC2_ISR_IHLF,
|
||||
5, 1000 * timeout_ms);
|
||||
}
|
||||
|
||||
static int stm32_fmc2_exec_op(struct nand_chip *chip,
|
||||
const struct nand_operation *op,
|
||||
bool check_only)
|
||||
@ -1366,8 +1400,8 @@ static int stm32_fmc2_exec_op(struct nand_chip *chip,
|
||||
break;
|
||||
|
||||
case NAND_OP_WAITRDY_INSTR:
|
||||
ret = nand_soft_waitrdy(chip,
|
||||
instr->ctx.waitrdy.timeout_ms);
|
||||
ret = stm32_fmc2_waitrdy(chip,
|
||||
instr->ctx.waitrdy.timeout_ms);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -247,7 +247,8 @@ static int sm_read_sector(struct sm_ftl *ftl,
|
||||
|
||||
/* FTL can contain -1 entries that are by default filled with bits */
|
||||
if (block == -1) {
|
||||
memset(buffer, 0xFF, SM_SECTOR_SIZE);
|
||||
if (buffer)
|
||||
memset(buffer, 0xFF, SM_SECTOR_SIZE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -4596,6 +4596,7 @@ static void sst_set_default_init(struct spi_nor *nor)
|
||||
static void st_micron_set_default_init(struct spi_nor *nor)
|
||||
{
|
||||
nor->flags |= SNOR_F_HAS_LOCK;
|
||||
nor->flags &= ~SNOR_F_HAS_16BIT_SR;
|
||||
nor->params.quad_enable = NULL;
|
||||
nor->params.set_4byte = st_micron_set_4byte;
|
||||
}
|
||||
|
@ -102,6 +102,7 @@
|
||||
#define TCAN4X5X_MODE_NORMAL BIT(7)
|
||||
|
||||
#define TCAN4X5X_DISABLE_WAKE_MSK (BIT(31) | BIT(30))
|
||||
#define TCAN4X5X_DISABLE_INH_MSK BIT(9)
|
||||
|
||||
#define TCAN4X5X_SW_RESET BIT(2)
|
||||
|
||||
@ -166,6 +167,28 @@ static void tcan4x5x_check_wake(struct tcan4x5x_priv *priv)
|
||||
}
|
||||
}
|
||||
|
||||
static int tcan4x5x_reset(struct tcan4x5x_priv *priv)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (priv->reset_gpio) {
|
||||
gpiod_set_value(priv->reset_gpio, 1);
|
||||
|
||||
/* tpulse_width minimum 30us */
|
||||
usleep_range(30, 100);
|
||||
gpiod_set_value(priv->reset_gpio, 0);
|
||||
} else {
|
||||
ret = regmap_write(priv->regmap, TCAN4X5X_CONFIG,
|
||||
TCAN4X5X_SW_RESET);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
usleep_range(700, 1000);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int regmap_spi_gather_write(void *context, const void *reg,
|
||||
size_t reg_len, const void *val,
|
||||
size_t val_len)
|
||||
@ -348,14 +371,23 @@ static int tcan4x5x_disable_wake(struct m_can_classdev *cdev)
|
||||
TCAN4X5X_DISABLE_WAKE_MSK, 0x00);
|
||||
}
|
||||
|
||||
static int tcan4x5x_disable_state(struct m_can_classdev *cdev)
|
||||
{
|
||||
struct tcan4x5x_priv *tcan4x5x = cdev->device_data;
|
||||
|
||||
return regmap_update_bits(tcan4x5x->regmap, TCAN4X5X_CONFIG,
|
||||
TCAN4X5X_DISABLE_INH_MSK, 0x01);
|
||||
}
|
||||
|
||||
static int tcan4x5x_parse_config(struct m_can_classdev *cdev)
|
||||
{
|
||||
struct tcan4x5x_priv *tcan4x5x = cdev->device_data;
|
||||
int ret;
|
||||
|
||||
tcan4x5x->device_wake_gpio = devm_gpiod_get(cdev->dev, "device-wake",
|
||||
GPIOD_OUT_HIGH);
|
||||
if (IS_ERR(tcan4x5x->device_wake_gpio)) {
|
||||
if (PTR_ERR(tcan4x5x->power) == -EPROBE_DEFER)
|
||||
if (PTR_ERR(tcan4x5x->device_wake_gpio) == -EPROBE_DEFER)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
tcan4x5x_disable_wake(cdev);
|
||||
@ -366,18 +398,17 @@ static int tcan4x5x_parse_config(struct m_can_classdev *cdev)
|
||||
if (IS_ERR(tcan4x5x->reset_gpio))
|
||||
tcan4x5x->reset_gpio = NULL;
|
||||
|
||||
usleep_range(700, 1000);
|
||||
ret = tcan4x5x_reset(tcan4x5x);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
tcan4x5x->device_state_gpio = devm_gpiod_get_optional(cdev->dev,
|
||||
"device-state",
|
||||
GPIOD_IN);
|
||||
if (IS_ERR(tcan4x5x->device_state_gpio))
|
||||
if (IS_ERR(tcan4x5x->device_state_gpio)) {
|
||||
tcan4x5x->device_state_gpio = NULL;
|
||||
|
||||
tcan4x5x->power = devm_regulator_get_optional(cdev->dev,
|
||||
"vsup");
|
||||
if (PTR_ERR(tcan4x5x->power) == -EPROBE_DEFER)
|
||||
return -EPROBE_DEFER;
|
||||
tcan4x5x_disable_state(cdev);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -412,6 +443,12 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
||||
priv->power = devm_regulator_get_optional(&spi->dev, "vsup");
|
||||
if (PTR_ERR(priv->power) == -EPROBE_DEFER)
|
||||
return -EPROBE_DEFER;
|
||||
else
|
||||
priv->power = NULL;
|
||||
|
||||
mcan_class->device_data = priv;
|
||||
|
||||
m_can_class_get_clocks(mcan_class);
|
||||
@ -451,11 +488,17 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
|
||||
priv->regmap = devm_regmap_init(&spi->dev, &tcan4x5x_bus,
|
||||
&spi->dev, &tcan4x5x_regmap);
|
||||
|
||||
ret = tcan4x5x_parse_config(mcan_class);
|
||||
ret = tcan4x5x_power_enable(priv->power, 1);
|
||||
if (ret)
|
||||
goto out_clk;
|
||||
|
||||
tcan4x5x_power_enable(priv->power, 1);
|
||||
ret = tcan4x5x_parse_config(mcan_class);
|
||||
if (ret)
|
||||
goto out_power;
|
||||
|
||||
ret = tcan4x5x_init(mcan_class);
|
||||
if (ret)
|
||||
goto out_power;
|
||||
|
||||
ret = m_can_class_register(mcan_class);
|
||||
if (ret)
|
||||
|
@ -381,13 +381,12 @@ static int mscan_rx_poll(struct napi_struct *napi, int quota)
|
||||
struct net_device *dev = napi->dev;
|
||||
struct mscan_regs __iomem *regs = priv->reg_base;
|
||||
struct net_device_stats *stats = &dev->stats;
|
||||
int npackets = 0;
|
||||
int ret = 1;
|
||||
int work_done = 0;
|
||||
struct sk_buff *skb;
|
||||
struct can_frame *frame;
|
||||
u8 canrflg;
|
||||
|
||||
while (npackets < quota) {
|
||||
while (work_done < quota) {
|
||||
canrflg = in_8(®s->canrflg);
|
||||
if (!(canrflg & (MSCAN_RXF | MSCAN_ERR_IF)))
|
||||
break;
|
||||
@ -408,18 +407,18 @@ static int mscan_rx_poll(struct napi_struct *napi, int quota)
|
||||
|
||||
stats->rx_packets++;
|
||||
stats->rx_bytes += frame->can_dlc;
|
||||
npackets++;
|
||||
work_done++;
|
||||
netif_receive_skb(skb);
|
||||
}
|
||||
|
||||
if (!(in_8(®s->canrflg) & (MSCAN_RXF | MSCAN_ERR_IF))) {
|
||||
napi_complete(&priv->napi);
|
||||
clear_bit(F_RX_PROGRESS, &priv->flags);
|
||||
if (priv->can.state < CAN_STATE_BUS_OFF)
|
||||
out_8(®s->canrier, priv->shadow_canrier);
|
||||
ret = 0;
|
||||
if (work_done < quota) {
|
||||
if (likely(napi_complete_done(&priv->napi, work_done))) {
|
||||
clear_bit(F_RX_PROGRESS, &priv->flags);
|
||||
if (priv->can.state < CAN_STATE_BUS_OFF)
|
||||
out_8(®s->canrier, priv->shadow_canrier);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
return work_done;
|
||||
}
|
||||
|
||||
static irqreturn_t mscan_isr(int irq, void *dev_id)
|
||||
|
@ -918,7 +918,7 @@ static int gs_usb_probe(struct usb_interface *intf,
|
||||
GS_USB_BREQ_HOST_FORMAT,
|
||||
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
|
||||
1,
|
||||
intf->altsetting[0].desc.bInterfaceNumber,
|
||||
intf->cur_altsetting->desc.bInterfaceNumber,
|
||||
hconf,
|
||||
sizeof(*hconf),
|
||||
1000);
|
||||
@ -941,7 +941,7 @@ static int gs_usb_probe(struct usb_interface *intf,
|
||||
GS_USB_BREQ_DEVICE_CONFIG,
|
||||
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
|
||||
1,
|
||||
intf->altsetting[0].desc.bInterfaceNumber,
|
||||
intf->cur_altsetting->desc.bInterfaceNumber,
|
||||
dconf,
|
||||
sizeof(*dconf),
|
||||
1000);
|
||||
|
@ -1590,7 +1590,7 @@ static int kvaser_usb_hydra_setup_endpoints(struct kvaser_usb *dev)
|
||||
struct usb_endpoint_descriptor *ep;
|
||||
int i;
|
||||
|
||||
iface_desc = &dev->intf->altsetting[0];
|
||||
iface_desc = dev->intf->cur_altsetting;
|
||||
|
||||
for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
|
||||
ep = &iface_desc->endpoint[i].desc;
|
||||
|
@ -1310,7 +1310,7 @@ static int kvaser_usb_leaf_setup_endpoints(struct kvaser_usb *dev)
|
||||
struct usb_endpoint_descriptor *endpoint;
|
||||
int i;
|
||||
|
||||
iface_desc = &dev->intf->altsetting[0];
|
||||
iface_desc = dev->intf->cur_altsetting;
|
||||
|
||||
for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
|
||||
endpoint = &iface_desc->endpoint[i].desc;
|
||||
|
@ -360,6 +360,11 @@ int mv88e6390_g1_set_cpu_port(struct mv88e6xxx_chip *chip, int port)
|
||||
{
|
||||
u16 ptr = MV88E6390_G1_MONITOR_MGMT_CTL_PTR_CPU_DEST;
|
||||
|
||||
/* Use the default high priority for management frames sent to
|
||||
* the CPU.
|
||||
*/
|
||||
port |= MV88E6390_G1_MONITOR_MGMT_CTL_PTR_CPU_DEST_MGMTPRI;
|
||||
|
||||
return mv88e6390_g1_monitor_write(chip, ptr, port);
|
||||
}
|
||||
|
||||
|
@ -211,6 +211,7 @@
|
||||
#define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_INGRESS_DEST 0x2000
|
||||
#define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_EGRESS_DEST 0x2100
|
||||
#define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_CPU_DEST 0x3000
|
||||
#define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_CPU_DEST_MGMTPRI 0x00e0
|
||||
#define MV88E6390_G1_MONITOR_MGMT_CTL_DATA_MASK 0x00ff
|
||||
|
||||
/* Offset 0x1C: Global Control 2 */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user