This is the 4.14.68 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAluPhTQACgkQONu9yGCS
aT7uMA/9GlKiVnqhXCRDZUS6zbbflwFRQK3nkXQ1xi4hGea6HzDJO1ADvmB36SQC
I/stuXN4pA0k2kuCLijqzVE7h4DA7S3Jemok+gISFxJH7tib2fsDFVEu1fN+e8xE
Npd16tdb0KKAGDCuuYtRatpWdmmsCqdVU51wtLTvOMq19vT2w2E+2gKTgzQkehTp
Bo6aF33bhfiWB/trea2lFFKpkrFF92bZubgx/NK8MW799XQvnWN8OkSSt85WfqdA
kFfcJSJF32s+q10BsZfapPuEzxbnlsB97/SvoW2hHQmAm4T8f/78nGD5/N8kAS2C
ZuKElZnZAyR0gv+4G4M3Bz1GU/vPQ7yh9zIIKW99FdsvY9Q1uilJBtRa6uuViOiu
3NoBFfYtOY2J7jp41gJeNctrMvSgfUSiiNgw+rP5eUbydsFMezcAgj6DmroyJtkY
Wt3VAvREtOzSyjet7IYrod1Qj9xJmGKJDQ5iRLwjjV2CVyFyxf94CTb6gJf/9A4u
YOCugisS/bix6hncjlKzf+EZN1YXXLX0olB4Smuv5C7UpmAWX2dLQGqhbxVSeJUh
zCC6vEX/Z86HtL4SVUSqgRoDi8URLQAftTU0mqPtP34qlYTOBGvlVJM9Dhe183Pg
bXpye3WpWSgKujrPY6j336A5QjzLpywUZCREmlcG9CatRO5j0F4=
=dt34
-----END PGP SIGNATURE-----
Merge 4.14.68 into android-4.14
Changes in 4.14.68
crypto: vmx - Use skcipher for ctr fallback
vti6: fix PMTU caching and reporting on xmit
xfrm: fix missing dst_release() after policy blocking lbcast and multicast
xfrm: free skb if nlsk pointer is NULL
esp6: fix memleak on error path in esp6_input
mac80211: add stations tied to AP_VLANs during hw reconfig
ext4: clear mmp sequence number when remounting read-only
nl80211: Add a missing break in parse_station_flags
drm/bridge: adv7511: Reset registers on hotplug
scsi: target: iscsi: cxgbit: fix max iso npdu calculation
scsi: libiscsi: fix possible NULL pointer dereference in case of TMF
drm/imx: imx-ldb: disable LDB on driver bind
drm/imx: imx-ldb: check if channel is enabled before printing warning
nbd: don't requeue the same request twice.
nbd: handle unexpected replies better
usb: gadget: r8a66597: Fix two possible sleep-in-atomic-context bugs in init_controller()
usb: gadget: r8a66597: Fix a possible sleep-in-atomic-context bugs in r8a66597_queue()
usb: gadget: f_uac2: fix error handling in afunc_bind (again)
usb: gadget: u_audio: fix pcm/card naming in g_audio_setup()
usb: gadget: u_audio: update hw_ptr in iso_complete after data copied
usb: gadget: u_audio: remove caching of stream buffer parameters
usb: gadget: u_audio: remove cached period bytes value
usb: gadget: u_audio: protect stream runtime fields with stream spinlock
usb/phy: fix PPC64 build errors in phy-fsl-usb.c
tools: usb: ffs-test: Fix build on big endian systems
usb: gadget: f_uac2: fix endianness of 'struct cntrl_*_lay3'
netfilter: nft_set_hash: add rcu_barrier() in the nft_rhash_destroy()
bpf, ppc64: fix unexpected r0=0 exit path inside bpf_xadd
netfilter: nf_tables: fix memory leaks on chain rename
netfilter: nf_tables: don't allow to rename to already-pending name
KVM: vmx: use local variable for current_vmptr when emulating VMPTRST
tools/power turbostat: fix -S on UP systems
net: caif: Add a missing rcu_read_unlock() in caif_flow_cb
qed: Fix link flap issue due to mismatching EEE capabilities.
qed: Fix possible race for the link state value.
qed: Correct Multicast API to reflect existence of 256 approximate buckets.
atl1c: reserve min skb headroom
net: prevent ISA drivers from building on PPC32
can: mpc5xxx_can: check of_iomap return before use
can: m_can: Move accessing of message ram to after clocks are enabled
i2c: davinci: Avoid zero value of CLKH
perf/x86/amd/ibs: Don't access non-started event
media: staging: omap4iss: Include asm/cacheflush.h after generic includes
bnx2x: Fix invalid memory access in rss hash config path.
qmi_wwan: fix interface number for DW5821e production firmware
net: axienet: Fix double deregister of mdio
locking/rtmutex: Allow specifying a subclass for nested locking
i2c/mux, locking/core: Annotate the nested rt_mutex usage
sched/rt: Restore rt_runtime after disabling RT_RUNTIME_SHARE
x86/boot: Fix if_changed build flip/flop bug
fscache: Allow cancelled operations to be enqueued
cachefiles: Fix refcounting bug in backing-file read monitoring
cachefiles: Wait rather than BUG'ing on "Unexpected object collision"
selftests/ftrace: Add snapshot and tracing_on test case
hinic: Link the logical network device to the pci device in sysfs
ipc/sem.c: prevent queue.status tearing in semop
zswap: re-check zswap_is_full() after do zswap_shrink()
tools/power turbostat: Read extended processor family from CPUID
Revert "MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum"
ARC: dma [non-IOC] setup SMP_CACHE_BYTES and cache_line_size
bpf: use GFP_ATOMIC instead of GFP_KERNEL in bpf_parse_prog()
nfp: flower: fix port metadata conversion bug
enic: handle mtu change for vf properly
ARC: [plat-eznps] Add missing struct nps_host_reg_aux_dpc
arc: [plat-eznps] fix data type errors in platform headers
arc: [plat-eznps] fix printk warning in arc/plat-eznps/mtm.c
arc: fix build errors in arc/include/asm/delay.h
arc: fix type warnings in arc/mm/cache.c
sparc/time: Add missing __init to init_tick_ops()
sparc: use asm-generic version of msi.h
enic: do not call enic_change_mtu in enic_probe
squashfs metadata 2: electric boogaloo
mm: delete historical BUG from zap_pmd_range()
Squashfs: Compute expected length from inode size rather than block length
drivers: net: lmc: fix case value for target abort error
memcg: remove memcg_cgroup::id from IDR on mem_cgroup_css_alloc() failure
gpiolib-acpi: make sure we trigger edge events at least once on boot
scsi: fcoe: fix use-after-free in fcoe_ctlr_els_send
scsi: fcoe: drop frames in ELS LOGO error path
scsi: fcoe: clear FC_RP_STARTED flags when receiving a LOGO
scsi: vmw_pvscsi: Return DID_RESET for status SAM_STAT_COMMAND_TERMINATED
mm/memory.c: check return value of ioremap_prot
mei: don't update offset in write
cifs: add missing debug entries for kconfig options
cifs: check kmalloc before use
smb3: enumerating snapshots was leaving part of the data off end
smb3: Do not send SMB3 SET_INFO if nothing changed
smb3: don't request leases in symlink creation and query
smb3: fill in statfs fsid and correct namelen
btrfs: use correct compare function of dirty_metadata_bytes
btrfs: don't leak ret from do_chunk_alloc
Btrfs: fix btrfs_write_inode vs delayed iput deadlock
iommu/arm-smmu: Error out only if not enough context interrupts
printk: Split the code for storing a message into the log buffer
printk: Create helper function to queue deferred console handling
printk/nmi: Prevent deadlock when accessing the main log buffer in NMI
kprobes/arm64: Fix %p uses in error messages
arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()
arm64: dts: rockchip: corrected uart1 clock-names for rk3328
KVM: arm/arm64: Skip updating PMD entry if no change
KVM: arm/arm64: Skip updating PTE entry if no change
s390/kvm: fix deadlock when killed by oom
stop_machine: Reflow cpu_stop_queue_two_works()
stop_machine: Atomically queue and wake stopper threads
ext4: check for NUL characters in extended attribute's name
ext4: sysfs: print ext4_super_block fields as little-endian
ext4: reset error code in ext4_find_entry in fallback
nvme-pci: add a memory barrier to nvme_dbbuf_update_and_check_event
platform/x86: ideapad-laptop: Apply no_hw_rfkill to Y20-15IKBM, too
mm: move tlb_table_flush to tlb_flush_mmu_free
mm/tlb, x86/mm: Support invalidating TLB caches for RCU_TABLE_FREE
x86/speculation/l1tf: Fix overflow in l1tf_pfn_limit() on 32bit
x86/speculation/l1tf: Fix off-by-one error when warning that system has too much RAM
x86/speculation/l1tf: Suggest what to do on systems with too much RAM
x86/vdso: Fix vDSO build if a retpoline is emitted
x86/process: Re-export start_thread()
KVM: x86: SVM: Call x86_spec_ctrl_set_guest/host() with interrupts disabled
x86/kvm/vmx: Remove duplicate l1d flush definitions
fuse: Don't access pipe->buffers without pipe_lock()
fuse: fix initial parallel dirops
fuse: fix double request_end()
fuse: fix unlocked access to processing queue
fuse: umount should wait for all requests
fuse: Fix oops at process_init_reply()
fuse: Add missed unlock_page() to fuse_readpages_fill()
udl-kms: change down_interruptible to down
udl-kms: handle allocation failure
udl-kms: fix crash due to uninitialized memory
udl-kms: avoid division
b43legacy/leds: Ensure NUL-termination of LED name string
b43/leds: Ensure NUL-termination of LED name string
ASoC: dpcm: don't merge format from invalid codec dai
ASoC: zte: Fix incorrect PCM format bit usages
ASoC: sirf: Fix potential NULL pointer dereference
pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show()
x86/vdso: Fix lsl operand order
x86/nmi: Fix NMI uaccess race against CR3 switching
x86/irqflags: Mark native_restore_fl extern inline
x86/spectre: Add missing family 6 check to microcode check
x86/speculation/l1tf: Increase l1tf memory limit for Nehalem+
hwmon: (nct6775) Fix potential Spectre v1
x86/entry/64: Wipe KASAN stack shadow before rewind_stack_do_exit()
s390/mm: fix addressing exception after suspend/resume
s390: fix br_r1_trampoline for machines without exrl
s390/qdio: reset old sbal_state flags
s390/numa: move initial setup of node_to_cpumask_map
s390/pci: fix out of bounds access during irq setup
kprobes/arm: Fix %p uses in error messages
kprobes: Make list and blacklist root user read only
MIPS: Correct the 64-bit DSP accumulator register size
MIPS: Always use -march=<arch>, not -<arch> shortcuts
MIPS: Change definition of cpu_relax() for Loongson-3
MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7
tpm: Return the actual size when receiving an unsupported command
scsi: mpt3sas: Fix _transport_smp_handler() error path
scsi: sysfs: Introduce sysfs_{un,}break_active_protection()
scsi: core: Avoid that SCSI device removal through sysfs triggers a deadlock
iscsi target: fix session creation failure handling
clk: rockchip: fix clk_i2sout parent selection bits on rk3399
PM / clk: signedness bug in of_pm_clk_add_clks()
power: generic-adc-battery: fix out-of-bounds write when copying channel properties
power: generic-adc-battery: check for duplicate properties copied from iio channels
watchdog: Mark watchdog touch functions as notrace
cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status
gcc-plugins: Add include required by GCC release 8
gcc-plugins: Use dynamic initializers
Linux 4.14.68
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
6fff4be48e
176 changed files with 1384 additions and 766 deletions
6
Makefile
6
Makefile
|
|
@ -1,7 +1,7 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 14
|
||||
SUBLEVEL = 67
|
||||
SUBLEVEL = 68
|
||||
EXTRAVERSION =
|
||||
NAME = Petit Gorille
|
||||
|
||||
|
|
@ -492,9 +492,13 @@ KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
|
|||
endif
|
||||
|
||||
RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register
|
||||
RETPOLINE_VDSO_CFLAGS_GCC := -mindirect-branch=thunk-inline -mindirect-branch-register
|
||||
RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk
|
||||
RETPOLINE_VDSO_CFLAGS_CLANG := -mretpoline
|
||||
RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG)))
|
||||
RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_VDSO_CFLAGS_CLANG)))
|
||||
export RETPOLINE_CFLAGS
|
||||
export RETPOLINE_VDSO_CFLAGS
|
||||
|
||||
ifeq ($(config-targets),1)
|
||||
# ===========================================================================
|
||||
|
|
|
|||
|
|
@ -336,6 +336,9 @@ config HAVE_ARCH_JUMP_LABEL
|
|||
config HAVE_RCU_TABLE_FREE
|
||||
bool
|
||||
|
||||
config HAVE_RCU_TABLE_INVALIDATE
|
||||
bool
|
||||
|
||||
config ARCH_HAVE_NMI_SAFE_CMPXCHG
|
||||
bool
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,9 @@ config ARC
|
|||
select HAVE_KERNEL_GZIP
|
||||
select HAVE_KERNEL_LZMA
|
||||
|
||||
config ARCH_HAS_CACHE_LINE_SIZE
|
||||
def_bool y
|
||||
|
||||
config MIGHT_HAVE_PCI
|
||||
bool
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,9 @@
|
|||
})
|
||||
|
||||
/* Largest line length for either L1 or L2 is 128 bytes */
|
||||
#define ARCH_DMA_MINALIGN 128
|
||||
#define SMP_CACHE_BYTES 128
|
||||
#define cache_line_size() SMP_CACHE_BYTES
|
||||
#define ARCH_DMA_MINALIGN SMP_CACHE_BYTES
|
||||
|
||||
extern void arc_cache_init(void);
|
||||
extern char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len);
|
||||
|
|
|
|||
|
|
@ -17,8 +17,11 @@
|
|||
#ifndef __ASM_ARC_UDELAY_H
|
||||
#define __ASM_ARC_UDELAY_H
|
||||
|
||||
#include <asm-generic/types.h>
|
||||
#include <asm/param.h> /* HZ */
|
||||
|
||||
extern unsigned long loops_per_jiffy;
|
||||
|
||||
static inline void __delay(unsigned long loops)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
|
|
|
|||
|
|
@ -1035,7 +1035,7 @@ void flush_cache_mm(struct mm_struct *mm)
|
|||
void flush_cache_page(struct vm_area_struct *vma, unsigned long u_vaddr,
|
||||
unsigned long pfn)
|
||||
{
|
||||
unsigned int paddr = pfn << PAGE_SHIFT;
|
||||
phys_addr_t paddr = pfn << PAGE_SHIFT;
|
||||
|
||||
u_vaddr &= PAGE_MASK;
|
||||
|
||||
|
|
@ -1055,8 +1055,9 @@ void flush_anon_page(struct vm_area_struct *vma, struct page *page,
|
|||
unsigned long u_vaddr)
|
||||
{
|
||||
/* TBD: do we really need to clear the kernel mapping */
|
||||
__flush_dcache_page(page_address(page), u_vaddr);
|
||||
__flush_dcache_page(page_address(page), page_address(page));
|
||||
__flush_dcache_page((phys_addr_t)page_address(page), u_vaddr);
|
||||
__flush_dcache_page((phys_addr_t)page_address(page),
|
||||
(phys_addr_t)page_address(page));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#error "Incorrect ctop.h include"
|
||||
#endif
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <soc/nps/common.h>
|
||||
|
||||
/* core auxiliary registers */
|
||||
|
|
@ -143,6 +144,15 @@ struct nps_host_reg_gim_p_int_dst {
|
|||
};
|
||||
|
||||
/* AUX registers definition */
|
||||
struct nps_host_reg_aux_dpc {
|
||||
union {
|
||||
struct {
|
||||
u32 ien:1, men:1, hen:1, reserved:29;
|
||||
};
|
||||
u32 value;
|
||||
};
|
||||
};
|
||||
|
||||
struct nps_host_reg_aux_udmc {
|
||||
union {
|
||||
struct {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@
|
|||
*/
|
||||
|
||||
#include <linux/smp.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/log2.h>
|
||||
#include <asm/arcregs.h>
|
||||
|
|
@ -157,10 +159,10 @@ void mtm_enable_core(unsigned int cpu)
|
|||
/* Verify and set the value of the mtm hs counter */
|
||||
static int __init set_mtm_hs_ctr(char *ctr_str)
|
||||
{
|
||||
long hs_ctr;
|
||||
int hs_ctr;
|
||||
int ret;
|
||||
|
||||
ret = kstrtol(ctr_str, 0, &hs_ctr);
|
||||
ret = kstrtoint(ctr_str, 0, &hs_ctr);
|
||||
|
||||
if (ret || hs_ctr > MT_HS_CNT_MAX || hs_ctr < MT_HS_CNT_MIN) {
|
||||
pr_err("** Invalid @nps_mtm_hs_ctr [%d] needs to be [%d:%d] (incl)\n",
|
||||
|
|
|
|||
|
|
@ -291,8 +291,8 @@ void __kprobes kprobe_handler(struct pt_regs *regs)
|
|||
break;
|
||||
case KPROBE_REENTER:
|
||||
/* A nested probe was hit in FIQ, it is a BUG */
|
||||
pr_warn("Unrecoverable kprobe detected at %p.\n",
|
||||
p->addr);
|
||||
pr_warn("Unrecoverable kprobe detected.\n");
|
||||
dump_kprobe(p);
|
||||
/* fall through */
|
||||
default:
|
||||
/* impossible cases */
|
||||
|
|
|
|||
|
|
@ -1517,7 +1517,6 @@ fail:
|
|||
print_registers(&result_regs);
|
||||
|
||||
if (mem) {
|
||||
pr_err("current_stack=%p\n", current_stack);
|
||||
pr_err("expected_memory:\n");
|
||||
print_memory(expected_memory, mem_size);
|
||||
pr_err("result_memory:\n");
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@
|
|||
reg = <0x0 0xff120000 0x0 0x100>;
|
||||
interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&cru SCLK_UART1>, <&cru PCLK_UART1>;
|
||||
clock-names = "sclk_uart", "pclk_uart";
|
||||
clock-names = "baudclk", "apb_pclk";
|
||||
dmas = <&dmac 4>, <&dmac 5>;
|
||||
#dma-cells = <2>;
|
||||
pinctrl-names = "default";
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ static int __kprobes reenter_kprobe(struct kprobe *p,
|
|||
break;
|
||||
case KPROBE_HIT_SS:
|
||||
case KPROBE_REENTER:
|
||||
pr_warn("Unrecoverable kprobe detected at %p.\n", p->addr);
|
||||
pr_warn("Unrecoverable kprobe detected.\n");
|
||||
dump_kprobe(p);
|
||||
BUG();
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -285,11 +285,13 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
|
|||
#endif /* CONFIG_NUMA */
|
||||
|
||||
#ifdef CONFIG_HAVE_ARCH_PFN_VALID
|
||||
#define PFN_MASK ((1UL << (64 - PAGE_SHIFT)) - 1)
|
||||
|
||||
int pfn_valid(unsigned long pfn)
|
||||
{
|
||||
return (pfn & PFN_MASK) == pfn && memblock_is_map_memory(pfn << PAGE_SHIFT);
|
||||
phys_addr_t addr = pfn << PAGE_SHIFT;
|
||||
|
||||
if ((addr >> PAGE_SHIFT) != pfn)
|
||||
return 0;
|
||||
return memblock_is_map_memory(addr);
|
||||
}
|
||||
EXPORT_SYMBOL(pfn_valid);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -155,15 +155,11 @@ cflags-$(CONFIG_CPU_R4300) += -march=r4300 -Wa,--trap
|
|||
cflags-$(CONFIG_CPU_VR41XX) += -march=r4100 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
|
||||
-Wa,-mips32 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
|
||||
-Wa,-mips32r2 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_MIPS32_R1) += -march=mips32 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_MIPS32_R2) += -march=mips32r2 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_MIPS32_R6) += -march=mips32r6 -Wa,--trap -modd-spreg
|
||||
cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips64 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \
|
||||
-Wa,-mips64 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_MIPS64_R2) += $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \
|
||||
-Wa,-mips64r2 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_MIPS64_R1) += -march=mips64 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_MIPS64_R2) += -march=mips64r2 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_MIPS64_R6) += -march=mips64r6 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_R5000) += -march=r5000 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_R5432) += $(call cc-option,-march=r5400,-march=r5000) \
|
||||
|
|
|
|||
|
|
@ -212,12 +212,6 @@ static int __init bcm47xx_cpu_fixes(void)
|
|||
*/
|
||||
if (bcm47xx_bus.bcma.bus.chipinfo.id == BCMA_CHIP_ID_BCM4706)
|
||||
cpu_wait = NULL;
|
||||
|
||||
/*
|
||||
* BCM47XX Erratum "R10: PCIe Transactions Periodically Fail"
|
||||
* Enable ExternalSync for sync instruction to take effect
|
||||
*/
|
||||
set_c0_config7(MIPS_CONF7_ES);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -680,8 +680,6 @@
|
|||
#define MIPS_CONF7_WII (_ULCAST_(1) << 31)
|
||||
|
||||
#define MIPS_CONF7_RPS (_ULCAST_(1) << 2)
|
||||
/* ExternalSync */
|
||||
#define MIPS_CONF7_ES (_ULCAST_(1) << 8)
|
||||
|
||||
#define MIPS_CONF7_IAR (_ULCAST_(1) << 10)
|
||||
#define MIPS_CONF7_AR (_ULCAST_(1) << 16)
|
||||
|
|
@ -2747,7 +2745,6 @@ __BUILD_SET_C0(status)
|
|||
__BUILD_SET_C0(cause)
|
||||
__BUILD_SET_C0(config)
|
||||
__BUILD_SET_C0(config5)
|
||||
__BUILD_SET_C0(config7)
|
||||
__BUILD_SET_C0(intcontrol)
|
||||
__BUILD_SET_C0(intctl)
|
||||
__BUILD_SET_C0(srsmap)
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ struct mips_fpu_struct {
|
|||
|
||||
#define NUM_DSP_REGS 6
|
||||
|
||||
typedef __u32 dspreg_t;
|
||||
typedef unsigned long dspreg_t;
|
||||
|
||||
struct mips_dsp_state {
|
||||
dspreg_t dspr[NUM_DSP_REGS];
|
||||
|
|
@ -388,7 +388,20 @@ unsigned long get_wchan(struct task_struct *p);
|
|||
#define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29])
|
||||
#define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status)
|
||||
|
||||
#ifdef CONFIG_CPU_LOONGSON3
|
||||
/*
|
||||
* Loongson-3's SFB (Store-Fill-Buffer) may buffer writes indefinitely when a
|
||||
* tight read loop is executed, because reads take priority over writes & the
|
||||
* hardware (incorrectly) doesn't ensure that writes will eventually occur.
|
||||
*
|
||||
* Since spin loops of any kind should have a cpu_relax() in them, force an SFB
|
||||
* flush from cpu_relax() such that any pending writes will become visible as
|
||||
* expected.
|
||||
*/
|
||||
#define cpu_relax() smp_mb()
|
||||
#else
|
||||
#define cpu_relax() barrier()
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Return_address is a replacement for __builtin_return_address(count)
|
||||
|
|
|
|||
|
|
@ -847,7 +847,7 @@ long arch_ptrace(struct task_struct *child, long request,
|
|||
goto out;
|
||||
}
|
||||
dregs = __get_dsp_regs(child);
|
||||
tmp = (unsigned long) (dregs[addr - DSP_BASE]);
|
||||
tmp = dregs[addr - DSP_BASE];
|
||||
break;
|
||||
}
|
||||
case DSP_CONTROL:
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
|
|||
goto out;
|
||||
}
|
||||
dregs = __get_dsp_regs(child);
|
||||
tmp = (unsigned long) (dregs[addr - DSP_BASE]);
|
||||
tmp = dregs[addr - DSP_BASE];
|
||||
break;
|
||||
}
|
||||
case DSP_CONTROL:
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
#include "libgcc.h"
|
||||
|
||||
/*
|
||||
* GCC 7 suboptimally generates __multi3 calls for mips64r6, so for that
|
||||
* specific case only we'll implement it here.
|
||||
* GCC 7 & older can suboptimally generate __multi3 calls for mips64r6, so for
|
||||
* that specific case only we implement that intrinsic here.
|
||||
*
|
||||
* See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82981
|
||||
*/
|
||||
#if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6) && (__GNUC__ == 7)
|
||||
#if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6) && (__GNUC__ < 8)
|
||||
|
||||
/* multiply 64-bit values, low 64-bits returned */
|
||||
static inline long long notrace dmulu(long long a, long long b)
|
||||
|
|
|
|||
|
|
@ -322,6 +322,7 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
|
|||
u64 imm64;
|
||||
u8 *func;
|
||||
u32 true_cond;
|
||||
u32 tmp_idx;
|
||||
|
||||
/*
|
||||
* addrs[] maps a BPF bytecode address into a real offset from
|
||||
|
|
@ -681,11 +682,7 @@ emit_clear:
|
|||
case BPF_STX | BPF_XADD | BPF_W:
|
||||
/* Get EA into TMP_REG_1 */
|
||||
PPC_ADDI(b2p[TMP_REG_1], dst_reg, off);
|
||||
/* error if EA is not word-aligned */
|
||||
PPC_ANDI(b2p[TMP_REG_2], b2p[TMP_REG_1], 0x03);
|
||||
PPC_BCC_SHORT(COND_EQ, (ctx->idx * 4) + 12);
|
||||
PPC_LI(b2p[BPF_REG_0], 0);
|
||||
PPC_JMP(exit_addr);
|
||||
tmp_idx = ctx->idx * 4;
|
||||
/* load value from memory into TMP_REG_2 */
|
||||
PPC_BPF_LWARX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1], 0);
|
||||
/* add value from src_reg into this */
|
||||
|
|
@ -693,32 +690,16 @@ emit_clear:
|
|||
/* store result back */
|
||||
PPC_BPF_STWCX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1]);
|
||||
/* we're done if this succeeded */
|
||||
PPC_BCC_SHORT(COND_EQ, (ctx->idx * 4) + (7*4));
|
||||
/* otherwise, let's try once more */
|
||||
PPC_BPF_LWARX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1], 0);
|
||||
PPC_ADD(b2p[TMP_REG_2], b2p[TMP_REG_2], src_reg);
|
||||
PPC_BPF_STWCX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1]);
|
||||
/* exit if the store was not successful */
|
||||
PPC_LI(b2p[BPF_REG_0], 0);
|
||||
PPC_BCC(COND_NE, exit_addr);
|
||||
PPC_BCC_SHORT(COND_NE, tmp_idx);
|
||||
break;
|
||||
/* *(u64 *)(dst + off) += src */
|
||||
case BPF_STX | BPF_XADD | BPF_DW:
|
||||
PPC_ADDI(b2p[TMP_REG_1], dst_reg, off);
|
||||
/* error if EA is not doubleword-aligned */
|
||||
PPC_ANDI(b2p[TMP_REG_2], b2p[TMP_REG_1], 0x07);
|
||||
PPC_BCC_SHORT(COND_EQ, (ctx->idx * 4) + (3*4));
|
||||
PPC_LI(b2p[BPF_REG_0], 0);
|
||||
PPC_JMP(exit_addr);
|
||||
tmp_idx = ctx->idx * 4;
|
||||
PPC_BPF_LDARX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1], 0);
|
||||
PPC_ADD(b2p[TMP_REG_2], b2p[TMP_REG_2], src_reg);
|
||||
PPC_BPF_STDCX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1]);
|
||||
PPC_BCC_SHORT(COND_EQ, (ctx->idx * 4) + (7*4));
|
||||
PPC_BPF_LDARX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1], 0);
|
||||
PPC_ADD(b2p[TMP_REG_2], b2p[TMP_REG_2], src_reg);
|
||||
PPC_BPF_STDCX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1]);
|
||||
PPC_LI(b2p[BPF_REG_0], 0);
|
||||
PPC_BCC(COND_NE, exit_addr);
|
||||
PPC_BCC_SHORT(COND_NE, tmp_idx);
|
||||
break;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -262,7 +262,6 @@ struct qdio_outbuf_state {
|
|||
void *user;
|
||||
};
|
||||
|
||||
#define QDIO_OUTBUF_STATE_FLAG_NONE 0x00
|
||||
#define QDIO_OUTBUF_STATE_FLAG_PENDING 0x01
|
||||
|
||||
#define CHSC_AC1_INITIATE_INPUTQ 0x80
|
||||
|
|
|
|||
|
|
@ -486,6 +486,8 @@ retry:
|
|||
/* No reason to continue if interrupted by SIGKILL. */
|
||||
if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) {
|
||||
fault = VM_FAULT_SIGNAL;
|
||||
if (flags & FAULT_FLAG_RETRY_NOWAIT)
|
||||
goto out_up;
|
||||
goto out;
|
||||
}
|
||||
if (unlikely(fault & VM_FAULT_ERROR))
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ void arch_set_page_states(int make_stable)
|
|||
list_for_each(l, &zone->free_area[order].free_list[t]) {
|
||||
page = list_entry(l, struct page, lru);
|
||||
if (make_stable)
|
||||
set_page_stable_dat(page, 0);
|
||||
set_page_stable_dat(page, order);
|
||||
else
|
||||
set_page_unused(page, order);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -518,8 +518,6 @@ static void bpf_jit_epilogue(struct bpf_jit *jit)
|
|||
/* br %r1 */
|
||||
_EMIT2(0x07f1);
|
||||
} else {
|
||||
/* larl %r1,.+14 */
|
||||
EMIT6_PCREL_RILB(0xc0000000, REG_1, jit->prg + 14);
|
||||
/* ex 0,S390_lowcore.br_r1_tampoline */
|
||||
EMIT4_DISP(0x44000000, REG_0, REG_0,
|
||||
offsetof(struct lowcore, br_r1_trampoline));
|
||||
|
|
|
|||
|
|
@ -134,26 +134,14 @@ void __init numa_setup(void)
|
|||
{
|
||||
pr_info("NUMA mode: %s\n", mode->name);
|
||||
nodes_clear(node_possible_map);
|
||||
/* Initially attach all possible CPUs to node 0. */
|
||||
cpumask_copy(&node_to_cpumask_map[0], cpu_possible_mask);
|
||||
if (mode->setup)
|
||||
mode->setup();
|
||||
numa_setup_memory();
|
||||
memblock_dump_all();
|
||||
}
|
||||
|
||||
/*
|
||||
* numa_init_early() - Initialization initcall
|
||||
*
|
||||
* This runs when only one CPU is online and before the first
|
||||
* topology update is called for by the scheduler.
|
||||
*/
|
||||
static int __init numa_init_early(void)
|
||||
{
|
||||
/* Attach all possible CPUs to node 0 for now. */
|
||||
cpumask_copy(&node_to_cpumask_map[0], cpu_possible_mask);
|
||||
return 0;
|
||||
}
|
||||
early_initcall(numa_init_early);
|
||||
|
||||
/*
|
||||
* numa_init_late() - Initialization initcall
|
||||
*
|
||||
|
|
|
|||
|
|
@ -420,6 +420,8 @@ int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
|
|||
hwirq = 0;
|
||||
for_each_pci_msi_entry(msi, pdev) {
|
||||
rc = -EIO;
|
||||
if (hwirq >= msi_vecs)
|
||||
break;
|
||||
irq = irq_alloc_desc(0); /* Alloc irq on node 0 */
|
||||
if (irq < 0)
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ generic-y += local64.h
|
|||
generic-y += mcs_spinlock.h
|
||||
generic-y += mm-arch-hooks.h
|
||||
generic-y += module.h
|
||||
generic-y += msi.h
|
||||
generic-y += preempt.h
|
||||
generic-y += rwsem.h
|
||||
generic-y += serial.h
|
||||
|
|
|
|||
|
|
@ -813,7 +813,7 @@ static void __init get_tick_patch(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void init_tick_ops(struct sparc64_tick_ops *ops)
|
||||
static void __init init_tick_ops(struct sparc64_tick_ops *ops)
|
||||
{
|
||||
unsigned long freq, quotient, tick;
|
||||
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@ config X86
|
|||
select HAVE_PERF_REGS
|
||||
select HAVE_PERF_USER_STACK_DUMP
|
||||
select HAVE_RCU_TABLE_FREE
|
||||
select HAVE_RCU_TABLE_INVALIDATE if HAVE_RCU_TABLE_FREE
|
||||
select HAVE_REGS_AND_STACK_ACCESS_API
|
||||
select HAVE_RELIABLE_STACKTRACE if X86_64 && UNWINDER_FRAME_POINTER && STACK_VALIDATION
|
||||
select HAVE_STACK_VALIDATION if X86_64
|
||||
|
|
|
|||
|
|
@ -104,9 +104,13 @@ define cmd_check_data_rel
|
|||
done
|
||||
endef
|
||||
|
||||
# We need to run two commands under "if_changed", so merge them into a
|
||||
# single invocation.
|
||||
quiet_cmd_check-and-link-vmlinux = LD $@
|
||||
cmd_check-and-link-vmlinux = $(cmd_check_data_rel); $(cmd_ld)
|
||||
|
||||
$(obj)/vmlinux: $(vmlinux-objs-y) FORCE
|
||||
$(call if_changed,check_data_rel)
|
||||
$(call if_changed,ld)
|
||||
$(call if_changed,check-and-link-vmlinux)
|
||||
|
||||
OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
|
||||
$(obj)/vmlinux.bin: vmlinux FORCE
|
||||
|
|
|
|||
|
|
@ -74,9 +74,9 @@ $(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so $(obj)/vdso2c FORCE
|
|||
CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \
|
||||
$(filter -g%,$(KBUILD_CFLAGS)) $(call cc-option, -fno-stack-protector) \
|
||||
-fno-omit-frame-pointer -foptimize-sibling-calls \
|
||||
-DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
|
||||
-DDISABLE_BRANCH_PROFILING -DBUILD_VDSO $(RETPOLINE_VDSO_CFLAGS)
|
||||
|
||||
$(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS)) $(CFL)
|
||||
$(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS) $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS)) $(CFL)
|
||||
|
||||
#
|
||||
# vDSO code runs in userspace and -pg doesn't help with profiling anyway.
|
||||
|
|
@ -147,11 +147,13 @@ KBUILD_CFLAGS_32 := $(filter-out -mcmodel=kernel,$(KBUILD_CFLAGS_32))
|
|||
KBUILD_CFLAGS_32 := $(filter-out -fno-pic,$(KBUILD_CFLAGS_32))
|
||||
KBUILD_CFLAGS_32 := $(filter-out -mfentry,$(KBUILD_CFLAGS_32))
|
||||
KBUILD_CFLAGS_32 := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS_32))
|
||||
KBUILD_CFLAGS_32 := $(filter-out $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS_32))
|
||||
KBUILD_CFLAGS_32 += -m32 -msoft-float -mregparm=0 -fpic
|
||||
KBUILD_CFLAGS_32 += $(call cc-option, -fno-stack-protector)
|
||||
KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls)
|
||||
KBUILD_CFLAGS_32 += -fno-omit-frame-pointer
|
||||
KBUILD_CFLAGS_32 += -DDISABLE_BRANCH_PROFILING
|
||||
KBUILD_CFLAGS_32 += $(RETPOLINE_VDSO_CFLAGS)
|
||||
$(obj)/vdso32.so.dbg: KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)
|
||||
|
||||
$(obj)/vdso32.so.dbg: FORCE \
|
||||
|
|
|
|||
|
|
@ -579,7 +579,7 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
|
|||
{
|
||||
struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu);
|
||||
struct perf_event *event = pcpu->event;
|
||||
struct hw_perf_event *hwc = &event->hw;
|
||||
struct hw_perf_event *hwc;
|
||||
struct perf_sample_data data;
|
||||
struct perf_raw_record raw;
|
||||
struct pt_regs regs;
|
||||
|
|
@ -602,6 +602,10 @@ fail:
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (WARN_ON_ONCE(!event))
|
||||
goto fail;
|
||||
|
||||
hwc = &event->hw;
|
||||
msr = hwc->config_base;
|
||||
buf = ibs_data.regs;
|
||||
rdmsrl(msr, *buf);
|
||||
|
|
|
|||
|
|
@ -2462,7 +2462,7 @@ perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs
|
|||
|
||||
perf_callchain_store(entry, regs->ip);
|
||||
|
||||
if (!current->mm)
|
||||
if (!nmi_uaccess_okay())
|
||||
return;
|
||||
|
||||
if (perf_callchain_user32(regs, entry))
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ extern inline unsigned long native_save_fl(void)
|
|||
return flags;
|
||||
}
|
||||
|
||||
static inline void native_restore_fl(unsigned long flags)
|
||||
extern inline void native_restore_fl(unsigned long flags);
|
||||
extern inline void native_restore_fl(unsigned long flags)
|
||||
{
|
||||
asm volatile("push %0 ; popf"
|
||||
: /* no output */
|
||||
|
|
|
|||
|
|
@ -132,6 +132,8 @@ struct cpuinfo_x86 {
|
|||
/* Index into per_cpu list: */
|
||||
u16 cpu_index;
|
||||
u32 microcode;
|
||||
/* Address space bits used by the cache internally */
|
||||
u8 x86_cache_bits;
|
||||
} __randomize_layout;
|
||||
|
||||
struct cpuid_regs {
|
||||
|
|
@ -180,9 +182,9 @@ extern const struct seq_operations cpuinfo_op;
|
|||
|
||||
extern void cpu_detect(struct cpuinfo_x86 *c);
|
||||
|
||||
static inline unsigned long l1tf_pfn_limit(void)
|
||||
static inline unsigned long long l1tf_pfn_limit(void)
|
||||
{
|
||||
return BIT(boot_cpu_data.x86_phys_bits - 1 - PAGE_SHIFT) - 1;
|
||||
return BIT_ULL(boot_cpu_data.x86_cache_bits - 1 - PAGE_SHIFT);
|
||||
}
|
||||
|
||||
extern void early_cpu_init(void);
|
||||
|
|
|
|||
|
|
@ -175,8 +175,16 @@ struct tlb_state {
|
|||
* are on. This means that it may not match current->active_mm,
|
||||
* which will contain the previous user mm when we're in lazy TLB
|
||||
* mode even if we've already switched back to swapper_pg_dir.
|
||||
*
|
||||
* During switch_mm_irqs_off(), loaded_mm will be set to
|
||||
* LOADED_MM_SWITCHING during the brief interrupts-off window
|
||||
* when CR3 and loaded_mm would otherwise be inconsistent. This
|
||||
* is for nmi_uaccess_okay()'s benefit.
|
||||
*/
|
||||
struct mm_struct *loaded_mm;
|
||||
|
||||
#define LOADED_MM_SWITCHING ((struct mm_struct *)1)
|
||||
|
||||
u16 loaded_mm_asid;
|
||||
u16 next_asid;
|
||||
/* last user mm's ctx id */
|
||||
|
|
@ -246,6 +254,38 @@ struct tlb_state {
|
|||
};
|
||||
DECLARE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate);
|
||||
|
||||
/*
|
||||
* Blindly accessing user memory from NMI context can be dangerous
|
||||
* if we're in the middle of switching the current user task or
|
||||
* switching the loaded mm. It can also be dangerous if we
|
||||
* interrupted some kernel code that was temporarily using a
|
||||
* different mm.
|
||||
*/
|
||||
static inline bool nmi_uaccess_okay(void)
|
||||
{
|
||||
struct mm_struct *loaded_mm = this_cpu_read(cpu_tlbstate.loaded_mm);
|
||||
struct mm_struct *current_mm = current->mm;
|
||||
|
||||
VM_WARN_ON_ONCE(!loaded_mm);
|
||||
|
||||
/*
|
||||
* The condition we want to check is
|
||||
* current_mm->pgd == __va(read_cr3_pa()). This may be slow, though,
|
||||
* if we're running in a VM with shadow paging, and nmi_uaccess_okay()
|
||||
* is supposed to be reasonably fast.
|
||||
*
|
||||
* Instead, we check the almost equivalent but somewhat conservative
|
||||
* condition below, and we rely on the fact that switch_mm_irqs_off()
|
||||
* sets loaded_mm to LOADED_MM_SWITCHING before writing to CR3.
|
||||
*/
|
||||
if (loaded_mm != current_mm)
|
||||
return false;
|
||||
|
||||
VM_WARN_ON_ONCE(current_mm->pgd != __va(read_cr3_pa()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Initialize cr4 shadow for this CPU. */
|
||||
static inline void cr4_init_shadow(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ static inline unsigned int __getcpu(void)
|
|||
*
|
||||
* If RDPID is available, use it.
|
||||
*/
|
||||
alternative_io ("lsl %[p],%[seg]",
|
||||
alternative_io ("lsl %[seg],%[p]",
|
||||
".byte 0xf3,0x0f,0xc7,0xf8", /* RDPID %eax/rax */
|
||||
X86_FEATURE_RDPID,
|
||||
[p] "=a" (p), [seg] "r" (__PER_CPU_SEG));
|
||||
|
|
|
|||
|
|
@ -652,6 +652,45 @@ EXPORT_SYMBOL_GPL(l1tf_mitigation);
|
|||
enum vmx_l1d_flush_state l1tf_vmx_mitigation = VMENTER_L1D_FLUSH_AUTO;
|
||||
EXPORT_SYMBOL_GPL(l1tf_vmx_mitigation);
|
||||
|
||||
/*
|
||||
* These CPUs all support 44bits physical address space internally in the
|
||||
* cache but CPUID can report a smaller number of physical address bits.
|
||||
*
|
||||
* The L1TF mitigation uses the top most address bit for the inversion of
|
||||
* non present PTEs. When the installed memory reaches into the top most
|
||||
* address bit due to memory holes, which has been observed on machines
|
||||
* which report 36bits physical address bits and have 32G RAM installed,
|
||||
* then the mitigation range check in l1tf_select_mitigation() triggers.
|
||||
* This is a false positive because the mitigation is still possible due to
|
||||
* the fact that the cache uses 44bit internally. Use the cache bits
|
||||
* instead of the reported physical bits and adjust them on the affected
|
||||
* machines to 44bit if the reported bits are less than 44.
|
||||
*/
|
||||
static void override_cache_bits(struct cpuinfo_x86 *c)
|
||||
{
|
||||
if (c->x86 != 6)
|
||||
return;
|
||||
|
||||
switch (c->x86_model) {
|
||||
case INTEL_FAM6_NEHALEM:
|
||||
case INTEL_FAM6_WESTMERE:
|
||||
case INTEL_FAM6_SANDYBRIDGE:
|
||||
case INTEL_FAM6_IVYBRIDGE:
|
||||
case INTEL_FAM6_HASWELL_CORE:
|
||||
case INTEL_FAM6_HASWELL_ULT:
|
||||
case INTEL_FAM6_HASWELL_GT3E:
|
||||
case INTEL_FAM6_BROADWELL_CORE:
|
||||
case INTEL_FAM6_BROADWELL_GT3E:
|
||||
case INTEL_FAM6_SKYLAKE_MOBILE:
|
||||
case INTEL_FAM6_SKYLAKE_DESKTOP:
|
||||
case INTEL_FAM6_KABYLAKE_MOBILE:
|
||||
case INTEL_FAM6_KABYLAKE_DESKTOP:
|
||||
if (c->x86_cache_bits < 44)
|
||||
c->x86_cache_bits = 44;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void __init l1tf_select_mitigation(void)
|
||||
{
|
||||
u64 half_pa;
|
||||
|
|
@ -659,6 +698,8 @@ static void __init l1tf_select_mitigation(void)
|
|||
if (!boot_cpu_has_bug(X86_BUG_L1TF))
|
||||
return;
|
||||
|
||||
override_cache_bits(&boot_cpu_data);
|
||||
|
||||
switch (l1tf_mitigation) {
|
||||
case L1TF_MITIGATION_OFF:
|
||||
case L1TF_MITIGATION_FLUSH_NOWARN:
|
||||
|
|
@ -678,14 +719,13 @@ static void __init l1tf_select_mitigation(void)
|
|||
return;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is extremely unlikely to happen because almost all
|
||||
* systems have far more MAX_PA/2 than RAM can be fit into
|
||||
* DIMM slots.
|
||||
*/
|
||||
half_pa = (u64)l1tf_pfn_limit() << PAGE_SHIFT;
|
||||
if (e820__mapped_any(half_pa, ULLONG_MAX - half_pa, E820_TYPE_RAM)) {
|
||||
pr_warn("System has more than MAX_PA/2 memory. L1TF mitigation not effective.\n");
|
||||
pr_info("You may make it effective by booting the kernel with mem=%llu parameter.\n",
|
||||
half_pa);
|
||||
pr_info("However, doing so will make a part of your RAM unusable.\n");
|
||||
pr_info("Reading https://www.kernel.org/doc/html/latest/admin-guide/l1tf.html might help you decide.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -890,6 +890,7 @@ static void identify_cpu_without_cpuid(struct cpuinfo_x86 *c)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
c->x86_cache_bits = c->x86_phys_bits;
|
||||
}
|
||||
|
||||
static const __initconst struct x86_cpu_id cpu_no_speculation[] = {
|
||||
|
|
|
|||
|
|
@ -150,6 +150,9 @@ static bool bad_spectre_microcode(struct cpuinfo_x86 *c)
|
|||
if (cpu_has(c, X86_FEATURE_HYPERVISOR))
|
||||
return false;
|
||||
|
||||
if (c->x86 != 6)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(spectre_bad_microcodes); i++) {
|
||||
if (c->x86_model == spectre_bad_microcodes[i].model &&
|
||||
c->x86_stepping == spectre_bad_microcodes[i].stepping)
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include <linux/bug.h>
|
||||
#include <linux/nmi.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/kasan.h>
|
||||
|
||||
#include <asm/cpu_entry_area.h>
|
||||
#include <asm/stacktrace.h>
|
||||
|
|
@ -298,7 +299,10 @@ void oops_end(unsigned long flags, struct pt_regs *regs, int signr)
|
|||
* We're not going to return, but we might be on an IST stack or
|
||||
* have very little stack space left. Rewind the stack and kill
|
||||
* the task.
|
||||
* Before we rewind the stack, we have to tell KASAN that we're going to
|
||||
* reuse the task stack and that existing poisons are invalid.
|
||||
*/
|
||||
kasan_unpoison_task_stack(current);
|
||||
rewind_stack_do_exit(signr);
|
||||
}
|
||||
NOKPROBE_SYMBOL(oops_end);
|
||||
|
|
|
|||
|
|
@ -370,6 +370,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
|
|||
start_thread_common(regs, new_ip, new_sp,
|
||||
__USER_CS, __USER_DS, 0);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(start_thread);
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
void compat_start_thread(struct pt_regs *regs, u32 new_ip, u32 new_sp)
|
||||
|
|
|
|||
|
|
@ -5067,8 +5067,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
|
|||
|
||||
clgi();
|
||||
|
||||
local_irq_enable();
|
||||
|
||||
/*
|
||||
* If this vCPU has touched SPEC_CTRL, restore the guest's value if
|
||||
* it's non-zero. Since vmentry is serialising on affected CPUs, there
|
||||
|
|
@ -5077,6 +5075,8 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
|
|||
*/
|
||||
x86_spec_ctrl_set_guest(svm->spec_ctrl, svm->virt_spec_ctrl);
|
||||
|
||||
local_irq_enable();
|
||||
|
||||
asm volatile (
|
||||
"push %%" _ASM_BP "; \n\t"
|
||||
"mov %c[rbx](%[svm]), %%" _ASM_BX " \n\t"
|
||||
|
|
@ -5199,12 +5199,12 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
|
|||
if (unlikely(!msr_write_intercepted(vcpu, MSR_IA32_SPEC_CTRL)))
|
||||
svm->spec_ctrl = native_read_msr(MSR_IA32_SPEC_CTRL);
|
||||
|
||||
x86_spec_ctrl_restore_host(svm->spec_ctrl, svm->virt_spec_ctrl);
|
||||
|
||||
reload_tss(vcpu);
|
||||
|
||||
local_irq_disable();
|
||||
|
||||
x86_spec_ctrl_restore_host(svm->spec_ctrl, svm->virt_spec_ctrl);
|
||||
|
||||
vcpu->arch.cr2 = svm->vmcb->save.cr2;
|
||||
vcpu->arch.regs[VCPU_REGS_RAX] = svm->vmcb->save.rax;
|
||||
vcpu->arch.regs[VCPU_REGS_RSP] = svm->vmcb->save.rsp;
|
||||
|
|
|
|||
|
|
@ -8108,21 +8108,20 @@ static int handle_vmptrld(struct kvm_vcpu *vcpu)
|
|||
/* Emulate the VMPTRST instruction */
|
||||
static int handle_vmptrst(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
|
||||
u32 vmx_instruction_info = vmcs_read32(VMX_INSTRUCTION_INFO);
|
||||
gva_t vmcs_gva;
|
||||
unsigned long exit_qual = vmcs_readl(EXIT_QUALIFICATION);
|
||||
u32 instr_info = vmcs_read32(VMX_INSTRUCTION_INFO);
|
||||
gpa_t current_vmptr = to_vmx(vcpu)->nested.current_vmptr;
|
||||
struct x86_exception e;
|
||||
gva_t gva;
|
||||
|
||||
if (!nested_vmx_check_permission(vcpu))
|
||||
return 1;
|
||||
|
||||
if (get_vmx_mem_address(vcpu, exit_qualification,
|
||||
vmx_instruction_info, true, &vmcs_gva))
|
||||
if (get_vmx_mem_address(vcpu, exit_qual, instr_info, true, &gva))
|
||||
return 1;
|
||||
/* *_system ok, nested_vmx_check_permission has verified cpl=0 */
|
||||
if (kvm_write_guest_virt_system(vcpu, vmcs_gva,
|
||||
(void *)&to_vmx(vcpu)->nested.current_vmptr,
|
||||
sizeof(u64), &e)) {
|
||||
if (kvm_write_guest_virt_system(vcpu, gva, (void *)¤t_vmptr,
|
||||
sizeof(gpa_t), &e)) {
|
||||
kvm_inject_page_fault(vcpu, &e);
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -9171,9 +9170,6 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu)
|
|||
* information but as all relevant affected CPUs have 32KiB L1D cache size
|
||||
* there is no point in doing so.
|
||||
*/
|
||||
#define L1D_CACHE_ORDER 4
|
||||
static void *vmx_l1d_flush_pages;
|
||||
|
||||
static void vmx_l1d_flush(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
int size = PAGE_SIZE << L1D_CACHE_ORDER;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
#include <linux/uaccess.h>
|
||||
#include <linux/export.h>
|
||||
|
||||
#include <asm/tlbflush.h>
|
||||
|
||||
/*
|
||||
* We rely on the nested NMI work to allow atomic faults from the NMI path; the
|
||||
* nested NMI paths are careful to preserve CR2.
|
||||
|
|
@ -19,6 +21,9 @@ copy_from_user_nmi(void *to, const void __user *from, unsigned long n)
|
|||
if (__range_not_ok(from, n, TASK_SIZE))
|
||||
return n;
|
||||
|
||||
if (!nmi_uaccess_okay())
|
||||
return n;
|
||||
|
||||
/*
|
||||
* Even though this function is typically called from NMI/IRQ context
|
||||
* disable pagefaults so that its behaviour is consistent even when
|
||||
|
|
|
|||
|
|
@ -892,7 +892,7 @@ unsigned long max_swapfile_size(void)
|
|||
|
||||
if (boot_cpu_has_bug(X86_BUG_L1TF)) {
|
||||
/* Limit the swap file size to MAX_PA/2 for L1TF workaround */
|
||||
unsigned long l1tf_limit = l1tf_pfn_limit() + 1;
|
||||
unsigned long long l1tf_limit = l1tf_pfn_limit();
|
||||
/*
|
||||
* We encode swap offsets also with 3 bits below those for pfn
|
||||
* which makes the usable limit higher.
|
||||
|
|
@ -900,7 +900,7 @@ unsigned long max_swapfile_size(void)
|
|||
#if CONFIG_PGTABLE_LEVELS > 2
|
||||
l1tf_limit <<= PAGE_SHIFT - SWP_OFFSET_FIRST_BIT;
|
||||
#endif
|
||||
pages = min_t(unsigned long, l1tf_limit, pages);
|
||||
pages = min_t(unsigned long long, l1tf_limit, pages);
|
||||
}
|
||||
return pages;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ bool pfn_modify_allowed(unsigned long pfn, pgprot_t prot)
|
|||
/* If it's real memory always allow */
|
||||
if (pfn_valid(pfn))
|
||||
return true;
|
||||
if (pfn > l1tf_pfn_limit() && !capable(CAP_SYS_ADMIN))
|
||||
if (pfn >= l1tf_pfn_limit() && !capable(CAP_SYS_ADMIN))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -292,6 +292,10 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
|
|||
|
||||
choose_new_asid(next, next_tlb_gen, &new_asid, &need_flush);
|
||||
|
||||
/* Let nmi_uaccess_okay() know that we're changing CR3. */
|
||||
this_cpu_write(cpu_tlbstate.loaded_mm, LOADED_MM_SWITCHING);
|
||||
barrier();
|
||||
|
||||
if (need_flush) {
|
||||
this_cpu_write(cpu_tlbstate.ctxs[new_asid].ctx_id, next->context.ctx_id);
|
||||
this_cpu_write(cpu_tlbstate.ctxs[new_asid].tlb_gen, next_tlb_gen);
|
||||
|
|
@ -322,6 +326,9 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
|
|||
if (next != &init_mm)
|
||||
this_cpu_write(cpu_tlbstate.last_ctx_id, next->context.ctx_id);
|
||||
|
||||
/* Make sure we write CR3 before loaded_mm. */
|
||||
barrier();
|
||||
|
||||
this_cpu_write(cpu_tlbstate.loaded_mm, next);
|
||||
this_cpu_write(cpu_tlbstate.loaded_mm_asid, new_asid);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ EXPORT_SYMBOL_GPL(of_pm_clk_add_clk);
|
|||
int of_pm_clk_add_clks(struct device *dev)
|
||||
{
|
||||
struct clk **clks;
|
||||
unsigned int i, count;
|
||||
int i, count;
|
||||
int ret;
|
||||
|
||||
if (!dev || !dev->of_node)
|
||||
|
|
|
|||
|
|
@ -112,12 +112,16 @@ struct nbd_device {
|
|||
struct task_struct *task_setup;
|
||||
};
|
||||
|
||||
#define NBD_CMD_REQUEUED 1
|
||||
|
||||
struct nbd_cmd {
|
||||
struct nbd_device *nbd;
|
||||
struct mutex lock;
|
||||
int index;
|
||||
int cookie;
|
||||
struct completion send_complete;
|
||||
blk_status_t status;
|
||||
unsigned long flags;
|
||||
u32 cmd_cookie;
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_DEBUG_FS)
|
||||
|
|
@ -146,6 +150,35 @@ static inline struct device *nbd_to_dev(struct nbd_device *nbd)
|
|||
return disk_to_dev(nbd->disk);
|
||||
}
|
||||
|
||||
static void nbd_requeue_cmd(struct nbd_cmd *cmd)
|
||||
{
|
||||
struct request *req = blk_mq_rq_from_pdu(cmd);
|
||||
|
||||
if (!test_and_set_bit(NBD_CMD_REQUEUED, &cmd->flags))
|
||||
blk_mq_requeue_request(req, true);
|
||||
}
|
||||
|
||||
#define NBD_COOKIE_BITS 32
|
||||
|
||||
static u64 nbd_cmd_handle(struct nbd_cmd *cmd)
|
||||
{
|
||||
struct request *req = blk_mq_rq_from_pdu(cmd);
|
||||
u32 tag = blk_mq_unique_tag(req);
|
||||
u64 cookie = cmd->cmd_cookie;
|
||||
|
||||
return (cookie << NBD_COOKIE_BITS) | tag;
|
||||
}
|
||||
|
||||
static u32 nbd_handle_to_tag(u64 handle)
|
||||
{
|
||||
return (u32)handle;
|
||||
}
|
||||
|
||||
static u32 nbd_handle_to_cookie(u64 handle)
|
||||
{
|
||||
return (u32)(handle >> NBD_COOKIE_BITS);
|
||||
}
|
||||
|
||||
static const char *nbdcmd_to_ascii(int cmd)
|
||||
{
|
||||
switch (cmd) {
|
||||
|
|
@ -306,6 +339,9 @@ static enum blk_eh_timer_return nbd_xmit_timeout(struct request *req,
|
|||
}
|
||||
config = nbd->config;
|
||||
|
||||
if (!mutex_trylock(&cmd->lock))
|
||||
return BLK_EH_RESET_TIMER;
|
||||
|
||||
if (config->num_connections > 1) {
|
||||
dev_err_ratelimited(nbd_to_dev(nbd),
|
||||
"Connection timed out, retrying\n");
|
||||
|
|
@ -328,7 +364,8 @@ static enum blk_eh_timer_return nbd_xmit_timeout(struct request *req,
|
|||
nbd_mark_nsock_dead(nbd, nsock, 1);
|
||||
mutex_unlock(&nsock->tx_lock);
|
||||
}
|
||||
blk_mq_requeue_request(req, true);
|
||||
mutex_unlock(&cmd->lock);
|
||||
nbd_requeue_cmd(cmd);
|
||||
nbd_config_put(nbd);
|
||||
return BLK_EH_NOT_HANDLED;
|
||||
}
|
||||
|
|
@ -338,6 +375,7 @@ static enum blk_eh_timer_return nbd_xmit_timeout(struct request *req,
|
|||
}
|
||||
set_bit(NBD_TIMEDOUT, &config->runtime_flags);
|
||||
cmd->status = BLK_STS_IOERR;
|
||||
mutex_unlock(&cmd->lock);
|
||||
sock_shutdown(nbd);
|
||||
nbd_config_put(nbd);
|
||||
|
||||
|
|
@ -414,9 +452,9 @@ static int nbd_send_cmd(struct nbd_device *nbd, struct nbd_cmd *cmd, int index)
|
|||
struct iov_iter from;
|
||||
unsigned long size = blk_rq_bytes(req);
|
||||
struct bio *bio;
|
||||
u64 handle;
|
||||
u32 type;
|
||||
u32 nbd_cmd_flags = 0;
|
||||
u32 tag = blk_mq_unique_tag(req);
|
||||
int sent = nsock->sent, skip = 0;
|
||||
|
||||
iov_iter_kvec(&from, WRITE | ITER_KVEC, &iov, 1, sizeof(request));
|
||||
|
|
@ -458,6 +496,8 @@ static int nbd_send_cmd(struct nbd_device *nbd, struct nbd_cmd *cmd, int index)
|
|||
goto send_pages;
|
||||
}
|
||||
iov_iter_advance(&from, sent);
|
||||
} else {
|
||||
cmd->cmd_cookie++;
|
||||
}
|
||||
cmd->index = index;
|
||||
cmd->cookie = nsock->cookie;
|
||||
|
|
@ -466,7 +506,8 @@ static int nbd_send_cmd(struct nbd_device *nbd, struct nbd_cmd *cmd, int index)
|
|||
request.from = cpu_to_be64((u64)blk_rq_pos(req) << 9);
|
||||
request.len = htonl(size);
|
||||
}
|
||||
memcpy(request.handle, &tag, sizeof(tag));
|
||||
handle = nbd_cmd_handle(cmd);
|
||||
memcpy(request.handle, &handle, sizeof(handle));
|
||||
|
||||
dev_dbg(nbd_to_dev(nbd), "request %p: sending control (%s@%llu,%uB)\n",
|
||||
cmd, nbdcmd_to_ascii(type),
|
||||
|
|
@ -484,6 +525,7 @@ static int nbd_send_cmd(struct nbd_device *nbd, struct nbd_cmd *cmd, int index)
|
|||
nsock->pending = req;
|
||||
nsock->sent = sent;
|
||||
}
|
||||
set_bit(NBD_CMD_REQUEUED, &cmd->flags);
|
||||
return BLK_STS_RESOURCE;
|
||||
}
|
||||
dev_err_ratelimited(disk_to_dev(nbd->disk),
|
||||
|
|
@ -525,6 +567,7 @@ send_pages:
|
|||
*/
|
||||
nsock->pending = req;
|
||||
nsock->sent = sent;
|
||||
set_bit(NBD_CMD_REQUEUED, &cmd->flags);
|
||||
return BLK_STS_RESOURCE;
|
||||
}
|
||||
dev_err(disk_to_dev(nbd->disk),
|
||||
|
|
@ -557,10 +600,12 @@ static struct nbd_cmd *nbd_read_stat(struct nbd_device *nbd, int index)
|
|||
struct nbd_reply reply;
|
||||
struct nbd_cmd *cmd;
|
||||
struct request *req = NULL;
|
||||
u64 handle;
|
||||
u16 hwq;
|
||||
u32 tag;
|
||||
struct kvec iov = {.iov_base = &reply, .iov_len = sizeof(reply)};
|
||||
struct iov_iter to;
|
||||
int ret = 0;
|
||||
|
||||
reply.magic = 0;
|
||||
iov_iter_kvec(&to, READ | ITER_KVEC, &iov, 1, sizeof(reply));
|
||||
|
|
@ -578,8 +623,8 @@ static struct nbd_cmd *nbd_read_stat(struct nbd_device *nbd, int index)
|
|||
return ERR_PTR(-EPROTO);
|
||||
}
|
||||
|
||||
memcpy(&tag, reply.handle, sizeof(u32));
|
||||
|
||||
memcpy(&handle, reply.handle, sizeof(handle));
|
||||
tag = nbd_handle_to_tag(handle);
|
||||
hwq = blk_mq_unique_tag_to_hwq(tag);
|
||||
if (hwq < nbd->tag_set.nr_hw_queues)
|
||||
req = blk_mq_tag_to_rq(nbd->tag_set.tags[hwq],
|
||||
|
|
@ -590,11 +635,25 @@ static struct nbd_cmd *nbd_read_stat(struct nbd_device *nbd, int index)
|
|||
return ERR_PTR(-ENOENT);
|
||||
}
|
||||
cmd = blk_mq_rq_to_pdu(req);
|
||||
|
||||
mutex_lock(&cmd->lock);
|
||||
if (cmd->cmd_cookie != nbd_handle_to_cookie(handle)) {
|
||||
dev_err(disk_to_dev(nbd->disk), "Double reply on req %p, cmd_cookie %u, handle cookie %u\n",
|
||||
req, cmd->cmd_cookie, nbd_handle_to_cookie(handle));
|
||||
ret = -ENOENT;
|
||||
goto out;
|
||||
}
|
||||
if (test_bit(NBD_CMD_REQUEUED, &cmd->flags)) {
|
||||
dev_err(disk_to_dev(nbd->disk), "Raced with timeout on req %p\n",
|
||||
req);
|
||||
ret = -ENOENT;
|
||||
goto out;
|
||||
}
|
||||
if (ntohl(reply.error)) {
|
||||
dev_err(disk_to_dev(nbd->disk), "Other side returned error (%d)\n",
|
||||
ntohl(reply.error));
|
||||
cmd->status = BLK_STS_IOERR;
|
||||
return cmd;
|
||||
goto out;
|
||||
}
|
||||
|
||||
dev_dbg(nbd_to_dev(nbd), "request %p: got reply\n", cmd);
|
||||
|
|
@ -619,18 +678,18 @@ static struct nbd_cmd *nbd_read_stat(struct nbd_device *nbd, int index)
|
|||
if (nbd_disconnected(config) ||
|
||||
config->num_connections <= 1) {
|
||||
cmd->status = BLK_STS_IOERR;
|
||||
return cmd;
|
||||
goto out;
|
||||
}
|
||||
return ERR_PTR(-EIO);
|
||||
ret = -EIO;
|
||||
goto out;
|
||||
}
|
||||
dev_dbg(nbd_to_dev(nbd), "request %p: got %d bytes data\n",
|
||||
cmd, bvec.bv_len);
|
||||
}
|
||||
} else {
|
||||
/* See the comment in nbd_queue_rq. */
|
||||
wait_for_completion(&cmd->send_complete);
|
||||
}
|
||||
return cmd;
|
||||
out:
|
||||
mutex_unlock(&cmd->lock);
|
||||
return ret ? ERR_PTR(ret) : cmd;
|
||||
}
|
||||
|
||||
static void recv_work(struct work_struct *work)
|
||||
|
|
@ -793,7 +852,7 @@ again:
|
|||
*/
|
||||
blk_mq_start_request(req);
|
||||
if (unlikely(nsock->pending && nsock->pending != req)) {
|
||||
blk_mq_requeue_request(req, true);
|
||||
nbd_requeue_cmd(cmd);
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -806,7 +865,7 @@ again:
|
|||
dev_err_ratelimited(disk_to_dev(nbd->disk),
|
||||
"Request send failed, requeueing\n");
|
||||
nbd_mark_nsock_dead(nbd, nsock, 1);
|
||||
blk_mq_requeue_request(req, true);
|
||||
nbd_requeue_cmd(cmd);
|
||||
ret = 0;
|
||||
}
|
||||
out:
|
||||
|
|
@ -830,7 +889,8 @@ static blk_status_t nbd_queue_rq(struct blk_mq_hw_ctx *hctx,
|
|||
* that the server is misbehaving (or there was an error) before we're
|
||||
* done sending everything over the wire.
|
||||
*/
|
||||
init_completion(&cmd->send_complete);
|
||||
mutex_lock(&cmd->lock);
|
||||
clear_bit(NBD_CMD_REQUEUED, &cmd->flags);
|
||||
|
||||
/* We can be called directly from the user space process, which means we
|
||||
* could possibly have signals pending so our sendmsg will fail. In
|
||||
|
|
@ -842,7 +902,7 @@ static blk_status_t nbd_queue_rq(struct blk_mq_hw_ctx *hctx,
|
|||
ret = BLK_STS_IOERR;
|
||||
else if (!ret)
|
||||
ret = BLK_STS_OK;
|
||||
complete(&cmd->send_complete);
|
||||
mutex_unlock(&cmd->lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -1446,6 +1506,8 @@ static int nbd_init_request(struct blk_mq_tag_set *set, struct request *rq,
|
|||
{
|
||||
struct nbd_cmd *cmd = blk_mq_rq_to_pdu(rq);
|
||||
cmd->nbd = set->driver_data;
|
||||
cmd->flags = 0;
|
||||
mutex_init(&cmd->lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2542,7 +2542,7 @@ static int cdrom_ioctl_drive_status(struct cdrom_device_info *cdi,
|
|||
if (!CDROM_CAN(CDC_SELECT_DISC) ||
|
||||
(arg == CDSL_CURRENT || arg == CDSL_NONE))
|
||||
return cdi->ops->drive_status(cdi, CDSL_CURRENT);
|
||||
if (((int)arg >= cdi->capacity))
|
||||
if (arg >= cdi->capacity)
|
||||
return -EINVAL;
|
||||
return cdrom_slot_status(cdi, arg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ static ssize_t tpm_try_transmit(struct tpm_chip *chip,
|
|||
header->tag = cpu_to_be16(TPM2_ST_NO_SESSIONS);
|
||||
header->return_code = cpu_to_be32(TPM2_RC_COMMAND_CODE |
|
||||
TSS2_RESMGR_TPM_RC_LAYER);
|
||||
return bufsiz;
|
||||
return sizeof(*header);
|
||||
}
|
||||
|
||||
if (bufsiz > TPM_BUFSIZE)
|
||||
|
|
|
|||
|
|
@ -630,7 +630,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {
|
|||
MUX(0, "clk_i2sout_src", mux_i2sch_p, CLK_SET_RATE_PARENT,
|
||||
RK3399_CLKSEL_CON(31), 0, 2, MFLAGS),
|
||||
COMPOSITE_NODIV(SCLK_I2S_8CH_OUT, "clk_i2sout", mux_i2sout_p, CLK_SET_RATE_PARENT,
|
||||
RK3399_CLKSEL_CON(30), 8, 2, MFLAGS,
|
||||
RK3399_CLKSEL_CON(31), 2, 1, MFLAGS,
|
||||
RK3399_CLKGATE_CON(8), 12, GFLAGS),
|
||||
|
||||
/* uart */
|
||||
|
|
|
|||
|
|
@ -27,21 +27,23 @@
|
|||
#include <asm/switch_to.h>
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/scatterwalk.h>
|
||||
#include <crypto/skcipher.h>
|
||||
|
||||
#include "aesp8-ppc.h"
|
||||
|
||||
struct p8_aes_ctr_ctx {
|
||||
struct crypto_blkcipher *fallback;
|
||||
struct crypto_skcipher *fallback;
|
||||
struct aes_key enc_key;
|
||||
};
|
||||
|
||||
static int p8_aes_ctr_init(struct crypto_tfm *tfm)
|
||||
{
|
||||
const char *alg = crypto_tfm_alg_name(tfm);
|
||||
struct crypto_blkcipher *fallback;
|
||||
struct crypto_skcipher *fallback;
|
||||
struct p8_aes_ctr_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||
|
||||
fallback =
|
||||
crypto_alloc_blkcipher(alg, 0, CRYPTO_ALG_NEED_FALLBACK);
|
||||
fallback = crypto_alloc_skcipher(alg, 0,
|
||||
CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK);
|
||||
if (IS_ERR(fallback)) {
|
||||
printk(KERN_ERR
|
||||
"Failed to allocate transformation for '%s': %ld\n",
|
||||
|
|
@ -49,9 +51,9 @@ static int p8_aes_ctr_init(struct crypto_tfm *tfm)
|
|||
return PTR_ERR(fallback);
|
||||
}
|
||||
|
||||
crypto_blkcipher_set_flags(
|
||||
crypto_skcipher_set_flags(
|
||||
fallback,
|
||||
crypto_blkcipher_get_flags((struct crypto_blkcipher *)tfm));
|
||||
crypto_skcipher_get_flags((struct crypto_skcipher *)tfm));
|
||||
ctx->fallback = fallback;
|
||||
|
||||
return 0;
|
||||
|
|
@ -62,7 +64,7 @@ static void p8_aes_ctr_exit(struct crypto_tfm *tfm)
|
|||
struct p8_aes_ctr_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||
|
||||
if (ctx->fallback) {
|
||||
crypto_free_blkcipher(ctx->fallback);
|
||||
crypto_free_skcipher(ctx->fallback);
|
||||
ctx->fallback = NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -81,7 +83,7 @@ static int p8_aes_ctr_setkey(struct crypto_tfm *tfm, const u8 *key,
|
|||
pagefault_enable();
|
||||
preempt_enable();
|
||||
|
||||
ret += crypto_blkcipher_setkey(ctx->fallback, key, keylen);
|
||||
ret += crypto_skcipher_setkey(ctx->fallback, key, keylen);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -115,15 +117,14 @@ static int p8_aes_ctr_crypt(struct blkcipher_desc *desc,
|
|||
struct blkcipher_walk walk;
|
||||
struct p8_aes_ctr_ctx *ctx =
|
||||
crypto_tfm_ctx(crypto_blkcipher_tfm(desc->tfm));
|
||||
struct blkcipher_desc fallback_desc = {
|
||||
.tfm = ctx->fallback,
|
||||
.info = desc->info,
|
||||
.flags = desc->flags
|
||||
};
|
||||
|
||||
if (in_interrupt()) {
|
||||
ret = crypto_blkcipher_encrypt(&fallback_desc, dst, src,
|
||||
nbytes);
|
||||
SKCIPHER_REQUEST_ON_STACK(req, ctx->fallback);
|
||||
skcipher_request_set_tfm(req, ctx->fallback);
|
||||
skcipher_request_set_callback(req, desc->flags, NULL, NULL);
|
||||
skcipher_request_set_crypt(req, src, dst, nbytes, desc->info);
|
||||
ret = crypto_skcipher_encrypt(req);
|
||||
skcipher_request_zero(req);
|
||||
} else {
|
||||
blkcipher_walk_init(&walk, dst, src, nbytes);
|
||||
ret = blkcipher_walk_virt_block(desc, &walk, AES_BLOCK_SIZE);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
struct acpi_gpio_event {
|
||||
struct list_head node;
|
||||
struct list_head initial_sync_list;
|
||||
acpi_handle handle;
|
||||
unsigned int pin;
|
||||
unsigned int irq;
|
||||
|
|
@ -50,6 +51,9 @@ struct acpi_gpio_chip {
|
|||
struct list_head events;
|
||||
};
|
||||
|
||||
static LIST_HEAD(acpi_gpio_initial_sync_list);
|
||||
static DEFINE_MUTEX(acpi_gpio_initial_sync_list_lock);
|
||||
|
||||
static int acpi_gpiochip_find(struct gpio_chip *gc, void *data)
|
||||
{
|
||||
if (!gc->parent)
|
||||
|
|
@ -142,6 +146,21 @@ static struct gpio_desc *acpi_get_gpiod(char *path, int pin)
|
|||
return gpiochip_get_desc(chip, offset);
|
||||
}
|
||||
|
||||
static void acpi_gpio_add_to_initial_sync_list(struct acpi_gpio_event *event)
|
||||
{
|
||||
mutex_lock(&acpi_gpio_initial_sync_list_lock);
|
||||
list_add(&event->initial_sync_list, &acpi_gpio_initial_sync_list);
|
||||
mutex_unlock(&acpi_gpio_initial_sync_list_lock);
|
||||
}
|
||||
|
||||
static void acpi_gpio_del_from_initial_sync_list(struct acpi_gpio_event *event)
|
||||
{
|
||||
mutex_lock(&acpi_gpio_initial_sync_list_lock);
|
||||
if (!list_empty(&event->initial_sync_list))
|
||||
list_del_init(&event->initial_sync_list);
|
||||
mutex_unlock(&acpi_gpio_initial_sync_list_lock);
|
||||
}
|
||||
|
||||
static irqreturn_t acpi_gpio_irq_handler(int irq, void *data)
|
||||
{
|
||||
struct acpi_gpio_event *event = data;
|
||||
|
|
@ -193,7 +212,7 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
|
|||
irq_handler_t handler = NULL;
|
||||
struct gpio_desc *desc;
|
||||
unsigned long irqflags;
|
||||
int ret, pin, irq;
|
||||
int ret, pin, irq, value;
|
||||
|
||||
if (!acpi_gpio_get_irq_resource(ares, &agpio))
|
||||
return AE_OK;
|
||||
|
|
@ -228,6 +247,8 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
|
|||
|
||||
gpiod_direction_input(desc);
|
||||
|
||||
value = gpiod_get_value(desc);
|
||||
|
||||
ret = gpiochip_lock_as_irq(chip, pin);
|
||||
if (ret) {
|
||||
dev_err(chip->parent, "Failed to lock GPIO as interrupt\n");
|
||||
|
|
@ -269,6 +290,7 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
|
|||
event->irq = irq;
|
||||
event->pin = pin;
|
||||
event->desc = desc;
|
||||
INIT_LIST_HEAD(&event->initial_sync_list);
|
||||
|
||||
ret = request_threaded_irq(event->irq, NULL, handler, irqflags,
|
||||
"ACPI:Event", event);
|
||||
|
|
@ -283,6 +305,18 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
|
|||
enable_irq_wake(irq);
|
||||
|
||||
list_add_tail(&event->node, &acpi_gpio->events);
|
||||
|
||||
/*
|
||||
* Make sure we trigger the initial state of the IRQ when using RISING
|
||||
* or FALLING. Note we run the handlers on late_init, the AML code
|
||||
* may refer to OperationRegions from other (builtin) drivers which
|
||||
* may be probed after us.
|
||||
*/
|
||||
if (handler == acpi_gpio_irq_handler &&
|
||||
(((irqflags & IRQF_TRIGGER_RISING) && value == 1) ||
|
||||
((irqflags & IRQF_TRIGGER_FALLING) && value == 0)))
|
||||
acpi_gpio_add_to_initial_sync_list(event);
|
||||
|
||||
return AE_OK;
|
||||
|
||||
fail_free_event:
|
||||
|
|
@ -355,6 +389,8 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip)
|
|||
list_for_each_entry_safe_reverse(event, ep, &acpi_gpio->events, node) {
|
||||
struct gpio_desc *desc;
|
||||
|
||||
acpi_gpio_del_from_initial_sync_list(event);
|
||||
|
||||
if (irqd_is_wakeup_set(irq_get_irq_data(event->irq)))
|
||||
disable_irq_wake(event->irq);
|
||||
|
||||
|
|
@ -1210,3 +1246,21 @@ bool acpi_can_fallback_to_crs(struct acpi_device *adev, const char *con_id)
|
|||
|
||||
return con_id == NULL;
|
||||
}
|
||||
|
||||
/* Sync the initial state of handlers after all builtin drivers have probed */
|
||||
static int acpi_gpio_initial_sync(void)
|
||||
{
|
||||
struct acpi_gpio_event *event, *ep;
|
||||
|
||||
mutex_lock(&acpi_gpio_initial_sync_list_lock);
|
||||
list_for_each_entry_safe(event, ep, &acpi_gpio_initial_sync_list,
|
||||
initial_sync_list) {
|
||||
acpi_evaluate_object(event->handle, NULL, NULL, NULL);
|
||||
list_del_init(&event->initial_sync_list);
|
||||
}
|
||||
mutex_unlock(&acpi_gpio_initial_sync_list_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* We must use _sync so that this runs after the first deferred_probe run */
|
||||
late_initcall_sync(acpi_gpio_initial_sync);
|
||||
|
|
|
|||
|
|
@ -424,6 +424,18 @@ static void adv7511_hpd_work(struct work_struct *work)
|
|||
else
|
||||
status = connector_status_disconnected;
|
||||
|
||||
/*
|
||||
* The bridge resets its registers on unplug. So when we get a plug
|
||||
* event and we're already supposed to be powered, cycle the bridge to
|
||||
* restore its state.
|
||||
*/
|
||||
if (status == connector_status_connected &&
|
||||
adv7511->connector.status == connector_status_disconnected &&
|
||||
adv7511->powered) {
|
||||
regcache_mark_dirty(adv7511->regmap);
|
||||
adv7511_power_on(adv7511);
|
||||
}
|
||||
|
||||
if (adv7511->connector.status != status) {
|
||||
adv7511->connector.status = status;
|
||||
drm_kms_helper_hotplug_event(adv7511->connector.dev);
|
||||
|
|
|
|||
|
|
@ -612,6 +612,9 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
|
|||
return PTR_ERR(imx_ldb->regmap);
|
||||
}
|
||||
|
||||
/* disable LDB by resetting the control register to POR default */
|
||||
regmap_write(imx_ldb->regmap, IOMUXC_GPR2, 0);
|
||||
|
||||
imx_ldb->dev = dev;
|
||||
|
||||
if (of_id)
|
||||
|
|
@ -652,14 +655,14 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
|
|||
if (ret || i < 0 || i > 1)
|
||||
return -EINVAL;
|
||||
|
||||
if (!of_device_is_available(child))
|
||||
continue;
|
||||
|
||||
if (dual && i > 0) {
|
||||
dev_warn(dev, "dual-channel mode, ignoring second output\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!of_device_is_available(child))
|
||||
continue;
|
||||
|
||||
channel = &imx_ldb->channel[i];
|
||||
channel->ldb = imx_ldb;
|
||||
channel->chno = i;
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ udl_fb_user_fb_create(struct drm_device *dev,
|
|||
struct drm_file *file,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd);
|
||||
|
||||
int udl_render_hline(struct drm_device *dev, int bpp, struct urb **urb_ptr,
|
||||
int udl_render_hline(struct drm_device *dev, int log_bpp, struct urb **urb_ptr,
|
||||
const char *front, char **urb_buf_ptr,
|
||||
u32 byte_offset, u32 device_byte_offset, u32 byte_width,
|
||||
int *ident_ptr, int *sent_ptr);
|
||||
|
|
|
|||
|
|
@ -90,7 +90,10 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y,
|
|||
int bytes_identical = 0;
|
||||
struct urb *urb;
|
||||
int aligned_x;
|
||||
int bpp = fb->base.format->cpp[0];
|
||||
int log_bpp;
|
||||
|
||||
BUG_ON(!is_power_of_2(fb->base.format->cpp[0]));
|
||||
log_bpp = __ffs(fb->base.format->cpp[0]);
|
||||
|
||||
if (!fb->active_16)
|
||||
return 0;
|
||||
|
|
@ -125,12 +128,12 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y,
|
|||
|
||||
for (i = y; i < y + height ; i++) {
|
||||
const int line_offset = fb->base.pitches[0] * i;
|
||||
const int byte_offset = line_offset + (x * bpp);
|
||||
const int dev_byte_offset = (fb->base.width * bpp * i) + (x * bpp);
|
||||
if (udl_render_hline(dev, bpp, &urb,
|
||||
const int byte_offset = line_offset + (x << log_bpp);
|
||||
const int dev_byte_offset = (fb->base.width * i + x) << log_bpp;
|
||||
if (udl_render_hline(dev, log_bpp, &urb,
|
||||
(char *) fb->obj->vmapping,
|
||||
&cmd, byte_offset, dev_byte_offset,
|
||||
width * bpp,
|
||||
width << log_bpp,
|
||||
&bytes_identical, &bytes_sent))
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -149,7 +152,7 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y,
|
|||
error:
|
||||
atomic_add(bytes_sent, &udl->bytes_sent);
|
||||
atomic_add(bytes_identical, &udl->bytes_identical);
|
||||
atomic_add(width*height*bpp, &udl->bytes_rendered);
|
||||
atomic_add((width * height) << log_bpp, &udl->bytes_rendered);
|
||||
end_cycles = get_cycles();
|
||||
atomic_add(((unsigned int) ((end_cycles - start_cycles)
|
||||
>> 10)), /* Kcycles */
|
||||
|
|
@ -221,7 +224,7 @@ static int udl_fb_open(struct fb_info *info, int user)
|
|||
|
||||
struct fb_deferred_io *fbdefio;
|
||||
|
||||
fbdefio = kmalloc(sizeof(struct fb_deferred_io), GFP_KERNEL);
|
||||
fbdefio = kzalloc(sizeof(struct fb_deferred_io), GFP_KERNEL);
|
||||
|
||||
if (fbdefio) {
|
||||
fbdefio->delay = DL_DEFIO_WRITE_DELAY;
|
||||
|
|
|
|||
|
|
@ -169,18 +169,13 @@ static void udl_free_urb_list(struct drm_device *dev)
|
|||
struct list_head *node;
|
||||
struct urb_node *unode;
|
||||
struct urb *urb;
|
||||
int ret;
|
||||
unsigned long flags;
|
||||
|
||||
DRM_DEBUG("Waiting for completes and freeing all render urbs\n");
|
||||
|
||||
/* keep waiting and freeing, until we've got 'em all */
|
||||
while (count--) {
|
||||
|
||||
/* Getting interrupted means a leak, but ok at shutdown*/
|
||||
ret = down_interruptible(&udl->urbs.limit_sem);
|
||||
if (ret)
|
||||
break;
|
||||
down(&udl->urbs.limit_sem);
|
||||
|
||||
spin_lock_irqsave(&udl->urbs.lock, flags);
|
||||
|
||||
|
|
@ -204,17 +199,22 @@ static void udl_free_urb_list(struct drm_device *dev)
|
|||
static int udl_alloc_urb_list(struct drm_device *dev, int count, size_t size)
|
||||
{
|
||||
struct udl_device *udl = dev->dev_private;
|
||||
int i = 0;
|
||||
struct urb *urb;
|
||||
struct urb_node *unode;
|
||||
char *buf;
|
||||
size_t wanted_size = count * size;
|
||||
|
||||
spin_lock_init(&udl->urbs.lock);
|
||||
|
||||
retry:
|
||||
udl->urbs.size = size;
|
||||
INIT_LIST_HEAD(&udl->urbs.list);
|
||||
|
||||
while (i < count) {
|
||||
sema_init(&udl->urbs.limit_sem, 0);
|
||||
udl->urbs.count = 0;
|
||||
udl->urbs.available = 0;
|
||||
|
||||
while (udl->urbs.count * size < wanted_size) {
|
||||
unode = kzalloc(sizeof(struct urb_node), GFP_KERNEL);
|
||||
if (!unode)
|
||||
break;
|
||||
|
|
@ -230,11 +230,16 @@ static int udl_alloc_urb_list(struct drm_device *dev, int count, size_t size)
|
|||
}
|
||||
unode->urb = urb;
|
||||
|
||||
buf = usb_alloc_coherent(udl->udev, MAX_TRANSFER, GFP_KERNEL,
|
||||
buf = usb_alloc_coherent(udl->udev, size, GFP_KERNEL,
|
||||
&urb->transfer_dma);
|
||||
if (!buf) {
|
||||
kfree(unode);
|
||||
usb_free_urb(urb);
|
||||
if (size > PAGE_SIZE) {
|
||||
size /= 2;
|
||||
udl_free_urb_list(dev);
|
||||
goto retry;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -245,16 +250,14 @@ static int udl_alloc_urb_list(struct drm_device *dev, int count, size_t size)
|
|||
|
||||
list_add_tail(&unode->entry, &udl->urbs.list);
|
||||
|
||||
i++;
|
||||
up(&udl->urbs.limit_sem);
|
||||
udl->urbs.count++;
|
||||
udl->urbs.available++;
|
||||
}
|
||||
|
||||
sema_init(&udl->urbs.limit_sem, i);
|
||||
udl->urbs.count = i;
|
||||
udl->urbs.available = i;
|
||||
DRM_DEBUG("allocated %d %d byte urbs\n", udl->urbs.count, (int) size);
|
||||
|
||||
DRM_DEBUG("allocated %d %d byte urbs\n", i, (int) size);
|
||||
|
||||
return i;
|
||||
return udl->urbs.count;
|
||||
}
|
||||
|
||||
struct urb *udl_get_urb(struct drm_device *dev)
|
||||
|
|
|
|||
|
|
@ -83,12 +83,12 @@ static inline u16 pixel32_to_be16(const uint32_t pixel)
|
|||
((pixel >> 8) & 0xf800));
|
||||
}
|
||||
|
||||
static inline u16 get_pixel_val16(const uint8_t *pixel, int bpp)
|
||||
static inline u16 get_pixel_val16(const uint8_t *pixel, int log_bpp)
|
||||
{
|
||||
u16 pixel_val16 = 0;
|
||||
if (bpp == 2)
|
||||
u16 pixel_val16;
|
||||
if (log_bpp == 1)
|
||||
pixel_val16 = *(const uint16_t *)pixel;
|
||||
else if (bpp == 4)
|
||||
else
|
||||
pixel_val16 = pixel32_to_be16(*(const uint32_t *)pixel);
|
||||
return pixel_val16;
|
||||
}
|
||||
|
|
@ -125,8 +125,9 @@ static void udl_compress_hline16(
|
|||
const u8 *const pixel_end,
|
||||
uint32_t *device_address_ptr,
|
||||
uint8_t **command_buffer_ptr,
|
||||
const uint8_t *const cmd_buffer_end, int bpp)
|
||||
const uint8_t *const cmd_buffer_end, int log_bpp)
|
||||
{
|
||||
const int bpp = 1 << log_bpp;
|
||||
const u8 *pixel = *pixel_start_ptr;
|
||||
uint32_t dev_addr = *device_address_ptr;
|
||||
uint8_t *cmd = *command_buffer_ptr;
|
||||
|
|
@ -153,12 +154,12 @@ static void udl_compress_hline16(
|
|||
raw_pixels_count_byte = cmd++; /* we'll know this later */
|
||||
raw_pixel_start = pixel;
|
||||
|
||||
cmd_pixel_end = pixel + min3(MAX_CMD_PIXELS + 1UL,
|
||||
(unsigned long)(pixel_end - pixel) / bpp,
|
||||
(unsigned long)(cmd_buffer_end - 1 - cmd) / 2) * bpp;
|
||||
cmd_pixel_end = pixel + (min3(MAX_CMD_PIXELS + 1UL,
|
||||
(unsigned long)(pixel_end - pixel) >> log_bpp,
|
||||
(unsigned long)(cmd_buffer_end - 1 - cmd) / 2) << log_bpp);
|
||||
|
||||
prefetch_range((void *) pixel, cmd_pixel_end - pixel);
|
||||
pixel_val16 = get_pixel_val16(pixel, bpp);
|
||||
pixel_val16 = get_pixel_val16(pixel, log_bpp);
|
||||
|
||||
while (pixel < cmd_pixel_end) {
|
||||
const u8 *const start = pixel;
|
||||
|
|
@ -170,7 +171,7 @@ static void udl_compress_hline16(
|
|||
pixel += bpp;
|
||||
|
||||
while (pixel < cmd_pixel_end) {
|
||||
pixel_val16 = get_pixel_val16(pixel, bpp);
|
||||
pixel_val16 = get_pixel_val16(pixel, log_bpp);
|
||||
if (pixel_val16 != repeating_pixel_val16)
|
||||
break;
|
||||
pixel += bpp;
|
||||
|
|
@ -179,10 +180,10 @@ static void udl_compress_hline16(
|
|||
if (unlikely(pixel > start + bpp)) {
|
||||
/* go back and fill in raw pixel count */
|
||||
*raw_pixels_count_byte = (((start -
|
||||
raw_pixel_start) / bpp) + 1) & 0xFF;
|
||||
raw_pixel_start) >> log_bpp) + 1) & 0xFF;
|
||||
|
||||
/* immediately after raw data is repeat byte */
|
||||
*cmd++ = (((pixel - start) / bpp) - 1) & 0xFF;
|
||||
*cmd++ = (((pixel - start) >> log_bpp) - 1) & 0xFF;
|
||||
|
||||
/* Then start another raw pixel span */
|
||||
raw_pixel_start = pixel;
|
||||
|
|
@ -192,14 +193,14 @@ static void udl_compress_hline16(
|
|||
|
||||
if (pixel > raw_pixel_start) {
|
||||
/* finalize last RAW span */
|
||||
*raw_pixels_count_byte = ((pixel-raw_pixel_start) / bpp) & 0xFF;
|
||||
*raw_pixels_count_byte = ((pixel - raw_pixel_start) >> log_bpp) & 0xFF;
|
||||
} else {
|
||||
/* undo unused byte */
|
||||
cmd--;
|
||||
}
|
||||
|
||||
*cmd_pixels_count_byte = ((pixel - cmd_pixel_start) / bpp) & 0xFF;
|
||||
dev_addr += ((pixel - cmd_pixel_start) / bpp) * 2;
|
||||
*cmd_pixels_count_byte = ((pixel - cmd_pixel_start) >> log_bpp) & 0xFF;
|
||||
dev_addr += ((pixel - cmd_pixel_start) >> log_bpp) * 2;
|
||||
}
|
||||
|
||||
if (cmd_buffer_end <= MIN_RLX_CMD_BYTES + cmd) {
|
||||
|
|
@ -222,19 +223,19 @@ static void udl_compress_hline16(
|
|||
* (that we can only write to, slowly, and can never read), and (optionally)
|
||||
* our shadow copy that tracks what's been sent to that hardware buffer.
|
||||
*/
|
||||
int udl_render_hline(struct drm_device *dev, int bpp, struct urb **urb_ptr,
|
||||
int udl_render_hline(struct drm_device *dev, int log_bpp, struct urb **urb_ptr,
|
||||
const char *front, char **urb_buf_ptr,
|
||||
u32 byte_offset, u32 device_byte_offset,
|
||||
u32 byte_width,
|
||||
int *ident_ptr, int *sent_ptr)
|
||||
{
|
||||
const u8 *line_start, *line_end, *next_pixel;
|
||||
u32 base16 = 0 + (device_byte_offset / bpp) * 2;
|
||||
u32 base16 = 0 + (device_byte_offset >> log_bpp) * 2;
|
||||
struct urb *urb = *urb_ptr;
|
||||
u8 *cmd = *urb_buf_ptr;
|
||||
u8 *cmd_end = (u8 *) urb->transfer_buffer + urb->transfer_buffer_length;
|
||||
|
||||
BUG_ON(!(bpp == 2 || bpp == 4));
|
||||
BUG_ON(!(log_bpp == 1 || log_bpp == 2));
|
||||
|
||||
line_start = (u8 *) (front + byte_offset);
|
||||
next_pixel = line_start;
|
||||
|
|
@ -244,7 +245,7 @@ int udl_render_hline(struct drm_device *dev, int bpp, struct urb **urb_ptr,
|
|||
|
||||
udl_compress_hline16(&next_pixel,
|
||||
line_end, &base16,
|
||||
(u8 **) &cmd, (u8 *) cmd_end, bpp);
|
||||
(u8 **) &cmd, (u8 *) cmd_end, log_bpp);
|
||||
|
||||
if (cmd >= cmd_end) {
|
||||
int len = cmd - (u8 *) urb->transfer_buffer;
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@
|
|||
#include <linux/bitops.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/nospec.h>
|
||||
#include "lm75.h"
|
||||
|
||||
#define USE_ALTERNATE
|
||||
|
|
@ -2642,6 +2643,7 @@ store_pwm_weight_temp_sel(struct device *dev, struct device_attribute *attr,
|
|||
return err;
|
||||
if (val > NUM_TEMP)
|
||||
return -EINVAL;
|
||||
val = array_index_nospec(val, NUM_TEMP + 1);
|
||||
if (val && (!(data->have_temp & BIT(val - 1)) ||
|
||||
!data->temp_src[val - 1]))
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -234,12 +234,16 @@ static void i2c_davinci_calc_clk_dividers(struct davinci_i2c_dev *dev)
|
|||
/*
|
||||
* It's not always possible to have 1 to 2 ratio when d=7, so fall back
|
||||
* to minimal possible clkh in this case.
|
||||
*
|
||||
* Note:
|
||||
* CLKH is not allowed to be 0, in this case I2C clock is not generated
|
||||
* at all
|
||||
*/
|
||||
if (clk >= clkl + d) {
|
||||
if (clk > clkl + d) {
|
||||
clkh = clk - clkl - d;
|
||||
clkl -= d;
|
||||
} else {
|
||||
clkh = 0;
|
||||
clkh = 1;
|
||||
clkl = clk - (d << 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -638,7 +638,7 @@ static int i2c_check_addr_busy(struct i2c_adapter *adapter, int addr)
|
|||
static void i2c_adapter_lock_bus(struct i2c_adapter *adapter,
|
||||
unsigned int flags)
|
||||
{
|
||||
rt_mutex_lock(&adapter->bus_lock);
|
||||
rt_mutex_lock_nested(&adapter->bus_lock, i2c_adapter_depth(adapter));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ static void i2c_mux_lock_bus(struct i2c_adapter *adapter, unsigned int flags)
|
|||
struct i2c_mux_priv *priv = adapter->algo_data;
|
||||
struct i2c_adapter *parent = priv->muxc->parent;
|
||||
|
||||
rt_mutex_lock(&parent->mux_lock);
|
||||
rt_mutex_lock_nested(&parent->mux_lock, i2c_adapter_depth(adapter));
|
||||
if (!(flags & I2C_LOCK_ROOT_ADAPTER))
|
||||
return;
|
||||
i2c_lock_bus(parent, flags);
|
||||
|
|
@ -181,7 +181,7 @@ static void i2c_parent_lock_bus(struct i2c_adapter *adapter,
|
|||
struct i2c_mux_priv *priv = adapter->algo_data;
|
||||
struct i2c_adapter *parent = priv->muxc->parent;
|
||||
|
||||
rt_mutex_lock(&parent->mux_lock);
|
||||
rt_mutex_lock_nested(&parent->mux_lock, i2c_adapter_depth(adapter));
|
||||
i2c_lock_bus(parent, flags);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2100,12 +2100,16 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
if (smmu->version == ARM_SMMU_V2 &&
|
||||
smmu->num_context_banks != smmu->num_context_irqs) {
|
||||
dev_err(dev,
|
||||
"found only %d context interrupt(s) but %d required\n",
|
||||
smmu->num_context_irqs, smmu->num_context_banks);
|
||||
return -ENODEV;
|
||||
if (smmu->version == ARM_SMMU_V2) {
|
||||
if (smmu->num_context_banks > smmu->num_context_irqs) {
|
||||
dev_err(dev,
|
||||
"found only %d context irq(s) but %d required\n",
|
||||
smmu->num_context_irqs, smmu->num_context_banks);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Ignore superfluous interrupts */
|
||||
smmu->num_context_irqs = smmu->num_context_banks;
|
||||
}
|
||||
|
||||
for (i = 0; i < smmu->num_global_irqs; ++i) {
|
||||
|
|
|
|||
|
|
@ -291,7 +291,6 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
|
|||
goto out;
|
||||
}
|
||||
|
||||
*offset = 0;
|
||||
cb = mei_cl_alloc_cb(cl, length, MEI_FOP_WRITE, file);
|
||||
if (!cb) {
|
||||
rets = -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -1637,8 +1637,6 @@ static int m_can_plat_probe(struct platform_device *pdev)
|
|||
priv->can.clock.freq = clk_get_rate(cclk);
|
||||
priv->mram_base = mram_addr;
|
||||
|
||||
m_can_of_parse_mram(priv, mram_config_vals);
|
||||
|
||||
platform_set_drvdata(pdev, dev);
|
||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||
|
||||
|
|
@ -1649,6 +1647,8 @@ static int m_can_plat_probe(struct platform_device *pdev)
|
|||
goto failed_free_dev;
|
||||
}
|
||||
|
||||
m_can_of_parse_mram(priv, mram_config_vals);
|
||||
|
||||
devm_can_led_init(dev);
|
||||
|
||||
dev_info(&pdev->dev, "%s device registered (irq=%d, version=%d)\n",
|
||||
|
|
@ -1698,8 +1698,6 @@ static __maybe_unused int m_can_resume(struct device *dev)
|
|||
|
||||
pinctrl_pm_select_default_state(dev);
|
||||
|
||||
m_can_init_ram(priv);
|
||||
|
||||
priv->can.state = CAN_STATE_ERROR_ACTIVE;
|
||||
|
||||
if (netif_running(ndev)) {
|
||||
|
|
@ -1709,6 +1707,7 @@ static __maybe_unused int m_can_resume(struct device *dev)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
m_can_init_ram(priv);
|
||||
m_can_start(ndev);
|
||||
netif_device_attach(ndev);
|
||||
netif_start_queue(ndev);
|
||||
|
|
|
|||
|
|
@ -86,6 +86,11 @@ static u32 mpc52xx_can_get_clock(struct platform_device *ofdev,
|
|||
return 0;
|
||||
}
|
||||
cdm = of_iomap(np_cdm, 0);
|
||||
if (!cdm) {
|
||||
of_node_put(np_cdm);
|
||||
dev_err(&ofdev->dev, "can't map clock node!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (in_8(&cdm->ipb_clk_sel) & 0x1)
|
||||
freq *= 2;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ config EL3
|
|||
|
||||
config 3C515
|
||||
tristate "3c515 ISA \"Fast EtherLink\""
|
||||
depends on ISA && ISA_DMA_API
|
||||
depends on ISA && ISA_DMA_API && !PPC32
|
||||
---help---
|
||||
If you have a 3Com ISA EtherLink XL "Corkscrew" 3c515 Fast Ethernet
|
||||
network card, say Y here.
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ config AMD8111_ETH
|
|||
|
||||
config LANCE
|
||||
tristate "AMD LANCE and PCnet (AT1500 and NE2100) support"
|
||||
depends on ISA && ISA_DMA_API && !ARM
|
||||
depends on ISA && ISA_DMA_API && !ARM && !PPC32
|
||||
---help---
|
||||
If you have a network (Ethernet) card of this type, say Y here.
|
||||
Some LinkSys cards are of this type.
|
||||
|
|
@ -138,7 +138,7 @@ config PCMCIA_NMCLAN
|
|||
|
||||
config NI65
|
||||
tristate "NI6510 support"
|
||||
depends on ISA && ISA_DMA_API && !ARM
|
||||
depends on ISA && ISA_DMA_API && !ARM && !PPC32
|
||||
---help---
|
||||
If you have a network (Ethernet) card of this type, say Y here.
|
||||
|
||||
|
|
|
|||
|
|
@ -1685,6 +1685,7 @@ static struct sk_buff *atl1c_alloc_skb(struct atl1c_adapter *adapter)
|
|||
skb = build_skb(page_address(page) + adapter->rx_page_offset,
|
||||
adapter->rx_frag_size);
|
||||
if (likely(skb)) {
|
||||
skb_reserve(skb, NET_SKB_PAD);
|
||||
adapter->rx_page_offset += adapter->rx_frag_size;
|
||||
if (adapter->rx_page_offset >= PAGE_SIZE)
|
||||
adapter->rx_page = NULL;
|
||||
|
|
|
|||
|
|
@ -3387,14 +3387,18 @@ static int bnx2x_set_rss_flags(struct bnx2x *bp, struct ethtool_rxnfc *info)
|
|||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"rss re-configured, UDP 4-tupple %s\n",
|
||||
udp_rss_requested ? "enabled" : "disabled");
|
||||
return bnx2x_rss(bp, &bp->rss_conf_obj, false, true);
|
||||
if (bp->state == BNX2X_STATE_OPEN)
|
||||
return bnx2x_rss(bp, &bp->rss_conf_obj, false,
|
||||
true);
|
||||
} else if ((info->flow_type == UDP_V6_FLOW) &&
|
||||
(bp->rss_conf_obj.udp_rss_v6 != udp_rss_requested)) {
|
||||
bp->rss_conf_obj.udp_rss_v6 = udp_rss_requested;
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"rss re-configured, UDP 4-tupple %s\n",
|
||||
udp_rss_requested ? "enabled" : "disabled");
|
||||
return bnx2x_rss(bp, &bp->rss_conf_obj, false, true);
|
||||
if (bp->state == BNX2X_STATE_OPEN)
|
||||
return bnx2x_rss(bp, &bp->rss_conf_obj, false,
|
||||
true);
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
|
@ -3508,7 +3512,10 @@ static int bnx2x_set_rxfh(struct net_device *dev, const u32 *indir,
|
|||
bp->rss_conf_obj.ind_table[i] = indir[i] + bp->fp->cl_id;
|
||||
}
|
||||
|
||||
return bnx2x_config_rss_eth(bp, false);
|
||||
if (bp->state == BNX2X_STATE_OPEN)
|
||||
return bnx2x_config_rss_eth(bp, false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ if NET_VENDOR_CIRRUS
|
|||
config CS89x0
|
||||
tristate "CS89x0 support"
|
||||
depends on ISA || EISA || ARM
|
||||
depends on !PPC32
|
||||
---help---
|
||||
Support for CS89x0 chipset based Ethernet cards. If you have a
|
||||
network (Ethernet) card of this type, say Y and read the file
|
||||
|
|
|
|||
|
|
@ -2007,28 +2007,42 @@ static int enic_stop(struct net_device *netdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int _enic_change_mtu(struct net_device *netdev, int new_mtu)
|
||||
{
|
||||
bool running = netif_running(netdev);
|
||||
int err = 0;
|
||||
|
||||
ASSERT_RTNL();
|
||||
if (running) {
|
||||
err = enic_stop(netdev);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
netdev->mtu = new_mtu;
|
||||
|
||||
if (running) {
|
||||
err = enic_open(netdev);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int enic_change_mtu(struct net_device *netdev, int new_mtu)
|
||||
{
|
||||
struct enic *enic = netdev_priv(netdev);
|
||||
int running = netif_running(netdev);
|
||||
|
||||
if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (running)
|
||||
enic_stop(netdev);
|
||||
|
||||
netdev->mtu = new_mtu;
|
||||
|
||||
if (netdev->mtu > enic->port_mtu)
|
||||
netdev_warn(netdev,
|
||||
"interface MTU (%d) set higher than port MTU (%d)\n",
|
||||
netdev->mtu, enic->port_mtu);
|
||||
"interface MTU (%d) set higher than port MTU (%d)\n",
|
||||
netdev->mtu, enic->port_mtu);
|
||||
|
||||
if (running)
|
||||
enic_open(netdev);
|
||||
|
||||
return 0;
|
||||
return _enic_change_mtu(netdev, new_mtu);
|
||||
}
|
||||
|
||||
static void enic_change_mtu_work(struct work_struct *work)
|
||||
|
|
@ -2036,47 +2050,9 @@ static void enic_change_mtu_work(struct work_struct *work)
|
|||
struct enic *enic = container_of(work, struct enic, change_mtu_work);
|
||||
struct net_device *netdev = enic->netdev;
|
||||
int new_mtu = vnic_dev_mtu(enic->vdev);
|
||||
int err;
|
||||
unsigned int i;
|
||||
|
||||
new_mtu = max_t(int, ENIC_MIN_MTU, min_t(int, ENIC_MAX_MTU, new_mtu));
|
||||
|
||||
rtnl_lock();
|
||||
|
||||
/* Stop RQ */
|
||||
del_timer_sync(&enic->notify_timer);
|
||||
|
||||
for (i = 0; i < enic->rq_count; i++)
|
||||
napi_disable(&enic->napi[i]);
|
||||
|
||||
vnic_intr_mask(&enic->intr[0]);
|
||||
enic_synchronize_irqs(enic);
|
||||
err = vnic_rq_disable(&enic->rq[0]);
|
||||
if (err) {
|
||||
rtnl_unlock();
|
||||
netdev_err(netdev, "Unable to disable RQ.\n");
|
||||
return;
|
||||
}
|
||||
vnic_rq_clean(&enic->rq[0], enic_free_rq_buf);
|
||||
vnic_cq_clean(&enic->cq[0]);
|
||||
vnic_intr_clean(&enic->intr[0]);
|
||||
|
||||
/* Fill RQ with new_mtu-sized buffers */
|
||||
netdev->mtu = new_mtu;
|
||||
vnic_rq_fill(&enic->rq[0], enic_rq_alloc_buf);
|
||||
/* Need at least one buffer on ring to get going */
|
||||
if (vnic_rq_desc_used(&enic->rq[0]) == 0) {
|
||||
rtnl_unlock();
|
||||
netdev_err(netdev, "Unable to alloc receive buffers.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Start RQ */
|
||||
vnic_rq_enable(&enic->rq[0]);
|
||||
napi_enable(&enic->napi[0]);
|
||||
vnic_intr_unmask(&enic->intr[0]);
|
||||
enic_notify_timer_start(enic);
|
||||
|
||||
(void)_enic_change_mtu(netdev, new_mtu);
|
||||
rtnl_unlock();
|
||||
|
||||
netdev_info(netdev, "interface MTU set as %d\n", netdev->mtu);
|
||||
|
|
@ -2867,7 +2843,6 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
*/
|
||||
|
||||
enic->port_mtu = enic->config.mtu;
|
||||
(void)enic_change_mtu(netdev, enic->port_mtu);
|
||||
|
||||
err = enic_set_mac_addr(netdev, enic->mac_addr);
|
||||
if (err) {
|
||||
|
|
@ -2954,6 +2929,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
/* MTU range: 68 - 9000 */
|
||||
netdev->min_mtu = ENIC_MIN_MTU;
|
||||
netdev->max_mtu = ENIC_MAX_MTU;
|
||||
netdev->mtu = enic->port_mtu;
|
||||
|
||||
err = register_netdev(netdev);
|
||||
if (err) {
|
||||
|
|
|
|||
|
|
@ -981,6 +981,7 @@ static int nic_dev_init(struct pci_dev *pdev)
|
|||
hinic_hwdev_cb_register(nic_dev->hwdev, HINIC_MGMT_MSG_CMD_LINK_STATUS,
|
||||
nic_dev, link_status_event_handler);
|
||||
|
||||
SET_NETDEV_DEV(netdev, &pdev->dev);
|
||||
err = register_netdev(netdev);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "Failed to register netdev\n");
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ nfp_flower_repr_get_type_and_port(struct nfp_app *app, u32 port_id, u8 *port)
|
|||
return NFP_REPR_TYPE_VF;
|
||||
}
|
||||
|
||||
return NFP_FLOWER_CMSG_PORT_TYPE_UNSPEC;
|
||||
return __NFP_REPR_TYPE_MAX;
|
||||
}
|
||||
|
||||
static struct net_device *
|
||||
|
|
@ -90,6 +90,8 @@ nfp_flower_repr_get(struct nfp_app *app, u32 port_id)
|
|||
u8 port = 0;
|
||||
|
||||
repr_type = nfp_flower_repr_get_type_and_port(app, port_id, &port);
|
||||
if (repr_type > NFP_REPR_TYPE_MAX)
|
||||
return NULL;
|
||||
|
||||
reprs = rcu_dereference(app->reprs[repr_type]);
|
||||
if (!reprs)
|
||||
|
|
|
|||
|
|
@ -663,7 +663,7 @@ qed_sp_update_mcast_bin(struct qed_hwfn *p_hwfn,
|
|||
|
||||
p_ramrod->common.update_approx_mcast_flg = 1;
|
||||
for (i = 0; i < ETH_MULTICAST_MAC_BINS_IN_REGS; i++) {
|
||||
u32 *p_bins = (u32 *)p_params->bins;
|
||||
u32 *p_bins = p_params->bins;
|
||||
|
||||
p_ramrod->approx_mcast.bins[i] = cpu_to_le32(p_bins[i]);
|
||||
}
|
||||
|
|
@ -1474,8 +1474,8 @@ qed_sp_eth_filter_mcast(struct qed_hwfn *p_hwfn,
|
|||
enum spq_mode comp_mode,
|
||||
struct qed_spq_comp_cb *p_comp_data)
|
||||
{
|
||||
unsigned long bins[ETH_MULTICAST_MAC_BINS_IN_REGS];
|
||||
struct vport_update_ramrod_data *p_ramrod = NULL;
|
||||
u32 bins[ETH_MULTICAST_MAC_BINS_IN_REGS];
|
||||
struct qed_spq_entry *p_ent = NULL;
|
||||
struct qed_sp_init_data init_data;
|
||||
u8 abs_vport_id = 0;
|
||||
|
|
@ -1511,26 +1511,25 @@ qed_sp_eth_filter_mcast(struct qed_hwfn *p_hwfn,
|
|||
/* explicitly clear out the entire vector */
|
||||
memset(&p_ramrod->approx_mcast.bins, 0,
|
||||
sizeof(p_ramrod->approx_mcast.bins));
|
||||
memset(bins, 0, sizeof(unsigned long) *
|
||||
ETH_MULTICAST_MAC_BINS_IN_REGS);
|
||||
memset(bins, 0, sizeof(bins));
|
||||
/* filter ADD op is explicit set op and it removes
|
||||
* any existing filters for the vport
|
||||
*/
|
||||
if (p_filter_cmd->opcode == QED_FILTER_ADD) {
|
||||
for (i = 0; i < p_filter_cmd->num_mc_addrs; i++) {
|
||||
u32 bit;
|
||||
u32 bit, nbits;
|
||||
|
||||
bit = qed_mcast_bin_from_mac(p_filter_cmd->mac[i]);
|
||||
__set_bit(bit, bins);
|
||||
nbits = sizeof(u32) * BITS_PER_BYTE;
|
||||
bins[bit / nbits] |= 1 << (bit % nbits);
|
||||
}
|
||||
|
||||
/* Convert to correct endianity */
|
||||
for (i = 0; i < ETH_MULTICAST_MAC_BINS_IN_REGS; i++) {
|
||||
struct vport_update_ramrod_mcast *p_ramrod_bins;
|
||||
u32 *p_bins = (u32 *)bins;
|
||||
|
||||
p_ramrod_bins = &p_ramrod->approx_mcast;
|
||||
p_ramrod_bins->bins[i] = cpu_to_le32(p_bins[i]);
|
||||
p_ramrod_bins->bins[i] = cpu_to_le32(bins[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ struct qed_sp_vport_update_params {
|
|||
u8 anti_spoofing_en;
|
||||
u8 update_accept_any_vlan_flg;
|
||||
u8 accept_any_vlan;
|
||||
unsigned long bins[8];
|
||||
u32 bins[8];
|
||||
struct qed_rss_params *rss_params;
|
||||
struct qed_filter_accept_flags accept_flags;
|
||||
struct qed_sge_tpa_params *sge_tpa_params;
|
||||
|
|
|
|||
|
|
@ -1182,6 +1182,7 @@ static void qed_mcp_handle_link_change(struct qed_hwfn *p_hwfn,
|
|||
break;
|
||||
default:
|
||||
p_link->speed = 0;
|
||||
p_link->link_up = 0;
|
||||
}
|
||||
|
||||
if (p_link->link_up && p_link->speed)
|
||||
|
|
@ -1279,9 +1280,15 @@ int qed_mcp_set_link(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, bool b_up)
|
|||
phy_cfg.pause |= (params->pause.forced_tx) ? ETH_PAUSE_TX : 0;
|
||||
phy_cfg.adv_speed = params->speed.advertised_speeds;
|
||||
phy_cfg.loopback_mode = params->loopback_mode;
|
||||
if (p_hwfn->mcp_info->capabilities & FW_MB_PARAM_FEATURE_SUPPORT_EEE) {
|
||||
if (params->eee.enable)
|
||||
phy_cfg.eee_cfg |= EEE_CFG_EEE_ENABLED;
|
||||
|
||||
/* There are MFWs that share this capability regardless of whether
|
||||
* this is feasible or not. And given that at the very least adv_caps
|
||||
* would be set internally by qed, we want to make sure LFA would
|
||||
* still work.
|
||||
*/
|
||||
if ((p_hwfn->mcp_info->capabilities &
|
||||
FW_MB_PARAM_FEATURE_SUPPORT_EEE) && params->eee.enable) {
|
||||
phy_cfg.eee_cfg |= EEE_CFG_EEE_ENABLED;
|
||||
if (params->eee.tx_lpi_enable)
|
||||
phy_cfg.eee_cfg |= EEE_CFG_TX_LPI;
|
||||
if (params->eee.adv_caps & QED_EEE_1G_ADV)
|
||||
|
|
|
|||
|
|
@ -2826,7 +2826,7 @@ qed_iov_vp_update_mcast_bin_param(struct qed_hwfn *p_hwfn,
|
|||
|
||||
p_data->update_approx_mcast_flg = 1;
|
||||
memcpy(p_data->bins, p_mcast_tlv->bins,
|
||||
sizeof(unsigned long) * ETH_MULTICAST_MAC_BINS_IN_REGS);
|
||||
sizeof(u32) * ETH_MULTICAST_MAC_BINS_IN_REGS);
|
||||
*tlvs_mask |= 1 << QED_IOV_VP_UPDATE_MCAST;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1126,7 +1126,7 @@ int qed_vf_pf_vport_update(struct qed_hwfn *p_hwfn,
|
|||
resp_size += sizeof(struct pfvf_def_resp_tlv);
|
||||
|
||||
memcpy(p_mcast_tlv->bins, p_params->bins,
|
||||
sizeof(unsigned long) * ETH_MULTICAST_MAC_BINS_IN_REGS);
|
||||
sizeof(u32) * ETH_MULTICAST_MAC_BINS_IN_REGS);
|
||||
}
|
||||
|
||||
update_rx = p_params->accept_flags.update_rx_mode_config;
|
||||
|
|
@ -1272,7 +1272,7 @@ void qed_vf_pf_filter_mcast(struct qed_hwfn *p_hwfn,
|
|||
u32 bit;
|
||||
|
||||
bit = qed_mcast_bin_from_mac(p_filter_cmd->mac[i]);
|
||||
__set_bit(bit, sp_params.bins);
|
||||
sp_params.bins[bit / 32] |= 1 << (bit % 32);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -392,7 +392,12 @@ struct vfpf_vport_update_mcast_bin_tlv {
|
|||
struct channel_tlv tl;
|
||||
u8 padding[4];
|
||||
|
||||
u64 bins[8];
|
||||
/* There are only 256 approx bins, and in HSI they're divided into
|
||||
* 32-bit values. As old VFs used to set-bit to the values on its side,
|
||||
* the upper half of the array is never expected to contain any data.
|
||||
*/
|
||||
u64 bins[4];
|
||||
u64 obsolete_bins[4];
|
||||
};
|
||||
|
||||
struct vfpf_vport_update_accept_param_tlv {
|
||||
|
|
|
|||
|
|
@ -218,6 +218,7 @@ issue:
|
|||
ret = of_mdiobus_register(bus, np1);
|
||||
if (ret) {
|
||||
mdiobus_free(bus);
|
||||
lp->mii_bus = NULL;
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1245,7 +1245,7 @@ static const struct usb_device_id products[] = {
|
|||
{QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
|
||||
{QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */
|
||||
{QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */
|
||||
{QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e */
|
||||
{QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */
|
||||
{QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */
|
||||
{QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */
|
||||
{QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */
|
||||
|
|
|
|||
|
|
@ -1371,7 +1371,7 @@ static irqreturn_t lmc_interrupt (int irq, void *dev_instance) /*fold00*/
|
|||
case 0x001:
|
||||
printk(KERN_WARNING "%s: Master Abort (naughty)\n", dev->name);
|
||||
break;
|
||||
case 0x010:
|
||||
case 0x002:
|
||||
printk(KERN_WARNING "%s: Target Abort (not so naughty)\n", dev->name);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ static int b43_register_led(struct b43_wldev *dev, struct b43_led *led,
|
|||
led->wl = dev->wl;
|
||||
led->index = led_index;
|
||||
led->activelow = activelow;
|
||||
strncpy(led->name, name, sizeof(led->name));
|
||||
strlcpy(led->name, name, sizeof(led->name));
|
||||
atomic_set(&led->state, 0);
|
||||
|
||||
led->led_dev.name = led->name;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ static int b43legacy_register_led(struct b43legacy_wldev *dev,
|
|||
led->dev = dev;
|
||||
led->index = led_index;
|
||||
led->activelow = activelow;
|
||||
strncpy(led->name, name, sizeof(led->name));
|
||||
strlcpy(led->name, name, sizeof(led->name));
|
||||
|
||||
led->led_dev.name = led->name;
|
||||
led->led_dev.default_trigger = default_trigger;
|
||||
|
|
|
|||
|
|
@ -306,6 +306,14 @@ static bool nvme_dbbuf_update_and_check_event(u16 value, u32 *dbbuf_db,
|
|||
old_value = *dbbuf_db;
|
||||
*dbbuf_db = value;
|
||||
|
||||
/*
|
||||
* Ensure that the doorbell is updated before reading the event
|
||||
* index from memory. The controller needs to provide similar
|
||||
* ordering to ensure the envent index is updated before reading
|
||||
* the doorbell.
|
||||
*/
|
||||
mb();
|
||||
|
||||
if (!nvme_dbbuf_need_event(*dbbuf_ei, value, old_value))
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ static void imx1_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
|
|||
const char *name;
|
||||
int i, ret;
|
||||
|
||||
if (group > info->ngroups)
|
||||
if (group >= info->ngroups)
|
||||
return;
|
||||
|
||||
seq_puts(s, "\n");
|
||||
|
|
|
|||
|
|
@ -1097,10 +1097,10 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
|
|||
},
|
||||
},
|
||||
{
|
||||
.ident = "Lenovo Legion Y520-15IKBN",
|
||||
.ident = "Lenovo Legion Y520-15IKB",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Y520-15IKBN"),
|
||||
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Y520-15IKB"),
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -243,10 +243,10 @@ static int gab_probe(struct platform_device *pdev)
|
|||
struct power_supply_desc *psy_desc;
|
||||
struct power_supply_config psy_cfg = {};
|
||||
struct gab_platform_data *pdata = pdev->dev.platform_data;
|
||||
enum power_supply_property *properties;
|
||||
int ret = 0;
|
||||
int chan;
|
||||
int index = 0;
|
||||
int index = ARRAY_SIZE(gab_props);
|
||||
bool any = false;
|
||||
|
||||
adc_bat = devm_kzalloc(&pdev->dev, sizeof(*adc_bat), GFP_KERNEL);
|
||||
if (!adc_bat) {
|
||||
|
|
@ -280,8 +280,6 @@ static int gab_probe(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
memcpy(psy_desc->properties, gab_props, sizeof(gab_props));
|
||||
properties = (enum power_supply_property *)
|
||||
((char *)psy_desc->properties + sizeof(gab_props));
|
||||
|
||||
/*
|
||||
* getting channel from iio and copying the battery properties
|
||||
|
|
@ -295,15 +293,22 @@ static int gab_probe(struct platform_device *pdev)
|
|||
adc_bat->channel[chan] = NULL;
|
||||
} else {
|
||||
/* copying properties for supported channels only */
|
||||
memcpy(properties + sizeof(*(psy_desc->properties)) * index,
|
||||
&gab_dyn_props[chan],
|
||||
sizeof(gab_dyn_props[chan]));
|
||||
index++;
|
||||
int index2;
|
||||
|
||||
for (index2 = 0; index2 < index; index2++) {
|
||||
if (psy_desc->properties[index2] ==
|
||||
gab_dyn_props[chan])
|
||||
break; /* already known */
|
||||
}
|
||||
if (index2 == index) /* really new */
|
||||
psy_desc->properties[index++] =
|
||||
gab_dyn_props[chan];
|
||||
any = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* none of the channels are supported so let's bail out */
|
||||
if (index == 0) {
|
||||
if (!any) {
|
||||
ret = -ENODEV;
|
||||
goto second_mem_fail;
|
||||
}
|
||||
|
|
@ -314,7 +319,7 @@ static int gab_probe(struct platform_device *pdev)
|
|||
* as come channels may be not be supported by the device.So
|
||||
* we need to take care of that.
|
||||
*/
|
||||
psy_desc->num_properties = ARRAY_SIZE(gab_props) + index;
|
||||
psy_desc->num_properties = index;
|
||||
|
||||
adc_bat->psy = power_supply_register(&pdev->dev, psy_desc, &psy_cfg);
|
||||
if (IS_ERR(adc_bat->psy)) {
|
||||
|
|
|
|||
|
|
@ -641,21 +641,20 @@ static inline unsigned long qdio_aob_for_buffer(struct qdio_output_q *q,
|
|||
unsigned long phys_aob = 0;
|
||||
|
||||
if (!q->use_cq)
|
||||
goto out;
|
||||
return 0;
|
||||
|
||||
if (!q->aobs[bufnr]) {
|
||||
struct qaob *aob = qdio_allocate_aob();
|
||||
q->aobs[bufnr] = aob;
|
||||
}
|
||||
if (q->aobs[bufnr]) {
|
||||
q->sbal_state[bufnr].flags = QDIO_OUTBUF_STATE_FLAG_NONE;
|
||||
q->sbal_state[bufnr].aob = q->aobs[bufnr];
|
||||
q->aobs[bufnr]->user1 = (u64) q->sbal_state[bufnr].user;
|
||||
phys_aob = virt_to_phys(q->aobs[bufnr]);
|
||||
WARN_ON_ONCE(phys_aob & 0xFF);
|
||||
}
|
||||
|
||||
out:
|
||||
q->sbal_state[bufnr].flags = 0;
|
||||
return phys_aob;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -754,9 +754,9 @@ int fcoe_ctlr_els_send(struct fcoe_ctlr *fip, struct fc_lport *lport,
|
|||
case ELS_LOGO:
|
||||
if (fip->mode == FIP_MODE_VN2VN) {
|
||||
if (fip->state != FIP_ST_VNMP_UP)
|
||||
return -EINVAL;
|
||||
goto drop;
|
||||
if (ntoh24(fh->fh_d_id) == FC_FID_FLOGI)
|
||||
return -EINVAL;
|
||||
goto drop;
|
||||
} else {
|
||||
if (fip->state != FIP_ST_ENABLED)
|
||||
return 0;
|
||||
|
|
@ -799,9 +799,9 @@ int fcoe_ctlr_els_send(struct fcoe_ctlr *fip, struct fc_lport *lport,
|
|||
fip->send(fip, skb);
|
||||
return -EINPROGRESS;
|
||||
drop:
|
||||
kfree_skb(skb);
|
||||
LIBFCOE_FIP_DBG(fip, "drop els_send op %u d_id %x\n",
|
||||
op, ntoh24(fh->fh_d_id));
|
||||
kfree_skb(skb);
|
||||
return -EINVAL;
|
||||
}
|
||||
EXPORT_SYMBOL(fcoe_ctlr_els_send);
|
||||
|
|
|
|||
|
|
@ -2164,6 +2164,7 @@ static void fc_rport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp)
|
|||
FC_RPORT_DBG(rdata, "Received LOGO request while in state %s\n",
|
||||
fc_rport_state(rdata));
|
||||
|
||||
rdata->flags &= ~FC_RP_STARTED;
|
||||
fc_rport_enter_delete(rdata, RPORT_EV_STOP);
|
||||
mutex_unlock(&rdata->rp_mutex);
|
||||
kref_put(&rdata->kref, fc_rport_destroy);
|
||||
|
|
|
|||
|
|
@ -284,11 +284,11 @@ static int iscsi_check_tmf_restrictions(struct iscsi_task *task, int opcode)
|
|||
*/
|
||||
if (opcode != ISCSI_OP_SCSI_DATA_OUT) {
|
||||
iscsi_conn_printk(KERN_INFO, conn,
|
||||
"task [op %x/%x itt "
|
||||
"task [op %x itt "
|
||||
"0x%x/0x%x] "
|
||||
"rejected.\n",
|
||||
task->hdr->opcode, opcode,
|
||||
task->itt, task->hdr_itt);
|
||||
opcode, task->itt,
|
||||
task->hdr_itt);
|
||||
return -EACCES;
|
||||
}
|
||||
/*
|
||||
|
|
@ -297,10 +297,10 @@ static int iscsi_check_tmf_restrictions(struct iscsi_task *task, int opcode)
|
|||
*/
|
||||
if (conn->session->fast_abort) {
|
||||
iscsi_conn_printk(KERN_INFO, conn,
|
||||
"task [op %x/%x itt "
|
||||
"task [op %x itt "
|
||||
"0x%x/0x%x] fast abort.\n",
|
||||
task->hdr->opcode, opcode,
|
||||
task->itt, task->hdr_itt);
|
||||
opcode, task->itt,
|
||||
task->hdr_itt);
|
||||
return -EACCES;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1936,12 +1936,12 @@ _transport_smp_handler(struct bsg_job *job, struct Scsi_Host *shost,
|
|||
pr_info(MPT3SAS_FMT "%s: host reset in progress!\n",
|
||||
__func__, ioc->name);
|
||||
rc = -EFAULT;
|
||||
goto out;
|
||||
goto job_done;
|
||||
}
|
||||
|
||||
rc = mutex_lock_interruptible(&ioc->transport_cmds.mutex);
|
||||
if (rc)
|
||||
goto out;
|
||||
goto job_done;
|
||||
|
||||
if (ioc->transport_cmds.status != MPT3_CMD_NOT_USED) {
|
||||
pr_err(MPT3SAS_FMT "%s: transport_cmds in use\n", ioc->name,
|
||||
|
|
@ -2066,6 +2066,7 @@ _transport_smp_handler(struct bsg_job *job, struct Scsi_Host *shost,
|
|||
out:
|
||||
ioc->transport_cmds.status = MPT3_CMD_NOT_USED;
|
||||
mutex_unlock(&ioc->transport_cmds.mutex);
|
||||
job_done:
|
||||
bsg_job_done(job, rc, reslen);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -721,8 +721,24 @@ static ssize_t
|
|||
sdev_store_delete(struct device *dev, struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
if (device_remove_file_self(dev, attr))
|
||||
scsi_remove_device(to_scsi_device(dev));
|
||||
struct kernfs_node *kn;
|
||||
|
||||
kn = sysfs_break_active_protection(&dev->kobj, &attr->attr);
|
||||
WARN_ON_ONCE(!kn);
|
||||
/*
|
||||
* Concurrent writes into the "delete" sysfs attribute may trigger
|
||||
* concurrent calls to device_remove_file() and scsi_remove_device().
|
||||
* device_remove_file() handles concurrent removal calls by
|
||||
* serializing these and by ignoring the second and later removal
|
||||
* attempts. Concurrent calls of scsi_remove_device() are
|
||||
* serialized. The second and later calls of scsi_remove_device() are
|
||||
* ignored because the first call of that function changes the device
|
||||
* state into SDEV_DEL.
|
||||
*/
|
||||
device_remove_file(dev, attr);
|
||||
scsi_remove_device(to_scsi_device(dev));
|
||||
if (kn)
|
||||
sysfs_unbreak_active_protection(kn);
|
||||
return count;
|
||||
};
|
||||
static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete);
|
||||
|
|
|
|||
|
|
@ -561,9 +561,14 @@ static void pvscsi_complete_request(struct pvscsi_adapter *adapter,
|
|||
(btstat == BTSTAT_SUCCESS ||
|
||||
btstat == BTSTAT_LINKED_COMMAND_COMPLETED ||
|
||||
btstat == BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG)) {
|
||||
cmd->result = (DID_OK << 16) | sdstat;
|
||||
if (sdstat == SAM_STAT_CHECK_CONDITION && cmd->sense_buffer)
|
||||
cmd->result |= (DRIVER_SENSE << 24);
|
||||
if (sdstat == SAM_STAT_COMMAND_TERMINATED) {
|
||||
cmd->result = (DID_RESET << 16);
|
||||
} else {
|
||||
cmd->result = (DID_OK << 16) | sdstat;
|
||||
if (sdstat == SAM_STAT_CHECK_CONDITION &&
|
||||
cmd->sense_buffer)
|
||||
cmd->result |= (DRIVER_SENSE << 24);
|
||||
}
|
||||
} else
|
||||
switch (btstat) {
|
||||
case BTSTAT_SUCCESS:
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue