mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
Merge remote-tracking branch 'sm8350/lineage-20' into lineage-23.0
* sm8350/lineage-20: tcp: Fix compiler error due to type confusion fixup! net: usb: rtl8150: Fix frame padding Linux 5.4.302 Input: pegasus-notetaker - fix potential out-of-bounds access Input: remove third argument of usb_maxpacket() usb: deprecate the third argument of usb_maxpacket() ata: libata-scsi: Fix system suspend for a security locked drive fs/proc: fix uaf in proc_readdir_de() pmdomain: imx: Fix reference count leak in imx_gpc_remove pmdomain: arm: scmi: Fix genpd leak on provider registration failure net: netpoll: fix incorrect refcount handling causing incorrect cleanup net: qede: Initialize qede_ll_ops with designated initializer uio_hv_generic: Set event for all channels on the device net: ethernet: ti: netcp: Standardize knav_dma_open_channel to return NULL on error ALSA: usb-audio: fix uac2 clock source at terminal parser mm/page_alloc: fix hash table order logging in alloc_large_system_hash() kconfig/nconf: Initialize the default locale at startup kconfig/mconf: Initialize the default locale at startup vsock: Ignore signal/timeout on connect() if already established s390/ctcm: Fix double-kfree ... Conflicts: drivers/usb/gadget/configfs.c Change-Id: I23044bb8ce42b6bd65eb30d909c4dba15ae3f915
This commit is contained in:
commit
ad91405468
400 changed files with 2724 additions and 1715 deletions
|
|
@ -4424,6 +4424,9 @@
|
|||
|
||||
rootflags= [KNL] Set root filesystem mount option string
|
||||
|
||||
initramfs_options= [KNL]
|
||||
Specify mount options for for the initramfs mount.
|
||||
|
||||
rootfstype= [KNL] Set root filesystem type
|
||||
|
||||
rootwait [KNL] Wait (indefinitely) for root device to show up.
|
||||
|
|
|
|||
|
|
@ -134,6 +134,8 @@ stable kernels.
|
|||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3194386 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | Neoverse-V3AE | #3312417 | ARM64_ERRATUM_3194386 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | MMU-500 | #841119,826419 | N/A |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -1,7 +1,7 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 4
|
||||
SUBLEVEL = 300
|
||||
SUBLEVEL = 302
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
|
|
|
|||
|
|
@ -371,6 +371,8 @@ static inline __attribute__ ((const)) int fls(unsigned long x)
|
|||
*/
|
||||
static inline __attribute__ ((const)) int __fls(unsigned long x)
|
||||
{
|
||||
if (__builtin_constant_p(x))
|
||||
return x ? BITS_PER_LONG - 1 - __builtin_clzl(x) : 0;
|
||||
/* FLS insn has exactly same semantics as the API */
|
||||
return __builtin_arc_fls(x);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -643,6 +643,7 @@ config ARM64_ERRATUM_3194386
|
|||
* ARM Neoverse-V1 erratum 3324341
|
||||
* ARM Neoverse V2 erratum 3324336
|
||||
* ARM Neoverse-V3 erratum 3312417
|
||||
* ARM Neoverse-V3AE erratum 3312417
|
||||
|
||||
On affected cores "MSR SSBS, #0" instructions may not affect
|
||||
subsequent speculative instructions, which may permit unexepected
|
||||
|
|
|
|||
|
|
@ -1599,6 +1599,8 @@
|
|||
hexagon_smp2p_in: slave-kernel {
|
||||
qcom,entry-name = "slave-kernel";
|
||||
|
||||
resets = <&gcc GCC_MDSS_BCR>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@
|
|||
#define ARM_CPU_PART_NEOVERSE_V2 0xD4F
|
||||
#define ARM_CPU_PART_CORTEX_A720 0xD81
|
||||
#define ARM_CPU_PART_CORTEX_X4 0xD82
|
||||
#define ARM_CPU_PART_NEOVERSE_V3AE 0xD83
|
||||
#define ARM_CPU_PART_NEOVERSE_V3 0xD84
|
||||
#define ARM_CPU_PART_CORTEX_X925 0xD85
|
||||
#define ARM_CPU_PART_CORTEX_A725 0xD87
|
||||
|
|
@ -141,6 +142,7 @@
|
|||
#define MIDR_NEOVERSE_V2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V2)
|
||||
#define MIDR_CORTEX_A720 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A720)
|
||||
#define MIDR_CORTEX_X4 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X4)
|
||||
#define MIDR_NEOVERSE_V3AE MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3AE)
|
||||
#define MIDR_NEOVERSE_V3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3)
|
||||
#define MIDR_CORTEX_X925 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X925)
|
||||
#define MIDR_CORTEX_A725 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A725)
|
||||
|
|
|
|||
|
|
@ -145,7 +145,8 @@ static inline pte_t set_pte_bit(pte_t pte, pgprot_t prot)
|
|||
static inline pte_t pte_mkwrite(pte_t pte)
|
||||
{
|
||||
pte = set_pte_bit(pte, __pgprot(PTE_WRITE));
|
||||
pte = clear_pte_bit(pte, __pgprot(PTE_RDONLY));
|
||||
if (pte_sw_dirty(pte))
|
||||
pte = clear_pte_bit(pte, __pgprot(PTE_RDONLY));
|
||||
return pte;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -863,6 +863,7 @@ static const struct midr_range erratum_spec_ssbs_list[] = {
|
|||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3AE),
|
||||
{}
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -314,12 +314,12 @@ static inline int bfchg_mem_test_and_change_bit(int nr,
|
|||
#include <asm-generic/bitops/ffz.h>
|
||||
#else
|
||||
|
||||
static inline int find_first_zero_bit(const unsigned long *vaddr,
|
||||
unsigned size)
|
||||
static inline unsigned long find_first_zero_bit(const unsigned long *vaddr,
|
||||
unsigned long size)
|
||||
{
|
||||
const unsigned long *p = vaddr;
|
||||
int res = 32;
|
||||
unsigned int words;
|
||||
unsigned long res = 32;
|
||||
unsigned long words;
|
||||
unsigned long num;
|
||||
|
||||
if (!size)
|
||||
|
|
@ -340,8 +340,9 @@ out:
|
|||
}
|
||||
#define find_first_zero_bit find_first_zero_bit
|
||||
|
||||
static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
|
||||
int offset)
|
||||
static inline unsigned long find_next_zero_bit(const unsigned long *vaddr,
|
||||
unsigned long size,
|
||||
unsigned long offset)
|
||||
{
|
||||
const unsigned long *p = vaddr + (offset >> 5);
|
||||
int bit = offset & 31UL, res;
|
||||
|
|
@ -370,11 +371,12 @@ static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
|
|||
}
|
||||
#define find_next_zero_bit find_next_zero_bit
|
||||
|
||||
static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
|
||||
static inline unsigned long find_first_bit(const unsigned long *vaddr,
|
||||
unsigned long size)
|
||||
{
|
||||
const unsigned long *p = vaddr;
|
||||
int res = 32;
|
||||
unsigned int words;
|
||||
unsigned long res = 32;
|
||||
unsigned long words;
|
||||
unsigned long num;
|
||||
|
||||
if (!size)
|
||||
|
|
@ -395,8 +397,9 @@ out:
|
|||
}
|
||||
#define find_first_bit find_first_bit
|
||||
|
||||
static inline int find_next_bit(const unsigned long *vaddr, int size,
|
||||
int offset)
|
||||
static inline unsigned long find_next_bit(const unsigned long *vaddr,
|
||||
unsigned long size,
|
||||
unsigned long offset)
|
||||
{
|
||||
const unsigned long *p = vaddr + (offset >> 5);
|
||||
int bit = offset & 31UL, res;
|
||||
|
|
|
|||
|
|
@ -5,8 +5,12 @@
|
|||
compatible = "lantiq,xway", "lantiq,danube";
|
||||
|
||||
cpus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
cpu@0 {
|
||||
compatible = "mips,mips24Kc";
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -101,6 +105,8 @@
|
|||
0x1000000 0 0x00000000 0xae00000 0 0x200000>; /* io space */
|
||||
reg = <0x7000000 0x8000 /* config space */
|
||||
0xe105400 0x400>; /* pci bridge */
|
||||
|
||||
device_type = "pci";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ void __init ltq_soc_init(void)
|
|||
/* add our generic xway clocks */
|
||||
clkdev_add_pmu("10000000.fpi", NULL, 0, 0, PMU_FPI);
|
||||
clkdev_add_pmu("1e100a00.gptu", NULL, 1, 0, PMU_GPT);
|
||||
clkdev_add_pmu("1e100bb0.stp", NULL, 1, 0, PMU_STP);
|
||||
clkdev_add_pmu("1e100bb0.gpio", NULL, 1, 0, PMU_STP);
|
||||
clkdev_add_pmu("1e100c00.serial", NULL, 0, 0, PMU_ASC1);
|
||||
clkdev_add_pmu("1e104100.dma", NULL, 1, 0, PMU_DMA);
|
||||
clkdev_add_pmu("1e100800.spi", NULL, 1, 0, PMU_SPI);
|
||||
|
|
|
|||
|
|
@ -242,16 +242,22 @@ mips_pci_controller:
|
|||
#endif
|
||||
|
||||
/*
|
||||
* Setup the Malta max (2GB) memory for PCI DMA in host bridge
|
||||
* in transparent addressing mode.
|
||||
* Set up memory mapping in host bridge for PCI DMA masters,
|
||||
* in transparent addressing mode. For EVA use the Malta
|
||||
* maximum of 2 GiB memory in the alias space at 0x80000000
|
||||
* as per PHYS_OFFSET. Otherwise use 256 MiB of memory in
|
||||
* the regular space, avoiding mapping the PCI MMIO window
|
||||
* for DMA as it seems to confuse the system controller's
|
||||
* logic, causing PCI MMIO to stop working.
|
||||
*/
|
||||
mask = PHYS_OFFSET | PCI_BASE_ADDRESS_MEM_PREFETCH;
|
||||
MSC_WRITE(MSC01_PCI_BAR0, mask);
|
||||
MSC_WRITE(MSC01_PCI_HEAD4, mask);
|
||||
mask = PHYS_OFFSET ? PHYS_OFFSET : 0xf0000000;
|
||||
MSC_WRITE(MSC01_PCI_BAR0,
|
||||
mask | PCI_BASE_ADDRESS_MEM_PREFETCH);
|
||||
MSC_WRITE(MSC01_PCI_HEAD4,
|
||||
PHYS_OFFSET | PCI_BASE_ADDRESS_MEM_PREFETCH);
|
||||
|
||||
mask &= MSC01_PCI_BAR0_SIZE_MSK;
|
||||
MSC_WRITE(MSC01_PCI_P2SCMSKL, mask);
|
||||
MSC_WRITE(MSC01_PCI_P2SCMAPL, mask);
|
||||
MSC_WRITE(MSC01_PCI_P2SCMAPL, PHYS_OFFSET);
|
||||
|
||||
/* Don't handle target retries indefinitely. */
|
||||
if ((data & MSC01_PCI_CFG_MAXRTRY_MSK) ==
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ static struct resource standard_io_resources[] = {
|
|||
.name = "keyboard",
|
||||
.start = 0x60,
|
||||
.end = 0x6f,
|
||||
.flags = IORESOURCE_IO | IORESOURCE_BUSY
|
||||
.flags = IORESOURCE_IO
|
||||
},
|
||||
{
|
||||
.name = "dma page reg",
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@
|
|||
#define TCSETS _IOW('T', 17, struct termios) /* TCSETATTR */
|
||||
#define TCSETSW _IOW('T', 18, struct termios) /* TCSETATTRD */
|
||||
#define TCSETSF _IOW('T', 19, struct termios) /* TCSETATTRF */
|
||||
#define TCGETA _IOR('T', 1, struct termio)
|
||||
#define TCSETA _IOW('T', 2, struct termio)
|
||||
#define TCSETAW _IOW('T', 3, struct termio)
|
||||
#define TCSETAF _IOW('T', 4, struct termio)
|
||||
#define TCGETA 0x40125401
|
||||
#define TCSETA 0x80125402
|
||||
#define TCSETAW 0x80125403
|
||||
#define TCSETAF 0x80125404
|
||||
#define TCSBRK _IO('T', 5)
|
||||
#define TCXONC _IO('T', 6)
|
||||
#define TCFLSH _IO('T', 7)
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ static enum pci_ers_result eeh_report_error(struct eeh_dev *edev,
|
|||
rc = driver->err_handler->error_detected(pdev, pci_channel_io_frozen);
|
||||
|
||||
edev->in_error = true;
|
||||
pci_uevent_ers(pdev, PCI_ERS_RESULT_NONE);
|
||||
pci_uevent_ers(pdev, rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@
|
|||
#define R_SPARC_7 43
|
||||
#define R_SPARC_5 44
|
||||
#define R_SPARC_6 45
|
||||
#define R_SPARC_UA64 54
|
||||
|
||||
/* Bits present in AT_HWCAP, primarily for Sparc32. */
|
||||
#define HWCAP_SPARC_FLUSH 0x00000001
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
|
|||
break;
|
||||
#ifdef CONFIG_SPARC64
|
||||
case R_SPARC_64:
|
||||
case R_SPARC_UA64:
|
||||
location[0] = v >> 56;
|
||||
location[1] = v >> 48;
|
||||
location[2] = v >> 40;
|
||||
|
|
|
|||
|
|
@ -387,6 +387,7 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
|
|||
|
||||
if (of_device_register(op)) {
|
||||
printk("%pOF: Could not register of device.\n", dp);
|
||||
put_device(&op->dev);
|
||||
kfree(op);
|
||||
op = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -680,6 +680,7 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
|
|||
|
||||
if (of_device_register(op)) {
|
||||
printk("%pOF: Could not register of device.\n", dp);
|
||||
put_device(&op->dev);
|
||||
kfree(op);
|
||||
op = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -696,16 +696,16 @@ FUNC_NAME:
|
|||
EX_LD_FP(LOAD(ldd, %o4+40, %f26), memcpy_retl_o2_plus_o5_plus_40)
|
||||
faligndata %f24, %f26, %f10
|
||||
EX_ST_FP(STORE(std, %f6, %o0+24), memcpy_retl_o2_plus_o5_plus_40)
|
||||
EX_LD_FP(LOAD(ldd, %o4+48, %f28), memcpy_retl_o2_plus_o5_plus_40)
|
||||
EX_LD_FP(LOAD(ldd, %o4+48, %f28), memcpy_retl_o2_plus_o5_plus_32)
|
||||
faligndata %f26, %f28, %f12
|
||||
EX_ST_FP(STORE(std, %f8, %o0+32), memcpy_retl_o2_plus_o5_plus_40)
|
||||
EX_ST_FP(STORE(std, %f8, %o0+32), memcpy_retl_o2_plus_o5_plus_32)
|
||||
add %o4, 64, %o4
|
||||
EX_LD_FP(LOAD(ldd, %o4-8, %f30), memcpy_retl_o2_plus_o5_plus_40)
|
||||
EX_LD_FP(LOAD(ldd, %o4-8, %f30), memcpy_retl_o2_plus_o5_plus_24)
|
||||
faligndata %f28, %f30, %f14
|
||||
EX_ST_FP(STORE(std, %f10, %o0+40), memcpy_retl_o2_plus_o5_plus_40)
|
||||
EX_ST_FP(STORE(std, %f12, %o0+48), memcpy_retl_o2_plus_o5_plus_40)
|
||||
EX_ST_FP(STORE(std, %f10, %o0+40), memcpy_retl_o2_plus_o5_plus_24)
|
||||
EX_ST_FP(STORE(std, %f12, %o0+48), memcpy_retl_o2_plus_o5_plus_16)
|
||||
add %o0, 64, %o0
|
||||
EX_ST_FP(STORE(std, %f14, %o0-8), memcpy_retl_o2_plus_o5_plus_40)
|
||||
EX_ST_FP(STORE(std, %f14, %o0-8), memcpy_retl_o2_plus_o5_plus_8)
|
||||
fsrc2 %f30, %f14
|
||||
bgu,pt %xcc, .Lunalign_sloop
|
||||
prefetch [%o4 + (8 * BLOCK_SIZE)], 20
|
||||
|
|
@ -728,7 +728,7 @@ FUNC_NAME:
|
|||
add %o4, 8, %o4
|
||||
faligndata %f0, %f2, %f16
|
||||
subcc %o5, 8, %o5
|
||||
EX_ST_FP(STORE(std, %f16, %o0), memcpy_retl_o2_plus_o5)
|
||||
EX_ST_FP(STORE(std, %f16, %o0), memcpy_retl_o2_plus_o5_plus_8)
|
||||
fsrc2 %f2, %f0
|
||||
bgu,pt %xcc, .Lunalign_by8
|
||||
add %o0, 8, %o0
|
||||
|
|
@ -772,7 +772,7 @@ FUNC_NAME:
|
|||
subcc %o5, 0x20, %o5
|
||||
EX_ST(STORE(stx, %o3, %o0 + 0x00), memcpy_retl_o2_plus_o5_plus_32)
|
||||
EX_ST(STORE(stx, %g2, %o0 + 0x08), memcpy_retl_o2_plus_o5_plus_24)
|
||||
EX_ST(STORE(stx, %g7, %o0 + 0x10), memcpy_retl_o2_plus_o5_plus_24)
|
||||
EX_ST(STORE(stx, %g7, %o0 + 0x10), memcpy_retl_o2_plus_o5_plus_16)
|
||||
EX_ST(STORE(stx, %o4, %o0 + 0x18), memcpy_retl_o2_plus_o5_plus_8)
|
||||
bne,pt %xcc, 1b
|
||||
add %o0, 0x20, %o0
|
||||
|
|
@ -804,12 +804,12 @@ FUNC_NAME:
|
|||
brz,pt %o3, 2f
|
||||
sub %o2, %o3, %o2
|
||||
|
||||
1: EX_LD(LOAD(ldub, %o1 + 0x00, %g2), memcpy_retl_o2_plus_g1)
|
||||
1: EX_LD(LOAD(ldub, %o1 + 0x00, %g2), memcpy_retl_o2_plus_o3)
|
||||
add %o1, 1, %o1
|
||||
subcc %o3, 1, %o3
|
||||
add %o0, 1, %o0
|
||||
bne,pt %xcc, 1b
|
||||
EX_ST(STORE(stb, %g2, %o0 - 0x01), memcpy_retl_o2_plus_g1_plus_1)
|
||||
EX_ST(STORE(stb, %g2, %o0 - 0x01), memcpy_retl_o2_plus_o3_plus_1)
|
||||
2:
|
||||
and %o1, 0x7, %o3
|
||||
brz,pn %o3, .Lmedium_noprefetch_cp
|
||||
|
|
|
|||
|
|
@ -137,6 +137,15 @@ ENTRY(memcpy_retl_o2_plus_63_8)
|
|||
ba,pt %xcc, __restore_asi
|
||||
add %o2, 8, %o0
|
||||
ENDPROC(memcpy_retl_o2_plus_63_8)
|
||||
ENTRY(memcpy_retl_o2_plus_o3)
|
||||
ba,pt %xcc, __restore_asi
|
||||
add %o2, %o3, %o0
|
||||
ENDPROC(memcpy_retl_o2_plus_o3)
|
||||
ENTRY(memcpy_retl_o2_plus_o3_plus_1)
|
||||
add %o3, 1, %o3
|
||||
ba,pt %xcc, __restore_asi
|
||||
add %o2, %o3, %o0
|
||||
ENDPROC(memcpy_retl_o2_plus_o3_plus_1)
|
||||
ENTRY(memcpy_retl_o2_plus_o5)
|
||||
ba,pt %xcc, __restore_asi
|
||||
add %o2, %o5, %o0
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
|
|||
subcc %o5, 0x20, %o5
|
||||
EX_ST(STORE(stx, %g1, %o0 + 0x00), memcpy_retl_o2_plus_o5_plus_32)
|
||||
EX_ST(STORE(stx, %g2, %o0 + 0x08), memcpy_retl_o2_plus_o5_plus_24)
|
||||
EX_ST(STORE(stx, GLOBAL_SPARE, %o0 + 0x10), memcpy_retl_o2_plus_o5_plus_24)
|
||||
EX_ST(STORE(stx, GLOBAL_SPARE, %o0 + 0x10), memcpy_retl_o2_plus_o5_plus_16)
|
||||
EX_ST(STORE(stx, %o4, %o0 + 0x18), memcpy_retl_o2_plus_o5_plus_8)
|
||||
bne,pt %icc, 1b
|
||||
add %o0, 0x20, %o0
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@
|
|||
#ifndef EX_RETVAL
|
||||
#define EX_RETVAL(x) x
|
||||
__restore_asi:
|
||||
ret
|
||||
wr %g0, ASI_AIUS, %asi
|
||||
ret
|
||||
restore
|
||||
ENTRY(NG_ret_i2_plus_i4_plus_1)
|
||||
ba,pt %xcc, __restore_asi
|
||||
|
|
@ -126,15 +126,16 @@ ENTRY(NG_ret_i2_plus_g1_minus_56)
|
|||
ba,pt %xcc, __restore_asi
|
||||
add %i2, %g1, %i0
|
||||
ENDPROC(NG_ret_i2_plus_g1_minus_56)
|
||||
ENTRY(NG_ret_i2_plus_i4)
|
||||
ENTRY(NG_ret_i2_plus_i4_plus_16)
|
||||
add %i4, 16, %i4
|
||||
ba,pt %xcc, __restore_asi
|
||||
add %i2, %i4, %i0
|
||||
ENDPROC(NG_ret_i2_plus_i4)
|
||||
ENTRY(NG_ret_i2_plus_i4_minus_8)
|
||||
sub %i4, 8, %i4
|
||||
ENDPROC(NG_ret_i2_plus_i4_plus_16)
|
||||
ENTRY(NG_ret_i2_plus_i4_plus_8)
|
||||
add %i4, 8, %i4
|
||||
ba,pt %xcc, __restore_asi
|
||||
add %i2, %i4, %i0
|
||||
ENDPROC(NG_ret_i2_plus_i4_minus_8)
|
||||
ENDPROC(NG_ret_i2_plus_i4_plus_8)
|
||||
ENTRY(NG_ret_i2_plus_8)
|
||||
ba,pt %xcc, __restore_asi
|
||||
add %i2, 8, %i0
|
||||
|
|
@ -161,6 +162,12 @@ ENTRY(NG_ret_i2_and_7_plus_i4)
|
|||
ba,pt %xcc, __restore_asi
|
||||
add %i2, %i4, %i0
|
||||
ENDPROC(NG_ret_i2_and_7_plus_i4)
|
||||
ENTRY(NG_ret_i2_and_7_plus_i4_plus_8)
|
||||
and %i2, 7, %i2
|
||||
add %i4, 8, %i4
|
||||
ba,pt %xcc, __restore_asi
|
||||
add %i2, %i4, %i0
|
||||
ENDPROC(NG_ret_i2_and_7_plus_i4)
|
||||
#endif
|
||||
|
||||
.align 64
|
||||
|
|
@ -406,13 +413,13 @@ FUNC_NAME: /* %i0=dst, %i1=src, %i2=len */
|
|||
andn %i2, 0xf, %i4
|
||||
and %i2, 0xf, %i2
|
||||
1: subcc %i4, 0x10, %i4
|
||||
EX_LD(LOAD(ldx, %i1, %o4), NG_ret_i2_plus_i4)
|
||||
EX_LD(LOAD(ldx, %i1, %o4), NG_ret_i2_plus_i4_plus_16)
|
||||
add %i1, 0x08, %i1
|
||||
EX_LD(LOAD(ldx, %i1, %g1), NG_ret_i2_plus_i4)
|
||||
EX_LD(LOAD(ldx, %i1, %g1), NG_ret_i2_plus_i4_plus_16)
|
||||
sub %i1, 0x08, %i1
|
||||
EX_ST(STORE(stx, %o4, %i1 + %i3), NG_ret_i2_plus_i4)
|
||||
EX_ST(STORE(stx, %o4, %i1 + %i3), NG_ret_i2_plus_i4_plus_16)
|
||||
add %i1, 0x8, %i1
|
||||
EX_ST(STORE(stx, %g1, %i1 + %i3), NG_ret_i2_plus_i4_minus_8)
|
||||
EX_ST(STORE(stx, %g1, %i1 + %i3), NG_ret_i2_plus_i4_plus_8)
|
||||
bgu,pt %XCC, 1b
|
||||
add %i1, 0x8, %i1
|
||||
73: andcc %i2, 0x8, %g0
|
||||
|
|
@ -469,7 +476,7 @@ FUNC_NAME: /* %i0=dst, %i1=src, %i2=len */
|
|||
subcc %i4, 0x8, %i4
|
||||
srlx %g3, %i3, %i5
|
||||
or %i5, %g2, %i5
|
||||
EX_ST(STORE(stx, %i5, %o0), NG_ret_i2_and_7_plus_i4)
|
||||
EX_ST(STORE(stx, %i5, %o0), NG_ret_i2_and_7_plus_i4_plus_8)
|
||||
add %o0, 0x8, %o0
|
||||
bgu,pt %icc, 1b
|
||||
sllx %g3, %g1, %g2
|
||||
|
|
|
|||
|
|
@ -164,17 +164,18 @@ ENTRY(U1_gs_40_fp)
|
|||
retl
|
||||
add %o0, %o2, %o0
|
||||
ENDPROC(U1_gs_40_fp)
|
||||
ENTRY(U1_g3_0_fp)
|
||||
VISExitHalf
|
||||
retl
|
||||
add %g3, %o2, %o0
|
||||
ENDPROC(U1_g3_0_fp)
|
||||
ENTRY(U1_g3_8_fp)
|
||||
VISExitHalf
|
||||
add %g3, 8, %g3
|
||||
retl
|
||||
add %g3, %o2, %o0
|
||||
ENDPROC(U1_g3_8_fp)
|
||||
ENTRY(U1_g3_16_fp)
|
||||
VISExitHalf
|
||||
add %g3, 16, %g3
|
||||
retl
|
||||
add %g3, %o2, %o0
|
||||
ENDPROC(U1_g3_16_fp)
|
||||
ENTRY(U1_o2_0_fp)
|
||||
VISExitHalf
|
||||
retl
|
||||
|
|
@ -547,18 +548,18 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
|
|||
62: FINISH_VISCHUNK(o0, f44, f46)
|
||||
63: UNEVEN_VISCHUNK_LAST(o0, f46, f0)
|
||||
|
||||
93: EX_LD_FP(LOAD(ldd, %o1, %f2), U1_g3_0_fp)
|
||||
93: EX_LD_FP(LOAD(ldd, %o1, %f2), U1_g3_8_fp)
|
||||
add %o1, 8, %o1
|
||||
subcc %g3, 8, %g3
|
||||
faligndata %f0, %f2, %f8
|
||||
EX_ST_FP(STORE(std, %f8, %o0), U1_g3_8_fp)
|
||||
EX_ST_FP(STORE(std, %f8, %o0), U1_g3_16_fp)
|
||||
bl,pn %xcc, 95f
|
||||
add %o0, 8, %o0
|
||||
EX_LD_FP(LOAD(ldd, %o1, %f0), U1_g3_0_fp)
|
||||
EX_LD_FP(LOAD(ldd, %o1, %f0), U1_g3_8_fp)
|
||||
add %o1, 8, %o1
|
||||
subcc %g3, 8, %g3
|
||||
faligndata %f2, %f0, %f8
|
||||
EX_ST_FP(STORE(std, %f8, %o0), U1_g3_8_fp)
|
||||
EX_ST_FP(STORE(std, %f8, %o0), U1_g3_16_fp)
|
||||
bge,pt %xcc, 93b
|
||||
add %o0, 8, %o0
|
||||
|
||||
|
|
|
|||
|
|
@ -267,6 +267,7 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
|
|||
faligndata %f10, %f12, %f26
|
||||
EX_LD_FP(LOAD(ldd, %o1 + 0x040, %f0), U3_retl_o2)
|
||||
|
||||
and %o2, 0x3f, %o2
|
||||
subcc GLOBAL_SPARE, 0x80, GLOBAL_SPARE
|
||||
add %o1, 0x40, %o1
|
||||
bgu,pt %XCC, 1f
|
||||
|
|
@ -336,7 +337,6 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
|
|||
* Also notice how this code is careful not to perform a
|
||||
* load past the end of the src buffer.
|
||||
*/
|
||||
and %o2, 0x3f, %o2
|
||||
andcc %o2, 0x38, %g2
|
||||
be,pn %XCC, 2f
|
||||
subcc %g2, 0x8, %g2
|
||||
|
|
|
|||
|
|
@ -134,6 +134,26 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
|
|||
|
||||
static pte_t sun4u_hugepage_shift_to_tte(pte_t entry, unsigned int shift)
|
||||
{
|
||||
unsigned long hugepage_size = _PAGE_SZ4MB_4U;
|
||||
|
||||
pte_val(entry) = pte_val(entry) & ~_PAGE_SZALL_4U;
|
||||
|
||||
switch (shift) {
|
||||
case HPAGE_256MB_SHIFT:
|
||||
hugepage_size = _PAGE_SZ256MB_4U;
|
||||
pte_val(entry) |= _PAGE_PMD_HUGE;
|
||||
break;
|
||||
case HPAGE_SHIFT:
|
||||
pte_val(entry) |= _PAGE_PMD_HUGE;
|
||||
break;
|
||||
case HPAGE_64K_SHIFT:
|
||||
hugepage_size = _PAGE_SZ64K_4U;
|
||||
break;
|
||||
default:
|
||||
WARN_ONCE(1, "unsupported hugepage shift=%u\n", shift);
|
||||
}
|
||||
|
||||
pte_val(entry) = pte_val(entry) | hugepage_size;
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,12 @@ bool emulate_vsyscall(unsigned long error_code,
|
|||
if ((error_code & (X86_PF_WRITE | X86_PF_USER)) != X86_PF_USER)
|
||||
return false;
|
||||
|
||||
if (!(error_code & X86_PF_INSTR)) {
|
||||
/*
|
||||
* Assume that faults at regs->ip are because of an
|
||||
* instruction fetch. Return early and avoid
|
||||
* emulation for faults during data accesses:
|
||||
*/
|
||||
if (address != regs->ip) {
|
||||
/* Failed vsyscall read */
|
||||
if (vsyscall_mode == EMULATE)
|
||||
return false;
|
||||
|
|
@ -136,13 +141,19 @@ bool emulate_vsyscall(unsigned long error_code,
|
|||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* X86_PF_INSTR is only set when NX is supported. When
|
||||
* available, use it to double-check that the emulation code
|
||||
* is only being used for instruction fetches:
|
||||
*/
|
||||
if (cpu_feature_enabled(X86_FEATURE_NX))
|
||||
WARN_ON_ONCE(!(error_code & X86_PF_INSTR));
|
||||
|
||||
/*
|
||||
* No point in checking CS -- the only way to get here is a user mode
|
||||
* trap to a high address, which means that we're in 64-bit user code.
|
||||
*/
|
||||
|
||||
WARN_ON_ONCE(address != regs->ip);
|
||||
|
||||
if (vsyscall_mode == NONE) {
|
||||
warn_bad_vsyscall(KERN_INFO, regs,
|
||||
"vsyscall attempted with vsyscall=none");
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ bool x86_page_table_writing_insn(struct x86_emulate_ctxt *ctxt);
|
|||
#define EMULATION_RESTART 1
|
||||
#define EMULATION_INTERCEPTED 2
|
||||
void init_decode_cache(struct x86_emulate_ctxt *ctxt);
|
||||
int x86_emulate_insn(struct x86_emulate_ctxt *ctxt);
|
||||
int x86_emulate_insn(struct x86_emulate_ctxt *ctxt, bool check_intercepts);
|
||||
int emulator_task_switch(struct x86_emulate_ctxt *ctxt,
|
||||
u16 tss_selector, int idt_index, int reason,
|
||||
bool has_error_code, u32 error_code);
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ static inline unsigned long vdso_encode_cpunode(int cpu, unsigned long node)
|
|||
|
||||
static inline void vdso_read_cpunode(unsigned *cpu, unsigned *node)
|
||||
{
|
||||
unsigned int p;
|
||||
unsigned long p;
|
||||
|
||||
/*
|
||||
* Load CPU and node number from the GDT. LSL is faster than RDTSCP
|
||||
|
|
@ -263,10 +263,10 @@ static inline void vdso_read_cpunode(unsigned *cpu, unsigned *node)
|
|||
*
|
||||
* If RDPID is available, use it.
|
||||
*/
|
||||
alternative_io ("lsl %[seg],%[p]",
|
||||
".byte 0xf3,0x0f,0xc7,0xf8", /* RDPID %eax/rax */
|
||||
alternative_io ("lsl %[seg],%k[p]",
|
||||
"rdpid %[p]",
|
||||
X86_FEATURE_RDPID,
|
||||
[p] "=a" (p), [seg] "r" (__CPUNODE_SEG));
|
||||
[p] "=r" (p), [seg] "r" (__CPUNODE_SEG));
|
||||
|
||||
if (cpu)
|
||||
*cpu = (p & VDSO_CPUNODE_MASK);
|
||||
|
|
|
|||
|
|
@ -1188,7 +1188,7 @@ set_mode:
|
|||
static const char * const spectre_v2_strings[] = {
|
||||
[SPECTRE_V2_NONE] = "Vulnerable",
|
||||
[SPECTRE_V2_RETPOLINE] = "Mitigation: Retpolines",
|
||||
[SPECTRE_V2_LFENCE] = "Mitigation: LFENCE",
|
||||
[SPECTRE_V2_LFENCE] = "Vulnerable: LFENCE",
|
||||
[SPECTRE_V2_EIBRS] = "Mitigation: Enhanced / Automatic IBRS",
|
||||
[SPECTRE_V2_EIBRS_LFENCE] = "Mitigation: Enhanced / Automatic IBRS + LFENCE",
|
||||
[SPECTRE_V2_EIBRS_RETPOLINE] = "Mitigation: Enhanced / Automatic IBRS + Retpolines",
|
||||
|
|
@ -2280,9 +2280,6 @@ static char *pbrsb_eibrs_state(void)
|
|||
|
||||
static ssize_t spectre_v2_show_state(char *buf)
|
||||
{
|
||||
if (spectre_v2_enabled == SPECTRE_V2_LFENCE)
|
||||
return sysfs_emit(buf, "Vulnerable: LFENCE\n");
|
||||
|
||||
if (spectre_v2_enabled == SPECTRE_V2_EIBRS && unprivileged_ebpf_enabled())
|
||||
return sysfs_emit(buf, "Vulnerable: eIBRS with unprivileged eBPF\n");
|
||||
|
||||
|
|
|
|||
|
|
@ -225,11 +225,19 @@ static u64 mbm_overflow_count(u64 prev_msr, u64 cur_msr)
|
|||
|
||||
static u64 __mon_event_count(u32 rmid, struct rmid_read *rr)
|
||||
{
|
||||
struct mbm_state *m;
|
||||
struct mbm_state *m = NULL;
|
||||
u64 chunks, tval;
|
||||
|
||||
tval = __rmid_read(rmid, rr->evtid);
|
||||
if (tval & (RMID_VAL_ERROR | RMID_VAL_UNAVAIL)) {
|
||||
if (tval & RMID_VAL_UNAVAIL) {
|
||||
if (rr->evtid == QOS_L3_MBM_TOTAL_EVENT_ID)
|
||||
m = &rr->d->mbm_total[rmid];
|
||||
else if (rr->evtid == QOS_L3_MBM_LOCAL_EVENT_ID)
|
||||
m = &rr->d->mbm_local[rmid];
|
||||
if (m)
|
||||
m->prev_msr = 0;
|
||||
}
|
||||
return tval;
|
||||
}
|
||||
switch (rr->evtid) {
|
||||
|
|
|
|||
|
|
@ -155,15 +155,26 @@ static int identify_insn(struct insn *insn)
|
|||
if (!insn->modrm.nbytes)
|
||||
return -EINVAL;
|
||||
|
||||
/* All the instructions of interest start with 0x0f. */
|
||||
if (insn->opcode.bytes[0] != 0xf)
|
||||
/* The instructions of interest have 2-byte opcodes: 0F 00 or 0F 01. */
|
||||
if (insn->opcode.nbytes < 2 || insn->opcode.bytes[0] != 0xf)
|
||||
return -EINVAL;
|
||||
|
||||
if (insn->opcode.bytes[1] == 0x1) {
|
||||
switch (X86_MODRM_REG(insn->modrm.value)) {
|
||||
case 0:
|
||||
/* The reg form of 0F 01 /0 encodes VMX instructions. */
|
||||
if (X86_MODRM_MOD(insn->modrm.value) == 3)
|
||||
return -EINVAL;
|
||||
|
||||
return UMIP_INST_SGDT;
|
||||
case 1:
|
||||
/*
|
||||
* The reg form of 0F 01 /1 encodes MONITOR/MWAIT,
|
||||
* STAC/CLAC, and ENCLS.
|
||||
*/
|
||||
if (X86_MODRM_MOD(insn->modrm.value) == 3)
|
||||
return -EINVAL;
|
||||
|
||||
return UMIP_INST_SIDT;
|
||||
case 4:
|
||||
return UMIP_INST_SMSW;
|
||||
|
|
|
|||
|
|
@ -5605,12 +5605,11 @@ void init_decode_cache(struct x86_emulate_ctxt *ctxt)
|
|||
ctxt->mem_read.end = 0;
|
||||
}
|
||||
|
||||
int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
|
||||
int x86_emulate_insn(struct x86_emulate_ctxt *ctxt, bool check_intercepts)
|
||||
{
|
||||
const struct x86_emulate_ops *ops = ctxt->ops;
|
||||
int rc = X86EMUL_CONTINUE;
|
||||
int saved_dst_type = ctxt->dst.type;
|
||||
unsigned emul_flags;
|
||||
|
||||
ctxt->mem_read.pos = 0;
|
||||
|
||||
|
|
@ -5625,7 +5624,6 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
|
|||
goto done;
|
||||
}
|
||||
|
||||
emul_flags = ctxt->ops->get_hflags(ctxt);
|
||||
if (unlikely(ctxt->d &
|
||||
(No64|Undefined|Sse|Mmx|Intercept|CheckPerm|Priv|Prot|String))) {
|
||||
if ((ctxt->mode == X86EMUL_MODE_PROT64 && (ctxt->d & No64)) ||
|
||||
|
|
@ -5659,7 +5657,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
|
|||
fetch_possible_mmx_operand(ctxt, &ctxt->dst);
|
||||
}
|
||||
|
||||
if (unlikely(emul_flags & X86EMUL_GUEST_MASK) && ctxt->intercept) {
|
||||
if (unlikely(check_intercepts) && ctxt->intercept) {
|
||||
rc = emulator_check_intercept(ctxt, ctxt->intercept,
|
||||
X86_ICPT_PRE_EXCEPT);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
|
|
@ -5688,7 +5686,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
|
|||
goto done;
|
||||
}
|
||||
|
||||
if (unlikely(emul_flags & X86EMUL_GUEST_MASK) && (ctxt->d & Intercept)) {
|
||||
if (unlikely(check_intercepts) && (ctxt->d & Intercept)) {
|
||||
rc = emulator_check_intercept(ctxt, ctxt->intercept,
|
||||
X86_ICPT_POST_EXCEPT);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
|
|
@ -5742,7 +5740,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
|
|||
|
||||
special_insn:
|
||||
|
||||
if (unlikely(emul_flags & X86EMUL_GUEST_MASK) && (ctxt->d & Intercept)) {
|
||||
if (unlikely(check_intercepts) && (ctxt->d & Intercept)) {
|
||||
rc = emulator_check_intercept(ctxt, ctxt->intercept,
|
||||
X86_ICPT_POST_MEMACCESS);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
|
|
|
|||
|
|
@ -6855,7 +6855,14 @@ restart:
|
|||
/* Save the faulting GPA (cr2) in the address field */
|
||||
ctxt->exception.address = cr2_or_gpa;
|
||||
|
||||
r = x86_emulate_insn(ctxt);
|
||||
/*
|
||||
* Check L1's instruction intercepts when emulating instructions for
|
||||
* L2, unless KVM is re-emulating a previously decoded instruction,
|
||||
* e.g. to complete userspace I/O, in which case KVM has already
|
||||
* checked the intercepts.
|
||||
*/
|
||||
r = x86_emulate_insn(ctxt, is_guest_mode(vcpu) &&
|
||||
!(emulation_type & EMULTYPE_NO_DECODE));
|
||||
|
||||
if (r == EMULATION_INTERCEPTED)
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -241,9 +241,11 @@ static void blk_mq_unregister_hctx(struct blk_mq_hw_ctx *hctx)
|
|||
return;
|
||||
|
||||
hctx_for_each_ctx(hctx, ctx, i)
|
||||
kobject_del(&ctx->kobj);
|
||||
if (ctx->kobj.state_in_sysfs)
|
||||
kobject_del(&ctx->kobj);
|
||||
|
||||
kobject_del(&hctx->kobj);
|
||||
if (hctx->kobj.state_in_sysfs)
|
||||
kobject_del(&hctx->kobj);
|
||||
}
|
||||
|
||||
static int blk_mq_register_hctx(struct blk_mq_hw_ctx *hctx)
|
||||
|
|
|
|||
|
|
@ -505,7 +505,8 @@ static unsigned int blk_round_down_sectors(unsigned int sectors, unsigned int lb
|
|||
int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
|
||||
sector_t start)
|
||||
{
|
||||
unsigned int top, bottom, alignment, ret = 0;
|
||||
unsigned int top, bottom, alignment;
|
||||
int ret = 0;
|
||||
|
||||
t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors);
|
||||
t->max_hw_sectors = min_not_zero(t->max_hw_sectors, b->max_hw_sectors);
|
||||
|
|
|
|||
|
|
@ -203,9 +203,14 @@ static int essiv_aead_crypt(struct aead_request *req, bool enc)
|
|||
const struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm);
|
||||
struct essiv_aead_request_ctx *rctx = aead_request_ctx(req);
|
||||
struct aead_request *subreq = &rctx->aead_req;
|
||||
int ivsize = crypto_aead_ivsize(tfm);
|
||||
int ssize = req->assoclen - ivsize;
|
||||
struct scatterlist *src = req->src;
|
||||
int err;
|
||||
|
||||
if (ssize < 0)
|
||||
return -EINVAL;
|
||||
|
||||
crypto_cipher_encrypt_one(tctx->essiv_cipher, req->iv, req->iv);
|
||||
|
||||
/*
|
||||
|
|
@ -215,19 +220,12 @@ static int essiv_aead_crypt(struct aead_request *req, bool enc)
|
|||
*/
|
||||
rctx->assoc = NULL;
|
||||
if (req->src == req->dst || !enc) {
|
||||
scatterwalk_map_and_copy(req->iv, req->dst,
|
||||
req->assoclen - crypto_aead_ivsize(tfm),
|
||||
crypto_aead_ivsize(tfm), 1);
|
||||
scatterwalk_map_and_copy(req->iv, req->dst, ssize, ivsize, 1);
|
||||
} else {
|
||||
u8 *iv = (u8 *)aead_request_ctx(req) + tctx->ivoffset;
|
||||
int ivsize = crypto_aead_ivsize(tfm);
|
||||
int ssize = req->assoclen - ivsize;
|
||||
struct scatterlist *sg;
|
||||
int nents;
|
||||
|
||||
if (ssize < 0)
|
||||
return -EINVAL;
|
||||
|
||||
nents = sg_nents_for_len(req->src, ssize);
|
||||
if (nents < 0)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -576,11 +576,11 @@ static int acpi_aml_release(struct inode *inode, struct file *file)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_aml_read_user(char __user *buf, int len)
|
||||
static ssize_t acpi_aml_read_user(char __user *buf, size_t len)
|
||||
{
|
||||
int ret;
|
||||
struct circ_buf *crc = &acpi_aml_io.out_crc;
|
||||
int n;
|
||||
ssize_t ret;
|
||||
size_t n;
|
||||
char *p;
|
||||
|
||||
ret = acpi_aml_lock_read(crc, ACPI_AML_OUT_USER);
|
||||
|
|
@ -589,7 +589,7 @@ static int acpi_aml_read_user(char __user *buf, int len)
|
|||
/* sync head before removing logs */
|
||||
smp_rmb();
|
||||
p = &crc->buf[crc->tail];
|
||||
n = min(len, circ_count_to_end(crc));
|
||||
n = min_t(size_t, len, circ_count_to_end(crc));
|
||||
if (copy_to_user(buf, p, n)) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
|
|
@ -606,8 +606,8 @@ out:
|
|||
static ssize_t acpi_aml_read(struct file *file, char __user *buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
int ret = 0;
|
||||
int size = 0;
|
||||
ssize_t ret = 0;
|
||||
ssize_t size = 0;
|
||||
|
||||
if (!count)
|
||||
return 0;
|
||||
|
|
@ -646,11 +646,11 @@ again:
|
|||
return size > 0 ? size : ret;
|
||||
}
|
||||
|
||||
static int acpi_aml_write_user(const char __user *buf, int len)
|
||||
static ssize_t acpi_aml_write_user(const char __user *buf, size_t len)
|
||||
{
|
||||
int ret;
|
||||
struct circ_buf *crc = &acpi_aml_io.in_crc;
|
||||
int n;
|
||||
ssize_t ret;
|
||||
size_t n;
|
||||
char *p;
|
||||
|
||||
ret = acpi_aml_lock_write(crc, ACPI_AML_IN_USER);
|
||||
|
|
@ -659,7 +659,7 @@ static int acpi_aml_write_user(const char __user *buf, int len)
|
|||
/* sync tail before inserting cmds */
|
||||
smp_mb();
|
||||
p = &crc->buf[crc->head];
|
||||
n = min(len, circ_space_to_end(crc));
|
||||
n = min_t(size_t, len, circ_space_to_end(crc));
|
||||
if (copy_from_user(p, buf, n)) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
|
|
@ -670,14 +670,14 @@ static int acpi_aml_write_user(const char __user *buf, int len)
|
|||
ret = n;
|
||||
out:
|
||||
acpi_aml_unlock_fifo(ACPI_AML_IN_USER, ret >= 0);
|
||||
return n;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t acpi_aml_write(struct file *file, const char __user *buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
int ret = 0;
|
||||
int size = 0;
|
||||
ssize_t ret = 0;
|
||||
ssize_t size = 0;
|
||||
|
||||
if (!count)
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -563,6 +563,9 @@ static int acpi_tad_remove(struct platform_device *pdev)
|
|||
|
||||
pm_runtime_get_sync(dev);
|
||||
|
||||
if (dd->capabilities & ACPI_TAD_RT)
|
||||
sysfs_remove_group(&dev->kobj, &acpi_tad_time_attr_group);
|
||||
|
||||
if (dd->capabilities & ACPI_TAD_DC_WAKE)
|
||||
sysfs_remove_group(&dev->kobj, &acpi_tad_dc_attr_group);
|
||||
|
||||
|
|
|
|||
|
|
@ -2024,8 +2024,10 @@ static void acpi_video_bus_remove_notify_handler(struct acpi_video_bus *video)
|
|||
struct acpi_video_device *dev;
|
||||
|
||||
mutex_lock(&video->device_list_lock);
|
||||
list_for_each_entry(dev, &video->video_device_list, entry)
|
||||
list_for_each_entry(dev, &video->video_device_list, entry) {
|
||||
acpi_video_dev_remove_notify_handler(dev);
|
||||
cancel_delayed_work_sync(&dev->switch_brightness_work);
|
||||
}
|
||||
mutex_unlock(&video->device_list_lock);
|
||||
|
||||
acpi_video_bus_stop_devices(video);
|
||||
|
|
|
|||
|
|
@ -462,7 +462,6 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
|
|||
struct acpi_walk_state *next_walk_state = NULL;
|
||||
union acpi_operand_object *obj_desc;
|
||||
struct acpi_evaluate_info *info;
|
||||
u32 i;
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR(ds_call_control_method, this_walk_state);
|
||||
|
||||
|
|
@ -546,14 +545,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
|
|||
* Delete the operands on the previous walkstate operand stack
|
||||
* (they were copied to new objects)
|
||||
*/
|
||||
for (i = 0; i < obj_desc->method.param_count; i++) {
|
||||
acpi_ut_remove_reference(this_walk_state->operands[i]);
|
||||
this_walk_state->operands[i] = NULL;
|
||||
}
|
||||
|
||||
/* Clear the operand stack */
|
||||
|
||||
this_walk_state->num_operands = 0;
|
||||
acpi_ds_clear_operands(this_walk_state);
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
||||
"**** Begin nested execution of [%4.4s] **** WalkState=%p\n",
|
||||
|
|
|
|||
|
|
@ -1508,6 +1508,9 @@ int acpi_processor_power_init(struct acpi_processor *pr)
|
|||
if (retval) {
|
||||
if (acpi_processor_registered == 0)
|
||||
cpuidle_unregister_driver(&acpi_idle_driver);
|
||||
|
||||
per_cpu(acpi_cpuidle_device, pr->id) = NULL;
|
||||
kfree(dev);
|
||||
return retval;
|
||||
}
|
||||
acpi_processor_registered++;
|
||||
|
|
|
|||
|
|
@ -1114,6 +1114,28 @@ struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* acpi_get_next_present_subnode - Return the next present child node handle
|
||||
* @fwnode: Firmware node to find the next child node for.
|
||||
* @child: Handle to one of the device's child nodes or a null handle.
|
||||
*
|
||||
* Like acpi_get_next_subnode(), but the device nodes returned by
|
||||
* acpi_get_next_present_subnode() are guaranteed to be present.
|
||||
*
|
||||
* Returns: The fwnode handle of the next present sub-node.
|
||||
*/
|
||||
static struct fwnode_handle *
|
||||
acpi_get_next_present_subnode(const struct fwnode_handle *fwnode,
|
||||
struct fwnode_handle *child)
|
||||
{
|
||||
do {
|
||||
child = acpi_get_next_subnode(fwnode, child);
|
||||
} while (is_acpi_device_node(child) &&
|
||||
!acpi_device_is_present(to_acpi_device_node(child)));
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
/**
|
||||
* acpi_node_get_parent - Return parent fwnode of this fwnode
|
||||
* @fwnode: Firmware node whose parent to get
|
||||
|
|
@ -1387,7 +1409,7 @@ acpi_fwnode_device_get_match_data(const struct fwnode_handle *fwnode,
|
|||
.property_read_string_array = \
|
||||
acpi_fwnode_property_read_string_array, \
|
||||
.get_parent = acpi_node_get_parent, \
|
||||
.get_next_child_node = acpi_get_next_subnode, \
|
||||
.get_next_child_node = acpi_get_next_present_subnode, \
|
||||
.get_named_child_node = acpi_fwnode_get_named_child_node, \
|
||||
.get_reference_args = acpi_fwnode_get_reference_args, \
|
||||
.graph_get_next_endpoint = \
|
||||
|
|
|
|||
|
|
@ -556,6 +556,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
|
|||
DMI_MATCH(DMI_PRODUCT_NAME, "MS-7721"),
|
||||
},
|
||||
},
|
||||
/* https://gitlab.freedesktop.org/drm/amd/-/issues/4512 */
|
||||
{
|
||||
.callback = video_detect_force_native,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "82K8"),
|
||||
},
|
||||
},
|
||||
{ },
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -990,17 +990,8 @@ static int binder_inc_node_nilocked(struct binder_node *node, int strong,
|
|||
} else {
|
||||
if (!internal)
|
||||
node->local_weak_refs++;
|
||||
if (!node->has_weak_ref && list_empty(&node->work.entry)) {
|
||||
if (target_list == NULL) {
|
||||
pr_err("invalid inc weak node for %d\n",
|
||||
node->debug_id);
|
||||
return -EINVAL;
|
||||
}
|
||||
/*
|
||||
* See comment above
|
||||
*/
|
||||
if (!node->has_weak_ref && target_list && list_empty(&node->work.entry))
|
||||
binder_enqueue_work_ilocked(&node->work, target_list);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1179,6 +1179,14 @@ static void ata_gen_ata_sense(struct ata_queued_cmd *qc)
|
|||
ata_scsi_set_sense(dev, cmd, NOT_READY, 0x04, 0x21);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ata_id_is_locked(dev->id)) {
|
||||
/* Security locked */
|
||||
/* LOGICAL UNIT ACCESS NOT AUTHORIZED */
|
||||
ata_scsi_set_sense(dev, cmd, DATA_PROTECT, 0x74, 0x71);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Use ata_to_sense_error() to map status register bits
|
||||
* onto sense key, asc & ascq.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -30,50 +30,46 @@ struct devcd_entry {
|
|||
void *data;
|
||||
size_t datalen;
|
||||
/*
|
||||
* Here, mutex is required to serialize the calls to del_wk work between
|
||||
* user/kernel space which happens when devcd is added with device_add()
|
||||
* and that sends uevent to user space. User space reads the uevents,
|
||||
* and calls to devcd_data_write() which try to modify the work which is
|
||||
* not even initialized/queued from devcoredump.
|
||||
* There are 2 races for which mutex is required.
|
||||
*
|
||||
* The first race is between device creation and userspace writing to
|
||||
* schedule immediately destruction.
|
||||
*
|
||||
* This race is handled by arming the timer before device creation, but
|
||||
* when device creation fails the timer still exists.
|
||||
*
|
||||
* cpu0(X) cpu1(Y)
|
||||
* To solve this, hold the mutex during device_add(), and set
|
||||
* init_completed on success before releasing the mutex.
|
||||
*
|
||||
* dev_coredump() uevent sent to user space
|
||||
* device_add() ======================> user space process Y reads the
|
||||
* uevents writes to devcd fd
|
||||
* which results into writes to
|
||||
* That way the timer will never fire until device_add() is called,
|
||||
* it will do nothing if init_completed is not set. The timer is also
|
||||
* cancelled in that case.
|
||||
*
|
||||
* devcd_data_write()
|
||||
* mod_delayed_work()
|
||||
* try_to_grab_pending()
|
||||
* del_timer()
|
||||
* debug_assert_init()
|
||||
* INIT_DELAYED_WORK()
|
||||
* schedule_delayed_work()
|
||||
*
|
||||
*
|
||||
* Also, mutex alone would not be enough to avoid scheduling of
|
||||
* del_wk work after it get flush from a call to devcd_free()
|
||||
* mentioned as below.
|
||||
*
|
||||
* disabled_store()
|
||||
* devcd_free()
|
||||
* mutex_lock() devcd_data_write()
|
||||
* flush_delayed_work()
|
||||
* mutex_unlock()
|
||||
* mutex_lock()
|
||||
* mod_delayed_work()
|
||||
* mutex_unlock()
|
||||
* So, delete_work flag is required.
|
||||
* The second race involves multiple parallel invocations of devcd_free(),
|
||||
* add a deleted flag so only 1 can call the destructor.
|
||||
*/
|
||||
struct mutex mutex;
|
||||
bool delete_work;
|
||||
bool init_completed, deleted;
|
||||
struct module *owner;
|
||||
ssize_t (*read)(char *buffer, loff_t offset, size_t count,
|
||||
void *data, size_t datalen);
|
||||
void (*free)(void *data);
|
||||
/*
|
||||
* If nothing interferes and device_add() was returns success,
|
||||
* del_wk will destroy the device after the timer fires.
|
||||
*
|
||||
* Multiple userspace processes can interfere in the working of the timer:
|
||||
* - Writing to the coredump will reschedule the timer to run immediately,
|
||||
* if still armed.
|
||||
*
|
||||
* This is handled by using "if (cancel_delayed_work()) {
|
||||
* schedule_delayed_work() }", to prevent re-arming after having
|
||||
* been previously fired.
|
||||
* - Writing to /sys/class/devcoredump/disabled will destroy the
|
||||
* coredump synchronously.
|
||||
* This is handled by using disable_delayed_work_sync(), and then
|
||||
* checking if deleted flag is set with &devcd->mutex held.
|
||||
*/
|
||||
struct delayed_work del_wk;
|
||||
struct device *failing_dev;
|
||||
};
|
||||
|
|
@ -102,14 +98,27 @@ static void devcd_dev_release(struct device *dev)
|
|||
kfree(devcd);
|
||||
}
|
||||
|
||||
static void __devcd_del(struct devcd_entry *devcd)
|
||||
{
|
||||
devcd->deleted = true;
|
||||
device_del(&devcd->devcd_dev);
|
||||
put_device(&devcd->devcd_dev);
|
||||
}
|
||||
|
||||
static void devcd_del(struct work_struct *wk)
|
||||
{
|
||||
struct devcd_entry *devcd;
|
||||
bool init_completed;
|
||||
|
||||
devcd = container_of(wk, struct devcd_entry, del_wk.work);
|
||||
|
||||
device_del(&devcd->devcd_dev);
|
||||
put_device(&devcd->devcd_dev);
|
||||
/* devcd->mutex serializes against dev_coredumpm_timeout */
|
||||
mutex_lock(&devcd->mutex);
|
||||
init_completed = devcd->init_completed;
|
||||
mutex_unlock(&devcd->mutex);
|
||||
|
||||
if (init_completed)
|
||||
__devcd_del(devcd);
|
||||
}
|
||||
|
||||
static ssize_t devcd_data_read(struct file *filp, struct kobject *kobj,
|
||||
|
|
@ -129,12 +138,12 @@ static ssize_t devcd_data_write(struct file *filp, struct kobject *kobj,
|
|||
struct device *dev = kobj_to_dev(kobj);
|
||||
struct devcd_entry *devcd = dev_to_devcd(dev);
|
||||
|
||||
mutex_lock(&devcd->mutex);
|
||||
if (!devcd->delete_work) {
|
||||
devcd->delete_work = true;
|
||||
mod_delayed_work(system_wq, &devcd->del_wk, 0);
|
||||
}
|
||||
mutex_unlock(&devcd->mutex);
|
||||
/*
|
||||
* Although it's tempting to use mod_delayed work here,
|
||||
* that will cause a reschedule if the timer already fired.
|
||||
*/
|
||||
if (cancel_delayed_work(&devcd->del_wk))
|
||||
schedule_delayed_work(&devcd->del_wk, 0);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
|
@ -162,11 +171,21 @@ static int devcd_free(struct device *dev, void *data)
|
|||
{
|
||||
struct devcd_entry *devcd = dev_to_devcd(dev);
|
||||
|
||||
/*
|
||||
* To prevent a race with devcd_data_write(), cancel work and
|
||||
* complete manually instead.
|
||||
*
|
||||
* We cannot rely on the return value of
|
||||
* cancel_delayed_work_sync() here, because it might be in the
|
||||
* middle of a cancel_delayed_work + schedule_delayed_work pair.
|
||||
*
|
||||
* devcd->mutex here guards against multiple parallel invocations
|
||||
* of devcd_free().
|
||||
*/
|
||||
cancel_delayed_work_sync(&devcd->del_wk);
|
||||
mutex_lock(&devcd->mutex);
|
||||
if (!devcd->delete_work)
|
||||
devcd->delete_work = true;
|
||||
|
||||
flush_delayed_work(&devcd->del_wk);
|
||||
if (!devcd->deleted)
|
||||
__devcd_del(devcd);
|
||||
mutex_unlock(&devcd->mutex);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -190,12 +209,10 @@ static ssize_t disabled_show(struct class *class, struct class_attribute *attr,
|
|||
* put_device() <- last reference
|
||||
* error = fn(dev, data) devcd_dev_release()
|
||||
* devcd_free(dev, data) kfree(devcd)
|
||||
* mutex_lock(&devcd->mutex);
|
||||
*
|
||||
*
|
||||
* In the above diagram, It looks like disabled_store() would be racing with parallely
|
||||
* running devcd_del() and result in memory abort while acquiring devcd->mutex which
|
||||
* is called after kfree of devcd memory after dropping its last reference with
|
||||
* In the above diagram, it looks like disabled_store() would be racing with parallelly
|
||||
* running devcd_del() and result in memory abort after dropping its last reference with
|
||||
* put_device(). However, this will not happens as fn(dev, data) runs
|
||||
* with its own reference to device via klist_node so it is not its last reference.
|
||||
* so, above situation would not occur.
|
||||
|
|
@ -357,7 +374,7 @@ void dev_coredumpm(struct device *dev, struct module *owner,
|
|||
devcd->read = read;
|
||||
devcd->free = free;
|
||||
devcd->failing_dev = get_device(dev);
|
||||
devcd->delete_work = false;
|
||||
devcd->deleted = false;
|
||||
|
||||
mutex_init(&devcd->mutex);
|
||||
device_initialize(&devcd->devcd_dev);
|
||||
|
|
@ -366,8 +383,14 @@ void dev_coredumpm(struct device *dev, struct module *owner,
|
|||
atomic_inc_return(&devcd_count));
|
||||
devcd->devcd_dev.class = &devcd_class;
|
||||
|
||||
mutex_lock(&devcd->mutex);
|
||||
dev_set_uevent_suppress(&devcd->devcd_dev, true);
|
||||
|
||||
/* devcd->mutex prevents devcd_del() completing until init finishes */
|
||||
mutex_lock(&devcd->mutex);
|
||||
devcd->init_completed = false;
|
||||
INIT_DELAYED_WORK(&devcd->del_wk, devcd_del);
|
||||
schedule_delayed_work(&devcd->del_wk, DEVCD_TIMEOUT);
|
||||
|
||||
if (device_add(&devcd->devcd_dev))
|
||||
goto put_device;
|
||||
|
||||
|
|
@ -381,13 +404,20 @@ void dev_coredumpm(struct device *dev, struct module *owner,
|
|||
|
||||
dev_set_uevent_suppress(&devcd->devcd_dev, false);
|
||||
kobject_uevent(&devcd->devcd_dev.kobj, KOBJ_ADD);
|
||||
INIT_DELAYED_WORK(&devcd->del_wk, devcd_del);
|
||||
schedule_delayed_work(&devcd->del_wk, DEVCD_TIMEOUT);
|
||||
|
||||
/*
|
||||
* Safe to run devcd_del() now that we are done with devcd_dev.
|
||||
* Alternatively we could have taken a ref on devcd_dev before
|
||||
* dropping the lock.
|
||||
*/
|
||||
devcd->init_completed = true;
|
||||
mutex_unlock(&devcd->mutex);
|
||||
return;
|
||||
put_device:
|
||||
put_device(&devcd->devcd_dev);
|
||||
mutex_unlock(&devcd->mutex);
|
||||
cancel_delayed_work_sync(&devcd->del_wk);
|
||||
put_device(&devcd->devcd_dev);
|
||||
|
||||
put_module:
|
||||
module_put(owner);
|
||||
free:
|
||||
|
|
|
|||
|
|
@ -944,6 +944,10 @@ int __register_one_node(int nid)
|
|||
return -ENOMEM;
|
||||
|
||||
error = register_node(node_devices[nid], nid);
|
||||
if (error) {
|
||||
node_devices[nid] = NULL;
|
||||
return error;
|
||||
}
|
||||
|
||||
/* link cpu under this node */
|
||||
for_each_present_cpu(cpu) {
|
||||
|
|
|
|||
|
|
@ -48,8 +48,7 @@ struct regmap *__regmap_init_slimbus(struct slim_device *slimbus,
|
|||
if (IS_ERR(bus))
|
||||
return ERR_CAST(bus);
|
||||
|
||||
return __regmap_init(&slimbus->dev, bus, &slimbus->dev, config,
|
||||
lock_key, lock_name);
|
||||
return __regmap_init(&slimbus->dev, bus, slimbus, config, lock_key, lock_name);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__regmap_init_slimbus);
|
||||
|
||||
|
|
@ -63,8 +62,7 @@ struct regmap *__devm_regmap_init_slimbus(struct slim_device *slimbus,
|
|||
if (IS_ERR(bus))
|
||||
return ERR_CAST(bus);
|
||||
|
||||
return __devm_regmap_init(&slimbus->dev, bus, &slimbus, config,
|
||||
lock_key, lock_name);
|
||||
return __devm_regmap_init(&slimbus->dev, bus, slimbus, config, lock_key, lock_name);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__devm_regmap_init_slimbus);
|
||||
|
||||
|
|
|
|||
|
|
@ -4004,6 +4004,11 @@ static void btusb_disconnect(struct usb_interface *intf)
|
|||
|
||||
hci_unregister_dev(hdev);
|
||||
|
||||
if (data->oob_wake_irq)
|
||||
device_init_wakeup(&data->udev->dev, false);
|
||||
if (data->reset_gpio)
|
||||
gpiod_put(data->reset_gpio);
|
||||
|
||||
if (intf == data->intf) {
|
||||
if (data->isoc)
|
||||
usb_driver_release_interface(&btusb_driver, data->isoc);
|
||||
|
|
@ -4014,17 +4019,11 @@ static void btusb_disconnect(struct usb_interface *intf)
|
|||
usb_driver_release_interface(&btusb_driver, data->diag);
|
||||
usb_driver_release_interface(&btusb_driver, data->intf);
|
||||
} else if (intf == data->diag) {
|
||||
usb_driver_release_interface(&btusb_driver, data->intf);
|
||||
if (data->isoc)
|
||||
usb_driver_release_interface(&btusb_driver, data->isoc);
|
||||
usb_driver_release_interface(&btusb_driver, data->intf);
|
||||
}
|
||||
|
||||
if (data->oob_wake_irq)
|
||||
device_init_wakeup(&data->udev->dev, false);
|
||||
|
||||
if (data->reset_gpio)
|
||||
gpiod_put(data->reset_gpio);
|
||||
|
||||
hci_free_dev(hdev);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -582,6 +582,9 @@ static int bcsp_recv(struct hci_uart *hu, const void *data, int count)
|
|||
struct bcsp_struct *bcsp = hu->priv;
|
||||
const unsigned char *ptr;
|
||||
|
||||
if (!test_bit(HCI_UART_REGISTERED, &hu->flags))
|
||||
return -EUNATCH;
|
||||
|
||||
BT_DBG("hu %p count %d rx_state %d rx_count %ld",
|
||||
hu, count, bcsp->rx_state, bcsp->rx_count);
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,8 @@ static int misc_open(struct inode *inode, struct file *file)
|
|||
}
|
||||
}
|
||||
|
||||
if (!new_fops) {
|
||||
/* Only request module for fixed minor code */
|
||||
if (!new_fops && minor < MISC_DYNAMIC_MINOR) {
|
||||
mutex_unlock(&misc_mtx);
|
||||
request_module("char-major-%d-%d", MISC_MAJOR, minor);
|
||||
mutex_lock(&misc_mtx);
|
||||
|
|
@ -124,10 +125,11 @@ static int misc_open(struct inode *inode, struct file *file)
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (!new_fops)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!new_fops)
|
||||
goto fail;
|
||||
|
||||
/*
|
||||
* Place the miscdevice in the file's
|
||||
* private_data so it can be used by the
|
||||
|
|
|
|||
|
|
@ -633,16 +633,10 @@ static void tpm_tis_gen_interrupt(struct tpm_chip *chip)
|
|||
cap_t cap;
|
||||
int ret;
|
||||
|
||||
ret = request_locality(chip, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
if (chip->flags & TPM_CHIP_FLAG_TPM2)
|
||||
ret = tpm2_get_tpm_pt(chip, 0x100, &cap2, desc);
|
||||
else
|
||||
ret = tpm1_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, desc, 0);
|
||||
|
||||
release_locality(chip, 0);
|
||||
}
|
||||
|
||||
/* Register the IRQ and issue a command that will cause an interrupt. If an
|
||||
|
|
@ -665,11 +659,17 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
|
|||
}
|
||||
priv->irq = irq;
|
||||
|
||||
rc = tpm_tis_read8(priv, TPM_INT_VECTOR(priv->locality),
|
||||
&original_int_vec);
|
||||
rc = request_locality(chip, 0);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
rc = tpm_tis_read8(priv, TPM_INT_VECTOR(priv->locality),
|
||||
&original_int_vec);
|
||||
if (rc < 0) {
|
||||
release_locality(chip, priv->locality);
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = tpm_tis_write8(priv, TPM_INT_VECTOR(priv->locality), irq);
|
||||
if (rc < 0)
|
||||
goto restore_irqs;
|
||||
|
|
@ -700,12 +700,14 @@ restore_irqs:
|
|||
* will call disable_irq which undoes all of the above.
|
||||
*/
|
||||
if (!(chip->flags & TPM_CHIP_FLAG_IRQ)) {
|
||||
tpm_tis_write8(priv, original_int_vec,
|
||||
TPM_INT_VECTOR(priv->locality));
|
||||
return -1;
|
||||
tpm_tis_write8(priv, TPM_INT_VECTOR(priv->locality),
|
||||
original_int_vec);
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
release_locality(chip, priv->locality);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Try to find the IRQ the TPM is using. This is for legacy x86 systems that
|
||||
|
|
|
|||
|
|
@ -374,23 +374,25 @@ static unsigned long lpc18xx_pll0_recalc_rate(struct clk_hw *hw,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static long lpc18xx_pll0_round_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long *prate)
|
||||
static int lpc18xx_pll0_determine_rate(struct clk_hw *hw,
|
||||
struct clk_rate_request *req)
|
||||
{
|
||||
unsigned long m;
|
||||
|
||||
if (*prate < rate) {
|
||||
if (req->best_parent_rate < req->rate) {
|
||||
pr_warn("%s: pll dividers not supported\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
m = DIV_ROUND_UP_ULL(*prate, rate * 2);
|
||||
if (m <= 0 && m > LPC18XX_PLL0_MSEL_MAX) {
|
||||
pr_warn("%s: unable to support rate %lu\n", __func__, rate);
|
||||
m = DIV_ROUND_UP_ULL(req->best_parent_rate, req->rate * 2);
|
||||
if (m == 0 || m > LPC18XX_PLL0_MSEL_MAX) {
|
||||
pr_warn("%s: unable to support rate %lu\n", __func__, req->rate);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 2 * *prate * m;
|
||||
req->rate = 2 * req->best_parent_rate * m;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lpc18xx_pll0_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
|
|
@ -406,7 +408,7 @@ static int lpc18xx_pll0_set_rate(struct clk_hw *hw, unsigned long rate,
|
|||
}
|
||||
|
||||
m = DIV_ROUND_UP_ULL(parent_rate, rate * 2);
|
||||
if (m <= 0 && m > LPC18XX_PLL0_MSEL_MAX) {
|
||||
if (m == 0 || m > LPC18XX_PLL0_MSEL_MAX) {
|
||||
pr_warn("%s: unable to support rate %lu\n", __func__, rate);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -447,7 +449,7 @@ static int lpc18xx_pll0_set_rate(struct clk_hw *hw, unsigned long rate,
|
|||
|
||||
static const struct clk_ops lpc18xx_pll0_ops = {
|
||||
.recalc_rate = lpc18xx_pll0_recalc_rate,
|
||||
.round_rate = lpc18xx_pll0_round_rate,
|
||||
.determine_rate = lpc18xx_pll0_determine_rate,
|
||||
.set_rate = lpc18xx_pll0_set_rate,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -78,24 +78,33 @@ static int __init clps711x_timer_init(struct device_node *np)
|
|||
unsigned int irq = irq_of_parse_and_map(np, 0);
|
||||
struct clk *clock = of_clk_get(np, 0);
|
||||
void __iomem *base = of_iomap(np, 0);
|
||||
int ret = 0;
|
||||
|
||||
if (!base)
|
||||
return -ENOMEM;
|
||||
if (!irq)
|
||||
return -EINVAL;
|
||||
if (IS_ERR(clock))
|
||||
return PTR_ERR(clock);
|
||||
if (!irq) {
|
||||
ret = -EINVAL;
|
||||
goto unmap_io;
|
||||
}
|
||||
if (IS_ERR(clock)) {
|
||||
ret = PTR_ERR(clock);
|
||||
goto unmap_io;
|
||||
}
|
||||
|
||||
switch (of_alias_get_id(np, "timer")) {
|
||||
case CLPS711X_CLKSRC_CLOCKSOURCE:
|
||||
clps711x_clksrc_init(clock, base);
|
||||
break;
|
||||
case CLPS711X_CLKSRC_CLOCKEVENT:
|
||||
return _clps711x_clkevt_init(clock, base, irq);
|
||||
ret = _clps711x_clkevt_init(clock, base, irq);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
unmap_io:
|
||||
iounmap(base);
|
||||
return ret;
|
||||
}
|
||||
TIMER_OF_DECLARE(clps711x, "cirrus,ep7209-timer", clps711x_timer_init);
|
||||
|
|
|
|||
|
|
@ -35,30 +35,30 @@ static unsigned long cycle_per_jiffy;
|
|||
|
||||
static inline void pit_timer_enable(void)
|
||||
{
|
||||
__raw_writel(PITTCTRL_TEN | PITTCTRL_TIE, clkevt_base + PITTCTRL);
|
||||
writel(PITTCTRL_TEN | PITTCTRL_TIE, clkevt_base + PITTCTRL);
|
||||
}
|
||||
|
||||
static inline void pit_timer_disable(void)
|
||||
{
|
||||
__raw_writel(0, clkevt_base + PITTCTRL);
|
||||
writel(0, clkevt_base + PITTCTRL);
|
||||
}
|
||||
|
||||
static inline void pit_irq_acknowledge(void)
|
||||
{
|
||||
__raw_writel(PITTFLG_TIF, clkevt_base + PITTFLG);
|
||||
writel(PITTFLG_TIF, clkevt_base + PITTFLG);
|
||||
}
|
||||
|
||||
static u64 notrace pit_read_sched_clock(void)
|
||||
{
|
||||
return ~__raw_readl(clksrc_base + PITCVAL);
|
||||
return ~readl(clksrc_base + PITCVAL);
|
||||
}
|
||||
|
||||
static int __init pit_clocksource_init(unsigned long rate)
|
||||
{
|
||||
/* set the max load value and start the clock source counter */
|
||||
__raw_writel(0, clksrc_base + PITTCTRL);
|
||||
__raw_writel(~0UL, clksrc_base + PITLDVAL);
|
||||
__raw_writel(PITTCTRL_TEN, clksrc_base + PITTCTRL);
|
||||
writel(0, clksrc_base + PITTCTRL);
|
||||
writel(~0UL, clksrc_base + PITLDVAL);
|
||||
writel(PITTCTRL_TEN, clksrc_base + PITTCTRL);
|
||||
|
||||
sched_clock_register(pit_read_sched_clock, 32, rate);
|
||||
return clocksource_mmio_init(clksrc_base + PITCVAL, "vf-pit", rate,
|
||||
|
|
@ -76,7 +76,7 @@ static int pit_set_next_event(unsigned long delta,
|
|||
* hardware requirement.
|
||||
*/
|
||||
pit_timer_disable();
|
||||
__raw_writel(delta - 1, clkevt_base + PITLDVAL);
|
||||
writel(delta - 1, clkevt_base + PITLDVAL);
|
||||
pit_timer_enable();
|
||||
|
||||
return 0;
|
||||
|
|
@ -132,8 +132,8 @@ static struct irqaction pit_timer_irq = {
|
|||
|
||||
static int __init pit_clockevent_init(unsigned long rate, int irq)
|
||||
{
|
||||
__raw_writel(0, clkevt_base + PITTCTRL);
|
||||
__raw_writel(PITTFLG_TIF, clkevt_base + PITTFLG);
|
||||
writel(0, clkevt_base + PITTCTRL);
|
||||
writel(PITTFLG_TIF, clkevt_base + PITTFLG);
|
||||
|
||||
BUG_ON(setup_irq(irq, &pit_timer_irq));
|
||||
|
||||
|
|
@ -189,7 +189,7 @@ static int __init pit_timer_init(struct device_node *np)
|
|||
cycle_per_jiffy = clk_rate / (HZ);
|
||||
|
||||
/* enable the pit module */
|
||||
__raw_writel(~PITMCR_MDIS, timer_base + PITMCR);
|
||||
writel(~PITMCR_MDIS, timer_base + PITMCR);
|
||||
|
||||
ret = pit_clocksource_init(clk_rate);
|
||||
if (ret)
|
||||
|
|
|
|||
|
|
@ -1092,10 +1092,10 @@ static void update_qos_request(enum freq_qos_req_type type)
|
|||
continue;
|
||||
|
||||
req = policy->driver_data;
|
||||
cpufreq_cpu_put(policy);
|
||||
|
||||
if (!req)
|
||||
if (!req) {
|
||||
cpufreq_cpu_put(policy);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (hwp_active)
|
||||
intel_pstate_get_hwp_max(i, &turbo_max, &max_state);
|
||||
|
|
@ -1114,6 +1114,8 @@ static void update_qos_request(enum freq_qos_req_type type)
|
|||
|
||||
if (freq_qos_update_request(req, freq) < 0)
|
||||
pr_warn("Failed to update freq constraint: CPU%d\n", i);
|
||||
|
||||
cpufreq_cpu_put(policy);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -956,6 +956,9 @@ static void __exit longhaul_exit(void)
|
|||
struct cpufreq_policy *policy = cpufreq_cpu_get(0);
|
||||
int i;
|
||||
|
||||
if (unlikely(!policy))
|
||||
return;
|
||||
|
||||
for (i = 0; i < numscales; i++) {
|
||||
if (mults[i] == maxmult) {
|
||||
struct cpufreq_freqs freqs;
|
||||
|
|
|
|||
|
|
@ -261,20 +261,17 @@ again:
|
|||
*
|
||||
* This can deal with workloads that have long pauses interspersed
|
||||
* with sporadic activity with a bunch of short pauses.
|
||||
*
|
||||
* However, if the number of remaining samples is too small to exclude
|
||||
* any more outliers, allow the deepest available idle state to be
|
||||
* selected because there are systems where the time spent by CPUs in
|
||||
* deep idle states is correlated to the maximum frequency the CPUs
|
||||
* can get to. On those systems, shallow idle states should be avoided
|
||||
* unless there is a clear indication that the given CPU is most likley
|
||||
* going to be woken up shortly.
|
||||
*/
|
||||
if (divisor * 4 <= INTERVALS * 3) {
|
||||
/*
|
||||
* If there are sufficiently many data points still under
|
||||
* consideration after the outliers have been eliminated,
|
||||
* returning without a prediction would be a mistake because it
|
||||
* is likely that the next interval will not exceed the current
|
||||
* maximum, so return the latter in that case.
|
||||
*/
|
||||
if (divisor >= INTERVALS / 2)
|
||||
return max;
|
||||
|
||||
if (divisor * 4 <= INTERVALS * 3)
|
||||
return UINT_MAX;
|
||||
}
|
||||
|
||||
thresh = max - 1;
|
||||
goto again;
|
||||
|
|
|
|||
|
|
@ -565,7 +565,7 @@ static int atmel_tdes_crypt_start(struct atmel_tdes_dev *dd)
|
|||
|
||||
if (err && (dd->flags & TDES_FLAGS_FAST)) {
|
||||
dma_unmap_sg(dd->dev, dd->in_sg, 1, DMA_TO_DEVICE);
|
||||
dma_unmap_sg(dd->dev, dd->out_sg, 1, DMA_TO_DEVICE);
|
||||
dma_unmap_sg(dd->dev, dd->out_sg, 1, DMA_FROM_DEVICE);
|
||||
}
|
||||
|
||||
return err;
|
||||
|
|
|
|||
|
|
@ -474,6 +474,25 @@ dw_edma_device_prep_dma_cyclic(struct dma_chan *dchan, dma_addr_t paddr,
|
|||
return dw_edma_device_transfer(&xfer);
|
||||
}
|
||||
|
||||
static void dw_hdma_set_callback_result(struct virt_dma_desc *vd,
|
||||
enum dmaengine_tx_result result)
|
||||
{
|
||||
u32 residue = 0;
|
||||
struct dw_edma_desc *desc;
|
||||
struct dmaengine_result *res;
|
||||
|
||||
if (!vd->tx.callback_result)
|
||||
return;
|
||||
|
||||
desc = vd2dw_edma_desc(vd);
|
||||
if (desc)
|
||||
residue = desc->alloc_sz - desc->xfer_sz;
|
||||
|
||||
res = &vd->tx_result;
|
||||
res->result = result;
|
||||
res->residue = residue;
|
||||
}
|
||||
|
||||
static void dw_edma_done_interrupt(struct dw_edma_chan *chan)
|
||||
{
|
||||
struct dw_edma_desc *desc;
|
||||
|
|
@ -489,6 +508,8 @@ static void dw_edma_done_interrupt(struct dw_edma_chan *chan)
|
|||
case EDMA_REQ_NONE:
|
||||
desc = vd2dw_edma_desc(vd);
|
||||
if (!desc->chunks_alloc) {
|
||||
dw_hdma_set_callback_result(vd,
|
||||
DMA_TRANS_NOERROR);
|
||||
list_del(&vd->node);
|
||||
vchan_cookie_complete(vd);
|
||||
}
|
||||
|
|
@ -527,6 +548,7 @@ static void dw_edma_abort_interrupt(struct dw_edma_chan *chan)
|
|||
spin_lock_irqsave(&chan->vc.lock, flags);
|
||||
vd = vchan_next_desc(&chan->vc);
|
||||
if (vd) {
|
||||
dw_hdma_set_callback_result(vd, DMA_TRANS_ABORTED);
|
||||
list_del(&vd->node);
|
||||
vchan_cookie_complete(vd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1013,7 +1013,7 @@ static int mv_xor_channel_remove(struct mv_xor_chan *mv_chan)
|
|||
|
||||
dma_async_device_unregister(&mv_chan->dmadev);
|
||||
|
||||
dma_free_coherent(dev, MV_XOR_POOL_SIZE,
|
||||
dma_free_wc(dev, MV_XOR_POOL_SIZE,
|
||||
mv_chan->dma_desc_pool_virt, mv_chan->dma_desc_pool);
|
||||
dma_unmap_single(dev, mv_chan->dummy_src_addr,
|
||||
MV_XOR_MIN_BYTE_COUNT, DMA_FROM_DEVICE);
|
||||
|
|
@ -1164,7 +1164,7 @@ mv_xor_channel_add(struct mv_xor_device *xordev,
|
|||
err_free_irq:
|
||||
free_irq(mv_chan->irq, mv_chan);
|
||||
err_free_dma:
|
||||
dma_free_coherent(&pdev->dev, MV_XOR_POOL_SIZE,
|
||||
dma_free_wc(&pdev->dev, MV_XOR_POOL_SIZE,
|
||||
mv_chan->dma_desc_pool_virt, mv_chan->dma_desc_pool);
|
||||
err_unmap_dst:
|
||||
dma_unmap_single(dma_dev->dev, mv_chan->dummy_dst_addr,
|
||||
|
|
|
|||
|
|
@ -129,12 +129,25 @@ static dma_cookie_t shdma_tx_submit(struct dma_async_tx_descriptor *tx)
|
|||
const struct shdma_ops *ops = sdev->ops;
|
||||
dev_dbg(schan->dev, "Bring up channel %d\n",
|
||||
schan->id);
|
||||
/*
|
||||
* TODO: .xfer_setup() might fail on some platforms.
|
||||
* Make it int then, on error remove chunks from the
|
||||
* queue again
|
||||
*/
|
||||
ops->setup_xfer(schan, schan->slave_id);
|
||||
|
||||
ret = ops->setup_xfer(schan, schan->slave_id);
|
||||
if (ret < 0) {
|
||||
dev_err(schan->dev, "setup_xfer failed: %d\n", ret);
|
||||
|
||||
/* Remove chunks from the queue and mark them as idle */
|
||||
list_for_each_entry_safe(chunk, c, &schan->ld_queue, node) {
|
||||
if (chunk->cookie == cookie) {
|
||||
chunk->mark = DESC_IDLE;
|
||||
list_move(&chunk->node, &schan->ld_free);
|
||||
}
|
||||
}
|
||||
|
||||
schan->pm_state = SHDMA_PM_ESTABLISHED;
|
||||
ret = pm_runtime_put(schan->dev);
|
||||
|
||||
spin_unlock_irq(&schan->chan_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (schan->pm_state == SHDMA_PM_PENDING)
|
||||
shdma_chan_xfer_ld_queue(schan);
|
||||
|
|
|
|||
|
|
@ -301,21 +301,30 @@ static bool sh_dmae_channel_busy(struct shdma_chan *schan)
|
|||
return dmae_is_busy(sh_chan);
|
||||
}
|
||||
|
||||
static void sh_dmae_setup_xfer(struct shdma_chan *schan,
|
||||
int slave_id)
|
||||
static int sh_dmae_setup_xfer(struct shdma_chan *schan, int slave_id)
|
||||
{
|
||||
struct sh_dmae_chan *sh_chan = container_of(schan, struct sh_dmae_chan,
|
||||
shdma_chan);
|
||||
|
||||
int ret = 0;
|
||||
if (slave_id >= 0) {
|
||||
const struct sh_dmae_slave_config *cfg =
|
||||
sh_chan->config;
|
||||
|
||||
dmae_set_dmars(sh_chan, cfg->mid_rid);
|
||||
dmae_set_chcr(sh_chan, cfg->chcr);
|
||||
ret = dmae_set_dmars(sh_chan, cfg->mid_rid);
|
||||
if (ret < 0)
|
||||
goto END;
|
||||
|
||||
ret = dmae_set_chcr(sh_chan, cfg->chcr);
|
||||
if (ret < 0)
|
||||
goto END;
|
||||
|
||||
} else {
|
||||
dmae_init(sh_chan);
|
||||
}
|
||||
|
||||
END:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1247,10 +1247,22 @@ altr_check_ocram_deps_init(struct altr_edac_device_dev *device)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Verify OCRAM has been initialized */
|
||||
/*
|
||||
* Verify that OCRAM has been initialized.
|
||||
* During a warm reset, OCRAM contents are retained, but the control
|
||||
* and status registers are reset to their default values. Therefore,
|
||||
* ECC must be explicitly re-enabled in the control register.
|
||||
* Error condition: if INITCOMPLETEA is clear and ECC_EN is already set.
|
||||
*/
|
||||
if (!ecc_test_bits(ALTR_A10_ECC_INITCOMPLETEA,
|
||||
(base + ALTR_A10_ECC_INITSTAT_OFST)))
|
||||
return -ENODEV;
|
||||
(base + ALTR_A10_ECC_INITSTAT_OFST))) {
|
||||
if (!ecc_test_bits(ALTR_A10_ECC_EN,
|
||||
(base + ALTR_A10_ECC_CTRL_OFST)))
|
||||
ecc_set_bits(ALTR_A10_ECC_EN,
|
||||
(base + ALTR_A10_ECC_CTRL_OFST));
|
||||
else
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Enable IRQ on Single Bit Error */
|
||||
writel(ALTR_A10_ECC_SERRINTEN, (base + ALTR_A10_ECC_ERRINTENS_OFST));
|
||||
|
|
@ -1420,7 +1432,7 @@ static const struct edac_device_prv_data a10_enetecc_data = {
|
|||
.ue_set_mask = ALTR_A10_ECC_TDERRA,
|
||||
.set_err_ofst = ALTR_A10_ECC_INTTEST_OFST,
|
||||
.ecc_irq_handler = altr_edac_a10_ecc_irq,
|
||||
.inject_fops = &altr_edac_a10_device_inject2_fops,
|
||||
.inject_fops = &altr_edac_a10_device_inject_fops,
|
||||
};
|
||||
|
||||
#endif /* CONFIG_EDAC_ALTERA_ETHERNET */
|
||||
|
|
@ -1510,7 +1522,7 @@ static const struct edac_device_prv_data a10_usbecc_data = {
|
|||
.ue_set_mask = ALTR_A10_ECC_TDERRA,
|
||||
.set_err_ofst = ALTR_A10_ECC_INTTEST_OFST,
|
||||
.ecc_irq_handler = altr_edac_a10_ecc_irq,
|
||||
.inject_fops = &altr_edac_a10_device_inject2_fops,
|
||||
.inject_fops = &altr_edac_a10_device_inject_fops,
|
||||
};
|
||||
|
||||
#endif /* CONFIG_EDAC_ALTERA_USB */
|
||||
|
|
|
|||
|
|
@ -162,6 +162,8 @@ static int adc_jack_remove(struct platform_device *pdev)
|
|||
{
|
||||
struct adc_jack_data *data = platform_get_drvdata(pdev);
|
||||
|
||||
if (data->wakeup_source)
|
||||
device_init_wakeup(&pdev->dev, false);
|
||||
free_irq(data->irq, data);
|
||||
cancel_work_sync(&data->handler.work);
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ static int scmi_pd_power_off(struct generic_pm_domain *domain)
|
|||
|
||||
static int scmi_pm_domain_probe(struct scmi_device *sdev)
|
||||
{
|
||||
int num_domains, i;
|
||||
int num_domains, i, ret;
|
||||
struct device *dev = &sdev->dev;
|
||||
struct device_node *np = dev->of_node;
|
||||
struct scmi_pm_domain *scmi_pd;
|
||||
|
|
@ -106,9 +106,18 @@ static int scmi_pm_domain_probe(struct scmi_device *sdev)
|
|||
scmi_pd_data->domains = domains;
|
||||
scmi_pd_data->num_domains = num_domains;
|
||||
|
||||
ret = of_genpd_add_provider_onecell(np, scmi_pd_data);
|
||||
if (ret)
|
||||
goto err_rm_genpds;
|
||||
|
||||
dev_set_drvdata(dev, scmi_pd_data);
|
||||
|
||||
return of_genpd_add_provider_onecell(np, scmi_pd_data);
|
||||
return 0;
|
||||
err_rm_genpds:
|
||||
for (i = num_domains - 1; i >= 0; i--)
|
||||
pm_genpd_remove(domains[i]);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void scmi_pm_domain_remove(struct scmi_device *sdev)
|
||||
|
|
|
|||
|
|
@ -223,11 +223,16 @@ EXPORT_SYMBOL(meson_sm_call_write);
|
|||
struct meson_sm_firmware *meson_sm_get(struct device_node *sm_node)
|
||||
{
|
||||
struct platform_device *pdev = of_find_device_by_node(sm_node);
|
||||
struct meson_sm_firmware *fw;
|
||||
|
||||
if (!pdev)
|
||||
return NULL;
|
||||
|
||||
return platform_get_drvdata(pdev);
|
||||
fw = platform_get_drvdata(pdev);
|
||||
|
||||
put_device(&pdev->dev);
|
||||
|
||||
return fw;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(meson_sm_get);
|
||||
|
||||
|
|
|
|||
|
|
@ -1572,10 +1572,9 @@ int amdgpu_amdkfd_gpuvm_get_vm_fault_info(struct kgd_dev *kgd,
|
|||
struct amdgpu_device *adev;
|
||||
|
||||
adev = (struct amdgpu_device *)kgd;
|
||||
if (atomic_read(&adev->gmc.vm_fault_info_updated) == 1) {
|
||||
if (atomic_read_acquire(&adev->gmc.vm_fault_info_updated) == 1) {
|
||||
*mem = *adev->gmc.vm_fault_info;
|
||||
mb();
|
||||
atomic_set(&adev->gmc.vm_fault_info_updated, 0);
|
||||
atomic_set_release(&adev->gmc.vm_fault_info_updated, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1042,7 +1042,7 @@ static int gmc_v7_0_sw_init(void *handle)
|
|||
GFP_KERNEL);
|
||||
if (!adev->gmc.vm_fault_info)
|
||||
return -ENOMEM;
|
||||
atomic_set(&adev->gmc.vm_fault_info_updated, 0);
|
||||
atomic_set_release(&adev->gmc.vm_fault_info_updated, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1272,7 +1272,7 @@ static int gmc_v7_0_process_interrupt(struct amdgpu_device *adev,
|
|||
vmid = REG_GET_FIELD(status, VM_CONTEXT1_PROTECTION_FAULT_STATUS,
|
||||
VMID);
|
||||
if (amdgpu_amdkfd_is_kfd_vmid(adev, vmid)
|
||||
&& !atomic_read(&adev->gmc.vm_fault_info_updated)) {
|
||||
&& !atomic_read_acquire(&adev->gmc.vm_fault_info_updated)) {
|
||||
struct kfd_vm_fault_info *info = adev->gmc.vm_fault_info;
|
||||
u32 protections = REG_GET_FIELD(status,
|
||||
VM_CONTEXT1_PROTECTION_FAULT_STATUS,
|
||||
|
|
@ -1288,8 +1288,7 @@ static int gmc_v7_0_process_interrupt(struct amdgpu_device *adev,
|
|||
info->prot_read = protections & 0x8 ? true : false;
|
||||
info->prot_write = protections & 0x10 ? true : false;
|
||||
info->prot_exec = protections & 0x20 ? true : false;
|
||||
mb();
|
||||
atomic_set(&adev->gmc.vm_fault_info_updated, 1);
|
||||
atomic_set_release(&adev->gmc.vm_fault_info_updated, 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1175,7 +1175,7 @@ static int gmc_v8_0_sw_init(void *handle)
|
|||
GFP_KERNEL);
|
||||
if (!adev->gmc.vm_fault_info)
|
||||
return -ENOMEM;
|
||||
atomic_set(&adev->gmc.vm_fault_info_updated, 0);
|
||||
atomic_set_release(&adev->gmc.vm_fault_info_updated, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1464,7 +1464,7 @@ static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev,
|
|||
vmid = REG_GET_FIELD(status, VM_CONTEXT1_PROTECTION_FAULT_STATUS,
|
||||
VMID);
|
||||
if (amdgpu_amdkfd_is_kfd_vmid(adev, vmid)
|
||||
&& !atomic_read(&adev->gmc.vm_fault_info_updated)) {
|
||||
&& !atomic_read_acquire(&adev->gmc.vm_fault_info_updated)) {
|
||||
struct kfd_vm_fault_info *info = adev->gmc.vm_fault_info;
|
||||
u32 protections = REG_GET_FIELD(status,
|
||||
VM_CONTEXT1_PROTECTION_FAULT_STATUS,
|
||||
|
|
@ -1480,8 +1480,7 @@ static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev,
|
|||
info->prot_read = protections & 0x8 ? true : false;
|
||||
info->prot_write = protections & 0x10 ? true : false;
|
||||
info->prot_exec = protections & 0x20 ? true : false;
|
||||
mb();
|
||||
atomic_set(&adev->gmc.vm_fault_info_updated, 1);
|
||||
atomic_set_release(&adev->gmc.vm_fault_info_updated, 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1796,8 +1796,10 @@ static long kfd_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
|
|||
unsigned int usize, asize;
|
||||
int retcode = -EINVAL;
|
||||
|
||||
if (nr >= AMDKFD_CORE_IOCTL_COUNT)
|
||||
if (nr >= AMDKFD_CORE_IOCTL_COUNT) {
|
||||
retcode = -ENOTTY;
|
||||
goto err_i1;
|
||||
}
|
||||
|
||||
if ((nr >= AMDKFD_COMMAND_START) && (nr < AMDKFD_COMMAND_END)) {
|
||||
u32 amdkfd_size;
|
||||
|
|
@ -1810,8 +1812,10 @@ static long kfd_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
|
|||
asize = amdkfd_size;
|
||||
|
||||
cmd = ioctl->cmd;
|
||||
} else
|
||||
} else {
|
||||
retcode = -ENOTTY;
|
||||
goto err_i1;
|
||||
}
|
||||
|
||||
dev_dbg(kfd_device, "ioctl cmd 0x%x (#%d), arg 0x%lx\n", cmd, nr, arg);
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,14 @@
|
|||
|
||||
#define KFD_KERNEL_QUEUE_SIZE 2048
|
||||
|
||||
#define KFD_UNMAP_LATENCY_MS (4000)
|
||||
/* KFD_UNMAP_LATENCY_MS is the timeout CP waiting for SDMA preemption. One XCC
|
||||
* can be associated to 2 SDMA engines. queue_preemption_timeout_ms is the time
|
||||
* driver waiting for CP returning the UNMAP_QUEUE fence. Thus the math is
|
||||
* queue_preemption_timeout_ms = sdma_preemption_time * 2 + cp workload
|
||||
* The format here makes CP workload 10% of total timeout
|
||||
*/
|
||||
#define KFD_UNMAP_LATENCY_MS \
|
||||
((queue_preemption_timeout_ms - queue_preemption_timeout_ms / 10) >> 1)
|
||||
|
||||
/*
|
||||
* 512 = 0x200
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, u32 exec_state,
|
|||
u32 link_target, link_dwords;
|
||||
bool switch_context = gpu->exec_state != exec_state;
|
||||
bool switch_mmu_context = gpu->mmu_context != mmu_context;
|
||||
unsigned int new_flush_seq = READ_ONCE(gpu->mmu_context->flush_seq);
|
||||
unsigned int new_flush_seq = READ_ONCE(mmu_context->flush_seq);
|
||||
bool need_flush = switch_mmu_context || gpu->flush_seq != new_flush_seq;
|
||||
bool has_blt = !!(gpu->identity.minor_features5 &
|
||||
chipMinorFeatures5_BLT_ENGINE);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ struct decon_context {
|
|||
void __iomem *regs;
|
||||
unsigned long irq_flags;
|
||||
bool i80_if;
|
||||
bool suspended;
|
||||
wait_queue_head_t wait_vsync_queue;
|
||||
atomic_t wait_vsync_event;
|
||||
|
||||
|
|
@ -85,9 +84,6 @@ static void decon_wait_for_vblank(struct exynos_drm_crtc *crtc)
|
|||
{
|
||||
struct decon_context *ctx = crtc->ctx;
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
atomic_set(&ctx->wait_vsync_event, 1);
|
||||
|
||||
/*
|
||||
|
|
@ -155,9 +151,6 @@ static void decon_commit(struct exynos_drm_crtc *crtc)
|
|||
struct drm_display_mode *mode = &crtc->base.state->adjusted_mode;
|
||||
u32 val, clkdiv;
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
/* nothing to do if we haven't set the mode yet */
|
||||
if (mode->htotal == 0 || mode->vtotal == 0)
|
||||
return;
|
||||
|
|
@ -219,9 +212,6 @@ static int decon_enable_vblank(struct exynos_drm_crtc *crtc)
|
|||
struct decon_context *ctx = crtc->ctx;
|
||||
u32 val;
|
||||
|
||||
if (ctx->suspended)
|
||||
return -EPERM;
|
||||
|
||||
if (!test_and_set_bit(0, &ctx->irq_flags)) {
|
||||
val = readl(ctx->regs + VIDINTCON0);
|
||||
|
||||
|
|
@ -244,9 +234,6 @@ static void decon_disable_vblank(struct exynos_drm_crtc *crtc)
|
|||
struct decon_context *ctx = crtc->ctx;
|
||||
u32 val;
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
if (test_and_clear_bit(0, &ctx->irq_flags)) {
|
||||
val = readl(ctx->regs + VIDINTCON0);
|
||||
|
||||
|
|
@ -369,9 +356,6 @@ static void decon_atomic_begin(struct exynos_drm_crtc *crtc)
|
|||
struct decon_context *ctx = crtc->ctx;
|
||||
int i;
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
for (i = 0; i < WINDOWS_NR; i++)
|
||||
decon_shadow_protect_win(ctx, i, true);
|
||||
}
|
||||
|
|
@ -391,9 +375,6 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc,
|
|||
unsigned int cpp = fb->format->cpp[0];
|
||||
unsigned int pitch = fb->pitches[0];
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
/*
|
||||
* SHADOWCON/PRTCON register is used for enabling timing.
|
||||
*
|
||||
|
|
@ -481,9 +462,6 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc,
|
|||
unsigned int win = plane->index;
|
||||
u32 val;
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
/* protect windows */
|
||||
decon_shadow_protect_win(ctx, win, true);
|
||||
|
||||
|
|
@ -502,9 +480,6 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc)
|
|||
struct decon_context *ctx = crtc->ctx;
|
||||
int i;
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
for (i = 0; i < WINDOWS_NR; i++)
|
||||
decon_shadow_protect_win(ctx, i, false);
|
||||
exynos_crtc_handle_event(crtc);
|
||||
|
|
@ -531,9 +506,6 @@ static void decon_enable(struct exynos_drm_crtc *crtc)
|
|||
{
|
||||
struct decon_context *ctx = crtc->ctx;
|
||||
|
||||
if (!ctx->suspended)
|
||||
return;
|
||||
|
||||
pm_runtime_get_sync(ctx->dev);
|
||||
|
||||
decon_init(ctx);
|
||||
|
|
@ -543,8 +515,6 @@ static void decon_enable(struct exynos_drm_crtc *crtc)
|
|||
decon_enable_vblank(ctx->crtc);
|
||||
|
||||
decon_commit(ctx->crtc);
|
||||
|
||||
ctx->suspended = false;
|
||||
}
|
||||
|
||||
static void decon_disable(struct exynos_drm_crtc *crtc)
|
||||
|
|
@ -552,9 +522,6 @@ static void decon_disable(struct exynos_drm_crtc *crtc)
|
|||
struct decon_context *ctx = crtc->ctx;
|
||||
int i;
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
/*
|
||||
* We need to make sure that all windows are disabled before we
|
||||
* suspend that connector. Otherwise we might try to scan from
|
||||
|
|
@ -564,8 +531,6 @@ static void decon_disable(struct exynos_drm_crtc *crtc)
|
|||
decon_disable_plane(crtc, &ctx->planes[i]);
|
||||
|
||||
pm_runtime_put_sync(ctx->dev);
|
||||
|
||||
ctx->suspended = true;
|
||||
}
|
||||
|
||||
static const struct exynos_drm_crtc_ops decon_crtc_ops = {
|
||||
|
|
@ -683,7 +648,6 @@ static int decon_probe(struct platform_device *pdev)
|
|||
return -ENOMEM;
|
||||
|
||||
ctx->dev = dev;
|
||||
ctx->suspended = true;
|
||||
|
||||
i80_if_timings = of_get_child_by_name(dev->of_node, "i80-if-timings");
|
||||
if (i80_if_timings)
|
||||
|
|
|
|||
|
|
@ -1122,7 +1122,7 @@ done:
|
|||
nvif_vmm_put(vmm, &old_mem->vma[1]);
|
||||
nvif_vmm_put(vmm, &old_mem->vma[0]);
|
||||
}
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ nvkm_snprintbf(char *data, int size, const struct nvkm_bitfield *bf, u32 value)
|
|||
bool space = false;
|
||||
while (size >= 1 && bf->name) {
|
||||
if (value & bf->mask) {
|
||||
int this = snprintf(data, size, "%s%s",
|
||||
int this = scnprintf(data, size, "%s%s",
|
||||
space ? " " : "", bf->name);
|
||||
size -= this;
|
||||
data += this;
|
||||
|
|
|
|||
|
|
@ -1411,7 +1411,7 @@ static void r600_texture_size(unsigned nfaces, unsigned blevel, unsigned llevel,
|
|||
unsigned block_align, unsigned height_align, unsigned base_align,
|
||||
unsigned *l0_size, unsigned *mipmap_size)
|
||||
{
|
||||
unsigned offset, i, level;
|
||||
unsigned offset, i;
|
||||
unsigned width, height, depth, size;
|
||||
unsigned blocksize;
|
||||
unsigned nbx, nby;
|
||||
|
|
@ -1423,7 +1423,7 @@ static void r600_texture_size(unsigned nfaces, unsigned blevel, unsigned llevel,
|
|||
w0 = r600_mip_minify(w0, 0);
|
||||
h0 = r600_mip_minify(h0, 0);
|
||||
d0 = r600_mip_minify(d0, 0);
|
||||
for(i = 0, offset = 0, level = blevel; i < nlevels; i++, level++) {
|
||||
for (i = 0, offset = 0; i < nlevels; i++) {
|
||||
width = r600_mip_minify(w0, i);
|
||||
nbx = r600_fmt_get_nblocksx(format, width);
|
||||
|
||||
|
|
|
|||
|
|
@ -3216,6 +3216,11 @@ static int vmw_cmd_check(struct vmw_private *dev_priv,
|
|||
|
||||
|
||||
cmd_id = header->id;
|
||||
if (header->size > SVGA_CMD_MAX_DATASIZE) {
|
||||
VMW_DEBUG_USER("SVGA3D command: %d is too big.\n",
|
||||
cmd_id + SVGA_3D_CMD_BASE);
|
||||
return -E2BIG;
|
||||
}
|
||||
*size = header->size + sizeof(SVGA3dCmdHeader);
|
||||
|
||||
cmd_id -= SVGA_3D_CMD_BASE;
|
||||
|
|
|
|||
|
|
@ -339,8 +339,10 @@ int vmw_validation_add_resource(struct vmw_validation_context *ctx,
|
|||
}
|
||||
}
|
||||
node->res = vmw_resource_reference_unless_doomed(res);
|
||||
if (!node->res)
|
||||
if (!node->res) {
|
||||
hash_del_rcu(&node->hash.head);
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
node->first_usage = 1;
|
||||
if (!res->dev_priv->has_mob) {
|
||||
|
|
|
|||
|
|
@ -303,6 +303,9 @@
|
|||
#define USB_DEVICE_ID_CODEMERCS_IOW_FIRST 0x1500
|
||||
#define USB_DEVICE_ID_CODEMERCS_IOW_LAST 0x15ff
|
||||
|
||||
#define USB_VENDOR_ID_COOLER_MASTER 0x2516
|
||||
#define USB_DEVICE_ID_COOLER_MASTER_MICE_DONGLE 0x01b7
|
||||
|
||||
#define USB_VENDOR_ID_CORSAIR 0x1b1c
|
||||
#define USB_DEVICE_ID_CORSAIR_K90 0x1b02
|
||||
|
||||
|
|
@ -1356,8 +1359,8 @@
|
|||
#define USB_VENDOR_ID_SIGNOTEC 0x2133
|
||||
#define USB_DEVICE_ID_SIGNOTEC_VIEWSONIC_PD1011 0x0018
|
||||
|
||||
#define USB_VENDOR_ID_SMARTLINKTECHNOLOGY 0x4c4a
|
||||
#define USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155 0x4155
|
||||
#define USB_VENDOR_ID_JIELI_SDK_DEFAULT 0x4c4a
|
||||
#define USB_DEVICE_ID_JIELI_SDK_4155 0x4155
|
||||
|
||||
#define USB_VENDOR_ID_QVR5 0x045e
|
||||
#define USB_VENDOR_ID_QVR32A 0x04b4
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ static const struct hid_device_id hid_quirks[] = {
|
|||
{ HID_USB_DEVICE(USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE), HID_QUIRK_NOGET },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_PRO_PEDALS), HID_QUIRK_NOGET },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_PRO_THROTTLE), HID_QUIRK_NOGET },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_COOLER_MASTER, USB_DEVICE_ID_COOLER_MASTER_MICE_DONGLE), HID_QUIRK_ALWAYS_POLL },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K65RGB), HID_QUIRK_NO_INIT_REPORTS },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K65RGB_RAPIDFIRE), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K70RGB), HID_QUIRK_NO_INIT_REPORTS },
|
||||
|
|
@ -894,7 +895,6 @@ static const struct hid_device_id hid_ignore_list[] = {
|
|||
#endif
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_HP_5MP_CAMERA_5473) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SMARTLINKTECHNOLOGY, USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155) },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
|
@ -1043,6 +1043,18 @@ bool hid_ignore(struct hid_device *hdev)
|
|||
strlen(elan_acpi_id[i].id)))
|
||||
return true;
|
||||
break;
|
||||
case USB_VENDOR_ID_JIELI_SDK_DEFAULT:
|
||||
/*
|
||||
* Multiple USB devices with identical IDs (mic & touchscreen).
|
||||
* The touch screen requires hid core processing, but the
|
||||
* microphone does not. They can be distinguished by manufacturer
|
||||
* and serial number.
|
||||
*/
|
||||
if (hdev->product == USB_DEVICE_ID_JIELI_SDK_4155 &&
|
||||
strncmp(hdev->name, "SmartlinkTechnology", 19) == 0 &&
|
||||
strncmp(hdev->uniq, "20201111000001", 14) == 0)
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (hdev->type == HID_TYPE_USBMOUSE &&
|
||||
|
|
|
|||
|
|
@ -1016,6 +1016,13 @@ static const struct dmi_system_id i8k_dmi_table[] __initconst = {
|
|||
},
|
||||
.driver_data = (void *)&i8k_config_data[DELL_PRECISION_490],
|
||||
},
|
||||
{
|
||||
.ident = "Dell OptiPlex 7040",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "OptiPlex 7040"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.ident = "Dell Precision",
|
||||
.matches = {
|
||||
|
|
|
|||
|
|
@ -414,6 +414,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
|
|||
|
||||
exit_probe:
|
||||
dw_i2c_plat_pm_cleanup(dev);
|
||||
i2c_dw_prepare_clk(dev, false);
|
||||
exit_reset:
|
||||
reset_control_assert(dev->rst);
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -782,6 +782,7 @@ static int mtk_i2c_transfer(struct i2c_adapter *adap,
|
|||
{
|
||||
int ret;
|
||||
int left_num = num;
|
||||
bool write_then_read_en = false;
|
||||
struct mtk_i2c *i2c = i2c_get_adapdata(adap);
|
||||
|
||||
ret = mtk_i2c_clock_enable(i2c);
|
||||
|
|
@ -795,6 +796,7 @@ static int mtk_i2c_transfer(struct i2c_adapter *adap,
|
|||
if (!(msgs[0].flags & I2C_M_RD) && (msgs[1].flags & I2C_M_RD) &&
|
||||
msgs[0].addr == msgs[1].addr) {
|
||||
i2c->auto_restart = 0;
|
||||
write_then_read_en = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -818,12 +820,10 @@ static int mtk_i2c_transfer(struct i2c_adapter *adap,
|
|||
else
|
||||
i2c->op = I2C_MASTER_WR;
|
||||
|
||||
if (!i2c->auto_restart) {
|
||||
if (num > 1) {
|
||||
/* combined two messages into one transaction */
|
||||
i2c->op = I2C_MASTER_WRRD;
|
||||
left_num--;
|
||||
}
|
||||
if (write_then_read_en) {
|
||||
/* combined two messages into one transaction */
|
||||
i2c->op = I2C_MASTER_WRRD;
|
||||
left_num--;
|
||||
}
|
||||
|
||||
/* always use DMA mode. */
|
||||
|
|
@ -831,7 +831,10 @@ static int mtk_i2c_transfer(struct i2c_adapter *adap,
|
|||
if (ret < 0)
|
||||
goto err_exit;
|
||||
|
||||
msgs++;
|
||||
if (i2c->op == I2C_MASTER_WRRD)
|
||||
msgs += 2;
|
||||
else
|
||||
msgs++;
|
||||
}
|
||||
/* the return value is number of executed messages */
|
||||
ret = num;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/completion.h>
|
||||
|
|
@ -29,9 +30,9 @@
|
|||
|
||||
/* Bit definitions for SPEAR_ADC_STATUS */
|
||||
#define SPEAR_ADC_STATUS_START_CONVERSION BIT(0)
|
||||
#define SPEAR_ADC_STATUS_CHANNEL_NUM(x) ((x) << 1)
|
||||
#define SPEAR_ADC_STATUS_CHANNEL_NUM_MASK GENMASK(3, 1)
|
||||
#define SPEAR_ADC_STATUS_ADC_ENABLE BIT(4)
|
||||
#define SPEAR_ADC_STATUS_AVG_SAMPLE(x) ((x) << 5)
|
||||
#define SPEAR_ADC_STATUS_AVG_SAMPLE_MASK GENMASK(8, 5)
|
||||
#define SPEAR_ADC_STATUS_VREF_INTERNAL BIT(9)
|
||||
|
||||
#define SPEAR_ADC_DATA_MASK 0x03ff
|
||||
|
|
@ -148,8 +149,8 @@ static int spear_adc_read_raw(struct iio_dev *indio_dev,
|
|||
case IIO_CHAN_INFO_RAW:
|
||||
mutex_lock(&indio_dev->mlock);
|
||||
|
||||
status = SPEAR_ADC_STATUS_CHANNEL_NUM(chan->channel) |
|
||||
SPEAR_ADC_STATUS_AVG_SAMPLE(st->avg_samples) |
|
||||
status = FIELD_PREP(SPEAR_ADC_STATUS_CHANNEL_NUM_MASK, chan->channel) |
|
||||
FIELD_PREP(SPEAR_ADC_STATUS_AVG_SAMPLE_MASK, st->avg_samples) |
|
||||
SPEAR_ADC_STATUS_START_CONVERSION |
|
||||
SPEAR_ADC_STATUS_ADC_ENABLE;
|
||||
if (st->vref_external == 0)
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ static int ad5360_update_ctrl(struct iio_dev *indio_dev, unsigned int set,
|
|||
unsigned int clr)
|
||||
{
|
||||
struct ad5360_state *st = iio_priv(indio_dev);
|
||||
unsigned int ret;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&indio_dev->mlock);
|
||||
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ static int ad5421_update_ctrl(struct iio_dev *indio_dev, unsigned int set,
|
|||
unsigned int clr)
|
||||
{
|
||||
struct ad5421_state *st = iio_priv(indio_dev);
|
||||
unsigned int ret;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&indio_dev->mlock);
|
||||
|
||||
|
|
|
|||
|
|
@ -137,6 +137,19 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq)
|
|||
if (freq > ADF4350_MAX_OUT_FREQ || freq < st->min_out_freq)
|
||||
return -EINVAL;
|
||||
|
||||
st->r4_rf_div_sel = 0;
|
||||
|
||||
/*
|
||||
* !\TODO: The below computation is making sure we get a power of 2
|
||||
* shift (st->r4_rf_div_sel) so that freq becomes higher or equal to
|
||||
* ADF4350_MIN_VCO_FREQ. This might be simplified with fls()/fls_long()
|
||||
* and friends.
|
||||
*/
|
||||
while (freq < ADF4350_MIN_VCO_FREQ) {
|
||||
freq <<= 1;
|
||||
st->r4_rf_div_sel++;
|
||||
}
|
||||
|
||||
if (freq > ADF4350_MAX_FREQ_45_PRESC) {
|
||||
prescaler = ADF4350_REG1_PRESCALER;
|
||||
mdiv = 75;
|
||||
|
|
@ -145,13 +158,6 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq)
|
|||
mdiv = 23;
|
||||
}
|
||||
|
||||
st->r4_rf_div_sel = 0;
|
||||
|
||||
while (freq < ADF4350_MIN_VCO_FREQ) {
|
||||
freq <<= 1;
|
||||
st->r4_rf_div_sel++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allow a predefined reference division factor
|
||||
* if not set, compute our own
|
||||
|
|
|
|||
|
|
@ -627,7 +627,7 @@ static int iio_convert_raw_to_processed_unlocked(struct iio_channel *chan,
|
|||
* If no channel scaling is available apply consumer scale to
|
||||
* raw value and return.
|
||||
*/
|
||||
*processed = raw * scale;
|
||||
*processed = raw64 * scale;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -459,14 +459,10 @@ static int addr_resolve_neigh(const struct dst_entry *dst,
|
|||
{
|
||||
int ret = 0;
|
||||
|
||||
if (ndev_flags & IFF_LOOPBACK) {
|
||||
if (ndev_flags & IFF_LOOPBACK)
|
||||
memcpy(addr->dst_dev_addr, addr->src_dev_addr, MAX_ADDR_LEN);
|
||||
} else {
|
||||
if (!(ndev_flags & IFF_NOARP)) {
|
||||
/* If the device doesn't do ARP internally */
|
||||
ret = fetch_ha(dst, addr, dst_in, seq);
|
||||
}
|
||||
}
|
||||
else
|
||||
ret = fetch_ha(dst, addr, dst_in, seq);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1036,6 +1036,8 @@ int ib_nl_handle_set_timeout(struct sk_buff *skb,
|
|||
if (timeout > IB_SA_LOCAL_SVC_TIMEOUT_MAX)
|
||||
timeout = IB_SA_LOCAL_SVC_TIMEOUT_MAX;
|
||||
|
||||
spin_lock_irqsave(&ib_nl_request_lock, flags);
|
||||
|
||||
delta = timeout - sa_local_svc_timeout_ms;
|
||||
if (delta < 0)
|
||||
abs_delta = -delta;
|
||||
|
|
@ -1043,7 +1045,6 @@ int ib_nl_handle_set_timeout(struct sk_buff *skb,
|
|||
abs_delta = delta;
|
||||
|
||||
if (delta != 0) {
|
||||
spin_lock_irqsave(&ib_nl_request_lock, flags);
|
||||
sa_local_svc_timeout_ms = timeout;
|
||||
list_for_each_entry(query, &ib_nl_request_list, list) {
|
||||
if (delta < 0 && abs_delta > query->timeout)
|
||||
|
|
@ -1061,9 +1062,10 @@ int ib_nl_handle_set_timeout(struct sk_buff *skb,
|
|||
if (delay)
|
||||
mod_delayed_work(ib_nl_wq, &ib_nl_timed_work,
|
||||
(unsigned long)delay);
|
||||
spin_unlock_irqrestore(&ib_nl_request_lock, flags);
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&ib_nl_request_lock, flags);
|
||||
|
||||
settimeout_out:
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -779,7 +779,7 @@ int siw_post_send(struct ib_qp *base_qp, const struct ib_send_wr *wr,
|
|||
struct siw_wqe *wqe = tx_wqe(qp);
|
||||
|
||||
unsigned long flags;
|
||||
int rv = 0;
|
||||
int rv = 0, imm_err = 0;
|
||||
|
||||
if (wr && !qp->kernel_verbs) {
|
||||
siw_dbg_qp(qp, "wr must be empty for user mapped sq\n");
|
||||
|
|
@ -965,9 +965,17 @@ int siw_post_send(struct ib_qp *base_qp, const struct ib_send_wr *wr,
|
|||
* Send directly if SQ processing is not in progress.
|
||||
* Eventual immediate errors (rv < 0) do not affect the involved
|
||||
* RI resources (Verbs, 8.3.1) and thus do not prevent from SQ
|
||||
* processing, if new work is already pending. But rv must be passed
|
||||
* to caller.
|
||||
* processing, if new work is already pending. But rv and pointer
|
||||
* to failed work request must be passed to caller.
|
||||
*/
|
||||
if (unlikely(rv < 0)) {
|
||||
/*
|
||||
* Immediate error
|
||||
*/
|
||||
siw_dbg_qp(qp, "Immediate error %d\n", rv);
|
||||
imm_err = rv;
|
||||
*bad_wr = wr;
|
||||
}
|
||||
if (wqe->wr_status != SIW_WR_IDLE) {
|
||||
spin_unlock_irqrestore(&qp->sq_lock, flags);
|
||||
goto skip_direct_sending;
|
||||
|
|
@ -992,15 +1000,10 @@ skip_direct_sending:
|
|||
|
||||
up_read(&qp->state_lock);
|
||||
|
||||
if (rv >= 0)
|
||||
return 0;
|
||||
/*
|
||||
* Immediate error
|
||||
*/
|
||||
siw_dbg_qp(qp, "error %d\n", rv);
|
||||
if (unlikely(imm_err))
|
||||
return imm_err;
|
||||
|
||||
*bad_wr = wr;
|
||||
return rv;
|
||||
return (rv >= 0) ? 0 : rv;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -244,6 +244,12 @@ static int cros_ec_keyb_work(struct notifier_block *nb,
|
|||
case EC_MKBP_EVENT_KEY_MATRIX:
|
||||
pm_wakeup_event(ckdev->dev, 0);
|
||||
|
||||
if (!ckdev->idev) {
|
||||
dev_warn_once(ckdev->dev,
|
||||
"Unexpected key matrix event\n");
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
if (ckdev->ec->event_size != ckdev->cols) {
|
||||
dev_err(ckdev->dev,
|
||||
"Discarded incomplete key matrix event.\n");
|
||||
|
|
|
|||
|
|
@ -639,7 +639,7 @@ static int ati_remote2_urb_init(struct ati_remote2 *ar2)
|
|||
return -ENOMEM;
|
||||
|
||||
pipe = usb_rcvintpipe(udev, ar2->ep[i]->bEndpointAddress);
|
||||
maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
|
||||
maxp = usb_maxpacket(udev, pipe);
|
||||
maxp = maxp > 4 ? 4 : maxp;
|
||||
|
||||
usb_fill_int_urb(ar2->urb[i], udev, pipe, ar2->buf[i], maxp,
|
||||
|
|
|
|||
|
|
@ -749,7 +749,7 @@ static int cm109_usb_probe(struct usb_interface *intf,
|
|||
|
||||
/* get a handle to the interrupt data pipe */
|
||||
pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
|
||||
ret = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
|
||||
ret = usb_maxpacket(udev, pipe);
|
||||
if (ret != USB_PKT_LEN)
|
||||
dev_err(&intf->dev, "invalid payload size %d, expected %d\n",
|
||||
ret, USB_PKT_LEN);
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i
|
|||
|
||||
/* get a handle to the interrupt data pipe */
|
||||
pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
|
||||
maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
|
||||
maxp = usb_maxpacket(udev, pipe);
|
||||
|
||||
if (maxp < POWERMATE_PAYLOAD_SIZE_MIN || maxp > POWERMATE_PAYLOAD_SIZE_MAX) {
|
||||
printk(KERN_WARNING "powermate: Expected payload of %d--%d bytes, found %d bytes!\n",
|
||||
|
|
|
|||
|
|
@ -774,6 +774,7 @@ static int uinput_ff_upload_to_user(char __user *buffer,
|
|||
if (in_compat_syscall()) {
|
||||
struct uinput_ff_upload_compat ff_up_compat;
|
||||
|
||||
memset(&ff_up_compat, 0, sizeof(ff_up_compat));
|
||||
ff_up_compat.request_id = ff_up->request_id;
|
||||
ff_up_compat.retval = ff_up->retval;
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -905,7 +905,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
|||
|
||||
/* get a handle to the interrupt data pipe */
|
||||
pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
|
||||
ret = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
|
||||
ret = usb_maxpacket(udev, pipe);
|
||||
if (ret != USB_PKT_LEN)
|
||||
dev_err(&intf->dev, "invalid payload size %d, expected %zd\n",
|
||||
ret, USB_PKT_LEN);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue