Merge 5.10.217 into android12-5.10-lts

Changes in 5.10.217
	dmaengine: pl330: issue_pending waits until WFP state
	dmaengine: Revert "dmaengine: pl330: issue_pending waits until WFP state"
	wifi: nl80211: don't free NULL coalescing rule
	eeprom: at24: Use dev_err_probe for nvmem register failure
	eeprom: at24: Probe for DDR3 thermal sensor in the SPD case
	eeprom: at24: fix memory corruption race condition
	pinctrl: pinctrl-aspeed-g6: Fix register offset for pinconf of GPIOR-T
	pinctrl/meson: fix typo in PDM's pin name
	pinctrl: core: delete incorrect free in pinctrl_enable()
	pinctrl: mediatek: paris: Rework mtk_pinconf_{get,set} switch/case logic
	pinctrl: mediatek: paris: Fix PIN_CONFIG_INPUT_SCHMITT_ENABLE readback
	pinctrl: mediatek: paris: Rework support for PIN_CONFIG_{INPUT,OUTPUT}_ENABLE
	sunrpc: add a struct rpc_stats arg to rpc_create_args
	nfs: expose /proc/net/sunrpc/nfs in net namespaces
	nfs: make the rpc_stat per net namespace
	nfs: Handle error of rpc_proc_register() in nfs_net_init().
	power: rt9455: hide unused rt9455_boost_voltage_values
	pinctrl: devicetree: fix refcount leak in pinctrl_dt_to_map()
	regulator: mt6360: De-capitalize devicetree regulator subnodes
	s390/mm: Fix storage key clearing for guest huge pages
	s390/mm: Fix clearing storage keys for huge pages
	bna: ensure the copied buf is NUL terminated
	octeontx2-af: avoid off-by-one read from userspace
	nsh: Restore skb->{protocol,data,mac_header} for outer header in nsh_gso_segment().
	net l2tp: drop flow hash on forward
	s390/vdso: Add CFI for RA register to asm macro vdso_func
	net: qede: sanitize 'rc' in qede_add_tc_flower_fltr()
	net: qede: use return from qede_parse_flow_attr() for flower
	net: qede: use return from qede_parse_flow_attr() for flow_spec
	net: qede: use return from qede_parse_actions()
	ASoC: Fix 7/8 spaces indentation in Kconfig
	ASoC: meson: cards: select SND_DYNAMIC_MINORS
	cxgb4: Properly lock TX queue for the selftest.
	net: dsa: mv88e6xxx: Fix number of databases for 88E6141 / 88E6341
	net: bridge: fix multicast-to-unicast with fraglist GSO
	net: core: reject skb_copy(_expand) for fraglist GSO skbs
	tipc: fix a possible memleak in tipc_buf_append
	net: gro: add flush check in udp_gro_receive_segment
	clk: sunxi-ng: h6: Reparent CPUX during PLL CPUX rate change
	KVM: arm64: vgic-v2: Use cpuid from userspace as vcpu_id
	KVM: arm64: vgic-v2: Check for non-NULL vCPU in vgic_v2_parse_attr()
	scsi: lpfc: Update lpfc_ramp_down_queue_handler() logic
	gfs2: Fix invalid metadata access in punch_hole
	wifi: mac80211: fix ieee80211_bss_*_flags kernel-doc
	wifi: cfg80211: fix rdev_dump_mpp() arguments order
	net: mark racy access on sk->sk_rcvbuf
	scsi: bnx2fc: Remove spin_lock_bh while releasing resources after upload
	btrfs: return accurate error code on open failure in open_fs_devices()
	ALSA: line6: Zero-initialize message buffers
	net: bcmgenet: Reset RBUF on first open
	ata: sata_gemini: Check clk_enable() result
	firewire: ohci: mask bus reset interrupts between ISR and bottom half
	tools/power turbostat: Fix added raw MSR output
	tools/power turbostat: Fix Bzy_MHz documentation typo
	btrfs: make btrfs_clear_delalloc_extent() free delalloc reserve
	btrfs: always clear PERTRANS metadata during commit
	scsi: target: Fix SELinux error when systemd-modules loads the target module
	blk-iocost: avoid out of bounds shift
	gpu: host1x: Do not setup DMA for virtual devices
	MIPS: scall: Save thread_info.syscall unconditionally on entry
	selftests: timers: Fix valid-adjtimex signed left-shift undefined behavior
	fs/9p: only translate RWX permissions for plain 9P2000
	fs/9p: translate O_TRUNC into OTRUNC
	9p: explicitly deny setlease attempts
	gpio: wcove: Use -ENOTSUPP consistently
	gpio: crystalcove: Use -ENOTSUPP consistently
	clk: Don't hold prepare_lock when calling kref_put()
	fs/9p: drop inodes immediately on non-.L too
	drm/nouveau/dp: Don't probe eDP ports twice harder
	net:usb:qmi_wwan: support Rolling modules
	xfrm: Preserve vlan tags for transport mode software GRO
	tcp: defer shutdown(SEND_SHUTDOWN) for TCP_SYN_RECV sockets
	tcp: Use refcount_inc_not_zero() in tcp_twsk_unique().
	Bluetooth: Fix use-after-free bugs caused by sco_sock_timeout
	Bluetooth: l2cap: fix null-ptr-deref in l2cap_chan_timeout
	rtnetlink: Correct nested IFLA_VF_VLAN_LIST attribute validation
	hwmon: (corsair-cpro) Use a separate buffer for sending commands
	hwmon: (corsair-cpro) Use complete_all() instead of complete() in ccp_raw_event()
	hwmon: (corsair-cpro) Protect ccp->wait_input_report with a spinlock
	phonet: fix rtm_phonet_notify() skb allocation
	kcov: Remove kcov include from sched.h and move it to its users.
	net: bridge: fix corrupted ethernet header on multicast-to-unicast
	ipv6: fib6_rules: avoid possible NULL dereference in fib6_rule_action()
	net: hns3: use appropriate barrier function after setting a bit value
	btrfs: fix kvcalloc() arguments order in btrfs_ioctl_send()
	firewire: nosy: ensure user_length is taken into account when fetching packet contents
	arm64: dts: qcom: Fix 'interrupt-map' parent address cells
	usb: typec: ucsi: Check for notifications after init
	usb: typec: ucsi: Fix connector check on init
	usb: Fix regression caused by invalid ep0 maxpacket in virtual SuperSpeed device
	usb: ohci: Prevent missed ohci interrupts
	usb: gadget: composite: fix OS descriptors w_value logic
	usb: gadget: f_fs: Fix a race condition when processing setup packets.
	usb: xhci-plat: Don't include xhci.h
	usb: dwc3: core: Prevent phy suspend during init
	ALSA: hda/realtek: Fix mute led of HP Laptop 15-da3001TU
	iio:imu: adis16475: Fix sync mode setting
	iio: accel: mxc4005: Interrupt handling fixes
	tipc: fix UAF in error path
	net: bcmgenet: synchronize use of bcmgenet_set_rx_mode()
	ASoC: tegra: Fix DSPK 16-bit playback
	dyndbg: fix old BUG_ON in >control parser
	mei: me: add lunar lake point M DID
	drm/vmwgfx: Fix invalid reads in fence signaled events
	net: fix out-of-bounds access in ops_init
	hwmon: (pmbus/ucd9000) Increase delay from 250 to 500us
	regulator: core: fix debugfs creation regression
	keys: Fix overwrite of key expiration on instantiation
	md: fix kmemleak of rdev->serial
	Linux 5.10.217

Change-Id: I63eef00187948953d29febc26cc4c2c30166f7aa
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2024-06-13 16:14:25 +00:00
commit dde5ece421
121 changed files with 720 additions and 472 deletions

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
VERSION = 5 VERSION = 5
PATCHLEVEL = 10 PATCHLEVEL = 10
SUBLEVEL = 216 SUBLEVEL = 217
EXTRAVERSION = EXTRAVERSION =
NAME = Dare mighty things NAME = Dare mighty things

View File

@ -949,10 +949,10 @@ pcie0: pci@1c00000 {
interrupts = <GIC_SPI 405 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 405 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "msi"; interrupt-names = "msi";
interrupt-map-mask = <0 0 0 0x7>; interrupt-map-mask = <0 0 0 0x7>;
interrupt-map = <0 0 0 1 &intc 0 135 IRQ_TYPE_LEVEL_HIGH>, interrupt-map = <0 0 0 1 &intc 0 0 135 IRQ_TYPE_LEVEL_HIGH>,
<0 0 0 2 &intc 0 136 IRQ_TYPE_LEVEL_HIGH>, <0 0 0 2 &intc 0 0 136 IRQ_TYPE_LEVEL_HIGH>,
<0 0 0 3 &intc 0 138 IRQ_TYPE_LEVEL_HIGH>, <0 0 0 3 &intc 0 0 138 IRQ_TYPE_LEVEL_HIGH>,
<0 0 0 4 &intc 0 139 IRQ_TYPE_LEVEL_HIGH>; <0 0 0 4 &intc 0 0 139 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&gcc GCC_PCIE_0_PIPE_CLK>, clocks = <&gcc GCC_PCIE_0_PIPE_CLK>,
<&gcc GCC_PCIE_0_MSTR_AXI_CLK>, <&gcc GCC_PCIE_0_MSTR_AXI_CLK>,

View File

@ -1824,10 +1824,10 @@ pcie0: pci@1c00000 {
interrupt-names = "msi"; interrupt-names = "msi";
#interrupt-cells = <1>; #interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0x7>; interrupt-map-mask = <0 0 0 0x7>;
interrupt-map = <0 0 0 1 &intc 0 149 IRQ_TYPE_LEVEL_HIGH>, /* int_a */ interrupt-map = <0 0 0 1 &intc 0 0 0 149 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
<0 0 0 2 &intc 0 150 IRQ_TYPE_LEVEL_HIGH>, /* int_b */ <0 0 0 2 &intc 0 0 0 150 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
<0 0 0 3 &intc 0 151 IRQ_TYPE_LEVEL_HIGH>, /* int_c */ <0 0 0 3 &intc 0 0 0 151 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
<0 0 0 4 &intc 0 152 IRQ_TYPE_LEVEL_HIGH>; /* int_d */ <0 0 0 4 &intc 0 0 0 152 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
clocks = <&gcc GCC_PCIE_0_PIPE_CLK>, clocks = <&gcc GCC_PCIE_0_PIPE_CLK>,
<&gcc GCC_PCIE_0_AUX_CLK>, <&gcc GCC_PCIE_0_AUX_CLK>,
@ -1928,10 +1928,10 @@ pcie1: pci@1c08000 {
interrupt-names = "msi"; interrupt-names = "msi";
#interrupt-cells = <1>; #interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0x7>; interrupt-map-mask = <0 0 0 0x7>;
interrupt-map = <0 0 0 1 &intc 0 434 IRQ_TYPE_LEVEL_HIGH>, /* int_a */ interrupt-map = <0 0 0 1 &intc 0 0 0 434 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
<0 0 0 2 &intc 0 435 IRQ_TYPE_LEVEL_HIGH>, /* int_b */ <0 0 0 2 &intc 0 0 0 435 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
<0 0 0 3 &intc 0 438 IRQ_TYPE_LEVEL_HIGH>, /* int_c */ <0 0 0 3 &intc 0 0 0 438 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
<0 0 0 4 &intc 0 439 IRQ_TYPE_LEVEL_HIGH>; /* int_d */ <0 0 0 4 &intc 0 0 0 439 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
clocks = <&gcc GCC_PCIE_1_PIPE_CLK>, clocks = <&gcc GCC_PCIE_1_PIPE_CLK>,
<&gcc GCC_PCIE_1_AUX_CLK>, <&gcc GCC_PCIE_1_AUX_CLK>,

View File

@ -284,16 +284,12 @@ int kvm_register_vgic_device(unsigned long type)
int vgic_v2_parse_attr(struct kvm_device *dev, struct kvm_device_attr *attr, int vgic_v2_parse_attr(struct kvm_device *dev, struct kvm_device_attr *attr,
struct vgic_reg_attr *reg_attr) struct vgic_reg_attr *reg_attr)
{ {
int cpuid; int cpuid = FIELD_GET(KVM_DEV_ARM_VGIC_CPUID_MASK, attr->attr);
cpuid = (attr->attr & KVM_DEV_ARM_VGIC_CPUID_MASK) >>
KVM_DEV_ARM_VGIC_CPUID_SHIFT;
if (cpuid >= atomic_read(&dev->kvm->online_vcpus))
return -EINVAL;
reg_attr->vcpu = kvm_get_vcpu(dev->kvm, cpuid);
reg_attr->addr = attr->attr & KVM_DEV_ARM_VGIC_OFFSET_MASK; reg_attr->addr = attr->attr & KVM_DEV_ARM_VGIC_OFFSET_MASK;
reg_attr->vcpu = kvm_get_vcpu_by_id(dev->kvm, cpuid);
if (!reg_attr->vcpu)
return -EINVAL;
return 0; return 0;
} }

View File

@ -157,7 +157,7 @@ static inline long regs_return_value(struct pt_regs *regs)
#define instruction_pointer(regs) ((regs)->cp0_epc) #define instruction_pointer(regs) ((regs)->cp0_epc)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
extern asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall); extern asmlinkage long syscall_trace_enter(struct pt_regs *regs);
extern asmlinkage void syscall_trace_leave(struct pt_regs *regs); extern asmlinkage void syscall_trace_leave(struct pt_regs *regs);
extern void die(const char *, struct pt_regs *) __noreturn; extern void die(const char *, struct pt_regs *) __noreturn;

View File

@ -100,6 +100,7 @@ void output_thread_info_defines(void)
OFFSET(TI_PRE_COUNT, thread_info, preempt_count); OFFSET(TI_PRE_COUNT, thread_info, preempt_count);
OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit); OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit);
OFFSET(TI_REGS, thread_info, regs); OFFSET(TI_REGS, thread_info, regs);
OFFSET(TI_SYSCALL, thread_info, syscall);
DEFINE(_THREAD_SIZE, THREAD_SIZE); DEFINE(_THREAD_SIZE, THREAD_SIZE);
DEFINE(_THREAD_MASK, THREAD_MASK); DEFINE(_THREAD_MASK, THREAD_MASK);
DEFINE(_IRQ_STACK_SIZE, IRQ_STACK_SIZE); DEFINE(_IRQ_STACK_SIZE, IRQ_STACK_SIZE);

View File

@ -1310,16 +1310,13 @@ long arch_ptrace(struct task_struct *child, long request,
* Notification of system call entry/exit * Notification of system call entry/exit
* - triggered by current->work.syscall_trace * - triggered by current->work.syscall_trace
*/ */
asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall) asmlinkage long syscall_trace_enter(struct pt_regs *regs)
{ {
user_exit(); user_exit();
current_thread_info()->syscall = syscall;
if (test_thread_flag(TIF_SYSCALL_TRACE)) { if (test_thread_flag(TIF_SYSCALL_TRACE)) {
if (tracehook_report_syscall_entry(regs)) if (tracehook_report_syscall_entry(regs))
return -1; return -1;
syscall = current_thread_info()->syscall;
} }
#ifdef CONFIG_SECCOMP #ifdef CONFIG_SECCOMP
@ -1328,7 +1325,7 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
struct seccomp_data sd; struct seccomp_data sd;
unsigned long args[6]; unsigned long args[6];
sd.nr = syscall; sd.nr = current_thread_info()->syscall;
sd.arch = syscall_get_arch(current); sd.arch = syscall_get_arch(current);
syscall_get_arguments(current, regs, args); syscall_get_arguments(current, regs, args);
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
@ -1338,23 +1335,23 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
ret = __secure_computing(&sd); ret = __secure_computing(&sd);
if (ret == -1) if (ret == -1)
return ret; return ret;
syscall = current_thread_info()->syscall;
} }
#endif #endif
if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
trace_sys_enter(regs, regs->regs[2]); trace_sys_enter(regs, regs->regs[2]);
audit_syscall_entry(syscall, regs->regs[4], regs->regs[5], audit_syscall_entry(current_thread_info()->syscall,
regs->regs[4], regs->regs[5],
regs->regs[6], regs->regs[7]); regs->regs[6], regs->regs[7]);
/* /*
* Negative syscall numbers are mistaken for rejected syscalls, but * Negative syscall numbers are mistaken for rejected syscalls, but
* won't have had the return value set appropriately, so we do so now. * won't have had the return value set appropriately, so we do so now.
*/ */
if (syscall < 0) if (current_thread_info()->syscall < 0)
syscall_set_return_value(current, regs, -ENOSYS, 0); syscall_set_return_value(current, regs, -ENOSYS, 0);
return syscall; return current_thread_info()->syscall;
} }
/* /*

View File

@ -80,6 +80,18 @@ loads_done:
PTR load_a7, bad_stack_a7 PTR load_a7, bad_stack_a7
.previous .previous
/*
* syscall number is in v0 unless we called syscall(__NR_###)
* where the real syscall number is in a0
*/
subu t2, v0, __NR_O32_Linux
bnez t2, 1f /* __NR_syscall at offset 0 */
LONG_S a0, TI_SYSCALL($28) # Save a0 as syscall number
b 2f
1:
LONG_S v0, TI_SYSCALL($28) # Save v0 as syscall number
2:
lw t0, TI_FLAGS($28) # syscall tracing enabled? lw t0, TI_FLAGS($28) # syscall tracing enabled?
li t1, _TIF_WORK_SYSCALL_ENTRY li t1, _TIF_WORK_SYSCALL_ENTRY
and t0, t1 and t0, t1
@ -117,16 +129,7 @@ syscall_trace_entry:
SAVE_STATIC SAVE_STATIC
move a0, sp move a0, sp
/* jal syscall_trace_enter
* syscall number is in v0 unless we called syscall(__NR_###)
* where the real syscall number is in a0
*/
move a1, v0
subu t2, v0, __NR_O32_Linux
bnez t2, 1f /* __NR_syscall at offset 0 */
lw a1, PT_R4(sp)
1: jal syscall_trace_enter
bltz v0, 1f # seccomp failed? Skip syscall bltz v0, 1f # seccomp failed? Skip syscall

View File

@ -44,6 +44,8 @@ NESTED(handle_sysn32, PT_SIZE, sp)
sd a3, PT_R26(sp) # save a3 for syscall restarting sd a3, PT_R26(sp) # save a3 for syscall restarting
LONG_S v0, TI_SYSCALL($28) # Store syscall number
li t1, _TIF_WORK_SYSCALL_ENTRY li t1, _TIF_WORK_SYSCALL_ENTRY
LONG_L t0, TI_FLAGS($28) # syscall tracing enabled? LONG_L t0, TI_FLAGS($28) # syscall tracing enabled?
and t0, t1, t0 and t0, t1, t0
@ -72,7 +74,6 @@ syscall_common:
n32_syscall_trace_entry: n32_syscall_trace_entry:
SAVE_STATIC SAVE_STATIC
move a0, sp move a0, sp
move a1, v0
jal syscall_trace_enter jal syscall_trace_enter
bltz v0, 1f # seccomp failed? Skip syscall bltz v0, 1f # seccomp failed? Skip syscall

View File

@ -47,6 +47,8 @@ NESTED(handle_sys64, PT_SIZE, sp)
sd a3, PT_R26(sp) # save a3 for syscall restarting sd a3, PT_R26(sp) # save a3 for syscall restarting
LONG_S v0, TI_SYSCALL($28) # Store syscall number
li t1, _TIF_WORK_SYSCALL_ENTRY li t1, _TIF_WORK_SYSCALL_ENTRY
LONG_L t0, TI_FLAGS($28) # syscall tracing enabled? LONG_L t0, TI_FLAGS($28) # syscall tracing enabled?
and t0, t1, t0 and t0, t1, t0
@ -83,7 +85,6 @@ n64_syscall_exit:
syscall_trace_entry: syscall_trace_entry:
SAVE_STATIC SAVE_STATIC
move a0, sp move a0, sp
move a1, v0
jal syscall_trace_enter jal syscall_trace_enter
bltz v0, 1f # seccomp failed? Skip syscall bltz v0, 1f # seccomp failed? Skip syscall

View File

@ -79,6 +79,22 @@ loads_done:
PTR load_a7, bad_stack_a7 PTR load_a7, bad_stack_a7
.previous .previous
/*
* absolute syscall number is in v0 unless we called syscall(__NR_###)
* where the real syscall number is in a0
* note: NR_syscall is the first O32 syscall but the macro is
* only defined when compiling with -mabi=32 (CONFIG_32BIT)
* therefore __NR_O32_Linux is used (4000)
*/
subu t2, v0, __NR_O32_Linux
bnez t2, 1f /* __NR_syscall at offset 0 */
LONG_S a0, TI_SYSCALL($28) # Save a0 as syscall number
b 2f
1:
LONG_S v0, TI_SYSCALL($28) # Save v0 as syscall number
2:
li t1, _TIF_WORK_SYSCALL_ENTRY li t1, _TIF_WORK_SYSCALL_ENTRY
LONG_L t0, TI_FLAGS($28) # syscall tracing enabled? LONG_L t0, TI_FLAGS($28) # syscall tracing enabled?
and t0, t1, t0 and t0, t1, t0
@ -113,22 +129,7 @@ trace_a_syscall:
sd a7, PT_R11(sp) # For indirect syscalls sd a7, PT_R11(sp) # For indirect syscalls
move a0, sp move a0, sp
/* jal syscall_trace_enter
* absolute syscall number is in v0 unless we called syscall(__NR_###)
* where the real syscall number is in a0
* note: NR_syscall is the first O32 syscall but the macro is
* only defined when compiling with -mabi=32 (CONFIG_32BIT)
* therefore __NR_O32_Linux is used (4000)
*/
.set push
.set reorder
subu t1, v0, __NR_O32_Linux
move a1, v0
bnez t1, 1f /* __NR_syscall at offset 0 */
ld a1, PT_R4(sp) /* Arg1 for __NR_syscall case */
.set pop
1: jal syscall_trace_enter
bltz v0, 1f # seccomp failed? Skip syscall bltz v0, 1f # seccomp failed? Skip syscall

View File

@ -9,6 +9,7 @@
#define CFI_DEF_CFA_OFFSET .cfi_def_cfa_offset #define CFI_DEF_CFA_OFFSET .cfi_def_cfa_offset
#define CFI_ADJUST_CFA_OFFSET .cfi_adjust_cfa_offset #define CFI_ADJUST_CFA_OFFSET .cfi_adjust_cfa_offset
#define CFI_RESTORE .cfi_restore #define CFI_RESTORE .cfi_restore
#define CFI_REL_OFFSET .cfi_rel_offset
#ifdef CONFIG_AS_CFI_VAL_OFFSET #ifdef CONFIG_AS_CFI_VAL_OFFSET
#define CFI_VAL_OFFSET .cfi_val_offset #define CFI_VAL_OFFSET .cfi_val_offset

View File

@ -23,8 +23,10 @@ __kernel_\func:
CFI_DEF_CFA_OFFSET (STACK_FRAME_OVERHEAD + WRAPPER_FRAME_SIZE) CFI_DEF_CFA_OFFSET (STACK_FRAME_OVERHEAD + WRAPPER_FRAME_SIZE)
CFI_VAL_OFFSET 15, -STACK_FRAME_OVERHEAD CFI_VAL_OFFSET 15, -STACK_FRAME_OVERHEAD
stg %r14,STACK_FRAME_OVERHEAD(%r15) stg %r14,STACK_FRAME_OVERHEAD(%r15)
CFI_REL_OFFSET 14, STACK_FRAME_OVERHEAD
brasl %r14,__s390_vdso_\func brasl %r14,__s390_vdso_\func
lg %r14,STACK_FRAME_OVERHEAD(%r15) lg %r14,STACK_FRAME_OVERHEAD(%r15)
CFI_RESTORE 14
aghi %r15,WRAPPER_FRAME_SIZE aghi %r15,WRAPPER_FRAME_SIZE
CFI_DEF_CFA_OFFSET STACK_FRAME_OVERHEAD CFI_DEF_CFA_OFFSET STACK_FRAME_OVERHEAD
CFI_RESTORE 15 CFI_RESTORE 15

View File

@ -2627,7 +2627,7 @@ static int __s390_enable_skey_hugetlb(pte_t *pte, unsigned long addr,
return 0; return 0;
start = pmd_val(*pmd) & HPAGE_MASK; start = pmd_val(*pmd) & HPAGE_MASK;
end = start + HPAGE_SIZE - 1; end = start + HPAGE_SIZE;
__storage_key_init_range(start, end); __storage_key_init_range(start, end);
set_bit(PG_arch_1, &page->flags); set_bit(PG_arch_1, &page->flags);
cond_resched(); cond_resched();

View File

@ -146,7 +146,7 @@ static void clear_huge_pte_skeys(struct mm_struct *mm, unsigned long rste)
} }
if (!test_and_set_bit(PG_arch_1, &page->flags)) if (!test_and_set_bit(PG_arch_1, &page->flags))
__storage_key_init_range(paddr, paddr + size - 1); __storage_key_init_range(paddr, paddr + size);
} }
void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,

View File

@ -1290,7 +1290,7 @@ static bool iocg_kick_delay(struct ioc_gq *iocg, struct ioc_now *now)
{ {
struct ioc *ioc = iocg->ioc; struct ioc *ioc = iocg->ioc;
struct blkcg_gq *blkg = iocg_to_blkg(iocg); struct blkcg_gq *blkg = iocg_to_blkg(iocg);
u64 tdelta, delay, new_delay; u64 tdelta, delay, new_delay, shift;
s64 vover, vover_pct; s64 vover, vover_pct;
u32 hwa; u32 hwa;
@ -1305,8 +1305,9 @@ static bool iocg_kick_delay(struct ioc_gq *iocg, struct ioc_now *now)
/* calculate the current delay in effect - 1/2 every second */ /* calculate the current delay in effect - 1/2 every second */
tdelta = now->now - iocg->delay_at; tdelta = now->now - iocg->delay_at;
if (iocg->delay) shift = div64_u64(tdelta, USEC_PER_SEC);
delay = iocg->delay >> div64_u64(tdelta, USEC_PER_SEC); if (iocg->delay && shift < BITS_PER_LONG)
delay = iocg->delay >> shift;
else else
delay = 0; delay = 0;

View File

@ -201,7 +201,10 @@ int gemini_sata_start_bridge(struct sata_gemini *sg, unsigned int bridge)
pclk = sg->sata0_pclk; pclk = sg->sata0_pclk;
else else
pclk = sg->sata1_pclk; pclk = sg->sata1_pclk;
clk_enable(pclk); ret = clk_enable(pclk);
if (ret)
return ret;
msleep(10); msleep(10);
/* Do not keep clocking a bridge that is not online */ /* Do not keep clocking a bridge that is not online */

View File

@ -4288,7 +4288,8 @@ void clk_unregister(struct clk *clk)
if (ops == &clk_nodrv_ops) { if (ops == &clk_nodrv_ops) {
pr_err("%s: unregistered clock: %s\n", __func__, pr_err("%s: unregistered clock: %s\n", __func__,
clk->core->name); clk->core->name);
goto unlock; clk_prepare_unlock();
return;
} }
/* /*
* Assign empty clock ops for consumers that might still hold * Assign empty clock ops for consumers that might still hold
@ -4322,11 +4323,10 @@ void clk_unregister(struct clk *clk)
if (clk->core->protect_count) if (clk->core->protect_count)
pr_warn("%s: unregistering protected clock: %s\n", pr_warn("%s: unregistering protected clock: %s\n",
__func__, clk->core->name); __func__, clk->core->name);
clk_prepare_unlock();
kref_put(&clk->core->ref, __clk_release); kref_put(&clk->core->ref, __clk_release);
free_clk(clk); free_clk(clk);
unlock:
clk_prepare_unlock();
} }
EXPORT_SYMBOL_GPL(clk_unregister); EXPORT_SYMBOL_GPL(clk_unregister);
@ -4532,13 +4532,11 @@ void __clk_put(struct clk *clk)
clk->max_rate < clk->core->req_rate) clk->max_rate < clk->core->req_rate)
clk_core_set_rate_nolock(clk->core, clk->core->req_rate); clk_core_set_rate_nolock(clk->core, clk->core->req_rate);
owner = clk->core->owner;
kref_put(&clk->core->ref, __clk_release);
clk_prepare_unlock(); clk_prepare_unlock();
owner = clk->core->owner;
kref_put(&clk->core->ref, __clk_release);
module_put(owner); module_put(owner);
free_clk(clk); free_clk(clk);
} }

View File

@ -1181,12 +1181,19 @@ static const u32 usb2_clk_regs[] = {
SUN50I_H6_USB3_CLK_REG, SUN50I_H6_USB3_CLK_REG,
}; };
static struct ccu_mux_nb sun50i_h6_cpu_nb = {
.common = &cpux_clk.common,
.cm = &cpux_clk.mux,
.delay_us = 1,
.bypass_index = 0, /* index of 24 MHz oscillator */
};
static int sun50i_h6_ccu_probe(struct platform_device *pdev) static int sun50i_h6_ccu_probe(struct platform_device *pdev)
{ {
struct resource *res; struct resource *res;
void __iomem *reg; void __iomem *reg;
int i, ret;
u32 val; u32 val;
int i;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
reg = devm_ioremap_resource(&pdev->dev, res); reg = devm_ioremap_resource(&pdev->dev, res);
@ -1240,7 +1247,15 @@ static int sun50i_h6_ccu_probe(struct platform_device *pdev)
val |= BIT(24); val |= BIT(24);
writel(val, reg + SUN50I_H6_HDMI_CEC_CLK_REG); writel(val, reg + SUN50I_H6_HDMI_CEC_CLK_REG);
return sunxi_ccu_probe(pdev->dev.of_node, reg, &sun50i_h6_ccu_desc); ret = sunxi_ccu_probe(pdev->dev.of_node, reg, &sun50i_h6_ccu_desc);
if (ret)
return ret;
/* Reparent CPU during PLL CPUX rate changes */
ccu_mux_notifier_register(pll_cpux_clk.common.hw.clk,
&sun50i_h6_cpu_nb);
return 0;
} }
static const struct of_device_id sun50i_h6_ccu_ids[] = { static const struct of_device_id sun50i_h6_ccu_ids[] = {

View File

@ -148,10 +148,12 @@ packet_buffer_get(struct client *client, char __user *data, size_t user_length)
if (atomic_read(&buffer->size) == 0) if (atomic_read(&buffer->size) == 0)
return -ENODEV; return -ENODEV;
/* FIXME: Check length <= user_length. */ length = buffer->head->length;
if (length > user_length)
return 0;
end = buffer->data + buffer->capacity; end = buffer->data + buffer->capacity;
length = buffer->head->length;
if (&buffer->head->data[length] < end) { if (&buffer->head->data[length] < end) {
if (copy_to_user(data, buffer->head->data, length)) if (copy_to_user(data, buffer->head->data, length))

View File

@ -2049,6 +2049,8 @@ static void bus_reset_work(struct work_struct *work)
ohci->generation = generation; ohci->generation = generation;
reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset); reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset);
if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS)
reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset);
if (ohci->quirks & QUIRK_RESET_PACKET) if (ohci->quirks & QUIRK_RESET_PACKET)
ohci->request_generation = generation; ohci->request_generation = generation;
@ -2115,12 +2117,14 @@ static irqreturn_t irq_handler(int irq, void *data)
return IRQ_NONE; return IRQ_NONE;
/* /*
* busReset and postedWriteErr must not be cleared yet * busReset and postedWriteErr events must not be cleared yet
* (OHCI 1.1 clauses 7.2.3.2 and 13.2.8.1) * (OHCI 1.1 clauses 7.2.3.2 and 13.2.8.1)
*/ */
reg_write(ohci, OHCI1394_IntEventClear, reg_write(ohci, OHCI1394_IntEventClear,
event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr)); event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr));
log_irqs(ohci, event); log_irqs(ohci, event);
if (event & OHCI1394_busReset)
reg_write(ohci, OHCI1394_IntMaskClear, OHCI1394_busReset);
if (event & OHCI1394_selfIDComplete) if (event & OHCI1394_selfIDComplete)
queue_work(selfid_workqueue, &ohci->bus_reset_work); queue_work(selfid_workqueue, &ohci->bus_reset_work);

View File

@ -91,7 +91,7 @@ static inline int to_reg(int gpio, enum ctrl_register reg_type)
case 0x5e: case 0x5e:
return GPIOPANELCTL; return GPIOPANELCTL;
default: default:
return -EOPNOTSUPP; return -ENOTSUPP;
} }
} }

View File

@ -102,7 +102,7 @@ static inline int to_reg(int gpio, enum ctrl_register reg_type)
unsigned int reg; unsigned int reg;
if (gpio >= WCOVE_GPIO_NUM) if (gpio >= WCOVE_GPIO_NUM)
return -EOPNOTSUPP; return -ENOTSUPP;
if (reg_type == CTRL_IN) if (reg_type == CTRL_IN)
reg = GPIO_IN_CTRL_BASE + gpio; reg = GPIO_IN_CTRL_BASE + gpio;

View File

@ -109,12 +109,15 @@ nouveau_dp_detect(struct nouveau_connector *nv_connector,
u8 *dpcd = nv_encoder->dp.dpcd; u8 *dpcd = nv_encoder->dp.dpcd;
int ret = NOUVEAU_DP_NONE; int ret = NOUVEAU_DP_NONE;
/* If we've already read the DPCD on an eDP device, we don't need to /* eDP ports don't support hotplugging - so there's no point in probing eDP ports unless we
* reread it as it won't change * haven't probed them once before.
*/ */
if (connector->connector_type == DRM_MODE_CONNECTOR_eDP && if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
dpcd[DP_DPCD_REV] != 0) if (connector->status == connector_status_connected)
return NOUVEAU_DP_SST; return NOUVEAU_DP_SST;
else if (connector->status == connector_status_disconnected)
return NOUVEAU_DP_NONE;
}
mutex_lock(&nv_encoder->dp.hpd_irq_lock); mutex_lock(&nv_encoder->dp.hpd_irq_lock);
if (mstm) { if (mstm) {

View File

@ -1066,7 +1066,7 @@ static int vmw_event_fence_action_create(struct drm_file *file_priv,
} }
event->event.base.type = DRM_VMW_EVENT_FENCE_SIGNALED; event->event.base.type = DRM_VMW_EVENT_FENCE_SIGNALED;
event->event.base.length = sizeof(*event); event->event.base.length = sizeof(event->event);
event->event.user_data = user_data; event->event.user_data = user_data;
ret = drm_event_reserve_init(dev, file_priv, &event->base, &event->event.base); ret = drm_event_reserve_init(dev, file_priv, &event->base, &event->event.base);

View File

@ -335,11 +335,6 @@ static int host1x_device_uevent(struct device *dev,
return 0; return 0;
} }
static int host1x_dma_configure(struct device *dev)
{
return of_dma_configure(dev, dev->of_node, true);
}
static const struct dev_pm_ops host1x_device_pm_ops = { static const struct dev_pm_ops host1x_device_pm_ops = {
.suspend = pm_generic_suspend, .suspend = pm_generic_suspend,
.resume = pm_generic_resume, .resume = pm_generic_resume,
@ -353,7 +348,6 @@ struct bus_type host1x_bus_type = {
.name = "host1x", .name = "host1x",
.match = host1x_device_match, .match = host1x_device_match,
.uevent = host1x_device_uevent, .uevent = host1x_device_uevent,
.dma_configure = host1x_dma_configure,
.pm = &host1x_device_pm_ops, .pm = &host1x_device_pm_ops,
}; };
@ -442,8 +436,6 @@ static int host1x_device_add(struct host1x *host1x,
device->dev.bus = &host1x_bus_type; device->dev.bus = &host1x_bus_type;
device->dev.parent = host1x->dev; device->dev.parent = host1x->dev;
of_dma_configure(&device->dev, host1x->dev->of_node, true);
device->dev.dma_parms = &device->dma_parms; device->dev.dma_parms = &device->dma_parms;
dma_set_max_seg_size(&device->dev, UINT_MAX); dma_set_max_seg_size(&device->dev, UINT_MAX);

View File

@ -16,6 +16,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/types.h> #include <linux/types.h>
#define USB_VENDOR_ID_CORSAIR 0x1b1c #define USB_VENDOR_ID_CORSAIR 0x1b1c
@ -77,8 +78,11 @@
struct ccp_device { struct ccp_device {
struct hid_device *hdev; struct hid_device *hdev;
struct device *hwmon_dev; struct device *hwmon_dev;
/* For reinitializing the completion below */
spinlock_t wait_input_report_lock;
struct completion wait_input_report; struct completion wait_input_report;
struct mutex mutex; /* whenever buffer is used, lock before send_usb_cmd */ struct mutex mutex; /* whenever buffer is used, lock before send_usb_cmd */
u8 *cmd_buffer;
u8 *buffer; u8 *buffer;
int target[6]; int target[6];
DECLARE_BITMAP(temp_cnct, NUM_TEMP_SENSORS); DECLARE_BITMAP(temp_cnct, NUM_TEMP_SENSORS);
@ -111,15 +115,23 @@ static int send_usb_cmd(struct ccp_device *ccp, u8 command, u8 byte1, u8 byte2,
unsigned long t; unsigned long t;
int ret; int ret;
memset(ccp->buffer, 0x00, OUT_BUFFER_SIZE); memset(ccp->cmd_buffer, 0x00, OUT_BUFFER_SIZE);
ccp->buffer[0] = command; ccp->cmd_buffer[0] = command;
ccp->buffer[1] = byte1; ccp->cmd_buffer[1] = byte1;
ccp->buffer[2] = byte2; ccp->cmd_buffer[2] = byte2;
ccp->buffer[3] = byte3; ccp->cmd_buffer[3] = byte3;
/*
* Disable raw event parsing for a moment to safely reinitialize the
* completion. Reinit is done because hidraw could have triggered
* the raw event parsing and marked the ccp->wait_input_report
* completion as done.
*/
spin_lock_bh(&ccp->wait_input_report_lock);
reinit_completion(&ccp->wait_input_report); reinit_completion(&ccp->wait_input_report);
spin_unlock_bh(&ccp->wait_input_report_lock);
ret = hid_hw_output_report(ccp->hdev, ccp->buffer, OUT_BUFFER_SIZE); ret = hid_hw_output_report(ccp->hdev, ccp->cmd_buffer, OUT_BUFFER_SIZE);
if (ret < 0) if (ret < 0)
return ret; return ret;
@ -135,11 +147,12 @@ static int ccp_raw_event(struct hid_device *hdev, struct hid_report *report, u8
struct ccp_device *ccp = hid_get_drvdata(hdev); struct ccp_device *ccp = hid_get_drvdata(hdev);
/* only copy buffer when requested */ /* only copy buffer when requested */
if (completion_done(&ccp->wait_input_report)) spin_lock(&ccp->wait_input_report_lock);
return 0; if (!completion_done(&ccp->wait_input_report)) {
memcpy(ccp->buffer, data, min(IN_BUFFER_SIZE, size));
memcpy(ccp->buffer, data, min(IN_BUFFER_SIZE, size)); complete_all(&ccp->wait_input_report);
complete(&ccp->wait_input_report); }
spin_unlock(&ccp->wait_input_report_lock);
return 0; return 0;
} }
@ -491,7 +504,11 @@ static int ccp_probe(struct hid_device *hdev, const struct hid_device_id *id)
if (!ccp) if (!ccp)
return -ENOMEM; return -ENOMEM;
ccp->buffer = devm_kmalloc(&hdev->dev, OUT_BUFFER_SIZE, GFP_KERNEL); ccp->cmd_buffer = devm_kmalloc(&hdev->dev, OUT_BUFFER_SIZE, GFP_KERNEL);
if (!ccp->cmd_buffer)
return -ENOMEM;
ccp->buffer = devm_kmalloc(&hdev->dev, IN_BUFFER_SIZE, GFP_KERNEL);
if (!ccp->buffer) if (!ccp->buffer)
return -ENOMEM; return -ENOMEM;
@ -509,7 +526,9 @@ static int ccp_probe(struct hid_device *hdev, const struct hid_device_id *id)
ccp->hdev = hdev; ccp->hdev = hdev;
hid_set_drvdata(hdev, ccp); hid_set_drvdata(hdev, ccp);
mutex_init(&ccp->mutex); mutex_init(&ccp->mutex);
spin_lock_init(&ccp->wait_input_report_lock);
init_completion(&ccp->wait_input_report); init_completion(&ccp->wait_input_report);
hid_device_io_start(hdev); hid_device_io_start(hdev);

View File

@ -80,11 +80,11 @@ struct ucd9000_debugfs_entry {
* It has been observed that the UCD90320 randomly fails register access when * It has been observed that the UCD90320 randomly fails register access when
* doing another access right on the back of a register write. To mitigate this * doing another access right on the back of a register write. To mitigate this
* make sure that there is a minimum delay between a write access and the * make sure that there is a minimum delay between a write access and the
* following access. The 250us is based on experimental data. At a delay of * following access. The 500 is based on experimental data. At a delay of
* 200us the issue seems to go away. Add a bit of extra margin to allow for * 350us the issue seems to go away. Add a bit of extra margin to allow for
* system to system differences. * system to system differences.
*/ */
#define UCD90320_WAIT_DELAY_US 250 #define UCD90320_WAIT_DELAY_US 500
static inline void ucd90320_wait(const struct ucd9000_data *data) static inline void ucd90320_wait(const struct ucd9000_data *data)
{ {

View File

@ -27,9 +27,13 @@
#define MXC4005_REG_ZOUT_UPPER 0x07 #define MXC4005_REG_ZOUT_UPPER 0x07
#define MXC4005_REG_ZOUT_LOWER 0x08 #define MXC4005_REG_ZOUT_LOWER 0x08
#define MXC4005_REG_INT_MASK0 0x0A
#define MXC4005_REG_INT_MASK1 0x0B #define MXC4005_REG_INT_MASK1 0x0B
#define MXC4005_REG_INT_MASK1_BIT_DRDYE 0x01 #define MXC4005_REG_INT_MASK1_BIT_DRDYE 0x01
#define MXC4005_REG_INT_CLR0 0x00
#define MXC4005_REG_INT_CLR1 0x01 #define MXC4005_REG_INT_CLR1 0x01
#define MXC4005_REG_INT_CLR1_BIT_DRDYC 0x01 #define MXC4005_REG_INT_CLR1_BIT_DRDYC 0x01
@ -113,7 +117,9 @@ static bool mxc4005_is_readable_reg(struct device *dev, unsigned int reg)
static bool mxc4005_is_writeable_reg(struct device *dev, unsigned int reg) static bool mxc4005_is_writeable_reg(struct device *dev, unsigned int reg)
{ {
switch (reg) { switch (reg) {
case MXC4005_REG_INT_CLR0:
case MXC4005_REG_INT_CLR1: case MXC4005_REG_INT_CLR1:
case MXC4005_REG_INT_MASK0:
case MXC4005_REG_INT_MASK1: case MXC4005_REG_INT_MASK1:
case MXC4005_REG_CONTROL: case MXC4005_REG_CONTROL:
return true; return true;
@ -334,17 +340,13 @@ static int mxc4005_set_trigger_state(struct iio_trigger *trig,
{ {
struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
struct mxc4005_data *data = iio_priv(indio_dev); struct mxc4005_data *data = iio_priv(indio_dev);
unsigned int val;
int ret; int ret;
mutex_lock(&data->mutex); mutex_lock(&data->mutex);
if (state) {
ret = regmap_write(data->regmap, MXC4005_REG_INT_MASK1,
MXC4005_REG_INT_MASK1_BIT_DRDYE);
} else {
ret = regmap_write(data->regmap, MXC4005_REG_INT_MASK1,
~MXC4005_REG_INT_MASK1_BIT_DRDYE);
}
val = state ? MXC4005_REG_INT_MASK1_BIT_DRDYE : 0;
ret = regmap_write(data->regmap, MXC4005_REG_INT_MASK1, val);
if (ret < 0) { if (ret < 0) {
mutex_unlock(&data->mutex); mutex_unlock(&data->mutex);
dev_err(data->dev, "failed to update reg_int_mask1"); dev_err(data->dev, "failed to update reg_int_mask1");
@ -386,6 +388,14 @@ static int mxc4005_chip_init(struct mxc4005_data *data)
dev_dbg(data->dev, "MXC4005 chip id %02x\n", reg); dev_dbg(data->dev, "MXC4005 chip id %02x\n", reg);
ret = regmap_write(data->regmap, MXC4005_REG_INT_MASK0, 0);
if (ret < 0)
return dev_err_probe(data->dev, ret, "writing INT_MASK0\n");
ret = regmap_write(data->regmap, MXC4005_REG_INT_MASK1, 0);
if (ret < 0)
return dev_err_probe(data->dev, ret, "writing INT_MASK1\n");
return 0; return 0;
} }

View File

@ -1070,6 +1070,7 @@ static int adis16475_config_sync_mode(struct adis16475 *st)
struct device *dev = &st->adis.spi->dev; struct device *dev = &st->adis.spi->dev;
const struct adis16475_sync *sync; const struct adis16475_sync *sync;
u32 sync_mode; u32 sync_mode;
u16 val;
/* default to internal clk */ /* default to internal clk */
st->clk_freq = st->info->int_clk * 1000; st->clk_freq = st->info->int_clk * 1000;
@ -1155,8 +1156,9 @@ static int adis16475_config_sync_mode(struct adis16475 *st)
* I'm keeping this for simplicity and avoiding extra variables * I'm keeping this for simplicity and avoiding extra variables
* in chip_info. * in chip_info.
*/ */
val = ADIS16475_SYNC_MODE(sync->sync_mode);
ret = __adis_update_bits(&st->adis, ADIS16475_REG_MSG_CTRL, ret = __adis_update_bits(&st->adis, ADIS16475_REG_MSG_CTRL,
ADIS16475_SYNC_MODE_MASK, sync->sync_mode); ADIS16475_SYNC_MODE_MASK, val);
if (ret) if (ret)
return ret; return ret;

View File

@ -2532,6 +2532,7 @@ static int bind_rdev_to_array(struct md_rdev *rdev, struct mddev *mddev)
fail: fail:
pr_warn("md: failed to register dev-%s for %s\n", pr_warn("md: failed to register dev-%s for %s\n",
b, mdname(mddev)); b, mdname(mddev));
mddev_destroy_serial_pool(mddev, rdev, false);
return err; return err;
} }

View File

@ -585,6 +585,31 @@ static unsigned int at24_get_offset_adj(u8 flags, unsigned int byte_len)
} }
} }
static void at24_probe_temp_sensor(struct i2c_client *client)
{
struct at24_data *at24 = i2c_get_clientdata(client);
struct i2c_board_info info = { .type = "jc42" };
int ret;
u8 val;
/*
* Byte 2 has value 11 for DDR3, earlier versions don't
* support the thermal sensor present flag
*/
ret = at24_read(at24, 2, &val, 1);
if (ret || val != 11)
return;
/* Byte 32, bit 7 is set if temp sensor is present */
ret = at24_read(at24, 32, &val, 1);
if (ret || !(val & BIT(7)))
return;
info.addr = 0x18 | (client->addr & 7);
i2c_new_client_device(client->adapter, &info);
}
static int at24_probe(struct i2c_client *client) static int at24_probe(struct i2c_client *client)
{ {
struct regmap_config regmap_config = { }; struct regmap_config regmap_config = { };
@ -757,14 +782,6 @@ static int at24_probe(struct i2c_client *client)
pm_runtime_set_active(dev); pm_runtime_set_active(dev);
pm_runtime_enable(dev); pm_runtime_enable(dev);
at24->nvmem = devm_nvmem_register(dev, &nvmem_config);
if (IS_ERR(at24->nvmem)) {
pm_runtime_disable(dev);
if (!pm_runtime_status_suspended(dev))
regulator_disable(at24->vcc_reg);
return PTR_ERR(at24->nvmem);
}
/* /*
* Perform a one-byte test read to verify that the * Perform a one-byte test read to verify that the
* chip is functional. * chip is functional.
@ -777,6 +794,19 @@ static int at24_probe(struct i2c_client *client)
return -ENODEV; return -ENODEV;
} }
at24->nvmem = devm_nvmem_register(dev, &nvmem_config);
if (IS_ERR(at24->nvmem)) {
pm_runtime_disable(dev);
if (!pm_runtime_status_suspended(dev))
regulator_disable(at24->vcc_reg);
return dev_err_probe(dev, PTR_ERR(at24->nvmem),
"failed to register nvmem\n");
}
/* If this a SPD EEPROM, probe for DDR3 thermal sensor */
if (cdata == &at24_data_spd)
at24_probe_temp_sensor(client);
pm_runtime_idle(dev); pm_runtime_idle(dev);
if (writable) if (writable)

View File

@ -115,6 +115,8 @@
#define MEI_DEV_ID_ARL_S 0x7F68 /* Arrow Lake Point S */ #define MEI_DEV_ID_ARL_S 0x7F68 /* Arrow Lake Point S */
#define MEI_DEV_ID_ARL_H 0x7770 /* Arrow Lake Point H */ #define MEI_DEV_ID_ARL_H 0x7770 /* Arrow Lake Point H */
#define MEI_DEV_ID_LNL_M 0xA870 /* Lunar Lake Point M */
/* /*
* MEI HW Section * MEI HW Section
*/ */

View File

@ -121,6 +121,8 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
{MEI_PCI_DEVICE(MEI_DEV_ID_ARL_S, MEI_ME_PCH15_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_ARL_S, MEI_ME_PCH15_CFG)},
{MEI_PCI_DEVICE(MEI_DEV_ID_ARL_H, MEI_ME_PCH15_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_ARL_H, MEI_ME_PCH15_CFG)},
{MEI_PCI_DEVICE(MEI_DEV_ID_LNL_M, MEI_ME_PCH15_CFG)},
/* required last entry */ /* required last entry */
{0, } {0, }
}; };

View File

@ -4650,7 +4650,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6141, .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6141,
.family = MV88E6XXX_FAMILY_6341, .family = MV88E6XXX_FAMILY_6341,
.name = "Marvell 88E6141", .name = "Marvell 88E6141",
.num_databases = 4096, .num_databases = 256,
.num_macs = 2048, .num_macs = 2048,
.num_ports = 6, .num_ports = 6,
.num_internal_phys = 5, .num_internal_phys = 5,
@ -5056,7 +5056,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6341, .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6341,
.family = MV88E6XXX_FAMILY_6341, .family = MV88E6XXX_FAMILY_6341,
.name = "Marvell 88E6341", .name = "Marvell 88E6341",
.num_databases = 4096, .num_databases = 256,
.num_macs = 2048, .num_macs = 2048,
.num_internal_phys = 5, .num_internal_phys = 5,
.num_ports = 6, .num_ports = 6,

View File

@ -2,7 +2,7 @@
/* /*
* Broadcom GENET (Gigabit Ethernet) controller driver * Broadcom GENET (Gigabit Ethernet) controller driver
* *
* Copyright (c) 2014-2020 Broadcom * Copyright (c) 2014-2024 Broadcom
*/ */
#define pr_fmt(fmt) "bcmgenet: " fmt #define pr_fmt(fmt) "bcmgenet: " fmt
@ -3252,7 +3252,7 @@ static void bcmgenet_get_hw_addr(struct bcmgenet_priv *priv,
} }
/* Returns a reusable dma control register value */ /* Returns a reusable dma control register value */
static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv) static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv, bool flush_rx)
{ {
unsigned int i; unsigned int i;
u32 reg; u32 reg;
@ -3277,6 +3277,14 @@ static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv)
udelay(10); udelay(10);
bcmgenet_umac_writel(priv, 0, UMAC_TX_FLUSH); bcmgenet_umac_writel(priv, 0, UMAC_TX_FLUSH);
if (flush_rx) {
reg = bcmgenet_rbuf_ctrl_get(priv);
bcmgenet_rbuf_ctrl_set(priv, reg | BIT(0));
udelay(10);
bcmgenet_rbuf_ctrl_set(priv, reg);
udelay(10);
}
return dma_ctrl; return dma_ctrl;
} }
@ -3298,7 +3306,9 @@ static void bcmgenet_netif_start(struct net_device *dev)
struct bcmgenet_priv *priv = netdev_priv(dev); struct bcmgenet_priv *priv = netdev_priv(dev);
/* Start the network engine */ /* Start the network engine */
netif_addr_lock_bh(dev);
bcmgenet_set_rx_mode(dev); bcmgenet_set_rx_mode(dev);
netif_addr_unlock_bh(dev);
bcmgenet_enable_rx_napi(priv); bcmgenet_enable_rx_napi(priv);
umac_enable_set(priv, CMD_TX_EN | CMD_RX_EN, true); umac_enable_set(priv, CMD_TX_EN | CMD_RX_EN, true);
@ -3340,8 +3350,8 @@ static int bcmgenet_open(struct net_device *dev)
bcmgenet_set_hw_addr(priv, dev->dev_addr); bcmgenet_set_hw_addr(priv, dev->dev_addr);
/* Disable RX/TX DMA and flush TX queues */ /* Disable RX/TX DMA and flush TX and RX queues */
dma_ctrl = bcmgenet_dma_disable(priv); dma_ctrl = bcmgenet_dma_disable(priv, true);
/* Reinitialize TDMA and RDMA and SW housekeeping */ /* Reinitialize TDMA and RDMA and SW housekeeping */
ret = bcmgenet_init_dma(priv); ret = bcmgenet_init_dma(priv);
@ -4199,7 +4209,7 @@ static int bcmgenet_resume(struct device *d)
bcmgenet_hfb_create_rxnfc_filter(priv, rule); bcmgenet_hfb_create_rxnfc_filter(priv, rule);
/* Disable RX/TX DMA and flush TX queues */ /* Disable RX/TX DMA and flush TX queues */
dma_ctrl = bcmgenet_dma_disable(priv); dma_ctrl = bcmgenet_dma_disable(priv, false);
/* Reinitialize TDMA and RDMA and SW housekeeping */ /* Reinitialize TDMA and RDMA and SW housekeeping */
ret = bcmgenet_init_dma(priv); ret = bcmgenet_init_dma(priv);

View File

@ -312,7 +312,7 @@ bnad_debugfs_write_regrd(struct file *file, const char __user *buf,
void *kern_buf; void *kern_buf;
/* Copy the user space buf */ /* Copy the user space buf */
kern_buf = memdup_user(buf, nbytes); kern_buf = memdup_user_nul(buf, nbytes);
if (IS_ERR(kern_buf)) if (IS_ERR(kern_buf))
return PTR_ERR(kern_buf); return PTR_ERR(kern_buf);
@ -372,7 +372,7 @@ bnad_debugfs_write_regwr(struct file *file, const char __user *buf,
void *kern_buf; void *kern_buf;
/* Copy the user space buf */ /* Copy the user space buf */
kern_buf = memdup_user(buf, nbytes); kern_buf = memdup_user_nul(buf, nbytes);
if (IS_ERR(kern_buf)) if (IS_ERR(kern_buf))
return PTR_ERR(kern_buf); return PTR_ERR(kern_buf);

View File

@ -2678,12 +2678,12 @@ int cxgb4_selftest_lb_pkt(struct net_device *netdev)
lb->loopback = 1; lb->loopback = 1;
q = &adap->sge.ethtxq[pi->first_qset]; q = &adap->sge.ethtxq[pi->first_qset];
__netif_tx_lock(q->txq, smp_processor_id()); __netif_tx_lock_bh(q->txq);
reclaim_completed_tx(adap, &q->q, -1, true); reclaim_completed_tx(adap, &q->q, -1, true);
credits = txq_avail(&q->q) - ndesc; credits = txq_avail(&q->q) - ndesc;
if (unlikely(credits < 0)) { if (unlikely(credits < 0)) {
__netif_tx_unlock(q->txq); __netif_tx_unlock_bh(q->txq);
return -ENOMEM; return -ENOMEM;
} }
@ -2718,7 +2718,7 @@ int cxgb4_selftest_lb_pkt(struct net_device *netdev)
init_completion(&lb->completion); init_completion(&lb->completion);
txq_advance(&q->q, ndesc); txq_advance(&q->q, ndesc);
cxgb4_ring_tx_db(adap, &q->q, ndesc); cxgb4_ring_tx_db(adap, &q->q, ndesc);
__netif_tx_unlock(q->txq); __netif_tx_unlock_bh(q->txq);
/* wait for the pkt to return */ /* wait for the pkt to return */
ret = wait_for_completion_timeout(&lb->completion, 10 * HZ); ret = wait_for_completion_timeout(&lb->completion, 10 * HZ);

View File

@ -7005,8 +7005,7 @@ static void hclge_set_timer_task(struct hnae3_handle *handle, bool enable)
/* Set the DOWN flag here to disable link updating */ /* Set the DOWN flag here to disable link updating */
set_bit(HCLGE_STATE_DOWN, &hdev->state); set_bit(HCLGE_STATE_DOWN, &hdev->state);
/* flush memory to make sure DOWN is seen by service task */ smp_mb__after_atomic(); /* flush memory to make sure DOWN is seen by service task */
smp_mb__before_atomic();
hclge_flush_link_update(hdev); hclge_flush_link_update(hdev);
} }
} }

View File

@ -2583,8 +2583,7 @@ static void hclgevf_set_timer_task(struct hnae3_handle *handle, bool enable)
} else { } else {
set_bit(HCLGEVF_STATE_DOWN, &hdev->state); set_bit(HCLGEVF_STATE_DOWN, &hdev->state);
/* flush memory to make sure DOWN is seen by service task */ smp_mb__after_atomic(); /* flush memory to make sure DOWN is seen by service task */
smp_mb__before_atomic();
hclgevf_flush_link_update(hdev); hclgevf_flush_link_update(hdev);
} }
} }

