mirror of
https://github.com/armbian/build.git
synced 2025-08-15 23:56:57 +02:00
6084 lines
202 KiB
Diff
6084 lines
202 KiB
Diff
diff --git a/Makefile b/Makefile
|
||
index bca0f2e14c5c2f..59060f58cfeff1 100644
|
||
--- a/Makefile
|
||
+++ b/Makefile
|
||
@@ -1,7 +1,7 @@
|
||
# SPDX-License-Identifier: GPL-2.0
|
||
VERSION = 6
|
||
PATCHLEVEL = 6
|
||
-SUBLEVEL = 82
|
||
+SUBLEVEL = 83
|
||
EXTRAVERSION =
|
||
NAME = Pinguïn Aangedreven
|
||
|
||
@@ -1057,6 +1057,11 @@ endif
|
||
KBUILD_USERCFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
|
||
KBUILD_USERLDFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
|
||
|
||
+# userspace programs are linked via the compiler, use the correct linker
|
||
+ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_LD_IS_LLD),yy)
|
||
+KBUILD_USERLDFLAGS += $(call cc-option, --ld-path=$(LD))
|
||
+endif
|
||
+
|
||
# make the checker run with the right architecture
|
||
CHECKFLAGS += --arch=$(ARCH)
|
||
|
||
diff --git a/arch/arm64/boot/dts/rockchip/px30-ringneck-haikou.dts b/arch/arm64/boot/dts/rockchip/px30-ringneck-haikou.dts
|
||
index de0a1f2af983be..56f73c17363fd0 100644
|
||
--- a/arch/arm64/boot/dts/rockchip/px30-ringneck-haikou.dts
|
||
+++ b/arch/arm64/boot/dts/rockchip/px30-ringneck-haikou.dts
|
||
@@ -226,6 +226,7 @@ &uart0 {
|
||
|
||
&uart5 {
|
||
pinctrl-0 = <&uart5_xfer>;
|
||
+ rts-gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
|
||
status = "okay";
|
||
};
|
||
|
||
diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
|
||
index 2ddc33d93b13b2..92a5e0879b1111 100644
|
||
--- a/arch/arm64/include/asm/hugetlb.h
|
||
+++ b/arch/arm64/include/asm/hugetlb.h
|
||
@@ -34,8 +34,8 @@ extern int huge_ptep_set_access_flags(struct vm_area_struct *vma,
|
||
unsigned long addr, pte_t *ptep,
|
||
pte_t pte, int dirty);
|
||
#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
|
||
-extern pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
|
||
- unsigned long addr, pte_t *ptep);
|
||
+extern pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
|
||
+ pte_t *ptep, unsigned long sz);
|
||
#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
|
||
extern void huge_ptep_set_wrprotect(struct mm_struct *mm,
|
||
unsigned long addr, pte_t *ptep);
|
||
diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
|
||
index a5e1588780b2ce..06efc3a1652eb5 100644
|
||
--- a/arch/arm64/mm/hugetlbpage.c
|
||
+++ b/arch/arm64/mm/hugetlbpage.c
|
||
@@ -121,20 +121,11 @@ static int find_num_contig(struct mm_struct *mm, unsigned long addr,
|
||
|
||
static inline int num_contig_ptes(unsigned long size, size_t *pgsize)
|
||
{
|
||
- int contig_ptes = 0;
|
||
+ int contig_ptes = 1;
|
||
|
||
*pgsize = size;
|
||
|
||
switch (size) {
|
||
-#ifndef __PAGETABLE_PMD_FOLDED
|
||
- case PUD_SIZE:
|
||
- if (pud_sect_supported())
|
||
- contig_ptes = 1;
|
||
- break;
|
||
-#endif
|
||
- case PMD_SIZE:
|
||
- contig_ptes = 1;
|
||
- break;
|
||
case CONT_PMD_SIZE:
|
||
*pgsize = PMD_SIZE;
|
||
contig_ptes = CONT_PMDS;
|
||
@@ -143,6 +134,8 @@ static inline int num_contig_ptes(unsigned long size, size_t *pgsize)
|
||
*pgsize = PAGE_SIZE;
|
||
contig_ptes = CONT_PTES;
|
||
break;
|
||
+ default:
|
||
+ WARN_ON(!__hugetlb_valid_size(size));
|
||
}
|
||
|
||
return contig_ptes;
|
||
@@ -184,24 +177,23 @@ static pte_t get_clear_contig(struct mm_struct *mm,
|
||
unsigned long pgsize,
|
||
unsigned long ncontig)
|
||
{
|
||
- pte_t orig_pte = ptep_get(ptep);
|
||
- unsigned long i;
|
||
-
|
||
- for (i = 0; i < ncontig; i++, addr += pgsize, ptep++) {
|
||
- pte_t pte = ptep_get_and_clear(mm, addr, ptep);
|
||
-
|
||
- /*
|
||
- * If HW_AFDBM is enabled, then the HW could turn on
|
||
- * the dirty or accessed bit for any page in the set,
|
||
- * so check them all.
|
||
- */
|
||
- if (pte_dirty(pte))
|
||
- orig_pte = pte_mkdirty(orig_pte);
|
||
-
|
||
- if (pte_young(pte))
|
||
- orig_pte = pte_mkyoung(orig_pte);
|
||
+ pte_t pte, tmp_pte;
|
||
+ bool present;
|
||
+
|
||
+ pte = ptep_get_and_clear(mm, addr, ptep);
|
||
+ present = pte_present(pte);
|
||
+ while (--ncontig) {
|
||
+ ptep++;
|
||
+ addr += pgsize;
|
||
+ tmp_pte = ptep_get_and_clear(mm, addr, ptep);
|
||
+ if (present) {
|
||
+ if (pte_dirty(tmp_pte))
|
||
+ pte = pte_mkdirty(pte);
|
||
+ if (pte_young(tmp_pte))
|
||
+ pte = pte_mkyoung(pte);
|
||
+ }
|
||
}
|
||
- return orig_pte;
|
||
+ return pte;
|
||
}
|
||
|
||
static pte_t get_clear_contig_flush(struct mm_struct *mm,
|
||
@@ -403,18 +395,13 @@ void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
|
||
pte_clear(mm, addr, ptep);
|
||
}
|
||
|
||
-pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
|
||
- unsigned long addr, pte_t *ptep)
|
||
+pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
|
||
+ pte_t *ptep, unsigned long sz)
|
||
{
|
||
int ncontig;
|
||
size_t pgsize;
|
||
- pte_t orig_pte = ptep_get(ptep);
|
||
-
|
||
- if (!pte_cont(orig_pte))
|
||
- return ptep_get_and_clear(mm, addr, ptep);
|
||
-
|
||
- ncontig = find_num_contig(mm, addr, ptep, &pgsize);
|
||
|
||
+ ncontig = num_contig_ptes(sz, &pgsize);
|
||
return get_clear_contig(mm, addr, ptep, pgsize, ncontig);
|
||
}
|
||
|
||
@@ -556,6 +543,8 @@ bool __init arch_hugetlb_valid_size(unsigned long size)
|
||
|
||
pte_t huge_ptep_modify_prot_start(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
|
||
{
|
||
+ unsigned long psize = huge_page_size(hstate_vma(vma));
|
||
+
|
||
if (IS_ENABLED(CONFIG_ARM64_ERRATUM_2645198) &&
|
||
cpus_have_const_cap(ARM64_WORKAROUND_2645198)) {
|
||
/*
|
||
@@ -566,7 +555,7 @@ pte_t huge_ptep_modify_prot_start(struct vm_area_struct *vma, unsigned long addr
|
||
if (pte_user_exec(READ_ONCE(*ptep)))
|
||
return huge_ptep_clear_flush(vma, addr, ptep);
|
||
}
|
||
- return huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
|
||
+ return huge_ptep_get_and_clear(vma->vm_mm, addr, ptep, psize);
|
||
}
|
||
|
||
void huge_ptep_modify_prot_commit(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep,
|
||
diff --git a/arch/loongarch/include/asm/hugetlb.h b/arch/loongarch/include/asm/hugetlb.h
|
||
index 427b487fbfd658..7b88eda0ac7e84 100644
|
||
--- a/arch/loongarch/include/asm/hugetlb.h
|
||
+++ b/arch/loongarch/include/asm/hugetlb.h
|
||
@@ -41,7 +41,8 @@ static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
|
||
|
||
#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
|
||
static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
|
||
- unsigned long addr, pte_t *ptep)
|
||
+ unsigned long addr, pte_t *ptep,
|
||
+ unsigned long sz)
|
||
{
|
||
pte_t clear;
|
||
pte_t pte = *ptep;
|
||
@@ -56,8 +57,9 @@ static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
|
||
unsigned long addr, pte_t *ptep)
|
||
{
|
||
pte_t pte;
|
||
+ unsigned long sz = huge_page_size(hstate_vma(vma));
|
||
|
||
- pte = huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
|
||
+ pte = huge_ptep_get_and_clear(vma->vm_mm, addr, ptep, sz);
|
||
flush_tlb_page(vma, addr);
|
||
return pte;
|
||
}
|
||
diff --git a/arch/loongarch/kernel/machine_kexec.c b/arch/loongarch/kernel/machine_kexec.c
|
||
index 2dcb9e003657c8..30aa420610a06a 100644
|
||
--- a/arch/loongarch/kernel/machine_kexec.c
|
||
+++ b/arch/loongarch/kernel/machine_kexec.c
|
||
@@ -126,14 +126,14 @@ void kexec_reboot(void)
|
||
/* All secondary cpus go to kexec_smp_wait */
|
||
if (smp_processor_id() > 0) {
|
||
relocated_kexec_smp_wait(NULL);
|
||
- unreachable();
|
||
+ BUG();
|
||
}
|
||
#endif
|
||
|
||
do_kexec = (void *)reboot_code_buffer;
|
||
do_kexec(efi_boot, cmdline_ptr, systable_ptr, start_addr, first_ind_entry);
|
||
|
||
- unreachable();
|
||
+ BUG();
|
||
}
|
||
|
||
|
||
diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c
|
||
index 7ef1c1ff1fc44c..655dc2b1616f2c 100644
|
||
--- a/arch/loongarch/kernel/setup.c
|
||
+++ b/arch/loongarch/kernel/setup.c
|
||
@@ -400,6 +400,9 @@ static void __init check_kernel_sections_mem(void)
|
||
*/
|
||
static void __init arch_mem_init(char **cmdline_p)
|
||
{
|
||
+ /* Recalculate max_low_pfn for "mem=xxx" */
|
||
+ max_pfn = max_low_pfn = PHYS_PFN(memblock_end_of_DRAM());
|
||
+
|
||
if (usermem)
|
||
pr_info("User-defined physical RAM map overwrite\n");
|
||
|
||
diff --git a/arch/loongarch/kernel/smp.c b/arch/loongarch/kernel/smp.c
|
||
index 9dbe7907a96124..ed67629454374f 100644
|
||
--- a/arch/loongarch/kernel/smp.c
|
||
+++ b/arch/loongarch/kernel/smp.c
|
||
@@ -18,6 +18,7 @@
|
||
#include <linux/smp.h>
|
||
#include <linux/threads.h>
|
||
#include <linux/export.h>
|
||
+#include <linux/suspend.h>
|
||
#include <linux/syscore_ops.h>
|
||
#include <linux/time.h>
|
||
#include <linux/tracepoint.h>
|
||
@@ -388,7 +389,7 @@ void loongson_cpu_die(unsigned int cpu)
|
||
mb();
|
||
}
|
||
|
||
-void __noreturn arch_cpu_idle_dead(void)
|
||
+static void __noreturn idle_play_dead(void)
|
||
{
|
||
register uint64_t addr;
|
||
register void (*init_fn)(void);
|
||
@@ -412,6 +413,50 @@ void __noreturn arch_cpu_idle_dead(void)
|
||
BUG();
|
||
}
|
||
|
||
+#ifdef CONFIG_HIBERNATION
|
||
+static void __noreturn poll_play_dead(void)
|
||
+{
|
||
+ register uint64_t addr;
|
||
+ register void (*init_fn)(void);
|
||
+
|
||
+ idle_task_exit();
|
||
+ __this_cpu_write(cpu_state, CPU_DEAD);
|
||
+
|
||
+ __smp_mb();
|
||
+ do {
|
||
+ __asm__ __volatile__("nop\n\t");
|
||
+ addr = iocsr_read64(LOONGARCH_IOCSR_MBUF0);
|
||
+ } while (addr == 0);
|
||
+
|
||
+ init_fn = (void *)TO_CACHE(addr);
|
||
+ iocsr_write32(0xffffffff, LOONGARCH_IOCSR_IPI_CLEAR);
|
||
+
|
||
+ init_fn();
|
||
+ BUG();
|
||
+}
|
||
+#endif
|
||
+
|
||
+static void (*play_dead)(void) = idle_play_dead;
|
||
+
|
||
+void __noreturn arch_cpu_idle_dead(void)
|
||
+{
|
||
+ play_dead();
|
||
+ BUG(); /* play_dead() doesn't return */
|
||
+}
|
||
+
|
||
+#ifdef CONFIG_HIBERNATION
|
||
+int hibernate_resume_nonboot_cpu_disable(void)
|
||
+{
|
||
+ int ret;
|
||
+
|
||
+ play_dead = poll_play_dead;
|
||
+ ret = suspend_disable_secondary_cpus();
|
||
+ play_dead = idle_play_dead;
|
||
+
|
||
+ return ret;
|
||
+}
|
||
+#endif
|
||
+
|
||
#endif
|
||
|
||
/*
|
||
diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
|
||
index fd69c88085542e..00ee3c0366305c 100644
|
||
--- a/arch/mips/include/asm/hugetlb.h
|
||
+++ b/arch/mips/include/asm/hugetlb.h
|
||
@@ -32,7 +32,8 @@ static inline int prepare_hugepage_range(struct file *file,
|
||
|
||
#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
|
||
static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
|
||
- unsigned long addr, pte_t *ptep)
|
||
+ unsigned long addr, pte_t *ptep,
|
||
+ unsigned long sz)
|
||
{
|
||
pte_t clear;
|
||
pte_t pte = *ptep;
|
||
@@ -47,13 +48,14 @@ static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
|
||
unsigned long addr, pte_t *ptep)
|
||
{
|
||
pte_t pte;
|
||
+ unsigned long sz = huge_page_size(hstate_vma(vma));
|
||
|
||
/*
|
||
* clear the huge pte entry firstly, so that the other smp threads will
|
||
* not get old pte entry after finishing flush_tlb_page and before
|
||
* setting new huge pte entry
|
||
*/
|
||
- pte = huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
|
||
+ pte = huge_ptep_get_and_clear(vma->vm_mm, addr, ptep, sz);
|
||
flush_tlb_page(vma, addr);
|
||
return pte;
|
||
}
|
||
diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h
|
||
index 72daacc472a0a3..f7a91411dcc955 100644
|
||
--- a/arch/parisc/include/asm/hugetlb.h
|
||
+++ b/arch/parisc/include/asm/hugetlb.h
|
||
@@ -10,7 +10,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
|
||
|
||
#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
|
||
pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
|
||
- pte_t *ptep);
|
||
+ pte_t *ptep, unsigned long sz);
|
||
|
||
/*
|
||
* If the arch doesn't supply something else, assume that hugepage
|
||
diff --git a/arch/parisc/mm/hugetlbpage.c b/arch/parisc/mm/hugetlbpage.c
|
||
index a9f7e21f66567a..9e8da00e55f611 100644
|
||
--- a/arch/parisc/mm/hugetlbpage.c
|
||
+++ b/arch/parisc/mm/hugetlbpage.c
|
||
@@ -147,7 +147,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
|
||
|
||
|
||
pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
|
||
- pte_t *ptep)
|
||
+ pte_t *ptep, unsigned long sz)
|
||
{
|
||
pte_t entry;
|
||
|
||
diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
|
||
index 8d8f4909ae1a4a..167c66c4e9ea74 100644
|
||
--- a/arch/powerpc/include/asm/hugetlb.h
|
||
+++ b/arch/powerpc/include/asm/hugetlb.h
|
||
@@ -46,7 +46,8 @@ void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
|
||
|
||
#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
|
||
static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
|
||
- unsigned long addr, pte_t *ptep)
|
||
+ unsigned long addr, pte_t *ptep,
|
||
+ unsigned long sz)
|
||
{
|
||
return __pte(pte_update(mm, addr, ptep, ~0UL, 0, 1));
|
||
}
|
||
@@ -56,8 +57,9 @@ static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
|
||
unsigned long addr, pte_t *ptep)
|
||
{
|
||
pte_t pte;
|
||
+ unsigned long sz = huge_page_size(hstate_vma(vma));
|
||
|
||
- pte = huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
|
||
+ pte = huge_ptep_get_and_clear(vma->vm_mm, addr, ptep, sz);
|
||
flush_hugetlb_page(vma, addr);
|
||
return pte;
|
||
}
|
||
diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
|
||
index bd413dafbaf969..ccb8f16ffe412f 100644
|
||
--- a/arch/powerpc/kvm/e500_mmu_host.c
|
||
+++ b/arch/powerpc/kvm/e500_mmu_host.c
|
||
@@ -242,7 +242,7 @@ static inline int tlbe_is_writable(struct kvm_book3e_206_tlb_entry *tlbe)
|
||
return tlbe->mas7_3 & (MAS3_SW|MAS3_UW);
|
||
}
|
||
|
||
-static inline bool kvmppc_e500_ref_setup(struct tlbe_ref *ref,
|
||
+static inline void kvmppc_e500_ref_setup(struct tlbe_ref *ref,
|
||
struct kvm_book3e_206_tlb_entry *gtlbe,
|
||
kvm_pfn_t pfn, unsigned int wimg)
|
||
{
|
||
@@ -252,7 +252,11 @@ static inline bool kvmppc_e500_ref_setup(struct tlbe_ref *ref,
|
||
/* Use guest supplied MAS2_G and MAS2_E */
|
||
ref->flags |= (gtlbe->mas2 & MAS2_ATTRIB_MASK) | wimg;
|
||
|
||
- return tlbe_is_writable(gtlbe);
|
||
+ /* Mark the page accessed */
|
||
+ kvm_set_pfn_accessed(pfn);
|
||
+
|
||
+ if (tlbe_is_writable(gtlbe))
|
||
+ kvm_set_pfn_dirty(pfn);
|
||
}
|
||
|
||
static inline void kvmppc_e500_ref_release(struct tlbe_ref *ref)
|
||
@@ -322,7 +326,6 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
|
||
{
|
||
struct kvm_memory_slot *slot;
|
||
unsigned long pfn = 0; /* silence GCC warning */
|
||
- struct page *page = NULL;
|
||
unsigned long hva;
|
||
int pfnmap = 0;
|
||
int tsize = BOOK3E_PAGESZ_4K;
|
||
@@ -334,7 +337,6 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
|
||
unsigned int wimg = 0;
|
||
pgd_t *pgdir;
|
||
unsigned long flags;
|
||
- bool writable = false;
|
||
|
||
/* used to check for invalidations in progress */
|
||
mmu_seq = kvm->mmu_invalidate_seq;
|
||
@@ -444,7 +446,7 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
|
||
|
||
if (likely(!pfnmap)) {
|
||
tsize_pages = 1UL << (tsize + 10 - PAGE_SHIFT);
|
||
- pfn = __kvm_faultin_pfn(slot, gfn, FOLL_WRITE, NULL, &page);
|
||
+ pfn = gfn_to_pfn_memslot(slot, gfn);
|
||
if (is_error_noslot_pfn(pfn)) {
|
||
if (printk_ratelimit())
|
||
pr_err("%s: real page not found for gfn %lx\n",
|
||
@@ -479,6 +481,7 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
|
||
if (pte_present(pte)) {
|
||
wimg = (pte_val(pte) >> PTE_WIMGE_SHIFT) &
|
||
MAS2_WIMGE_MASK;
|
||
+ local_irq_restore(flags);
|
||
} else {
|
||
local_irq_restore(flags);
|
||
pr_err_ratelimited("%s: pte not present: gfn %lx,pfn %lx\n",
|
||
@@ -487,9 +490,8 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
|
||
goto out;
|
||
}
|
||
}
|
||
- local_irq_restore(flags);
|
||
+ kvmppc_e500_ref_setup(ref, gtlbe, pfn, wimg);
|
||
|
||
- writable = kvmppc_e500_ref_setup(ref, gtlbe, pfn, wimg);
|
||
kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize,
|
||
ref, gvaddr, stlbe);
|
||
|
||
@@ -497,8 +499,11 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
|
||
kvmppc_mmu_flush_icache(pfn);
|
||
|
||
out:
|
||
- kvm_release_faultin_page(kvm, page, !!ret, writable);
|
||
spin_unlock(&kvm->mmu_lock);
|
||
+
|
||
+ /* Drop refcount on page, so that mmu notifiers can clear it */
|
||
+ kvm_release_pfn_clean(pfn);
|
||
+
|
||
return ret;
|
||
}
|
||
|
||
diff --git a/arch/riscv/include/asm/cpufeature.h b/arch/riscv/include/asm/cpufeature.h
|
||
index d0345bd659c94f..13b7d35648a9c5 100644
|
||
--- a/arch/riscv/include/asm/cpufeature.h
|
||
+++ b/arch/riscv/include/asm/cpufeature.h
|
||
@@ -31,5 +31,6 @@ DECLARE_PER_CPU(long, misaligned_access_speed);
|
||
extern struct riscv_isainfo hart_isa[NR_CPUS];
|
||
|
||
void check_unaligned_access(int cpu);
|
||
+void riscv_user_isa_enable(void);
|
||
|
||
#endif
|
||
diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h
|
||
index 777cb8299551ca..4b61a033fd33df 100644
|
||
--- a/arch/riscv/include/asm/csr.h
|
||
+++ b/arch/riscv/include/asm/csr.h
|
||
@@ -275,6 +275,7 @@
|
||
#define CSR_SIE 0x104
|
||
#define CSR_STVEC 0x105
|
||
#define CSR_SCOUNTEREN 0x106
|
||
+#define CSR_SENVCFG 0x10a
|
||
#define CSR_SSCRATCH 0x140
|
||
#define CSR_SEPC 0x141
|
||
#define CSR_SCAUSE 0x142
|
||
@@ -397,6 +398,7 @@
|
||
# define CSR_STATUS CSR_MSTATUS
|
||
# define CSR_IE CSR_MIE
|
||
# define CSR_TVEC CSR_MTVEC
|
||
+# define CSR_ENVCFG CSR_MENVCFG
|
||
# define CSR_SCRATCH CSR_MSCRATCH
|
||
# define CSR_EPC CSR_MEPC
|
||
# define CSR_CAUSE CSR_MCAUSE
|
||
@@ -421,6 +423,7 @@
|
||
# define CSR_STATUS CSR_SSTATUS
|
||
# define CSR_IE CSR_SIE
|
||
# define CSR_TVEC CSR_STVEC
|
||
+# define CSR_ENVCFG CSR_SENVCFG
|
||
# define CSR_SCRATCH CSR_SSCRATCH
|
||
# define CSR_EPC CSR_SEPC
|
||
# define CSR_CAUSE CSR_SCAUSE
|
||
diff --git a/arch/riscv/include/asm/hugetlb.h b/arch/riscv/include/asm/hugetlb.h
|
||
index 22deb7a2a6ec4e..0e809026b6e39c 100644
|
||
--- a/arch/riscv/include/asm/hugetlb.h
|
||
+++ b/arch/riscv/include/asm/hugetlb.h
|
||
@@ -28,7 +28,8 @@ void set_huge_pte_at(struct mm_struct *mm,
|
||
|
||
#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
|
||
pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
|
||
- unsigned long addr, pte_t *ptep);
|
||
+ unsigned long addr, pte_t *ptep,
|
||
+ unsigned long sz);
|
||
|
||
#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
|
||
pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
|
||
diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h
|
||
index f4157034efa9cb..e215d3399a1791 100644
|
||
--- a/arch/riscv/include/asm/hwcap.h
|
||
+++ b/arch/riscv/include/asm/hwcap.h
|
||
@@ -70,6 +70,7 @@
|
||
#ifndef __ASSEMBLY__
|
||
|
||
#include <linux/jump_label.h>
|
||
+#include <asm/cpufeature.h>
|
||
|
||
unsigned long riscv_get_elf_hwcap(void);
|
||
|
||
@@ -137,6 +138,21 @@ riscv_has_extension_unlikely(const unsigned long ext)
|
||
return true;
|
||
}
|
||
|
||
+static __always_inline bool riscv_cpu_has_extension_likely(int cpu, const unsigned long ext)
|
||
+{
|
||
+ if (IS_ENABLED(CONFIG_RISCV_ALTERNATIVE) && riscv_has_extension_likely(ext))
|
||
+ return true;
|
||
+
|
||
+ return __riscv_isa_extension_available(hart_isa[cpu].isa, ext);
|
||
+}
|
||
+
|
||
+static __always_inline bool riscv_cpu_has_extension_unlikely(int cpu, const unsigned long ext)
|
||
+{
|
||
+ if (IS_ENABLED(CONFIG_RISCV_ALTERNATIVE) && riscv_has_extension_unlikely(ext))
|
||
+ return true;
|
||
+
|
||
+ return __riscv_isa_extension_available(hart_isa[cpu].isa, ext);
|
||
+}
|
||
#endif
|
||
|
||
#endif /* _ASM_RISCV_HWCAP_H */
|
||
diff --git a/arch/riscv/kernel/cacheinfo.c b/arch/riscv/kernel/cacheinfo.c
|
||
index 09e9b88110d151..9fb97c9f9b0bee 100644
|
||
--- a/arch/riscv/kernel/cacheinfo.c
|
||
+++ b/arch/riscv/kernel/cacheinfo.c
|
||
@@ -3,6 +3,7 @@
|
||
* Copyright (C) 2017 SiFive
|
||
*/
|
||
|
||
+#include <linux/acpi.h>
|
||
#include <linux/cpu.h>
|
||
#include <linux/of.h>
|
||
#include <asm/cacheinfo.h>
|
||
@@ -64,7 +65,6 @@ uintptr_t get_cache_geometry(u32 level, enum cache_type type)
|
||
}
|
||
|
||
static void ci_leaf_init(struct cacheinfo *this_leaf,
|
||
- struct device_node *node,
|
||
enum cache_type type, unsigned int level)
|
||
{
|
||
this_leaf->level = level;
|
||
@@ -75,16 +75,40 @@ int populate_cache_leaves(unsigned int cpu)
|
||
{
|
||
struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
|
||
struct cacheinfo *this_leaf = this_cpu_ci->info_list;
|
||
- struct device_node *np = of_cpu_device_node_get(cpu);
|
||
- struct device_node *prev = NULL;
|
||
+ struct device_node *np, *prev;
|
||
int levels = 1, level = 1;
|
||
|
||
- if (of_property_read_bool(np, "cache-size"))
|
||
- ci_leaf_init(this_leaf++, np, CACHE_TYPE_UNIFIED, level);
|
||
- if (of_property_read_bool(np, "i-cache-size"))
|
||
- ci_leaf_init(this_leaf++, np, CACHE_TYPE_INST, level);
|
||
- if (of_property_read_bool(np, "d-cache-size"))
|
||
- ci_leaf_init(this_leaf++, np, CACHE_TYPE_DATA, level);
|
||
+ if (!acpi_disabled) {
|
||
+ int ret, fw_levels, split_levels;
|
||
+
|
||
+ ret = acpi_get_cache_info(cpu, &fw_levels, &split_levels);
|
||
+ if (ret)
|
||
+ return ret;
|
||
+
|
||
+ BUG_ON((split_levels > fw_levels) ||
|
||
+ (split_levels + fw_levels > this_cpu_ci->num_leaves));
|
||
+
|
||
+ for (; level <= this_cpu_ci->num_levels; level++) {
|
||
+ if (level <= split_levels) {
|
||
+ ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
|
||
+ ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
|
||
+ } else {
|
||
+ ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
|
||
+ }
|
||
+ }
|
||
+ return 0;
|
||
+ }
|
||
+
|
||
+ np = of_cpu_device_node_get(cpu);
|
||
+ if (!np)
|
||
+ return -ENOENT;
|
||
+
|
||
+ if (of_property_present(np, "cache-size"))
|
||
+ ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
|
||
+ if (of_property_present(np, "i-cache-size"))
|
||
+ ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
|
||
+ if (of_property_present(np, "d-cache-size"))
|
||
+ ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
|
||
|
||
prev = np;
|
||
while ((np = of_find_next_cache_node(np))) {
|
||
@@ -96,12 +120,12 @@ int populate_cache_leaves(unsigned int cpu)
|
||
break;
|
||
if (level <= levels)
|
||
break;
|
||
- if (of_property_read_bool(np, "cache-size"))
|
||
- ci_leaf_init(this_leaf++, np, CACHE_TYPE_UNIFIED, level);
|
||
- if (of_property_read_bool(np, "i-cache-size"))
|
||
- ci_leaf_init(this_leaf++, np, CACHE_TYPE_INST, level);
|
||
- if (of_property_read_bool(np, "d-cache-size"))
|
||
- ci_leaf_init(this_leaf++, np, CACHE_TYPE_DATA, level);
|
||
+ if (of_property_present(np, "cache-size"))
|
||
+ ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
|
||
+ if (of_property_present(np, "i-cache-size"))
|
||
+ ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
|
||
+ if (of_property_present(np, "d-cache-size"))
|
||
+ ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
|
||
levels = level;
|
||
}
|
||
of_node_put(np);
|
||
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
|
||
index bb5fb2b820a21e..3f0ad09e16500a 100644
|
||
--- a/arch/riscv/kernel/cpufeature.c
|
||
+++ b/arch/riscv/kernel/cpufeature.c
|
||
@@ -676,6 +676,12 @@ static int check_unaligned_access_boot_cpu(void)
|
||
|
||
arch_initcall(check_unaligned_access_boot_cpu);
|
||
|
||
+void riscv_user_isa_enable(void)
|
||
+{
|
||
+ if (riscv_cpu_has_extension_unlikely(smp_processor_id(), RISCV_ISA_EXT_ZICBOZ))
|
||
+ csr_set(CSR_ENVCFG, ENVCFG_CBZE);
|
||
+}
|
||
+
|
||
#ifdef CONFIG_RISCV_ALTERNATIVE
|
||
/*
|
||
* Alternative patch sites consider 48 bits when determining when to patch
|
||
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
|
||
index ff802d100a5715..175184b0592649 100644
|
||
--- a/arch/riscv/kernel/setup.c
|
||
+++ b/arch/riscv/kernel/setup.c
|
||
@@ -26,6 +26,7 @@
|
||
#include <asm/acpi.h>
|
||
#include <asm/alternative.h>
|
||
#include <asm/cacheflush.h>
|
||
+#include <asm/cpufeature.h>
|
||
#include <asm/cpu_ops.h>
|
||
#include <asm/early_ioremap.h>
|
||
#include <asm/pgtable.h>
|
||
@@ -305,12 +306,15 @@ void __init setup_arch(char **cmdline_p)
|
||
|
||
riscv_init_cbo_blocksizes();
|
||
riscv_fill_hwcap();
|
||
- init_rt_signal_env();
|
||
apply_boot_alternatives();
|
||
+ init_rt_signal_env();
|
||
+
|
||
if (IS_ENABLED(CONFIG_RISCV_ISA_ZICBOM) &&
|
||
riscv_isa_extension_available(NULL, ZICBOM))
|
||
riscv_noncoherent_supported();
|
||
riscv_set_dma_cache_alignment();
|
||
+
|
||
+ riscv_user_isa_enable();
|
||
}
|
||
|
||
static int __init topology_init(void)
|
||
diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c
|
||
index 1b8da4e40a4d6e..d1b0a6fc3adfc7 100644
|
||
--- a/arch/riscv/kernel/smpboot.c
|
||
+++ b/arch/riscv/kernel/smpboot.c
|
||
@@ -25,6 +25,8 @@
|
||
#include <linux/of.h>
|
||
#include <linux/sched/task_stack.h>
|
||
#include <linux/sched/mm.h>
|
||
+
|
||
+#include <asm/cpufeature.h>
|
||
#include <asm/cpu_ops.h>
|
||
#include <asm/cpufeature.h>
|
||
#include <asm/irq.h>
|
||
@@ -253,6 +255,8 @@ asmlinkage __visible void smp_callin(void)
|
||
elf_hwcap &= ~COMPAT_HWCAP_ISA_V;
|
||
}
|
||
|
||
+ riscv_user_isa_enable();
|
||
+
|
||
/*
|
||
* Remote TLB flushes are ignored while the CPU is offline, so emit
|
||
* a local TLB flush right now just in case.
|
||
diff --git a/arch/riscv/mm/hugetlbpage.c b/arch/riscv/mm/hugetlbpage.c
|
||
index 5ef2a6891158a6..c9d70dc310d59f 100644
|
||
--- a/arch/riscv/mm/hugetlbpage.c
|
||
+++ b/arch/riscv/mm/hugetlbpage.c
|
||
@@ -293,7 +293,7 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
|
||
|
||
pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
|
||
unsigned long addr,
|
||
- pte_t *ptep)
|
||
+ pte_t *ptep, unsigned long sz)
|
||
{
|
||
pte_t orig_pte = ptep_get(ptep);
|
||
int pte_num;
|
||
diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h
|
||
index deb198a610395b..097b388d4e6901 100644
|
||
--- a/arch/s390/include/asm/hugetlb.h
|
||
+++ b/arch/s390/include/asm/hugetlb.h
|
||
@@ -20,8 +20,15 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
|
||
void __set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
|
||
pte_t *ptep, pte_t pte);
|
||
pte_t huge_ptep_get(pte_t *ptep);
|
||
-pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
|
||
- unsigned long addr, pte_t *ptep);
|
||
+pte_t __huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
|
||
+ pte_t *ptep);
|
||
+
|
||
+static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
|
||
+ unsigned long addr, pte_t *ptep,
|
||
+ unsigned long sz)
|
||
+{
|
||
+ return __huge_ptep_get_and_clear(mm, addr, ptep);
|
||
+}
|
||
|
||
/*
|
||
* If the arch doesn't supply something else, assume that hugepage
|
||
@@ -57,7 +64,7 @@ static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
|
||
static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
|
||
unsigned long address, pte_t *ptep)
|
||
{
|
||
- return huge_ptep_get_and_clear(vma->vm_mm, address, ptep);
|
||
+ return __huge_ptep_get_and_clear(vma->vm_mm, address, ptep);
|
||
}
|
||
|
||
static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
|
||
@@ -66,7 +73,7 @@ static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
|
||
{
|
||
int changed = !pte_same(huge_ptep_get(ptep), pte);
|
||
if (changed) {
|
||
- huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
|
||
+ __huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
|
||
__set_huge_pte_at(vma->vm_mm, addr, ptep, pte);
|
||
}
|
||
return changed;
|
||
@@ -75,7 +82,7 @@ static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
|
||
static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
|
||
unsigned long addr, pte_t *ptep)
|
||
{
|
||
- pte_t pte = huge_ptep_get_and_clear(mm, addr, ptep);
|
||
+ pte_t pte = __huge_ptep_get_and_clear(mm, addr, ptep);
|
||
__set_huge_pte_at(mm, addr, ptep, pte_wrprotect(pte));
|
||
}
|
||
|
||
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
|
||
index 1d2aa448d1031c..bfedbd7fae3bc1 100644
|
||
--- a/arch/s390/kernel/traps.c
|
||
+++ b/arch/s390/kernel/traps.c
|
||
@@ -276,10 +276,10 @@ static void __init test_monitor_call(void)
|
||
return;
|
||
asm volatile(
|
||
" mc 0,0\n"
|
||
- "0: xgr %0,%0\n"
|
||
+ "0: lhi %[val],0\n"
|
||
"1:\n"
|
||
- EX_TABLE(0b,1b)
|
||
- : "+d" (val));
|
||
+ EX_TABLE(0b, 1b)
|
||
+ : [val] "+d" (val));
|
||
if (!val)
|
||
panic("Monitor call doesn't work!\n");
|
||
}
|
||
diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
|
||
index 763469e518eec8..5ebd730f1ffbbc 100644
|
||
--- a/arch/s390/mm/hugetlbpage.c
|
||
+++ b/arch/s390/mm/hugetlbpage.c
|
||
@@ -174,8 +174,8 @@ pte_t huge_ptep_get(pte_t *ptep)
|
||
return __rste_to_pte(pte_val(*ptep));
|
||
}
|
||
|
||
-pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
|
||
- unsigned long addr, pte_t *ptep)
|
||
+pte_t __huge_ptep_get_and_clear(struct mm_struct *mm,
|
||
+ unsigned long addr, pte_t *ptep)
|
||
{
|
||
pte_t pte = huge_ptep_get(ptep);
|
||
pmd_t *pmdp = (pmd_t *) ptep;
|
||
diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
|
||
index c714ca6a05aa04..e7a9cdd498dca6 100644
|
||
--- a/arch/sparc/include/asm/hugetlb.h
|
||
+++ b/arch/sparc/include/asm/hugetlb.h
|
||
@@ -20,7 +20,7 @@ void __set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
|
||
|
||
#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
|
||
pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
|
||
- pte_t *ptep);
|
||
+ pte_t *ptep, unsigned long sz);
|
||
|
||
#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
|
||
static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
|
||
diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
|
||
index b432500c13a5d8..8dad5d0995dcce 100644
|
||
--- a/arch/sparc/mm/hugetlbpage.c
|
||
+++ b/arch/sparc/mm/hugetlbpage.c
|
||
@@ -371,7 +371,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
|
||
}
|
||
|
||
pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
|
||
- pte_t *ptep)
|
||
+ pte_t *ptep, unsigned long sz)
|
||
{
|
||
unsigned int i, nptes, orig_shift, shift;
|
||
unsigned long size;
|
||
diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c
|
||
index 9caf89063e775e..55c98fdd67d2b7 100644
|
||
--- a/arch/x86/boot/compressed/acpi.c
|
||
+++ b/arch/x86/boot/compressed/acpi.c
|
||
@@ -30,13 +30,13 @@ __efi_get_rsdp_addr(unsigned long cfg_tbl_pa, unsigned int cfg_tbl_len)
|
||
* Search EFI system tables for RSDP. Preferred is ACPI_20_TABLE_GUID to
|
||
* ACPI_TABLE_GUID because it has more features.
|
||
*/
|
||
- rsdp_addr = efi_find_vendor_table(boot_params, cfg_tbl_pa, cfg_tbl_len,
|
||
+ rsdp_addr = efi_find_vendor_table(boot_params_ptr, cfg_tbl_pa, cfg_tbl_len,
|
||
ACPI_20_TABLE_GUID);
|
||
if (rsdp_addr)
|
||
return (acpi_physical_address)rsdp_addr;
|
||
|
||
/* No ACPI_20_TABLE_GUID found, fallback to ACPI_TABLE_GUID. */
|
||
- rsdp_addr = efi_find_vendor_table(boot_params, cfg_tbl_pa, cfg_tbl_len,
|
||
+ rsdp_addr = efi_find_vendor_table(boot_params_ptr, cfg_tbl_pa, cfg_tbl_len,
|
||
ACPI_TABLE_GUID);
|
||
if (rsdp_addr)
|
||
return (acpi_physical_address)rsdp_addr;
|
||
@@ -56,15 +56,15 @@ static acpi_physical_address efi_get_rsdp_addr(void)
|
||
enum efi_type et;
|
||
int ret;
|
||
|
||
- et = efi_get_type(boot_params);
|
||
+ et = efi_get_type(boot_params_ptr);
|
||
if (et == EFI_TYPE_NONE)
|
||
return 0;
|
||
|
||
- systab_pa = efi_get_system_table(boot_params);
|
||
+ systab_pa = efi_get_system_table(boot_params_ptr);
|
||
if (!systab_pa)
|
||
error("EFI support advertised, but unable to locate system table.");
|
||
|
||
- ret = efi_get_conf_table(boot_params, &cfg_tbl_pa, &cfg_tbl_len);
|
||
+ ret = efi_get_conf_table(boot_params_ptr, &cfg_tbl_pa, &cfg_tbl_len);
|
||
if (ret || !cfg_tbl_pa)
|
||
error("EFI config table not found.");
|
||
|
||
@@ -156,7 +156,7 @@ acpi_physical_address get_rsdp_addr(void)
|
||
{
|
||
acpi_physical_address pa;
|
||
|
||
- pa = boot_params->acpi_rsdp_addr;
|
||
+ pa = boot_params_ptr->acpi_rsdp_addr;
|
||
|
||
if (!pa)
|
||
pa = efi_get_rsdp_addr();
|
||
@@ -210,7 +210,7 @@ static unsigned long get_acpi_srat_table(void)
|
||
rsdp = (struct acpi_table_rsdp *)get_cmdline_acpi_rsdp();
|
||
if (!rsdp)
|
||
rsdp = (struct acpi_table_rsdp *)(long)
|
||
- boot_params->acpi_rsdp_addr;
|
||
+ boot_params_ptr->acpi_rsdp_addr;
|
||
|
||
if (!rsdp)
|
||
return 0;
|
||
diff --git a/arch/x86/boot/compressed/cmdline.c b/arch/x86/boot/compressed/cmdline.c
|
||
index f1add5d85da9d9..c1bb180973ea2a 100644
|
||
--- a/arch/x86/boot/compressed/cmdline.c
|
||
+++ b/arch/x86/boot/compressed/cmdline.c
|
||
@@ -14,9 +14,9 @@ static inline char rdfs8(addr_t addr)
|
||
#include "../cmdline.c"
|
||
unsigned long get_cmd_line_ptr(void)
|
||
{
|
||
- unsigned long cmd_line_ptr = boot_params->hdr.cmd_line_ptr;
|
||
+ unsigned long cmd_line_ptr = boot_params_ptr->hdr.cmd_line_ptr;
|
||
|
||
- cmd_line_ptr |= (u64)boot_params->ext_cmd_line_ptr << 32;
|
||
+ cmd_line_ptr |= (u64)boot_params_ptr->ext_cmd_line_ptr << 32;
|
||
|
||
return cmd_line_ptr;
|
||
}
|
||
diff --git a/arch/x86/boot/compressed/ident_map_64.c b/arch/x86/boot/compressed/ident_map_64.c
|
||
index aead80ec70a0bf..d040080d7edbd6 100644
|
||
--- a/arch/x86/boot/compressed/ident_map_64.c
|
||
+++ b/arch/x86/boot/compressed/ident_map_64.c
|
||
@@ -159,8 +159,9 @@ void initialize_identity_maps(void *rmode)
|
||
* or does not touch all the pages covering them.
|
||
*/
|
||
kernel_add_identity_map((unsigned long)_head, (unsigned long)_end);
|
||
- boot_params = rmode;
|
||
- kernel_add_identity_map((unsigned long)boot_params, (unsigned long)(boot_params + 1));
|
||
+ boot_params_ptr = rmode;
|
||
+ kernel_add_identity_map((unsigned long)boot_params_ptr,
|
||
+ (unsigned long)(boot_params_ptr + 1));
|
||
cmdline = get_cmd_line_ptr();
|
||
kernel_add_identity_map(cmdline, cmdline + COMMAND_LINE_SIZE);
|
||
|
||
@@ -168,7 +169,7 @@ void initialize_identity_maps(void *rmode)
|
||
* Also map the setup_data entries passed via boot_params in case they
|
||
* need to be accessed by uncompressed kernel via the identity mapping.
|
||
*/
|
||
- sd = (struct setup_data *)boot_params->hdr.setup_data;
|
||
+ sd = (struct setup_data *)boot_params_ptr->hdr.setup_data;
|
||
while (sd) {
|
||
unsigned long sd_addr = (unsigned long)sd;
|
||
|
||
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
|
||
index 9193acf0e9cdec..dec961c6d16a7c 100644
|
||
--- a/arch/x86/boot/compressed/kaslr.c
|
||
+++ b/arch/x86/boot/compressed/kaslr.c
|
||
@@ -63,7 +63,7 @@ static unsigned long get_boot_seed(void)
|
||
unsigned long hash = 0;
|
||
|
||
hash = rotate_xor(hash, build_str, sizeof(build_str));
|
||
- hash = rotate_xor(hash, boot_params, sizeof(*boot_params));
|
||
+ hash = rotate_xor(hash, boot_params_ptr, sizeof(*boot_params_ptr));
|
||
|
||
return hash;
|
||
}
|
||
@@ -383,7 +383,7 @@ static void handle_mem_options(void)
|
||
static void mem_avoid_init(unsigned long input, unsigned long input_size,
|
||
unsigned long output)
|
||
{
|
||
- unsigned long init_size = boot_params->hdr.init_size;
|
||
+ unsigned long init_size = boot_params_ptr->hdr.init_size;
|
||
u64 initrd_start, initrd_size;
|
||
unsigned long cmd_line, cmd_line_size;
|
||
|
||
@@ -395,10 +395,10 @@ static void mem_avoid_init(unsigned long input, unsigned long input_size,
|
||
mem_avoid[MEM_AVOID_ZO_RANGE].size = (output + init_size) - input;
|
||
|
||
/* Avoid initrd. */
|
||
- initrd_start = (u64)boot_params->ext_ramdisk_image << 32;
|
||
- initrd_start |= boot_params->hdr.ramdisk_image;
|
||
- initrd_size = (u64)boot_params->ext_ramdisk_size << 32;
|
||
- initrd_size |= boot_params->hdr.ramdisk_size;
|
||
+ initrd_start = (u64)boot_params_ptr->ext_ramdisk_image << 32;
|
||
+ initrd_start |= boot_params_ptr->hdr.ramdisk_image;
|
||
+ initrd_size = (u64)boot_params_ptr->ext_ramdisk_size << 32;
|
||
+ initrd_size |= boot_params_ptr->hdr.ramdisk_size;
|
||
mem_avoid[MEM_AVOID_INITRD].start = initrd_start;
|
||
mem_avoid[MEM_AVOID_INITRD].size = initrd_size;
|
||
/* No need to set mapping for initrd, it will be handled in VO. */
|
||
@@ -413,8 +413,8 @@ static void mem_avoid_init(unsigned long input, unsigned long input_size,
|
||
}
|
||
|
||
/* Avoid boot parameters. */
|
||
- mem_avoid[MEM_AVOID_BOOTPARAMS].start = (unsigned long)boot_params;
|
||
- mem_avoid[MEM_AVOID_BOOTPARAMS].size = sizeof(*boot_params);
|
||
+ mem_avoid[MEM_AVOID_BOOTPARAMS].start = (unsigned long)boot_params_ptr;
|
||
+ mem_avoid[MEM_AVOID_BOOTPARAMS].size = sizeof(*boot_params_ptr);
|
||
|
||
/* We don't need to set a mapping for setup_data. */
|
||
|
||
@@ -447,7 +447,7 @@ static bool mem_avoid_overlap(struct mem_vector *img,
|
||
}
|
||
|
||
/* Avoid all entries in the setup_data linked list. */
|
||
- ptr = (struct setup_data *)(unsigned long)boot_params->hdr.setup_data;
|
||
+ ptr = (struct setup_data *)(unsigned long)boot_params_ptr->hdr.setup_data;
|
||
while (ptr) {
|
||
struct mem_vector avoid;
|
||
|
||
@@ -706,7 +706,7 @@ static inline bool memory_type_is_free(efi_memory_desc_t *md)
|
||
static bool
|
||
process_efi_entries(unsigned long minimum, unsigned long image_size)
|
||
{
|
||
- struct efi_info *e = &boot_params->efi_info;
|
||
+ struct efi_info *e = &boot_params_ptr->efi_info;
|
||
bool efi_mirror_found = false;
|
||
struct mem_vector region;
|
||
efi_memory_desc_t *md;
|
||
@@ -777,8 +777,8 @@ static void process_e820_entries(unsigned long minimum,
|
||
struct boot_e820_entry *entry;
|
||
|
||
/* Verify potential e820 positions, appending to slots list. */
|
||
- for (i = 0; i < boot_params->e820_entries; i++) {
|
||
- entry = &boot_params->e820_table[i];
|
||
+ for (i = 0; i < boot_params_ptr->e820_entries; i++) {
|
||
+ entry = &boot_params_ptr->e820_table[i];
|
||
/* Skip non-RAM entries. */
|
||
if (entry->type != E820_TYPE_RAM)
|
||
continue;
|
||
@@ -852,7 +852,7 @@ void choose_random_location(unsigned long input,
|
||
return;
|
||
}
|
||
|
||
- boot_params->hdr.loadflags |= KASLR_FLAG;
|
||
+ boot_params_ptr->hdr.loadflags |= KASLR_FLAG;
|
||
|
||
if (IS_ENABLED(CONFIG_X86_32))
|
||
mem_limit = KERNEL_IMAGE_SIZE;
|
||
diff --git a/arch/x86/boot/compressed/mem.c b/arch/x86/boot/compressed/mem.c
|
||
index 3c1609245f2add..b3c3a4be7471f1 100644
|
||
--- a/arch/x86/boot/compressed/mem.c
|
||
+++ b/arch/x86/boot/compressed/mem.c
|
||
@@ -54,17 +54,17 @@ bool init_unaccepted_memory(void)
|
||
enum efi_type et;
|
||
int ret;
|
||
|
||
- et = efi_get_type(boot_params);
|
||
+ et = efi_get_type(boot_params_ptr);
|
||
if (et == EFI_TYPE_NONE)
|
||
return false;
|
||
|
||
- ret = efi_get_conf_table(boot_params, &cfg_table_pa, &cfg_table_len);
|
||
+ ret = efi_get_conf_table(boot_params_ptr, &cfg_table_pa, &cfg_table_len);
|
||
if (ret) {
|
||
warn("EFI config table not found.");
|
||
return false;
|
||
}
|
||
|
||
- table = (void *)efi_find_vendor_table(boot_params, cfg_table_pa,
|
||
+ table = (void *)efi_find_vendor_table(boot_params_ptr, cfg_table_pa,
|
||
cfg_table_len, guid);
|
||
if (!table)
|
||
return false;
|
||
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
|
||
index b5ecbd32a46fac..ee0fac468e7f76 100644
|
||
--- a/arch/x86/boot/compressed/misc.c
|
||
+++ b/arch/x86/boot/compressed/misc.c
|
||
@@ -46,7 +46,7 @@ void *memmove(void *dest, const void *src, size_t n);
|
||
/*
|
||
* This is set up by the setup-routine at boot-time
|
||
*/
|
||
-struct boot_params *boot_params;
|
||
+struct boot_params *boot_params_ptr;
|
||
|
||
struct port_io_ops pio_ops;
|
||
|
||
@@ -132,8 +132,8 @@ void __putstr(const char *s)
|
||
if (lines == 0 || cols == 0)
|
||
return;
|
||
|
||
- x = boot_params->screen_info.orig_x;
|
||
- y = boot_params->screen_info.orig_y;
|
||
+ x = boot_params_ptr->screen_info.orig_x;
|
||
+ y = boot_params_ptr->screen_info.orig_y;
|
||
|
||
while ((c = *s++) != '\0') {
|
||
if (c == '\n') {
|
||
@@ -154,8 +154,8 @@ void __putstr(const char *s)
|
||
}
|
||
}
|
||
|
||
- boot_params->screen_info.orig_x = x;
|
||
- boot_params->screen_info.orig_y = y;
|
||
+ boot_params_ptr->screen_info.orig_x = x;
|
||
+ boot_params_ptr->screen_info.orig_y = y;
|
||
|
||
pos = (x + cols * y) * 2; /* Update cursor position */
|
||
outb(14, vidport);
|
||
@@ -396,16 +396,16 @@ asmlinkage __visible void *extract_kernel(void *rmode, unsigned char *output)
|
||
size_t entry_offset;
|
||
|
||
/* Retain x86 boot parameters pointer passed from startup_32/64. */
|
||
- boot_params = rmode;
|
||
+ boot_params_ptr = rmode;
|
||
|
||
/* Clear flags intended for solely in-kernel use. */
|
||
- boot_params->hdr.loadflags &= ~KASLR_FLAG;
|
||
+ boot_params_ptr->hdr.loadflags &= ~KASLR_FLAG;
|
||
|
||
- parse_mem_encrypt(&boot_params->hdr);
|
||
+ parse_mem_encrypt(&boot_params_ptr->hdr);
|
||
|
||
- sanitize_boot_params(boot_params);
|
||
+ sanitize_boot_params(boot_params_ptr);
|
||
|
||
- if (boot_params->screen_info.orig_video_mode == 7) {
|
||
+ if (boot_params_ptr->screen_info.orig_video_mode == 7) {
|
||
vidmem = (char *) 0xb0000;
|
||
vidport = 0x3b4;
|
||
} else {
|
||
@@ -413,8 +413,8 @@ asmlinkage __visible void *extract_kernel(void *rmode, unsigned char *output)
|
||
vidport = 0x3d4;
|
||
}
|
||
|
||
- lines = boot_params->screen_info.orig_video_lines;
|
||
- cols = boot_params->screen_info.orig_video_cols;
|
||
+ lines = boot_params_ptr->screen_info.orig_video_lines;
|
||
+ cols = boot_params_ptr->screen_info.orig_video_cols;
|
||
|
||
init_default_io_ops();
|
||
|
||
@@ -433,7 +433,7 @@ asmlinkage __visible void *extract_kernel(void *rmode, unsigned char *output)
|
||
* so that early debugging output from the RSDP parsing code can be
|
||
* collected.
|
||
*/
|
||
- boot_params->acpi_rsdp_addr = get_rsdp_addr();
|
||
+ boot_params_ptr->acpi_rsdp_addr = get_rsdp_addr();
|
||
|
||
debug_putstr("early console in extract_kernel\n");
|
||
|
||
diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h
|
||
index aae1a2db425103..bc2f0f17fb90ec 100644
|
||
--- a/arch/x86/boot/compressed/misc.h
|
||
+++ b/arch/x86/boot/compressed/misc.h
|
||
@@ -61,7 +61,6 @@ extern memptr free_mem_ptr;
|
||
extern memptr free_mem_end_ptr;
|
||
void *malloc(int size);
|
||
void free(void *where);
|
||
-extern struct boot_params *boot_params;
|
||
void __putstr(const char *s);
|
||
void __puthex(unsigned long value);
|
||
#define error_putstr(__x) __putstr(__x)
|
||
diff --git a/arch/x86/boot/compressed/pgtable_64.c b/arch/x86/boot/compressed/pgtable_64.c
|
||
index 7939eb6e6ce9bb..15354673d3aa7f 100644
|
||
--- a/arch/x86/boot/compressed/pgtable_64.c
|
||
+++ b/arch/x86/boot/compressed/pgtable_64.c
|
||
@@ -1,5 +1,6 @@
|
||
// SPDX-License-Identifier: GPL-2.0
|
||
#include "misc.h"
|
||
+#include <asm/bootparam_utils.h>
|
||
#include <asm/e820/types.h>
|
||
#include <asm/processor.h>
|
||
#include "pgtable.h"
|
||
@@ -28,7 +29,6 @@ static char trampoline_save[TRAMPOLINE_32BIT_SIZE];
|
||
*/
|
||
unsigned long *trampoline_32bit __section(".data");
|
||
|
||
-extern struct boot_params *boot_params;
|
||
int cmdline_find_option_bool(const char *option);
|
||
|
||
static unsigned long find_trampoline_placement(void)
|
||
@@ -49,7 +49,7 @@ static unsigned long find_trampoline_placement(void)
|
||
*
|
||
* Only look for values in the legacy ROM for non-EFI system.
|
||
*/
|
||
- signature = (char *)&boot_params->efi_info.efi_loader_signature;
|
||
+ signature = (char *)&boot_params_ptr->efi_info.efi_loader_signature;
|
||
if (strncmp(signature, EFI32_LOADER_SIGNATURE, 4) &&
|
||
strncmp(signature, EFI64_LOADER_SIGNATURE, 4)) {
|
||
ebda_start = *(unsigned short *)0x40e << 4;
|
||
@@ -65,10 +65,10 @@ static unsigned long find_trampoline_placement(void)
|
||
bios_start = round_down(bios_start, PAGE_SIZE);
|
||
|
||
/* Find the first usable memory region under bios_start. */
|
||
- for (i = boot_params->e820_entries - 1; i >= 0; i--) {
|
||
+ for (i = boot_params_ptr->e820_entries - 1; i >= 0; i--) {
|
||
unsigned long new = bios_start;
|
||
|
||
- entry = &boot_params->e820_table[i];
|
||
+ entry = &boot_params_ptr->e820_table[i];
|
||
|
||
/* Skip all entries above bios_start. */
|
||
if (bios_start <= entry->addr)
|
||
@@ -107,7 +107,8 @@ asmlinkage void configure_5level_paging(struct boot_params *bp, void *pgtable)
|
||
bool l5_required = false;
|
||
|
||
/* Initialize boot_params. Required for cmdline_find_option_bool(). */
|
||
- boot_params = bp;
|
||
+ sanitize_boot_params(bp);
|
||
+ boot_params_ptr = bp;
|
||
|
||
/*
|
||
* Check if LA57 is desired and supported.
|
||
diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c
|
||
index 0a49218a516a28..01d61f0609ab4d 100644
|
||
--- a/arch/x86/boot/compressed/sev.c
|
||
+++ b/arch/x86/boot/compressed/sev.c
|
||
@@ -618,7 +618,7 @@ void sev_prep_identity_maps(unsigned long top_level_pgt)
|
||
* accessed after switchover.
|
||
*/
|
||
if (sev_snp_enabled()) {
|
||
- unsigned long cc_info_pa = boot_params->cc_blob_address;
|
||
+ unsigned long cc_info_pa = boot_params_ptr->cc_blob_address;
|
||
struct cc_blob_sev_info *cc_info;
|
||
|
||
kernel_add_identity_map(cc_info_pa, cc_info_pa + sizeof(*cc_info));
|
||
diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h
|
||
index c945c893c52e0a..a3e0be0470a400 100644
|
||
--- a/arch/x86/include/asm/boot.h
|
||
+++ b/arch/x86/include/asm/boot.h
|
||
@@ -86,6 +86,8 @@ extern const unsigned long kernel_total_size;
|
||
|
||
unsigned long decompress_kernel(unsigned char *outbuf, unsigned long virt_addr,
|
||
void (*error)(char *x));
|
||
+
|
||
+extern struct boot_params *boot_params_ptr;
|
||
#endif
|
||
|
||
#endif /* _ASM_X86_BOOT_H */
|
||
diff --git a/arch/x86/include/asm/spec-ctrl.h b/arch/x86/include/asm/spec-ctrl.h
|
||
index cb0386fc4dc3b3..c648502e453579 100644
|
||
--- a/arch/x86/include/asm/spec-ctrl.h
|
||
+++ b/arch/x86/include/asm/spec-ctrl.h
|
||
@@ -4,6 +4,7 @@
|
||
|
||
#include <linux/thread_info.h>
|
||
#include <asm/nospec-branch.h>
|
||
+#include <asm/msr.h>
|
||
|
||
/*
|
||
* On VMENTER we must preserve whatever view of the SPEC_CTRL MSR
|
||
@@ -76,6 +77,16 @@ static inline u64 ssbd_tif_to_amd_ls_cfg(u64 tifn)
|
||
return (tifn & _TIF_SSBD) ? x86_amd_ls_cfg_ssbd_mask : 0ULL;
|
||
}
|
||
|
||
+/*
|
||
+ * This can be used in noinstr functions & should only be called in bare
|
||
+ * metal context.
|
||
+ */
|
||
+static __always_inline void __update_spec_ctrl(u64 val)
|
||
+{
|
||
+ __this_cpu_write(x86_spec_ctrl_current, val);
|
||
+ native_wrmsrl(MSR_IA32_SPEC_CTRL, val);
|
||
+}
|
||
+
|
||
#ifdef CONFIG_SMP
|
||
extern void speculative_store_bypass_ht_init(void);
|
||
#else
|
||
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
|
||
index b6d5fc396f88c8..ef75930d07545a 100644
|
||
--- a/arch/x86/kernel/amd_nb.c
|
||
+++ b/arch/x86/kernel/amd_nb.c
|
||
@@ -360,7 +360,6 @@ bool __init early_is_amd_nb(u32 device)
|
||
|
||
struct resource *amd_get_mmconfig_range(struct resource *res)
|
||
{
|
||
- u32 address;
|
||
u64 base, msr;
|
||
unsigned int segn_busn_bits;
|
||
|
||
@@ -368,13 +367,11 @@ struct resource *amd_get_mmconfig_range(struct resource *res)
|
||
boot_cpu_data.x86_vendor != X86_VENDOR_HYGON)
|
||
return NULL;
|
||
|
||
- /* assume all cpus from fam10h have mmconfig */
|
||
- if (boot_cpu_data.x86 < 0x10)
|
||
+ /* Assume CPUs from Fam10h have mmconfig, although not all VMs do */
|
||
+ if (boot_cpu_data.x86 < 0x10 ||
|
||
+ rdmsrl_safe(MSR_FAM10H_MMIO_CONF_BASE, &msr))
|
||
return NULL;
|
||
|
||
- address = MSR_FAM10H_MMIO_CONF_BASE;
|
||
- rdmsrl(address, msr);
|
||
-
|
||
/* mmconfig is not enabled */
|
||
if (!(msr & FAM10H_MMIO_CONF_ENABLE))
|
||
return NULL;
|
||
diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c
|
||
index 8f86eacf69f7c9..4729b5771dce8e 100644
|
||
--- a/arch/x86/kernel/cpu/cacheinfo.c
|
||
+++ b/arch/x86/kernel/cpu/cacheinfo.c
|
||
@@ -810,7 +810,7 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c)
|
||
cpuid(2, ®s[0], ®s[1], ®s[2], ®s[3]);
|
||
|
||
/* If bit 31 is set, this is an unknown format */
|
||
- for (j = 0 ; j < 3 ; j++)
|
||
+ for (j = 0 ; j < 4 ; j++)
|
||
if (regs[j] & (1 << 31))
|
||
regs[j] = 0;
|
||
|
||
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
|
||
index 4752a9f17ef615..38eeff91109f9b 100644
|
||
--- a/arch/x86/kernel/cpu/intel.c
|
||
+++ b/arch/x86/kernel/cpu/intel.c
|
||
@@ -748,26 +748,37 @@ static unsigned int intel_size_cache(struct cpuinfo_x86 *c, unsigned int size)
|
||
}
|
||
#endif
|
||
|
||
-#define TLB_INST_4K 0x01
|
||
-#define TLB_INST_4M 0x02
|
||
-#define TLB_INST_2M_4M 0x03
|
||
+#define TLB_INST_4K 0x01
|
||
+#define TLB_INST_4M 0x02
|
||
+#define TLB_INST_2M_4M 0x03
|
||
|
||
-#define TLB_INST_ALL 0x05
|
||
-#define TLB_INST_1G 0x06
|
||
+#define TLB_INST_ALL 0x05
|
||
+#define TLB_INST_1G 0x06
|
||
|
||
-#define TLB_DATA_4K 0x11
|
||
-#define TLB_DATA_4M 0x12
|
||
-#define TLB_DATA_2M_4M 0x13
|
||
-#define TLB_DATA_4K_4M 0x14
|
||
+#define TLB_DATA_4K 0x11
|
||
+#define TLB_DATA_4M 0x12
|
||
+#define TLB_DATA_2M_4M 0x13
|
||
+#define TLB_DATA_4K_4M 0x14
|
||
|
||
-#define TLB_DATA_1G 0x16
|
||
+#define TLB_DATA_1G 0x16
|
||
+#define TLB_DATA_1G_2M_4M 0x17
|
||
|
||
-#define TLB_DATA0_4K 0x21
|
||
-#define TLB_DATA0_4M 0x22
|
||
-#define TLB_DATA0_2M_4M 0x23
|
||
+#define TLB_DATA0_4K 0x21
|
||
+#define TLB_DATA0_4M 0x22
|
||
+#define TLB_DATA0_2M_4M 0x23
|
||
|
||
-#define STLB_4K 0x41
|
||
-#define STLB_4K_2M 0x42
|
||
+#define STLB_4K 0x41
|
||
+#define STLB_4K_2M 0x42
|
||
+
|
||
+/*
|
||
+ * All of leaf 0x2's one-byte TLB descriptors implies the same number of
|
||
+ * entries for their respective TLB types. The 0x63 descriptor is an
|
||
+ * exception: it implies 4 dTLB entries for 1GB pages 32 dTLB entries
|
||
+ * for 2MB or 4MB pages. Encode descriptor 0x63 dTLB entry count for
|
||
+ * 2MB/4MB pages here, as its count for dTLB 1GB pages is already at the
|
||
+ * intel_tlb_table[] mapping.
|
||
+ */
|
||
+#define TLB_0x63_2M_4M_ENTRIES 32
|
||
|
||
static const struct _tlb_table intel_tlb_table[] = {
|
||
{ 0x01, TLB_INST_4K, 32, " TLB_INST 4 KByte pages, 4-way set associative" },
|
||
@@ -789,7 +800,8 @@ static const struct _tlb_table intel_tlb_table[] = {
|
||
{ 0x5c, TLB_DATA_4K_4M, 128, " TLB_DATA 4 KByte and 4 MByte pages" },
|
||
{ 0x5d, TLB_DATA_4K_4M, 256, " TLB_DATA 4 KByte and 4 MByte pages" },
|
||
{ 0x61, TLB_INST_4K, 48, " TLB_INST 4 KByte pages, full associative" },
|
||
- { 0x63, TLB_DATA_1G, 4, " TLB_DATA 1 GByte pages, 4-way set associative" },
|
||
+ { 0x63, TLB_DATA_1G_2M_4M, 4, " TLB_DATA 1 GByte pages, 4-way set associative"
|
||
+ " (plus 32 entries TLB_DATA 2 MByte or 4 MByte pages, not encoded here)" },
|
||
{ 0x6b, TLB_DATA_4K, 256, " TLB_DATA 4 KByte pages, 8-way associative" },
|
||
{ 0x6c, TLB_DATA_2M_4M, 128, " TLB_DATA 2 MByte or 4 MByte pages, 8-way associative" },
|
||
{ 0x6d, TLB_DATA_1G, 16, " TLB_DATA 1 GByte pages, fully associative" },
|
||
@@ -889,6 +901,12 @@ static void intel_tlb_lookup(const unsigned char desc)
|
||
if (tlb_lld_4m[ENTRIES] < intel_tlb_table[k].entries)
|
||
tlb_lld_4m[ENTRIES] = intel_tlb_table[k].entries;
|
||
break;
|
||
+ case TLB_DATA_1G_2M_4M:
|
||
+ if (tlb_lld_2m[ENTRIES] < TLB_0x63_2M_4M_ENTRIES)
|
||
+ tlb_lld_2m[ENTRIES] = TLB_0x63_2M_4M_ENTRIES;
|
||
+ if (tlb_lld_4m[ENTRIES] < TLB_0x63_2M_4M_ENTRIES)
|
||
+ tlb_lld_4m[ENTRIES] = TLB_0x63_2M_4M_ENTRIES;
|
||
+ fallthrough;
|
||
case TLB_DATA_1G:
|
||
if (tlb_lld_1g[ENTRIES] < intel_tlb_table[k].entries)
|
||
tlb_lld_1g[ENTRIES] = intel_tlb_table[k].entries;
|
||
@@ -912,7 +930,7 @@ static void intel_detect_tlb(struct cpuinfo_x86 *c)
|
||
cpuid(2, ®s[0], ®s[1], ®s[2], ®s[3]);
|
||
|
||
/* If bit 31 is set, this is an unknown format */
|
||
- for (j = 0 ; j < 3 ; j++)
|
||
+ for (j = 0 ; j < 4 ; j++)
|
||
if (regs[j] & (1 << 31))
|
||
regs[j] = 0;
|
||
|
||
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
|
||
index 13a632da09ed7b..af766298b253bd 100644
|
||
--- a/arch/x86/kernel/cpu/microcode/amd.c
|
||
+++ b/arch/x86/kernel/cpu/microcode/amd.c
|
||
@@ -177,23 +177,29 @@ static bool need_sha_check(u32 cur_rev)
|
||
{
|
||
switch (cur_rev >> 8) {
|
||
case 0x80012: return cur_rev <= 0x800126f; break;
|
||
+ case 0x80082: return cur_rev <= 0x800820f; break;
|
||
case 0x83010: return cur_rev <= 0x830107c; break;
|
||
case 0x86001: return cur_rev <= 0x860010e; break;
|
||
case 0x86081: return cur_rev <= 0x8608108; break;
|
||
case 0x87010: return cur_rev <= 0x8701034; break;
|
||
case 0x8a000: return cur_rev <= 0x8a0000a; break;
|
||
+ case 0xa0010: return cur_rev <= 0xa00107a; break;
|
||
case 0xa0011: return cur_rev <= 0xa0011da; break;
|
||
case 0xa0012: return cur_rev <= 0xa001243; break;
|
||
+ case 0xa0082: return cur_rev <= 0xa00820e; break;
|
||
case 0xa1011: return cur_rev <= 0xa101153; break;
|
||
case 0xa1012: return cur_rev <= 0xa10124e; break;
|
||
case 0xa1081: return cur_rev <= 0xa108109; break;
|
||
case 0xa2010: return cur_rev <= 0xa20102f; break;
|
||
case 0xa2012: return cur_rev <= 0xa201212; break;
|
||
+ case 0xa4041: return cur_rev <= 0xa404109; break;
|
||
+ case 0xa5000: return cur_rev <= 0xa500013; break;
|
||
case 0xa6012: return cur_rev <= 0xa60120a; break;
|
||
case 0xa7041: return cur_rev <= 0xa704109; break;
|
||
case 0xa7052: return cur_rev <= 0xa705208; break;
|
||
case 0xa7080: return cur_rev <= 0xa708009; break;
|
||
case 0xa70c0: return cur_rev <= 0xa70C009; break;
|
||
+ case 0xaa001: return cur_rev <= 0xaa00116; break;
|
||
case 0xaa002: return cur_rev <= 0xaa00218; break;
|
||
default: break;
|
||
}
|
||
diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c
|
||
index 5d390df2144066..a59a0011c930ad 100644
|
||
--- a/arch/x86/kernel/cpu/sgx/ioctl.c
|
||
+++ b/arch/x86/kernel/cpu/sgx/ioctl.c
|
||
@@ -64,6 +64,13 @@ static int sgx_encl_create(struct sgx_encl *encl, struct sgx_secs *secs)
|
||
struct file *backing;
|
||
long ret;
|
||
|
||
+ /*
|
||
+ * ECREATE would detect this too, but checking here also ensures
|
||
+ * that the 'encl_size' calculations below can never overflow.
|
||
+ */
|
||
+ if (!is_power_of_2(secs->size))
|
||
+ return -EINVAL;
|
||
+
|
||
va_page = sgx_encl_grow(encl, true);
|
||
if (IS_ERR(va_page))
|
||
return PTR_ERR(va_page);
|
||
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
|
||
index 7e6763c2bc01e9..5fb12d9c71befa 100644
|
||
--- a/arch/x86/kvm/cpuid.c
|
||
+++ b/arch/x86/kvm/cpuid.c
|
||
@@ -1307,7 +1307,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
|
||
|
||
entry->ecx = entry->edx = 0;
|
||
if (!enable_pmu || !kvm_cpu_cap_has(X86_FEATURE_PERFMON_V2)) {
|
||
- entry->eax = entry->ebx;
|
||
+ entry->eax = entry->ebx = 0;
|
||
break;
|
||
}
|
||
|
||
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
|
||
index d762330bce166c..1d06b8fc15a85c 100644
|
||
--- a/arch/x86/kvm/svm/svm.c
|
||
+++ b/arch/x86/kvm/svm/svm.c
|
||
@@ -3156,6 +3156,27 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
|
||
kvm_pr_unimpl_wrmsr(vcpu, ecx, data);
|
||
break;
|
||
}
|
||
+
|
||
+ /*
|
||
+ * AMD changed the architectural behavior of bits 5:2. On CPUs
|
||
+ * without BusLockTrap, bits 5:2 control "external pins", but
|
||
+ * on CPUs that support BusLockDetect, bit 2 enables BusLockTrap
|
||
+ * and bits 5:3 are reserved-to-zero. Sadly, old KVM allowed
|
||
+ * the guest to set bits 5:2 despite not actually virtualizing
|
||
+ * Performance-Monitoring/Breakpoint external pins. Drop bits
|
||
+ * 5:2 for backwards compatibility.
|
||
+ */
|
||
+ data &= ~GENMASK(5, 2);
|
||
+
|
||
+ /*
|
||
+ * Suppress BTF as KVM doesn't virtualize BTF, but there's no
|
||
+ * way to communicate lack of support to the guest.
|
||
+ */
|
||
+ if (data & DEBUGCTLMSR_BTF) {
|
||
+ kvm_pr_unimpl_wrmsr(vcpu, MSR_IA32_DEBUGCTLMSR, data);
|
||
+ data &= ~DEBUGCTLMSR_BTF;
|
||
+ }
|
||
+
|
||
if (data & DEBUGCTL_RESERVED_BITS)
|
||
return 1;
|
||
|
||
diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h
|
||
index 37ada9808d9b57..81f00177f501a1 100644
|
||
--- a/arch/x86/kvm/svm/svm.h
|
||
+++ b/arch/x86/kvm/svm/svm.h
|
||
@@ -533,7 +533,7 @@ static inline bool is_vnmi_enabled(struct vcpu_svm *svm)
|
||
/* svm.c */
|
||
#define MSR_INVALID 0xffffffffU
|
||
|
||
-#define DEBUGCTL_RESERVED_BITS (~(0x3fULL))
|
||
+#define DEBUGCTL_RESERVED_BITS (~DEBUGCTLMSR_LBR)
|
||
|
||
extern bool dump_invalid_vmcb;
|
||
|
||
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
|
||
index 6215dfa23578da..71d29dd7ad761e 100644
|
||
--- a/arch/x86/mm/init.c
|
||
+++ b/arch/x86/mm/init.c
|
||
@@ -262,28 +262,33 @@ static void __init probe_page_size_mask(void)
|
||
}
|
||
|
||
/*
|
||
- * INVLPG may not properly flush Global entries
|
||
- * on these CPUs when PCIDs are enabled.
|
||
+ * INVLPG may not properly flush Global entries on
|
||
+ * these CPUs. New microcode fixes the issue.
|
||
*/
|
||
static const struct x86_cpu_id invlpg_miss_ids[] = {
|
||
- X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE, 0),
|
||
- X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_L, 0),
|
||
- X86_MATCH_INTEL_FAM6_MODEL(ATOM_GRACEMONT, 0),
|
||
- X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE, 0),
|
||
- X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_P, 0),
|
||
- X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_S, 0),
|
||
+ X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE, 0x2e),
|
||
+ X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_L, 0x42c),
|
||
+ X86_MATCH_INTEL_FAM6_MODEL(ATOM_GRACEMONT, 0x11),
|
||
+ X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE, 0x118),
|
||
+ X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_P, 0x4117),
|
||
+ X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_S, 0x2e),
|
||
{}
|
||
};
|
||
|
||
static void setup_pcid(void)
|
||
{
|
||
+ const struct x86_cpu_id *invlpg_miss_match;
|
||
+
|
||
if (!IS_ENABLED(CONFIG_X86_64))
|
||
return;
|
||
|
||
if (!boot_cpu_has(X86_FEATURE_PCID))
|
||
return;
|
||
|
||
- if (x86_match_cpu(invlpg_miss_ids)) {
|
||
+ invlpg_miss_match = x86_match_cpu(invlpg_miss_ids);
|
||
+
|
||
+ if (invlpg_miss_match &&
|
||
+ boot_cpu_data.microcode < invlpg_miss_match->driver_data) {
|
||
pr_info("Incomplete global flushes, disabling PCID");
|
||
setup_clear_cpu_cap(X86_FEATURE_PCID);
|
||
return;
|
||
diff --git a/block/partitions/efi.c b/block/partitions/efi.c
|
||
index 5e9be13a56a82a..7acba66eed481c 100644
|
||
--- a/block/partitions/efi.c
|
||
+++ b/block/partitions/efi.c
|
||
@@ -682,7 +682,7 @@ static void utf16_le_to_7bit(const __le16 *in, unsigned int size, u8 *out)
|
||
out[size] = 0;
|
||
|
||
while (i < size) {
|
||
- u8 c = le16_to_cpu(in[i]) & 0xff;
|
||
+ u8 c = le16_to_cpu(in[i]) & 0x7f;
|
||
|
||
if (c && !isprint(c))
|
||
c = '!';
|
||
diff --git a/drivers/base/core.c b/drivers/base/core.c
|
||
index 18a73e49210261..8e2caa9eb5cd41 100644
|
||
--- a/drivers/base/core.c
|
||
+++ b/drivers/base/core.c
|
||
@@ -2026,6 +2026,7 @@ static bool __fw_devlink_relax_cycles(struct fwnode_handle *con_handle,
|
||
out:
|
||
sup_handle->flags &= ~FWNODE_FLAG_VISITED;
|
||
put_device(sup_dev);
|
||
+ put_device(con_dev);
|
||
put_device(par_dev);
|
||
return ret;
|
||
}
|
||
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
|
||
index 1105e8adf7f96f..95095500f93afb 100644
|
||
--- a/drivers/block/ublk_drv.c
|
||
+++ b/drivers/block/ublk_drv.c
|
||
@@ -2599,9 +2599,12 @@ static int ublk_ctrl_set_params(struct ublk_device *ub,
|
||
if (ph.len > sizeof(struct ublk_params))
|
||
ph.len = sizeof(struct ublk_params);
|
||
|
||
- /* parameters can only be changed when device isn't live */
|
||
mutex_lock(&ub->mutex);
|
||
- if (ub->dev_info.state == UBLK_S_DEV_LIVE) {
|
||
+ if (test_bit(UB_STATE_USED, &ub->state)) {
|
||
+ /*
|
||
+ * Parameters can only be changed when device hasn't
|
||
+ * been started yet
|
||
+ */
|
||
ret = -EACCES;
|
||
} else if (copy_from_user(&ub->params, argp, ph.len)) {
|
||
ret = -EFAULT;
|
||
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
|
||
index c80b5aa7628ae9..bc3f63f1ccd863 100644
|
||
--- a/drivers/bluetooth/btusb.c
|
||
+++ b/drivers/bluetooth/btusb.c
|
||
@@ -4230,6 +4230,7 @@ static ssize_t force_poll_sync_write(struct file *file,
|
||
}
|
||
|
||
static const struct file_operations force_poll_sync_fops = {
|
||
+ .owner = THIS_MODULE,
|
||
.open = simple_open,
|
||
.read = force_poll_sync_read,
|
||
.write = force_poll_sync_write,
|
||
diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
|
||
index 154841916f5652..6121ca84654114 100644
|
||
--- a/drivers/bus/mhi/host/pci_generic.c
|
||
+++ b/drivers/bus/mhi/host/pci_generic.c
|
||
@@ -892,8 +892,9 @@ static void mhi_pci_recovery_work(struct work_struct *work)
|
||
err_unprepare:
|
||
mhi_unprepare_after_power_down(mhi_cntrl);
|
||
err_try_reset:
|
||
- if (pci_reset_function(pdev))
|
||
- dev_err(&pdev->dev, "Recovery failed\n");
|
||
+ err = pci_try_reset_function(pdev);
|
||
+ if (err)
|
||
+ dev_err(&pdev->dev, "Recovery failed: %d\n", err);
|
||
}
|
||
|
||
static void health_check(struct timer_list *t)
|
||
diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c
|
||
index d2cad4c670a073..a61834bc84a991 100644
|
||
--- a/drivers/cdx/cdx.c
|
||
+++ b/drivers/cdx/cdx.c
|
||
@@ -365,8 +365,12 @@ static ssize_t driver_override_show(struct device *dev,
|
||
struct device_attribute *attr, char *buf)
|
||
{
|
||
struct cdx_device *cdx_dev = to_cdx_device(dev);
|
||
+ ssize_t len;
|
||
|
||
- return sysfs_emit(buf, "%s\n", cdx_dev->driver_override);
|
||
+ device_lock(dev);
|
||
+ len = sysfs_emit(buf, "%s\n", cdx_dev->driver_override);
|
||
+ device_unlock(dev);
|
||
+ return len;
|
||
}
|
||
static DEVICE_ATTR_RW(driver_override);
|
||
|
||
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
|
||
index 2cf595d2e10b85..f7dd455dd0dd3c 100644
|
||
--- a/drivers/char/misc.c
|
||
+++ b/drivers/char/misc.c
|
||
@@ -264,8 +264,8 @@ int misc_register(struct miscdevice *misc)
|
||
device_create_with_groups(&misc_class, misc->parent, dev,
|
||
misc, misc->groups, "%s", misc->name);
|
||
if (IS_ERR(misc->this_device)) {
|
||
+ misc_minor_free(misc->minor);
|
||
if (is_dynamic) {
|
||
- misc_minor_free(misc->minor);
|
||
misc->minor = MISC_DYNAMIC_MINOR;
|
||
}
|
||
err = PTR_ERR(misc->this_device);
|
||
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
|
||
index b2b06d18b7b4a7..7bea03963b2812 100644
|
||
--- a/drivers/firmware/efi/libstub/x86-stub.c
|
||
+++ b/drivers/firmware/efi/libstub/x86-stub.c
|
||
@@ -883,7 +883,7 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
|
||
unsigned long kernel_entry;
|
||
efi_status_t status;
|
||
|
||
- boot_params_pointer = boot_params;
|
||
+ boot_params_ptr = boot_params;
|
||
|
||
efi_system_table = sys_table_arg;
|
||
/* Check if we were booted by the EFI firmware */
|
||
diff --git a/drivers/firmware/efi/libstub/x86-stub.h b/drivers/firmware/efi/libstub/x86-stub.h
|
||
index 4433d0f97441ca..1c20e99a649442 100644
|
||
--- a/drivers/firmware/efi/libstub/x86-stub.h
|
||
+++ b/drivers/firmware/efi/libstub/x86-stub.h
|
||
@@ -2,8 +2,6 @@
|
||
|
||
#include <linux/efi.h>
|
||
|
||
-extern struct boot_params *boot_params_pointer asm("boot_params");
|
||
-
|
||
extern void trampoline_32bit_src(void *, bool);
|
||
extern const u16 trampoline_ljmp_imm_offset;
|
||
|
||
diff --git a/drivers/firmware/efi/mokvar-table.c b/drivers/firmware/efi/mokvar-table.c
|
||
index 5ed0602c2f75f0..4eb0dff4dfaf8b 100644
|
||
--- a/drivers/firmware/efi/mokvar-table.c
|
||
+++ b/drivers/firmware/efi/mokvar-table.c
|
||
@@ -103,9 +103,7 @@ void __init efi_mokvar_table_init(void)
|
||
void *va = NULL;
|
||
unsigned long cur_offset = 0;
|
||
unsigned long offset_limit;
|
||
- unsigned long map_size = 0;
|
||
unsigned long map_size_needed = 0;
|
||
- unsigned long size;
|
||
struct efi_mokvar_table_entry *mokvar_entry;
|
||
int err;
|
||
|
||
@@ -134,48 +132,34 @@ void __init efi_mokvar_table_init(void)
|
||
*/
|
||
err = -EINVAL;
|
||
while (cur_offset + sizeof(*mokvar_entry) <= offset_limit) {
|
||
- mokvar_entry = va + cur_offset;
|
||
- map_size_needed = cur_offset + sizeof(*mokvar_entry);
|
||
- if (map_size_needed > map_size) {
|
||
- if (va)
|
||
- early_memunmap(va, map_size);
|
||
- /*
|
||
- * Map a little more than the fixed size entry
|
||
- * header, anticipating some data. It's safe to
|
||
- * do so as long as we stay within current memory
|
||
- * descriptor.
|
||
- */
|
||
- map_size = min(map_size_needed + 2*EFI_PAGE_SIZE,
|
||
- offset_limit);
|
||
- va = early_memremap(efi.mokvar_table, map_size);
|
||
- if (!va) {
|
||
- pr_err("Failed to map EFI MOKvar config table pa=0x%lx, size=%lu.\n",
|
||
- efi.mokvar_table, map_size);
|
||
- return;
|
||
- }
|
||
- mokvar_entry = va + cur_offset;
|
||
+ if (va)
|
||
+ early_memunmap(va, sizeof(*mokvar_entry));
|
||
+ va = early_memremap(efi.mokvar_table + cur_offset, sizeof(*mokvar_entry));
|
||
+ if (!va) {
|
||
+ pr_err("Failed to map EFI MOKvar config table pa=0x%lx, size=%zu.\n",
|
||
+ efi.mokvar_table + cur_offset, sizeof(*mokvar_entry));
|
||
+ return;
|
||
}
|
||
+ mokvar_entry = va;
|
||
|
||
/* Check for last sentinel entry */
|
||
if (mokvar_entry->name[0] == '\0') {
|
||
if (mokvar_entry->data_size != 0)
|
||
break;
|
||
err = 0;
|
||
+ map_size_needed = cur_offset + sizeof(*mokvar_entry);
|
||
break;
|
||
}
|
||
|
||
- /* Sanity check that the name is null terminated */
|
||
- size = strnlen(mokvar_entry->name,
|
||
- sizeof(mokvar_entry->name));
|
||
- if (size >= sizeof(mokvar_entry->name))
|
||
- break;
|
||
+ /* Enforce that the name is NUL terminated */
|
||
+ mokvar_entry->name[sizeof(mokvar_entry->name) - 1] = '\0';
|
||
|
||
/* Advance to the next entry */
|
||
- cur_offset = map_size_needed + mokvar_entry->data_size;
|
||
+ cur_offset += sizeof(*mokvar_entry) + mokvar_entry->data_size;
|
||
}
|
||
|
||
if (va)
|
||
- early_memunmap(va, map_size);
|
||
+ early_memunmap(va, sizeof(*mokvar_entry));
|
||
if (err) {
|
||
pr_err("EFI MOKvar config table is not valid\n");
|
||
return;
|
||
diff --git a/drivers/gpio/gpio-aggregator.c b/drivers/gpio/gpio-aggregator.c
|
||
index 38e0fff9afe722..cc6ee4334602aa 100644
|
||
--- a/drivers/gpio/gpio-aggregator.c
|
||
+++ b/drivers/gpio/gpio-aggregator.c
|
||
@@ -121,10 +121,15 @@ static ssize_t new_device_store(struct device_driver *driver, const char *buf,
|
||
struct platform_device *pdev;
|
||
int res, id;
|
||
|
||
+ if (!try_module_get(THIS_MODULE))
|
||
+ return -ENOENT;
|
||
+
|
||
/* kernfs guarantees string termination, so count + 1 is safe */
|
||
aggr = kzalloc(sizeof(*aggr) + count + 1, GFP_KERNEL);
|
||
- if (!aggr)
|
||
- return -ENOMEM;
|
||
+ if (!aggr) {
|
||
+ res = -ENOMEM;
|
||
+ goto put_module;
|
||
+ }
|
||
|
||
memcpy(aggr->args, buf, count + 1);
|
||
|
||
@@ -163,6 +168,7 @@ static ssize_t new_device_store(struct device_driver *driver, const char *buf,
|
||
}
|
||
|
||
aggr->pdev = pdev;
|
||
+ module_put(THIS_MODULE);
|
||
return count;
|
||
|
||
remove_table:
|
||
@@ -177,6 +183,8 @@ static ssize_t new_device_store(struct device_driver *driver, const char *buf,
|
||
kfree(aggr->lookups);
|
||
free_ga:
|
||
kfree(aggr);
|
||
+put_module:
|
||
+ module_put(THIS_MODULE);
|
||
return res;
|
||
}
|
||
|
||
@@ -205,13 +213,19 @@ static ssize_t delete_device_store(struct device_driver *driver,
|
||
if (error)
|
||
return error;
|
||
|
||
+ if (!try_module_get(THIS_MODULE))
|
||
+ return -ENOENT;
|
||
+
|
||
mutex_lock(&gpio_aggregator_lock);
|
||
aggr = idr_remove(&gpio_aggregator_idr, id);
|
||
mutex_unlock(&gpio_aggregator_lock);
|
||
- if (!aggr)
|
||
+ if (!aggr) {
|
||
+ module_put(THIS_MODULE);
|
||
return -ENOENT;
|
||
+ }
|
||
|
||
gpio_aggregator_free(aggr);
|
||
+ module_put(THIS_MODULE);
|
||
return count;
|
||
}
|
||
static DRIVER_ATTR_WO(delete_device);
|
||
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
|
||
index 86e69cde04da0f..53ec8cc0479835 100644
|
||
--- a/drivers/gpio/gpio-rcar.c
|
||
+++ b/drivers/gpio/gpio-rcar.c
|
||
@@ -40,7 +40,7 @@ struct gpio_rcar_info {
|
||
|
||
struct gpio_rcar_priv {
|
||
void __iomem *base;
|
||
- spinlock_t lock;
|
||
+ raw_spinlock_t lock;
|
||
struct device *dev;
|
||
struct gpio_chip gpio_chip;
|
||
unsigned int irq_parent;
|
||
@@ -123,7 +123,7 @@ static void gpio_rcar_config_interrupt_input_mode(struct gpio_rcar_priv *p,
|
||
* "Setting Level-Sensitive Interrupt Input Mode"
|
||
*/
|
||
|
||
- spin_lock_irqsave(&p->lock, flags);
|
||
+ raw_spin_lock_irqsave(&p->lock, flags);
|
||
|
||
/* Configure positive or negative logic in POSNEG */
|
||
gpio_rcar_modify_bit(p, POSNEG, hwirq, !active_high_rising_edge);
|
||
@@ -142,7 +142,7 @@ static void gpio_rcar_config_interrupt_input_mode(struct gpio_rcar_priv *p,
|
||
if (!level_trigger)
|
||
gpio_rcar_write(p, INTCLR, BIT(hwirq));
|
||
|
||
- spin_unlock_irqrestore(&p->lock, flags);
|
||
+ raw_spin_unlock_irqrestore(&p->lock, flags);
|
||
}
|
||
|
||
static int gpio_rcar_irq_set_type(struct irq_data *d, unsigned int type)
|
||
@@ -246,7 +246,7 @@ static void gpio_rcar_config_general_input_output_mode(struct gpio_chip *chip,
|
||
* "Setting General Input Mode"
|
||
*/
|
||
|
||
- spin_lock_irqsave(&p->lock, flags);
|
||
+ raw_spin_lock_irqsave(&p->lock, flags);
|
||
|
||
/* Configure positive logic in POSNEG */
|
||
gpio_rcar_modify_bit(p, POSNEG, gpio, false);
|
||
@@ -261,7 +261,7 @@ static void gpio_rcar_config_general_input_output_mode(struct gpio_chip *chip,
|
||
if (p->info.has_outdtsel && output)
|
||
gpio_rcar_modify_bit(p, OUTDTSEL, gpio, false);
|
||
|
||
- spin_unlock_irqrestore(&p->lock, flags);
|
||
+ raw_spin_unlock_irqrestore(&p->lock, flags);
|
||
}
|
||
|
||
static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset)
|
||
@@ -347,7 +347,7 @@ static int gpio_rcar_get_multiple(struct gpio_chip *chip, unsigned long *mask,
|
||
return 0;
|
||
}
|
||
|
||
- spin_lock_irqsave(&p->lock, flags);
|
||
+ raw_spin_lock_irqsave(&p->lock, flags);
|
||
outputs = gpio_rcar_read(p, INOUTSEL);
|
||
m = outputs & bankmask;
|
||
if (m)
|
||
@@ -356,7 +356,7 @@ static int gpio_rcar_get_multiple(struct gpio_chip *chip, unsigned long *mask,
|
||
m = ~outputs & bankmask;
|
||
if (m)
|
||
val |= gpio_rcar_read(p, INDT) & m;
|
||
- spin_unlock_irqrestore(&p->lock, flags);
|
||
+ raw_spin_unlock_irqrestore(&p->lock, flags);
|
||
|
||
bits[0] = val;
|
||
return 0;
|
||
@@ -367,9 +367,9 @@ static void gpio_rcar_set(struct gpio_chip *chip, unsigned offset, int value)
|
||
struct gpio_rcar_priv *p = gpiochip_get_data(chip);
|
||
unsigned long flags;
|
||
|
||
- spin_lock_irqsave(&p->lock, flags);
|
||
+ raw_spin_lock_irqsave(&p->lock, flags);
|
||
gpio_rcar_modify_bit(p, OUTDT, offset, value);
|
||
- spin_unlock_irqrestore(&p->lock, flags);
|
||
+ raw_spin_unlock_irqrestore(&p->lock, flags);
|
||
}
|
||
|
||
static void gpio_rcar_set_multiple(struct gpio_chip *chip, unsigned long *mask,
|
||
@@ -386,12 +386,12 @@ static void gpio_rcar_set_multiple(struct gpio_chip *chip, unsigned long *mask,
|
||
if (!bankmask)
|
||
return;
|
||
|
||
- spin_lock_irqsave(&p->lock, flags);
|
||
+ raw_spin_lock_irqsave(&p->lock, flags);
|
||
val = gpio_rcar_read(p, OUTDT);
|
||
val &= ~bankmask;
|
||
val |= (bankmask & bits[0]);
|
||
gpio_rcar_write(p, OUTDT, val);
|
||
- spin_unlock_irqrestore(&p->lock, flags);
|
||
+ raw_spin_unlock_irqrestore(&p->lock, flags);
|
||
}
|
||
|
||
static int gpio_rcar_direction_output(struct gpio_chip *chip, unsigned offset,
|
||
@@ -468,7 +468,12 @@ static int gpio_rcar_parse_dt(struct gpio_rcar_priv *p, unsigned int *npins)
|
||
p->info = *info;
|
||
|
||
ret = of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, 0, &args);
|
||
- *npins = ret == 0 ? args.args[2] : RCAR_MAX_GPIO_PER_BANK;
|
||
+ if (ret) {
|
||
+ *npins = RCAR_MAX_GPIO_PER_BANK;
|
||
+ } else {
|
||
+ *npins = args.args[2];
|
||
+ of_node_put(args.np);
|
||
+ }
|
||
|
||
if (*npins == 0 || *npins > RCAR_MAX_GPIO_PER_BANK) {
|
||
dev_warn(p->dev, "Invalid number of gpio lines %u, using %u\n",
|
||
@@ -505,7 +510,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
|
||
return -ENOMEM;
|
||
|
||
p->dev = dev;
|
||
- spin_lock_init(&p->lock);
|
||
+ raw_spin_lock_init(&p->lock);
|
||
|
||
/* Get device configuration from DT node */
|
||
ret = gpio_rcar_parse_dt(p, &npins);
|
||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
|
||
index 2e739b80cfccf1..45dd6cbad81e79 100644
|
||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
|
||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
|
||
@@ -1116,6 +1116,17 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
|
||
if (amdgpu_sriov_vf(adev))
|
||
return 0;
|
||
|
||
+ /* resizing on Dell G5 SE platforms causes problems with runtime pm */
|
||
+ if ((amdgpu_runtime_pm != 0) &&
|
||
+ adev->pdev->vendor == PCI_VENDOR_ID_ATI &&
|
||
+ adev->pdev->device == 0x731f &&
|
||
+ adev->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
|
||
+ return 0;
|
||
+
|
||
+ /* PCI_EXT_CAP_ID_VNDR extended capability is located at 0x100 */
|
||
+ if (!pci_find_ext_capability(adev->pdev, PCI_EXT_CAP_ID_VNDR))
|
||
+ DRM_WARN("System can't access extended configuration space,please check!!\n");
|
||
+
|
||
/* skip if the bios has already enabled large BAR */
|
||
if (adev->gmc.real_vram_size &&
|
||
(pci_resource_len(adev->pdev, 0) >= adev->gmc.real_vram_size))
|
||
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
|
||
index 99fcd39bb15e0d..69c0d0b341af2a 100644
|
||
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
|
||
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
|
||
@@ -1394,7 +1394,8 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
|
||
DC_LOGGER_INIT(pipe_ctx->stream->ctx->logger);
|
||
|
||
/* Invalid input */
|
||
- if (!plane_state->dst_rect.width ||
|
||
+ if (!plane_state ||
|
||
+ !plane_state->dst_rect.width ||
|
||
!plane_state->dst_rect.height ||
|
||
!plane_state->src_rect.width ||
|
||
!plane_state->src_rect.height) {
|
||
diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c
|
||
index 5b8efe8e735a9b..0a0efeeb790e26 100644
|
||
--- a/drivers/gpu/drm/i915/display/icl_dsi.c
|
||
+++ b/drivers/gpu/drm/i915/display/icl_dsi.c
|
||
@@ -797,8 +797,8 @@ gen11_dsi_configure_transcoder(struct intel_encoder *encoder,
|
||
|
||
/* select data lane width */
|
||
tmp = intel_de_read(dev_priv, TRANS_DDI_FUNC_CTL(dsi_trans));
|
||
- tmp &= ~DDI_PORT_WIDTH_MASK;
|
||
- tmp |= DDI_PORT_WIDTH(intel_dsi->lane_count);
|
||
+ tmp &= ~TRANS_DDI_PORT_WIDTH_MASK;
|
||
+ tmp |= TRANS_DDI_PORT_WIDTH(intel_dsi->lane_count);
|
||
|
||
/* select input pipe */
|
||
tmp &= ~TRANS_DDI_EDP_INPUT_MASK;
|
||
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
|
||
index b347f906234945..893ecee3949acb 100644
|
||
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
|
||
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
|
||
@@ -2357,13 +2357,22 @@ mtl_ddi_enable_d2d(struct intel_encoder *encoder)
|
||
{
|
||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||
enum port port = encoder->port;
|
||
+ i915_reg_t reg;
|
||
+ u32 set_bits, wait_bits;
|
||
|
||
- intel_de_rmw(dev_priv, XELPDP_PORT_BUF_CTL1(port), 0,
|
||
- XELPDP_PORT_BUF_D2D_LINK_ENABLE);
|
||
+ if (DISPLAY_VER(dev_priv) >= 20) {
|
||
+ reg = DDI_BUF_CTL(port);
|
||
+ set_bits = XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
|
||
+ wait_bits = XE2LPD_DDI_BUF_D2D_LINK_STATE;
|
||
+ } else {
|
||
+ reg = XELPDP_PORT_BUF_CTL1(port);
|
||
+ set_bits = XELPDP_PORT_BUF_D2D_LINK_ENABLE;
|
||
+ wait_bits = XELPDP_PORT_BUF_D2D_LINK_STATE;
|
||
+ }
|
||
|
||
- if (wait_for_us((intel_de_read(dev_priv, XELPDP_PORT_BUF_CTL1(port)) &
|
||
- XELPDP_PORT_BUF_D2D_LINK_STATE), 100)) {
|
||
- drm_err(&dev_priv->drm, "Timeout waiting for D2D Link enable for PORT_BUF_CTL %c\n",
|
||
+ intel_de_rmw(dev_priv, reg, 0, set_bits);
|
||
+ if (wait_for_us(intel_de_read(dev_priv, reg) & wait_bits, 100)) {
|
||
+ drm_err(&dev_priv->drm, "Timeout waiting for D2D Link enable for DDI/PORT_BUF_CTL %c\n",
|
||
port_name(port));
|
||
}
|
||
}
|
||
@@ -2810,13 +2819,22 @@ mtl_ddi_disable_d2d_link(struct intel_encoder *encoder)
|
||
{
|
||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||
enum port port = encoder->port;
|
||
+ i915_reg_t reg;
|
||
+ u32 clr_bits, wait_bits;
|
||
|
||
- intel_de_rmw(dev_priv, XELPDP_PORT_BUF_CTL1(port),
|
||
- XELPDP_PORT_BUF_D2D_LINK_ENABLE, 0);
|
||
+ if (DISPLAY_VER(dev_priv) >= 20) {
|
||
+ reg = DDI_BUF_CTL(port);
|
||
+ clr_bits = XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
|
||
+ wait_bits = XE2LPD_DDI_BUF_D2D_LINK_STATE;
|
||
+ } else {
|
||
+ reg = XELPDP_PORT_BUF_CTL1(port);
|
||
+ clr_bits = XELPDP_PORT_BUF_D2D_LINK_ENABLE;
|
||
+ wait_bits = XELPDP_PORT_BUF_D2D_LINK_STATE;
|
||
+ }
|
||
|
||
- if (wait_for_us(!(intel_de_read(dev_priv, XELPDP_PORT_BUF_CTL1(port)) &
|
||
- XELPDP_PORT_BUF_D2D_LINK_STATE), 100))
|
||
- drm_err(&dev_priv->drm, "Timeout waiting for D2D Link disable for PORT_BUF_CTL %c\n",
|
||
+ intel_de_rmw(dev_priv, reg, clr_bits, 0);
|
||
+ if (wait_for_us(!(intel_de_read(dev_priv, reg) & wait_bits), 100))
|
||
+ drm_err(&dev_priv->drm, "Timeout waiting for D2D Link disable for DDI/PORT_BUF_CTL %c\n",
|
||
port_name(port));
|
||
}
|
||
|
||
@@ -3224,7 +3242,10 @@ static void intel_enable_ddi_hdmi(struct intel_atomic_state *state,
|
||
intel_de_rmw(dev_priv, XELPDP_PORT_BUF_CTL1(port),
|
||
XELPDP_PORT_WIDTH_MASK | XELPDP_PORT_REVERSAL, port_buf);
|
||
|
||
- buf_ctl |= DDI_PORT_WIDTH(lane_count);
|
||
+ buf_ctl |= DDI_PORT_WIDTH(crtc_state->lane_count);
|
||
+
|
||
+ if (DISPLAY_VER(dev_priv) >= 20)
|
||
+ buf_ctl |= XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
|
||
} else if (IS_ALDERLAKE_P(dev_priv) && intel_phy_is_tc(dev_priv, phy)) {
|
||
drm_WARN_ON(&dev_priv->drm, !intel_tc_port_in_legacy_mode(dig_port));
|
||
buf_ctl |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
|
||
@@ -3449,6 +3470,9 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
|
||
|
||
/* 6.i Configure and enable DDI_CTL_DE to start sending valid data to port slice */
|
||
intel_dp->DP |= DDI_BUF_CTL_ENABLE;
|
||
+ if (DISPLAY_VER(dev_priv) >= 20)
|
||
+ intel_dp->DP |= XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
|
||
+
|
||
intel_de_write(dev_priv, DDI_BUF_CTL(port), intel_dp->DP);
|
||
intel_de_posting_read(dev_priv, DDI_BUF_CTL(port));
|
||
|
||
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
|
||
index aefad14ab27a42..589a10253d8986 100644
|
||
--- a/drivers/gpu/drm/i915/i915_reg.h
|
||
+++ b/drivers/gpu/drm/i915/i915_reg.h
|
||
@@ -5724,6 +5724,8 @@ enum skl_power_gate {
|
||
/* Known as DDI_CTL_DE in MTL+ */
|
||
#define DDI_BUF_CTL(port) _MMIO_PORT(port, _DDI_BUF_CTL_A, _DDI_BUF_CTL_B)
|
||
#define DDI_BUF_CTL_ENABLE (1 << 31)
|
||
+#define XE2LPD_DDI_BUF_D2D_LINK_ENABLE REG_BIT(29)
|
||
+#define XE2LPD_DDI_BUF_D2D_LINK_STATE REG_BIT(28)
|
||
#define DDI_BUF_TRANS_SELECT(n) ((n) << 24)
|
||
#define DDI_BUF_EMP_MASK (0xf << 24)
|
||
#define DDI_BUF_PHY_LINK_RATE(r) ((r) << 20)
|
||
@@ -5735,7 +5737,7 @@ enum skl_power_gate {
|
||
#define DDI_BUF_IS_IDLE (1 << 7)
|
||
#define DDI_BUF_CTL_TC_PHY_OWNERSHIP REG_BIT(6)
|
||
#define DDI_A_4_LANES (1 << 4)
|
||
-#define DDI_PORT_WIDTH(width) (((width) - 1) << 1)
|
||
+#define DDI_PORT_WIDTH(width) (((width) == 3 ? 4 : ((width) - 1)) << 1)
|
||
#define DDI_PORT_WIDTH_MASK (7 << 1)
|
||
#define DDI_PORT_WIDTH_SHIFT 1
|
||
#define DDI_INIT_DISPLAY_DETECTED (1 << 0)
|
||
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
|
||
index 430a4263ccf7a8..b0c9970c2abd1f 100644
|
||
--- a/drivers/gpu/drm/radeon/r300.c
|
||
+++ b/drivers/gpu/drm/radeon/r300.c
|
||
@@ -358,7 +358,8 @@ int r300_mc_wait_for_idle(struct radeon_device *rdev)
|
||
return -1;
|
||
}
|
||
|
||
-static void r300_gpu_init(struct radeon_device *rdev)
|
||
+/* rs400_gpu_init also calls this! */
|
||
+void r300_gpu_init(struct radeon_device *rdev)
|
||
{
|
||
uint32_t gb_tile_config, tmp;
|
||
|
||
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
|
||
index 1e00f6b99f94b6..8f5e07834fcc60 100644
|
||
--- a/drivers/gpu/drm/radeon/radeon_asic.h
|
||
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
|
||
@@ -165,6 +165,7 @@ void r200_set_safe_registers(struct radeon_device *rdev);
|
||
*/
|
||
extern int r300_init(struct radeon_device *rdev);
|
||
extern void r300_fini(struct radeon_device *rdev);
|
||
+extern void r300_gpu_init(struct radeon_device *rdev);
|
||
extern int r300_suspend(struct radeon_device *rdev);
|
||
extern int r300_resume(struct radeon_device *rdev);
|
||
extern int r300_asic_reset(struct radeon_device *rdev, bool hard);
|
||
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
|
||
index 4f93fe468ec7f9..a6f90cea59dffc 100644
|
||
--- a/drivers/gpu/drm/radeon/rs400.c
|
||
+++ b/drivers/gpu/drm/radeon/rs400.c
|
||
@@ -255,8 +255,22 @@ int rs400_mc_wait_for_idle(struct radeon_device *rdev)
|
||
|
||
static void rs400_gpu_init(struct radeon_device *rdev)
|
||
{
|
||
- /* FIXME: is this correct ? */
|
||
- r420_pipes_init(rdev);
|
||
+ /* Earlier code was calling r420_pipes_init and then
|
||
+ * rs400_mc_wait_for_idle(rdev). The problem is that
|
||
+ * at least on my Mobility Radeon Xpress 200M RC410 card
|
||
+ * that ends up in this code path ends up num_gb_pipes == 3
|
||
+ * while the card seems to have only one pipe. With the
|
||
+ * r420 pipe initialization method.
|
||
+ *
|
||
+ * Problems shown up as HyperZ glitches, see:
|
||
+ * https://bugs.freedesktop.org/show_bug.cgi?id=110897
|
||
+ *
|
||
+ * Delegating initialization to r300 code seems to work
|
||
+ * and results in proper pipe numbers. The rs400 cards
|
||
+ * are said to be not r400, but r300 kind of cards.
|
||
+ */
|
||
+ r300_gpu_init(rdev);
|
||
+
|
||
if (rs400_mc_wait_for_idle(rdev)) {
|
||
pr_warn("rs400: Failed to wait MC idle while programming pipes. Bad things might happen. %08x\n",
|
||
RREG32(RADEON_MC_STATUS));
|
||
diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h
|
||
index 3143ecaaff8628..f7f10e97ac0556 100644
|
||
--- a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h
|
||
+++ b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h
|
||
@@ -21,7 +21,7 @@
|
||
*
|
||
*/
|
||
|
||
-#if !defined(_GPU_SCHED_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
|
||
+#if !defined(_GPU_SCHED_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
|
||
#define _GPU_SCHED_TRACE_H_
|
||
|
||
#include <linux/stringify.h>
|
||
@@ -106,7 +106,7 @@ TRACE_EVENT(drm_sched_job_wait_dep,
|
||
__entry->seqno)
|
||
);
|
||
|
||
-#endif
|
||
+#endif /* _GPU_SCHED_TRACE_H_ */
|
||
|
||
/* This part must be outside protection */
|
||
#undef TRACE_INCLUDE_PATH
|
||
diff --git a/drivers/hid/hid-appleir.c b/drivers/hid/hid-appleir.c
|
||
index 8deded1857254a..c45e5aa569d25f 100644
|
||
--- a/drivers/hid/hid-appleir.c
|
||
+++ b/drivers/hid/hid-appleir.c
|
||
@@ -188,7 +188,7 @@ static int appleir_raw_event(struct hid_device *hid, struct hid_report *report,
|
||
static const u8 flatbattery[] = { 0x25, 0x87, 0xe0 };
|
||
unsigned long flags;
|
||
|
||
- if (len != 5)
|
||
+ if (len != 5 || !(hid->claimed & HID_CLAIMED_INPUT))
|
||
goto out;
|
||
|
||
if (!memcmp(data, keydown, sizeof(keydown))) {
|
||
diff --git a/drivers/hid/hid-google-hammer.c b/drivers/hid/hid-google-hammer.c
|
||
index c6bdb9c4ef3e00..d25291ed900d02 100644
|
||
--- a/drivers/hid/hid-google-hammer.c
|
||
+++ b/drivers/hid/hid-google-hammer.c
|
||
@@ -269,11 +269,13 @@ static int cbas_ec_remove(struct platform_device *pdev)
|
||
return 0;
|
||
}
|
||
|
||
+#ifdef CONFIG_ACPI
|
||
static const struct acpi_device_id cbas_ec_acpi_ids[] = {
|
||
{ "GOOG000B", 0 },
|
||
{ }
|
||
};
|
||
MODULE_DEVICE_TABLE(acpi, cbas_ec_acpi_ids);
|
||
+#endif
|
||
|
||
#ifdef CONFIG_OF
|
||
static const struct of_device_id cbas_ec_of_match[] = {
|
||
diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c
|
||
index 49c067133975f7..29ff4eb5194b7b 100644
|
||
--- a/drivers/hid/hid-steam.c
|
||
+++ b/drivers/hid/hid-steam.c
|
||
@@ -1325,11 +1325,11 @@ static void steam_remove(struct hid_device *hdev)
|
||
return;
|
||
}
|
||
|
||
+ hid_destroy_device(steam->client_hdev);
|
||
cancel_delayed_work_sync(&steam->mode_switch);
|
||
cancel_work_sync(&steam->work_connect);
|
||
cancel_work_sync(&steam->rumble_work);
|
||
cancel_work_sync(&steam->unregister_work);
|
||
- hid_destroy_device(steam->client_hdev);
|
||
steam->client_hdev = NULL;
|
||
steam->client_opened = false;
|
||
if (steam->quirks & STEAM_QUIRK_WIRELESS) {
|
||
diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.c b/drivers/hid/intel-ish-hid/ishtp-hid.c
|
||
index 00c6f0ebf35633..be2c62fc8251d7 100644
|
||
--- a/drivers/hid/intel-ish-hid/ishtp-hid.c
|
||
+++ b/drivers/hid/intel-ish-hid/ishtp-hid.c
|
||
@@ -261,12 +261,14 @@ int ishtp_hid_probe(unsigned int cur_hid_dev,
|
||
*/
|
||
void ishtp_hid_remove(struct ishtp_cl_data *client_data)
|
||
{
|
||
+ void *data;
|
||
int i;
|
||
|
||
for (i = 0; i < client_data->num_hid_devices; ++i) {
|
||
if (client_data->hid_sensor_hubs[i]) {
|
||
- kfree(client_data->hid_sensor_hubs[i]->driver_data);
|
||
+ data = client_data->hid_sensor_hubs[i]->driver_data;
|
||
hid_destroy_device(client_data->hid_sensor_hubs[i]);
|
||
+ kfree(data);
|
||
client_data->hid_sensor_hubs[i] = NULL;
|
||
}
|
||
}
|
||
diff --git a/drivers/hwmon/ad7314.c b/drivers/hwmon/ad7314.c
|
||
index 7802bbf5f9587f..59424103f6348a 100644
|
||
--- a/drivers/hwmon/ad7314.c
|
||
+++ b/drivers/hwmon/ad7314.c
|
||
@@ -22,11 +22,13 @@
|
||
*/
|
||
#define AD7314_TEMP_MASK 0x7FE0
|
||
#define AD7314_TEMP_SHIFT 5
|
||
+#define AD7314_LEADING_ZEROS_MASK BIT(15)
|
||
|
||
/*
|
||
* ADT7301 and ADT7302 temperature masks
|
||
*/
|
||
#define ADT7301_TEMP_MASK 0x3FFF
|
||
+#define ADT7301_LEADING_ZEROS_MASK (BIT(15) | BIT(14))
|
||
|
||
enum ad7314_variant {
|
||
adt7301,
|
||
@@ -65,12 +67,20 @@ static ssize_t ad7314_temperature_show(struct device *dev,
|
||
return ret;
|
||
switch (spi_get_device_id(chip->spi_dev)->driver_data) {
|
||
case ad7314:
|
||
+ if (ret & AD7314_LEADING_ZEROS_MASK) {
|
||
+ /* Invalid read-out, leading zero part is missing */
|
||
+ return -EIO;
|
||
+ }
|
||
data = (ret & AD7314_TEMP_MASK) >> AD7314_TEMP_SHIFT;
|
||
data = sign_extend32(data, 9);
|
||
|
||
return sprintf(buf, "%d\n", 250 * data);
|
||
case adt7301:
|
||
case adt7302:
|
||
+ if (ret & ADT7301_LEADING_ZEROS_MASK) {
|
||
+ /* Invalid read-out, leading zero part is missing */
|
||
+ return -EIO;
|
||
+ }
|
||
/*
|
||
* Documented as a 13 bit twos complement register
|
||
* with a sign bit - which is a 14 bit 2's complement
|
||
diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c
|
||
index b5352900463fb9..0d29c8f97ba7c2 100644
|
||
--- a/drivers/hwmon/ntc_thermistor.c
|
||
+++ b/drivers/hwmon/ntc_thermistor.c
|
||
@@ -181,40 +181,40 @@ static const struct ntc_compensation ncpXXwf104[] = {
|
||
};
|
||
|
||
static const struct ntc_compensation ncpXXxh103[] = {
|
||
- { .temp_c = -40, .ohm = 247565 },
|
||
- { .temp_c = -35, .ohm = 181742 },
|
||
- { .temp_c = -30, .ohm = 135128 },
|
||
- { .temp_c = -25, .ohm = 101678 },
|
||
- { .temp_c = -20, .ohm = 77373 },
|
||
- { .temp_c = -15, .ohm = 59504 },
|
||
- { .temp_c = -10, .ohm = 46222 },
|
||
- { .temp_c = -5, .ohm = 36244 },
|
||
- { .temp_c = 0, .ohm = 28674 },
|
||
- { .temp_c = 5, .ohm = 22878 },
|
||
- { .temp_c = 10, .ohm = 18399 },
|
||
- { .temp_c = 15, .ohm = 14910 },
|
||
- { .temp_c = 20, .ohm = 12169 },
|
||
+ { .temp_c = -40, .ohm = 195652 },
|
||
+ { .temp_c = -35, .ohm = 148171 },
|
||
+ { .temp_c = -30, .ohm = 113347 },
|
||
+ { .temp_c = -25, .ohm = 87559 },
|
||
+ { .temp_c = -20, .ohm = 68237 },
|
||
+ { .temp_c = -15, .ohm = 53650 },
|
||
+ { .temp_c = -10, .ohm = 42506 },
|
||
+ { .temp_c = -5, .ohm = 33892 },
|
||
+ { .temp_c = 0, .ohm = 27219 },
|
||
+ { .temp_c = 5, .ohm = 22021 },
|
||
+ { .temp_c = 10, .ohm = 17926 },
|
||
+ { .temp_c = 15, .ohm = 14674 },
|
||
+ { .temp_c = 20, .ohm = 12081 },
|
||
{ .temp_c = 25, .ohm = 10000 },
|
||
- { .temp_c = 30, .ohm = 8271 },
|
||
- { .temp_c = 35, .ohm = 6883 },
|
||
- { .temp_c = 40, .ohm = 5762 },
|
||
- { .temp_c = 45, .ohm = 4851 },
|
||
- { .temp_c = 50, .ohm = 4105 },
|
||
- { .temp_c = 55, .ohm = 3492 },
|
||
- { .temp_c = 60, .ohm = 2985 },
|
||
- { .temp_c = 65, .ohm = 2563 },
|
||
- { .temp_c = 70, .ohm = 2211 },
|
||
- { .temp_c = 75, .ohm = 1915 },
|
||
- { .temp_c = 80, .ohm = 1666 },
|
||
- { .temp_c = 85, .ohm = 1454 },
|
||
- { .temp_c = 90, .ohm = 1275 },
|
||
- { .temp_c = 95, .ohm = 1121 },
|
||
- { .temp_c = 100, .ohm = 990 },
|
||
- { .temp_c = 105, .ohm = 876 },
|
||
- { .temp_c = 110, .ohm = 779 },
|
||
- { .temp_c = 115, .ohm = 694 },
|
||
- { .temp_c = 120, .ohm = 620 },
|
||
- { .temp_c = 125, .ohm = 556 },
|
||
+ { .temp_c = 30, .ohm = 8315 },
|
||
+ { .temp_c = 35, .ohm = 6948 },
|
||
+ { .temp_c = 40, .ohm = 5834 },
|
||
+ { .temp_c = 45, .ohm = 4917 },
|
||
+ { .temp_c = 50, .ohm = 4161 },
|
||
+ { .temp_c = 55, .ohm = 3535 },
|
||
+ { .temp_c = 60, .ohm = 3014 },
|
||
+ { .temp_c = 65, .ohm = 2586 },
|
||
+ { .temp_c = 70, .ohm = 2228 },
|
||
+ { .temp_c = 75, .ohm = 1925 },
|
||
+ { .temp_c = 80, .ohm = 1669 },
|
||
+ { .temp_c = 85, .ohm = 1452 },
|
||
+ { .temp_c = 90, .ohm = 1268 },
|
||
+ { .temp_c = 95, .ohm = 1110 },
|
||
+ { .temp_c = 100, .ohm = 974 },
|
||
+ { .temp_c = 105, .ohm = 858 },
|
||
+ { .temp_c = 110, .ohm = 758 },
|
||
+ { .temp_c = 115, .ohm = 672 },
|
||
+ { .temp_c = 120, .ohm = 596 },
|
||
+ { .temp_c = 125, .ohm = 531 },
|
||
};
|
||
|
||
/*
|
||
diff --git a/drivers/hwmon/peci/dimmtemp.c b/drivers/hwmon/peci/dimmtemp.c
|
||
index 5ca4d04e4b14ab..01329fce390938 100644
|
||
--- a/drivers/hwmon/peci/dimmtemp.c
|
||
+++ b/drivers/hwmon/peci/dimmtemp.c
|
||
@@ -127,8 +127,6 @@ static int update_thresholds(struct peci_dimmtemp *priv, int dimm_no)
|
||
return 0;
|
||
|
||
ret = priv->gen_info->read_thresholds(priv, dimm_order, chan_rank, &data);
|
||
- if (ret == -ENODATA) /* Use default or previous value */
|
||
- return 0;
|
||
if (ret)
|
||
return ret;
|
||
|
||
@@ -509,11 +507,11 @@ read_thresholds_icx(struct peci_dimmtemp *priv, int dimm_order, int chan_rank, u
|
||
|
||
ret = peci_ep_pci_local_read(priv->peci_dev, 0, 13, 0, 2, 0xd4, ®_val);
|
||
if (ret || !(reg_val & BIT(31)))
|
||
- return -ENODATA; /* Use default or previous value */
|
||
+ return -ENODATA;
|
||
|
||
ret = peci_ep_pci_local_read(priv->peci_dev, 0, 13, 0, 2, 0xd0, ®_val);
|
||
if (ret)
|
||
- return -ENODATA; /* Use default or previous value */
|
||
+ return -ENODATA;
|
||
|
||
/*
|
||
* Device 26, Offset 224e0: IMC 0 channel 0 -> rank 0
|
||
@@ -546,11 +544,11 @@ read_thresholds_spr(struct peci_dimmtemp *priv, int dimm_order, int chan_rank, u
|
||
|
||
ret = peci_ep_pci_local_read(priv->peci_dev, 0, 30, 0, 2, 0xd4, ®_val);
|
||
if (ret || !(reg_val & BIT(31)))
|
||
- return -ENODATA; /* Use default or previous value */
|
||
+ return -ENODATA;
|
||
|
||
ret = peci_ep_pci_local_read(priv->peci_dev, 0, 30, 0, 2, 0xd0, ®_val);
|
||
if (ret)
|
||
- return -ENODATA; /* Use default or previous value */
|
||
+ return -ENODATA;
|
||
|
||
/*
|
||
* Device 26, Offset 219a8: IMC 0 channel 0 -> rank 0
|
||
diff --git a/drivers/hwmon/pmbus/pmbus.c b/drivers/hwmon/pmbus/pmbus.c
|
||
index ec40c5c599543a..59424dc518c8f9 100644
|
||
--- a/drivers/hwmon/pmbus/pmbus.c
|
||
+++ b/drivers/hwmon/pmbus/pmbus.c
|
||
@@ -103,6 +103,8 @@ static int pmbus_identify(struct i2c_client *client,
|
||
if (pmbus_check_byte_register(client, 0, PMBUS_PAGE)) {
|
||
int page;
|
||
|
||
+ info->pages = PMBUS_PAGES;
|
||
+
|
||
for (page = 1; page < PMBUS_PAGES; page++) {
|
||
if (pmbus_set_page(client, page, 0xff) < 0)
|
||
break;
|
||
diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c
|
||
index 78d9f52e2a7194..207084d55044a1 100644
|
||
--- a/drivers/hwmon/xgene-hwmon.c
|
||
+++ b/drivers/hwmon/xgene-hwmon.c
|
||
@@ -712,7 +712,7 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
|
||
goto out;
|
||
}
|
||
|
||
- if (!ctx->pcc_comm_addr) {
|
||
+ if (IS_ERR_OR_NULL(ctx->pcc_comm_addr)) {
|
||
dev_err(&pdev->dev,
|
||
"Failed to ioremap PCC comm region\n");
|
||
rc = -ENOMEM;
|
||
diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c
|
||
index 8dad239aba2cea..e7985db1f29b36 100644
|
||
--- a/drivers/hwtracing/intel_th/pci.c
|
||
+++ b/drivers/hwtracing/intel_th/pci.c
|
||
@@ -329,6 +329,21 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
|
||
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa824),
|
||
.driver_data = (kernel_ulong_t)&intel_th_2x,
|
||
},
|
||
+ {
|
||
+ /* Arrow Lake */
|
||
+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x7724),
|
||
+ .driver_data = (kernel_ulong_t)&intel_th_2x,
|
||
+ },
|
||
+ {
|
||
+ /* Panther Lake-H */
|
||
+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xe324),
|
||
+ .driver_data = (kernel_ulong_t)&intel_th_2x,
|
||
+ },
|
||
+ {
|
||
+ /* Panther Lake-P/U */
|
||
+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xe424),
|
||
+ .driver_data = (kernel_ulong_t)&intel_th_2x,
|
||
+ },
|
||
{
|
||
/* Alder Lake CPU */
|
||
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x466f),
|
||
diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
|
||
index df67b63ccf69ca..b54e4481fafb4d 100644
|
||
--- a/drivers/iio/adc/at91-sama5d2_adc.c
|
||
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
|
||
@@ -329,7 +329,7 @@ static const struct at91_adc_reg_layout sama7g5_layout = {
|
||
#define AT91_HWFIFO_MAX_SIZE_STR "128"
|
||
#define AT91_HWFIFO_MAX_SIZE 128
|
||
|
||
-#define AT91_SAMA5D2_CHAN_SINGLE(index, num, addr) \
|
||
+#define AT91_SAMA_CHAN_SINGLE(index, num, addr, rbits) \
|
||
{ \
|
||
.type = IIO_VOLTAGE, \
|
||
.channel = num, \
|
||
@@ -337,7 +337,7 @@ static const struct at91_adc_reg_layout sama7g5_layout = {
|
||
.scan_index = index, \
|
||
.scan_type = { \
|
||
.sign = 'u', \
|
||
- .realbits = 14, \
|
||
+ .realbits = rbits, \
|
||
.storagebits = 16, \
|
||
}, \
|
||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
|
||
@@ -350,7 +350,13 @@ static const struct at91_adc_reg_layout sama7g5_layout = {
|
||
.indexed = 1, \
|
||
}
|
||
|
||
-#define AT91_SAMA5D2_CHAN_DIFF(index, num, num2, addr) \
|
||
+#define AT91_SAMA5D2_CHAN_SINGLE(index, num, addr) \
|
||
+ AT91_SAMA_CHAN_SINGLE(index, num, addr, 14)
|
||
+
|
||
+#define AT91_SAMA7G5_CHAN_SINGLE(index, num, addr) \
|
||
+ AT91_SAMA_CHAN_SINGLE(index, num, addr, 16)
|
||
+
|
||
+#define AT91_SAMA_CHAN_DIFF(index, num, num2, addr, rbits) \
|
||
{ \
|
||
.type = IIO_VOLTAGE, \
|
||
.differential = 1, \
|
||
@@ -360,7 +366,7 @@ static const struct at91_adc_reg_layout sama7g5_layout = {
|
||
.scan_index = index, \
|
||
.scan_type = { \
|
||
.sign = 's', \
|
||
- .realbits = 14, \
|
||
+ .realbits = rbits, \
|
||
.storagebits = 16, \
|
||
}, \
|
||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
|
||
@@ -373,6 +379,12 @@ static const struct at91_adc_reg_layout sama7g5_layout = {
|
||
.indexed = 1, \
|
||
}
|
||
|
||
+#define AT91_SAMA5D2_CHAN_DIFF(index, num, num2, addr) \
|
||
+ AT91_SAMA_CHAN_DIFF(index, num, num2, addr, 14)
|
||
+
|
||
+#define AT91_SAMA7G5_CHAN_DIFF(index, num, num2, addr) \
|
||
+ AT91_SAMA_CHAN_DIFF(index, num, num2, addr, 16)
|
||
+
|
||
#define AT91_SAMA5D2_CHAN_TOUCH(num, name, mod) \
|
||
{ \
|
||
.type = IIO_POSITIONRELATIVE, \
|
||
@@ -666,30 +678,30 @@ static const struct iio_chan_spec at91_sama5d2_adc_channels[] = {
|
||
};
|
||
|
||
static const struct iio_chan_spec at91_sama7g5_adc_channels[] = {
|
||
- AT91_SAMA5D2_CHAN_SINGLE(0, 0, 0x60),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(1, 1, 0x64),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(2, 2, 0x68),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(3, 3, 0x6c),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(4, 4, 0x70),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(5, 5, 0x74),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(6, 6, 0x78),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(7, 7, 0x7c),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(8, 8, 0x80),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(9, 9, 0x84),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(10, 10, 0x88),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(11, 11, 0x8c),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(12, 12, 0x90),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(13, 13, 0x94),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(14, 14, 0x98),
|
||
- AT91_SAMA5D2_CHAN_SINGLE(15, 15, 0x9c),
|
||
- AT91_SAMA5D2_CHAN_DIFF(16, 0, 1, 0x60),
|
||
- AT91_SAMA5D2_CHAN_DIFF(17, 2, 3, 0x68),
|
||
- AT91_SAMA5D2_CHAN_DIFF(18, 4, 5, 0x70),
|
||
- AT91_SAMA5D2_CHAN_DIFF(19, 6, 7, 0x78),
|
||
- AT91_SAMA5D2_CHAN_DIFF(20, 8, 9, 0x80),
|
||
- AT91_SAMA5D2_CHAN_DIFF(21, 10, 11, 0x88),
|
||
- AT91_SAMA5D2_CHAN_DIFF(22, 12, 13, 0x90),
|
||
- AT91_SAMA5D2_CHAN_DIFF(23, 14, 15, 0x98),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(0, 0, 0x60),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(1, 1, 0x64),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(2, 2, 0x68),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(3, 3, 0x6c),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(4, 4, 0x70),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(5, 5, 0x74),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(6, 6, 0x78),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(7, 7, 0x7c),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(8, 8, 0x80),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(9, 9, 0x84),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(10, 10, 0x88),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(11, 11, 0x8c),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(12, 12, 0x90),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(13, 13, 0x94),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(14, 14, 0x98),
|
||
+ AT91_SAMA7G5_CHAN_SINGLE(15, 15, 0x9c),
|
||
+ AT91_SAMA7G5_CHAN_DIFF(16, 0, 1, 0x60),
|
||
+ AT91_SAMA7G5_CHAN_DIFF(17, 2, 3, 0x68),
|
||
+ AT91_SAMA7G5_CHAN_DIFF(18, 4, 5, 0x70),
|
||
+ AT91_SAMA7G5_CHAN_DIFF(19, 6, 7, 0x78),
|
||
+ AT91_SAMA7G5_CHAN_DIFF(20, 8, 9, 0x80),
|
||
+ AT91_SAMA7G5_CHAN_DIFF(21, 10, 11, 0x88),
|
||
+ AT91_SAMA7G5_CHAN_DIFF(22, 12, 13, 0x90),
|
||
+ AT91_SAMA7G5_CHAN_DIFF(23, 14, 15, 0x98),
|
||
IIO_CHAN_SOFT_TIMESTAMP(24),
|
||
AT91_SAMA5D2_CHAN_TEMP(AT91_SAMA7G5_ADC_TEMP_CHANNEL, "temp", 0xdc),
|
||
};
|
||
diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c
|
||
index a492e8f2fc0fbc..130bda62022293 100644
|
||
--- a/drivers/iio/dac/ad3552r.c
|
||
+++ b/drivers/iio/dac/ad3552r.c
|
||
@@ -703,6 +703,12 @@ static int ad3552r_reset(struct ad3552r_desc *dac)
|
||
return ret;
|
||
}
|
||
|
||
+ /* Clear reset error flag, see ad3552r manual, rev B table 38. */
|
||
+ ret = ad3552r_write_reg(dac, AD3552R_REG_ADDR_ERR_STATUS,
|
||
+ AD3552R_MASK_RESET_STATUS);
|
||
+ if (ret)
|
||
+ return ret;
|
||
+
|
||
return ad3552r_update_reg_field(dac,
|
||
addr_mask_map[AD3552R_ADDR_ASCENSION][0],
|
||
addr_mask_map[AD3552R_ADDR_ASCENSION][1],
|
||
diff --git a/drivers/iio/filter/admv8818.c b/drivers/iio/filter/admv8818.c
|
||
index 848baa6e3bbf5d..d85b7d3de86604 100644
|
||
--- a/drivers/iio/filter/admv8818.c
|
||
+++ b/drivers/iio/filter/admv8818.c
|
||
@@ -574,21 +574,15 @@ static int admv8818_init(struct admv8818_state *st)
|
||
struct spi_device *spi = st->spi;
|
||
unsigned int chip_id;
|
||
|
||
- ret = regmap_update_bits(st->regmap, ADMV8818_REG_SPI_CONFIG_A,
|
||
- ADMV8818_SOFTRESET_N_MSK |
|
||
- ADMV8818_SOFTRESET_MSK,
|
||
- FIELD_PREP(ADMV8818_SOFTRESET_N_MSK, 1) |
|
||
- FIELD_PREP(ADMV8818_SOFTRESET_MSK, 1));
|
||
+ ret = regmap_write(st->regmap, ADMV8818_REG_SPI_CONFIG_A,
|
||
+ ADMV8818_SOFTRESET_N_MSK | ADMV8818_SOFTRESET_MSK);
|
||
if (ret) {
|
||
dev_err(&spi->dev, "ADMV8818 Soft Reset failed.\n");
|
||
return ret;
|
||
}
|
||
|
||
- ret = regmap_update_bits(st->regmap, ADMV8818_REG_SPI_CONFIG_A,
|
||
- ADMV8818_SDOACTIVE_N_MSK |
|
||
- ADMV8818_SDOACTIVE_MSK,
|
||
- FIELD_PREP(ADMV8818_SDOACTIVE_N_MSK, 1) |
|
||
- FIELD_PREP(ADMV8818_SDOACTIVE_MSK, 1));
|
||
+ ret = regmap_write(st->regmap, ADMV8818_REG_SPI_CONFIG_A,
|
||
+ ADMV8818_SDOACTIVE_N_MSK | ADMV8818_SDOACTIVE_MSK);
|
||
if (ret) {
|
||
dev_err(&spi->dev, "ADMV8818 SDO Enable failed.\n");
|
||
return ret;
|
||
diff --git a/drivers/misc/cardreader/rtsx_usb.c b/drivers/misc/cardreader/rtsx_usb.c
|
||
index 285a748748d701..f150d8769f1986 100644
|
||
--- a/drivers/misc/cardreader/rtsx_usb.c
|
||
+++ b/drivers/misc/cardreader/rtsx_usb.c
|
||
@@ -286,7 +286,6 @@ static int rtsx_usb_get_status_with_bulk(struct rtsx_ucr *ucr, u16 *status)
|
||
int rtsx_usb_get_card_status(struct rtsx_ucr *ucr, u16 *status)
|
||
{
|
||
int ret;
|
||
- u8 interrupt_val = 0;
|
||
u16 *buf;
|
||
|
||
if (!status)
|
||
@@ -309,20 +308,6 @@ int rtsx_usb_get_card_status(struct rtsx_ucr *ucr, u16 *status)
|
||
ret = rtsx_usb_get_status_with_bulk(ucr, status);
|
||
}
|
||
|
||
- rtsx_usb_read_register(ucr, CARD_INT_PEND, &interrupt_val);
|
||
- /* Cross check presence with interrupts */
|
||
- if (*status & XD_CD)
|
||
- if (!(interrupt_val & XD_INT))
|
||
- *status &= ~XD_CD;
|
||
-
|
||
- if (*status & SD_CD)
|
||
- if (!(interrupt_val & SD_INT))
|
||
- *status &= ~SD_CD;
|
||
-
|
||
- if (*status & MS_CD)
|
||
- if (!(interrupt_val & MS_INT))
|
||
- *status &= ~MS_CD;
|
||
-
|
||
/* usb_control_msg may return positive when success */
|
||
if (ret < 0)
|
||
return ret;
|
||
diff --git a/drivers/misc/eeprom/digsy_mtc_eeprom.c b/drivers/misc/eeprom/digsy_mtc_eeprom.c
|
||
index 4eddc5ba1af9c8..dfaedc0e350dbd 100644
|
||
--- a/drivers/misc/eeprom/digsy_mtc_eeprom.c
|
||
+++ b/drivers/misc/eeprom/digsy_mtc_eeprom.c
|
||
@@ -60,7 +60,7 @@ static struct platform_device digsy_mtc_eeprom = {
|
||
};
|
||
|
||
static struct gpiod_lookup_table eeprom_spi_gpiod_table = {
|
||
- .dev_id = "spi_gpio",
|
||
+ .dev_id = "spi_gpio.1",
|
||
.table = {
|
||
GPIO_LOOKUP("gpio@b00", GPIO_EEPROM_CLK,
|
||
"sck", GPIO_ACTIVE_HIGH),
|
||
diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h
|
||
index d3c03d4edbeff3..a4668ddd94551a 100644
|
||
--- a/drivers/misc/mei/hw-me-regs.h
|
||
+++ b/drivers/misc/mei/hw-me-regs.h
|
||
@@ -117,6 +117,8 @@
|
||
|
||
#define MEI_DEV_ID_LNL_M 0xA870 /* Lunar Lake Point M */
|
||
|
||
+#define MEI_DEV_ID_PTL_P 0xE470 /* Panther Lake P */
|
||
+
|
||
/*
|
||
* MEI HW Section
|
||
*/
|
||
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
|
||
index 6c4f5e9fe834dc..6826cc50d29f36 100644
|
||
--- a/drivers/misc/mei/pci-me.c
|
||
+++ b/drivers/misc/mei/pci-me.c
|
||
@@ -124,6 +124,8 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
|
||
|
||
{MEI_PCI_DEVICE(MEI_DEV_ID_LNL_M, MEI_ME_PCH15_CFG)},
|
||
|
||
+ {MEI_PCI_DEVICE(MEI_DEV_ID_PTL_P, MEI_ME_PCH15_CFG)},
|
||
+
|
||
/* required last entry */
|
||
{0, }
|
||
};
|
||
diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c
|
||
index 0b0f234b0b5080..a8b9ada7526c7a 100644
|
||
--- a/drivers/net/caif/caif_virtio.c
|
||
+++ b/drivers/net/caif/caif_virtio.c
|
||
@@ -745,7 +745,7 @@ static int cfv_probe(struct virtio_device *vdev)
|
||
|
||
if (cfv->vr_rx)
|
||
vdev->vringh_config->del_vrhs(cfv->vdev);
|
||
- if (cfv->vdev)
|
||
+ if (cfv->vq_tx)
|
||
vdev->config->del_vqs(cfv->vdev);
|
||
free_netdev(netdev);
|
||
return err;
|
||
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
|
||
index 53ead0989777ff..90ab2f1058ce0e 100644
|
||
--- a/drivers/net/dsa/mt7530.c
|
||
+++ b/drivers/net/dsa/mt7530.c
|
||
@@ -2640,7 +2640,8 @@ mt7531_setup_common(struct dsa_switch *ds)
|
||
if (ret < 0)
|
||
return ret;
|
||
|
||
- return 0;
|
||
+ /* Setup VLAN ID 0 for VLAN-unaware bridges */
|
||
+ return mt7530_setup_vlan0(priv);
|
||
}
|
||
|
||
static int
|
||
@@ -2734,11 +2735,6 @@ mt7531_setup(struct dsa_switch *ds)
|
||
|
||
mt7531_setup_common(ds);
|
||
|
||
- /* Setup VLAN ID 0 for VLAN-unaware bridges */
|
||
- ret = mt7530_setup_vlan0(priv);
|
||
- if (ret)
|
||
- return ret;
|
||
-
|
||
ds->assisted_learning_on_cpu_port = true;
|
||
ds->mtu_enforcement_ingress = true;
|
||
|
||
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
|
||
index 61fe9625bed1f2..06f42e5b5149f2 100644
|
||
--- a/drivers/net/ethernet/emulex/benet/be.h
|
||
+++ b/drivers/net/ethernet/emulex/benet/be.h
|
||
@@ -562,7 +562,7 @@ struct be_adapter {
|
||
struct be_dma_mem mbox_mem_alloced;
|
||
|
||
struct be_mcc_obj mcc_obj;
|
||
- struct mutex mcc_lock; /* For serializing mcc cmds to BE card */
|
||
+ spinlock_t mcc_lock; /* For serializing mcc cmds to BE card */
|
||
spinlock_t mcc_cq_lock;
|
||
|
||
u16 cfg_num_rx_irqs; /* configured via set-channels */
|
||
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
|
||
index 61adcebeef0107..51b8377edd1d04 100644
|
||
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
|
||
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
|
||
@@ -575,7 +575,7 @@ int be_process_mcc(struct be_adapter *adapter)
|
||
/* Wait till no more pending mcc requests are present */
|
||
static int be_mcc_wait_compl(struct be_adapter *adapter)
|
||
{
|
||
-#define mcc_timeout 12000 /* 12s timeout */
|
||
+#define mcc_timeout 120000 /* 12s timeout */
|
||
int i, status = 0;
|
||
struct be_mcc_obj *mcc_obj = &adapter->mcc_obj;
|
||
|
||
@@ -589,7 +589,7 @@ static int be_mcc_wait_compl(struct be_adapter *adapter)
|
||
|
||
if (atomic_read(&mcc_obj->q.used) == 0)
|
||
break;
|
||
- usleep_range(500, 1000);
|
||
+ udelay(100);
|
||
}
|
||
if (i == mcc_timeout) {
|
||
dev_err(&adapter->pdev->dev, "FW not responding\n");
|
||
@@ -866,7 +866,7 @@ static bool use_mcc(struct be_adapter *adapter)
|
||
static int be_cmd_lock(struct be_adapter *adapter)
|
||
{
|
||
if (use_mcc(adapter)) {
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
return 0;
|
||
} else {
|
||
return mutex_lock_interruptible(&adapter->mbox_lock);
|
||
@@ -877,7 +877,7 @@ static int be_cmd_lock(struct be_adapter *adapter)
|
||
static void be_cmd_unlock(struct be_adapter *adapter)
|
||
{
|
||
if (use_mcc(adapter))
|
||
- return mutex_unlock(&adapter->mcc_lock);
|
||
+ return spin_unlock_bh(&adapter->mcc_lock);
|
||
else
|
||
return mutex_unlock(&adapter->mbox_lock);
|
||
}
|
||
@@ -1047,7 +1047,7 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
|
||
struct be_cmd_req_mac_query *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -1076,7 +1076,7 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
|
||
}
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -1088,7 +1088,7 @@ int be_cmd_pmac_add(struct be_adapter *adapter, const u8 *mac_addr,
|
||
struct be_cmd_req_pmac_add *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -1113,7 +1113,7 @@ int be_cmd_pmac_add(struct be_adapter *adapter, const u8 *mac_addr,
|
||
}
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
|
||
if (base_status(status) == MCC_STATUS_UNAUTHORIZED_REQUEST)
|
||
status = -EPERM;
|
||
@@ -1131,7 +1131,7 @@ int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, int pmac_id, u32 dom)
|
||
if (pmac_id == -1)
|
||
return 0;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -1151,7 +1151,7 @@ int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, int pmac_id, u32 dom)
|
||
status = be_mcc_notify_wait(adapter);
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -1414,7 +1414,7 @@ int be_cmd_rxq_create(struct be_adapter *adapter,
|
||
struct be_dma_mem *q_mem = &rxq->dma_mem;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -1444,7 +1444,7 @@ int be_cmd_rxq_create(struct be_adapter *adapter,
|
||
}
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -1508,7 +1508,7 @@ int be_cmd_rxq_destroy(struct be_adapter *adapter, struct be_queue_info *q)
|
||
struct be_cmd_req_q_destroy *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -1525,7 +1525,7 @@ int be_cmd_rxq_destroy(struct be_adapter *adapter, struct be_queue_info *q)
|
||
q->created = false;
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -1593,7 +1593,7 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd)
|
||
struct be_cmd_req_hdr *hdr;
|
||
int status = 0;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -1621,7 +1621,7 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd)
|
||
adapter->stats_cmd_sent = true;
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -1637,7 +1637,7 @@ int lancer_cmd_get_pport_stats(struct be_adapter *adapter,
|
||
CMD_SUBSYSTEM_ETH))
|
||
return -EPERM;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -1660,7 +1660,7 @@ int lancer_cmd_get_pport_stats(struct be_adapter *adapter,
|
||
adapter->stats_cmd_sent = true;
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -1697,7 +1697,7 @@ int be_cmd_link_status_query(struct be_adapter *adapter, u16 *link_speed,
|
||
struct be_cmd_req_link_status *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
if (link_status)
|
||
*link_status = LINK_DOWN;
|
||
@@ -1736,7 +1736,7 @@ int be_cmd_link_status_query(struct be_adapter *adapter, u16 *link_speed,
|
||
}
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -1747,7 +1747,7 @@ int be_cmd_get_die_temperature(struct be_adapter *adapter)
|
||
struct be_cmd_req_get_cntl_addnl_attribs *req;
|
||
int status = 0;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -1762,7 +1762,7 @@ int be_cmd_get_die_temperature(struct be_adapter *adapter)
|
||
|
||
status = be_mcc_notify(adapter);
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -1811,7 +1811,7 @@ int be_cmd_get_fat_dump(struct be_adapter *adapter, u32 buf_len, void *buf)
|
||
if (!get_fat_cmd.va)
|
||
return -ENOMEM;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
while (total_size) {
|
||
buf_size = min(total_size, (u32)60 * 1024);
|
||
@@ -1849,9 +1849,9 @@ int be_cmd_get_fat_dump(struct be_adapter *adapter, u32 buf_len, void *buf)
|
||
log_offset += buf_size;
|
||
}
|
||
err:
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
dma_free_coherent(&adapter->pdev->dev, get_fat_cmd.size,
|
||
get_fat_cmd.va, get_fat_cmd.dma);
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -1862,7 +1862,7 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter)
|
||
struct be_cmd_req_get_fw_version *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -1885,7 +1885,7 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter)
|
||
sizeof(adapter->fw_on_flash));
|
||
}
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -1899,7 +1899,7 @@ static int __be_cmd_modify_eqd(struct be_adapter *adapter,
|
||
struct be_cmd_req_modify_eq_delay *req;
|
||
int status = 0, i;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -1922,7 +1922,7 @@ static int __be_cmd_modify_eqd(struct be_adapter *adapter,
|
||
|
||
status = be_mcc_notify(adapter);
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -1949,7 +1949,7 @@ int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array,
|
||
struct be_cmd_req_vlan_config *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -1971,7 +1971,7 @@ int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array,
|
||
|
||
status = be_mcc_notify_wait(adapter);
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -1982,7 +1982,7 @@ static int __be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value)
|
||
struct be_cmd_req_rx_filter *req = mem->va;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -2015,7 +2015,7 @@ static int __be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value)
|
||
|
||
status = be_mcc_notify_wait(adapter);
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -2046,7 +2046,7 @@ int be_cmd_set_flow_control(struct be_adapter *adapter, u32 tx_fc, u32 rx_fc)
|
||
CMD_SUBSYSTEM_COMMON))
|
||
return -EPERM;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -2066,7 +2066,7 @@ int be_cmd_set_flow_control(struct be_adapter *adapter, u32 tx_fc, u32 rx_fc)
|
||
status = be_mcc_notify_wait(adapter);
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
|
||
if (base_status(status) == MCC_STATUS_FEATURE_NOT_SUPPORTED)
|
||
return -EOPNOTSUPP;
|
||
@@ -2085,7 +2085,7 @@ int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc)
|
||
CMD_SUBSYSTEM_COMMON))
|
||
return -EPERM;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -2108,7 +2108,7 @@ int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc)
|
||
}
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -2189,7 +2189,7 @@ int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable,
|
||
if (!(be_if_cap_flags(adapter) & BE_IF_FLAGS_RSS))
|
||
return 0;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -2214,7 +2214,7 @@ int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable,
|
||
|
||
status = be_mcc_notify_wait(adapter);
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -2226,7 +2226,7 @@ int be_cmd_set_beacon_state(struct be_adapter *adapter, u8 port_num,
|
||
struct be_cmd_req_enable_disable_beacon *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -2247,7 +2247,7 @@ int be_cmd_set_beacon_state(struct be_adapter *adapter, u8 port_num,
|
||
status = be_mcc_notify_wait(adapter);
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -2258,7 +2258,7 @@ int be_cmd_get_beacon_state(struct be_adapter *adapter, u8 port_num, u32 *state)
|
||
struct be_cmd_req_get_beacon_state *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -2282,7 +2282,7 @@ int be_cmd_get_beacon_state(struct be_adapter *adapter, u8 port_num, u32 *state)
|
||
}
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -2306,7 +2306,7 @@ int be_cmd_read_port_transceiver_data(struct be_adapter *adapter,
|
||
return -ENOMEM;
|
||
}
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -2328,7 +2328,7 @@ int be_cmd_read_port_transceiver_data(struct be_adapter *adapter,
|
||
memcpy(data, resp->page_data + off, len);
|
||
}
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, cmd.dma);
|
||
return status;
|
||
}
|
||
@@ -2345,7 +2345,7 @@ static int lancer_cmd_write_object(struct be_adapter *adapter,
|
||
void *ctxt = NULL;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
adapter->flash_status = 0;
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
@@ -2387,7 +2387,7 @@ static int lancer_cmd_write_object(struct be_adapter *adapter,
|
||
if (status)
|
||
goto err_unlock;
|
||
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
|
||
if (!wait_for_completion_timeout(&adapter->et_cmd_compl,
|
||
msecs_to_jiffies(60000)))
|
||
@@ -2406,7 +2406,7 @@ static int lancer_cmd_write_object(struct be_adapter *adapter,
|
||
return status;
|
||
|
||
err_unlock:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -2460,7 +2460,7 @@ static int lancer_cmd_delete_object(struct be_adapter *adapter,
|
||
struct be_mcc_wrb *wrb;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -2478,7 +2478,7 @@ static int lancer_cmd_delete_object(struct be_adapter *adapter,
|
||
|
||
status = be_mcc_notify_wait(adapter);
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -2491,7 +2491,7 @@ int lancer_cmd_read_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
|
||
struct lancer_cmd_resp_read_object *resp;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -2525,7 +2525,7 @@ int lancer_cmd_read_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
|
||
}
|
||
|
||
err_unlock:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -2537,7 +2537,7 @@ static int be_cmd_write_flashrom(struct be_adapter *adapter,
|
||
struct be_cmd_write_flashrom *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
adapter->flash_status = 0;
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
@@ -2562,7 +2562,7 @@ static int be_cmd_write_flashrom(struct be_adapter *adapter,
|
||
if (status)
|
||
goto err_unlock;
|
||
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
|
||
if (!wait_for_completion_timeout(&adapter->et_cmd_compl,
|
||
msecs_to_jiffies(40000)))
|
||
@@ -2573,7 +2573,7 @@ static int be_cmd_write_flashrom(struct be_adapter *adapter,
|
||
return status;
|
||
|
||
err_unlock:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -2584,7 +2584,7 @@ static int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc,
|
||
struct be_mcc_wrb *wrb;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -2611,7 +2611,7 @@ static int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc,
|
||
memcpy(flashed_crc, req->crc, 4);
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -3217,7 +3217,7 @@ int be_cmd_enable_magic_wol(struct be_adapter *adapter, u8 *mac,
|
||
struct be_cmd_req_acpi_wol_magic_config *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -3234,7 +3234,7 @@ int be_cmd_enable_magic_wol(struct be_adapter *adapter, u8 *mac,
|
||
status = be_mcc_notify_wait(adapter);
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -3249,7 +3249,7 @@ int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num,
|
||
CMD_SUBSYSTEM_LOWLEVEL))
|
||
return -EPERM;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -3272,7 +3272,7 @@ int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num,
|
||
if (status)
|
||
goto err_unlock;
|
||
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
|
||
if (!wait_for_completion_timeout(&adapter->et_cmd_compl,
|
||
msecs_to_jiffies(SET_LB_MODE_TIMEOUT)))
|
||
@@ -3281,7 +3281,7 @@ int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num,
|
||
return status;
|
||
|
||
err_unlock:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -3298,7 +3298,7 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num,
|
||
CMD_SUBSYSTEM_LOWLEVEL))
|
||
return -EPERM;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -3324,7 +3324,7 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num,
|
||
if (status)
|
||
goto err;
|
||
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
|
||
wait_for_completion(&adapter->et_cmd_compl);
|
||
resp = embedded_payload(wrb);
|
||
@@ -3332,7 +3332,7 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num,
|
||
|
||
return status;
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -3348,7 +3348,7 @@ int be_cmd_ddr_dma_test(struct be_adapter *adapter, u64 pattern,
|
||
CMD_SUBSYSTEM_LOWLEVEL))
|
||
return -EPERM;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -3382,7 +3382,7 @@ int be_cmd_ddr_dma_test(struct be_adapter *adapter, u64 pattern,
|
||
}
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -3393,7 +3393,7 @@ int be_cmd_get_seeprom_data(struct be_adapter *adapter,
|
||
struct be_cmd_req_seeprom_read *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -3409,7 +3409,7 @@ int be_cmd_get_seeprom_data(struct be_adapter *adapter,
|
||
status = be_mcc_notify_wait(adapter);
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -3424,7 +3424,7 @@ int be_cmd_get_phy_info(struct be_adapter *adapter)
|
||
CMD_SUBSYSTEM_COMMON))
|
||
return -EPERM;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -3469,7 +3469,7 @@ int be_cmd_get_phy_info(struct be_adapter *adapter)
|
||
}
|
||
dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, cmd.dma);
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -3479,7 +3479,7 @@ static int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain)
|
||
struct be_cmd_req_set_qos *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -3499,7 +3499,7 @@ static int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain)
|
||
status = be_mcc_notify_wait(adapter);
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -3611,7 +3611,7 @@ int be_cmd_get_fn_privileges(struct be_adapter *adapter, u32 *privilege,
|
||
struct be_cmd_req_get_fn_privileges *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -3643,7 +3643,7 @@ int be_cmd_get_fn_privileges(struct be_adapter *adapter, u32 *privilege,
|
||
}
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -3655,7 +3655,7 @@ int be_cmd_set_fn_privileges(struct be_adapter *adapter, u32 privileges,
|
||
struct be_cmd_req_set_fn_privileges *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -3675,7 +3675,7 @@ int be_cmd_set_fn_privileges(struct be_adapter *adapter, u32 privileges,
|
||
|
||
status = be_mcc_notify_wait(adapter);
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -3707,7 +3707,7 @@ int be_cmd_get_mac_from_list(struct be_adapter *adapter, u8 *mac,
|
||
return -ENOMEM;
|
||
}
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -3771,7 +3771,7 @@ int be_cmd_get_mac_from_list(struct be_adapter *adapter, u8 *mac,
|
||
}
|
||
|
||
out:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
dma_free_coherent(&adapter->pdev->dev, get_mac_list_cmd.size,
|
||
get_mac_list_cmd.va, get_mac_list_cmd.dma);
|
||
return status;
|
||
@@ -3831,7 +3831,7 @@ int be_cmd_set_mac_list(struct be_adapter *adapter, u8 *mac_array,
|
||
if (!cmd.va)
|
||
return -ENOMEM;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -3853,7 +3853,7 @@ int be_cmd_set_mac_list(struct be_adapter *adapter, u8 *mac_array,
|
||
|
||
err:
|
||
dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, cmd.dma);
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -3889,7 +3889,7 @@ int be_cmd_set_hsw_config(struct be_adapter *adapter, u16 pvid,
|
||
CMD_SUBSYSTEM_COMMON))
|
||
return -EPERM;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -3930,7 +3930,7 @@ int be_cmd_set_hsw_config(struct be_adapter *adapter, u16 pvid,
|
||
status = be_mcc_notify_wait(adapter);
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -3944,7 +3944,7 @@ int be_cmd_get_hsw_config(struct be_adapter *adapter, u16 *pvid,
|
||
int status;
|
||
u16 vid;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -3991,7 +3991,7 @@ int be_cmd_get_hsw_config(struct be_adapter *adapter, u16 *pvid,
|
||
}
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -4190,7 +4190,7 @@ int be_cmd_set_ext_fat_capabilites(struct be_adapter *adapter,
|
||
struct be_cmd_req_set_ext_fat_caps *req;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -4206,7 +4206,7 @@ int be_cmd_set_ext_fat_capabilites(struct be_adapter *adapter,
|
||
|
||
status = be_mcc_notify_wait(adapter);
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -4684,7 +4684,7 @@ int be_cmd_manage_iface(struct be_adapter *adapter, u32 iface, u8 op)
|
||
if (iface == 0xFFFFFFFF)
|
||
return -1;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -4701,7 +4701,7 @@ int be_cmd_manage_iface(struct be_adapter *adapter, u32 iface, u8 op)
|
||
|
||
status = be_mcc_notify_wait(adapter);
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -4735,7 +4735,7 @@ int be_cmd_get_if_id(struct be_adapter *adapter, struct be_vf_cfg *vf_cfg,
|
||
struct be_cmd_resp_get_iface_list *resp;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -4756,7 +4756,7 @@ int be_cmd_get_if_id(struct be_adapter *adapter, struct be_vf_cfg *vf_cfg,
|
||
}
|
||
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -4850,7 +4850,7 @@ int be_cmd_enable_vf(struct be_adapter *adapter, u8 domain)
|
||
if (BEx_chip(adapter))
|
||
return 0;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -4868,7 +4868,7 @@ int be_cmd_enable_vf(struct be_adapter *adapter, u8 domain)
|
||
req->enable = 1;
|
||
status = be_mcc_notify_wait(adapter);
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -4941,7 +4941,7 @@ __be_cmd_set_logical_link_config(struct be_adapter *adapter,
|
||
u32 link_config = 0;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -4969,7 +4969,7 @@ __be_cmd_set_logical_link_config(struct be_adapter *adapter,
|
||
|
||
status = be_mcc_notify_wait(adapter);
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -5000,8 +5000,7 @@ int be_cmd_set_features(struct be_adapter *adapter)
|
||
struct be_mcc_wrb *wrb;
|
||
int status;
|
||
|
||
- if (mutex_lock_interruptible(&adapter->mcc_lock))
|
||
- return -1;
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -5039,7 +5038,7 @@ int be_cmd_set_features(struct be_adapter *adapter)
|
||
dev_info(&adapter->pdev->dev,
|
||
"Adapter does not support HW error recovery\n");
|
||
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
|
||
@@ -5053,7 +5052,7 @@ int be_roce_mcc_cmd(void *netdev_handle, void *wrb_payload,
|
||
struct be_cmd_resp_hdr *resp;
|
||
int status;
|
||
|
||
- mutex_lock(&adapter->mcc_lock);
|
||
+ spin_lock_bh(&adapter->mcc_lock);
|
||
|
||
wrb = wrb_from_mccq(adapter);
|
||
if (!wrb) {
|
||
@@ -5076,7 +5075,7 @@ int be_roce_mcc_cmd(void *netdev_handle, void *wrb_payload,
|
||
memcpy(wrb_payload, resp, sizeof(*resp) + resp->response_length);
|
||
be_dws_le_to_cpu(wrb_payload, sizeof(*resp) + resp->response_length);
|
||
err:
|
||
- mutex_unlock(&adapter->mcc_lock);
|
||
+ spin_unlock_bh(&adapter->mcc_lock);
|
||
return status;
|
||
}
|
||
EXPORT_SYMBOL(be_roce_mcc_cmd);
|
||
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
|
||
index 9d425ece33fd2a..6bc0fde95f9dcf 100644
|
||
--- a/drivers/net/ethernet/emulex/benet/be_main.c
|
||
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
|
||
@@ -5670,8 +5670,8 @@ static int be_drv_init(struct be_adapter *adapter)
|
||
}
|
||
|
||
mutex_init(&adapter->mbox_lock);
|
||
- mutex_init(&adapter->mcc_lock);
|
||
mutex_init(&adapter->rx_filter_lock);
|
||
+ spin_lock_init(&adapter->mcc_lock);
|
||
spin_lock_init(&adapter->mcc_cq_lock);
|
||
init_completion(&adapter->et_cmd_compl);
|
||
|
||
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
|
||
index 9aa57134f460cd..8feb7d4226bb58 100644
|
||
--- a/drivers/net/ethernet/freescale/enetc/enetc.c
|
||
+++ b/drivers/net/ethernet/freescale/enetc/enetc.c
|
||
@@ -1023,7 +1023,6 @@ static int enetc_refill_rx_ring(struct enetc_bdr *rx_ring, const int buff_cnt)
|
||
return j;
|
||
}
|
||
|
||
-#ifdef CONFIG_FSL_ENETC_PTP_CLOCK
|
||
static void enetc_get_rx_tstamp(struct net_device *ndev,
|
||
union enetc_rx_bd *rxbd,
|
||
struct sk_buff *skb)
|
||
@@ -1047,7 +1046,6 @@ static void enetc_get_rx_tstamp(struct net_device *ndev,
|
||
shhwtstamps->hwtstamp = ns_to_ktime(tstamp);
|
||
}
|
||
}
|
||
-#endif
|
||
|
||
static void enetc_get_offloads(struct enetc_bdr *rx_ring,
|
||
union enetc_rx_bd *rxbd, struct sk_buff *skb)
|
||
@@ -1087,10 +1085,9 @@ static void enetc_get_offloads(struct enetc_bdr *rx_ring,
|
||
__vlan_hwaccel_put_tag(skb, tpid, le16_to_cpu(rxbd->r.vlan_opt));
|
||
}
|
||
|
||
-#ifdef CONFIG_FSL_ENETC_PTP_CLOCK
|
||
- if (priv->active_offloads & ENETC_F_RX_TSTAMP)
|
||
+ if (IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK) &&
|
||
+ (priv->active_offloads & ENETC_F_RX_TSTAMP))
|
||
enetc_get_rx_tstamp(rx_ring->ndev, rxbd, skb);
|
||
-#endif
|
||
}
|
||
|
||
/* This gets called during the non-XDP NAPI poll cycle as well as on XDP_PASS,
|
||
@@ -2956,7 +2953,6 @@ void enetc_set_features(struct net_device *ndev, netdev_features_t features)
|
||
}
|
||
EXPORT_SYMBOL_GPL(enetc_set_features);
|
||
|
||
-#ifdef CONFIG_FSL_ENETC_PTP_CLOCK
|
||
static int enetc_hwtstamp_set(struct net_device *ndev, struct ifreq *ifr)
|
||
{
|
||
struct enetc_ndev_priv *priv = netdev_priv(ndev);
|
||
@@ -2975,6 +2971,9 @@ static int enetc_hwtstamp_set(struct net_device *ndev, struct ifreq *ifr)
|
||
new_offloads |= ENETC_F_TX_TSTAMP;
|
||
break;
|
||
case HWTSTAMP_TX_ONESTEP_SYNC:
|
||
+ if (!enetc_si_is_pf(priv->si))
|
||
+ return -EOPNOTSUPP;
|
||
+
|
||
new_offloads &= ~ENETC_F_TX_TSTAMP_MASK;
|
||
new_offloads |= ENETC_F_TX_ONESTEP_SYNC_TSTAMP;
|
||
break;
|
||
@@ -3025,17 +3024,17 @@ static int enetc_hwtstamp_get(struct net_device *ndev, struct ifreq *ifr)
|
||
return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ?
|
||
-EFAULT : 0;
|
||
}
|
||
-#endif
|
||
|
||
int enetc_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
|
||
{
|
||
struct enetc_ndev_priv *priv = netdev_priv(ndev);
|
||
-#ifdef CONFIG_FSL_ENETC_PTP_CLOCK
|
||
- if (cmd == SIOCSHWTSTAMP)
|
||
- return enetc_hwtstamp_set(ndev, rq);
|
||
- if (cmd == SIOCGHWTSTAMP)
|
||
- return enetc_hwtstamp_get(ndev, rq);
|
||
-#endif
|
||
+
|
||
+ if (IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK)) {
|
||
+ if (cmd == SIOCSHWTSTAMP)
|
||
+ return enetc_hwtstamp_set(ndev, rq);
|
||
+ if (cmd == SIOCGHWTSTAMP)
|
||
+ return enetc_hwtstamp_get(ndev, rq);
|
||
+ }
|
||
|
||
if (!priv->phylink)
|
||
return -EOPNOTSUPP;
|
||
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.h b/drivers/net/ethernet/freescale/enetc/enetc.h
|
||
index fcadb0848d2541..860ecee302f1a6 100644
|
||
--- a/drivers/net/ethernet/freescale/enetc/enetc.h
|
||
+++ b/drivers/net/ethernet/freescale/enetc/enetc.h
|
||
@@ -184,10 +184,9 @@ static inline union enetc_rx_bd *enetc_rxbd(struct enetc_bdr *rx_ring, int i)
|
||
{
|
||
int hw_idx = i;
|
||
|
||
-#ifdef CONFIG_FSL_ENETC_PTP_CLOCK
|
||
- if (rx_ring->ext_en)
|
||
+ if (IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK) && rx_ring->ext_en)
|
||
hw_idx = 2 * i;
|
||
-#endif
|
||
+
|
||
return &(((union enetc_rx_bd *)rx_ring->bd_base)[hw_idx]);
|
||
}
|
||
|
||
@@ -199,10 +198,8 @@ static inline void enetc_rxbd_next(struct enetc_bdr *rx_ring,
|
||
|
||
new_rxbd++;
|
||
|
||
-#ifdef CONFIG_FSL_ENETC_PTP_CLOCK
|
||
- if (rx_ring->ext_en)
|
||
+ if (IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK) && rx_ring->ext_en)
|
||
new_rxbd++;
|
||
-#endif
|
||
|
||
if (unlikely(++new_index == rx_ring->bd_count)) {
|
||
new_rxbd = rx_ring->bd_base;
|
||
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
|
||
index e993ed04ab5720..1e3e0073276ecb 100644
|
||
--- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
|
||
+++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
|
||
@@ -840,34 +840,35 @@ static int enetc_set_coalesce(struct net_device *ndev,
|
||
static int enetc_get_ts_info(struct net_device *ndev,
|
||
struct ethtool_ts_info *info)
|
||
{
|
||
+ struct enetc_ndev_priv *priv = netdev_priv(ndev);
|
||
int *phc_idx;
|
||
|
||
phc_idx = symbol_get(enetc_phc_index);
|
||
if (phc_idx) {
|
||
info->phc_index = *phc_idx;
|
||
symbol_put(enetc_phc_index);
|
||
- } else {
|
||
- info->phc_index = -1;
|
||
}
|
||
|
||
-#ifdef CONFIG_FSL_ENETC_PTP_CLOCK
|
||
+ if (!IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK)) {
|
||
+ info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE;
|
||
+
|
||
+ return 0;
|
||
+ }
|
||
+
|
||
info->so_timestamping = SOF_TIMESTAMPING_TX_HARDWARE |
|
||
SOF_TIMESTAMPING_RX_HARDWARE |
|
||
SOF_TIMESTAMPING_RAW_HARDWARE |
|
||
- SOF_TIMESTAMPING_TX_SOFTWARE |
|
||
- SOF_TIMESTAMPING_RX_SOFTWARE |
|
||
- SOF_TIMESTAMPING_SOFTWARE;
|
||
+ SOF_TIMESTAMPING_TX_SOFTWARE;
|
||
|
||
info->tx_types = (1 << HWTSTAMP_TX_OFF) |
|
||
- (1 << HWTSTAMP_TX_ON) |
|
||
- (1 << HWTSTAMP_TX_ONESTEP_SYNC);
|
||
+ (1 << HWTSTAMP_TX_ON);
|
||
+
|
||
+ if (enetc_si_is_pf(priv->si))
|
||
+ info->tx_types |= (1 << HWTSTAMP_TX_ONESTEP_SYNC);
|
||
+
|
||
info->rx_filters = (1 << HWTSTAMP_FILTER_NONE) |
|
||
(1 << HWTSTAMP_FILTER_ALL);
|
||
-#else
|
||
- info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
|
||
- SOF_TIMESTAMPING_TX_SOFTWARE |
|
||
- SOF_TIMESTAMPING_SOFTWARE;
|
||
-#endif
|
||
+
|
||
return 0;
|
||
}
|
||
|
||
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c
|
||
index 507d7ce26d8317..ddc691424c8163 100644
|
||
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c
|
||
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c
|
||
@@ -484,7 +484,7 @@ int hclge_ptp_init(struct hclge_dev *hdev)
|
||
|
||
ret = hclge_ptp_get_cycle(hdev);
|
||
if (ret)
|
||
- return ret;
|
||
+ goto out;
|
||
}
|
||
|
||
ret = hclge_ptp_int_en(hdev, true);
|
||
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
|
||
index 4f18addc191b85..05f410999a5a13 100644
|
||
--- a/drivers/net/ethernet/ibm/ibmvnic.c
|
||
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
|
||
@@ -2427,6 +2427,7 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
|
||
unsigned int skblen;
|
||
union sub_crq tx_crq;
|
||
unsigned int offset;
|
||
+ bool use_scrq_send_direct = false;
|
||
int num_entries = 1;
|
||
unsigned char *dst;
|
||
int bufidx = 0;
|
||
@@ -2486,6 +2487,20 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
|
||
memset(dst, 0, tx_pool->buf_size);
|
||
data_dma_addr = ltb->addr + offset;
|
||
|
||
+ /* if we are going to send_subcrq_direct this then we need to
|
||
+ * update the checksum before copying the data into ltb. Essentially
|
||
+ * these packets force disable CSO so that we can guarantee that
|
||
+ * FW does not need header info and we can send direct. Also, vnic
|
||
+ * server must be able to xmit standard packets without header data
|
||
+ */
|
||
+ if (*hdrs == 0 && !skb_is_gso(skb) &&
|
||
+ !ind_bufp->index && !netdev_xmit_more()) {
|
||
+ use_scrq_send_direct = true;
|
||
+ if (skb->ip_summed == CHECKSUM_PARTIAL &&
|
||
+ skb_checksum_help(skb))
|
||
+ use_scrq_send_direct = false;
|
||
+ }
|
||
+
|
||
if (skb_shinfo(skb)->nr_frags) {
|
||
int cur, i;
|
||
|
||
@@ -2571,11 +2586,13 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
|
||
tx_crq.v1.flags1 |= IBMVNIC_TX_LSO;
|
||
tx_crq.v1.mss = cpu_to_be16(skb_shinfo(skb)->gso_size);
|
||
hdrs += 2;
|
||
- } else if (!ind_bufp->index && !netdev_xmit_more()) {
|
||
- ind_bufp->indir_arr[0] = tx_crq;
|
||
+ } else if (use_scrq_send_direct) {
|
||
+ /* See above comment, CSO disabled with direct xmit */
|
||
+ tx_crq.v1.flags1 &= ~(IBMVNIC_TX_CHKSUM_OFFLOAD);
|
||
ind_bufp->index = 1;
|
||
tx_buff->num_entries = 1;
|
||
netdev_tx_sent_queue(txq, skb->len);
|
||
+ ind_bufp->indir_arr[0] = tx_crq;
|
||
lpar_rc = ibmvnic_tx_scrq_flush(adapter, tx_scrq, false);
|
||
if (lpar_rc != H_SUCCESS)
|
||
goto tx_err;
|
||
diff --git a/drivers/net/ipa/data/ipa_data-v4.7.c b/drivers/net/ipa/data/ipa_data-v4.7.c
|
||
index b83390c4861580..1e4a9f632eddf5 100644
|
||
--- a/drivers/net/ipa/data/ipa_data-v4.7.c
|
||
+++ b/drivers/net/ipa/data/ipa_data-v4.7.c
|
||
@@ -27,20 +27,18 @@ enum ipa_resource_type {
|
||
enum ipa_rsrc_group_id {
|
||
/* Source resource group identifiers */
|
||
IPA_RSRC_GROUP_SRC_UL_DL = 0,
|
||
- IPA_RSRC_GROUP_SRC_UC_RX_Q,
|
||
IPA_RSRC_GROUP_SRC_COUNT, /* Last in set; not a source group */
|
||
|
||
/* Destination resource group identifiers */
|
||
- IPA_RSRC_GROUP_DST_UL_DL_DPL = 0,
|
||
- IPA_RSRC_GROUP_DST_UNUSED_1,
|
||
+ IPA_RSRC_GROUP_DST_UL_DL = 0,
|
||
IPA_RSRC_GROUP_DST_COUNT, /* Last; not a destination group */
|
||
};
|
||
|
||
/* QSB configuration data for an SoC having IPA v4.7 */
|
||
static const struct ipa_qsb_data ipa_qsb_data[] = {
|
||
[IPA_QSB_MASTER_DDR] = {
|
||
- .max_writes = 8,
|
||
- .max_reads = 0, /* no limit (hardware max) */
|
||
+ .max_writes = 12,
|
||
+ .max_reads = 13,
|
||
.max_reads_beats = 120,
|
||
},
|
||
};
|
||
@@ -80,7 +78,7 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
|
||
},
|
||
.endpoint = {
|
||
.config = {
|
||
- .resource_group = IPA_RSRC_GROUP_DST_UL_DL_DPL,
|
||
+ .resource_group = IPA_RSRC_GROUP_DST_UL_DL,
|
||
.aggregation = true,
|
||
.status_enable = true,
|
||
.rx = {
|
||
@@ -105,6 +103,7 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
|
||
.filter_support = true,
|
||
.config = {
|
||
.resource_group = IPA_RSRC_GROUP_SRC_UL_DL,
|
||
+ .checksum = true,
|
||
.qmap = true,
|
||
.status_enable = true,
|
||
.tx = {
|
||
@@ -127,7 +126,8 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
|
||
},
|
||
.endpoint = {
|
||
.config = {
|
||
- .resource_group = IPA_RSRC_GROUP_DST_UL_DL_DPL,
|
||
+ .resource_group = IPA_RSRC_GROUP_DST_UL_DL,
|
||
+ .checksum = true,
|
||
.qmap = true,
|
||
.aggregation = true,
|
||
.rx = {
|
||
@@ -196,12 +196,12 @@ static const struct ipa_resource ipa_resource_src[] = {
|
||
/* Destination resource configuration data for an SoC having IPA v4.7 */
|
||
static const struct ipa_resource ipa_resource_dst[] = {
|
||
[IPA_RESOURCE_TYPE_DST_DATA_SECTORS] = {
|
||
- .limits[IPA_RSRC_GROUP_DST_UL_DL_DPL] = {
|
||
+ .limits[IPA_RSRC_GROUP_DST_UL_DL] = {
|
||
.min = 7, .max = 7,
|
||
},
|
||
},
|
||
[IPA_RESOURCE_TYPE_DST_DPS_DMARS] = {
|
||
- .limits[IPA_RSRC_GROUP_DST_UL_DL_DPL] = {
|
||
+ .limits[IPA_RSRC_GROUP_DST_UL_DL] = {
|
||
.min = 2, .max = 2,
|
||
},
|
||
},
|
||
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
|
||
index 90f1cfbc7c50b3..ee1527cf3d0c4c 100644
|
||
--- a/drivers/net/ppp/ppp_generic.c
|
||
+++ b/drivers/net/ppp/ppp_generic.c
|
||
@@ -72,6 +72,17 @@
|
||
#define PPP_PROTO_LEN 2
|
||
#define PPP_LCP_HDRLEN 4
|
||
|
||
+/* The filter instructions generated by libpcap are constructed
|
||
+ * assuming a four-byte PPP header on each packet, where the last
|
||
+ * 2 bytes are the protocol field defined in the RFC and the first
|
||
+ * byte of the first 2 bytes indicates the direction.
|
||
+ * The second byte is currently unused, but we still need to initialize
|
||
+ * it to prevent crafted BPF programs from reading them which would
|
||
+ * cause reading of uninitialized data.
|
||
+ */
|
||
+#define PPP_FILTER_OUTBOUND_TAG 0x0100
|
||
+#define PPP_FILTER_INBOUND_TAG 0x0000
|
||
+
|
||
/*
|
||
* An instance of /dev/ppp can be associated with either a ppp
|
||
* interface unit or a ppp channel. In both cases, file->private_data
|
||
@@ -1762,10 +1773,10 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
|
||
|
||
if (proto < 0x8000) {
|
||
#ifdef CONFIG_PPP_FILTER
|
||
- /* check if we should pass this packet */
|
||
- /* the filter instructions are constructed assuming
|
||
- a four-byte PPP header on each packet */
|
||
- *(u8 *)skb_push(skb, 2) = 1;
|
||
+ /* check if the packet passes the pass and active filters.
|
||
+ * See comment for PPP_FILTER_OUTBOUND_TAG above.
|
||
+ */
|
||
+ *(__be16 *)skb_push(skb, 2) = htons(PPP_FILTER_OUTBOUND_TAG);
|
||
if (ppp->pass_filter &&
|
||
bpf_prog_run(ppp->pass_filter, skb) == 0) {
|
||
if (ppp->debug & 1)
|
||
@@ -2482,14 +2493,13 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
|
||
/* network protocol frame - give it to the kernel */
|
||
|
||
#ifdef CONFIG_PPP_FILTER
|
||
- /* check if the packet passes the pass and active filters */
|
||
- /* the filter instructions are constructed assuming
|
||
- a four-byte PPP header on each packet */
|
||
if (ppp->pass_filter || ppp->active_filter) {
|
||
if (skb_unclone(skb, GFP_ATOMIC))
|
||
goto err;
|
||
-
|
||
- *(u8 *)skb_push(skb, 2) = 0;
|
||
+ /* Check if the packet passes the pass and active filters.
|
||
+ * See comment for PPP_FILTER_INBOUND_TAG above.
|
||
+ */
|
||
+ *(__be16 *)skb_push(skb, 2) = htons(PPP_FILTER_INBOUND_TAG);
|
||
if (ppp->pass_filter &&
|
||
bpf_prog_run(ppp->pass_filter, skb) == 0) {
|
||
if (ppp->debug & 1)
|
||
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
|
||
index 47bea1855e8c8d..42f7f95dac225e 100644
|
||
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
|
||
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
|
||
@@ -1200,7 +1200,7 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
|
||
|
||
if (tlv_len != sizeof(*fseq_ver))
|
||
goto invalid_tlv_len;
|
||
- IWL_INFO(drv, "TLV_FW_FSEQ_VERSION: %s\n",
|
||
+ IWL_INFO(drv, "TLV_FW_FSEQ_VERSION: %.32s\n",
|
||
fseq_ver->version);
|
||
}
|
||
break;
|
||
diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
|
||
index bd142aed20f456..a0af659a4c4a21 100644
|
||
--- a/drivers/nvme/target/tcp.c
|
||
+++ b/drivers/nvme/target/tcp.c
|
||
@@ -547,10 +547,16 @@ static void nvmet_tcp_queue_response(struct nvmet_req *req)
|
||
struct nvmet_tcp_cmd *cmd =
|
||
container_of(req, struct nvmet_tcp_cmd, req);
|
||
struct nvmet_tcp_queue *queue = cmd->queue;
|
||
+ enum nvmet_tcp_recv_state queue_state;
|
||
+ struct nvmet_tcp_cmd *queue_cmd;
|
||
struct nvme_sgl_desc *sgl;
|
||
u32 len;
|
||
|
||
- if (unlikely(cmd == queue->cmd)) {
|
||
+ /* Pairs with store_release in nvmet_prepare_receive_pdu() */
|
||
+ queue_state = smp_load_acquire(&queue->rcv_state);
|
||
+ queue_cmd = READ_ONCE(queue->cmd);
|
||
+
|
||
+ if (unlikely(cmd == queue_cmd)) {
|
||
sgl = &cmd->req.cmd->common.dptr.sgl;
|
||
len = le32_to_cpu(sgl->length);
|
||
|
||
@@ -559,7 +565,7 @@ static void nvmet_tcp_queue_response(struct nvmet_req *req)
|
||
* Avoid using helpers, this might happen before
|
||
* nvmet_req_init is completed.
|
||
*/
|
||
- if (queue->rcv_state == NVMET_TCP_RECV_PDU &&
|
||
+ if (queue_state == NVMET_TCP_RECV_PDU &&
|
||
len && len <= cmd->req.port->inline_data_size &&
|
||
nvme_is_write(cmd->req.cmd))
|
||
return;
|
||
@@ -823,8 +829,9 @@ static void nvmet_prepare_receive_pdu(struct nvmet_tcp_queue *queue)
|
||
{
|
||
queue->offset = 0;
|
||
queue->left = sizeof(struct nvme_tcp_hdr);
|
||
- queue->cmd = NULL;
|
||
- queue->rcv_state = NVMET_TCP_RECV_PDU;
|
||
+ WRITE_ONCE(queue->cmd, NULL);
|
||
+ /* Ensure rcv_state is visible only after queue->cmd is set */
|
||
+ smp_store_release(&queue->rcv_state, NVMET_TCP_RECV_PDU);
|
||
}
|
||
|
||
static void nvmet_tcp_free_crypto(struct nvmet_tcp_queue *queue)
|
||
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
|
||
index 4a30daa0a9b9cc..959f1808c240fa 100644
|
||
--- a/drivers/of/of_reserved_mem.c
|
||
+++ b/drivers/of/of_reserved_mem.c
|
||
@@ -156,12 +156,12 @@ static int __init __reserved_mem_alloc_size(unsigned long node,
|
||
|
||
prop = of_get_flat_dt_prop(node, "alignment", &len);
|
||
if (prop) {
|
||
- if (len != dt_root_size_cells * sizeof(__be32)) {
|
||
+ if (len != dt_root_addr_cells * sizeof(__be32)) {
|
||
pr_err("invalid alignment property in '%s' node.\n",
|
||
uname);
|
||
return -EINVAL;
|
||
}
|
||
- align = dt_mem_next_cell(dt_root_size_cells, &prop);
|
||
+ align = dt_mem_next_cell(dt_root_addr_cells, &prop);
|
||
}
|
||
|
||
nomap = of_get_flat_dt_prop(node, "no-map", NULL) != NULL;
|
||
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
|
||
index 964670d4ca1e2a..692bd6fea3744e 100644
|
||
--- a/drivers/platform/x86/thinkpad_acpi.c
|
||
+++ b/drivers/platform/x86/thinkpad_acpi.c
|
||
@@ -9911,6 +9911,7 @@ static const struct tpacpi_quirk battery_quirk_table[] __initconst = {
|
||
* Individual addressing is broken on models that expose the
|
||
* primary battery as BAT1.
|
||
*/
|
||
+ TPACPI_Q_LNV('G', '8', true), /* ThinkPad X131e */
|
||
TPACPI_Q_LNV('8', 'F', true), /* Thinkpad X120e */
|
||
TPACPI_Q_LNV('J', '7', true), /* B5400 */
|
||
TPACPI_Q_LNV('J', 'I', true), /* Thinkpad 11e */
|
||
diff --git a/drivers/rapidio/devices/rio_mport_cdev.c b/drivers/rapidio/devices/rio_mport_cdev.c
|
||
index a115730ebf1461..ca5d06060e0577 100644
|
||
--- a/drivers/rapidio/devices/rio_mport_cdev.c
|
||
+++ b/drivers/rapidio/devices/rio_mport_cdev.c
|
||
@@ -1740,7 +1740,8 @@ static int rio_mport_add_riodev(struct mport_cdev_priv *priv,
|
||
err = rio_add_net(net);
|
||
if (err) {
|
||
rmcd_debug(RDEV, "failed to register net, err=%d", err);
|
||
- kfree(net);
|
||
+ put_device(&net->dev);
|
||
+ mport->net = NULL;
|
||
goto cleanup;
|
||
}
|
||
}
|
||
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
|
||
index fdcf742b2adbcb..c12941f71e2cba 100644
|
||
--- a/drivers/rapidio/rio-scan.c
|
||
+++ b/drivers/rapidio/rio-scan.c
|
||
@@ -871,7 +871,10 @@ static struct rio_net *rio_scan_alloc_net(struct rio_mport *mport,
|
||
dev_set_name(&net->dev, "rnet_%d", net->id);
|
||
net->dev.parent = &mport->dev;
|
||
net->dev.release = rio_scan_release_dev;
|
||
- rio_add_net(net);
|
||
+ if (rio_add_net(net)) {
|
||
+ put_device(&net->dev);
|
||
+ net = NULL;
|
||
+ }
|
||
}
|
||
|
||
return net;
|
||
diff --git a/drivers/slimbus/messaging.c b/drivers/slimbus/messaging.c
|
||
index 4ce0cb61e48135..245e9c7f92cdc4 100644
|
||
--- a/drivers/slimbus/messaging.c
|
||
+++ b/drivers/slimbus/messaging.c
|
||
@@ -147,8 +147,9 @@ int slim_do_transfer(struct slim_controller *ctrl, struct slim_msg_txn *txn)
|
||
}
|
||
|
||
ret = ctrl->xfer_msg(ctrl, txn);
|
||
-
|
||
- if (!ret && need_tid && !txn->msg->comp) {
|
||
+ if (ret == -ETIMEDOUT) {
|
||
+ slim_free_txn_tid(ctrl, txn);
|
||
+ } else if (!ret && need_tid && !txn->msg->comp) {
|
||
unsigned long ms = txn->rl + HZ;
|
||
|
||
timeout = wait_for_completion_timeout(txn->comp,
|
||
diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
|
||
index cd0e7ae07162c0..7e556f37d598cb 100644
|
||
--- a/drivers/spi/spi-mxs.c
|
||
+++ b/drivers/spi/spi-mxs.c
|
||
@@ -39,6 +39,7 @@
|
||
#include <linux/spi/spi.h>
|
||
#include <linux/spi/mxs-spi.h>
|
||
#include <trace/events/spi.h>
|
||
+#include <linux/dma/mxs-dma.h>
|
||
|
||
#define DRIVER_NAME "mxs-spi"
|
||
|
||
@@ -252,7 +253,7 @@ static int mxs_spi_txrx_dma(struct mxs_spi *spi,
|
||
desc = dmaengine_prep_slave_sg(ssp->dmach,
|
||
&dma_xfer[sg_count].sg, 1,
|
||
(flags & TXRX_WRITE) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM,
|
||
- DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
||
+ DMA_PREP_INTERRUPT | MXS_DMA_CTRL_WAIT4END);
|
||
|
||
if (!desc) {
|
||
dev_err(ssp->dev,
|
||
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
|
||
index 8f3b9a0a38e1dd..1443e9cf631a6e 100644
|
||
--- a/drivers/usb/atm/cxacru.c
|
||
+++ b/drivers/usb/atm/cxacru.c
|
||
@@ -1131,7 +1131,10 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance,
|
||
struct cxacru_data *instance;
|
||
struct usb_device *usb_dev = interface_to_usbdev(intf);
|
||
struct usb_host_endpoint *cmd_ep = usb_dev->ep_in[CXACRU_EP_CMD];
|
||
- struct usb_endpoint_descriptor *in, *out;
|
||
+ static const u8 ep_addrs[] = {
|
||
+ CXACRU_EP_CMD + USB_DIR_IN,
|
||
+ CXACRU_EP_CMD + USB_DIR_OUT,
|
||
+ 0};
|
||
int ret;
|
||
|
||
/* instance init */
|
||
@@ -1179,13 +1182,11 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance,
|
||
}
|
||
|
||
if (usb_endpoint_xfer_int(&cmd_ep->desc))
|
||
- ret = usb_find_common_endpoints(intf->cur_altsetting,
|
||
- NULL, NULL, &in, &out);
|
||
+ ret = usb_check_int_endpoints(intf, ep_addrs);
|
||
else
|
||
- ret = usb_find_common_endpoints(intf->cur_altsetting,
|
||
- &in, &out, NULL, NULL);
|
||
+ ret = usb_check_bulk_endpoints(intf, ep_addrs);
|
||
|
||
- if (ret) {
|
||
+ if (!ret) {
|
||
usb_err(usbatm_instance, "cxacru_bind: interface has incorrect endpoints\n");
|
||
ret = -ENODEV;
|
||
goto fail;
|
||
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
|
||
index 38f3f5a766dfdf..760283a541b41b 100644
|
||
--- a/drivers/usb/core/hub.c
|
||
+++ b/drivers/usb/core/hub.c
|
||
@@ -6033,6 +6033,36 @@ void usb_hub_cleanup(void)
|
||
usb_deregister(&hub_driver);
|
||
} /* usb_hub_cleanup() */
|
||
|
||
+/**
|
||
+ * hub_hc_release_resources - clear resources used by host controller
|
||
+ * @udev: pointer to device being released
|
||
+ *
|
||
+ * Context: task context, might sleep
|
||
+ *
|
||
+ * Function releases the host controller resources in correct order before
|
||
+ * making any operation on resuming usb device. The host controller resources
|
||
+ * allocated for devices in tree should be released starting from the last
|
||
+ * usb device in tree toward the root hub. This function is used only during
|
||
+ * resuming device when usb device require reinitialization – that is, when
|
||
+ * flag udev->reset_resume is set.
|
||
+ *
|
||
+ * This call is synchronous, and may not be used in an interrupt context.
|
||
+ */
|
||
+static void hub_hc_release_resources(struct usb_device *udev)
|
||
+{
|
||
+ struct usb_hub *hub = usb_hub_to_struct_hub(udev);
|
||
+ struct usb_hcd *hcd = bus_to_hcd(udev->bus);
|
||
+ int i;
|
||
+
|
||
+ /* Release up resources for all children before this device */
|
||
+ for (i = 0; i < udev->maxchild; i++)
|
||
+ if (hub->ports[i]->child)
|
||
+ hub_hc_release_resources(hub->ports[i]->child);
|
||
+
|
||
+ if (hcd->driver->reset_device)
|
||
+ hcd->driver->reset_device(hcd, udev);
|
||
+}
|
||
+
|
||
/**
|
||
* usb_reset_and_verify_device - perform a USB port reset to reinitialize a device
|
||
* @udev: device to reset (not in SUSPENDED or NOTATTACHED state)
|
||
@@ -6097,6 +6127,9 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
|
||
bos = udev->bos;
|
||
udev->bos = NULL;
|
||
|
||
+ if (udev->reset_resume)
|
||
+ hub_hc_release_resources(udev);
|
||
+
|
||
mutex_lock(hcd->address0_mutex);
|
||
|
||
for (i = 0; i < PORT_INIT_TRIES; ++i) {
|
||
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
|
||
index 027479179f09e9..6926bd639ec6ff 100644
|
||
--- a/drivers/usb/core/quirks.c
|
||
+++ b/drivers/usb/core/quirks.c
|
||
@@ -341,6 +341,10 @@ static const struct usb_device_id usb_quirk_list[] = {
|
||
{ USB_DEVICE(0x0638, 0x0a13), .driver_info =
|
||
USB_QUIRK_STRING_FETCH_255 },
|
||
|
||
+ /* Prolific Single-LUN Mass Storage Card Reader */
|
||
+ { USB_DEVICE(0x067b, 0x2731), .driver_info = USB_QUIRK_DELAY_INIT |
|
||
+ USB_QUIRK_NO_LPM },
|
||
+
|
||
/* Saitek Cyborg Gold Joystick */
|
||
{ USB_DEVICE(0x06a3, 0x0006), .driver_info =
|
||
USB_QUIRK_CONFIG_INTF_STRINGS },
|
||
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
|
||
index 318ae24a41f482..30404461ef7de3 100644
|
||
--- a/drivers/usb/dwc3/core.c
|
||
+++ b/drivers/usb/dwc3/core.c
|
||
@@ -125,11 +125,24 @@ void dwc3_enable_susphy(struct dwc3 *dwc, bool enable)
|
||
dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
|
||
}
|
||
|
||
-void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode)
|
||
+void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode, bool ignore_susphy)
|
||
{
|
||
+ unsigned int hw_mode;
|
||
u32 reg;
|
||
|
||
reg = dwc3_readl(dwc->regs, DWC3_GCTL);
|
||
+
|
||
+ /*
|
||
+ * For DRD controllers, GUSB3PIPECTL.SUSPENDENABLE and
|
||
+ * GUSB2PHYCFG.SUSPHY should be cleared during mode switching,
|
||
+ * and they can be set after core initialization.
|
||
+ */
|
||
+ hw_mode = DWC3_GHWPARAMS0_MODE(dwc->hwparams.hwparams0);
|
||
+ if (hw_mode == DWC3_GHWPARAMS0_MODE_DRD && !ignore_susphy) {
|
||
+ if (DWC3_GCTL_PRTCAP(reg) != mode)
|
||
+ dwc3_enable_susphy(dwc, false);
|
||
+ }
|
||
+
|
||
reg &= ~(DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_OTG));
|
||
reg |= DWC3_GCTL_PRTCAPDIR(mode);
|
||
dwc3_writel(dwc->regs, DWC3_GCTL, reg);
|
||
@@ -209,7 +222,7 @@ static void __dwc3_set_mode(struct work_struct *work)
|
||
|
||
spin_lock_irqsave(&dwc->lock, flags);
|
||
|
||
- dwc3_set_prtcap(dwc, desired_dr_role);
|
||
+ dwc3_set_prtcap(dwc, desired_dr_role, false);
|
||
|
||
spin_unlock_irqrestore(&dwc->lock, flags);
|
||
|
||
@@ -643,16 +656,7 @@ static int dwc3_phy_setup(struct dwc3 *dwc)
|
||
*/
|
||
reg &= ~DWC3_GUSB3PIPECTL_UX_EXIT_PX;
|
||
|
||
- /*
|
||
- * Above DWC_usb3.0 1.94a, it is recommended to set
|
||
- * DWC3_GUSB3PIPECTL_SUSPHY to '0' during coreConsultant configuration.
|
||
- * So default value will be '0' when the core is reset. Application
|
||
- * needs to set it to '1' after the core initialization is completed.
|
||
- *
|
||
- * Similarly for DRD controllers, GUSB3PIPECTL.SUSPENDENABLE must be
|
||
- * cleared after power-on reset, and it can be set after core
|
||
- * initialization.
|
||
- */
|
||
+ /* Ensure the GUSB3PIPECTL.SUSPENDENABLE is cleared prior to phy init. */
|
||
reg &= ~DWC3_GUSB3PIPECTL_SUSPHY;
|
||
|
||
if (dwc->u2ss_inp3_quirk)
|
||
@@ -725,15 +729,7 @@ static int dwc3_phy_setup(struct dwc3 *dwc)
|
||
break;
|
||
}
|
||
|
||
- /*
|
||
- * Above DWC_usb3.0 1.94a, it is recommended to set
|
||
- * DWC3_GUSB2PHYCFG_SUSPHY to '0' during coreConsultant configuration.
|
||
- * So default value will be '0' when the core is reset. Application
|
||
- * needs to set it to '1' after the core initialization is completed.
|
||
- *
|
||
- * Similarly for DRD controllers, GUSB2PHYCFG.SUSPHY must be cleared
|
||
- * after power-on reset, and it can be set after core initialization.
|
||
- */
|
||
+ /* Ensure the GUSB2PHYCFG.SUSPHY is cleared prior to phy init. */
|
||
reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
|
||
|
||
if (dwc->dis_enblslpm_quirk)
|
||
@@ -809,6 +805,25 @@ static int dwc3_phy_power_on(struct dwc3 *dwc)
|
||
if (ret < 0)
|
||
goto err_power_off_usb2_phy;
|
||
|
||
+ /*
|
||
+ * Above DWC_usb3.0 1.94a, it is recommended to set
|
||
+ * DWC3_GUSB3PIPECTL_SUSPHY and DWC3_GUSB2PHYCFG_SUSPHY to '0' during
|
||
+ * coreConsultant configuration. So default value will be '0' when the
|
||
+ * core is reset. Application needs to set it to '1' after the core
|
||
+ * initialization is completed.
|
||
+ *
|
||
+ * Certain phy requires to be in P0 power state during initialization.
|
||
+ * Make sure GUSB3PIPECTL.SUSPENDENABLE and GUSB2PHYCFG.SUSPHY are clear
|
||
+ * prior to phy init to maintain in the P0 state.
|
||
+ *
|
||
+ * After phy initialization, some phy operations can only be executed
|
||
+ * while in lower P states. Ensure GUSB3PIPECTL.SUSPENDENABLE and
|
||
+ * GUSB2PHYCFG.SUSPHY are set soon after initialization to avoid
|
||
+ * blocking phy ops.
|
||
+ */
|
||
+ if (!DWC3_VER_IS_WITHIN(DWC3, ANY, 194A))
|
||
+ dwc3_enable_susphy(dwc, true);
|
||
+
|
||
return 0;
|
||
|
||
err_power_off_usb2_phy:
|
||
@@ -1432,7 +1447,7 @@ static int dwc3_core_init_mode(struct dwc3 *dwc)
|
||
|
||
switch (dwc->dr_mode) {
|
||
case USB_DR_MODE_PERIPHERAL:
|
||
- dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE);
|
||
+ dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE, false);
|
||
|
||
if (dwc->usb2_phy)
|
||
otg_set_vbus(dwc->usb2_phy->otg, false);
|
||
@@ -1444,7 +1459,7 @@ static int dwc3_core_init_mode(struct dwc3 *dwc)
|
||
return dev_err_probe(dev, ret, "failed to initialize gadget\n");
|
||
break;
|
||
case USB_DR_MODE_HOST:
|
||
- dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_HOST);
|
||
+ dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_HOST, false);
|
||
|
||
if (dwc->usb2_phy)
|
||
otg_set_vbus(dwc->usb2_phy->otg, true);
|
||
@@ -1487,7 +1502,7 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc)
|
||
}
|
||
|
||
/* de-assert DRVVBUS for HOST and OTG mode */
|
||
- dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE);
|
||
+ dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE, true);
|
||
}
|
||
|
||
static void dwc3_get_properties(struct dwc3 *dwc)
|
||
@@ -1656,8 +1671,6 @@ static void dwc3_get_properties(struct dwc3 *dwc)
|
||
dwc->tx_thr_num_pkt_prd = tx_thr_num_pkt_prd;
|
||
dwc->tx_max_burst_prd = tx_max_burst_prd;
|
||
|
||
- dwc->imod_interval = 0;
|
||
-
|
||
dwc->tx_fifo_resize_max_num = tx_fifo_resize_max_num;
|
||
}
|
||
|
||
@@ -1675,21 +1688,19 @@ static void dwc3_check_params(struct dwc3 *dwc)
|
||
unsigned int hwparam_gen =
|
||
DWC3_GHWPARAMS3_SSPHY_IFC(dwc->hwparams.hwparams3);
|
||
|
||
- /* Check for proper value of imod_interval */
|
||
- if (dwc->imod_interval && !dwc3_has_imod(dwc)) {
|
||
- dev_warn(dwc->dev, "Interrupt moderation not supported\n");
|
||
- dwc->imod_interval = 0;
|
||
- }
|
||
-
|
||
/*
|
||
+ * Enable IMOD for all supporting controllers.
|
||
+ *
|
||
+ * Particularly, DWC_usb3 v3.00a must enable this feature for
|
||
+ * the following reason:
|
||
+ *
|
||
* Workaround for STAR 9000961433 which affects only version
|
||
* 3.00a of the DWC_usb3 core. This prevents the controller
|
||
* interrupt from being masked while handling events. IMOD
|
||
* allows us to work around this issue. Enable it for the
|
||
* affected version.
|
||
*/
|
||
- if (!dwc->imod_interval &&
|
||
- DWC3_VER_IS(DWC3, 300A))
|
||
+ if (dwc3_has_imod((dwc)))
|
||
dwc->imod_interval = 1;
|
||
|
||
/* Check the maximum_speed parameter */
|
||
@@ -2192,7 +2203,7 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg)
|
||
if (ret)
|
||
return ret;
|
||
|
||
- dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE);
|
||
+ dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE, true);
|
||
dwc3_gadget_resume(dwc);
|
||
break;
|
||
case DWC3_GCTL_PRTCAP_HOST:
|
||
@@ -2200,7 +2211,7 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg)
|
||
ret = dwc3_core_init_for_resume(dwc);
|
||
if (ret)
|
||
return ret;
|
||
- dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_HOST);
|
||
+ dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_HOST, true);
|
||
break;
|
||
}
|
||
/* Restore GUSB2PHYCFG bits that were modified in suspend */
|
||
@@ -2225,7 +2236,7 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg)
|
||
if (ret)
|
||
return ret;
|
||
|
||
- dwc3_set_prtcap(dwc, dwc->current_dr_role);
|
||
+ dwc3_set_prtcap(dwc, dwc->current_dr_role, true);
|
||
|
||
dwc3_otg_init(dwc);
|
||
if (dwc->current_otg_role == DWC3_OTG_ROLE_HOST) {
|
||
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
|
||
index 516bace7e1dced..06be72f789690e 100644
|
||
--- a/drivers/usb/dwc3/core.h
|
||
+++ b/drivers/usb/dwc3/core.h
|
||
@@ -1531,7 +1531,7 @@ struct dwc3_gadget_ep_cmd_params {
|
||
#define DWC3_HAS_OTG BIT(3)
|
||
|
||
/* prototypes */
|
||
-void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode);
|
||
+void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode, bool ignore_susphy);
|
||
void dwc3_set_mode(struct dwc3 *dwc, u32 mode);
|
||
u32 dwc3_core_fifo_space(struct dwc3_ep *dep, u8 type);
|
||
|
||
diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c
|
||
index 57ddd2e43022eb..80bfe68cde62d2 100644
|
||
--- a/drivers/usb/dwc3/drd.c
|
||
+++ b/drivers/usb/dwc3/drd.c
|
||
@@ -173,7 +173,7 @@ void dwc3_otg_init(struct dwc3 *dwc)
|
||
* block "Initialize GCTL for OTG operation".
|
||
*/
|
||
/* GCTL.PrtCapDir=2'b11 */
|
||
- dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_OTG);
|
||
+ dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_OTG, true);
|
||
/* GUSB2PHYCFG0.SusPHY=0 */
|
||
reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
|
||
reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
|
||
@@ -553,7 +553,7 @@ int dwc3_drd_init(struct dwc3 *dwc)
|
||
|
||
dwc3_drd_update(dwc);
|
||
} else {
|
||
- dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_OTG);
|
||
+ dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_OTG, true);
|
||
|
||
/* use OTG block to get ID event */
|
||
irq = dwc3_otg_get_irq(dwc);
|
||
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
|
||
index f6d9a9c67db4e2..fdaace1564f96f 100644
|
||
--- a/drivers/usb/dwc3/gadget.c
|
||
+++ b/drivers/usb/dwc3/gadget.c
|
||
@@ -4507,14 +4507,18 @@ static irqreturn_t dwc3_process_event_buf(struct dwc3_event_buffer *evt)
|
||
dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(0),
|
||
DWC3_GEVNTSIZ_SIZE(evt->length));
|
||
|
||
+ evt->flags &= ~DWC3_EVENT_PENDING;
|
||
+ /*
|
||
+ * Add an explicit write memory barrier to make sure that the update of
|
||
+ * clearing DWC3_EVENT_PENDING is observed in dwc3_check_event_buf()
|
||
+ */
|
||
+ wmb();
|
||
+
|
||
if (dwc->imod_interval) {
|
||
dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), DWC3_GEVNTCOUNT_EHB);
|
||
dwc3_writel(dwc->regs, DWC3_DEV_IMOD(0), dwc->imod_interval);
|
||
}
|
||
|
||
- /* Keep the clearing of DWC3_EVENT_PENDING at the end */
|
||
- evt->flags &= ~DWC3_EVENT_PENDING;
|
||
-
|
||
return ret;
|
||
}
|
||
|
||
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
|
||
index 9225c21d118453..69ce7d384ba8bb 100644
|
||
--- a/drivers/usb/gadget/composite.c
|
||
+++ b/drivers/usb/gadget/composite.c
|
||
@@ -1050,10 +1050,11 @@ static int set_config(struct usb_composite_dev *cdev,
|
||
else
|
||
usb_gadget_set_remote_wakeup(gadget, 0);
|
||
done:
|
||
- if (power <= USB_SELF_POWER_VBUS_MAX_DRAW)
|
||
- usb_gadget_set_selfpowered(gadget);
|
||
- else
|
||
+ if (power > USB_SELF_POWER_VBUS_MAX_DRAW ||
|
||
+ (c && !(c->bmAttributes & USB_CONFIG_ATT_SELFPOWER)))
|
||
usb_gadget_clear_selfpowered(gadget);
|
||
+ else
|
||
+ usb_gadget_set_selfpowered(gadget);
|
||
|
||
usb_gadget_vbus_draw(gadget, power);
|
||
if (result >= 0 && cdev->delayed_status)
|
||
@@ -2615,7 +2616,10 @@ void composite_suspend(struct usb_gadget *gadget)
|
||
|
||
cdev->suspended = 1;
|
||
|
||
- usb_gadget_set_selfpowered(gadget);
|
||
+ if (cdev->config &&
|
||
+ cdev->config->bmAttributes & USB_CONFIG_ATT_SELFPOWER)
|
||
+ usb_gadget_set_selfpowered(gadget);
|
||
+
|
||
usb_gadget_vbus_draw(gadget, 2);
|
||
}
|
||
|
||
@@ -2649,8 +2653,11 @@ void composite_resume(struct usb_gadget *gadget)
|
||
else
|
||
maxpower = min(maxpower, 900U);
|
||
|
||
- if (maxpower > USB_SELF_POWER_VBUS_MAX_DRAW)
|
||
+ if (maxpower > USB_SELF_POWER_VBUS_MAX_DRAW ||
|
||
+ !(cdev->config->bmAttributes & USB_CONFIG_ATT_SELFPOWER))
|
||
usb_gadget_clear_selfpowered(gadget);
|
||
+ else
|
||
+ usb_gadget_set_selfpowered(gadget);
|
||
|
||
usb_gadget_vbus_draw(gadget, maxpower);
|
||
} else {
|
||
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
|
||
index 4bb0553da65857..2da2db5e15a3c8 100644
|
||
--- a/drivers/usb/gadget/function/u_ether.c
|
||
+++ b/drivers/usb/gadget/function/u_ether.c
|
||
@@ -1052,8 +1052,8 @@ void gether_suspend(struct gether *link)
|
||
* There is a transfer in progress. So we trigger a remote
|
||
* wakeup to inform the host.
|
||
*/
|
||
- ether_wakeup_host(dev->port_usb);
|
||
- return;
|
||
+ if (!ether_wakeup_host(dev->port_usb))
|
||
+ return;
|
||
}
|
||
spin_lock_irqsave(&dev->lock, flags);
|
||
link->is_suspend = true;
|
||
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
|
||
index 54c47463c215c2..b0137eac7ab383 100644
|
||
--- a/drivers/usb/host/xhci-mem.c
|
||
+++ b/drivers/usb/host/xhci-mem.c
|
||
@@ -2364,7 +2364,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
|
||
* and our use of dma addresses in the trb_address_map radix tree needs
|
||
* TRB_SEGMENT_SIZE alignment, so we pick the greater alignment need.
|
||
*/
|
||
- if (xhci->quirks & XHCI_ZHAOXIN_TRB_FETCH)
|
||
+ if (xhci->quirks & XHCI_TRB_OVERFETCH)
|
||
+ /* Buggy HC prefetches beyond segment bounds - allocate dummy space at the end */
|
||
xhci->segment_pool = dma_pool_create("xHCI ring segments", dev,
|
||
TRB_SEGMENT_SIZE * 2, TRB_SEGMENT_SIZE * 2, xhci->page_size * 2);
|
||
else
|
||
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
|
||
index 340d9597d1ab05..c1a172b6feae84 100644
|
||
--- a/drivers/usb/host/xhci-pci.c
|
||
+++ b/drivers/usb/host/xhci-pci.c
|
||
@@ -28,8 +28,8 @@
|
||
#define SPARSE_CNTL_ENABLE 0xC12C
|
||
|
||
/* Device for a quirk */
|
||
-#define PCI_VENDOR_ID_FRESCO_LOGIC 0x1b73
|
||
-#define PCI_DEVICE_ID_FRESCO_LOGIC_PDK 0x1000
|
||
+#define PCI_VENDOR_ID_FRESCO_LOGIC 0x1b73
|
||
+#define PCI_DEVICE_ID_FRESCO_LOGIC_PDK 0x1000
|
||
#define PCI_DEVICE_ID_FRESCO_LOGIC_FL1009 0x1009
|
||
#define PCI_DEVICE_ID_FRESCO_LOGIC_FL1100 0x1100
|
||
#define PCI_DEVICE_ID_FRESCO_LOGIC_FL1400 0x1400
|
||
@@ -38,8 +38,10 @@
|
||
#define PCI_DEVICE_ID_EJ168 0x7023
|
||
#define PCI_DEVICE_ID_EJ188 0x7052
|
||
|
||
-#define PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI 0x8c31
|
||
-#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31
|
||
+#define PCI_DEVICE_ID_VIA_VL805 0x3483
|
||
+
|
||
+#define PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI 0x8c31
|
||
+#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31
|
||
#define PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_XHCI 0x9cb1
|
||
#define PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI 0x22b5
|
||
#define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI 0xa12f
|
||
@@ -480,8 +482,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
|
||
pdev->device == 0x3432)
|
||
xhci->quirks |= XHCI_BROKEN_STREAMS;
|
||
|
||
- if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483)
|
||
+ if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == PCI_DEVICE_ID_VIA_VL805) {
|
||
xhci->quirks |= XHCI_LPM_SUPPORT;
|
||
+ xhci->quirks |= XHCI_TRB_OVERFETCH;
|
||
+ }
|
||
|
||
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
|
||
pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) {
|
||
@@ -529,11 +533,11 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
|
||
|
||
if (pdev->device == 0x9202) {
|
||
xhci->quirks |= XHCI_RESET_ON_RESUME;
|
||
- xhci->quirks |= XHCI_ZHAOXIN_TRB_FETCH;
|
||
+ xhci->quirks |= XHCI_TRB_OVERFETCH;
|
||
}
|
||
|
||
if (pdev->device == 0x9203)
|
||
- xhci->quirks |= XHCI_ZHAOXIN_TRB_FETCH;
|
||
+ xhci->quirks |= XHCI_TRB_OVERFETCH;
|
||
}
|
||
|
||
if (pdev->vendor == PCI_DEVICE_ID_CADENCE &&
|
||
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
|
||
index fddb3a90dae3df..df87e8bcb7d246 100644
|
||
--- a/drivers/usb/host/xhci.h
|
||
+++ b/drivers/usb/host/xhci.h
|
||
@@ -1657,7 +1657,7 @@ struct xhci_hcd {
|
||
#define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(42)
|
||
#define XHCI_SUSPEND_RESUME_CLKS BIT_ULL(43)
|
||
#define XHCI_RESET_TO_DEFAULT BIT_ULL(44)
|
||
-#define XHCI_ZHAOXIN_TRB_FETCH BIT_ULL(45)
|
||
+#define XHCI_TRB_OVERFETCH BIT_ULL(45)
|
||
#define XHCI_ZHAOXIN_HOST BIT_ULL(46)
|
||
#define XHCI_WRITE_64_HI_LO BIT_ULL(47)
|
||
#define XHCI_CDNS_SCTX_QUIRK BIT_ULL(48)
|
||
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
|
||
index dd1c1754243942..205820544f6f9e 100644
|
||
--- a/drivers/usb/renesas_usbhs/common.c
|
||
+++ b/drivers/usb/renesas_usbhs/common.c
|
||
@@ -312,8 +312,10 @@ static int usbhsc_clk_get(struct device *dev, struct usbhs_priv *priv)
|
||
priv->clks[1] = of_clk_get(dev_of_node(dev), 1);
|
||
if (PTR_ERR(priv->clks[1]) == -ENOENT)
|
||
priv->clks[1] = NULL;
|
||
- else if (IS_ERR(priv->clks[1]))
|
||
+ else if (IS_ERR(priv->clks[1])) {
|
||
+ clk_put(priv->clks[0]);
|
||
return PTR_ERR(priv->clks[1]);
|
||
+ }
|
||
|
||
return 0;
|
||
}
|
||
@@ -768,6 +770,8 @@ static void usbhs_remove(struct platform_device *pdev)
|
||
|
||
dev_dbg(&pdev->dev, "usb remove\n");
|
||
|
||
+ flush_delayed_work(&priv->notify_hotplug_work);
|
||
+
|
||
/* power off */
|
||
if (!usbhs_get_dparam(priv, runtime_pwctrl))
|
||
usbhsc_power_ctrl(priv, 0);
|
||
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c
|
||
index 105132ae87acbc..e8e5723f541226 100644
|
||
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
|
||
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
|
||
@@ -1094,7 +1094,7 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv)
|
||
goto usbhs_mod_gadget_probe_err_gpriv;
|
||
}
|
||
|
||
- gpriv->transceiver = usb_get_phy(USB_PHY_TYPE_UNDEFINED);
|
||
+ gpriv->transceiver = devm_usb_get_phy(dev, USB_PHY_TYPE_UNDEFINED);
|
||
dev_info(dev, "%stransceiver found\n",
|
||
!IS_ERR(gpriv->transceiver) ? "" : "no ");
|
||
|
||
diff --git a/drivers/usb/typec/tcpm/tcpci_rt1711h.c b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
|
||
index 17ebc5fb684f9f..66b29d09372ed7 100644
|
||
--- a/drivers/usb/typec/tcpm/tcpci_rt1711h.c
|
||
+++ b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
|
||
@@ -331,6 +331,11 @@ static int rt1711h_probe(struct i2c_client *client)
|
||
{
|
||
int ret;
|
||
struct rt1711h_chip *chip;
|
||
+ const u16 alert_mask = TCPC_ALERT_TX_SUCCESS | TCPC_ALERT_TX_DISCARDED |
|
||
+ TCPC_ALERT_TX_FAILED | TCPC_ALERT_RX_HARD_RST |
|
||
+ TCPC_ALERT_RX_STATUS | TCPC_ALERT_POWER_STATUS |
|
||
+ TCPC_ALERT_CC_STATUS | TCPC_ALERT_RX_BUF_OVF |
|
||
+ TCPC_ALERT_FAULT;
|
||
|
||
chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
|
||
if (!chip)
|
||
@@ -379,6 +384,12 @@ static int rt1711h_probe(struct i2c_client *client)
|
||
dev_name(chip->dev), chip);
|
||
if (ret < 0)
|
||
return ret;
|
||
+
|
||
+ /* Enable alert interrupts */
|
||
+ ret = rt1711h_write16(chip, TCPC_ALERT_MASK, alert_mask);
|
||
+ if (ret < 0)
|
||
+ return ret;
|
||
+
|
||
enable_irq_wake(client->irq);
|
||
|
||
return 0;
|
||
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
|
||
index d6a3fd00c3a5c4..29a04d6795012d 100644
|
||
--- a/drivers/usb/typec/ucsi/ucsi.c
|
||
+++ b/drivers/usb/typec/ucsi/ucsi.c
|
||
@@ -25,7 +25,7 @@
|
||
* difficult to estimate the time it takes for the system to process the command
|
||
* before it is actually passed to the PPM.
|
||
*/
|
||
-#define UCSI_TIMEOUT_MS 5000
|
||
+#define UCSI_TIMEOUT_MS 10000
|
||
|
||
/*
|
||
* UCSI_SWAP_TIMEOUT_MS - Timeout for role swap requests
|
||
@@ -1465,11 +1465,11 @@ static int ucsi_init(struct ucsi *ucsi)
|
||
|
||
err_unregister:
|
||
for (con = connector; con->port; con++) {
|
||
+ if (con->wq)
|
||
+ destroy_workqueue(con->wq);
|
||
ucsi_unregister_partner(con);
|
||
ucsi_unregister_altmodes(con, UCSI_RECIPIENT_CON);
|
||
ucsi_unregister_port_psy(con);
|
||
- if (con->wq)
|
||
- destroy_workqueue(con->wq);
|
||
|
||
usb_power_delivery_unregister_capabilities(con->port_sink_caps);
|
||
con->port_sink_caps = NULL;
|
||
@@ -1651,10 +1651,6 @@ void ucsi_unregister(struct ucsi *ucsi)
|
||
|
||
for (i = 0; i < ucsi->cap.num_connectors; i++) {
|
||
cancel_work_sync(&ucsi->connector[i].work);
|
||
- ucsi_unregister_partner(&ucsi->connector[i]);
|
||
- ucsi_unregister_altmodes(&ucsi->connector[i],
|
||
- UCSI_RECIPIENT_CON);
|
||
- ucsi_unregister_port_psy(&ucsi->connector[i]);
|
||
|
||
if (ucsi->connector[i].wq) {
|
||
struct ucsi_work *uwork;
|
||
@@ -1670,6 +1666,11 @@ void ucsi_unregister(struct ucsi *ucsi)
|
||
destroy_workqueue(ucsi->connector[i].wq);
|
||
}
|
||
|
||
+ ucsi_unregister_partner(&ucsi->connector[i]);
|
||
+ ucsi_unregister_altmodes(&ucsi->connector[i],
|
||
+ UCSI_RECIPIENT_CON);
|
||
+ ucsi_unregister_port_psy(&ucsi->connector[i]);
|
||
+
|
||
usb_power_delivery_unregister_capabilities(ucsi->connector[i].port_sink_caps);
|
||
ucsi->connector[i].port_sink_caps = NULL;
|
||
usb_power_delivery_unregister_capabilities(ucsi->connector[i].port_source_caps);
|
||
diff --git a/drivers/virt/acrn/hsm.c b/drivers/virt/acrn/hsm.c
|
||
index 423ea888d79af3..92730c08fd7934 100644
|
||
--- a/drivers/virt/acrn/hsm.c
|
||
+++ b/drivers/virt/acrn/hsm.c
|
||
@@ -49,7 +49,7 @@ static int pmcmd_ioctl(u64 cmd, void __user *uptr)
|
||
switch (cmd & PMCMD_TYPE_MASK) {
|
||
case ACRN_PMCMD_GET_PX_CNT:
|
||
case ACRN_PMCMD_GET_CX_CNT:
|
||
- pm_info = kmalloc(sizeof(u64), GFP_KERNEL);
|
||
+ pm_info = kzalloc(sizeof(u64), GFP_KERNEL);
|
||
if (!pm_info)
|
||
return -ENOMEM;
|
||
|
||
@@ -64,7 +64,7 @@ static int pmcmd_ioctl(u64 cmd, void __user *uptr)
|
||
kfree(pm_info);
|
||
break;
|
||
case ACRN_PMCMD_GET_PX_DATA:
|
||
- px_data = kmalloc(sizeof(*px_data), GFP_KERNEL);
|
||
+ px_data = kzalloc(sizeof(*px_data), GFP_KERNEL);
|
||
if (!px_data)
|
||
return -ENOMEM;
|
||
|
||
@@ -79,7 +79,7 @@ static int pmcmd_ioctl(u64 cmd, void __user *uptr)
|
||
kfree(px_data);
|
||
break;
|
||
case ACRN_PMCMD_GET_CX_DATA:
|
||
- cx_data = kmalloc(sizeof(*cx_data), GFP_KERNEL);
|
||
+ cx_data = kzalloc(sizeof(*cx_data), GFP_KERNEL);
|
||
if (!cx_data)
|
||
return -ENOMEM;
|
||
|
||
diff --git a/fs/exfat/balloc.c b/fs/exfat/balloc.c
|
||
index 5b547a5963808e..32209acd51be4f 100644
|
||
--- a/fs/exfat/balloc.c
|
||
+++ b/fs/exfat/balloc.c
|
||
@@ -160,7 +160,7 @@ int exfat_set_bitmap(struct inode *inode, unsigned int clu, bool sync)
|
||
return 0;
|
||
}
|
||
|
||
-void exfat_clear_bitmap(struct inode *inode, unsigned int clu, bool sync)
|
||
+int exfat_clear_bitmap(struct inode *inode, unsigned int clu, bool sync)
|
||
{
|
||
int i, b;
|
||
unsigned int ent_idx;
|
||
@@ -169,13 +169,17 @@ void exfat_clear_bitmap(struct inode *inode, unsigned int clu, bool sync)
|
||
struct exfat_mount_options *opts = &sbi->options;
|
||
|
||
if (!is_valid_cluster(sbi, clu))
|
||
- return;
|
||
+ return -EIO;
|
||
|
||
ent_idx = CLUSTER_TO_BITMAP_ENT(clu);
|
||
i = BITMAP_OFFSET_SECTOR_INDEX(sb, ent_idx);
|
||
b = BITMAP_OFFSET_BIT_IN_SECTOR(sb, ent_idx);
|
||
|
||
+ if (!test_bit_le(b, sbi->vol_amap[i]->b_data))
|
||
+ return -EIO;
|
||
+
|
||
clear_bit_le(b, sbi->vol_amap[i]->b_data);
|
||
+
|
||
exfat_update_bh(sbi->vol_amap[i], sync);
|
||
|
||
if (opts->discard) {
|
||
@@ -190,6 +194,8 @@ void exfat_clear_bitmap(struct inode *inode, unsigned int clu, bool sync)
|
||
opts->discard = 0;
|
||
}
|
||
}
|
||
+
|
||
+ return 0;
|
||
}
|
||
|
||
/*
|
||
diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h
|
||
index f55498e5c23d46..19245ddd885fc3 100644
|
||
--- a/fs/exfat/exfat_fs.h
|
||
+++ b/fs/exfat/exfat_fs.h
|
||
@@ -441,7 +441,7 @@ int exfat_count_num_clusters(struct super_block *sb,
|
||
int exfat_load_bitmap(struct super_block *sb);
|
||
void exfat_free_bitmap(struct exfat_sb_info *sbi);
|
||
int exfat_set_bitmap(struct inode *inode, unsigned int clu, bool sync);
|
||
-void exfat_clear_bitmap(struct inode *inode, unsigned int clu, bool sync);
|
||
+int exfat_clear_bitmap(struct inode *inode, unsigned int clu, bool sync);
|
||
unsigned int exfat_find_free_bitmap(struct super_block *sb, unsigned int clu);
|
||
int exfat_count_used_clusters(struct super_block *sb, unsigned int *ret_count);
|
||
int exfat_trim_fs(struct inode *inode, struct fstrim_range *range);
|
||
diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c
|
||
index 428d862a1d2bfc..74590041fb2c7b 100644
|
||
--- a/fs/exfat/fatent.c
|
||
+++ b/fs/exfat/fatent.c
|
||
@@ -175,6 +175,7 @@ static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain
|
||
BITMAP_OFFSET_SECTOR_INDEX(sb, CLUSTER_TO_BITMAP_ENT(clu));
|
||
|
||
if (p_chain->flags == ALLOC_NO_FAT_CHAIN) {
|
||
+ int err;
|
||
unsigned int last_cluster = p_chain->dir + p_chain->size - 1;
|
||
do {
|
||
bool sync = false;
|
||
@@ -189,7 +190,9 @@ static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain
|
||
cur_cmap_i = next_cmap_i;
|
||
}
|
||
|
||
- exfat_clear_bitmap(inode, clu, (sync && IS_DIRSYNC(inode)));
|
||
+ err = exfat_clear_bitmap(inode, clu, (sync && IS_DIRSYNC(inode)));
|
||
+ if (err)
|
||
+ break;
|
||
clu++;
|
||
num_clusters++;
|
||
} while (num_clusters < p_chain->size);
|
||
@@ -210,12 +213,13 @@ static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain
|
||
cur_cmap_i = next_cmap_i;
|
||
}
|
||
|
||
- exfat_clear_bitmap(inode, clu, (sync && IS_DIRSYNC(inode)));
|
||
+ if (exfat_clear_bitmap(inode, clu, (sync && IS_DIRSYNC(inode))))
|
||
+ break;
|
||
clu = n_clu;
|
||
num_clusters++;
|
||
|
||
if (err)
|
||
- goto dec_used_clus;
|
||
+ break;
|
||
|
||
if (num_clusters >= sbi->num_clusters - EXFAT_FIRST_CLUSTER) {
|
||
/*
|
||
@@ -229,7 +233,6 @@ static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain
|
||
} while (clu != EXFAT_EOF_CLUSTER);
|
||
}
|
||
|
||
-dec_used_clus:
|
||
sbi->used_clusters -= num_clusters;
|
||
return 0;
|
||
}
|
||
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
|
||
index 258521d5125edd..a1ff4a4f5380eb 100644
|
||
--- a/fs/nfs/direct.c
|
||
+++ b/fs/nfs/direct.c
|
||
@@ -130,6 +130,20 @@ static void nfs_direct_truncate_request(struct nfs_direct_req *dreq,
|
||
dreq->count = req_start;
|
||
}
|
||
|
||
+static void nfs_direct_file_adjust_size_locked(struct inode *inode,
|
||
+ loff_t offset, size_t count)
|
||
+{
|
||
+ loff_t newsize = offset + (loff_t)count;
|
||
+ loff_t oldsize = i_size_read(inode);
|
||
+
|
||
+ if (newsize > oldsize) {
|
||
+ i_size_write(inode, newsize);
|
||
+ NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_SIZE;
|
||
+ trace_nfs_size_grow(inode, newsize);
|
||
+ nfs_inc_stats(inode, NFSIOS_EXTENDWRITE);
|
||
+ }
|
||
+}
|
||
+
|
||
/**
|
||
* nfs_swap_rw - NFS address space operation for swap I/O
|
||
* @iocb: target I/O control block
|
||
@@ -728,6 +742,7 @@ static void nfs_direct_write_completion(struct nfs_pgio_header *hdr)
|
||
struct nfs_direct_req *dreq = hdr->dreq;
|
||
struct nfs_commit_info cinfo;
|
||
struct nfs_page *req = nfs_list_entry(hdr->pages.next);
|
||
+ struct inode *inode = dreq->inode;
|
||
int flags = NFS_ODIRECT_DONE;
|
||
|
||
trace_nfs_direct_write_completion(dreq);
|
||
@@ -749,6 +764,10 @@ static void nfs_direct_write_completion(struct nfs_pgio_header *hdr)
|
||
}
|
||
spin_unlock(&dreq->lock);
|
||
|
||
+ spin_lock(&inode->i_lock);
|
||
+ nfs_direct_file_adjust_size_locked(inode, dreq->io_start, dreq->count);
|
||
+ spin_unlock(&inode->i_lock);
|
||
+
|
||
while (!list_empty(&hdr->pages)) {
|
||
|
||
req = nfs_list_entry(hdr->pages.next);
|
||
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
|
||
index 3f9768810427df..003dda0018403d 100644
|
||
--- a/fs/nfs/file.c
|
||
+++ b/fs/nfs/file.c
|
||
@@ -29,6 +29,7 @@
|
||
#include <linux/pagemap.h>
|
||
#include <linux/gfp.h>
|
||
#include <linux/swap.h>
|
||
+#include <linux/compaction.h>
|
||
|
||
#include <linux/uaccess.h>
|
||
#include <linux/filelock.h>
|
||
@@ -450,7 +451,7 @@ static bool nfs_release_folio(struct folio *folio, gfp_t gfp)
|
||
/* If the private flag is set, then the folio is not freeable */
|
||
if (folio_test_private(folio)) {
|
||
if ((current_gfp_context(gfp) & GFP_KERNEL) != GFP_KERNEL ||
|
||
- current_is_kswapd())
|
||
+ current_is_kswapd() || current_is_kcompactd())
|
||
return false;
|
||
if (nfs_wb_folio(folio_file_mapping(folio)->host, folio) < 0)
|
||
return false;
|
||
diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
|
||
index b3e59a7c71205f..dbb407d5e6dab2 100644
|
||
--- a/fs/smb/client/inode.c
|
||
+++ b/fs/smb/client/inode.c
|
||
@@ -1320,7 +1320,7 @@ int cifs_get_inode_info(struct inode **inode,
|
||
struct cifs_fattr fattr = {};
|
||
int rc;
|
||
|
||
- if (is_inode_cache_good(*inode)) {
|
||
+ if (!data && is_inode_cache_good(*inode)) {
|
||
cifs_dbg(FYI, "No need to revalidate cached inode sizes\n");
|
||
return 0;
|
||
}
|
||
@@ -1419,7 +1419,7 @@ int smb311_posix_get_inode_info(struct inode **inode,
|
||
struct cifs_fattr fattr = {};
|
||
int rc;
|
||
|
||
- if (is_inode_cache_good(*inode)) {
|
||
+ if (!data && is_inode_cache_good(*inode)) {
|
||
cifs_dbg(FYI, "No need to revalidate cached inode sizes\n");
|
||
return 0;
|
||
}
|
||
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
|
||
index 815a9a5cfa8079..58e5cc2b1f3e1d 100644
|
||
--- a/fs/smb/server/smb2pdu.c
|
||
+++ b/fs/smb/server/smb2pdu.c
|
||
@@ -7442,17 +7442,17 @@ int smb2_lock(struct ksmbd_work *work)
|
||
}
|
||
|
||
no_check_cl:
|
||
+ flock = smb_lock->fl;
|
||
+ list_del(&smb_lock->llist);
|
||
+
|
||
if (smb_lock->zero_len) {
|
||
err = 0;
|
||
goto skip;
|
||
}
|
||
-
|
||
- flock = smb_lock->fl;
|
||
- list_del(&smb_lock->llist);
|
||
retry:
|
||
rc = vfs_lock_file(filp, smb_lock->cmd, flock, NULL);
|
||
skip:
|
||
- if (flags & SMB2_LOCKFLAG_UNLOCK) {
|
||
+ if (smb_lock->flags & SMB2_LOCKFLAG_UNLOCK) {
|
||
if (!rc) {
|
||
ksmbd_debug(SMB, "File unlocked\n");
|
||
} else if (rc == -ENOENT) {
|
||
diff --git a/fs/smb/server/smbacl.c b/fs/smb/server/smbacl.c
|
||
index 1c9775f1efa56d..da8ed72f335d99 100644
|
||
--- a/fs/smb/server/smbacl.c
|
||
+++ b/fs/smb/server/smbacl.c
|
||
@@ -807,6 +807,13 @@ static int parse_sid(struct smb_sid *psid, char *end_of_acl)
|
||
return -EINVAL;
|
||
}
|
||
|
||
+ if (!psid->num_subauth)
|
||
+ return 0;
|
||
+
|
||
+ if (psid->num_subauth > SID_MAX_SUB_AUTHORITIES ||
|
||
+ end_of_acl < (char *)psid + 8 + sizeof(__le32) * psid->num_subauth)
|
||
+ return -EINVAL;
|
||
+
|
||
return 0;
|
||
}
|
||
|
||
@@ -848,6 +855,9 @@ int parse_sec_desc(struct mnt_idmap *idmap, struct smb_ntsd *pntsd,
|
||
pntsd->type = cpu_to_le16(DACL_PRESENT);
|
||
|
||
if (pntsd->osidoffset) {
|
||
+ if (le32_to_cpu(pntsd->osidoffset) < sizeof(struct smb_ntsd))
|
||
+ return -EINVAL;
|
||
+
|
||
rc = parse_sid(owner_sid_ptr, end_of_acl);
|
||
if (rc) {
|
||
pr_err("%s: Error %d parsing Owner SID\n", __func__, rc);
|
||
@@ -863,6 +873,9 @@ int parse_sec_desc(struct mnt_idmap *idmap, struct smb_ntsd *pntsd,
|
||
}
|
||
|
||
if (pntsd->gsidoffset) {
|
||
+ if (le32_to_cpu(pntsd->gsidoffset) < sizeof(struct smb_ntsd))
|
||
+ return -EINVAL;
|
||
+
|
||
rc = parse_sid(group_sid_ptr, end_of_acl);
|
||
if (rc) {
|
||
pr_err("%s: Error %d mapping Owner SID to gid\n",
|
||
@@ -884,6 +897,9 @@ int parse_sec_desc(struct mnt_idmap *idmap, struct smb_ntsd *pntsd,
|
||
pntsd->type |= cpu_to_le16(DACL_PROTECTED);
|
||
|
||
if (dacloffset) {
|
||
+ if (dacloffset < sizeof(struct smb_ntsd))
|
||
+ return -EINVAL;
|
||
+
|
||
parse_dacl(idmap, dacl_ptr, end_of_acl,
|
||
owner_sid_ptr, group_sid_ptr, fattr);
|
||
}
|
||
diff --git a/fs/smb/server/transport_ipc.c b/fs/smb/server/transport_ipc.c
|
||
index 449999576a141e..2d7cd7f42f2785 100644
|
||
--- a/fs/smb/server/transport_ipc.c
|
||
+++ b/fs/smb/server/transport_ipc.c
|
||
@@ -267,6 +267,7 @@ static int handle_response(int type, void *payload, size_t sz)
|
||
if (entry->type + 1 != type) {
|
||
pr_err("Waiting for IPC type %d, got %d. Ignore.\n",
|
||
entry->type + 1, type);
|
||
+ continue;
|
||
}
|
||
|
||
entry->response = kvzalloc(sz, GFP_KERNEL);
|
||
diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
|
||
index 6dcf4d576970c4..2d7ae9b51d1e35 100644
|
||
--- a/include/asm-generic/hugetlb.h
|
||
+++ b/include/asm-generic/hugetlb.h
|
||
@@ -84,7 +84,7 @@ static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
|
||
|
||
#ifndef __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
|
||
static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
|
||
- unsigned long addr, pte_t *ptep)
|
||
+ unsigned long addr, pte_t *ptep, unsigned long sz)
|
||
{
|
||
return ptep_get_and_clear(mm, addr, ptep);
|
||
}
|
||
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
|
||
index e9477649604964..7bf0c521db6340 100644
|
||
--- a/include/linux/compaction.h
|
||
+++ b/include/linux/compaction.h
|
||
@@ -80,6 +80,11 @@ static inline unsigned long compact_gap(unsigned int order)
|
||
return 2UL << order;
|
||
}
|
||
|
||
+static inline int current_is_kcompactd(void)
|
||
+{
|
||
+ return current->flags & PF_KCOMPACTD;
|
||
+}
|
||
+
|
||
#ifdef CONFIG_COMPACTION
|
||
|
||
extern unsigned int extfrag_for_order(struct zone *zone, unsigned int order);
|
||
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
|
||
index 0ca93c7574ad22..fc2023d07f6931 100644
|
||
--- a/include/linux/hugetlb.h
|
||
+++ b/include/linux/hugetlb.h
|
||
@@ -1007,7 +1007,9 @@ static inline void hugetlb_count_sub(long l, struct mm_struct *mm)
|
||
static inline pte_t huge_ptep_modify_prot_start(struct vm_area_struct *vma,
|
||
unsigned long addr, pte_t *ptep)
|
||
{
|
||
- return huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
|
||
+ unsigned long psize = huge_page_size(hstate_vma(vma));
|
||
+
|
||
+ return huge_ptep_get_and_clear(vma->vm_mm, addr, ptep, psize);
|
||
}
|
||
#endif
|
||
|
||
diff --git a/include/linux/sched.h b/include/linux/sched.h
|
||
index 2af0a8859d6473..393c300347dee4 100644
|
||
--- a/include/linux/sched.h
|
||
+++ b/include/linux/sched.h
|
||
@@ -1746,7 +1746,7 @@ extern struct pid *cad_pid;
|
||
#define PF_USED_MATH 0x00002000 /* If unset the fpu must be initialized before use */
|
||
#define PF_USER_WORKER 0x00004000 /* Kernel thread cloned from userspace thread */
|
||
#define PF_NOFREEZE 0x00008000 /* This thread should not be frozen */
|
||
-#define PF__HOLE__00010000 0x00010000
|
||
+#define PF_KCOMPACTD 0x00010000 /* I am kcompactd */
|
||
#define PF_KSWAPD 0x00020000 /* I am kswapd */
|
||
#define PF_MEMALLOC_NOFS 0x00040000 /* All allocation requests will inherit GFP_NOFS */
|
||
#define PF_MEMALLOC_NOIO 0x00080000 /* All allocation requests will inherit GFP_NOIO */
|
||
diff --git a/kernel/events/core.c b/kernel/events/core.c
|
||
index 4f6b18ecfdb219..4dd8936b5aa09a 100644
|
||
--- a/kernel/events/core.c
|
||
+++ b/kernel/events/core.c
|
||
@@ -11660,6 +11660,8 @@ void perf_pmu_unregister(struct pmu *pmu)
|
||
{
|
||
mutex_lock(&pmus_lock);
|
||
list_del_rcu(&pmu->entry);
|
||
+ idr_remove(&pmu_idr, pmu->type);
|
||
+ mutex_unlock(&pmus_lock);
|
||
|
||
/*
|
||
* We dereference the pmu list under both SRCU and regular RCU, so
|
||
@@ -11669,7 +11671,6 @@ void perf_pmu_unregister(struct pmu *pmu)
|
||
synchronize_rcu();
|
||
|
||
free_percpu(pmu->pmu_disable_count);
|
||
- idr_remove(&pmu_idr, pmu->type);
|
||
if (pmu_bus_running && pmu->dev && pmu->dev != PMU_NULL_DEV) {
|
||
if (pmu->nr_addr_filters)
|
||
device_remove_file(pmu->dev, &dev_attr_nr_addr_filters);
|
||
@@ -11677,7 +11678,6 @@ void perf_pmu_unregister(struct pmu *pmu)
|
||
put_device(pmu->dev);
|
||
}
|
||
free_pmu_context(pmu);
|
||
- mutex_unlock(&pmus_lock);
|
||
}
|
||
EXPORT_SYMBOL_GPL(perf_pmu_unregister);
|
||
|
||
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
|
||
index 7e2edd1b069397..f5dfc2f22d798b 100644
|
||
--- a/kernel/events/uprobes.c
|
||
+++ b/kernel/events/uprobes.c
|
||
@@ -1721,6 +1721,7 @@ void uprobe_free_utask(struct task_struct *t)
|
||
if (!utask)
|
||
return;
|
||
|
||
+ t->utask = NULL;
|
||
if (utask->active_uprobe)
|
||
put_uprobe(utask->active_uprobe);
|
||
|
||
@@ -1730,7 +1731,6 @@ void uprobe_free_utask(struct task_struct *t)
|
||
|
||
xol_free_insn_slot(t);
|
||
kfree(utask);
|
||
- t->utask = NULL;
|
||
}
|
||
|
||
/*
|
||
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
|
||
index 726fa69c4d88b2..2808dbdd03847e 100644
|
||
--- a/kernel/sched/fair.c
|
||
+++ b/kernel/sched/fair.c
|
||
@@ -4118,15 +4118,17 @@ static inline bool child_cfs_rq_on_list(struct cfs_rq *cfs_rq)
|
||
{
|
||
struct cfs_rq *prev_cfs_rq;
|
||
struct list_head *prev;
|
||
+ struct rq *rq = rq_of(cfs_rq);
|
||
|
||
if (cfs_rq->on_list) {
|
||
prev = cfs_rq->leaf_cfs_rq_list.prev;
|
||
} else {
|
||
- struct rq *rq = rq_of(cfs_rq);
|
||
-
|
||
prev = rq->tmp_alone_branch;
|
||
}
|
||
|
||
+ if (prev == &rq->leaf_cfs_rq_list)
|
||
+ return false;
|
||
+
|
||
prev_cfs_rq = container_of(prev, struct cfs_rq, leaf_cfs_rq_list);
|
||
|
||
return (prev_cfs_rq->tg->parent == cfs_rq->tg);
|
||
diff --git a/kernel/trace/trace_fprobe.c b/kernel/trace/trace_fprobe.c
|
||
index f26bb8a90cb541..93620a78358769 100644
|
||
--- a/kernel/trace/trace_fprobe.c
|
||
+++ b/kernel/trace/trace_fprobe.c
|
||
@@ -948,6 +948,8 @@ static int parse_symbol_and_return(int argc, const char *argv[],
|
||
if (is_tracepoint) {
|
||
trace_probe_log_set_index(i);
|
||
trace_probe_log_err(tmp - argv[i], RETVAL_ON_PROBE);
|
||
+ kfree(*symbol);
|
||
+ *symbol = NULL;
|
||
return -EINVAL;
|
||
}
|
||
*is_return = true;
|
||
diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
|
||
index cef3a50628a3e4..48afed3c3f88ec 100644
|
||
--- a/kernel/trace/trace_probe.h
|
||
+++ b/kernel/trace/trace_probe.h
|
||
@@ -35,7 +35,6 @@
|
||
#define MAX_ARG_NAME_LEN 32
|
||
#define MAX_BTF_ARGS_LEN 128
|
||
#define MAX_STRING_SIZE PATH_MAX
|
||
-#define MAX_ARG_BUF_LEN (MAX_TRACE_ARGS * MAX_ARG_NAME_LEN)
|
||
|
||
/* Reserved field names */
|
||
#define FIELD_STRING_IP "__probe_ip"
|
||
diff --git a/mm/compaction.c b/mm/compaction.c
|
||
index 61c741f11e9bb3..8b889bee2ace50 100644
|
||
--- a/mm/compaction.c
|
||
+++ b/mm/compaction.c
|
||
@@ -3050,6 +3050,7 @@ static int kcompactd(void *p)
|
||
if (!cpumask_empty(cpumask))
|
||
set_cpus_allowed_ptr(tsk, cpumask);
|
||
|
||
+ current->flags |= PF_KCOMPACTD;
|
||
set_freezable();
|
||
|
||
pgdat->kcompactd_max_order = 0;
|
||
@@ -3106,6 +3107,8 @@ static int kcompactd(void *p)
|
||
pgdat->proactive_compact_trigger = false;
|
||
}
|
||
|
||
+ current->flags &= ~PF_KCOMPACTD;
|
||
+
|
||
return 0;
|
||
}
|
||
|
||
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
|
||
index 21c12519a7ef3a..faded25b19be83 100644
|
||
--- a/mm/hugetlb.c
|
||
+++ b/mm/hugetlb.c
|
||
@@ -5236,7 +5236,7 @@ static void move_huge_pte(struct vm_area_struct *vma, unsigned long old_addr,
|
||
if (src_ptl != dst_ptl)
|
||
spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING);
|
||
|
||
- pte = huge_ptep_get_and_clear(mm, old_addr, src_pte);
|
||
+ pte = huge_ptep_get_and_clear(mm, old_addr, src_pte, sz);
|
||
set_huge_pte_at(mm, new_addr, dst_pte, pte, sz);
|
||
|
||
if (src_ptl != dst_ptl)
|
||
@@ -5399,7 +5399,7 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
|
||
set_vma_resv_flags(vma, HPAGE_RESV_UNMAPPED);
|
||
}
|
||
|
||
- pte = huge_ptep_get_and_clear(mm, address, ptep);
|
||
+ pte = huge_ptep_get_and_clear(mm, address, ptep, sz);
|
||
tlb_remove_huge_tlb_entry(h, tlb, ptep, address);
|
||
if (huge_pte_dirty(pte))
|
||
set_page_dirty(page);
|
||
diff --git a/mm/kmsan/hooks.c b/mm/kmsan/hooks.c
|
||
index 5d6e2dee5692a3..7478dfca737bcb 100644
|
||
--- a/mm/kmsan/hooks.c
|
||
+++ b/mm/kmsan/hooks.c
|
||
@@ -346,6 +346,7 @@ void kmsan_handle_dma(struct page *page, size_t offset, size_t size,
|
||
size -= to_go;
|
||
}
|
||
}
|
||
+EXPORT_SYMBOL_GPL(kmsan_handle_dma);
|
||
|
||
void kmsan_handle_dma_sg(struct scatterlist *sg, int nents,
|
||
enum dma_data_direction dir)
|
||
diff --git a/mm/memory.c b/mm/memory.c
|
||
index 742c2f65c2c857..65f1865cb461e4 100644
|
||
--- a/mm/memory.c
|
||
+++ b/mm/memory.c
|
||
@@ -2746,8 +2746,10 @@ static int __apply_to_page_range(struct mm_struct *mm, unsigned long addr,
|
||
next = pgd_addr_end(addr, end);
|
||
if (pgd_none(*pgd) && !create)
|
||
continue;
|
||
- if (WARN_ON_ONCE(pgd_leaf(*pgd)))
|
||
- return -EINVAL;
|
||
+ if (WARN_ON_ONCE(pgd_leaf(*pgd))) {
|
||
+ err = -EINVAL;
|
||
+ break;
|
||
+ }
|
||
if (!pgd_none(*pgd) && WARN_ON_ONCE(pgd_bad(*pgd))) {
|
||
if (!create)
|
||
continue;
|
||
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
|
||
index f47439e0ef1085..191f0f95d3edf6 100644
|
||
--- a/mm/page_alloc.c
|
||
+++ b/mm/page_alloc.c
|
||
@@ -3936,6 +3936,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
|
||
restart:
|
||
compaction_retries = 0;
|
||
no_progress_loops = 0;
|
||
+ compact_result = COMPACT_SKIPPED;
|
||
compact_priority = DEF_COMPACT_PRIORITY;
|
||
cpuset_mems_cookie = read_mems_allowed_begin();
|
||
zonelist_iter_cookie = zonelist_iter_begin();
|
||
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
|
||
index 5c2b5f93cb666d..fb947787f25da2 100644
|
||
--- a/mm/vmalloc.c
|
||
+++ b/mm/vmalloc.c
|
||
@@ -558,13 +558,13 @@ static int vmap_small_pages_range_noflush(unsigned long addr, unsigned long end,
|
||
mask |= PGTBL_PGD_MODIFIED;
|
||
err = vmap_pages_p4d_range(pgd, addr, next, prot, pages, &nr, &mask);
|
||
if (err)
|
||
- return err;
|
||
+ break;
|
||
} while (pgd++, addr = next, addr != end);
|
||
|
||
if (mask & ARCH_PAGE_TABLE_SYNC_MASK)
|
||
arch_sync_kernel_mappings(start, end);
|
||
|
||
- return 0;
|
||
+ return err;
|
||
}
|
||
|
||
/*
|
||
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
|
||
index e40aa3e3641cbf..b477ba37a6991f 100644
|
||
--- a/net/8021q/vlan.c
|
||
+++ b/net/8021q/vlan.c
|
||
@@ -131,7 +131,8 @@ int vlan_check_real_dev(struct net_device *real_dev,
|
||
{
|
||
const char *name = real_dev->name;
|
||
|
||
- if (real_dev->features & NETIF_F_VLAN_CHALLENGED) {
|
||
+ if (real_dev->features & NETIF_F_VLAN_CHALLENGED ||
|
||
+ real_dev->type != ARPHRD_ETHER) {
|
||
pr_info("VLANs not supported on %s\n", name);
|
||
NL_SET_ERR_MSG_MOD(extack, "VLANs not supported on device");
|
||
return -EOPNOTSUPP;
|
||
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
|
||
index b36254107ef578..29e420e9754bb3 100644
|
||
--- a/net/bluetooth/mgmt.c
|
||
+++ b/net/bluetooth/mgmt.c
|
||
@@ -9679,6 +9679,9 @@ void mgmt_device_connected(struct hci_dev *hdev, struct hci_conn *conn,
|
||
sizeof(*ev) + (name ? eir_precalc_len(name_len) : 0) +
|
||
eir_precalc_len(sizeof(conn->dev_class)));
|
||
|
||
+ if (!skb)
|
||
+ return;
|
||
+
|
||
ev = skb_put(skb, sizeof(*ev));
|
||
bacpy(&ev->addr.bdaddr, &conn->dst);
|
||
ev->addr.type = link_to_bdaddr(conn->type, conn->dst_type);
|
||
@@ -10443,6 +10446,8 @@ void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
|
||
|
||
skb = mgmt_alloc_skb(hdev, MGMT_EV_DEVICE_FOUND,
|
||
sizeof(*ev) + (name ? eir_precalc_len(name_len) : 0));
|
||
+ if (!skb)
|
||
+ return;
|
||
|
||
ev = skb_put(skb, sizeof(*ev));
|
||
bacpy(&ev->addr.bdaddr, bdaddr);
|
||
diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c
|
||
index 69e6012ae82fbd..f1f723579a490c 100644
|
||
--- a/net/ipv4/tcp_offload.c
|
||
+++ b/net/ipv4/tcp_offload.c
|
||
@@ -13,12 +13,15 @@
|
||
#include <net/tcp.h>
|
||
#include <net/protocol.h>
|
||
|
||
-static void tcp_gso_tstamp(struct sk_buff *skb, unsigned int ts_seq,
|
||
+static void tcp_gso_tstamp(struct sk_buff *skb, struct sk_buff *gso_skb,
|
||
unsigned int seq, unsigned int mss)
|
||
{
|
||
+ u32 flags = skb_shinfo(gso_skb)->tx_flags & SKBTX_ANY_TSTAMP;
|
||
+ u32 ts_seq = skb_shinfo(gso_skb)->tskey;
|
||
+
|
||
while (skb) {
|
||
if (before(ts_seq, seq + mss)) {
|
||
- skb_shinfo(skb)->tx_flags |= SKBTX_SW_TSTAMP;
|
||
+ skb_shinfo(skb)->tx_flags |= flags;
|
||
skb_shinfo(skb)->tskey = ts_seq;
|
||
return;
|
||
}
|
||
@@ -120,8 +123,8 @@ struct sk_buff *tcp_gso_segment(struct sk_buff *skb,
|
||
th = tcp_hdr(skb);
|
||
seq = ntohl(th->seq);
|
||
|
||
- if (unlikely(skb_shinfo(gso_skb)->tx_flags & SKBTX_SW_TSTAMP))
|
||
- tcp_gso_tstamp(segs, skb_shinfo(gso_skb)->tskey, seq, mss);
|
||
+ if (unlikely(skb_shinfo(gso_skb)->tx_flags & SKBTX_ANY_TSTAMP))
|
||
+ tcp_gso_tstamp(segs, gso_skb, seq, mss);
|
||
|
||
newcheck = ~csum_fold(csum_add(csum_unfold(th->check), delta));
|
||
|
||
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
|
||
index a727eeafd0a96d..2ab16139c197b3 100644
|
||
--- a/net/ipv4/udp_offload.c
|
||
+++ b/net/ipv4/udp_offload.c
|
||
@@ -315,13 +315,17 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
|
||
|
||
/* clear destructor to avoid skb_segment assigning it to tail */
|
||
copy_dtor = gso_skb->destructor == sock_wfree;
|
||
- if (copy_dtor)
|
||
+ if (copy_dtor) {
|
||
gso_skb->destructor = NULL;
|
||
+ gso_skb->sk = NULL;
|
||
+ }
|
||
|
||
segs = skb_segment(gso_skb, features);
|
||
if (IS_ERR_OR_NULL(segs)) {
|
||
- if (copy_dtor)
|
||
+ if (copy_dtor) {
|
||
gso_skb->destructor = sock_wfree;
|
||
+ gso_skb->sk = sk;
|
||
+ }
|
||
return segs;
|
||
}
|
||
|
||
diff --git a/net/ipv6/ila/ila_lwt.c b/net/ipv6/ila/ila_lwt.c
|
||
index ff7e734e335b06..7d574f5132e2fb 100644
|
||
--- a/net/ipv6/ila/ila_lwt.c
|
||
+++ b/net/ipv6/ila/ila_lwt.c
|
||
@@ -88,13 +88,15 @@ static int ila_output(struct net *net, struct sock *sk, struct sk_buff *skb)
|
||
goto drop;
|
||
}
|
||
|
||
- if (ilwt->connected) {
|
||
+ /* cache only if we don't create a dst reference loop */
|
||
+ if (ilwt->connected && orig_dst->lwtstate != dst->lwtstate) {
|
||
local_bh_disable();
|
||
dst_cache_set_ip6(&ilwt->dst_cache, dst, &fl6.saddr);
|
||
local_bh_enable();
|
||
}
|
||
}
|
||
|
||
+ skb_dst_drop(skb);
|
||
skb_dst_set(skb, dst);
|
||
return dst_output(net, sk, skb);
|
||
|
||
diff --git a/net/llc/llc_s_ac.c b/net/llc/llc_s_ac.c
|
||
index 06fb8e6944b06a..7a0cae9a811148 100644
|
||
--- a/net/llc/llc_s_ac.c
|
||
+++ b/net/llc/llc_s_ac.c
|
||
@@ -24,7 +24,7 @@
|
||
#include <net/llc_s_ac.h>
|
||
#include <net/llc_s_ev.h>
|
||
#include <net/llc_sap.h>
|
||
-
|
||
+#include <net/sock.h>
|
||
|
||
/**
|
||
* llc_sap_action_unitdata_ind - forward UI PDU to network layer
|
||
@@ -40,6 +40,26 @@ int llc_sap_action_unitdata_ind(struct llc_sap *sap, struct sk_buff *skb)
|
||
return 0;
|
||
}
|
||
|
||
+static int llc_prepare_and_xmit(struct sk_buff *skb)
|
||
+{
|
||
+ struct llc_sap_state_ev *ev = llc_sap_ev(skb);
|
||
+ struct sk_buff *nskb;
|
||
+ int rc;
|
||
+
|
||
+ rc = llc_mac_hdr_init(skb, ev->saddr.mac, ev->daddr.mac);
|
||
+ if (rc)
|
||
+ return rc;
|
||
+
|
||
+ nskb = skb_clone(skb, GFP_ATOMIC);
|
||
+ if (!nskb)
|
||
+ return -ENOMEM;
|
||
+
|
||
+ if (skb->sk)
|
||
+ skb_set_owner_w(nskb, skb->sk);
|
||
+
|
||
+ return dev_queue_xmit(nskb);
|
||
+}
|
||
+
|
||
/**
|
||
* llc_sap_action_send_ui - sends UI PDU resp to UNITDATA REQ to MAC layer
|
||
* @sap: SAP
|
||
@@ -52,17 +72,12 @@ int llc_sap_action_unitdata_ind(struct llc_sap *sap, struct sk_buff *skb)
|
||
int llc_sap_action_send_ui(struct llc_sap *sap, struct sk_buff *skb)
|
||
{
|
||
struct llc_sap_state_ev *ev = llc_sap_ev(skb);
|
||
- int rc;
|
||
|
||
llc_pdu_header_init(skb, LLC_PDU_TYPE_U, ev->saddr.lsap,
|
||
ev->daddr.lsap, LLC_PDU_CMD);
|
||
llc_pdu_init_as_ui_cmd(skb);
|
||
- rc = llc_mac_hdr_init(skb, ev->saddr.mac, ev->daddr.mac);
|
||
- if (likely(!rc)) {
|
||
- skb_get(skb);
|
||
- rc = dev_queue_xmit(skb);
|
||
- }
|
||
- return rc;
|
||
+
|
||
+ return llc_prepare_and_xmit(skb);
|
||
}
|
||
|
||
/**
|
||
@@ -77,17 +92,12 @@ int llc_sap_action_send_ui(struct llc_sap *sap, struct sk_buff *skb)
|
||
int llc_sap_action_send_xid_c(struct llc_sap *sap, struct sk_buff *skb)
|
||
{
|
||
struct llc_sap_state_ev *ev = llc_sap_ev(skb);
|
||
- int rc;
|
||
|
||
llc_pdu_header_init(skb, LLC_PDU_TYPE_U_XID, ev->saddr.lsap,
|
||
ev->daddr.lsap, LLC_PDU_CMD);
|
||
llc_pdu_init_as_xid_cmd(skb, LLC_XID_NULL_CLASS_2, 0);
|
||
- rc = llc_mac_hdr_init(skb, ev->saddr.mac, ev->daddr.mac);
|
||
- if (likely(!rc)) {
|
||
- skb_get(skb);
|
||
- rc = dev_queue_xmit(skb);
|
||
- }
|
||
- return rc;
|
||
+
|
||
+ return llc_prepare_and_xmit(skb);
|
||
}
|
||
|
||
/**
|
||
@@ -133,17 +143,12 @@ int llc_sap_action_send_xid_r(struct llc_sap *sap, struct sk_buff *skb)
|
||
int llc_sap_action_send_test_c(struct llc_sap *sap, struct sk_buff *skb)
|
||
{
|
||
struct llc_sap_state_ev *ev = llc_sap_ev(skb);
|
||
- int rc;
|
||
|
||
llc_pdu_header_init(skb, LLC_PDU_TYPE_U, ev->saddr.lsap,
|
||
ev->daddr.lsap, LLC_PDU_CMD);
|
||
llc_pdu_init_as_test_cmd(skb);
|
||
- rc = llc_mac_hdr_init(skb, ev->saddr.mac, ev->daddr.mac);
|
||
- if (likely(!rc)) {
|
||
- skb_get(skb);
|
||
- rc = dev_queue_xmit(skb);
|
||
- }
|
||
- return rc;
|
||
+
|
||
+ return llc_prepare_and_xmit(skb);
|
||
}
|
||
|
||
int llc_sap_action_send_test_r(struct llc_sap *sap, struct sk_buff *skb)
|
||
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
|
||
index 5f16e2fa2de67a..f7257de37bd090 100644
|
||
--- a/net/mptcp/pm_netlink.c
|
||
+++ b/net/mptcp/pm_netlink.c
|
||
@@ -969,7 +969,7 @@ static void __mptcp_pm_release_addr_entry(struct mptcp_pm_addr_entry *entry)
|
||
|
||
static int mptcp_pm_nl_append_new_local_addr(struct pm_nl_pernet *pernet,
|
||
struct mptcp_pm_addr_entry *entry,
|
||
- bool needs_id)
|
||
+ bool needs_id, bool replace)
|
||
{
|
||
struct mptcp_pm_addr_entry *cur, *del_entry = NULL;
|
||
unsigned int addr_max;
|
||
@@ -1009,6 +1009,17 @@ static int mptcp_pm_nl_append_new_local_addr(struct pm_nl_pernet *pernet,
|
||
if (entry->addr.id)
|
||
goto out;
|
||
|
||
+ /* allow callers that only need to look up the local
|
||
+ * addr's id to skip replacement. This allows them to
|
||
+ * avoid calling synchronize_rcu in the packet recv
|
||
+ * path.
|
||
+ */
|
||
+ if (!replace) {
|
||
+ kfree(entry);
|
||
+ ret = cur->addr.id;
|
||
+ goto out;
|
||
+ }
|
||
+
|
||
pernet->addrs--;
|
||
entry->addr.id = cur->addr.id;
|
||
list_del_rcu(&cur->list);
|
||
@@ -1161,7 +1172,7 @@ int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_info *skc
|
||
entry->ifindex = 0;
|
||
entry->flags = MPTCP_PM_ADDR_FLAG_IMPLICIT;
|
||
entry->lsk = NULL;
|
||
- ret = mptcp_pm_nl_append_new_local_addr(pernet, entry, true);
|
||
+ ret = mptcp_pm_nl_append_new_local_addr(pernet, entry, true, false);
|
||
if (ret < 0)
|
||
kfree(entry);
|
||
|
||
@@ -1456,7 +1467,8 @@ static int mptcp_nl_cmd_add_addr(struct sk_buff *skb, struct genl_info *info)
|
||
}
|
||
}
|
||
ret = mptcp_pm_nl_append_new_local_addr(pernet, entry,
|
||
- !mptcp_pm_has_addr_attr_id(attr, info));
|
||
+ !mptcp_pm_has_addr_attr_id(attr, info),
|
||
+ true);
|
||
if (ret < 0) {
|
||
GENL_SET_ERR_MSG_FMT(info, "too many addresses or duplicate one: %d", ret);
|
||
goto out_free;
|
||
diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c
|
||
index e1040421b79797..1080d89f917802 100644
|
||
--- a/net/sched/sch_fifo.c
|
||
+++ b/net/sched/sch_fifo.c
|
||
@@ -39,6 +39,9 @@ static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc *sch,
|
||
{
|
||
unsigned int prev_backlog;
|
||
|
||
+ if (unlikely(sch->limit == 0))
|
||
+ return qdisc_drop(skb, sch, to_free);
|
||
+
|
||
if (likely(sch->q.qlen < sch->limit))
|
||
return qdisc_enqueue_tail(skb, sch);
|
||
|
||
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
|
||
index 5b9f39d93b0456..0fdd614e08d08b 100644
|
||
--- a/net/wireless/nl80211.c
|
||
+++ b/net/wireless/nl80211.c
|
||
@@ -4102,6 +4102,11 @@ static int parse_monitor_flags(struct nlattr *nla, u32 *mntrflags)
|
||
if (flags[flag])
|
||
*mntrflags |= (1<<flag);
|
||
|
||
+ /* cooked monitor mode is incompatible with other modes */
|
||
+ if (*mntrflags & MONITOR_FLAG_COOK_FRAMES &&
|
||
+ *mntrflags != MONITOR_FLAG_COOK_FRAMES)
|
||
+ return -EOPNOTSUPP;
|
||
+
|
||
*mntrflags |= MONITOR_FLAG_CHANGED;
|
||
|
||
return 0;
|
||
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
|
||
index 0317cf9da307db..9e0366ea86f4a5 100644
|
||
--- a/net/wireless/reg.c
|
||
+++ b/net/wireless/reg.c
|
||
@@ -405,7 +405,8 @@ static bool is_an_alpha2(const char *alpha2)
|
||
{
|
||
if (!alpha2)
|
||
return false;
|
||
- return isalpha(alpha2[0]) && isalpha(alpha2[1]);
|
||
+ return isascii(alpha2[0]) && isalpha(alpha2[0]) &&
|
||
+ isascii(alpha2[1]) && isalpha(alpha2[1]);
|
||
}
|
||
|
||
static bool alpha2_equal(const char *alpha2_x, const char *alpha2_y)
|
||
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
|
||
index cc1217ac2c6faf..98308a2bdef6e0 100644
|
||
--- a/security/integrity/ima/ima_main.c
|
||
+++ b/security/integrity/ima/ima_main.c
|
||
@@ -267,10 +267,13 @@ static int process_measurement(struct file *file, const struct cred *cred,
|
||
mutex_lock(&iint->mutex);
|
||
|
||
if (test_and_clear_bit(IMA_CHANGE_ATTR, &iint->atomic_flags))
|
||
- /* reset appraisal flags if ima_inode_post_setattr was called */
|
||
+ /*
|
||
+ * Reset appraisal flags (action and non-action rule-specific)
|
||
+ * if ima_inode_post_setattr was called.
|
||
+ */
|
||
iint->flags &= ~(IMA_APPRAISE | IMA_APPRAISED |
|
||
IMA_APPRAISE_SUBMASK | IMA_APPRAISED_SUBMASK |
|
||
- IMA_NONACTION_FLAGS);
|
||
+ IMA_NONACTION_RULE_FLAGS);
|
||
|
||
/*
|
||
* Re-evaulate the file if either the xattr has changed or the
|
||
diff --git a/security/integrity/integrity.h b/security/integrity/integrity.h
|
||
index 9561db7cf6b42c..ad20ff7f5dfaa4 100644
|
||
--- a/security/integrity/integrity.h
|
||
+++ b/security/integrity/integrity.h
|
||
@@ -42,6 +42,9 @@
|
||
#define IMA_CHECK_BLACKLIST 0x40000000
|
||
#define IMA_VERITY_REQUIRED 0x80000000
|
||
|
||
+/* Exclude non-action flags which are not rule-specific. */
|
||
+#define IMA_NONACTION_RULE_FLAGS (IMA_NONACTION_FLAGS & ~IMA_NEW_FILE)
|
||
+
|
||
#define IMA_DO_MASK (IMA_MEASURE | IMA_APPRAISE | IMA_AUDIT | \
|
||
IMA_HASH | IMA_APPRAISE_SUBMASK)
|
||
#define IMA_DONE_MASK (IMA_MEASURED | IMA_APPRAISED | IMA_AUDITED | \
|
||
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
|
||
index 54931ad0dc990f..6195fe9dda1799 100644
|
||
--- a/sound/core/seq/seq_clientmgr.c
|
||
+++ b/sound/core/seq/seq_clientmgr.c
|
||
@@ -106,7 +106,7 @@ static struct snd_seq_client *clientptr(int clientid)
|
||
return clienttab[clientid];
|
||
}
|
||
|
||
-struct snd_seq_client *snd_seq_client_use_ptr(int clientid)
|
||
+static struct snd_seq_client *client_use_ptr(int clientid, bool load_module)
|
||
{
|
||
unsigned long flags;
|
||
struct snd_seq_client *client;
|
||
@@ -126,7 +126,7 @@ struct snd_seq_client *snd_seq_client_use_ptr(int clientid)
|
||
}
|
||
spin_unlock_irqrestore(&clients_lock, flags);
|
||
#ifdef CONFIG_MODULES
|
||
- if (!in_interrupt()) {
|
||
+ if (load_module) {
|
||
static DECLARE_BITMAP(client_requested, SNDRV_SEQ_GLOBAL_CLIENTS);
|
||
static DECLARE_BITMAP(card_requested, SNDRV_CARDS);
|
||
|
||
@@ -168,6 +168,20 @@ struct snd_seq_client *snd_seq_client_use_ptr(int clientid)
|
||
return client;
|
||
}
|
||
|
||
+/* get snd_seq_client object for the given id quickly */
|
||
+struct snd_seq_client *snd_seq_client_use_ptr(int clientid)
|
||
+{
|
||
+ return client_use_ptr(clientid, false);
|
||
+}
|
||
+
|
||
+/* get snd_seq_client object for the given id;
|
||
+ * if not found, retry after loading the modules
|
||
+ */
|
||
+static struct snd_seq_client *client_load_and_use_ptr(int clientid)
|
||
+{
|
||
+ return client_use_ptr(clientid, IS_ENABLED(CONFIG_MODULES));
|
||
+}
|
||
+
|
||
/* Take refcount and perform ioctl_mutex lock on the given client;
|
||
* used only for OSS sequencer
|
||
* Unlock via snd_seq_client_ioctl_unlock() below
|
||
@@ -176,7 +190,7 @@ bool snd_seq_client_ioctl_lock(int clientid)
|
||
{
|
||
struct snd_seq_client *client;
|
||
|
||
- client = snd_seq_client_use_ptr(clientid);
|
||
+ client = client_load_and_use_ptr(clientid);
|
||
if (!client)
|
||
return false;
|
||
mutex_lock(&client->ioctl_mutex);
|
||
@@ -1200,7 +1214,7 @@ static int snd_seq_ioctl_running_mode(struct snd_seq_client *client, void *arg)
|
||
int err = 0;
|
||
|
||
/* requested client number */
|
||
- cptr = snd_seq_client_use_ptr(info->client);
|
||
+ cptr = client_load_and_use_ptr(info->client);
|
||
if (cptr == NULL)
|
||
return -ENOENT; /* don't change !!! */
|
||
|
||
@@ -1262,7 +1276,7 @@ static int snd_seq_ioctl_get_client_info(struct snd_seq_client *client,
|
||
struct snd_seq_client *cptr;
|
||
|
||
/* requested client number */
|
||
- cptr = snd_seq_client_use_ptr(client_info->client);
|
||
+ cptr = client_load_and_use_ptr(client_info->client);
|
||
if (cptr == NULL)
|
||
return -ENOENT; /* don't change !!! */
|
||
|
||
@@ -1397,7 +1411,7 @@ static int snd_seq_ioctl_get_port_info(struct snd_seq_client *client, void *arg)
|
||
struct snd_seq_client *cptr;
|
||
struct snd_seq_client_port *port;
|
||
|
||
- cptr = snd_seq_client_use_ptr(info->addr.client);
|
||
+ cptr = client_load_and_use_ptr(info->addr.client);
|
||
if (cptr == NULL)
|
||
return -ENXIO;
|
||
|
||
@@ -1501,10 +1515,10 @@ static int snd_seq_ioctl_subscribe_port(struct snd_seq_client *client,
|
||
struct snd_seq_client *receiver = NULL, *sender = NULL;
|
||
struct snd_seq_client_port *sport = NULL, *dport = NULL;
|
||
|
||
- receiver = snd_seq_client_use_ptr(subs->dest.client);
|
||
+ receiver = client_load_and_use_ptr(subs->dest.client);
|
||
if (!receiver)
|
||
goto __end;
|
||
- sender = snd_seq_client_use_ptr(subs->sender.client);
|
||
+ sender = client_load_and_use_ptr(subs->sender.client);
|
||
if (!sender)
|
||
goto __end;
|
||
sport = snd_seq_port_use_ptr(sender, subs->sender.port);
|
||
@@ -1865,7 +1879,7 @@ static int snd_seq_ioctl_get_client_pool(struct snd_seq_client *client,
|
||
struct snd_seq_client_pool *info = arg;
|
||
struct snd_seq_client *cptr;
|
||
|
||
- cptr = snd_seq_client_use_ptr(info->client);
|
||
+ cptr = client_load_and_use_ptr(info->client);
|
||
if (cptr == NULL)
|
||
return -ENOENT;
|
||
memset(info, 0, sizeof(*info));
|
||
@@ -1969,7 +1983,7 @@ static int snd_seq_ioctl_get_subscription(struct snd_seq_client *client,
|
||
struct snd_seq_client_port *sport = NULL;
|
||
|
||
result = -EINVAL;
|
||
- sender = snd_seq_client_use_ptr(subs->sender.client);
|
||
+ sender = client_load_and_use_ptr(subs->sender.client);
|
||
if (!sender)
|
||
goto __end;
|
||
sport = snd_seq_port_use_ptr(sender, subs->sender.port);
|
||
@@ -2000,7 +2014,7 @@ static int snd_seq_ioctl_query_subs(struct snd_seq_client *client, void *arg)
|
||
struct list_head *p;
|
||
int i;
|
||
|
||
- cptr = snd_seq_client_use_ptr(subs->root.client);
|
||
+ cptr = client_load_and_use_ptr(subs->root.client);
|
||
if (!cptr)
|
||
goto __end;
|
||
port = snd_seq_port_use_ptr(cptr, subs->root.port);
|
||
@@ -2067,7 +2081,7 @@ static int snd_seq_ioctl_query_next_client(struct snd_seq_client *client,
|
||
if (info->client < 0)
|
||
info->client = 0;
|
||
for (; info->client < SNDRV_SEQ_MAX_CLIENTS; info->client++) {
|
||
- cptr = snd_seq_client_use_ptr(info->client);
|
||
+ cptr = client_load_and_use_ptr(info->client);
|
||
if (cptr)
|
||
break; /* found */
|
||
}
|
||
@@ -2090,7 +2104,7 @@ static int snd_seq_ioctl_query_next_port(struct snd_seq_client *client,
|
||
struct snd_seq_client *cptr;
|
||
struct snd_seq_client_port *port = NULL;
|
||
|
||
- cptr = snd_seq_client_use_ptr(info->addr.client);
|
||
+ cptr = client_load_and_use_ptr(info->addr.client);
|
||
if (cptr == NULL)
|
||
return -ENXIO;
|
||
|
||
@@ -2187,7 +2201,7 @@ static int snd_seq_ioctl_client_ump_info(struct snd_seq_client *caller,
|
||
size = sizeof(struct snd_ump_endpoint_info);
|
||
else
|
||
size = sizeof(struct snd_ump_block_info);
|
||
- cptr = snd_seq_client_use_ptr(client);
|
||
+ cptr = client_load_and_use_ptr(client);
|
||
if (!cptr)
|
||
return -ENOENT;
|
||
|
||
@@ -2459,7 +2473,7 @@ int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev,
|
||
if (check_event_type_and_length(ev))
|
||
return -EINVAL;
|
||
|
||
- cptr = snd_seq_client_use_ptr(client);
|
||
+ cptr = client_load_and_use_ptr(client);
|
||
if (cptr == NULL)
|
||
return -EINVAL;
|
||
|
||
@@ -2686,7 +2700,7 @@ void snd_seq_info_clients_read(struct snd_info_entry *entry,
|
||
|
||
/* list the client table */
|
||
for (c = 0; c < SNDRV_SEQ_MAX_CLIENTS; c++) {
|
||
- client = snd_seq_client_use_ptr(c);
|
||
+ client = client_load_and_use_ptr(c);
|
||
if (client == NULL)
|
||
continue;
|
||
if (client->type == NO_CLIENT) {
|
||
diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig
|
||
index 233b03bb4f9869..bc32a2e345b7eb 100644
|
||
--- a/sound/pci/hda/Kconfig
|
||
+++ b/sound/pci/hda/Kconfig
|
||
@@ -183,6 +183,7 @@ comment "Set to Y if you want auto-loading the side codec driver"
|
||
|
||
config SND_HDA_CODEC_REALTEK
|
||
tristate "Build Realtek HD-audio codec support"
|
||
+ depends on INPUT
|
||
select SND_HDA_GENERIC
|
||
select SND_HDA_GENERIC_LEDS
|
||
help
|
||
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
|
||
index 134c6f6e0959ae..d90151910bee90 100644
|
||
--- a/sound/pci/hda/hda_intel.c
|
||
+++ b/sound/pci/hda/hda_intel.c
|
||
@@ -2222,6 +2222,8 @@ static const struct snd_pci_quirk power_save_denylist[] = {
|
||
SND_PCI_QUIRK(0x1631, 0xe017, "Packard Bell NEC IMEDIA 5204", 0),
|
||
/* KONTRON SinglePC may cause a stall at runtime resume */
|
||
SND_PCI_QUIRK(0x1734, 0x1232, "KONTRON SinglePC", 0),
|
||
+ /* Dell ALC3271 */
|
||
+ SND_PCI_QUIRK(0x1028, 0x0962, "Dell ALC3271", 0),
|
||
{}
|
||
};
|
||
#endif /* CONFIG_PM */
|
||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
|
||
index 822bd9a00892c3..ec57148453c820 100644
|
||
--- a/sound/pci/hda/patch_realtek.c
|
||
+++ b/sound/pci/hda/patch_realtek.c
|
||
@@ -3834,6 +3834,79 @@ static void alc225_shutup(struct hda_codec *codec)
|
||
}
|
||
}
|
||
|
||
+static void alc222_init(struct hda_codec *codec)
|
||
+{
|
||
+ struct alc_spec *spec = codec->spec;
|
||
+ hda_nid_t hp_pin = alc_get_hp_pin(spec);
|
||
+ bool hp1_pin_sense, hp2_pin_sense;
|
||
+
|
||
+ if (!hp_pin)
|
||
+ return;
|
||
+
|
||
+ msleep(30);
|
||
+
|
||
+ hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
|
||
+ hp2_pin_sense = snd_hda_jack_detect(codec, 0x14);
|
||
+
|
||
+ if (hp1_pin_sense || hp2_pin_sense) {
|
||
+ msleep(2);
|
||
+
|
||
+ if (hp1_pin_sense)
|
||
+ snd_hda_codec_write(codec, hp_pin, 0,
|
||
+ AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
|
||
+ if (hp2_pin_sense)
|
||
+ snd_hda_codec_write(codec, 0x14, 0,
|
||
+ AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
|
||
+ msleep(75);
|
||
+
|
||
+ if (hp1_pin_sense)
|
||
+ snd_hda_codec_write(codec, hp_pin, 0,
|
||
+ AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
|
||
+ if (hp2_pin_sense)
|
||
+ snd_hda_codec_write(codec, 0x14, 0,
|
||
+ AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
|
||
+
|
||
+ msleep(75);
|
||
+ }
|
||
+}
|
||
+
|
||
+static void alc222_shutup(struct hda_codec *codec)
|
||
+{
|
||
+ struct alc_spec *spec = codec->spec;
|
||
+ hda_nid_t hp_pin = alc_get_hp_pin(spec);
|
||
+ bool hp1_pin_sense, hp2_pin_sense;
|
||
+
|
||
+ if (!hp_pin)
|
||
+ hp_pin = 0x21;
|
||
+
|
||
+ hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
|
||
+ hp2_pin_sense = snd_hda_jack_detect(codec, 0x14);
|
||
+
|
||
+ if (hp1_pin_sense || hp2_pin_sense) {
|
||
+ msleep(2);
|
||
+
|
||
+ if (hp1_pin_sense)
|
||
+ snd_hda_codec_write(codec, hp_pin, 0,
|
||
+ AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
|
||
+ if (hp2_pin_sense)
|
||
+ snd_hda_codec_write(codec, 0x14, 0,
|
||
+ AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
|
||
+
|
||
+ msleep(75);
|
||
+
|
||
+ if (hp1_pin_sense)
|
||
+ snd_hda_codec_write(codec, hp_pin, 0,
|
||
+ AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
|
||
+ if (hp2_pin_sense)
|
||
+ snd_hda_codec_write(codec, 0x14, 0,
|
||
+ AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
|
||
+
|
||
+ msleep(75);
|
||
+ }
|
||
+ alc_auto_setup_eapd(codec, false);
|
||
+ alc_shutup_pins(codec);
|
||
+}
|
||
+
|
||
static void alc_default_init(struct hda_codec *codec)
|
||
{
|
||
struct alc_spec *spec = codec->spec;
|
||
@@ -4792,7 +4865,6 @@ static void alc298_fixup_samsung_amp(struct hda_codec *codec,
|
||
}
|
||
}
|
||
|
||
-#if IS_REACHABLE(CONFIG_INPUT)
|
||
static void gpio2_mic_hotkey_event(struct hda_codec *codec,
|
||
struct hda_jack_callback *event)
|
||
{
|
||
@@ -4901,10 +4973,6 @@ static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
|
||
spec->kb_dev = NULL;
|
||
}
|
||
}
|
||
-#else /* INPUT */
|
||
-#define alc280_fixup_hp_gpio2_mic_hotkey NULL
|
||
-#define alc233_fixup_lenovo_line2_mic_hotkey NULL
|
||
-#endif /* INPUT */
|
||
|
||
static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
|
||
const struct hda_fixup *fix, int action)
|
||
@@ -4918,6 +4986,16 @@ static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
|
||
}
|
||
}
|
||
|
||
+static void alc233_fixup_lenovo_low_en_micmute_led(struct hda_codec *codec,
|
||
+ const struct hda_fixup *fix, int action)
|
||
+{
|
||
+ struct alc_spec *spec = codec->spec;
|
||
+
|
||
+ if (action == HDA_FIXUP_ACT_PRE_PROBE)
|
||
+ spec->micmute_led_polarity = 1;
|
||
+ alc233_fixup_lenovo_line2_mic_hotkey(codec, fix, action);
|
||
+}
|
||
+
|
||
static void alc_hp_mute_disable(struct hda_codec *codec, unsigned int delay)
|
||
{
|
||
if (delay <= 0)
|
||
@@ -7295,6 +7373,7 @@ enum {
|
||
ALC275_FIXUP_DELL_XPS,
|
||
ALC293_FIXUP_LENOVO_SPK_NOISE,
|
||
ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
|
||
+ ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED,
|
||
ALC255_FIXUP_DELL_SPK_NOISE,
|
||
ALC225_FIXUP_DISABLE_MIC_VREF,
|
||
ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
|
||
@@ -8282,6 +8361,10 @@ static const struct hda_fixup alc269_fixups[] = {
|
||
.type = HDA_FIXUP_FUNC,
|
||
.v.func = alc233_fixup_lenovo_line2_mic_hotkey,
|
||
},
|
||
+ [ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED] = {
|
||
+ .type = HDA_FIXUP_FUNC,
|
||
+ .v.func = alc233_fixup_lenovo_low_en_micmute_led,
|
||
+ },
|
||
[ALC233_FIXUP_INTEL_NUC8_DMIC] = {
|
||
.type = HDA_FIXUP_FUNC,
|
||
.v.func = alc_fixup_inv_dmic,
|
||
@@ -10343,6 +10426,9 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
||
SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
|
||
SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
|
||
SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC),
|
||
+ SND_PCI_QUIRK(0x17aa, 0x3384, "ThinkCentre M90a PRO", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
|
||
+ SND_PCI_QUIRK(0x17aa, 0x3386, "ThinkCentre M90a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
|
||
+ SND_PCI_QUIRK(0x17aa, 0x3387, "ThinkCentre M70a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
|
||
SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
|
||
SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8 / DuetITL 2021", ALC287_FIXUP_LENOVO_14IRP8_DUETITL),
|
||
SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
|
||
@@ -11291,8 +11377,11 @@ static int patch_alc269(struct hda_codec *codec)
|
||
spec->codec_variant = ALC269_TYPE_ALC300;
|
||
spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
|
||
break;
|
||
+ case 0x10ec0222:
|
||
case 0x10ec0623:
|
||
spec->codec_variant = ALC269_TYPE_ALC623;
|
||
+ spec->shutup = alc222_shutup;
|
||
+ spec->init_hook = alc222_init;
|
||
break;
|
||
case 0x10ec0700:
|
||
case 0x10ec0701:
|
||
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c
|
||
index 4c4ce0319d624d..0fe989a6337691 100644
|
||
--- a/sound/usb/usx2y/usbusx2y.c
|
||
+++ b/sound/usb/usx2y/usbusx2y.c
|
||
@@ -151,6 +151,12 @@ static int snd_usx2y_card_used[SNDRV_CARDS];
|
||
static void snd_usx2y_card_private_free(struct snd_card *card);
|
||
static void usx2y_unlinkseq(struct snd_usx2y_async_seq *s);
|
||
|
||
+#ifdef USX2Y_NRPACKS_VARIABLE
|
||
+int nrpacks = USX2Y_NRPACKS; /* number of packets per urb */
|
||
+module_param(nrpacks, int, 0444);
|
||
+MODULE_PARM_DESC(nrpacks, "Number of packets per URB.");
|
||
+#endif
|
||
+
|
||
/*
|
||
* pipe 4 is used for switching the lamps, setting samplerate, volumes ....
|
||
*/
|
||
@@ -433,6 +439,11 @@ static int snd_usx2y_probe(struct usb_interface *intf,
|
||
struct snd_card *card;
|
||
int err;
|
||
|
||
+#ifdef USX2Y_NRPACKS_VARIABLE
|
||
+ if (nrpacks < 0 || nrpacks > USX2Y_NRPACKS_MAX)
|
||
+ return -EINVAL;
|
||
+#endif
|
||
+
|
||
if (le16_to_cpu(device->descriptor.idVendor) != 0x1604 ||
|
||
(le16_to_cpu(device->descriptor.idProduct) != USB_ID_US122 &&
|
||
le16_to_cpu(device->descriptor.idProduct) != USB_ID_US224 &&
|
||
diff --git a/sound/usb/usx2y/usbusx2y.h b/sound/usb/usx2y/usbusx2y.h
|
||
index 8d82f5cc2fe1c8..0538c457921e67 100644
|
||
--- a/sound/usb/usx2y/usbusx2y.h
|
||
+++ b/sound/usb/usx2y/usbusx2y.h
|
||
@@ -7,6 +7,32 @@
|
||
|
||
#define NRURBS 2
|
||
|
||
+/* Default value used for nr of packs per urb.
|
||
+ * 1 to 4 have been tested ok on uhci.
|
||
+ * To use 3 on ohci, you'd need a patch:
|
||
+ * look for "0000425-linux-2.6.9-rc4-mm1_ohci-hcd.patch.gz" on
|
||
+ * "https://bugtrack.alsa-project.org/alsa-bug/bug_view_page.php?bug_id=0000425"
|
||
+ *
|
||
+ * 1, 2 and 4 work out of the box on ohci, if I recall correctly.
|
||
+ * Bigger is safer operation, smaller gives lower latencies.
|
||
+ */
|
||
+#define USX2Y_NRPACKS 4
|
||
+
|
||
+#define USX2Y_NRPACKS_MAX 1024
|
||
+
|
||
+/* If your system works ok with this module's parameter
|
||
+ * nrpacks set to 1, you might as well comment
|
||
+ * this define out, and thereby produce smaller, faster code.
|
||
+ * You'd also set USX2Y_NRPACKS to 1 then.
|
||
+ */
|
||
+#define USX2Y_NRPACKS_VARIABLE 1
|
||
+
|
||
+#ifdef USX2Y_NRPACKS_VARIABLE
|
||
+extern int nrpacks;
|
||
+#define nr_of_packs() nrpacks
|
||
+#else
|
||
+#define nr_of_packs() USX2Y_NRPACKS
|
||
+#endif
|
||
|
||
#define URBS_ASYNC_SEQ 10
|
||
#define URB_DATA_LEN_ASYNC_SEQ 32
|
||
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
|
||
index 5197599e7aa61b..98d0e8edc98328 100644
|
||
--- a/sound/usb/usx2y/usbusx2yaudio.c
|
||
+++ b/sound/usb/usx2y/usbusx2yaudio.c
|
||
@@ -28,33 +28,6 @@
|
||
#include "usx2y.h"
|
||
#include "usbusx2y.h"
|
||
|
||
-/* Default value used for nr of packs per urb.
|
||
- * 1 to 4 have been tested ok on uhci.
|
||
- * To use 3 on ohci, you'd need a patch:
|
||
- * look for "0000425-linux-2.6.9-rc4-mm1_ohci-hcd.patch.gz" on
|
||
- * "https://bugtrack.alsa-project.org/alsa-bug/bug_view_page.php?bug_id=0000425"
|
||
- *
|
||
- * 1, 2 and 4 work out of the box on ohci, if I recall correctly.
|
||
- * Bigger is safer operation, smaller gives lower latencies.
|
||
- */
|
||
-#define USX2Y_NRPACKS 4
|
||
-
|
||
-/* If your system works ok with this module's parameter
|
||
- * nrpacks set to 1, you might as well comment
|
||
- * this define out, and thereby produce smaller, faster code.
|
||
- * You'd also set USX2Y_NRPACKS to 1 then.
|
||
- */
|
||
-#define USX2Y_NRPACKS_VARIABLE 1
|
||
-
|
||
-#ifdef USX2Y_NRPACKS_VARIABLE
|
||
-static int nrpacks = USX2Y_NRPACKS; /* number of packets per urb */
|
||
-#define nr_of_packs() nrpacks
|
||
-module_param(nrpacks, int, 0444);
|
||
-MODULE_PARM_DESC(nrpacks, "Number of packets per URB.");
|
||
-#else
|
||
-#define nr_of_packs() USX2Y_NRPACKS
|
||
-#endif
|
||
-
|
||
static int usx2y_urb_capt_retire(struct snd_usx2y_substream *subs)
|
||
{
|
||
struct urb *urb = subs->completed_urb;
|
||
diff --git a/usr/include/Makefile b/usr/include/Makefile
|
||
index 07796df0a295b9..c16fbabb362581 100644
|
||
--- a/usr/include/Makefile
|
||
+++ b/usr/include/Makefile
|
||
@@ -10,7 +10,7 @@ UAPI_CFLAGS := -std=c90 -Wall -Werror=implicit-function-declaration
|
||
|
||
# In theory, we do not care -m32 or -m64 for header compile tests.
|
||
# It is here just because CONFIG_CC_CAN_LINK is tested with -m32 or -m64.
|
||
-UAPI_CFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CFLAGS))
|
||
+UAPI_CFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
|
||
|
||
# USERCFLAGS might contain sysroot location for CC.
|
||
UAPI_CFLAGS += $(USERCFLAGS)
|