View File

@ -420,12 +420,10 @@ static ssize_t rvu_dbg_qsize_write(struct file *filp,
u16 pcifunc; u16 pcifunc;
int ret, lf; int ret, lf;
cmd_buf = memdup_user(buffer, count + 1); cmd_buf = memdup_user_nul(buffer, count);
if (IS_ERR(cmd_buf)) if (IS_ERR(cmd_buf))
return -ENOMEM; return -ENOMEM;
cmd_buf[count] = '\0';
cmd_buf_tmp = strchr(cmd_buf, '\n'); cmd_buf_tmp = strchr(cmd_buf, '\n');
if (cmd_buf_tmp) { if (cmd_buf_tmp) {
*cmd_buf_tmp = '\0'; *cmd_buf_tmp = '\0';

View File

@ -1877,8 +1877,8 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
struct flow_cls_offload *f) struct flow_cls_offload *f)
{ {
struct qede_arfs_fltr_node *n; struct qede_arfs_fltr_node *n;
int min_hlen, rc = -EINVAL;
struct qede_arfs_tuple t; struct qede_arfs_tuple t;
int min_hlen, rc;
__qede_lock(edev); __qede_lock(edev);
@ -1888,7 +1888,8 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
} }
/* parse flower attribute and prepare filter */ /* parse flower attribute and prepare filter */
if (qede_parse_flow_attr(edev, proto, f->rule, &t)) rc = qede_parse_flow_attr(edev, proto, f->rule, &t);
if (rc)
goto unlock; goto unlock;
/* Validate profile mode and number of filters */ /* Validate profile mode and number of filters */
@ -1897,11 +1898,13 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
DP_NOTICE(edev, DP_NOTICE(edev,
"Filter configuration invalidated, filter mode=0x%x, configured mode=0x%x, filter count=0x%x\n", "Filter configuration invalidated, filter mode=0x%x, configured mode=0x%x, filter count=0x%x\n",
t.mode, edev->arfs->mode, edev->arfs->filter_count); t.mode, edev->arfs->mode, edev->arfs->filter_count);
rc = -EINVAL;
goto unlock; goto unlock;
} }
/* parse tc actions and get the vf_id */ /* parse tc actions and get the vf_id */
if (qede_parse_actions(edev, &f->rule->action, f->common.extack)) rc = qede_parse_actions(edev, &f->rule->action, f->common.extack);
if (rc)
goto unlock; goto unlock;
if (qede_flow_find_fltr(edev, &t)) { if (qede_flow_find_fltr(edev, &t)) {
@ -2007,10 +2010,9 @@ static int qede_flow_spec_to_rule(struct qede_dev *edev,
if (IS_ERR(flow)) if (IS_ERR(flow))
return PTR_ERR(flow); return PTR_ERR(flow);
if (qede_parse_flow_attr(edev, proto, flow->rule, t)) { err = qede_parse_flow_attr(edev, proto, flow->rule, t);
err = -EINVAL; if (err)
goto err_out; goto err_out;
}
/* Make sure location is valid and filter isn't already set */ /* Make sure location is valid and filter isn't already set */
err = qede_flow_spec_validate(edev, &flow->rule->action, t, err = qede_flow_spec_validate(edev, &flow->rule->action, t,

View File

@ -1358,6 +1358,7 @@ static const struct usb_device_id products[] = {
{QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/ {QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/
{QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */ {QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */
{QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */ {QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */
{QMI_QUIRK_SET_DTR(0x33f8, 0x0104, 4)}, /* Rolling RW101 RMNET */
/* 4. Gobi 1000 devices */ /* 4. Gobi 1000 devices */
{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */

View File

@ -43,7 +43,7 @@
#define SCU614 0x614 /* Disable GPIO Internal Pull-Down #1 */ #define SCU614 0x614 /* Disable GPIO Internal Pull-Down #1 */
#define SCU618 0x618 /* Disable GPIO Internal Pull-Down #2 */ #define SCU618 0x618 /* Disable GPIO Internal Pull-Down #2 */
#define SCU61C 0x61c /* Disable GPIO Internal Pull-Down #3 */ #define SCU61C 0x61c /* Disable GPIO Internal Pull-Down #3 */
#define SCU620 0x620 /* Disable GPIO Internal Pull-Down #4 */ #define SCU630 0x630 /* Disable GPIO Internal Pull-Down #4 */
#define SCU634 0x634 /* Disable GPIO Internal Pull-Down #5 */ #define SCU634 0x634 /* Disable GPIO Internal Pull-Down #5 */
#define SCU638 0x638 /* Disable GPIO Internal Pull-Down #6 */ #define SCU638 0x638 /* Disable GPIO Internal Pull-Down #6 */
#define SCU694 0x694 /* Multi-function Pin Control #25 */ #define SCU694 0x694 /* Multi-function Pin Control #25 */
@ -2471,38 +2471,38 @@ static struct aspeed_pin_config aspeed_g6_configs[] = {
ASPEED_PULL_DOWN_PINCONF(D14, SCU61C, 0), ASPEED_PULL_DOWN_PINCONF(D14, SCU61C, 0),
/* GPIOS7 */ /* GPIOS7 */
ASPEED_PULL_DOWN_PINCONF(T24, SCU620, 23), ASPEED_PULL_DOWN_PINCONF(T24, SCU630, 23),
/* GPIOS6 */ /* GPIOS6 */
ASPEED_PULL_DOWN_PINCONF(P23, SCU620, 22), ASPEED_PULL_DOWN_PINCONF(P23, SCU630, 22),
/* GPIOS5 */ /* GPIOS5 */
ASPEED_PULL_DOWN_PINCONF(P24, SCU620, 21), ASPEED_PULL_DOWN_PINCONF(P24, SCU630, 21),
/* GPIOS4 */ /* GPIOS4 */
ASPEED_PULL_DOWN_PINCONF(R26, SCU620, 20), ASPEED_PULL_DOWN_PINCONF(R26, SCU630, 20),
/* GPIOS3*/ /* GPIOS3*/
ASPEED_PULL_DOWN_PINCONF(R24, SCU620, 19), ASPEED_PULL_DOWN_PINCONF(R24, SCU630, 19),
/* GPIOS2 */ /* GPIOS2 */
ASPEED_PULL_DOWN_PINCONF(T26, SCU620, 18), ASPEED_PULL_DOWN_PINCONF(T26, SCU630, 18),
/* GPIOS1 */ /* GPIOS1 */
ASPEED_PULL_DOWN_PINCONF(T25, SCU620, 17), ASPEED_PULL_DOWN_PINCONF(T25, SCU630, 17),
/* GPIOS0 */ /* GPIOS0 */
ASPEED_PULL_DOWN_PINCONF(R23, SCU620, 16), ASPEED_PULL_DOWN_PINCONF(R23, SCU630, 16),
/* GPIOR7 */ /* GPIOR7 */
ASPEED_PULL_DOWN_PINCONF(U26, SCU620, 15), ASPEED_PULL_DOWN_PINCONF(U26, SCU630, 15),
/* GPIOR6 */ /* GPIOR6 */
ASPEED_PULL_DOWN_PINCONF(W26, SCU620, 14), ASPEED_PULL_DOWN_PINCONF(W26, SCU630, 14),
/* GPIOR5 */ /* GPIOR5 */
ASPEED_PULL_DOWN_PINCONF(T23, SCU620, 13), ASPEED_PULL_DOWN_PINCONF(T23, SCU630, 13),
/* GPIOR4 */ /* GPIOR4 */
ASPEED_PULL_DOWN_PINCONF(U25, SCU620, 12), ASPEED_PULL_DOWN_PINCONF(U25, SCU630, 12),
/* GPIOR3*/ /* GPIOR3*/
ASPEED_PULL_DOWN_PINCONF(V26, SCU620, 11), ASPEED_PULL_DOWN_PINCONF(V26, SCU630, 11),
/* GPIOR2 */ /* GPIOR2 */
ASPEED_PULL_DOWN_PINCONF(V24, SCU620, 10), ASPEED_PULL_DOWN_PINCONF(V24, SCU630, 10),
/* GPIOR1 */ /* GPIOR1 */
ASPEED_PULL_DOWN_PINCONF(U24, SCU620, 9), ASPEED_PULL_DOWN_PINCONF(U24, SCU630, 9),
/* GPIOR0 */ /* GPIOR0 */
ASPEED_PULL_DOWN_PINCONF(V25, SCU620, 8), ASPEED_PULL_DOWN_PINCONF(V25, SCU630, 8),
/* GPIOX7 */ /* GPIOX7 */
ASPEED_PULL_DOWN_PINCONF(AB10, SCU634, 31), ASPEED_PULL_DOWN_PINCONF(AB10, SCU634, 31),

View File

@ -2075,13 +2075,7 @@ int pinctrl_enable(struct pinctrl_dev *pctldev)
error = pinctrl_claim_hogs(pctldev); error = pinctrl_claim_hogs(pctldev);
if (error) { if (error) {
dev_err(pctldev->dev, "could not claim hogs: %i\n", dev_err(pctldev->dev, "could not claim hogs: %i\n", error);
error);
pinctrl_free_pindescs(pctldev, pctldev->desc->pins,
pctldev->desc->npins);
mutex_destroy(&pctldev->mutex);
kfree(pctldev);
return error; return error;
} }

View File

@ -220,14 +220,16 @@ int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev)
for (state = 0; ; state++) { for (state = 0; ; state++) {
/* Retrieve the pinctrl-* property */ /* Retrieve the pinctrl-* property */
propname = kasprintf(GFP_KERNEL, "pinctrl-%d", state); propname = kasprintf(GFP_KERNEL, "pinctrl-%d", state);
if (!propname) if (!propname) {
return -ENOMEM; ret = -ENOMEM;
goto err;
}
prop = of_find_property(np, propname, &size); prop = of_find_property(np, propname, &size);
kfree(propname); kfree(propname);
if (!prop) { if (!prop) {
if (state == 0) { if (state == 0) {
of_node_put(np); ret = -ENODEV;
return -ENODEV; goto err;
} }
break; break;
} }

View File

@ -79,78 +79,76 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
{ {
struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev); struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev);
u32 param = pinconf_to_config_param(*config); u32 param = pinconf_to_config_param(*config);
int pullup, err, reg, ret = 1; int pullup, reg, err = -ENOTSUPP, ret = 1;
const struct mtk_pin_desc *desc; const struct mtk_pin_desc *desc;
if (pin >= hw->soc->npins) { if (pin >= hw->soc->npins)
err = -EINVAL; return -EINVAL;
goto out;
}
desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin]; desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin];
switch (param) { switch (param) {
case PIN_CONFIG_BIAS_DISABLE: case PIN_CONFIG_BIAS_DISABLE:
case PIN_CONFIG_BIAS_PULL_UP: case PIN_CONFIG_BIAS_PULL_UP:
case PIN_CONFIG_BIAS_PULL_DOWN: case PIN_CONFIG_BIAS_PULL_DOWN:
if (hw->soc->bias_get_combo) { if (!hw->soc->bias_get_combo)
err = hw->soc->bias_get_combo(hw, desc, &pullup, &ret); break;
if (err) err = hw->soc->bias_get_combo(hw, desc, &pullup, &ret);
goto out; if (err)
if (ret == MTK_PUPD_SET_R1R0_00) break;
ret = MTK_DISABLE; if (ret == MTK_PUPD_SET_R1R0_00)
if (param == PIN_CONFIG_BIAS_DISABLE) { ret = MTK_DISABLE;
if (ret != MTK_DISABLE) if (param == PIN_CONFIG_BIAS_DISABLE) {
err = -EINVAL; if (ret != MTK_DISABLE)
} else if (param == PIN_CONFIG_BIAS_PULL_UP) { err = -EINVAL;
if (!pullup || ret == MTK_DISABLE) } else if (param == PIN_CONFIG_BIAS_PULL_UP) {
err = -EINVAL; if (!pullup || ret == MTK_DISABLE)
} else if (param == PIN_CONFIG_BIAS_PULL_DOWN) { err = -EINVAL;
if (pullup || ret == MTK_DISABLE) } else if (param == PIN_CONFIG_BIAS_PULL_DOWN) {
err = -EINVAL; if (pullup || ret == MTK_DISABLE)
} err = -EINVAL;
} else {
err = -ENOTSUPP;
} }
break; break;
case PIN_CONFIG_SLEW_RATE: case PIN_CONFIG_SLEW_RATE:
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_SR, &ret); err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_SR, &ret);
break; break;
case PIN_CONFIG_INPUT_ENABLE: case PIN_CONFIG_INPUT_ENABLE:
case PIN_CONFIG_OUTPUT_ENABLE: err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_IES, &ret);
if (!ret)
err = -EINVAL;
break;
case PIN_CONFIG_OUTPUT:
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DIR, &ret); err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DIR, &ret);
if (err) if (err)
goto out; break;
/* CONFIG Current direction return value
* ------------- ----------------- ----------------------
* OUTPUT_ENABLE output 1 (= HW value)
* input 0 (= HW value)
* INPUT_ENABLE output 0 (= reverse HW value)
* input 1 (= reverse HW value)
*/
if (param == PIN_CONFIG_INPUT_ENABLE)
ret = !ret;
if (!ret) {
err = -EINVAL;
break;
}
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DO, &ret);
break; break;
case PIN_CONFIG_INPUT_SCHMITT_ENABLE: case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DIR, &ret); err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DIR, &ret);
if (err) if (err)
goto out; break;
/* return error when in output mode /* return error when in output mode
* because schmitt trigger only work in input mode * because schmitt trigger only work in input mode
*/ */
if (ret) { if (ret) {
err = -EINVAL; err = -EINVAL;
goto out; break;
} }
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_SMT, &ret); err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_SMT, &ret);
if (!ret)
err = -EINVAL;
break; break;
case PIN_CONFIG_DRIVE_STRENGTH: case PIN_CONFIG_DRIVE_STRENGTH:
if (hw->soc->drive_get) if (!hw->soc->drive_get)
err = hw->soc->drive_get(hw, desc, &ret); break;
else err = hw->soc->drive_get(hw, desc, &ret);
err = -ENOTSUPP;
break; break;
case MTK_PIN_CONFIG_TDSEL: case MTK_PIN_CONFIG_TDSEL:
case MTK_PIN_CONFIG_RDSEL: case MTK_PIN_CONFIG_RDSEL:
@ -160,23 +158,18 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
break; break;
case MTK_PIN_CONFIG_PU_ADV: case MTK_PIN_CONFIG_PU_ADV:
case MTK_PIN_CONFIG_PD_ADV: case MTK_PIN_CONFIG_PD_ADV:
if (hw->soc->adv_pull_get) { if (!hw->soc->adv_pull_get)
pullup = param == MTK_PIN_CONFIG_PU_ADV; break;
err = hw->soc->adv_pull_get(hw, desc, pullup, &ret); pullup = param == MTK_PIN_CONFIG_PU_ADV;
} else err = hw->soc->adv_pull_get(hw, desc, pullup, &ret);
err = -ENOTSUPP;
break; break;
case MTK_PIN_CONFIG_DRV_ADV: case MTK_PIN_CONFIG_DRV_ADV:
if (hw->soc->adv_drive_get) if (!hw->soc->adv_drive_get)
err = hw->soc->adv_drive_get(hw, desc, &ret); break;
else err = hw->soc->adv_drive_get(hw, desc, &ret);
err = -ENOTSUPP;
break; break;
default:
err = -ENOTSUPP;
} }
out:
if (!err) if (!err)
*config = pinconf_to_config_packed(param, ret); *config = pinconf_to_config_packed(param, ret);
@ -188,54 +181,33 @@ static int mtk_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
{ {
struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev); struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev);
const struct mtk_pin_desc *desc; const struct mtk_pin_desc *desc;
int err = 0; int err = -ENOTSUPP;
u32 reg; u32 reg;
if (pin >= hw->soc->npins) { if (pin >= hw->soc->npins)
err = -EINVAL; return -EINVAL;
goto err;
}
desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin]; desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin];
switch ((u32)param) { switch ((u32)param) {
case PIN_CONFIG_BIAS_DISABLE: case PIN_CONFIG_BIAS_DISABLE:
if (hw->soc->bias_set_combo) if (!hw->soc->bias_set_combo)
err = hw->soc->bias_set_combo(hw, desc, 0, MTK_DISABLE); break;
else err = hw->soc->bias_set_combo(hw, desc, 0, MTK_DISABLE);
err = -ENOTSUPP;
break; break;
case PIN_CONFIG_BIAS_PULL_UP: case PIN_CONFIG_BIAS_PULL_UP:
if (hw->soc->bias_set_combo) if (!hw->soc->bias_set_combo)
err = hw->soc->bias_set_combo(hw, desc, 1, arg); break;
else err = hw->soc->bias_set_combo(hw, desc, 1, arg);
err = -ENOTSUPP;
break; break;
case PIN_CONFIG_BIAS_PULL_DOWN: case PIN_CONFIG_BIAS_PULL_DOWN:
if (hw->soc->bias_set_combo) if (!hw->soc->bias_set_combo)
err = hw->soc->bias_set_combo(hw, desc, 0, arg); break;
else err = hw->soc->bias_set_combo(hw, desc, 0, arg);
err = -ENOTSUPP;
break;
case PIN_CONFIG_OUTPUT_ENABLE:
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT,
MTK_DISABLE);
/* Keep set direction to consider the case that a GPIO pin
* does not have SMT control
*/
if (err != -ENOTSUPP)
goto err;
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
MTK_OUTPUT);
break; break;
case PIN_CONFIG_INPUT_ENABLE: case PIN_CONFIG_INPUT_ENABLE:
/* regard all non-zero value as enable */ /* regard all non-zero value as enable */
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_IES, !!arg); err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_IES, !!arg);
if (err)
goto err;
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
MTK_INPUT);
break; break;
case PIN_CONFIG_SLEW_RATE: case PIN_CONFIG_SLEW_RATE:
/* regard all non-zero value as enable */ /* regard all non-zero value as enable */
@ -245,7 +217,7 @@ static int mtk_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR, err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
MTK_OUTPUT); MTK_OUTPUT);
if (err) if (err)
goto err; break;
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DO, err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DO,
arg); arg);
@ -257,15 +229,14 @@ static int mtk_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
*/ */
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR, !arg); err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR, !arg);
if (err) if (err)
goto err; break;
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT, !!arg); err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT, !!arg);
break; break;
case PIN_CONFIG_DRIVE_STRENGTH: case PIN_CONFIG_DRIVE_STRENGTH:
if (hw->soc->drive_set) if (!hw->soc->drive_set)
err = hw->soc->drive_set(hw, desc, arg); break;
else err = hw->soc->drive_set(hw, desc, arg);
err = -ENOTSUPP;
break; break;
case MTK_PIN_CONFIG_TDSEL: case MTK_PIN_CONFIG_TDSEL:
case MTK_PIN_CONFIG_RDSEL: case MTK_PIN_CONFIG_RDSEL:
@ -275,26 +246,19 @@ static int mtk_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
break; break;
case MTK_PIN_CONFIG_PU_ADV: case MTK_PIN_CONFIG_PU_ADV:
case MTK_PIN_CONFIG_PD_ADV: case MTK_PIN_CONFIG_PD_ADV:
if (hw->soc->adv_pull_set) { if (!hw->soc->adv_pull_set)
bool pullup; break;
err = hw->soc->adv_pull_set(hw, desc,
pullup = param == MTK_PIN_CONFIG_PU_ADV; (param == MTK_PIN_CONFIG_PU_ADV),
err = hw->soc->adv_pull_set(hw, desc, pullup, arg);
arg);
} else
err = -ENOTSUPP;
break; break;
case MTK_PIN_CONFIG_DRV_ADV: case MTK_PIN_CONFIG_DRV_ADV:
if (hw->soc->adv_drive_set) if (!hw->soc->adv_drive_set)
err = hw->soc->adv_drive_set(hw, desc, arg); break;
else err = hw->soc->adv_drive_set(hw, desc, arg);
err = -ENOTSUPP;
break; break;
default:
err = -ENOTSUPP;
} }
err:
return err; return err;
} }

View File

@ -250,7 +250,7 @@ static const unsigned int pdm_dclk_x_pins[] = { GPIOX_10 };
static const unsigned int pdm_din2_a_pins[] = { GPIOA_6 }; static const unsigned int pdm_din2_a_pins[] = { GPIOA_6 };
static const unsigned int pdm_din1_a_pins[] = { GPIOA_7 }; static const unsigned int pdm_din1_a_pins[] = { GPIOA_7 };
static const unsigned int pdm_din0_a_pins[] = { GPIOA_8 }; static const unsigned int pdm_din0_a_pins[] = { GPIOA_8 };
static const unsigned int pdm_dclk_pins[] = { GPIOA_9 }; static const unsigned int pdm_dclk_a_pins[] = { GPIOA_9 };
/* gen_clk */ /* gen_clk */
static const unsigned int gen_clk_x_pins[] = { GPIOX_7 }; static const unsigned int gen_clk_x_pins[] = { GPIOX_7 };
@ -591,7 +591,7 @@ static struct meson_pmx_group meson_a1_periphs_groups[] = {
GROUP(pdm_din2_a, 3), GROUP(pdm_din2_a, 3),
GROUP(pdm_din1_a, 3), GROUP(pdm_din1_a, 3),
GROUP(pdm_din0_a, 3), GROUP(pdm_din0_a, 3),
GROUP(pdm_dclk, 3), GROUP(pdm_dclk_a, 3),
GROUP(pwm_c_a, 3), GROUP(pwm_c_a, 3),
GROUP(pwm_b_a, 3), GROUP(pwm_b_a, 3),
@ -755,7 +755,7 @@ static const char * const spi_a_groups[] = {
static const char * const pdm_groups[] = { static const char * const pdm_groups[] = {
"pdm_din0_x", "pdm_din1_x", "pdm_din2_x", "pdm_dclk_x", "pdm_din2_a", "pdm_din0_x", "pdm_din1_x", "pdm_din2_x", "pdm_dclk_x", "pdm_din2_a",
"pdm_din1_a", "pdm_din0_a", "pdm_dclk", "pdm_din1_a", "pdm_din0_a", "pdm_dclk_a",
}; };
static const char * const gen_clk_groups[] = { static const char * const gen_clk_groups[] = {

View File

@ -193,6 +193,7 @@ static const int rt9455_voreg_values[] = {
4450000, 4450000, 4450000, 4450000, 4450000, 4450000, 4450000, 4450000 4450000, 4450000, 4450000, 4450000, 4450000, 4450000, 4450000, 4450000
}; };
#if IS_ENABLED(CONFIG_USB_PHY)
/* /*
* When the charger is in boost mode, REG02[7:2] represent boost output * When the charger is in boost mode, REG02[7:2] represent boost output
* voltage. * voltage.
@ -208,6 +209,7 @@ static const int rt9455_boost_voltage_values[] = {
5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000,
5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000,
}; };
#endif
/* REG07[3:0] (VMREG) in uV */ /* REG07[3:0] (VMREG) in uV */
static const int rt9455_vmreg_values[] = { static const int rt9455_vmreg_values[] = {

View File

@ -1749,19 +1749,24 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
} }
} }
if (err != -EEXIST) if (err != -EEXIST) {
regulator->debugfs = debugfs_create_dir(supply_name, rdev->debugfs); regulator->debugfs = debugfs_create_dir(supply_name, rdev->debugfs);
if (IS_ERR(regulator->debugfs)) if (IS_ERR(regulator->debugfs)) {
rdev_dbg(rdev, "Failed to create debugfs directory\n"); rdev_dbg(rdev, "Failed to create debugfs directory\n");
regulator->debugfs = NULL;
}
}
debugfs_create_u32("uA_load", 0444, regulator->debugfs, if (regulator->debugfs) {
&regulator->uA_load); debugfs_create_u32("uA_load", 0444, regulator->debugfs,
debugfs_create_u32("min_uV", 0444, regulator->debugfs, &regulator->uA_load);
&regulator->voltage[PM_SUSPEND_ON].min_uV); debugfs_create_u32("min_uV", 0444, regulator->debugfs,
debugfs_create_u32("max_uV", 0444, regulator->debugfs, &regulator->voltage[PM_SUSPEND_ON].min_uV);
&regulator->voltage[PM_SUSPEND_ON].max_uV); debugfs_create_u32("max_uV", 0444, regulator->debugfs,
debugfs_create_file("constraint_flags", 0444, regulator->debugfs, &regulator->voltage[PM_SUSPEND_ON].max_uV);
regulator, &constraint_flags_fops); debugfs_create_file("constraint_flags", 0444, regulator->debugfs,
regulator, &constraint_flags_fops);
}
/* /*
* Check now if the regulator is an always on regulator - if * Check now if the regulator is an always on regulator - if

View File

@ -319,15 +319,15 @@ static unsigned int mt6360_regulator_of_map_mode(unsigned int hw_mode)
} }
} }
#define MT6360_REGULATOR_DESC(_name, _sname, ereg, emask, vreg, vmask, \ #define MT6360_REGULATOR_DESC(match, _name, _sname, ereg, emask, vreg, \
mreg, mmask, streg, stmask, vranges, \ vmask, mreg, mmask, streg, stmask, \
vcnts, offon_delay, irq_tbls) \ vranges, vcnts, offon_delay, irq_tbls) \
{ \ { \
.desc = { \ .desc = { \
.name = #_name, \ .name = #_name, \
.supply_name = #_sname, \ .supply_name = #_sname, \
.id = MT6360_REGULATOR_##_name, \ .id = MT6360_REGULATOR_##_name, \
.of_match = of_match_ptr(#_name), \ .of_match = of_match_ptr(match), \
.regulators_node = of_match_ptr("regulator"), \ .regulators_node = of_match_ptr("regulator"), \
.of_map_mode = mt6360_regulator_of_map_mode, \ .of_map_mode = mt6360_regulator_of_map_mode, \
.owner = THIS_MODULE, \ .owner = THIS_MODULE, \
@ -351,21 +351,29 @@ static unsigned int mt6360_regulator_of_map_mode(unsigned int hw_mode)
} }
static const struct mt6360_regulator_desc mt6360_regulator_descs[] = { static const struct mt6360_regulator_desc mt6360_regulator_descs[] = {
MT6360_REGULATOR_DESC(BUCK1, BUCK1_VIN, 0x117, 0x40, 0x110, 0xff, 0x117, 0x30, 0x117, 0x04, MT6360_REGULATOR_DESC("buck1", BUCK1, BUCK1_VIN,
0x117, 0x40, 0x110, 0xff, 0x117, 0x30, 0x117, 0x04,
buck_vout_ranges, 256, 0, buck1_irq_tbls), buck_vout_ranges, 256, 0, buck1_irq_tbls),
MT6360_REGULATOR_DESC(BUCK2, BUCK2_VIN, 0x127, 0x40, 0x120, 0xff, 0x127, 0x30, 0x127, 0x04, MT6360_REGULATOR_DESC("buck2", BUCK2, BUCK2_VIN,
0x127, 0x40, 0x120, 0xff, 0x127, 0x30, 0x127, 0x04,
buck_vout_ranges, 256, 0, buck2_irq_tbls), buck_vout_ranges, 256, 0, buck2_irq_tbls),
MT6360_REGULATOR_DESC(LDO6, LDO_VIN3, 0x137, 0x40, 0x13B, 0xff, 0x137, 0x30, 0x137, 0x04, MT6360_REGULATOR_DESC("ldo6", LDO6, LDO_VIN3,
0x137, 0x40, 0x13B, 0xff, 0x137, 0x30, 0x137, 0x04,
ldo_vout_ranges1, 256, 0, ldo6_irq_tbls), ldo_vout_ranges1, 256, 0, ldo6_irq_tbls),
MT6360_REGULATOR_DESC(LDO7, LDO_VIN3, 0x131, 0x40, 0x135, 0xff, 0x131, 0x30, 0x131, 0x04, MT6360_REGULATOR_DESC("ldo7", LDO7, LDO_VIN3,
0x131, 0x40, 0x135, 0xff, 0x131, 0x30, 0x131, 0x04,
ldo_vout_ranges1, 256, 0, ldo7_irq_tbls), ldo_vout_ranges1, 256, 0, ldo7_irq_tbls),
MT6360_REGULATOR_DESC(LDO1, LDO_VIN1, 0x217, 0x40, 0x21B, 0xff, 0x217, 0x30, 0x217, 0x04, MT6360_REGULATOR_DESC("ldo1", LDO1, LDO_VIN1,
0x217, 0x40, 0x21B, 0xff, 0x217, 0x30, 0x217, 0x04,
ldo_vout_ranges2, 256, 0, ldo1_irq_tbls), ldo_vout_ranges2, 256, 0, ldo1_irq_tbls),
MT6360_REGULATOR_DESC(LDO2, LDO_VIN1, 0x211, 0x40, 0x215, 0xff, 0x211, 0x30, 0x211, 0x04, MT6360_REGULATOR_DESC("ldo2", LDO2, LDO_VIN1,
0x211, 0x40, 0x215, 0xff, 0x211, 0x30, 0x211, 0x04,
ldo_vout_ranges2, 256, 0, ldo2_irq_tbls), ldo_vout_ranges2, 256, 0, ldo2_irq_tbls),
MT6360_REGULATOR_DESC(LDO3, LDO_VIN1, 0x205, 0x40, 0x209, 0xff, 0x205, 0x30, 0x205, 0x04, MT6360_REGULATOR_DESC("ldo3", LDO3, LDO_VIN1,
0x205, 0x40, 0x209, 0xff, 0x205, 0x30, 0x205, 0x04,
ldo_vout_ranges2, 256, 100, ldo3_irq_tbls), ldo_vout_ranges2, 256, 100, ldo3_irq_tbls),
MT6360_REGULATOR_DESC(LDO5, LDO_VIN2, 0x20B, 0x40, 0x20F, 0x7f, 0x20B, 0x30, 0x20B, 0x04, MT6360_REGULATOR_DESC("ldo5", LDO5, LDO_VIN2,
0x20B, 0x40, 0x20F, 0x7f, 0x20B, 0x30, 0x20B, 0x04,
ldo_vout_ranges3, 128, 100, ldo5_irq_tbls), ldo_vout_ranges3, 128, 100, ldo5_irq_tbls),
}; };

View File

@ -833,7 +833,6 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,
BNX2FC_TGT_DBG(tgt, "Freeing up session resources\n"); BNX2FC_TGT_DBG(tgt, "Freeing up session resources\n");
spin_lock_bh(&tgt->cq_lock);
ctx_base_ptr = tgt->ctx_base; ctx_base_ptr = tgt->ctx_base;
tgt->ctx_base = NULL; tgt->ctx_base = NULL;
@ -889,7 +888,6 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,
tgt->sq, tgt->sq_dma); tgt->sq, tgt->sq_dma);
tgt->sq = NULL; tgt->sq = NULL;
} }
spin_unlock_bh(&tgt->cq_lock);
if (ctx_base_ptr) if (ctx_base_ptr)
iounmap(ctx_base_ptr); iounmap(ctx_base_ptr);

View File

@ -1065,7 +1065,6 @@ struct lpfc_hba {
unsigned long bit_flags; unsigned long bit_flags;
#define FABRIC_COMANDS_BLOCKED 0 #define FABRIC_COMANDS_BLOCKED 0
atomic_t num_rsrc_err; atomic_t num_rsrc_err;
atomic_t num_cmd_success;
unsigned long last_rsrc_error_time; unsigned long last_rsrc_error_time;
unsigned long last_ramp_down_time; unsigned long last_ramp_down_time;
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS #ifdef CONFIG_SCSI_LPFC_DEBUG_FS

View File

@ -246,11 +246,10 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
struct Scsi_Host *shost; struct Scsi_Host *shost;
struct scsi_device *sdev; struct scsi_device *sdev;
unsigned long new_queue_depth; unsigned long new_queue_depth;
unsigned long num_rsrc_err, num_cmd_success; unsigned long num_rsrc_err;
int i; int i;
num_rsrc_err = atomic_read(&phba->num_rsrc_err); num_rsrc_err = atomic_read(&phba->num_rsrc_err);
num_cmd_success = atomic_read(&phba->num_cmd_success);
/* /*
* The error and success command counters are global per * The error and success command counters are global per
@ -265,20 +264,16 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
shost = lpfc_shost_from_vport(vports[i]); shost = lpfc_shost_from_vport(vports[i]);
shost_for_each_device(sdev, shost) { shost_for_each_device(sdev, shost) {
new_queue_depth = if (num_rsrc_err >= sdev->queue_depth)
sdev->queue_depth * num_rsrc_err / new_queue_depth = 1;
(num_rsrc_err + num_cmd_success);
if (!new_queue_depth)
new_queue_depth = sdev->queue_depth - 1;
else else
new_queue_depth = sdev->queue_depth - new_queue_depth = sdev->queue_depth -
new_queue_depth; num_rsrc_err;
scsi_change_queue_depth(sdev, new_queue_depth); scsi_change_queue_depth(sdev, new_queue_depth);
} }
} }
lpfc_destroy_vport_work_array(phba, vports); lpfc_destroy_vport_work_array(phba, vports);
atomic_set(&phba->num_rsrc_err, 0); atomic_set(&phba->num_rsrc_err, 0);
atomic_set(&phba->num_cmd_success, 0);
} }
/** /**

View File

@ -3532,6 +3532,8 @@ static int __init target_core_init_configfs(void)
{ {
struct configfs_subsystem *subsys = &target_core_fabrics; struct configfs_subsystem *subsys = &target_core_fabrics;
struct t10_alua_lu_gp *lu_gp; struct t10_alua_lu_gp *lu_gp;
struct cred *kern_cred;
const struct cred *old_cred;
int ret; int ret;
pr_debug("TARGET_CORE[0]: Loading Generic Kernel Storage" pr_debug("TARGET_CORE[0]: Loading Generic Kernel Storage"
@ -3608,11 +3610,21 @@ static int __init target_core_init_configfs(void)
if (ret < 0) if (ret < 0)
goto out; goto out;
/* We use the kernel credentials to access the target directory */
kern_cred = prepare_kernel_cred(&init_task);
if (!kern_cred) {
ret = -ENOMEM;
goto out;
}
old_cred = override_creds(kern_cred);
target_init_dbroot(); target_init_dbroot();
revert_creds(old_cred);
put_cred(kern_cred);
return 0; return 0;
out: out:
target_xcopy_release_pt();
configfs_unregister_subsystem(subsys); configfs_unregister_subsystem(subsys);
core_dev_release_virtual_lun0(); core_dev_release_virtual_lun0();
rd_module_exit(); rd_module_exit();

View File

@ -4974,9 +4974,10 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
} }
if (usb_endpoint_maxp(&udev->ep0.desc) == i) { if (usb_endpoint_maxp(&udev->ep0.desc) == i) {
; /* Initial ep0 maxpacket guess is right */ ; /* Initial ep0 maxpacket guess is right */
} else if ((udev->speed == USB_SPEED_FULL || } else if (((udev->speed == USB_SPEED_FULL ||
udev->speed == USB_SPEED_HIGH) && udev->speed == USB_SPEED_HIGH) &&
(i == 8 || i == 16 || i == 32 || i == 64)) { (i == 8 || i == 16 || i == 32 || i == 64)) ||
(udev->speed >= USB_SPEED_SUPER && i > 0)) {
/* Initial guess is wrong; use the descriptor's value */ /* Initial guess is wrong; use the descriptor's value */
if (udev->speed == USB_SPEED_FULL) if (udev->speed == USB_SPEED_FULL)
dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i); dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);

View File

@ -102,6 +102,27 @@ static int dwc3_get_dr_mode(struct dwc3 *dwc)
return 0; return 0;
} }
void dwc3_enable_susphy(struct dwc3 *dwc, bool enable)
{
u32 reg;
reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0));
if (enable && !dwc->dis_u3_susphy_quirk)
reg |= DWC3_GUSB3PIPECTL_SUSPHY;
else
reg &= ~DWC3_GUSB3PIPECTL_SUSPHY;
dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg);
reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
if (enable && !dwc->dis_u2_susphy_quirk)
reg |= DWC3_GUSB2PHYCFG_SUSPHY;
else
reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
}
void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode) void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode)
{ {
u32 reg; u32 reg;
@ -594,11 +615,8 @@ static int dwc3_core_ulpi_init(struct dwc3 *dwc)
*/ */
static int dwc3_phy_setup(struct dwc3 *dwc) static int dwc3_phy_setup(struct dwc3 *dwc)
{ {
unsigned int hw_mode;
u32 reg; u32 reg;
hw_mode = DWC3_GHWPARAMS0_MODE(dwc->hwparams.hwparams0);
reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)); reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0));
/* /*
@ -608,21 +626,16 @@ static int dwc3_phy_setup(struct dwc3 *dwc)
reg &= ~DWC3_GUSB3PIPECTL_UX_EXIT_PX; reg &= ~DWC3_GUSB3PIPECTL_UX_EXIT_PX;
/* /*
* Above 1.94a, it is recommended to set DWC3_GUSB3PIPECTL_SUSPHY * Above DWC_usb3.0 1.94a, it is recommended to set
* to '0' during coreConsultant configuration. So default value * DWC3_GUSB3PIPECTL_SUSPHY to '0' during coreConsultant configuration.
* will be '0' when the core is reset. Application needs to set it * So default value will be '0' when the core is reset. Application
* to '1' after the core initialization is completed. * needs to set it to '1' after the core initialization is completed.
*
* Similarly for DRD controllers, GUSB3PIPECTL.SUSPENDENABLE must be
* cleared after power-on reset, and it can be set after core
* initialization.
*/ */
if (!DWC3_VER_IS_WITHIN(DWC3, ANY, 194A)) reg &= ~DWC3_GUSB3PIPECTL_SUSPHY;
reg |= DWC3_GUSB3PIPECTL_SUSPHY;
/*
* For DRD controllers, GUSB3PIPECTL.SUSPENDENABLE must be cleared after
* power-on reset, and it can be set after core initialization, which is
* after device soft-reset during initialization.
*/
if (hw_mode == DWC3_GHWPARAMS0_MODE_DRD)
reg &= ~DWC3_GUSB3PIPECTL_SUSPHY;
if (dwc->u2ss_inp3_quirk) if (dwc->u2ss_inp3_quirk)
reg |= DWC3_GUSB3PIPECTL_U2SSINP3OK; reg |= DWC3_GUSB3PIPECTL_U2SSINP3OK;
@ -648,9 +661,6 @@ static int dwc3_phy_setup(struct dwc3 *dwc)
if (dwc->tx_de_emphasis_quirk) if (dwc->tx_de_emphasis_quirk)
reg |= DWC3_GUSB3PIPECTL_TX_DEEPH(dwc->tx_de_emphasis); reg |= DWC3_GUSB3PIPECTL_TX_DEEPH(dwc->tx_de_emphasis);
if (dwc->dis_u3_susphy_quirk)
reg &= ~DWC3_GUSB3PIPECTL_SUSPHY;
if (dwc->dis_del_phy_power_chg_quirk) if (dwc->dis_del_phy_power_chg_quirk)
reg &= ~DWC3_GUSB3PIPECTL_DEPOCHANGE; reg &= ~DWC3_GUSB3PIPECTL_DEPOCHANGE;
@ -698,24 +708,15 @@ static int dwc3_phy_setup(struct dwc3 *dwc)
} }
/* /*
* Above 1.94a, it is recommended to set DWC3_GUSB2PHYCFG_SUSPHY to * Above DWC_usb3.0 1.94a, it is recommended to set
* '0' during coreConsultant configuration. So default value will * DWC3_GUSB2PHYCFG_SUSPHY to '0' during coreConsultant configuration.
* be '0' when the core is reset. Application needs to set it to * So default value will be '0' when the core is reset. Application
* '1' after the core initialization is completed. * needs to set it to '1' after the core initialization is completed.
*
* Similarly for DRD controllers, GUSB2PHYCFG.SUSPHY must be cleared
* after power-on reset, and it can be set after core initialization.
*/ */
if (!DWC3_VER_IS_WITHIN(DWC3, ANY, 194A)) reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
reg |= DWC3_GUSB2PHYCFG_SUSPHY;
/*
* For DRD controllers, GUSB2PHYCFG.SUSPHY must be cleared after
* power-on reset, and it can be set after core initialization, which is
* after device soft-reset during initialization.
*/
if (hw_mode == DWC3_GHWPARAMS0_MODE_DRD)
reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
if (dwc->dis_u2_susphy_quirk)
reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
if (dwc->dis_enblslpm_quirk) if (dwc->dis_enblslpm_quirk)
reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM; reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM;
@ -997,21 +998,6 @@ static int dwc3_core_init(struct dwc3 *dwc)
if (ret) if (ret)
goto err1; goto err1;
if (hw_mode == DWC3_GHWPARAMS0_MODE_DRD &&
!DWC3_VER_IS_WITHIN(DWC3, ANY, 194A)) {
if (!dwc->dis_u3_susphy_quirk) {
reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0));
reg |= DWC3_GUSB3PIPECTL_SUSPHY;
dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg);
}
if (!dwc->dis_u2_susphy_quirk) {
reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
reg |= DWC3_GUSB2PHYCFG_SUSPHY;
dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
}
}
dwc3_core_setup_global_control(dwc); dwc3_core_setup_global_control(dwc);
dwc3_core_num_eps(dwc); dwc3_core_num_eps(dwc);

View File

@ -1544,6 +1544,7 @@ int dwc3_event_buffers_setup(struct dwc3 *dwc);
void dwc3_event_buffers_cleanup(struct dwc3 *dwc); void dwc3_event_buffers_cleanup(struct dwc3 *dwc);
int dwc3_core_soft_reset(struct dwc3 *dwc); int dwc3_core_soft_reset(struct dwc3 *dwc);
void dwc3_enable_susphy(struct dwc3 *dwc, bool enable);
#if IS_ENABLED(CONFIG_USB_DWC3_HOST) || IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE) #if IS_ENABLED(CONFIG_USB_DWC3_HOST) || IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)
int dwc3_host_init(struct dwc3 *dwc); int dwc3_host_init(struct dwc3 *dwc);

View File

@ -2812,6 +2812,7 @@ static int __dwc3_gadget_start(struct dwc3 *dwc)
dwc3_ep0_out_start(dwc); dwc3_ep0_out_start(dwc);
dwc3_gadget_enable_irq(dwc); dwc3_gadget_enable_irq(dwc);
dwc3_enable_susphy(dwc, true);
return 0; return 0;
@ -4588,6 +4589,7 @@ void dwc3_gadget_exit(struct dwc3 *dwc)
if (!dwc->gadget) if (!dwc->gadget)
return; return;
dwc3_enable_susphy(dwc, false);
usb_del_gadget(dwc->gadget); usb_del_gadget(dwc->gadget);
dwc3_gadget_free_endpoints(dwc); dwc3_gadget_free_endpoints(dwc);
usb_put_gadget(dwc->gadget); usb_put_gadget(dwc->gadget);

View File

@ -9,9 +9,30 @@
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/usb.h>
#include <linux/usb/hcd.h>
#include "../host/xhci-plat.h"
#include "core.h" #include "core.h"
static void dwc3_xhci_plat_start(struct usb_hcd *hcd)
{
struct platform_device *pdev;
struct dwc3 *dwc;
if (!usb_hcd_is_primary_hcd(hcd))
return;
pdev = to_platform_device(hcd->self.controller);
dwc = dev_get_drvdata(pdev->dev.parent);
dwc3_enable_susphy(dwc, true);
}
static const struct xhci_plat_priv dwc3_xhci_plat_quirk = {
.plat_start = dwc3_xhci_plat_start,
};
static int dwc3_host_get_irq(struct dwc3 *dwc) static int dwc3_host_get_irq(struct dwc3 *dwc)
{ {
struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); struct platform_device *dwc3_pdev = to_platform_device(dwc->dev);
@ -115,6 +136,11 @@ int dwc3_host_init(struct dwc3 *dwc)
} }
} }
ret = platform_device_add_data(xhci, &dwc3_xhci_plat_quirk,
sizeof(struct xhci_plat_priv));
if (ret)
goto err;
ret = platform_device_add(xhci); ret = platform_device_add(xhci);
if (ret) { if (ret) {
dev_err(dwc->dev, "failed to register xHCI device\n"); dev_err(dwc->dev, "failed to register xHCI device\n");
@ -129,6 +155,7 @@ int dwc3_host_init(struct dwc3 *dwc)
void dwc3_host_exit(struct dwc3 *dwc) void dwc3_host_exit(struct dwc3 *dwc)
{ {
dwc3_enable_susphy(dwc, false);
platform_device_unregister(dwc->xhci); platform_device_unregister(dwc->xhci);
dwc->xhci = NULL; dwc->xhci = NULL;
} }

View File

@ -1969,7 +1969,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
buf[5] = 0x01; buf[5] = 0x01;
switch (ctrl->bRequestType & USB_RECIP_MASK) { switch (ctrl->bRequestType & USB_RECIP_MASK) {
case USB_RECIP_DEVICE: case USB_RECIP_DEVICE:
if (w_index != 0x4 || (w_value >> 8)) if (w_index != 0x4 || (w_value & 0xff))
break; break;
buf[6] = w_index; buf[6] = w_index;
/* Number of ext compat interfaces */ /* Number of ext compat interfaces */
@ -1985,9 +1985,9 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
} }
break; break;
case USB_RECIP_INTERFACE: case USB_RECIP_INTERFACE:
if (w_index != 0x5 || (w_value >> 8)) if (w_index != 0x5 || (w_value & 0xff))
break; break;
interface = w_value & 0xFF; interface = w_value >> 8;
if (interface >= MAX_CONFIG_INTERFACES || if (interface >= MAX_CONFIG_INTERFACES ||
!os_desc_cfg->interface[interface]) !os_desc_cfg->interface[interface])
break; break;

View File

@ -3413,7 +3413,7 @@ static int ffs_func_setup(struct usb_function *f,
__ffs_event_add(ffs, FUNCTIONFS_SETUP); __ffs_event_add(ffs, FUNCTIONFS_SETUP);
spin_unlock_irqrestore(&ffs->ev.waitq.lock, flags); spin_unlock_irqrestore(&ffs->ev.waitq.lock, flags);
return creq->wLength == 0 ? USB_GADGET_DELAYED_STATUS : 0; return ffs->ev.setup.wLength == 0 ? USB_GADGET_DELAYED_STATUS : 0;
} }
static bool ffs_func_req_match(struct usb_function *f, static bool ffs_func_req_match(struct usb_function *f,

View File

@ -890,6 +890,7 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd)
/* Check for an all 1's result which is a typical consequence /* Check for an all 1's result which is a typical consequence
* of dead, unclocked, or unplugged (CardBus...) devices * of dead, unclocked, or unplugged (CardBus...) devices
*/ */
again:
if (ints == ~(u32)0) { if (ints == ~(u32)0) {
ohci->rh_state = OHCI_RH_HALTED; ohci->rh_state = OHCI_RH_HALTED;
ohci_dbg (ohci, "device removed!\n"); ohci_dbg (ohci, "device removed!\n");
@ -984,6 +985,13 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd)
} }
spin_unlock(&ohci->lock); spin_unlock(&ohci->lock);
/* repeat until all enabled interrupts are handled */
if (ohci->rh_state != OHCI_RH_HALTED) {
ints = ohci_readl(ohci, &regs->intrstatus);
if (ints && (ints & ohci_readl(ohci, &regs->intrenable)))
goto again;
}
return IRQ_HANDLED; return IRQ_HANDLED;
} }

View File

@ -8,7 +8,9 @@
#ifndef _XHCI_PLAT_H #ifndef _XHCI_PLAT_H
#define _XHCI_PLAT_H #define _XHCI_PLAT_H
#include "xhci.h" /* for hcd_to_xhci() */ struct device;
struct platform_device;
struct usb_hcd;
struct xhci_plat_priv { struct xhci_plat_priv {
const char *firmware_name; const char *firmware_name;

View File

@ -854,7 +854,7 @@ void ucsi_connector_change(struct ucsi *ucsi, u8 num)
struct ucsi_connector *con = &ucsi->connector[num - 1]; struct ucsi_connector *con = &ucsi->connector[num - 1];
if (!(ucsi->ntfy & UCSI_ENABLE_NTFY_CONNECTOR_CHANGE)) { if (!(ucsi->ntfy & UCSI_ENABLE_NTFY_CONNECTOR_CHANGE)) {
dev_dbg(ucsi->dev, "Bogus connector change event\n"); dev_dbg(ucsi->dev, "Early connector change event\n");
return; return;
} }
@ -1242,6 +1242,7 @@ static int ucsi_init(struct ucsi *ucsi)
{ {
struct ucsi_connector *con; struct ucsi_connector *con;
u64 command, ntfy; u64 command, ntfy;
u32 cci;
int ret; int ret;
int i; int i;
@ -1293,6 +1294,15 @@ static int ucsi_init(struct ucsi *ucsi)
goto err_unregister; goto err_unregister;
ucsi->ntfy = ntfy; ucsi->ntfy = ntfy;
mutex_lock(&ucsi->ppm_lock);
ret = ucsi->ops->read(ucsi, UCSI_CCI, &cci, sizeof(cci));
mutex_unlock(&ucsi->ppm_lock);
if (ret)
return ret;
if (UCSI_CCI_CONNECTOR(cci))
ucsi_connector_change(ucsi, UCSI_CCI_CONNECTOR(cci));
return 0; return 0;
err_unregister: err_unregister:

View File

@ -18,6 +18,7 @@
#include <linux/usb.h> #include <linux/usb.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/sched/task.h> #include <linux/sched/task.h>
#include <linux/kcov.h>
#include <uapi/linux/usbip.h> #include <uapi/linux/usbip.h>
#undef pr_fmt #undef pr_fmt

View File

@ -685,6 +685,7 @@ const struct file_operations v9fs_file_operations = {
.splice_read = generic_file_splice_read, .splice_read = generic_file_splice_read,
.splice_write = iter_file_splice_write, .splice_write = iter_file_splice_write,
.fsync = v9fs_file_fsync, .fsync = v9fs_file_fsync,
.setlease = simple_nosetlease,
}; };
const struct file_operations v9fs_file_operations_dotl = { const struct file_operations v9fs_file_operations_dotl = {
@ -726,4 +727,5 @@ const struct file_operations v9fs_mmap_file_operations_dotl = {
.splice_read = generic_file_splice_read, .splice_read = generic_file_splice_read,
.splice_write = iter_file_splice_write, .splice_write = iter_file_splice_write,
.fsync = v9fs_file_fsync_dotl, .fsync = v9fs_file_fsync_dotl,
.setlease = simple_nosetlease,
}; };

View File

@ -86,7 +86,7 @@ static int p9mode2perm(struct v9fs_session_info *v9ses,
int res; int res;
int mode = stat->mode; int mode = stat->mode;
res = mode & S_IALLUGO; res = mode & 0777; /* S_IRWXUGO */
if (v9fs_proto_dotu(v9ses)) { if (v9fs_proto_dotu(v9ses)) {
if ((mode & P9_DMSETUID) == P9_DMSETUID) if ((mode & P9_DMSETUID) == P9_DMSETUID)
res |= S_ISUID; res |= S_ISUID;
@ -177,6 +177,9 @@ int v9fs_uflags2omode(int uflags, int extended)
break; break;
} }
if (uflags & O_TRUNC)
ret |= P9_OTRUNC;
if (extended) { if (extended) {
if (uflags & O_EXCL) if (uflags & O_EXCL)
ret |= P9_OEXCL; ret |= P9_OEXCL;

View File

@ -336,6 +336,7 @@ static const struct super_operations v9fs_super_ops = {
.alloc_inode = v9fs_alloc_inode, .alloc_inode = v9fs_alloc_inode,
.free_inode = v9fs_free_inode, .free_inode = v9fs_free_inode,
.statfs = simple_statfs, .statfs = simple_statfs,
.drop_inode = v9fs_drop_inode,
.evict_inode = v9fs_evict_inode, .evict_inode = v9fs_evict_inode,
.show_options = v9fs_show_options, .show_options = v9fs_show_options,
.umount_begin = v9fs_umount_begin, .umount_begin = v9fs_umount_begin,

View File

@ -2070,7 +2070,7 @@ void btrfs_clear_delalloc_extent(struct inode *vfs_inode,
*/ */
if (*bits & EXTENT_CLEAR_META_RESV && if (*bits & EXTENT_CLEAR_META_RESV &&
root != fs_info->tree_root) root != fs_info->tree_root)
btrfs_delalloc_release_metadata(inode, len, false); btrfs_delalloc_release_metadata(inode, len, true);
/* For sanity tests. */ /* For sanity tests. */
if (btrfs_is_testing(fs_info)) if (btrfs_is_testing(fs_info))

View File

@ -7339,8 +7339,8 @@ long btrfs_ioctl_send(struct file *mnt_file, struct btrfs_ioctl_send_args *arg)
sctx->waiting_dir_moves = RB_ROOT; sctx->waiting_dir_moves = RB_ROOT;
sctx->orphan_dirs = RB_ROOT; sctx->orphan_dirs = RB_ROOT;
sctx->clone_roots = kvcalloc(sizeof(*sctx->clone_roots), sctx->clone_roots = kvcalloc(arg->clone_sources_count + 1,
arg->clone_sources_count + 1, sizeof(*sctx->clone_roots),
GFP_KERNEL); GFP_KERNEL);
if (!sctx->clone_roots) { if (!sctx->clone_roots) {
ret = -ENOMEM; ret = -ENOMEM;

View File

@ -1343,6 +1343,7 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans)
radix_tree_tag_clear(&fs_info->fs_roots_radix, radix_tree_tag_clear(&fs_info->fs_roots_radix,
(unsigned long)root->root_key.objectid, (unsigned long)root->root_key.objectid,
BTRFS_ROOT_TRANS_TAG); BTRFS_ROOT_TRANS_TAG);
btrfs_qgroup_free_meta_all_pertrans(root);
spin_unlock(&fs_info->fs_roots_radix_lock); spin_unlock(&fs_info->fs_roots_radix_lock);
btrfs_free_log(trans, root); btrfs_free_log(trans, root);
@ -1367,7 +1368,6 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans)
if (ret2) if (ret2)
return ret2; return ret2;
spin_lock(&fs_info->fs_roots_radix_lock); spin_lock(&fs_info->fs_roots_radix_lock);
btrfs_qgroup_free_meta_all_pertrans(root);
} }
} }
spin_unlock(&fs_info->fs_roots_radix_lock); spin_unlock(&fs_info->fs_roots_radix_lock);

View File

@ -1266,25 +1266,32 @@ static int open_fs_devices(struct btrfs_fs_devices *fs_devices,
struct btrfs_device *device; struct btrfs_device *device;
struct btrfs_device *latest_dev = NULL; struct btrfs_device *latest_dev = NULL;
struct btrfs_device *tmp_device; struct btrfs_device *tmp_device;
int ret = 0;
flags |= FMODE_EXCL; flags |= FMODE_EXCL;
list_for_each_entry_safe(device, tmp_device, &fs_devices->devices, list_for_each_entry_safe(device, tmp_device, &fs_devices->devices,
dev_list) { dev_list) {
int ret; int ret2;
ret = btrfs_open_one_device(fs_devices, device, flags, holder); ret2 = btrfs_open_one_device(fs_devices, device, flags, holder);
if (ret == 0 && if (ret2 == 0 &&
(!latest_dev || device->generation > latest_dev->generation)) { (!latest_dev || device->generation > latest_dev->generation)) {
latest_dev = device; latest_dev = device;
} else if (ret == -ENODATA) { } else if (ret2 == -ENODATA) {
fs_devices->num_devices--; fs_devices->num_devices--;
list_del(&device->dev_list); list_del(&device->dev_list);
btrfs_free_device(device); btrfs_free_device(device);
} }
if (ret == 0 && ret2 != 0)
ret = ret2;
} }
if (fs_devices->open_devices == 0)
if (fs_devices->open_devices == 0) {
if (ret)
return ret;
return -EINVAL; return -EINVAL;
}
fs_devices->opened = 1; fs_devices->opened = 1;
fs_devices->latest_bdev = latest_dev->bdev; fs_devices->latest_bdev = latest_dev->bdev;

View File

@ -1758,7 +1758,8 @@ static int punch_hole(struct gfs2_inode *ip, u64 offset, u64 length)
struct buffer_head *dibh, *bh; struct buffer_head *dibh, *bh;
struct gfs2_holder rd_gh; struct gfs2_holder rd_gh;
unsigned int bsize_shift = sdp->sd_sb.sb_bsize_shift; unsigned int bsize_shift = sdp->sd_sb.sb_bsize_shift;
u64 lblock = (offset + (1 << bsize_shift) - 1) >> bsize_shift; unsigned int bsize = 1 << bsize_shift;
u64 lblock = (offset + bsize - 1) >> bsize_shift;
__u16 start_list[GFS2_MAX_META_HEIGHT]; __u16 start_list[GFS2_MAX_META_HEIGHT];
__u16 __end_list[GFS2_MAX_META_HEIGHT], *end_list = NULL; __u16 __end_list[GFS2_MAX_META_HEIGHT], *end_list = NULL;
unsigned int start_aligned, end_aligned; unsigned int start_aligned, end_aligned;
@ -1769,7 +1770,7 @@ static int punch_hole(struct gfs2_inode *ip, u64 offset, u64 length)
u64 prev_bnr = 0; u64 prev_bnr = 0;
__be64 *start, *end; __be64 *start, *end;
if (offset >= maxsize) { if (offset + bsize - 1 >= maxsize) {
/* /*
* The starting point lies beyond the allocated meta-data; * The starting point lies beyond the allocated meta-data;
* there are no blocks do deallocate. * there are no blocks do deallocate.

View File

@ -73,7 +73,6 @@ const struct rpc_program nfs_program = {
.number = NFS_PROGRAM, .number = NFS_PROGRAM,
.nrvers = ARRAY_SIZE(nfs_version), .nrvers = ARRAY_SIZE(nfs_version),
.version = nfs_version, .version = nfs_version,
.stats = &nfs_rpcstat,
.pipe_dir_name = NFS_PIPE_DIRNAME, .pipe_dir_name = NFS_PIPE_DIRNAME,
}; };
@ -501,6 +500,7 @@ int nfs_create_rpc_client(struct nfs_client *clp,
const struct nfs_client_initdata *cl_init, const struct nfs_client_initdata *cl_init,
rpc_authflavor_t flavor) rpc_authflavor_t flavor)
{ {
struct nfs_net *nn = net_generic(clp->cl_net, nfs_net_id);
struct rpc_clnt *clnt = NULL; struct rpc_clnt *clnt = NULL;
struct rpc_create_args args = { struct rpc_create_args args = {
.net = clp->cl_net, .net = clp->cl_net,
@ -512,6 +512,7 @@ int nfs_create_rpc_client(struct nfs_client *clp,
.servername = clp->cl_hostname, .servername = clp->cl_hostname,
.nodename = cl_init->nodename, .nodename = cl_init->nodename,
.program = &nfs_program, .program = &nfs_program,
.stats = &nn->rpcstats,
.version = clp->rpc_ops->version, .version = clp->rpc_ops->version,
.authflavor = flavor, .authflavor = flavor,
.cred = cl_init->cred, .cred = cl_init->cred,
@ -1110,6 +1111,8 @@ void nfs_clients_init(struct net *net)
#endif #endif
spin_lock_init(&nn->nfs_client_lock); spin_lock_init(&nn->nfs_client_lock);
nn->boot_time = ktime_get_real(); nn->boot_time = ktime_get_real();
memset(&nn->rpcstats, 0, sizeof(nn->rpcstats));
nn->rpcstats.program = &nfs_program;
nfs_netns_sysfs_setup(nn, net); nfs_netns_sysfs_setup(nn, net);
} }

View File

@ -2225,12 +2225,21 @@ EXPORT_SYMBOL_GPL(nfs_net_id);
static int nfs_net_init(struct net *net) static int nfs_net_init(struct net *net)
{ {
struct nfs_net *nn = net_generic(net, nfs_net_id);
nfs_clients_init(net); nfs_clients_init(net);
if (!rpc_proc_register(net, &nn->rpcstats)) {
nfs_clients_exit(net);
return -ENOMEM;
}
return nfs_fs_proc_net_init(net); return nfs_fs_proc_net_init(net);
} }
static void nfs_net_exit(struct net *net) static void nfs_net_exit(struct net *net)
{ {
rpc_proc_unregister(net, "nfs");
nfs_fs_proc_net_exit(net); nfs_fs_proc_net_exit(net);
nfs_clients_exit(net); nfs_clients_exit(net);
} }
@ -2289,15 +2298,12 @@ static int __init init_nfs_fs(void)
if (err) if (err)
goto out1; goto out1;
rpc_proc_register(&init_net, &nfs_rpcstat);
err = register_nfs_fs(); err = register_nfs_fs();
if (err) if (err)
goto out0; goto out0;
return 0; return 0;
out0: out0:
rpc_proc_unregister(&init_net, "nfs");
nfs_destroy_directcache(); nfs_destroy_directcache();
out1: out1:
nfs_destroy_writepagecache(); nfs_destroy_writepagecache();
@ -2330,7 +2336,6 @@ static void __exit exit_nfs_fs(void)
nfs_destroy_nfspagecache(); nfs_destroy_nfspagecache();
nfs_fscache_unregister(); nfs_fscache_unregister();
unregister_pernet_subsys(&nfs_net_ops); unregister_pernet_subsys(&nfs_net_ops);
rpc_proc_unregister(&init_net, "nfs");
unregister_nfs_fs(); unregister_nfs_fs();
nfs_fs_proc_exit(); nfs_fs_proc_exit();
nfsiod_stop(); nfsiod_stop();

View File

@ -435,8 +435,6 @@ int nfs_try_get_tree(struct fs_context *);
int nfs_get_tree_common(struct fs_context *); int nfs_get_tree_common(struct fs_context *);
void nfs_kill_super(struct super_block *); void nfs_kill_super(struct super_block *);
extern struct rpc_stat nfs_rpcstat;
extern int __init register_nfs_fs(void); extern int __init register_nfs_fs(void);
extern void __exit unregister_nfs_fs(void); extern void __exit unregister_nfs_fs(void);
extern bool nfs_sb_active(struct super_block *sb); extern bool nfs_sb_active(struct super_block *sb);

View File

@ -9,6 +9,7 @@
#include <linux/nfs4.h> #include <linux/nfs4.h>
#include <net/net_namespace.h> #include <net/net_namespace.h>
#include <net/netns/generic.h> #include <net/netns/generic.h>
#include <linux/sunrpc/stats.h>
struct bl_dev_msg { struct bl_dev_msg {
int32_t status; int32_t status;
@ -34,6 +35,7 @@ struct nfs_net {
struct nfs_netns_client *nfs_client; struct nfs_netns_client *nfs_client;
spinlock_t nfs_client_lock; spinlock_t nfs_client_lock;
ktime_t boot_time; ktime_t boot_time;
struct rpc_stat rpcstats;
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
struct proc_dir_entry *proc_nfsfs; struct proc_dir_entry *proc_nfsfs;
#endif #endif

View File

@ -2,6 +2,7 @@
#ifndef _LINUX_KCOV_H #ifndef _LINUX_KCOV_H
#define _LINUX_KCOV_H #define _LINUX_KCOV_H
#include <linux/sched.h>
#include <uapi/linux/kcov.h> #include <uapi/linux/kcov.h>
struct task_struct; struct task_struct;

View File

@ -14,7 +14,6 @@
#include <linux/pid.h> #include <linux/pid.h>
#include <linux/sem.h> #include <linux/sem.h>
#include <linux/shm.h> #include <linux/shm.h>
#include <linux/kcov.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/plist.h> #include <linux/plist.h>
#include <linux/hrtimer.h> #include <linux/hrtimer.h>

View File

@ -2653,6 +2653,21 @@ static inline void skb_mac_header_rebuild(struct sk_buff *skb)
} }
} }
/* Move the full mac header up to current network_header.
* Leaves skb->data pointing at offset skb->mac_len into the mac_header.
* Must be provided the complete mac header length.
*/
static inline void skb_mac_header_rebuild_full(struct sk_buff *skb, u32 full_mac_len)
{
if (skb_mac_header_was_set(skb)) {
const unsigned char *old_mac = skb_mac_header(skb);
skb_set_mac_header(skb, -full_mac_len);
memmove(skb_mac_header(skb), old_mac, full_mac_len);
__skb_push(skb, full_mac_len - skb->mac_len);
}
}
static inline int skb_checksum_start_offset(const struct sk_buff *skb) static inline int skb_checksum_start_offset(const struct sk_buff *skb)
{ {
return skb->csum_start - skb_headroom(skb); return skb->csum_start - skb_headroom(skb);

View File

@ -126,6 +126,7 @@ struct rpc_create_args {
const char *servername; const char *servername;
const char *nodename; const char *nodename;
const struct rpc_program *program; const struct rpc_program *program;
struct rpc_stat *stats;
u32 prognumber; /* overrides program->number */ u32 prognumber; /* overrides program->number */
u32 version; u32 version;
rpc_authflavor_t authflavor; rpc_authflavor_t authflavor;

View File

@ -1023,6 +1023,9 @@ struct xfrm_offload {
#define CRYPTO_INVALID_PACKET_SYNTAX 64 #define CRYPTO_INVALID_PACKET_SYNTAX 64
#define CRYPTO_INVALID_PROTOCOL 128 #define CRYPTO_INVALID_PROTOCOL 128
/* Used to keep whole l2 header for transport mode GRO */
__u32 orig_mac_len;
__u8 proto; __u8 proto;
}; };

View File

@ -260,7 +260,11 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords)
} else { } else {
for (end = buf; *end && !isspace(*end); end++) for (end = buf; *end && !isspace(*end); end++)
; ;
BUG_ON(end == buf); if (end == buf) {
pr_err("parse err after word:%d=%s\n", nwords,
nwords ? words[nwords - 1] : "<none>");
return -EINVAL;
}
} }
/* `buf' is start of word, `end' is one past its end */ /* `buf' is start of word, `end' is one past its end */

View File

@ -435,6 +435,9 @@ static void l2cap_chan_timeout(struct work_struct *work)
BT_DBG("chan %p state %s", chan, state_to_string(chan->state)); BT_DBG("chan %p state %s", chan, state_to_string(chan->state));
if (!conn)
return;
mutex_lock(&conn->chan_lock); mutex_lock(&conn->chan_lock);
/* __set_chan_timer() calls l2cap_chan_hold(chan) while scheduling /* __set_chan_timer() calls l2cap_chan_hold(chan) while scheduling
* this work. No need to call l2cap_chan_hold(chan) here again. * this work. No need to call l2cap_chan_hold(chan) here again.

View File

@ -83,6 +83,10 @@ static void sco_sock_timeout(struct work_struct *work)
struct sock *sk; struct sock *sk;
sco_conn_lock(conn); sco_conn_lock(conn);
if (!conn->hcon) {
sco_conn_unlock(conn);
return;
}
sk = conn->sk; sk = conn->sk;
if (sk) if (sk)
sock_hold(sk); sock_hold(sk);

View File

@ -245,6 +245,7 @@ static void maybe_deliver_addr(struct net_bridge_port *p, struct sk_buff *skb,
{ {
struct net_device *dev = BR_INPUT_SKB_CB(skb)->brdev; struct net_device *dev = BR_INPUT_SKB_CB(skb)->brdev;
const unsigned char *src = eth_hdr(skb)->h_source; const unsigned char *src = eth_hdr(skb)->h_source;
struct sk_buff *nskb;
if (!should_deliver(p, skb)) if (!should_deliver(p, skb))
return; return;
@ -253,12 +254,16 @@ static void maybe_deliver_addr(struct net_bridge_port *p, struct sk_buff *skb,
if (skb->dev == p->dev && ether_addr_equal(src, addr)) if (skb->dev == p->dev && ether_addr_equal(src, addr))
return; return;
skb = skb_copy(skb, GFP_ATOMIC); __skb_push(skb, ETH_HLEN);
if (!skb) { nskb = pskb_copy(skb, GFP_ATOMIC);
__skb_pull(skb, ETH_HLEN);
if (!nskb) {
dev->stats.tx_dropped++; dev->stats.tx_dropped++;
return; return;
} }
skb = nskb;
__skb_pull(skb, ETH_HLEN);
if (!is_broadcast_ether_addr(addr)) if (!is_broadcast_ether_addr(addr))
memcpy(eth_hdr(skb)->h_dest, addr, ETH_ALEN); memcpy(eth_hdr(skb)->h_dest, addr, ETH_ALEN);

View File

@ -74,12 +74,15 @@ DEFINE_COOKIE(net_cookie);
static struct net_generic *net_alloc_generic(void) static struct net_generic *net_alloc_generic(void)
{ {
unsigned int gen_ptrs = READ_ONCE(max_gen_ptrs);
unsigned int generic_size;
struct net_generic *ng; struct net_generic *ng;
unsigned int generic_size = offsetof(struct net_generic, ptr[max_gen_ptrs]);
generic_size = offsetof(struct net_generic, ptr[gen_ptrs]);
ng = kzalloc(generic_size, GFP_KERNEL); ng = kzalloc(generic_size, GFP_KERNEL);
if (ng) if (ng)
ng->s.len = max_gen_ptrs; ng->s.len = gen_ptrs;
return ng; return ng;
} }
@ -1228,7 +1231,11 @@ static int register_pernet_operations(struct list_head *list,
if (error < 0) if (error < 0)
return error; return error;
*ops->id = error; *ops->id = error;
max_gen_ptrs = max(max_gen_ptrs, *ops->id + 1); /* This does not require READ_ONCE as writers already hold
* pernet_ops_rwsem. But WRITE_ONCE is needed to protect
* net_alloc_generic.
*/
WRITE_ONCE(max_gen_ptrs, max(max_gen_ptrs, *ops->id + 1));
} }
error = __register_pernet_operations(list, ops); error = __register_pernet_operations(list, ops);
if (error) { if (error) {

View File

@ -2379,7 +2379,7 @@ static int do_setvfinfo(struct net_device *dev, struct nlattr **tb)
nla_for_each_nested(attr, tb[IFLA_VF_VLAN_LIST], rem) { nla_for_each_nested(attr, tb[IFLA_VF_VLAN_LIST], rem) {
if (nla_type(attr) != IFLA_VF_VLAN_INFO || if (nla_type(attr) != IFLA_VF_VLAN_INFO ||
nla_len(attr) < NLA_HDRLEN) { nla_len(attr) < sizeof(struct ifla_vf_vlan_info)) {
return -EINVAL; return -EINVAL;
} }
if (len >= MAX_VLAN_LIST_LEN) if (len >= MAX_VLAN_LIST_LEN)

View File

@ -60,6 +60,7 @@
#include <linux/prefetch.h> #include <linux/prefetch.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
#include <linux/mpls.h> #include <linux/mpls.h>
#include <linux/kcov.h>
#include <net/protocol.h> #include <net/protocol.h>
#include <net/dst.h> #include <net/dst.h>
@ -1518,11 +1519,17 @@ static inline int skb_alloc_rx_flag(const struct sk_buff *skb)
struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t gfp_mask) struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t gfp_mask)
{ {
int headerlen = skb_headroom(skb); struct sk_buff *n;
unsigned int size = skb_end_offset(skb) + skb->data_len; unsigned int size;
struct sk_buff *n = __alloc_skb(size, gfp_mask, int headerlen;
skb_alloc_rx_flag(skb), NUMA_NO_NODE);
if (WARN_ON_ONCE(skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST))
return NULL;
headerlen = skb_headroom(skb);
size = skb_end_offset(skb) + skb->data_len;
n = __alloc_skb(size, gfp_mask,
skb_alloc_rx_flag(skb), NUMA_NO_NODE);
if (!n) if (!n)
return NULL; return NULL;
@ -1783,12 +1790,17 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
/* /*
* Allocate the copy buffer * Allocate the copy buffer
*/ */
struct sk_buff *n = __alloc_skb(newheadroom + skb->len + newtailroom,
gfp_mask, skb_alloc_rx_flag(skb),
NUMA_NO_NODE);
int oldheadroom = skb_headroom(skb);
int head_copy_len, head_copy_off; int head_copy_len, head_copy_off;
struct sk_buff *n;
int oldheadroom;
if (WARN_ON_ONCE(skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST))
return NULL;
oldheadroom = skb_headroom(skb);
n = __alloc_skb(newheadroom + skb->len + newtailroom,
gfp_mask, skb_alloc_rx_flag(skb),
NUMA_NO_NODE);
if (!n) if (!n)
return NULL; return NULL;

View File

@ -441,7 +441,7 @@ int __sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
unsigned long flags; unsigned long flags;
struct sk_buff_head *list = &sk->sk_receive_queue; struct sk_buff_head *list = &sk->sk_receive_queue;
if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) { if (atomic_read(&sk->sk_rmem_alloc) >= READ_ONCE(sk->sk_rcvbuf)) {
atomic_inc(&sk->sk_drops); atomic_inc(&sk->sk_drops);
trace_sock_rcvqueue_full(sk, skb); trace_sock_rcvqueue_full(sk, skb);
return -ENOMEM; return -ENOMEM;
@ -493,7 +493,7 @@ int __sk_receive_skb(struct sock *sk, struct sk_buff *skb,
skb->dev = NULL; skb->dev = NULL;
if (sk_rcvqueues_full(sk, sk->sk_rcvbuf)) { if (sk_rcvqueues_full(sk, READ_ONCE(sk->sk_rcvbuf))) {
atomic_inc(&sk->sk_drops); atomic_inc(&sk->sk_drops);
goto discard_and_relse; goto discard_and_relse;
} }

View File

@ -2498,7 +2498,7 @@ void tcp_shutdown(struct sock *sk, int how)
/* If we've already sent a FIN, or it's a closed state, skip this. */ /* If we've already sent a FIN, or it's a closed state, skip this. */
if ((1 << sk->sk_state) & if ((1 << sk->sk_state) &
(TCPF_ESTABLISHED | TCPF_SYN_SENT | (TCPF_ESTABLISHED | TCPF_SYN_SENT |
TCPF_SYN_RECV | TCPF_CLOSE_WAIT)) { TCPF_CLOSE_WAIT)) {
/* Clear out any half completed packets. FIN if needed. */ /* Clear out any half completed packets. FIN if needed. */
if (tcp_close_state(sk)) if (tcp_close_state(sk))
tcp_send_fin(sk); tcp_send_fin(sk);
@ -2583,7 +2583,7 @@ void __tcp_close(struct sock *sk, long timeout)
* machine. State transitions: * machine. State transitions:
* *
* TCP_ESTABLISHED -> TCP_FIN_WAIT1 * TCP_ESTABLISHED -> TCP_FIN_WAIT1
* TCP_SYN_RECV -> TCP_FIN_WAIT1 (forget it, it's impossible) * TCP_SYN_RECV -> TCP_FIN_WAIT1 (it is difficult)
* TCP_CLOSE_WAIT -> TCP_LAST_ACK * TCP_CLOSE_WAIT -> TCP_LAST_ACK
* *
* are legal only when FIN has been sent (i.e. in window), * are legal only when FIN has been sent (i.e. in window),

View File

@ -6518,6 +6518,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
tcp_initialize_rcv_mss(sk); tcp_initialize_rcv_mss(sk);
tcp_fast_path_on(tp); tcp_fast_path_on(tp);
if (sk->sk_shutdown & SEND_SHUTDOWN)
tcp_shutdown(sk, SEND_SHUTDOWN);
break; break;
case TCP_FIN_WAIT1: { case TCP_FIN_WAIT1: {

View File

@ -151,6 +151,12 @@ int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp)
if (tcptw->tw_ts_recent_stamp && if (tcptw->tw_ts_recent_stamp &&
(!twp || (reuse && time_after32(ktime_get_seconds(), (!twp || (reuse && time_after32(ktime_get_seconds(),
tcptw->tw_ts_recent_stamp)))) { tcptw->tw_ts_recent_stamp)))) {
/* inet_twsk_hashdance() sets sk_refcnt after putting twsk
* and releasing the bucket lock.
*/
if (unlikely(!refcount_inc_not_zero(&sktw->sk_refcnt)))
return 0;
/* In case of repair and re-using TIME-WAIT sockets we still /* In case of repair and re-using TIME-WAIT sockets we still
* want to be sure that it is safe as above but honor the * want to be sure that it is safe as above but honor the
* sequence numbers and time stamps set as part of the repair * sequence numbers and time stamps set as part of the repair
@ -171,7 +177,7 @@ int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp)
tp->rx_opt.ts_recent = tcptw->tw_ts_recent; tp->rx_opt.ts_recent = tcptw->tw_ts_recent;
tp->rx_opt.ts_recent_stamp = tcptw->tw_ts_recent_stamp; tp->rx_opt.ts_recent_stamp = tcptw->tw_ts_recent_stamp;
} }
sock_hold(sktw);
return 1; return 1;
} }

View File

@ -3440,7 +3440,9 @@ void tcp_send_fin(struct sock *sk)
return; return;
} }
} else { } else {
skb = alloc_skb_fclone(MAX_TCP_HEADER, sk->sk_allocation); skb = alloc_skb_fclone(MAX_TCP_HEADER,
sk_gfp_mask(sk, GFP_ATOMIC |
__GFP_NOWARN));
if (unlikely(!skb)) if (unlikely(!skb))
return; return;

View File

@ -431,6 +431,7 @@ static struct sk_buff *udp_gro_receive_segment(struct list_head *head,
struct sk_buff *p; struct sk_buff *p;
unsigned int ulen; unsigned int ulen;
int ret = 0; int ret = 0;
int flush;
/* requires non zero csum, for symmetry with GSO */ /* requires non zero csum, for symmetry with GSO */
if (!uh->check) { if (!uh->check) {
@ -464,13 +465,22 @@ static struct sk_buff *udp_gro_receive_segment(struct list_head *head,
return p; return p;
} }
flush = NAPI_GRO_CB(p)->flush;
if (NAPI_GRO_CB(p)->flush_id != 1 ||
NAPI_GRO_CB(p)->count != 1 ||
!NAPI_GRO_CB(p)->is_atomic)
flush |= NAPI_GRO_CB(p)->flush_id;
else
NAPI_GRO_CB(p)->is_atomic = false;
/* Terminate the flow on len mismatch or if it grow "too much". /* Terminate the flow on len mismatch or if it grow "too much".
* Under small packet flood GRO count could elsewhere grow a lot * Under small packet flood GRO count could elsewhere grow a lot
* leading to excessive truesize values. * leading to excessive truesize values.
* On len mismatch merge the first packet shorter than gso_size, * On len mismatch merge the first packet shorter than gso_size,
* otherwise complete the GRO packet. * otherwise complete the GRO packet.
*/ */
if (ulen > ntohs(uh2->len)) { if (ulen > ntohs(uh2->len) || flush) {
pp = p; pp = p;
} else { } else {
if (NAPI_GRO_CB(skb)->is_flist) { if (NAPI_GRO_CB(skb)->is_flist) {

View File

@ -61,7 +61,11 @@ int xfrm4_transport_finish(struct sk_buff *skb, int async)
ip_send_check(iph); ip_send_check(iph);
if (xo && (xo->flags & XFRM_GRO)) { if (xo && (xo->flags & XFRM_GRO)) {
skb_mac_header_rebuild(skb); /* The full l2 header needs to be preserved so that re-injecting the packet at l2
* works correctly in the presence of vlan tags.
*/
skb_mac_header_rebuild_full(skb, xo->orig_mac_len);
skb_reset_network_header(skb);
skb_reset_transport_header(skb); skb_reset_transport_header(skb);
return 0; return 0;
} }

View File

@ -232,8 +232,12 @@ static int __fib6_rule_action(struct fib_rule *rule, struct flowi *flp,
rt = pol_lookup_func(lookup, rt = pol_lookup_func(lookup,
net, table, flp6, arg->lookup_data, flags); net, table, flp6, arg->lookup_data, flags);
if (rt != net->ipv6.ip6_null_entry) { if (rt != net->ipv6.ip6_null_entry) {
struct inet6_dev *idev = ip6_dst_idev(&rt->dst);
if (!idev)
goto again;
err = fib6_rule_saddr(net, rule, flags, flp6, err = fib6_rule_saddr(net, rule, flags, flp6,
ip6_dst_idev(&rt->dst)->dev); idev->dev);
if (err == -EAGAIN) if (err == -EAGAIN)
goto again; goto again;

View File

@ -56,7 +56,11 @@ int xfrm6_transport_finish(struct sk_buff *skb, int async)
skb_postpush_rcsum(skb, skb_network_header(skb), nhlen); skb_postpush_rcsum(skb, skb_network_header(skb), nhlen);
if (xo && (xo->flags & XFRM_GRO)) { if (xo && (xo->flags & XFRM_GRO)) {
skb_mac_header_rebuild(skb); /* The full l2 header needs to be preserved so that re-injecting the packet at l2
* works correctly in the presence of vlan tags.
*/
skb_mac_header_rebuild_full(skb, xo->orig_mac_len);
skb_reset_network_header(skb);
skb_reset_transport_header(skb); skb_reset_transport_header(skb);
return 0; return 0;
} }

View File

@ -136,6 +136,9 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb,
/* checksums verified by L2TP */ /* checksums verified by L2TP */
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
/* drop outer flow-hash */
skb_clear_hash(skb);
skb_dst_drop(skb); skb_dst_drop(skb);
nf_reset_ct(skb); nf_reset_ct(skb);

Some files were not shown because too many files have changed in this diff Show More