Merge branch 'spi-5.15' into spi-5.16
This commit is contained in:
commit
5fe7bd5a37
|
@ -175,9 +175,10 @@ for IRQ numbers that are passed to struct device registrations. In that
|
|||
case the Linux IRQ numbers cannot be dynamically assigned and the legacy
|
||||
mapping should be used.
|
||||
|
||||
As the name implies, the *_legacy() functions are deprecated and only
|
||||
As the name implies, the \*_legacy() functions are deprecated and only
|
||||
exist to ease the support of ancient platforms. No new users should be
|
||||
added.
|
||||
added. Same goes for the \*_simple() functions when their use results
|
||||
in the legacy behaviour.
|
||||
|
||||
The legacy map assumes a contiguous range of IRQ numbers has already
|
||||
been allocated for the controller and that the IRQ number can be
|
||||
|
|
|
@ -171,7 +171,7 @@ examples:
|
|||
cs-gpios = <&gpio0 13 0>,
|
||||
<&gpio0 14 0>;
|
||||
rx-sample-delay-ns = <3>;
|
||||
spi-flash@1 {
|
||||
flash@1 {
|
||||
compatible = "spi-nand";
|
||||
reg = <1>;
|
||||
rx-sample-delay-ns = <7>;
|
||||
|
|
|
@ -851,7 +851,7 @@ NOTES:
|
|||
- 0x88A8 traffic will not be received unless VLAN stripping is disabled with
|
||||
the following command::
|
||||
|
||||
# ethool -K <ethX> rxvlan off
|
||||
# ethtool -K <ethX> rxvlan off
|
||||
|
||||
- 0x88A8/0x8100 double VLANs cannot be used with 0x8100 or 0x8100/0x8100 VLANS
|
||||
configured on the same port. 0x88a8/0x8100 traffic will not be received if
|
||||
|
|
35
MAINTAINERS
35
MAINTAINERS
|
@ -977,12 +977,12 @@ L: platform-driver-x86@vger.kernel.org
|
|||
S: Maintained
|
||||
F: drivers/platform/x86/amd-pmc.*
|
||||
|
||||
AMD POWERPLAY
|
||||
AMD POWERPLAY AND SWSMU
|
||||
M: Evan Quan <evan.quan@amd.com>
|
||||
L: amd-gfx@lists.freedesktop.org
|
||||
S: Supported
|
||||
T: git https://gitlab.freedesktop.org/agd5f/linux.git
|
||||
F: drivers/gpu/drm/amd/pm/powerplay/
|
||||
F: drivers/gpu/drm/amd/pm/
|
||||
|
||||
AMD PTDMA DRIVER
|
||||
M: Sanjay R Mehta <sanju.mehta@amd.com>
|
||||
|
@ -2804,9 +2804,8 @@ F: arch/arm/mach-pxa/include/mach/vpac270.h
|
|||
F: arch/arm/mach-pxa/vpac270.c
|
||||
|
||||
ARM/VT8500 ARM ARCHITECTURE
|
||||
M: Tony Prisk <linux@prisktech.co.nz>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
S: Orphan
|
||||
F: Documentation/devicetree/bindings/i2c/i2c-wmt.txt
|
||||
F: arch/arm/mach-vt8500/
|
||||
F: drivers/clocksource/timer-vt8500.c
|
||||
|
@ -13255,9 +13254,9 @@ F: Documentation/scsi/NinjaSCSI.rst
|
|||
F: drivers/scsi/nsp32*
|
||||
|
||||
NIOS2 ARCHITECTURE
|
||||
M: Ley Foon Tan <ley.foon.tan@intel.com>
|
||||
M: Dinh Nguyen <dinguyen@kernel.org>
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git
|
||||
F: arch/nios2/
|
||||
|
||||
NITRO ENCLAVES (NE)
|
||||
|
@ -16651,13 +16650,6 @@ M: Lubomir Rintel <lkundrak@v3.sk>
|
|||
S: Supported
|
||||
F: drivers/char/pcmcia/scr24x_cs.c
|
||||
|
||||
SCSI CDROM DRIVER
|
||||
M: Jens Axboe <axboe@kernel.dk>
|
||||
L: linux-scsi@vger.kernel.org
|
||||
S: Maintained
|
||||
W: http://www.kernel.dk
|
||||
F: drivers/scsi/sr*
|
||||
|
||||
SCSI RDMA PROTOCOL (SRP) INITIATOR
|
||||
M: Bart Van Assche <bvanassche@acm.org>
|
||||
L: linux-rdma@vger.kernel.org
|
||||
|
@ -16956,7 +16948,6 @@ F: drivers/misc/sgi-xp/
|
|||
|
||||
SHARED MEMORY COMMUNICATIONS (SMC) SOCKETS
|
||||
M: Karsten Graul <kgraul@linux.ibm.com>
|
||||
M: Guvenc Gulce <guvenc@linux.ibm.com>
|
||||
L: linux-s390@vger.kernel.org
|
||||
S: Supported
|
||||
W: http://www.ibm.com/developerworks/linux/linux390/
|
||||
|
@ -17969,10 +17960,11 @@ F: Documentation/admin-guide/svga.rst
|
|||
F: arch/x86/boot/video*
|
||||
|
||||
SWIOTLB SUBSYSTEM
|
||||
M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
M: Christoph Hellwig <hch@infradead.org>
|
||||
L: iommu@lists.linux-foundation.org
|
||||
S: Supported
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git
|
||||
W: http://git.infradead.org/users/hch/dma-mapping.git
|
||||
T: git git://git.infradead.org/users/hch/dma-mapping.git
|
||||
F: arch/*/kernel/pci-swiotlb.c
|
||||
F: include/linux/swiotlb.h
|
||||
F: kernel/dma/swiotlb.c
|
||||
|
@ -19289,13 +19281,12 @@ S: Maintained
|
|||
F: drivers/usb/misc/chaoskey.c
|
||||
|
||||
USB CYPRESS C67X00 DRIVER
|
||||
M: Peter Korsgaard <jacmet@sunsite.dk>
|
||||
L: linux-usb@vger.kernel.org
|
||||
S: Maintained
|
||||
S: Orphan
|
||||
F: drivers/usb/c67x00/
|
||||
|
||||
USB DAVICOM DM9601 DRIVER
|
||||
M: Peter Korsgaard <jacmet@sunsite.dk>
|
||||
M: Peter Korsgaard <peter@korsgaard.com>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
W: http://www.linux-usb.org/usbnet
|
||||
|
@ -20475,7 +20466,6 @@ F: samples/bpf/xdpsock*
|
|||
F: tools/lib/bpf/xsk*
|
||||
|
||||
XEN BLOCK SUBSYSTEM
|
||||
M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
M: Roger Pau Monné <roger.pau@citrix.com>
|
||||
L: xen-devel@lists.xenproject.org (moderated for non-subscribers)
|
||||
S: Supported
|
||||
|
@ -20523,7 +20513,7 @@ S: Supported
|
|||
F: drivers/net/xen-netback/*
|
||||
|
||||
XEN PCI SUBSYSTEM
|
||||
M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
M: Juergen Gross <jgross@suse.com>
|
||||
L: xen-devel@lists.xenproject.org (moderated for non-subscribers)
|
||||
S: Supported
|
||||
F: arch/x86/pci/*xen*
|
||||
|
@ -20546,7 +20536,8 @@ S: Supported
|
|||
F: sound/xen/*
|
||||
|
||||
XEN SWIOTLB SUBSYSTEM
|
||||
M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
M: Juergen Gross <jgross@suse.com>
|
||||
M: Stefano Stabellini <sstabellini@kernel.org>
|
||||
L: xen-devel@lists.xenproject.org (moderated for non-subscribers)
|
||||
L: iommu@lists.linux-foundation.org
|
||||
S: Supported
|
||||
|
|
2
Makefile
2
Makefile
|
@ -2,7 +2,7 @@
|
|||
VERSION = 5
|
||||
PATCHLEVEL = 15
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc2
|
||||
EXTRAVERSION = -rc3
|
||||
NAME = Opossums on Parade
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
|
|
@ -628,7 +628,6 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
|
|||
uprobe_notify_resume(regs);
|
||||
} else {
|
||||
tracehook_notify_resume(regs);
|
||||
rseq_handle_notify_resume(NULL, regs);
|
||||
}
|
||||
}
|
||||
local_irq_disable();
|
||||
|
|
|
@ -487,7 +487,6 @@
|
|||
interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
|
||||
phys = <&qusb_phy_0>, <&usb0_ssphy>;
|
||||
phy-names = "usb2-phy", "usb3-phy";
|
||||
tx-fifo-resize;
|
||||
snps,is-utmi-l1-suspend;
|
||||
snps,hird-threshold = /bits/ 8 <0x0>;
|
||||
snps,dis_u2_susphy_quirk;
|
||||
|
@ -528,7 +527,6 @@
|
|||
interrupts = <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>;
|
||||
phys = <&qusb_phy_1>, <&usb1_ssphy>;
|
||||
phy-names = "usb2-phy", "usb3-phy";
|
||||
tx-fifo-resize;
|
||||
snps,is-utmi-l1-suspend;
|
||||
snps,hird-threshold = /bits/ 8 <0x0>;
|
||||
snps,dis_u2_susphy_quirk;
|
||||
|
|
|
@ -50,9 +50,6 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr);
|
|||
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
|
||||
#define acpi_os_ioremap acpi_os_ioremap
|
||||
|
||||
void __iomem *acpi_os_memmap(acpi_physical_address phys, acpi_size size);
|
||||
#define acpi_os_memmap acpi_os_memmap
|
||||
|
||||
typedef u64 phys_cpuid_t;
|
||||
#define PHYS_CPUID_INVALID INVALID_HWID
|
||||
|
||||
|
|
|
@ -525,6 +525,11 @@ alternative_endif
|
|||
#define EXPORT_SYMBOL_NOKASAN(name) EXPORT_SYMBOL(name)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_KASAN_HW_TAGS
|
||||
#define EXPORT_SYMBOL_NOHWKASAN(name)
|
||||
#else
|
||||
#define EXPORT_SYMBOL_NOHWKASAN(name) EXPORT_SYMBOL_NOKASAN(name)
|
||||
#endif
|
||||
/*
|
||||
* Emit a 64-bit absolute little endian symbol reference in a way that
|
||||
* ensures that it will be resolved at build time, even when building a
|
||||
|
|
|
@ -99,11 +99,17 @@ void mte_check_tfsr_el1(void);
|
|||
|
||||
static inline void mte_check_tfsr_entry(void)
|
||||
{
|
||||
if (!system_supports_mte())
|
||||
return;
|
||||
|
||||
mte_check_tfsr_el1();
|
||||
}
|
||||
|
||||
static inline void mte_check_tfsr_exit(void)
|
||||
{
|
||||
if (!system_supports_mte())
|
||||
return;
|
||||
|
||||
/*
|
||||
* The asynchronous faults are sync'ed automatically with
|
||||
* TFSR_EL1 on kernel entry but for exit an explicit dsb()
|
||||
|
|
|
@ -12,11 +12,13 @@ extern char *strrchr(const char *, int c);
|
|||
#define __HAVE_ARCH_STRCHR
|
||||
extern char *strchr(const char *, int c);
|
||||
|
||||
#ifndef CONFIG_KASAN_HW_TAGS
|
||||
#define __HAVE_ARCH_STRCMP
|
||||
extern int strcmp(const char *, const char *);
|
||||
|
||||
#define __HAVE_ARCH_STRNCMP
|
||||
extern int strncmp(const char *, const char *, __kernel_size_t);
|
||||
#endif
|
||||
|
||||
#define __HAVE_ARCH_STRLEN
|
||||
extern __kernel_size_t strlen(const char *);
|
||||
|
|
|
@ -273,8 +273,7 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr)
|
|||
return __pgprot(PROT_DEVICE_nGnRnE);
|
||||
}
|
||||
|
||||
static void __iomem *__acpi_os_ioremap(acpi_physical_address phys,
|
||||
acpi_size size, bool memory)
|
||||
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
|
||||
{
|
||||
efi_memory_desc_t *md, *region = NULL;
|
||||
pgprot_t prot;
|
||||
|
@ -300,11 +299,9 @@ static void __iomem *__acpi_os_ioremap(acpi_physical_address phys,
|
|||
* It is fine for AML to remap regions that are not represented in the
|
||||
* EFI memory map at all, as it only describes normal memory, and MMIO
|
||||
* regions that require a virtual mapping to make them accessible to
|
||||
* the EFI runtime services. Determine the region default
|
||||
* attributes by checking the requested memory semantics.
|
||||
* the EFI runtime services.
|
||||
*/
|
||||
prot = memory ? __pgprot(PROT_NORMAL_NC) :
|
||||
__pgprot(PROT_DEVICE_nGnRnE);
|
||||
prot = __pgprot(PROT_DEVICE_nGnRnE);
|
||||
if (region) {
|
||||
switch (region->type) {
|
||||
case EFI_LOADER_CODE:
|
||||
|
@ -364,16 +361,6 @@ static void __iomem *__acpi_os_ioremap(acpi_physical_address phys,
|
|||
return __ioremap(phys, size, prot);
|
||||
}
|
||||
|
||||
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
|
||||
{
|
||||
return __acpi_os_ioremap(phys, size, false);
|
||||
}
|
||||
|
||||
void __iomem *acpi_os_memmap(acpi_physical_address phys, acpi_size size)
|
||||
{
|
||||
return __acpi_os_ioremap(phys, size, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Claim Synchronous External Aborts as a firmware first notification.
|
||||
*
|
||||
|
|
|
@ -1526,9 +1526,13 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry,
|
|||
/*
|
||||
* For reasons that aren't entirely clear, enabling KPTI on Cavium
|
||||
* ThunderX leads to apparent I-cache corruption of kernel text, which
|
||||
* ends as well as you might imagine. Don't even try.
|
||||
* ends as well as you might imagine. Don't even try. We cannot rely
|
||||
* on the cpus_have_*cap() helpers here to detect the CPU erratum
|
||||
* because cpucap detection order may change. However, since we know
|
||||
* affected CPUs are always in a homogeneous configuration, it is
|
||||
* safe to rely on this_cpu_has_cap() here.
|
||||
*/
|
||||
if (cpus_have_const_cap(ARM64_WORKAROUND_CAVIUM_27456)) {
|
||||
if (this_cpu_has_cap(ARM64_WORKAROUND_CAVIUM_27456)) {
|
||||
str = "ARM64_WORKAROUND_CAVIUM_27456";
|
||||
__kpti_forced = -1;
|
||||
}
|
||||
|
|
|
@ -142,12 +142,7 @@ void mte_enable_kernel_async(void)
|
|||
#ifdef CONFIG_KASAN_HW_TAGS
|
||||
void mte_check_tfsr_el1(void)
|
||||
{
|
||||
u64 tfsr_el1;
|
||||
|
||||
if (!system_supports_mte())
|
||||
return;
|
||||
|
||||
tfsr_el1 = read_sysreg_s(SYS_TFSR_EL1);
|
||||
u64 tfsr_el1 = read_sysreg_s(SYS_TFSR_EL1);
|
||||
|
||||
if (unlikely(tfsr_el1 & SYS_TFSR_EL1_TF1)) {
|
||||
/*
|
||||
|
@ -199,6 +194,9 @@ void mte_thread_init_user(void)
|
|||
|
||||
void mte_thread_switch(struct task_struct *next)
|
||||
{
|
||||
if (!system_supports_mte())
|
||||
return;
|
||||
|
||||
mte_update_sctlr_user(next);
|
||||
|
||||
/*
|
||||
|
|
|
@ -940,10 +940,8 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_flags)
|
|||
if (thread_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
|
||||
do_signal(regs);
|
||||
|
||||
if (thread_flags & _TIF_NOTIFY_RESUME) {
|
||||
if (thread_flags & _TIF_NOTIFY_RESUME)
|
||||
tracehook_notify_resume(regs);
|
||||
rseq_handle_notify_resume(NULL, regs);
|
||||
}
|
||||
|
||||
if (thread_flags & _TIF_FOREIGN_FPSTATE)
|
||||
fpsimd_restore_current_state();
|
||||
|
|
|
@ -173,4 +173,4 @@ L(done):
|
|||
ret
|
||||
|
||||
SYM_FUNC_END_PI(strcmp)
|
||||
EXPORT_SYMBOL_NOKASAN(strcmp)
|
||||
EXPORT_SYMBOL_NOHWKASAN(strcmp)
|
||||
|
|
|
@ -258,4 +258,4 @@ L(ret0):
|
|||
ret
|
||||
|
||||
SYM_FUNC_END_PI(strncmp)
|
||||
EXPORT_SYMBOL_NOKASAN(strncmp)
|
||||
EXPORT_SYMBOL_NOHWKASAN(strncmp)
|
||||
|
|
|
@ -260,8 +260,6 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
|
|||
if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
|
||||
do_signal(regs);
|
||||
|
||||
if (thread_info_flags & _TIF_NOTIFY_RESUME) {
|
||||
if (thread_info_flags & _TIF_NOTIFY_RESUME)
|
||||
tracehook_notify_resume(regs);
|
||||
rseq_handle_notify_resume(NULL, regs);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -906,10 +906,8 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused,
|
|||
if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
|
||||
do_signal(regs);
|
||||
|
||||
if (thread_info_flags & _TIF_NOTIFY_RESUME) {
|
||||
if (thread_info_flags & _TIF_NOTIFY_RESUME)
|
||||
tracehook_notify_resume(regs);
|
||||
rseq_handle_notify_resume(NULL, regs);
|
||||
}
|
||||
|
||||
user_enter();
|
||||
}
|
||||
|
|
|
@ -293,10 +293,8 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
|
|||
do_signal(current);
|
||||
}
|
||||
|
||||
if (thread_info_flags & _TIF_NOTIFY_RESUME) {
|
||||
if (thread_info_flags & _TIF_NOTIFY_RESUME)
|
||||
tracehook_notify_resume(regs);
|
||||
rseq_handle_notify_resume(NULL, regs);
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned long get_tm_stackpointer(struct task_struct *tsk)
|
||||
|
|
|
@ -55,7 +55,7 @@ int ccwgroup_create_dev(struct device *root, struct ccwgroup_driver *gdrv,
|
|||
int num_devices, const char *buf);
|
||||
|
||||
extern int ccwgroup_set_online(struct ccwgroup_device *gdev);
|
||||
extern int ccwgroup_set_offline(struct ccwgroup_device *gdev);
|
||||
int ccwgroup_set_offline(struct ccwgroup_device *gdev, bool call_gdrv);
|
||||
|
||||
extern int ccwgroup_probe_ccwdev(struct ccw_device *cdev);
|
||||
extern void ccwgroup_remove_ccwdev(struct ccw_device *cdev);
|
||||
|
|
|
@ -248,8 +248,7 @@ static inline void reg_set_seen(struct bpf_jit *jit, u32 b1)
|
|||
|
||||
#define EMIT6_PCREL(op1, op2, b1, b2, i, off, mask) \
|
||||
({ \
|
||||
/* Branch instruction needs 6 bytes */ \
|
||||
int rel = (addrs[(i) + (off) + 1] - (addrs[(i) + 1] - 6)) / 2;\
|
||||
int rel = (addrs[(i) + (off) + 1] - jit->prg) / 2; \
|
||||
_EMIT6((op1) | reg(b1, b2) << 16 | (rel & 0xffff), (op2) | (mask));\
|
||||
REG_SET_SEEN(b1); \
|
||||
REG_SET_SEEN(b2); \
|
||||
|
@ -761,10 +760,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
|
|||
EMIT4(0xb9080000, dst_reg, src_reg);
|
||||
break;
|
||||
case BPF_ALU | BPF_ADD | BPF_K: /* dst = (u32) dst + (u32) imm */
|
||||
if (!imm)
|
||||
break;
|
||||
/* alfi %dst,imm */
|
||||
EMIT6_IMM(0xc20b0000, dst_reg, imm);
|
||||
if (imm != 0) {
|
||||
/* alfi %dst,imm */
|
||||
EMIT6_IMM(0xc20b0000, dst_reg, imm);
|
||||
}
|
||||
EMIT_ZERO(dst_reg);
|
||||
break;
|
||||
case BPF_ALU64 | BPF_ADD | BPF_K: /* dst = dst + imm */
|
||||
|
@ -786,17 +785,22 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
|
|||
EMIT4(0xb9090000, dst_reg, src_reg);
|
||||
break;
|
||||
case BPF_ALU | BPF_SUB | BPF_K: /* dst = (u32) dst - (u32) imm */
|
||||
if (!imm)
|
||||
break;
|
||||
/* alfi %dst,-imm */
|
||||
EMIT6_IMM(0xc20b0000, dst_reg, -imm);
|
||||
if (imm != 0) {
|
||||
/* alfi %dst,-imm */
|
||||
EMIT6_IMM(0xc20b0000, dst_reg, -imm);
|
||||
}
|
||||
EMIT_ZERO(dst_reg);
|
||||
break;
|
||||
case BPF_ALU64 | BPF_SUB | BPF_K: /* dst = dst - imm */
|
||||
if (!imm)
|
||||
break;
|
||||
/* agfi %dst,-imm */
|
||||
EMIT6_IMM(0xc2080000, dst_reg, -imm);
|
||||
if (imm == -0x80000000) {
|
||||
/* algfi %dst,0x80000000 */
|
||||
EMIT6_IMM(0xc20a0000, dst_reg, 0x80000000);
|
||||
} else {
|
||||
/* agfi %dst,-imm */
|
||||
EMIT6_IMM(0xc2080000, dst_reg, -imm);
|
||||
}
|
||||
break;
|
||||
/*
|
||||
* BPF_MUL
|
||||
|
@ -811,10 +815,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
|
|||
EMIT4(0xb90c0000, dst_reg, src_reg);
|
||||
break;
|
||||
case BPF_ALU | BPF_MUL | BPF_K: /* dst = (u32) dst * (u32) imm */
|
||||
if (imm == 1)
|
||||
break;
|
||||
/* msfi %r5,imm */
|
||||
EMIT6_IMM(0xc2010000, dst_reg, imm);
|
||||
if (imm != 1) {
|
||||
/* msfi %r5,imm */
|
||||
EMIT6_IMM(0xc2010000, dst_reg, imm);
|
||||
}
|
||||
EMIT_ZERO(dst_reg);
|
||||
break;
|
||||
case BPF_ALU64 | BPF_MUL | BPF_K: /* dst = dst * imm */
|
||||
|
@ -867,6 +871,8 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
|
|||
if (BPF_OP(insn->code) == BPF_MOD)
|
||||
/* lhgi %dst,0 */
|
||||
EMIT4_IMM(0xa7090000, dst_reg, 0);
|
||||
else
|
||||
EMIT_ZERO(dst_reg);
|
||||
break;
|
||||
}
|
||||
/* lhi %w0,0 */
|
||||
|
@ -999,10 +1005,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
|
|||
EMIT4(0xb9820000, dst_reg, src_reg);
|
||||
break;
|
||||
case BPF_ALU | BPF_XOR | BPF_K: /* dst = (u32) dst ^ (u32) imm */
|
||||
if (!imm)
|
||||
break;
|
||||
/* xilf %dst,imm */
|
||||
EMIT6_IMM(0xc0070000, dst_reg, imm);
|
||||
if (imm != 0) {
|
||||
/* xilf %dst,imm */
|
||||
EMIT6_IMM(0xc0070000, dst_reg, imm);
|
||||
}
|
||||
EMIT_ZERO(dst_reg);
|
||||
break;
|
||||
case BPF_ALU64 | BPF_XOR | BPF_K: /* dst = dst ^ imm */
|
||||
|
@ -1033,10 +1039,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
|
|||
EMIT6_DISP_LH(0xeb000000, 0x000d, dst_reg, dst_reg, src_reg, 0);
|
||||
break;
|
||||
case BPF_ALU | BPF_LSH | BPF_K: /* dst = (u32) dst << (u32) imm */
|
||||
if (imm == 0)
|
||||
break;
|
||||
/* sll %dst,imm(%r0) */
|
||||
EMIT4_DISP(0x89000000, dst_reg, REG_0, imm);
|
||||
if (imm != 0) {
|
||||
/* sll %dst,imm(%r0) */
|
||||
EMIT4_DISP(0x89000000, dst_reg, REG_0, imm);
|
||||
}
|
||||
EMIT_ZERO(dst_reg);
|
||||
break;
|
||||
case BPF_ALU64 | BPF_LSH | BPF_K: /* dst = dst << imm */
|
||||
|
@ -1058,10 +1064,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
|
|||
EMIT6_DISP_LH(0xeb000000, 0x000c, dst_reg, dst_reg, src_reg, 0);
|
||||
break;
|
||||
case BPF_ALU | BPF_RSH | BPF_K: /* dst = (u32) dst >> (u32) imm */
|
||||
if (imm == 0)
|
||||
break;
|
||||
/* srl %dst,imm(%r0) */
|
||||
EMIT4_DISP(0x88000000, dst_reg, REG_0, imm);
|
||||
if (imm != 0) {
|
||||
/* srl %dst,imm(%r0) */
|
||||
EMIT4_DISP(0x88000000, dst_reg, REG_0, imm);
|
||||
}
|
||||
EMIT_ZERO(dst_reg);
|
||||
break;
|
||||
case BPF_ALU64 | BPF_RSH | BPF_K: /* dst = dst >> imm */
|
||||
|
@ -1083,10 +1089,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
|
|||
EMIT6_DISP_LH(0xeb000000, 0x000a, dst_reg, dst_reg, src_reg, 0);
|
||||
break;
|
||||
case BPF_ALU | BPF_ARSH | BPF_K: /* ((s32) dst >> imm */
|
||||
if (imm == 0)
|
||||
break;
|
||||
/* sra %dst,imm(%r0) */
|
||||
EMIT4_DISP(0x8a000000, dst_reg, REG_0, imm);
|
||||
if (imm != 0) {
|
||||
/* sra %dst,imm(%r0) */
|
||||
EMIT4_DISP(0x8a000000, dst_reg, REG_0, imm);
|
||||
}
|
||||
EMIT_ZERO(dst_reg);
|
||||
break;
|
||||
case BPF_ALU64 | BPF_ARSH | BPF_K: /* ((s64) dst) >>= imm */
|
||||
|
|
|
@ -34,7 +34,7 @@ typedef struct { unsigned long long pmd; } pmd_t;
|
|||
|
||||
static inline pmd_t *pud_pgtable(pud_t pud)
|
||||
{
|
||||
return (pmd_t *)pud_val(pud);
|
||||
return (pmd_t *)(unsigned long)pud_val(pud);
|
||||
}
|
||||
|
||||
/* only used by the stubbed out hugetlb gup code, should never be called */
|
||||
|
|
|
@ -19,8 +19,10 @@ void ioport_unmap(void __iomem *addr)
|
|||
EXPORT_SYMBOL(ioport_map);
|
||||
EXPORT_SYMBOL(ioport_unmap);
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
|
||||
{
|
||||
/* nothing to do */
|
||||
}
|
||||
EXPORT_SYMBOL(pci_iounmap);
|
||||
#endif
|
||||
|
|
|
@ -2610,7 +2610,6 @@ config PCI_OLPC
|
|||
config PCI_XEN
|
||||
def_bool y
|
||||
depends on PCI && XEN
|
||||
select SWIOTLB_XEN
|
||||
|
||||
config MMCONF_FAM10H
|
||||
def_bool y
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
#ifndef _ASM_X86_PKEYS_H
|
||||
#define _ASM_X86_PKEYS_H
|
||||
|
||||
#define ARCH_DEFAULT_PKEY 0
|
||||
|
||||
/*
|
||||
* If more than 16 keys are ever supported, a thorough audit
|
||||
* will be necessary to ensure that the types that store key
|
||||
|
|
|
@ -275,7 +275,7 @@ static inline int enqcmds(void __iomem *dst, const void *src)
|
|||
{
|
||||
const struct { char _[64]; } *__src = src;
|
||||
struct { char _[64]; } __iomem *__dst = dst;
|
||||
int zf;
|
||||
bool zf;
|
||||
|
||||
/*
|
||||
* ENQCMDS %(rdx), rax
|
||||
|
|
|
@ -3,14 +3,10 @@
|
|||
#define _ASM_X86_SWIOTLB_XEN_H
|
||||
|
||||
#ifdef CONFIG_SWIOTLB_XEN
|
||||
extern int xen_swiotlb;
|
||||
extern int __init pci_xen_swiotlb_detect(void);
|
||||
extern void __init pci_xen_swiotlb_init(void);
|
||||
extern int pci_xen_swiotlb_init_late(void);
|
||||
#else
|
||||
#define xen_swiotlb (0)
|
||||
static inline int __init pci_xen_swiotlb_detect(void) { return 0; }
|
||||
static inline void __init pci_xen_swiotlb_init(void) { }
|
||||
#define pci_xen_swiotlb_detect NULL
|
||||
static inline int pci_xen_swiotlb_init_late(void) { return -ENXIO; }
|
||||
#endif
|
||||
|
||||
|
|
|
@ -830,6 +830,20 @@ void __init setup_arch(char **cmdline_p)
|
|||
|
||||
x86_init.oem.arch_setup();
|
||||
|
||||
/*
|
||||
* Do some memory reservations *before* memory is added to memblock, so
|
||||
* memblock allocations won't overwrite it.
|
||||
*
|
||||
* After this point, everything still needed from the boot loader or
|
||||
* firmware or kernel text should be early reserved or marked not RAM in
|
||||
* e820. All other memory is free game.
|
||||
*
|
||||
* This call needs to happen before e820__memory_setup() which calls the
|
||||
* xen_memory_setup() on Xen dom0 which relies on the fact that those
|
||||
* early reservations have happened already.
|
||||
*/
|
||||
early_reserve_memory();
|
||||
|
||||
iomem_resource.end = (1ULL << boot_cpu_data.x86_phys_bits) - 1;
|
||||
e820__memory_setup();
|
||||
parse_setup_data();
|
||||
|
@ -876,18 +890,6 @@ void __init setup_arch(char **cmdline_p)
|
|||
|
||||
parse_early_param();
|
||||
|
||||
/*
|
||||
* Do some memory reservations *before* memory is added to
|
||||
* memblock, so memblock allocations won't overwrite it.
|
||||
* Do it after early param, so we could get (unlikely) panic from
|
||||
* serial.
|
||||
*
|
||||
* After this point everything still needed from the boot loader or
|
||||
* firmware or kernel text should be early reserved or marked not
|
||||
* RAM in e820. All other memory is free game.
|
||||
*/
|
||||
early_reserve_memory();
|
||||
|
||||
#ifdef CONFIG_MEMORY_HOTPLUG
|
||||
/*
|
||||
* Memory used by the kernel cannot be hot-removed because Linux
|
||||
|
|
|
@ -37,10 +37,10 @@
|
|||
((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
|
||||
|
||||
#define __get_next(t, insn) \
|
||||
({ t r = *(t*)insn->next_byte; insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
|
||||
({ t r; memcpy(&r, insn->next_byte, sizeof(t)); insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
|
||||
|
||||
#define __peek_nbyte_next(t, insn, n) \
|
||||
({ t r = *(t*)((insn)->next_byte + n); leXX_to_cpu(t, r); })
|
||||
({ t r; memcpy(&r, (insn)->next_byte + n, sizeof(t)); leXX_to_cpu(t, r); })
|
||||
|
||||
#define get_next(t, insn) \
|
||||
({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })
|
||||
|
|
|
@ -710,7 +710,8 @@ oops:
|
|||
|
||||
static noinline void
|
||||
kernelmode_fixup_or_oops(struct pt_regs *regs, unsigned long error_code,
|
||||
unsigned long address, int signal, int si_code)
|
||||
unsigned long address, int signal, int si_code,
|
||||
u32 pkey)
|
||||
{
|
||||
WARN_ON_ONCE(user_mode(regs));
|
||||
|
||||
|
@ -735,8 +736,12 @@ kernelmode_fixup_or_oops(struct pt_regs *regs, unsigned long error_code,
|
|||
|
||||
set_signal_archinfo(address, error_code);
|
||||
|
||||
/* XXX: hwpoison faults will set the wrong code. */
|
||||
force_sig_fault(signal, si_code, (void __user *)address);
|
||||
if (si_code == SEGV_PKUERR) {
|
||||
force_sig_pkuerr((void __user *)address, pkey);
|
||||
} else {
|
||||
/* XXX: hwpoison faults will set the wrong code. */
|
||||
force_sig_fault(signal, si_code, (void __user *)address);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -798,7 +803,8 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
|
|||
struct task_struct *tsk = current;
|
||||
|
||||
if (!user_mode(regs)) {
|
||||
kernelmode_fixup_or_oops(regs, error_code, address, pkey, si_code);
|
||||
kernelmode_fixup_or_oops(regs, error_code, address,
|
||||
SIGSEGV, si_code, pkey);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -930,7 +936,8 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
|
|||
{
|
||||
/* Kernel mode? Handle exceptions or die: */
|
||||
if (!user_mode(regs)) {
|
||||
kernelmode_fixup_or_oops(regs, error_code, address, SIGBUS, BUS_ADRERR);
|
||||
kernelmode_fixup_or_oops(regs, error_code, address,
|
||||
SIGBUS, BUS_ADRERR, ARCH_DEFAULT_PKEY);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1396,7 +1403,8 @@ good_area:
|
|||
*/
|
||||
if (!user_mode(regs))
|
||||
kernelmode_fixup_or_oops(regs, error_code, address,
|
||||
SIGBUS, BUS_ADRERR);
|
||||
SIGBUS, BUS_ADRERR,
|
||||
ARCH_DEFAULT_PKEY);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1416,7 +1424,8 @@ good_area:
|
|||
return;
|
||||
|
||||
if (fatal_signal_pending(current) && !user_mode(regs)) {
|
||||
kernelmode_fixup_or_oops(regs, error_code, address, 0, 0);
|
||||
kernelmode_fixup_or_oops(regs, error_code, address,
|
||||
0, 0, ARCH_DEFAULT_PKEY);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1424,7 +1433,8 @@ good_area:
|
|||
/* Kernel mode? Handle exceptions or die: */
|
||||
if (!user_mode(regs)) {
|
||||
kernelmode_fixup_or_oops(regs, error_code, address,
|
||||
SIGSEGV, SEGV_MAPERR);
|
||||
SIGSEGV, SEGV_MAPERR,
|
||||
ARCH_DEFAULT_PKEY);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -755,8 +755,8 @@ static void xen_write_idt_entry(gate_desc *dt, int entrynum, const gate_desc *g)
|
|||
preempt_enable();
|
||||
}
|
||||
|
||||
static void xen_convert_trap_info(const struct desc_ptr *desc,
|
||||
struct trap_info *traps)
|
||||
static unsigned xen_convert_trap_info(const struct desc_ptr *desc,
|
||||
struct trap_info *traps, bool full)
|
||||
{
|
||||
unsigned in, out, count;
|
||||
|
||||
|
@ -766,17 +766,18 @@ static void xen_convert_trap_info(const struct desc_ptr *desc,
|
|||
for (in = out = 0; in < count; in++) {
|
||||
gate_desc *entry = (gate_desc *)(desc->address) + in;
|
||||
|
||||
if (cvt_gate_to_trap(in, entry, &traps[out]))
|
||||
if (cvt_gate_to_trap(in, entry, &traps[out]) || full)
|
||||
out++;
|
||||
}
|
||||
traps[out].address = 0;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
void xen_copy_trap_info(struct trap_info *traps)
|
||||
{
|
||||
const struct desc_ptr *desc = this_cpu_ptr(&idt_desc);
|
||||
|
||||
xen_convert_trap_info(desc, traps);
|
||||
xen_convert_trap_info(desc, traps, true);
|
||||
}
|
||||
|
||||
/* Load a new IDT into Xen. In principle this can be per-CPU, so we
|
||||
|
@ -786,6 +787,7 @@ static void xen_load_idt(const struct desc_ptr *desc)
|
|||
{
|
||||
static DEFINE_SPINLOCK(lock);
|
||||
static struct trap_info traps[257];
|
||||
unsigned out;
|
||||
|
||||
trace_xen_cpu_load_idt(desc);
|
||||
|
||||
|
@ -793,7 +795,8 @@ static void xen_load_idt(const struct desc_ptr *desc)
|
|||
|
||||
memcpy(this_cpu_ptr(&idt_desc), desc, sizeof(idt_desc));
|
||||
|
||||
xen_convert_trap_info(desc, traps);
|
||||
out = xen_convert_trap_info(desc, traps, false);
|
||||
memset(&traps[out], 0, sizeof(traps[0]));
|
||||
|
||||
xen_mc_flush();
|
||||
if (HYPERVISOR_set_trap_table(traps))
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#endif
|
||||
#include <linux/export.h>
|
||||
|
||||
int xen_swiotlb __read_mostly;
|
||||
static int xen_swiotlb __read_mostly;
|
||||
|
||||
/*
|
||||
* pci_xen_swiotlb_detect - set xen_swiotlb to 1 if necessary
|
||||
|
@ -56,7 +56,7 @@ int __init pci_xen_swiotlb_detect(void)
|
|||
return xen_swiotlb;
|
||||
}
|
||||
|
||||
void __init pci_xen_swiotlb_init(void)
|
||||
static void __init pci_xen_swiotlb_init(void)
|
||||
{
|
||||
if (xen_swiotlb) {
|
||||
xen_swiotlb_init_early();
|
||||
|
|
|
@ -290,8 +290,6 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
|
|||
|
||||
gdt = get_cpu_gdt_rw(cpu);
|
||||
|
||||
memset(&ctxt->fpu_ctxt, 0, sizeof(ctxt->fpu_ctxt));
|
||||
|
||||
/*
|
||||
* Bring up the CPU in cpu_bringup_and_idle() with the stack
|
||||
* pointing just below where pt_regs would be if it were a normal
|
||||
|
@ -308,8 +306,6 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
|
|||
|
||||
xen_copy_trap_info(ctxt->trap_ctxt);
|
||||
|
||||
ctxt->ldt_ents = 0;
|
||||
|
||||
BUG_ON((unsigned long)gdt & ~PAGE_MASK);
|
||||
|
||||
gdt_mfn = arbitrary_virt_to_mfn(gdt);
|
||||
|
|
|
@ -1466,7 +1466,7 @@ again:
|
|||
if (!bio_integrity_endio(bio))
|
||||
return;
|
||||
|
||||
if (bio->bi_bdev)
|
||||
if (bio->bi_bdev && bio_flagged(bio, BIO_TRACKED))
|
||||
rq_qos_done_bio(bio->bi_bdev->bd_disk->queue, bio);
|
||||
|
||||
if (bio->bi_bdev && bio_flagged(bio, BIO_TRACE_COMPLETION)) {
|
||||
|
|
23
block/bsg.c
23
block/bsg.c
|
@ -165,13 +165,20 @@ static const struct file_operations bsg_fops = {
|
|||
.llseek = default_llseek,
|
||||
};
|
||||
|
||||
static void bsg_device_release(struct device *dev)
|
||||
{
|
||||
struct bsg_device *bd = container_of(dev, struct bsg_device, device);
|
||||
|
||||
ida_simple_remove(&bsg_minor_ida, MINOR(bd->device.devt));
|
||||
kfree(bd);
|
||||
}
|
||||
|
||||
void bsg_unregister_queue(struct bsg_device *bd)
|
||||
{
|
||||
if (bd->queue->kobj.sd)
|
||||
sysfs_remove_link(&bd->queue->kobj, "bsg");
|
||||
cdev_device_del(&bd->cdev, &bd->device);
|
||||
ida_simple_remove(&bsg_minor_ida, MINOR(bd->device.devt));
|
||||
kfree(bd);
|
||||
put_device(&bd->device);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(bsg_unregister_queue);
|
||||
|
||||
|
@ -193,11 +200,13 @@ struct bsg_device *bsg_register_queue(struct request_queue *q,
|
|||
if (ret < 0) {
|
||||
if (ret == -ENOSPC)
|
||||
dev_err(parent, "bsg: too many bsg devices\n");
|
||||
goto out_kfree;
|
||||
kfree(bd);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
bd->device.devt = MKDEV(bsg_major, ret);
|
||||
bd->device.class = bsg_class;
|
||||
bd->device.parent = parent;
|
||||
bd->device.release = bsg_device_release;
|
||||
dev_set_name(&bd->device, "%s", name);
|
||||
device_initialize(&bd->device);
|
||||
|
||||
|
@ -205,7 +214,7 @@ struct bsg_device *bsg_register_queue(struct request_queue *q,
|
|||
bd->cdev.owner = THIS_MODULE;
|
||||
ret = cdev_device_add(&bd->cdev, &bd->device);
|
||||
if (ret)
|
||||
goto out_ida_remove;
|
||||
goto out_put_device;
|
||||
|
||||
if (q->kobj.sd) {
|
||||
ret = sysfs_create_link(&q->kobj, &bd->device.kobj, "bsg");
|
||||
|
@ -217,10 +226,8 @@ struct bsg_device *bsg_register_queue(struct request_queue *q,
|
|||
|
||||
out_device_del:
|
||||
cdev_device_del(&bd->cdev, &bd->device);
|
||||
out_ida_remove:
|
||||
ida_simple_remove(&bsg_minor_ida, MINOR(bd->device.devt));
|
||||
out_kfree:
|
||||
kfree(bd);
|
||||
out_put_device:
|
||||
put_device(&bd->device);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(bsg_register_queue);
|
||||
|
|
21
block/fops.c
21
block/fops.c
|
@ -14,6 +14,7 @@
|
|||
#include <linux/task_io_accounting_ops.h>
|
||||
#include <linux/falloc.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/fs.h>
|
||||
#include "blk.h"
|
||||
|
||||
static struct inode *bdev_file_inode(struct file *file)
|
||||
|
@ -553,7 +554,8 @@ static ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to)
|
|||
static long blkdev_fallocate(struct file *file, int mode, loff_t start,
|
||||
loff_t len)
|
||||
{
|
||||
struct block_device *bdev = I_BDEV(bdev_file_inode(file));
|
||||
struct inode *inode = bdev_file_inode(file);
|
||||
struct block_device *bdev = I_BDEV(inode);
|
||||
loff_t end = start + len - 1;
|
||||
loff_t isize;
|
||||
int error;
|
||||
|
@ -580,10 +582,12 @@ static long blkdev_fallocate(struct file *file, int mode, loff_t start,
|
|||
if ((start | len) & (bdev_logical_block_size(bdev) - 1))
|
||||
return -EINVAL;
|
||||
|
||||
filemap_invalidate_lock(inode->i_mapping);
|
||||
|
||||
/* Invalidate the page cache, including dirty pages. */
|
||||
error = truncate_bdev_range(bdev, file->f_mode, start, end);
|
||||
if (error)
|
||||
return error;
|
||||
goto fail;
|
||||
|
||||
switch (mode) {
|
||||
case FALLOC_FL_ZERO_RANGE:
|
||||
|
@ -600,17 +604,12 @@ static long blkdev_fallocate(struct file *file, int mode, loff_t start,
|
|||
GFP_KERNEL, 0);
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
error = -EOPNOTSUPP;
|
||||
}
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
/*
|
||||
* Invalidate the page cache again; if someone wandered in and dirtied
|
||||
* a page, we just discard it - userspace has no way of knowing whether
|
||||
* the write happened before or after discard completing...
|
||||
*/
|
||||
return truncate_bdev_range(bdev, file->f_mode, start, end);
|
||||
fail:
|
||||
filemap_invalidate_unlock(inode->i_mapping);
|
||||
return error;
|
||||
}
|
||||
|
||||
const struct file_operations def_blk_fops = {
|
||||
|
|
|
@ -284,8 +284,7 @@ acpi_map_lookup_virt(void __iomem *virt, acpi_size size)
|
|||
#define should_use_kmap(pfn) page_is_ram(pfn)
|
||||
#endif
|
||||
|
||||
static void __iomem *acpi_map(acpi_physical_address pg_off, unsigned long pg_sz,
|
||||
bool memory)
|
||||
static void __iomem *acpi_map(acpi_physical_address pg_off, unsigned long pg_sz)
|
||||
{
|
||||
unsigned long pfn;
|
||||
|
||||
|
@ -295,8 +294,7 @@ static void __iomem *acpi_map(acpi_physical_address pg_off, unsigned long pg_sz,
|
|||
return NULL;
|
||||
return (void __iomem __force *)kmap(pfn_to_page(pfn));
|
||||
} else
|
||||
return memory ? acpi_os_memmap(pg_off, pg_sz) :
|
||||
acpi_os_ioremap(pg_off, pg_sz);
|
||||
return acpi_os_ioremap(pg_off, pg_sz);
|
||||
}
|
||||
|
||||
static void acpi_unmap(acpi_physical_address pg_off, void __iomem *vaddr)
|
||||
|
@ -311,10 +309,9 @@ static void acpi_unmap(acpi_physical_address pg_off, void __iomem *vaddr)
|
|||
}
|
||||
|
||||
/**
|
||||
* __acpi_os_map_iomem - Get a virtual address for a given physical address range.
|
||||
* acpi_os_map_iomem - Get a virtual address for a given physical address range.
|
||||
* @phys: Start of the physical address range to map.
|
||||
* @size: Size of the physical address range to map.
|
||||
* @memory: true if remapping memory, false if IO
|
||||
*
|
||||
* Look up the given physical address range in the list of existing ACPI memory
|
||||
* mappings. If found, get a reference to it and return a pointer to it (its
|
||||
|
@ -324,8 +321,8 @@ static void acpi_unmap(acpi_physical_address pg_off, void __iomem *vaddr)
|
|||
* During early init (when acpi_permanent_mmap has not been set yet) this
|
||||
* routine simply calls __acpi_map_table() to get the job done.
|
||||
*/
|
||||
static void __iomem __ref
|
||||
*__acpi_os_map_iomem(acpi_physical_address phys, acpi_size size, bool memory)
|
||||
void __iomem __ref
|
||||
*acpi_os_map_iomem(acpi_physical_address phys, acpi_size size)
|
||||
{
|
||||
struct acpi_ioremap *map;
|
||||
void __iomem *virt;
|
||||
|
@ -356,7 +353,7 @@ static void __iomem __ref
|
|||
|
||||
pg_off = round_down(phys, PAGE_SIZE);
|
||||
pg_sz = round_up(phys + size, PAGE_SIZE) - pg_off;
|
||||
virt = acpi_map(phys, size, memory);
|
||||
virt = acpi_map(phys, size);
|
||||
if (!virt) {
|
||||
mutex_unlock(&acpi_ioremap_lock);
|
||||
kfree(map);
|
||||
|
@ -375,17 +372,11 @@ out:
|
|||
mutex_unlock(&acpi_ioremap_lock);
|
||||
return map->virt + (phys - map->phys);
|
||||
}
|
||||
|
||||
void __iomem *__ref
|
||||
acpi_os_map_iomem(acpi_physical_address phys, acpi_size size)
|
||||
{
|
||||
return __acpi_os_map_iomem(phys, size, false);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_os_map_iomem);
|
||||
|
||||
void *__ref acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
|
||||
{
|
||||
return (void *)__acpi_os_map_iomem(phys, size, true);
|
||||
return (void *)acpi_os_map_iomem(phys, size);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_os_map_memory);
|
||||
|
||||
|
|
|
@ -1852,6 +1852,7 @@ static void binder_deferred_fd_close(int fd)
|
|||
}
|
||||
|
||||
static void binder_transaction_buffer_release(struct binder_proc *proc,
|
||||
struct binder_thread *thread,
|
||||
struct binder_buffer *buffer,
|
||||
binder_size_t failed_at,
|
||||
bool is_failure)
|
||||
|
@ -2011,8 +2012,16 @@ static void binder_transaction_buffer_release(struct binder_proc *proc,
|
|||
&proc->alloc, &fd, buffer,
|
||||
offset, sizeof(fd));
|
||||
WARN_ON(err);
|
||||
if (!err)
|
||||
if (!err) {
|
||||
binder_deferred_fd_close(fd);
|
||||
/*
|
||||
* Need to make sure the thread goes
|
||||
* back to userspace to complete the
|
||||
* deferred close
|
||||
*/
|
||||
if (thread)
|
||||
thread->looper_need_return = true;
|
||||
}
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
|
@ -3038,9 +3047,8 @@ static void binder_transaction(struct binder_proc *proc,
|
|||
if (reply) {
|
||||
binder_enqueue_thread_work(thread, tcomplete);
|
||||
binder_inner_proc_lock(target_proc);
|
||||
if (target_thread->is_dead || target_proc->is_frozen) {
|
||||
return_error = target_thread->is_dead ?
|
||||
BR_DEAD_REPLY : BR_FROZEN_REPLY;
|
||||
if (target_thread->is_dead) {
|
||||
return_error = BR_DEAD_REPLY;
|
||||
binder_inner_proc_unlock(target_proc);
|
||||
goto err_dead_proc_or_thread;
|
||||
}
|
||||
|
@ -3105,7 +3113,7 @@ err_bad_parent:
|
|||
err_copy_data_failed:
|
||||
binder_free_txn_fixups(t);
|
||||
trace_binder_transaction_failed_buffer_release(t->buffer);
|
||||
binder_transaction_buffer_release(target_proc, t->buffer,
|
||||
binder_transaction_buffer_release(target_proc, NULL, t->buffer,
|
||||
buffer_offset, true);
|
||||
if (target_node)
|
||||
binder_dec_node_tmpref(target_node);
|
||||
|
@ -3184,7 +3192,9 @@ err_invalid_target_handle:
|
|||
* Cleanup buffer and free it.
|
||||
*/
|
||||
static void
|
||||
binder_free_buf(struct binder_proc *proc, struct binder_buffer *buffer)
|
||||
binder_free_buf(struct binder_proc *proc,
|
||||
struct binder_thread *thread,
|
||||
struct binder_buffer *buffer)
|
||||
{
|
||||
binder_inner_proc_lock(proc);
|
||||
if (buffer->transaction) {
|
||||
|
@ -3212,7 +3222,7 @@ binder_free_buf(struct binder_proc *proc, struct binder_buffer *buffer)
|
|||
binder_node_inner_unlock(buf_node);
|
||||
}
|
||||
trace_binder_transaction_buffer_release(buffer);
|
||||
binder_transaction_buffer_release(proc, buffer, 0, false);
|
||||
binder_transaction_buffer_release(proc, thread, buffer, 0, false);
|
||||
binder_alloc_free_buf(&proc->alloc, buffer);
|
||||
}
|
||||
|
||||
|
@ -3414,7 +3424,7 @@ static int binder_thread_write(struct binder_proc *proc,
|
|||
proc->pid, thread->pid, (u64)data_ptr,
|
||||
buffer->debug_id,
|
||||
buffer->transaction ? "active" : "finished");
|
||||
binder_free_buf(proc, buffer);
|
||||
binder_free_buf(proc, thread, buffer);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -4107,7 +4117,7 @@ retry:
|
|||
buffer->transaction = NULL;
|
||||
binder_cleanup_transaction(t, "fd fixups failed",
|
||||
BR_FAILED_REPLY);
|
||||
binder_free_buf(proc, buffer);
|
||||
binder_free_buf(proc, thread, buffer);
|
||||
binder_debug(BINDER_DEBUG_FAILED_TRANSACTION,
|
||||
"%d:%d %stransaction %d fd fixups failed %d/%d, line %d\n",
|
||||
proc->pid, thread->pid,
|
||||
|
@ -4648,6 +4658,22 @@ static int binder_ioctl_get_node_debug_info(struct binder_proc *proc,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static bool binder_txns_pending_ilocked(struct binder_proc *proc)
|
||||
{
|
||||
struct rb_node *n;
|
||||
struct binder_thread *thread;
|
||||
|
||||
if (proc->outstanding_txns > 0)
|
||||
return true;
|
||||
|
||||
for (n = rb_first(&proc->threads); n; n = rb_next(n)) {
|
||||
thread = rb_entry(n, struct binder_thread, rb_node);
|
||||
if (thread->transaction_stack)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static int binder_ioctl_freeze(struct binder_freeze_info *info,
|
||||
struct binder_proc *target_proc)
|
||||
{
|
||||
|
@ -4679,8 +4705,13 @@ static int binder_ioctl_freeze(struct binder_freeze_info *info,
|
|||
(!target_proc->outstanding_txns),
|
||||
msecs_to_jiffies(info->timeout_ms));
|
||||
|
||||
if (!ret && target_proc->outstanding_txns)
|
||||
ret = -EAGAIN;
|
||||
/* Check pending transactions that wait for reply */
|
||||
if (ret >= 0) {
|
||||
binder_inner_proc_lock(target_proc);
|
||||
if (binder_txns_pending_ilocked(target_proc))
|
||||
ret = -EAGAIN;
|
||||
binder_inner_proc_unlock(target_proc);
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
binder_inner_proc_lock(target_proc);
|
||||
|
@ -4696,6 +4727,7 @@ static int binder_ioctl_get_freezer_info(
|
|||
{
|
||||
struct binder_proc *target_proc;
|
||||
bool found = false;
|
||||
__u32 txns_pending;
|
||||
|
||||
info->sync_recv = 0;
|
||||
info->async_recv = 0;
|
||||
|
@ -4705,7 +4737,9 @@ static int binder_ioctl_get_freezer_info(
|
|||
if (target_proc->pid == info->pid) {
|
||||
found = true;
|
||||
binder_inner_proc_lock(target_proc);
|
||||
info->sync_recv |= target_proc->sync_recv;
|
||||
txns_pending = binder_txns_pending_ilocked(target_proc);
|
||||
info->sync_recv |= target_proc->sync_recv |
|
||||
(txns_pending << 1);
|
||||
info->async_recv |= target_proc->async_recv;
|
||||
binder_inner_proc_unlock(target_proc);
|
||||
}
|
||||
|
|
|
@ -378,6 +378,8 @@ struct binder_ref {
|
|||
* binder transactions
|
||||
* (protected by @inner_lock)
|
||||
* @sync_recv: process received sync transactions since last frozen
|
||||
* bit 0: received sync transaction after being frozen
|
||||
* bit 1: new pending sync transaction during freezing
|
||||
* (protected by @inner_lock)
|
||||
* @async_recv: process received async transactions since last frozen
|
||||
* (protected by @inner_lock)
|
||||
|
|
|
@ -1116,6 +1116,9 @@ int device_create_managed_software_node(struct device *dev,
|
|||
to_swnode(fwnode)->managed = true;
|
||||
set_secondary_fwnode(dev, fwnode);
|
||||
|
||||
if (device_is_registered(dev))
|
||||
software_node_notify(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(device_create_managed_software_node);
|
||||
|
|
|
@ -3090,6 +3090,7 @@ static int compat_insnlist(struct file *file, unsigned long arg)
|
|||
mutex_lock(&dev->mutex);
|
||||
rc = do_insnlist_ioctl(dev, insns, insnlist32.n_insns, file);
|
||||
mutex_unlock(&dev->mutex);
|
||||
kfree(insns);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
@ -464,7 +464,7 @@ static void dmc520_init_csrow(struct mem_ctl_info *mci)
|
|||
dimm->grain = pvt->mem_width_in_bytes;
|
||||
dimm->dtype = dt;
|
||||
dimm->mtype = mt;
|
||||
dimm->edac_mode = EDAC_FLAG_SECDED;
|
||||
dimm->edac_mode = EDAC_SECDED;
|
||||
dimm->nr_pages = pages_per_rank / csi->nr_channels;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -782,7 +782,7 @@ static void init_csrows(struct mem_ctl_info *mci)
|
|||
|
||||
for (j = 0; j < csi->nr_channels; j++) {
|
||||
dimm = csi->channels[j]->dimm;
|
||||
dimm->edac_mode = EDAC_FLAG_SECDED;
|
||||
dimm->edac_mode = EDAC_SECDED;
|
||||
dimm->mtype = p_data->get_mtype(priv->baseaddr);
|
||||
dimm->nr_pages = (size >> PAGE_SHIFT) / csi->nr_channels;
|
||||
dimm->grain = SYNPS_EDAC_ERR_GRAIN;
|
||||
|
|
|
@ -1019,16 +1019,18 @@ create_feature_instance(struct build_feature_devs_info *binfo,
|
|||
{
|
||||
unsigned int irq_base, nr_irqs;
|
||||
struct dfl_feature_info *finfo;
|
||||
u8 revision = 0;
|
||||
int ret;
|
||||
u8 revision;
|
||||
u64 v;
|
||||
|
||||
v = readq(binfo->ioaddr + ofst);
|
||||
revision = FIELD_GET(DFH_REVISION, v);
|
||||
if (fid != FEATURE_ID_AFU) {
|
||||
v = readq(binfo->ioaddr + ofst);
|
||||
revision = FIELD_GET(DFH_REVISION, v);
|
||||
|
||||
/* read feature size and id if inputs are invalid */
|
||||
size = size ? size : feature_size(v);
|
||||
fid = fid ? fid : feature_id(v);
|
||||
/* read feature size and id if inputs are invalid */
|
||||
size = size ? size : feature_size(v);
|
||||
fid = fid ? fid : feature_id(v);
|
||||
}
|
||||
|
||||
if (binfo->len - ofst < size)
|
||||
return -EINVAL;
|
||||
|
|
|
@ -225,8 +225,10 @@ static int machxo2_write_init(struct fpga_manager *mgr,
|
|||
goto fail;
|
||||
|
||||
get_status(spi, &status);
|
||||
if (test_bit(FAIL, &status))
|
||||
if (test_bit(FAIL, &status)) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
dump_status_reg(&status);
|
||||
|
||||
spi_message_init(&msg);
|
||||
|
@ -313,6 +315,7 @@ static int machxo2_write_complete(struct fpga_manager *mgr,
|
|||
dump_status_reg(&status);
|
||||
if (!test_bit(DONE, &status)) {
|
||||
machxo2_cleanup(mgr);
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -335,6 +338,7 @@ static int machxo2_write_complete(struct fpga_manager *mgr,
|
|||
break;
|
||||
if (++refreshloop == MACHXO2_MAX_REFRESH_LOOP) {
|
||||
machxo2_cleanup(mgr);
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
} while (1);
|
||||
|
|
|
@ -395,7 +395,7 @@ static void aspeed_sgpio_irq_handler(struct irq_desc *desc)
|
|||
reg = ioread32(bank_reg(data, bank, reg_irq_status));
|
||||
|
||||
for_each_set_bit(p, ®, 32)
|
||||
generic_handle_domain_irq(gc->irq.domain, i * 32 + p);
|
||||
generic_handle_domain_irq(gc->irq.domain, i * 32 + p * 2);
|
||||
}
|
||||
|
||||
chained_irq_exit(ic, desc);
|
||||
|
|
|
@ -141,7 +141,7 @@ static int rockchip_gpio_get_direction(struct gpio_chip *chip,
|
|||
u32 data;
|
||||
|
||||
data = rockchip_gpio_readl_bit(bank, offset, bank->gpio_regs->port_ddr);
|
||||
if (data & BIT(offset))
|
||||
if (data)
|
||||
return GPIO_LINE_DIRECTION_OUT;
|
||||
|
||||
return GPIO_LINE_DIRECTION_IN;
|
||||
|
@ -195,7 +195,7 @@ static int rockchip_gpio_set_debounce(struct gpio_chip *gc,
|
|||
unsigned int cur_div_reg;
|
||||
u64 div;
|
||||
|
||||
if (!IS_ERR(bank->db_clk)) {
|
||||
if (bank->gpio_type == GPIO_TYPE_V2 && !IS_ERR(bank->db_clk)) {
|
||||
div_debounce_support = true;
|
||||
freq = clk_get_rate(bank->db_clk);
|
||||
max_debounce = (GENMASK(23, 0) + 1) * 2 * 1000000 / freq;
|
||||
|
|
|
@ -184,7 +184,7 @@ static void uniphier_gpio_irq_mask(struct irq_data *data)
|
|||
|
||||
uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, 0);
|
||||
|
||||
return irq_chip_mask_parent(data);
|
||||
irq_chip_mask_parent(data);
|
||||
}
|
||||
|
||||
static void uniphier_gpio_irq_unmask(struct irq_data *data)
|
||||
|
@ -194,7 +194,7 @@ static void uniphier_gpio_irq_unmask(struct irq_data *data)
|
|||
|
||||
uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, mask);
|
||||
|
||||
return irq_chip_unmask_parent(data);
|
||||
irq_chip_unmask_parent(data);
|
||||
}
|
||||
|
||||
static int uniphier_gpio_irq_set_type(struct irq_data *data, unsigned int type)
|
||||
|
|
|
@ -313,9 +313,11 @@ static struct gpio_desc *acpi_request_own_gpiod(struct gpio_chip *chip,
|
|||
|
||||
ret = gpio_set_debounce_timeout(desc, agpio->debounce_timeout);
|
||||
if (ret)
|
||||
gpiochip_free_own_desc(desc);
|
||||
dev_warn(chip->parent,
|
||||
"Failed to set debounce-timeout for pin 0x%04X, err %d\n",
|
||||
pin, ret);
|
||||
|
||||
return ret ? ERR_PTR(ret) : desc;
|
||||
return desc;
|
||||
}
|
||||
|
||||
static bool acpi_gpio_in_ignore_list(const char *controller_in, int pin_in)
|
||||
|
|
|
@ -971,7 +971,6 @@ out:
|
|||
void kgd2kfd_device_exit(struct kfd_dev *kfd)
|
||||
{
|
||||
if (kfd->init_complete) {
|
||||
svm_migrate_fini((struct amdgpu_device *)kfd->kgd);
|
||||
device_queue_manager_uninit(kfd->dqm);
|
||||
kfd_interrupt_exit(kfd);
|
||||
kfd_topology_remove_device(kfd);
|
||||
|
|
|
@ -891,9 +891,16 @@ int svm_migrate_init(struct amdgpu_device *adev)
|
|||
pgmap->ops = &svm_migrate_pgmap_ops;
|
||||
pgmap->owner = SVM_ADEV_PGMAP_OWNER(adev);
|
||||
pgmap->flags = MIGRATE_VMA_SELECT_DEVICE_PRIVATE;
|
||||
|
||||
/* Device manager releases device-specific resources, memory region and
|
||||
* pgmap when driver disconnects from device.
|
||||
*/
|
||||
r = devm_memremap_pages(adev->dev, pgmap);
|
||||
if (IS_ERR(r)) {
|
||||
pr_err("failed to register HMM device memory\n");
|
||||
|
||||
/* Disable SVM support capability */
|
||||
pgmap->type = 0;
|
||||
devm_release_mem_region(adev->dev, res->start,
|
||||
res->end - res->start + 1);
|
||||
return PTR_ERR(r);
|
||||
|
@ -908,12 +915,3 @@ int svm_migrate_init(struct amdgpu_device *adev)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void svm_migrate_fini(struct amdgpu_device *adev)
|
||||
{
|
||||
struct dev_pagemap *pgmap = &adev->kfd.dev->pgmap;
|
||||
|
||||
devm_memunmap_pages(adev->dev, pgmap);
|
||||
devm_release_mem_region(adev->dev, pgmap->range.start,
|
||||
pgmap->range.end - pgmap->range.start + 1);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,6 @@ unsigned long
|
|||
svm_migrate_addr_to_pfn(struct amdgpu_device *adev, unsigned long addr);
|
||||
|
||||
int svm_migrate_init(struct amdgpu_device *adev);
|
||||
void svm_migrate_fini(struct amdgpu_device *adev);
|
||||
|
||||
#else
|
||||
|
||||
|
@ -55,10 +54,6 @@ static inline int svm_migrate_init(struct amdgpu_device *adev)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void svm_migrate_fini(struct amdgpu_device *adev)
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
|
||||
#endif /* IS_ENABLED(CONFIG_HSA_AMD_SVM) */
|
||||
|
||||
|
|
|
@ -118,6 +118,13 @@ static void svm_range_remove_notifier(struct svm_range *prange)
|
|||
mmu_interval_notifier_remove(&prange->notifier);
|
||||
}
|
||||
|
||||
static bool
|
||||
svm_is_valid_dma_mapping_addr(struct device *dev, dma_addr_t dma_addr)
|
||||
{
|
||||
return dma_addr && !dma_mapping_error(dev, dma_addr) &&
|
||||
!(dma_addr & SVM_RANGE_VRAM_DOMAIN);
|
||||
}
|
||||
|
||||
static int
|
||||
svm_range_dma_map_dev(struct amdgpu_device *adev, struct svm_range *prange,
|
||||
unsigned long offset, unsigned long npages,
|
||||
|
@ -139,8 +146,7 @@ svm_range_dma_map_dev(struct amdgpu_device *adev, struct svm_range *prange,
|
|||
|
||||
addr += offset;
|
||||
for (i = 0; i < npages; i++) {
|
||||
if (WARN_ONCE(addr[i] && !dma_mapping_error(dev, addr[i]),
|
||||
"leaking dma mapping\n"))
|
||||
if (svm_is_valid_dma_mapping_addr(dev, addr[i]))
|
||||
dma_unmap_page(dev, addr[i], PAGE_SIZE, dir);
|
||||
|
||||
page = hmm_pfn_to_page(hmm_pfns[i]);
|
||||
|
@ -209,7 +215,7 @@ void svm_range_dma_unmap(struct device *dev, dma_addr_t *dma_addr,
|
|||
return;
|
||||
|
||||
for (i = offset; i < offset + npages; i++) {
|
||||
if (!dma_addr[i] || dma_mapping_error(dev, dma_addr[i]))
|
||||
if (!svm_is_valid_dma_mapping_addr(dev, dma_addr[i]))
|
||||
continue;
|
||||
pr_debug("dma unmapping 0x%llx\n", dma_addr[i] >> PAGE_SHIFT);
|
||||
dma_unmap_page(dev, dma_addr[i], PAGE_SIZE, dir);
|
||||
|
@ -1165,7 +1171,7 @@ svm_range_map_to_gpu(struct amdgpu_device *adev, struct amdgpu_vm *vm,
|
|||
unsigned long last_start;
|
||||
int last_domain;
|
||||
int r = 0;
|
||||
int64_t i;
|
||||
int64_t i, j;
|
||||
|
||||
last_start = prange->start + offset;
|
||||
|
||||
|
@ -1178,7 +1184,11 @@ svm_range_map_to_gpu(struct amdgpu_device *adev, struct amdgpu_vm *vm,
|
|||
for (i = offset; i < offset + npages; i++) {
|
||||
last_domain = dma_addr[i] & SVM_RANGE_VRAM_DOMAIN;
|
||||
dma_addr[i] &= ~SVM_RANGE_VRAM_DOMAIN;
|
||||
if ((prange->start + i) < prange->last &&
|
||||
|
||||
/* Collect all pages in the same address range and memory domain
|
||||
* that can be mapped with a single call to update mapping.
|
||||
*/
|
||||
if (i < offset + npages - 1 &&
|
||||
last_domain == (dma_addr[i + 1] & SVM_RANGE_VRAM_DOMAIN))
|
||||
continue;
|
||||
|
||||
|
@ -1201,6 +1211,10 @@ svm_range_map_to_gpu(struct amdgpu_device *adev, struct amdgpu_vm *vm,
|
|||
NULL, dma_addr,
|
||||
&vm->last_update,
|
||||
&table_freed);
|
||||
|
||||
for (j = last_start - prange->start; j <= i; j++)
|
||||
dma_addr[j] |= last_domain;
|
||||
|
||||
if (r) {
|
||||
pr_debug("failed %d to map to gpu 0x%lx\n", r, prange->start);
|
||||
goto out;
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#define DC_LOGGER \
|
||||
engine->ctx->logger
|
||||
|
||||
#define DC_TRACE_LEVEL_MESSAGE(...) /* do nothing */
|
||||
#define DC_TRACE_LEVEL_MESSAGE(...) do { } while (0)
|
||||
#define IS_DC_I2CAUX_LOGGING_ENABLED() (false)
|
||||
#define LOG_FLAG_Error_I2cAux LOG_ERROR
|
||||
#define LOG_FLAG_I2cAux_DceAux LOG_I2C_AUX
|
||||
|
@ -76,7 +76,7 @@ enum {
|
|||
#define DEFAULT_AUX_ENGINE_MULT 0
|
||||
#define DEFAULT_AUX_ENGINE_LENGTH 69
|
||||
|
||||
#define DC_TRACE_LEVEL_MESSAGE(...) /* do nothing */
|
||||
#define DC_TRACE_LEVEL_MESSAGE(...) do { } while (0)
|
||||
|
||||
static void release_engine(
|
||||
struct dce_aux *engine)
|
||||
|
|
|
@ -6867,6 +6867,8 @@ static int si_dpm_enable(struct amdgpu_device *adev)
|
|||
si_enable_auto_throttle_source(adev, AMDGPU_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
|
||||
si_thermal_start_thermal_controller(adev);
|
||||
|
||||
ni_update_current_ps(adev, boot_ps);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -222,31 +222,42 @@ static int icl_sagv_max_dclk(const struct intel_qgv_info *qi)
|
|||
|
||||
struct intel_sa_info {
|
||||
u16 displayrtids;
|
||||
u8 deburst, deprogbwlimit;
|
||||
u8 deburst, deprogbwlimit, derating;
|
||||
};
|
||||
|
||||
static const struct intel_sa_info icl_sa_info = {
|
||||
.deburst = 8,
|
||||
.deprogbwlimit = 25, /* GB/s */
|
||||
.displayrtids = 128,
|
||||
.derating = 10,
|
||||
};
|
||||
|
||||
static const struct intel_sa_info tgl_sa_info = {
|
||||
.deburst = 16,
|
||||
.deprogbwlimit = 34, /* GB/s */
|
||||
.displayrtids = 256,
|
||||
.derating = 10,
|
||||
};
|
||||
|
||||
static const struct intel_sa_info rkl_sa_info = {
|
||||
.deburst = 16,
|
||||
.deprogbwlimit = 20, /* GB/s */
|
||||
.displayrtids = 128,
|
||||
.derating = 10,
|
||||
};
|
||||
|
||||
static const struct intel_sa_info adls_sa_info = {
|
||||
.deburst = 16,
|
||||
.deprogbwlimit = 38, /* GB/s */
|
||||
.displayrtids = 256,
|
||||
.derating = 10,
|
||||
};
|
||||
|
||||
static const struct intel_sa_info adlp_sa_info = {
|
||||
.deburst = 16,
|
||||
.deprogbwlimit = 38, /* GB/s */
|
||||
.displayrtids = 256,
|
||||
.derating = 20,
|
||||
};
|
||||
|
||||
static int icl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel_sa_info *sa)
|
||||
|
@ -302,7 +313,7 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel
|
|||
bw = icl_calc_bw(sp->dclk, clpchgroup * 32 * num_channels, ct);
|
||||
|
||||
bi->deratedbw[j] = min(maxdebw,
|
||||
bw * 9 / 10); /* 90% */
|
||||
bw * (100 - sa->derating) / 100);
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
"BW%d / QGV %d: num_planes=%d deratedbw=%u\n",
|
||||
|
@ -400,7 +411,9 @@ void intel_bw_init_hw(struct drm_i915_private *dev_priv)
|
|||
|
||||
if (IS_DG2(dev_priv))
|
||||
dg2_get_bw_info(dev_priv);
|
||||
else if (IS_ALDERLAKE_S(dev_priv) || IS_ALDERLAKE_P(dev_priv))
|
||||
else if (IS_ALDERLAKE_P(dev_priv))
|
||||
icl_get_bw_info(dev_priv, &adlp_sa_info);
|
||||
else if (IS_ALDERLAKE_S(dev_priv))
|
||||
icl_get_bw_info(dev_priv, &adls_sa_info);
|
||||
else if (IS_ROCKETLAKE(dev_priv))
|
||||
icl_get_bw_info(dev_priv, &rkl_sa_info);
|
||||
|
|
|
@ -805,11 +805,14 @@ void intel_dmc_ucode_resume(struct drm_i915_private *dev_priv)
|
|||
*/
|
||||
void intel_dmc_ucode_fini(struct drm_i915_private *dev_priv)
|
||||
{
|
||||
int id;
|
||||
|
||||
if (!HAS_DMC(dev_priv))
|
||||
return;
|
||||
|
||||
intel_dmc_ucode_suspend(dev_priv);
|
||||
drm_WARN_ON(&dev_priv->drm, dev_priv->dmc.wakeref);
|
||||
|
||||
kfree(dev_priv->dmc.dmc_info[DMC_FW_MAIN].payload);
|
||||
for (id = 0; id < DMC_FW_MAX; id++)
|
||||
kfree(dev_priv->dmc.dmc_info[id].payload);
|
||||
}
|
||||
|
|
|
@ -356,11 +356,8 @@ static void i915_ttm_delete_mem_notify(struct ttm_buffer_object *bo)
|
|||
{
|
||||
struct drm_i915_gem_object *obj = i915_ttm_to_gem(bo);
|
||||
|
||||
if (likely(obj)) {
|
||||
/* This releases all gem object bindings to the backend. */
|
||||
if (likely(obj))
|
||||
i915_ttm_free_cached_io_st(obj);
|
||||
__i915_gem_free_object(obj);
|
||||
}
|
||||
}
|
||||
|
||||
static struct intel_memory_region *
|
||||
|
@ -875,8 +872,12 @@ void i915_ttm_bo_destroy(struct ttm_buffer_object *bo)
|
|||
{
|
||||
struct drm_i915_gem_object *obj = i915_ttm_to_gem(bo);
|
||||
|
||||
/* This releases all gem object bindings to the backend. */
|
||||
__i915_gem_free_object(obj);
|
||||
|
||||
i915_gem_object_release_memory_region(obj);
|
||||
mutex_destroy(&obj->ttm.get_io_page.lock);
|
||||
|
||||
if (obj->ttm.created)
|
||||
call_rcu(&obj->rcu, __i915_gem_free_object_rcu);
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ nvkm_control_mthd_pstate_info(struct nvkm_control *ctrl, void *data, u32 size)
|
|||
args->v0.count = 0;
|
||||
args->v0.ustate_ac = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE;
|
||||
args->v0.ustate_dc = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE;
|
||||
args->v0.pwrsrc = -ENOSYS;
|
||||
args->v0.pwrsrc = -ENODEV;
|
||||
args->v0.pstate = NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_UNKNOWN;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include "coresight-config.h"
|
||||
#include "coresight-etm-perf.h"
|
||||
|
|
|
@ -409,6 +409,7 @@ config MESON_IRQ_GPIO
|
|||
config GOLDFISH_PIC
|
||||
bool "Goldfish programmable interrupt controller"
|
||||
depends on MIPS && (GOLDFISH || COMPILE_TEST)
|
||||
select GENERIC_IRQ_CHIP
|
||||
select IRQ_DOMAIN
|
||||
help
|
||||
Say yes here to enable Goldfish interrupt controller driver used
|
||||
|
|
|
@ -359,16 +359,16 @@ static void armada_370_xp_ipi_send_mask(struct irq_data *d,
|
|||
ARMADA_370_XP_SW_TRIG_INT_OFFS);
|
||||
}
|
||||
|
||||
static void armada_370_xp_ipi_eoi(struct irq_data *d)
|
||||
static void armada_370_xp_ipi_ack(struct irq_data *d)
|
||||
{
|
||||
writel(~BIT(d->hwirq), per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS);
|
||||
}
|
||||
|
||||
static struct irq_chip ipi_irqchip = {
|
||||
.name = "IPI",
|
||||
.irq_ack = armada_370_xp_ipi_ack,
|
||||
.irq_mask = armada_370_xp_ipi_mask,
|
||||
.irq_unmask = armada_370_xp_ipi_unmask,
|
||||
.irq_eoi = armada_370_xp_ipi_eoi,
|
||||
.ipi_send_mask = armada_370_xp_ipi_send_mask,
|
||||
};
|
||||
|
||||
|
|
|
@ -4501,7 +4501,7 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
|
|||
|
||||
if (err) {
|
||||
if (i > 0)
|
||||
its_vpe_irq_domain_free(domain, virq, i - 1);
|
||||
its_vpe_irq_domain_free(domain, virq, i);
|
||||
|
||||
its_lpi_free(bitmap, base, nr_ids);
|
||||
its_free_prop_table(vprop_page);
|
||||
|
|
|
@ -107,6 +107,8 @@ static DEFINE_RAW_SPINLOCK(cpu_map_lock);
|
|||
|
||||
#endif
|
||||
|
||||
static DEFINE_STATIC_KEY_FALSE(needs_rmw_access);
|
||||
|
||||
/*
|
||||
* The GIC mapping of CPU interfaces does not necessarily match
|
||||
* the logical CPU numbering. Let's use a mapping as returned
|
||||
|
@ -774,6 +776,25 @@ static int gic_pm_init(struct gic_chip_data *gic)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
static void rmw_writeb(u8 bval, void __iomem *addr)
|
||||
{
|
||||
static DEFINE_RAW_SPINLOCK(rmw_lock);
|
||||
unsigned long offset = (unsigned long)addr & 3UL;
|
||||
unsigned long shift = offset * 8;
|
||||
unsigned long flags;
|
||||
u32 val;
|
||||
|
||||
raw_spin_lock_irqsave(&rmw_lock, flags);
|
||||
|
||||
addr -= offset;
|
||||
val = readl_relaxed(addr);
|
||||
val &= ~GENMASK(shift + 7, shift);
|
||||
val |= bval << shift;
|
||||
writel_relaxed(val, addr);
|
||||
|
||||
raw_spin_unlock_irqrestore(&rmw_lock, flags);
|
||||
}
|
||||
|
||||
static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
|
||||
bool force)
|
||||
{
|
||||
|
@ -788,7 +809,10 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
|
|||
if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
|
||||
return -EINVAL;
|
||||
|
||||
writeb_relaxed(gic_cpu_map[cpu], reg);
|
||||
if (static_branch_unlikely(&needs_rmw_access))
|
||||
rmw_writeb(gic_cpu_map[cpu], reg);
|
||||
else
|
||||
writeb_relaxed(gic_cpu_map[cpu], reg);
|
||||
irq_data_update_effective_affinity(d, cpumask_of(cpu));
|
||||
|
||||
return IRQ_SET_MASK_OK_DONE;
|
||||
|
@ -1375,6 +1399,30 @@ static bool gic_check_eoimode(struct device_node *node, void __iomem **base)
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool gic_enable_rmw_access(void *data)
|
||||
{
|
||||
/*
|
||||
* The EMEV2 class of machines has a broken interconnect, and
|
||||
* locks up on accesses that are less than 32bit. So far, only
|
||||
* the affinity setting requires it.
|
||||
*/
|
||||
if (of_machine_is_compatible("renesas,emev2")) {
|
||||
static_branch_enable(&needs_rmw_access);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static const struct gic_quirk gic_quirks[] = {
|
||||
{
|
||||
.desc = "broken byte access",
|
||||
.compatible = "arm,pl390",
|
||||
.init = gic_enable_rmw_access,
|
||||
},
|
||||
{ },
|
||||
};
|
||||
|
||||
static int gic_of_setup(struct gic_chip_data *gic, struct device_node *node)
|
||||
{
|
||||
if (!gic || !node)
|
||||
|
@ -1391,6 +1439,8 @@ static int gic_of_setup(struct gic_chip_data *gic, struct device_node *node)
|
|||
if (of_property_read_u32(node, "cpu-offset", &gic->percpu_offset))
|
||||
gic->percpu_offset = 0;
|
||||
|
||||
gic_enable_of_quirks(node, gic_quirks, gic);
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
/* The maximum IRQ pin number of mbigen chip(start from 0) */
|
||||
#define MAXIMUM_IRQ_PIN_NUM 1407
|
||||
|
||||
/**
|
||||
/*
|
||||
* In mbigen vector register
|
||||
* bit[21:12]: event id value
|
||||
* bit[11:0]: device id
|
||||
|
@ -39,14 +39,14 @@
|
|||
/* offset of vector register in mbigen node */
|
||||
#define REG_MBIGEN_VEC_OFFSET 0x200
|
||||
|
||||
/**
|
||||
/*
|
||||
* offset of clear register in mbigen node
|
||||
* This register is used to clear the status
|
||||
* of interrupt
|
||||
*/
|
||||
#define REG_MBIGEN_CLEAR_OFFSET 0xa000
|
||||
|
||||
/**
|
||||
/*
|
||||
* offset of interrupt type register
|
||||
* This register is used to configure interrupt
|
||||
* trigger type
|
||||
|
|
|
@ -223,12 +223,12 @@ static int rza1_irqc_probe(struct platform_device *pdev)
|
|||
goto out_put_node;
|
||||
}
|
||||
|
||||
priv->chip.name = "rza1-irqc",
|
||||
priv->chip.irq_mask = irq_chip_mask_parent,
|
||||
priv->chip.irq_unmask = irq_chip_unmask_parent,
|
||||
priv->chip.irq_eoi = rza1_irqc_eoi,
|
||||
priv->chip.irq_retrigger = irq_chip_retrigger_hierarchy,
|
||||
priv->chip.irq_set_type = rza1_irqc_set_type,
|
||||
priv->chip.name = "rza1-irqc";
|
||||
priv->chip.irq_mask = irq_chip_mask_parent;
|
||||
priv->chip.irq_unmask = irq_chip_unmask_parent;
|
||||
priv->chip.irq_eoi = rza1_irqc_eoi;
|
||||
priv->chip.irq_retrigger = irq_chip_retrigger_hierarchy;
|
||||
priv->chip.irq_set_type = rza1_irqc_set_type;
|
||||
priv->chip.flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE;
|
||||
|
||||
priv->irq_domain = irq_domain_add_hierarchy(parent, 0, IRQC_NUM_IRQ,
|
||||
|
|
|
@ -275,8 +275,8 @@ struct mcb_bus *mcb_alloc_bus(struct device *carrier)
|
|||
|
||||
bus_nr = ida_simple_get(&mcb_ida, 0, 0, GFP_KERNEL);
|
||||
if (bus_nr < 0) {
|
||||
rc = bus_nr;
|
||||
goto err_free;
|
||||
kfree(bus);
|
||||
return ERR_PTR(bus_nr);
|
||||
}
|
||||
|
||||
bus->bus_nr = bus_nr;
|
||||
|
@ -291,12 +291,12 @@ struct mcb_bus *mcb_alloc_bus(struct device *carrier)
|
|||
dev_set_name(&bus->dev, "mcb:%d", bus_nr);
|
||||
rc = device_add(&bus->dev);
|
||||
if (rc)
|
||||
goto err_free;
|
||||
goto err_put;
|
||||
|
||||
return bus;
|
||||
err_free:
|
||||
put_device(carrier);
|
||||
kfree(bus);
|
||||
|
||||
err_put:
|
||||
put_device(&bus->dev);
|
||||
return ERR_PTR(rc);
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(mcb_alloc_bus, MCB);
|
||||
|
|
|
@ -5700,10 +5700,6 @@ static int md_alloc(dev_t dev, char *name)
|
|||
disk->flags |= GENHD_FL_EXT_DEVT;
|
||||
disk->events |= DISK_EVENT_MEDIA_CHANGE;
|
||||
mddev->gendisk = disk;
|
||||
/* As soon as we call add_disk(), another thread could get
|
||||
* through to md_open, so make sure it doesn't get too far
|
||||
*/
|
||||
mutex_lock(&mddev->open_mutex);
|
||||
add_disk(disk);
|
||||
|
||||
error = kobject_add(&mddev->kobj, &disk_to_dev(disk)->kobj, "%s", "md");
|
||||
|
@ -5718,7 +5714,6 @@ static int md_alloc(dev_t dev, char *name)
|
|||
if (mddev->kobj.sd &&
|
||||
sysfs_create_group(&mddev->kobj, &md_bitmap_group))
|
||||
pr_debug("pointless warning\n");
|
||||
mutex_unlock(&mddev->open_mutex);
|
||||
abort:
|
||||
mutex_unlock(&disks_mutex);
|
||||
if (!error && mddev->kobj.sd) {
|
||||
|
|
|
@ -267,13 +267,13 @@ int bcm_vk_tty_init(struct bcm_vk *vk, char *name)
|
|||
struct device *tty_dev;
|
||||
|
||||
tty_port_init(&vk->tty[i].port);
|
||||
tty_dev = tty_port_register_device(&vk->tty[i].port, tty_drv,
|
||||
i, dev);
|
||||
tty_dev = tty_port_register_device_attr(&vk->tty[i].port,
|
||||
tty_drv, i, dev, vk,
|
||||
NULL);
|
||||
if (IS_ERR(tty_dev)) {
|
||||
err = PTR_ERR(tty_dev);
|
||||
goto unwind;
|
||||
}
|
||||
dev_set_drvdata(tty_dev, vk);
|
||||
vk->tty[i].is_opened = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1090,7 +1090,7 @@ static int genwqe_pci_setup(struct genwqe_dev *cd)
|
|||
|
||||
/* check for 64-bit DMA address supported (DAC) */
|
||||
/* check for 32-bit DMA address supported (SAC) */
|
||||
if (dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(64)) ||
|
||||
if (dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(64)) &&
|
||||
dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32))) {
|
||||
dev_err(&pci_dev->dev,
|
||||
"err: neither DMA32 nor DMA64 supported\n");
|
||||
|
|
|
@ -405,7 +405,7 @@ static void staged_cs_put(struct hl_device *hdev, struct hl_cs *cs)
|
|||
static void cs_handle_tdr(struct hl_device *hdev, struct hl_cs *cs)
|
||||
{
|
||||
bool next_entry_found = false;
|
||||
struct hl_cs *next;
|
||||
struct hl_cs *next, *first_cs;
|
||||
|
||||
if (!cs_needs_timeout(cs))
|
||||
return;
|
||||
|
@ -415,9 +415,16 @@ static void cs_handle_tdr(struct hl_device *hdev, struct hl_cs *cs)
|
|||
/* We need to handle tdr only once for the complete staged submission.
|
||||
* Hence, we choose the CS that reaches this function first which is
|
||||
* the CS marked as 'staged_last'.
|
||||
* In case single staged cs was submitted which has both first and last
|
||||
* indications, then "cs_find_first" below will return NULL, since we
|
||||
* removed the cs node from the list before getting here,
|
||||
* in such cases just continue with the cs to cancel it's TDR work.
|
||||
*/
|
||||
if (cs->staged_cs && cs->staged_last)
|
||||
cs = hl_staged_cs_find_first(hdev, cs->staged_sequence);
|
||||
if (cs->staged_cs && cs->staged_last) {
|
||||
first_cs = hl_staged_cs_find_first(hdev, cs->staged_sequence);
|
||||
if (first_cs)
|
||||
cs = first_cs;
|
||||
}
|
||||
|
||||
spin_unlock(&hdev->cs_mirror_lock);
|
||||
|
||||
|
@ -1288,6 +1295,12 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks,
|
|||
if (rc)
|
||||
goto free_cs_object;
|
||||
|
||||
/* If this is a staged submission we must return the staged sequence
|
||||
* rather than the internal CS sequence
|
||||
*/
|
||||
if (cs->staged_cs)
|
||||
*cs_seq = cs->staged_sequence;
|
||||
|
||||
/* Validate ALL the CS chunks before submitting the CS */
|
||||
for (i = 0 ; i < num_chunks ; i++) {
|
||||
struct hl_cs_chunk *chunk = &cs_chunk_array[i];
|
||||
|
@ -1988,6 +2001,15 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type,
|
|||
goto free_cs_chunk_array;
|
||||
}
|
||||
|
||||
if (!hdev->nic_ports_mask) {
|
||||
atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
|
||||
atomic64_inc(&cntr->validation_drop_cnt);
|
||||
dev_err(hdev->dev,
|
||||
"Collective operations not supported when NIC ports are disabled");
|
||||
rc = -EINVAL;
|
||||
goto free_cs_chunk_array;
|
||||
}
|
||||
|
||||
collective_engine_id = chunk->collective_engine_id;
|
||||
}
|
||||
|
||||
|
@ -2026,9 +2048,10 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type,
|
|||
spin_unlock(&ctx->sig_mgr.lock);
|
||||
|
||||
if (!handle_found) {
|
||||
dev_err(hdev->dev, "Cannot find encapsulated signals handle for seq 0x%llx\n",
|
||||
/* treat as signal CS already finished */
|
||||
dev_dbg(hdev->dev, "Cannot find encapsulated signals handle for seq 0x%llx\n",
|
||||
signal_seq);
|
||||
rc = -EINVAL;
|
||||
rc = 0;
|
||||
goto free_cs_chunk_array;
|
||||
}
|
||||
|
||||
|
@ -2613,7 +2636,8 @@ static int hl_multi_cs_wait_ioctl(struct hl_fpriv *hpriv, void *data)
|
|||
* completed after the poll function.
|
||||
*/
|
||||
if (!mcs_data.completion_bitmap) {
|
||||
dev_err(hdev->dev, "Multi-CS got completion on wait but no CS completed\n");
|
||||
dev_warn_ratelimited(hdev->dev,
|
||||
"Multi-CS got completion on wait but no CS completed\n");
|
||||
rc = -EFAULT;
|
||||
}
|
||||
}
|
||||
|
@ -2740,10 +2764,20 @@ static int _hl_interrupt_wait_ioctl(struct hl_device *hdev, struct hl_ctx *ctx,
|
|||
else
|
||||
interrupt = &hdev->user_interrupt[interrupt_offset];
|
||||
|
||||
/* Add pending user interrupt to relevant list for the interrupt
|
||||
* handler to monitor
|
||||
*/
|
||||
spin_lock_irqsave(&interrupt->wait_list_lock, flags);
|
||||
list_add_tail(&pend->wait_list_node, &interrupt->wait_list_head);
|
||||
spin_unlock_irqrestore(&interrupt->wait_list_lock, flags);
|
||||
|
||||
/* We check for completion value as interrupt could have been received
|
||||
* before we added the node to the wait list
|
||||
*/
|
||||
if (copy_from_user(&completion_value, u64_to_user_ptr(user_address), 4)) {
|
||||
dev_err(hdev->dev, "Failed to copy completion value from user\n");
|
||||
rc = -EFAULT;
|
||||
goto free_fence;
|
||||
goto remove_pending_user_interrupt;
|
||||
}
|
||||
|
||||
if (completion_value >= target_value)
|
||||
|
@ -2752,14 +2786,7 @@ static int _hl_interrupt_wait_ioctl(struct hl_device *hdev, struct hl_ctx *ctx,
|
|||
*status = CS_WAIT_STATUS_BUSY;
|
||||
|
||||
if (!timeout_us || (*status == CS_WAIT_STATUS_COMPLETED))
|
||||
goto free_fence;
|
||||
|
||||
/* Add pending user interrupt to relevant list for the interrupt
|
||||
* handler to monitor
|
||||
*/
|
||||
spin_lock_irqsave(&interrupt->wait_list_lock, flags);
|
||||
list_add_tail(&pend->wait_list_node, &interrupt->wait_list_head);
|
||||
spin_unlock_irqrestore(&interrupt->wait_list_lock, flags);
|
||||
goto remove_pending_user_interrupt;
|
||||
|
||||
wait_again:
|
||||
/* Wait for interrupt handler to signal completion */
|
||||
|
@ -2770,6 +2797,15 @@ wait_again:
|
|||
* If comparison fails, keep waiting until timeout expires
|
||||
*/
|
||||
if (completion_rc > 0) {
|
||||
spin_lock_irqsave(&interrupt->wait_list_lock, flags);
|
||||
/* reinit_completion must be called before we check for user
|
||||
* completion value, otherwise, if interrupt is received after
|
||||
* the comparison and before the next wait_for_completion,
|
||||
* we will reach timeout and fail
|
||||
*/
|
||||
reinit_completion(&pend->fence.completion);
|
||||
spin_unlock_irqrestore(&interrupt->wait_list_lock, flags);
|
||||
|
||||
if (copy_from_user(&completion_value, u64_to_user_ptr(user_address), 4)) {
|
||||
dev_err(hdev->dev, "Failed to copy completion value from user\n");
|
||||
rc = -EFAULT;
|
||||
|
@ -2780,11 +2816,7 @@ wait_again:
|
|||
if (completion_value >= target_value) {
|
||||
*status = CS_WAIT_STATUS_COMPLETED;
|
||||
} else {
|
||||
spin_lock_irqsave(&interrupt->wait_list_lock, flags);
|
||||
reinit_completion(&pend->fence.completion);
|
||||
timeout = completion_rc;
|
||||
|
||||
spin_unlock_irqrestore(&interrupt->wait_list_lock, flags);
|
||||
goto wait_again;
|
||||
}
|
||||
} else if (completion_rc == -ERESTARTSYS) {
|
||||
|
@ -2802,7 +2834,6 @@ remove_pending_user_interrupt:
|
|||
list_del(&pend->wait_list_node);
|
||||
spin_unlock_irqrestore(&interrupt->wait_list_lock, flags);
|
||||
|
||||
free_fence:
|
||||
kfree(pend);
|
||||
hl_ctx_put(ctx);
|
||||
|
||||
|
|
|
@ -437,6 +437,7 @@ void hl_hw_queue_encaps_sig_set_sob_info(struct hl_device *hdev,
|
|||
struct hl_cs_compl *cs_cmpl)
|
||||
{
|
||||
struct hl_cs_encaps_sig_handle *handle = cs->encaps_sig_hdl;
|
||||
u32 offset = 0;
|
||||
|
||||
cs_cmpl->hw_sob = handle->hw_sob;
|
||||
|
||||
|
@ -446,9 +447,13 @@ void hl_hw_queue_encaps_sig_set_sob_info(struct hl_device *hdev,
|
|||
* set offset 1 for example he mean to wait only for the first
|
||||
* signal only, which will be pre_sob_val, and if he set offset 2
|
||||
* then the value required is (pre_sob_val + 1) and so on...
|
||||
* if user set wait offset to 0, then treat it as legacy wait cs,
|
||||
* wait for the next signal.
|
||||
*/
|
||||
cs_cmpl->sob_val = handle->pre_sob_val +
|
||||
(job->encaps_sig_wait_offset - 1);
|
||||
if (job->encaps_sig_wait_offset)
|
||||
offset = job->encaps_sig_wait_offset - 1;
|
||||
|
||||
cs_cmpl->sob_val = handle->pre_sob_val + offset;
|
||||
}
|
||||
|
||||
static int init_wait_cs(struct hl_device *hdev, struct hl_cs *cs,
|
||||
|
|
|
@ -395,7 +395,7 @@ static struct hl_hw_obj_name_entry gaudi_so_id_to_str[] = {
|
|||
|
||||
static struct hl_hw_obj_name_entry gaudi_monitor_id_to_str[] = {
|
||||
{ .id = 200, .name = "MON_OBJ_DMA_DOWN_FEEDBACK_RESET" },
|
||||
{ .id = 201, .name = "MON_OBJ_DMA_UP_FEADBACK_RESET" },
|
||||
{ .id = 201, .name = "MON_OBJ_DMA_UP_FEEDBACK_RESET" },
|
||||
{ .id = 203, .name = "MON_OBJ_DRAM_TO_SRAM_QUEUE_FENCE" },
|
||||
{ .id = 204, .name = "MON_OBJ_TPC_0_CLK_GATE" },
|
||||
{ .id = 205, .name = "MON_OBJ_TPC_1_CLK_GATE" },
|
||||
|
@ -5802,6 +5802,7 @@ static void gaudi_add_end_of_cb_packets(struct hl_device *hdev,
|
|||
{
|
||||
struct gaudi_device *gaudi = hdev->asic_specific;
|
||||
struct packet_msg_prot *cq_pkt;
|
||||
u64 msi_addr;
|
||||
u32 tmp;
|
||||
|
||||
cq_pkt = kernel_address + len - (sizeof(struct packet_msg_prot) * 2);
|
||||
|
@ -5823,10 +5824,12 @@ static void gaudi_add_end_of_cb_packets(struct hl_device *hdev,
|
|||
cq_pkt->ctl = cpu_to_le32(tmp);
|
||||
cq_pkt->value = cpu_to_le32(1);
|
||||
|
||||
if (!gaudi->multi_msi_mode)
|
||||
msi_vec = 0;
|
||||
if (gaudi->multi_msi_mode)
|
||||
msi_addr = mmPCIE_MSI_INTR_0 + msi_vec * 4;
|
||||
else
|
||||
msi_addr = mmPCIE_CORE_MSI_REQ;
|
||||
|
||||
cq_pkt->addr = cpu_to_le64(CFG_BASE + mmPCIE_MSI_INTR_0 + msi_vec * 4);
|
||||
cq_pkt->addr = cpu_to_le64(CFG_BASE + msi_addr);
|
||||
}
|
||||
|
||||
static void gaudi_update_eq_ci(struct hl_device *hdev, u32 val)
|
||||
|
|
|
@ -8,16 +8,21 @@
|
|||
#include "gaudiP.h"
|
||||
#include "../include/gaudi/asic_reg/gaudi_regs.h"
|
||||
|
||||
#define GAUDI_NUMBER_OF_RR_REGS 24
|
||||
#define GAUDI_NUMBER_OF_LBW_RANGES 12
|
||||
#define GAUDI_NUMBER_OF_LBW_RR_REGS 28
|
||||
#define GAUDI_NUMBER_OF_HBW_RR_REGS 24
|
||||
#define GAUDI_NUMBER_OF_LBW_RANGES 10
|
||||
|
||||
static u64 gaudi_rr_lbw_hit_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_lbw_hit_aw_regs[GAUDI_NUMBER_OF_LBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_SOB_HIT_WPROT,
|
||||
mmDMA_IF_W_S_DMA0_HIT_WPROT,
|
||||
mmDMA_IF_W_S_DMA1_HIT_WPROT,
|
||||
mmDMA_IF_E_S_SOB_HIT_WPROT,
|
||||
mmDMA_IF_E_S_DMA0_HIT_WPROT,
|
||||
mmDMA_IF_E_S_DMA1_HIT_WPROT,
|
||||
mmDMA_IF_W_N_SOB_HIT_WPROT,
|
||||
mmDMA_IF_W_N_DMA0_HIT_WPROT,
|
||||
mmDMA_IF_W_N_DMA1_HIT_WPROT,
|
||||
mmDMA_IF_E_N_SOB_HIT_WPROT,
|
||||
mmDMA_IF_E_N_DMA0_HIT_WPROT,
|
||||
mmDMA_IF_E_N_DMA1_HIT_WPROT,
|
||||
mmSIF_RTR_0_LBW_RANGE_PROT_HIT_AW,
|
||||
|
@ -38,13 +43,17 @@ static u64 gaudi_rr_lbw_hit_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_7_LBW_RANGE_PROT_HIT_AW,
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_lbw_hit_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_lbw_hit_ar_regs[GAUDI_NUMBER_OF_LBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_SOB_HIT_RPROT,
|
||||
mmDMA_IF_W_S_DMA0_HIT_RPROT,
|
||||
mmDMA_IF_W_S_DMA1_HIT_RPROT,
|
||||
mmDMA_IF_E_S_SOB_HIT_RPROT,
|
||||
mmDMA_IF_E_S_DMA0_HIT_RPROT,
|
||||
mmDMA_IF_E_S_DMA1_HIT_RPROT,
|
||||
mmDMA_IF_W_N_SOB_HIT_RPROT,
|
||||
mmDMA_IF_W_N_DMA0_HIT_RPROT,
|
||||
mmDMA_IF_W_N_DMA1_HIT_RPROT,
|
||||
mmDMA_IF_E_N_SOB_HIT_RPROT,
|
||||
mmDMA_IF_E_N_DMA0_HIT_RPROT,
|
||||
mmDMA_IF_E_N_DMA1_HIT_RPROT,
|
||||
mmSIF_RTR_0_LBW_RANGE_PROT_HIT_AR,
|
||||
|
@ -65,13 +74,17 @@ static u64 gaudi_rr_lbw_hit_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_7_LBW_RANGE_PROT_HIT_AR,
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_lbw_min_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_lbw_min_aw_regs[GAUDI_NUMBER_OF_LBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_SOB_MIN_WPROT_0,
|
||||
mmDMA_IF_W_S_DMA0_MIN_WPROT_0,
|
||||
mmDMA_IF_W_S_DMA1_MIN_WPROT_0,
|
||||
mmDMA_IF_E_S_SOB_MIN_WPROT_0,
|
||||
mmDMA_IF_E_S_DMA0_MIN_WPROT_0,
|
||||
mmDMA_IF_E_S_DMA1_MIN_WPROT_0,
|
||||
mmDMA_IF_W_N_SOB_MIN_WPROT_0,
|
||||
mmDMA_IF_W_N_DMA0_MIN_WPROT_0,
|
||||
mmDMA_IF_W_N_DMA1_MIN_WPROT_0,
|
||||
mmDMA_IF_E_N_SOB_MIN_WPROT_0,
|
||||
mmDMA_IF_E_N_DMA0_MIN_WPROT_0,
|
||||
mmDMA_IF_E_N_DMA1_MIN_WPROT_0,
|
||||
mmSIF_RTR_0_LBW_RANGE_PROT_MIN_AW_0,
|
||||
|
@ -92,13 +105,17 @@ static u64 gaudi_rr_lbw_min_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_7_LBW_RANGE_PROT_MIN_AW_0,
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_lbw_max_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_lbw_max_aw_regs[GAUDI_NUMBER_OF_LBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_SOB_MAX_WPROT_0,
|
||||
mmDMA_IF_W_S_DMA0_MAX_WPROT_0,
|
||||
mmDMA_IF_W_S_DMA1_MAX_WPROT_0,
|
||||
mmDMA_IF_E_S_SOB_MAX_WPROT_0,
|
||||
mmDMA_IF_E_S_DMA0_MAX_WPROT_0,
|
||||
mmDMA_IF_E_S_DMA1_MAX_WPROT_0,
|
||||
mmDMA_IF_W_N_SOB_MAX_WPROT_0,
|
||||
mmDMA_IF_W_N_DMA0_MAX_WPROT_0,
|
||||
mmDMA_IF_W_N_DMA1_MAX_WPROT_0,
|
||||
mmDMA_IF_E_N_SOB_MAX_WPROT_0,
|
||||
mmDMA_IF_E_N_DMA0_MAX_WPROT_0,
|
||||
mmDMA_IF_E_N_DMA1_MAX_WPROT_0,
|
||||
mmSIF_RTR_0_LBW_RANGE_PROT_MAX_AW_0,
|
||||
|
@ -119,13 +136,17 @@ static u64 gaudi_rr_lbw_max_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_7_LBW_RANGE_PROT_MAX_AW_0,
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_lbw_min_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_lbw_min_ar_regs[GAUDI_NUMBER_OF_LBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_SOB_MIN_RPROT_0,
|
||||
mmDMA_IF_W_S_DMA0_MIN_RPROT_0,
|
||||
mmDMA_IF_W_S_DMA1_MIN_RPROT_0,
|
||||
mmDMA_IF_E_S_SOB_MIN_RPROT_0,
|
||||
mmDMA_IF_E_S_DMA0_MIN_RPROT_0,
|
||||
mmDMA_IF_E_S_DMA1_MIN_RPROT_0,
|
||||
mmDMA_IF_W_N_SOB_MIN_RPROT_0,
|
||||
mmDMA_IF_W_N_DMA0_MIN_RPROT_0,
|
||||
mmDMA_IF_W_N_DMA1_MIN_RPROT_0,
|
||||
mmDMA_IF_E_N_SOB_MIN_RPROT_0,
|
||||
mmDMA_IF_E_N_DMA0_MIN_RPROT_0,
|
||||
mmDMA_IF_E_N_DMA1_MIN_RPROT_0,
|
||||
mmSIF_RTR_0_LBW_RANGE_PROT_MIN_AR_0,
|
||||
|
@ -146,13 +167,17 @@ static u64 gaudi_rr_lbw_min_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_7_LBW_RANGE_PROT_MIN_AR_0,
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_lbw_max_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_lbw_max_ar_regs[GAUDI_NUMBER_OF_LBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_SOB_MAX_RPROT_0,
|
||||
mmDMA_IF_W_S_DMA0_MAX_RPROT_0,
|
||||
mmDMA_IF_W_S_DMA1_MAX_RPROT_0,
|
||||
mmDMA_IF_E_S_SOB_MAX_RPROT_0,
|
||||
mmDMA_IF_E_S_DMA0_MAX_RPROT_0,
|
||||
mmDMA_IF_E_S_DMA1_MAX_RPROT_0,
|
||||
mmDMA_IF_W_N_SOB_MAX_RPROT_0,
|
||||
mmDMA_IF_W_N_DMA0_MAX_RPROT_0,
|
||||
mmDMA_IF_W_N_DMA1_MAX_RPROT_0,
|
||||
mmDMA_IF_E_N_SOB_MAX_RPROT_0,
|
||||
mmDMA_IF_E_N_DMA0_MAX_RPROT_0,
|
||||
mmDMA_IF_E_N_DMA1_MAX_RPROT_0,
|
||||
mmSIF_RTR_0_LBW_RANGE_PROT_MAX_AR_0,
|
||||
|
@ -173,7 +198,7 @@ static u64 gaudi_rr_lbw_max_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_7_LBW_RANGE_PROT_MAX_AR_0,
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_hbw_hit_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_hbw_hit_aw_regs[GAUDI_NUMBER_OF_HBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_DOWN_CH0_RANGE_SEC_HIT_AW,
|
||||
mmDMA_IF_W_S_DOWN_CH1_RANGE_SEC_HIT_AW,
|
||||
mmDMA_IF_E_S_DOWN_CH0_RANGE_SEC_HIT_AW,
|
||||
|
@ -200,7 +225,7 @@ static u64 gaudi_rr_hbw_hit_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_CTRL_7_RANGE_SEC_HIT_AW
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_hbw_hit_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_hbw_hit_ar_regs[GAUDI_NUMBER_OF_HBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_DOWN_CH0_RANGE_SEC_HIT_AR,
|
||||
mmDMA_IF_W_S_DOWN_CH1_RANGE_SEC_HIT_AR,
|
||||
mmDMA_IF_E_S_DOWN_CH0_RANGE_SEC_HIT_AR,
|
||||
|
@ -227,7 +252,7 @@ static u64 gaudi_rr_hbw_hit_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_CTRL_7_RANGE_SEC_HIT_AR
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_hbw_base_low_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_hbw_base_low_aw_regs[GAUDI_NUMBER_OF_HBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_DOWN_CH0_RANGE_SEC_BASE_LOW_AW_0,
|
||||
mmDMA_IF_W_S_DOWN_CH1_RANGE_SEC_BASE_LOW_AW_0,
|
||||
mmDMA_IF_E_S_DOWN_CH0_RANGE_SEC_BASE_LOW_AW_0,
|
||||
|
@ -254,7 +279,7 @@ static u64 gaudi_rr_hbw_base_low_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_CTRL_7_RANGE_SEC_BASE_LOW_AW_0
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_hbw_base_high_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_hbw_base_high_aw_regs[GAUDI_NUMBER_OF_HBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_DOWN_CH0_RANGE_SEC_BASE_HIGH_AW_0,
|
||||
mmDMA_IF_W_S_DOWN_CH1_RANGE_SEC_BASE_HIGH_AW_0,
|
||||
mmDMA_IF_E_S_DOWN_CH0_RANGE_SEC_BASE_HIGH_AW_0,
|
||||
|
@ -281,7 +306,7 @@ static u64 gaudi_rr_hbw_base_high_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_CTRL_7_RANGE_SEC_BASE_HIGH_AW_0
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_hbw_mask_low_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_hbw_mask_low_aw_regs[GAUDI_NUMBER_OF_HBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_DOWN_CH0_RANGE_SEC_MASK_LOW_AW_0,
|
||||
mmDMA_IF_W_S_DOWN_CH1_RANGE_SEC_MASK_LOW_AW_0,
|
||||
mmDMA_IF_E_S_DOWN_CH0_RANGE_SEC_MASK_LOW_AW_0,
|
||||
|
@ -308,7 +333,7 @@ static u64 gaudi_rr_hbw_mask_low_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_CTRL_7_RANGE_SEC_MASK_LOW_AW_0
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_hbw_mask_high_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_hbw_mask_high_aw_regs[GAUDI_NUMBER_OF_HBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_DOWN_CH0_RANGE_SEC_MASK_HIGH_AW_0,
|
||||
mmDMA_IF_W_S_DOWN_CH1_RANGE_SEC_MASK_HIGH_AW_0,
|
||||
mmDMA_IF_E_S_DOWN_CH0_RANGE_SEC_MASK_HIGH_AW_0,
|
||||
|
@ -335,7 +360,7 @@ static u64 gaudi_rr_hbw_mask_high_aw_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_CTRL_7_RANGE_SEC_MASK_HIGH_AW_0
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_hbw_base_low_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_hbw_base_low_ar_regs[GAUDI_NUMBER_OF_HBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_DOWN_CH0_RANGE_SEC_BASE_LOW_AR_0,
|
||||
mmDMA_IF_W_S_DOWN_CH1_RANGE_SEC_BASE_LOW_AR_0,
|
||||
mmDMA_IF_E_S_DOWN_CH0_RANGE_SEC_BASE_LOW_AR_0,
|
||||
|
@ -362,7 +387,7 @@ static u64 gaudi_rr_hbw_base_low_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_CTRL_7_RANGE_SEC_BASE_LOW_AR_0
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_hbw_base_high_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_hbw_base_high_ar_regs[GAUDI_NUMBER_OF_HBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_DOWN_CH0_RANGE_SEC_BASE_HIGH_AR_0,
|
||||
mmDMA_IF_W_S_DOWN_CH1_RANGE_SEC_BASE_HIGH_AR_0,
|
||||
mmDMA_IF_E_S_DOWN_CH0_RANGE_SEC_BASE_HIGH_AR_0,
|
||||
|
@ -389,7 +414,7 @@ static u64 gaudi_rr_hbw_base_high_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_CTRL_7_RANGE_SEC_BASE_HIGH_AR_0
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_hbw_mask_low_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_hbw_mask_low_ar_regs[GAUDI_NUMBER_OF_HBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_DOWN_CH0_RANGE_SEC_MASK_LOW_AR_0,
|
||||
mmDMA_IF_W_S_DOWN_CH1_RANGE_SEC_MASK_LOW_AR_0,
|
||||
mmDMA_IF_E_S_DOWN_CH0_RANGE_SEC_MASK_LOW_AR_0,
|
||||
|
@ -416,7 +441,7 @@ static u64 gaudi_rr_hbw_mask_low_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
|||
mmNIF_RTR_CTRL_7_RANGE_SEC_MASK_LOW_AR_0
|
||||
};
|
||||
|
||||
static u64 gaudi_rr_hbw_mask_high_ar_regs[GAUDI_NUMBER_OF_RR_REGS] = {
|
||||
static u64 gaudi_rr_hbw_mask_high_ar_regs[GAUDI_NUMBER_OF_HBW_RR_REGS] = {
|
||||
mmDMA_IF_W_S_DOWN_CH0_RANGE_SEC_MASK_HIGH_AR_0,
|
||||
mmDMA_IF_W_S_DOWN_CH1_RANGE_SEC_MASK_HIGH_AR_0,
|
||||
mmDMA_IF_E_S_DOWN_CH0_RANGE_SEC_MASK_HIGH_AR_0,
|
||||
|
@ -12849,50 +12874,44 @@ static void gaudi_init_range_registers_lbw(struct hl_device *hdev)
|
|||
u32 lbw_rng_end[GAUDI_NUMBER_OF_LBW_RANGES];
|
||||
int i, j;
|
||||
|
||||
lbw_rng_start[0] = (0xFBFE0000 & 0x3FFFFFF) - 1;
|
||||
lbw_rng_end[0] = (0xFBFFF000 & 0x3FFFFFF) + 1;
|
||||
lbw_rng_start[0] = (0xFC0E8000 & 0x3FFFFFF) - 1; /* 0x000E7FFF */
|
||||
lbw_rng_end[0] = (0xFC11FFFF & 0x3FFFFFF) + 1; /* 0x00120000 */
|
||||
|
||||
lbw_rng_start[1] = (0xFC0E8000 & 0x3FFFFFF) - 1;
|
||||
lbw_rng_end[1] = (0xFC120000 & 0x3FFFFFF) + 1;
|
||||
lbw_rng_start[1] = (0xFC1E8000 & 0x3FFFFFF) - 1; /* 0x001E7FFF */
|
||||
lbw_rng_end[1] = (0xFC48FFFF & 0x3FFFFFF) + 1; /* 0x00490000 */
|
||||
|
||||
lbw_rng_start[2] = (0xFC1E8000 & 0x3FFFFFF) - 1;
|
||||
lbw_rng_end[2] = (0xFC48FFFF & 0x3FFFFFF) + 1;
|
||||
lbw_rng_start[2] = (0xFC600000 & 0x3FFFFFF) - 1; /* 0x005FFFFF */
|
||||
lbw_rng_end[2] = (0xFCC48FFF & 0x3FFFFFF) + 1; /* 0x00C49000 */
|
||||
|
||||
lbw_rng_start[3] = (0xFC600000 & 0x3FFFFFF) - 1;
|
||||
lbw_rng_end[3] = (0xFCC48FFF & 0x3FFFFFF) + 1;
|
||||
lbw_rng_start[3] = (0xFCC4A000 & 0x3FFFFFF) - 1; /* 0x00C49FFF */
|
||||
lbw_rng_end[3] = (0xFCCDFFFF & 0x3FFFFFF) + 1; /* 0x00CE0000 */
|
||||
|
||||
lbw_rng_start[4] = (0xFCC4A000 & 0x3FFFFFF) - 1;
|
||||
lbw_rng_end[4] = (0xFCCDFFFF & 0x3FFFFFF) + 1;
|
||||
lbw_rng_start[4] = (0xFCCE4000 & 0x3FFFFFF) - 1; /* 0x00CE3FFF */
|
||||
lbw_rng_end[4] = (0xFCD1FFFF & 0x3FFFFFF) + 1; /* 0x00D20000 */
|
||||
|
||||
lbw_rng_start[5] = (0xFCCE4000 & 0x3FFFFFF) - 1;
|
||||
lbw_rng_end[5] = (0xFCD1FFFF & 0x3FFFFFF) + 1;
|
||||
lbw_rng_start[5] = (0xFCD24000 & 0x3FFFFFF) - 1; /* 0x00D23FFF */
|
||||
lbw_rng_end[5] = (0xFCD5FFFF & 0x3FFFFFF) + 1; /* 0x00D60000 */
|
||||
|
||||
lbw_rng_start[6] = (0xFCD24000 & 0x3FFFFFF) - 1;
|
||||
lbw_rng_end[6] = (0xFCD5FFFF & 0x3FFFFFF) + 1;
|
||||
lbw_rng_start[6] = (0xFCD64000 & 0x3FFFFFF) - 1; /* 0x00D63FFF */
|
||||
lbw_rng_end[6] = (0xFCD9FFFF & 0x3FFFFFF) + 1; /* 0x00DA0000 */
|
||||
|
||||
lbw_rng_start[7] = (0xFCD64000 & 0x3FFFFFF) - 1;
|
||||
lbw_rng_end[7] = (0xFCD9FFFF & 0x3FFFFFF) + 1;
|
||||
lbw_rng_start[7] = (0xFCDA4000 & 0x3FFFFFF) - 1; /* 0x00DA3FFF */
|
||||
lbw_rng_end[7] = (0xFCDDFFFF & 0x3FFFFFF) + 1; /* 0x00DE0000 */
|
||||
|
||||
lbw_rng_start[8] = (0xFCDA4000 & 0x3FFFFFF) - 1;
|
||||
lbw_rng_end[8] = (0xFCDDFFFF & 0x3FFFFFF) + 1;
|
||||
lbw_rng_start[8] = (0xFCDE4000 & 0x3FFFFFF) - 1; /* 0x00DE3FFF */
|
||||
lbw_rng_end[8] = (0xFCE05FFF & 0x3FFFFFF) + 1; /* 0x00E06000 */
|
||||
|
||||
lbw_rng_start[9] = (0xFCDE4000 & 0x3FFFFFF) - 1;
|
||||
lbw_rng_end[9] = (0xFCE05FFF & 0x3FFFFFF) + 1;
|
||||
lbw_rng_start[9] = (0xFCFC9000 & 0x3FFFFFF) - 1; /* 0x00FC8FFF */
|
||||
lbw_rng_end[9] = (0xFFFFFFFE & 0x3FFFFFF) + 1; /* 0x03FFFFFF */
|
||||
|
||||
lbw_rng_start[10] = (0xFEC43000 & 0x3FFFFFF) - 1;
|
||||
lbw_rng_end[10] = (0xFEC43FFF & 0x3FFFFFF) + 1;
|
||||
|
||||
lbw_rng_start[11] = (0xFE484000 & 0x3FFFFFF) - 1;
|
||||
lbw_rng_end[11] = (0xFE484FFF & 0x3FFFFFF) + 1;
|
||||
|
||||
for (i = 0 ; i < GAUDI_NUMBER_OF_RR_REGS ; i++) {
|
||||
for (i = 0 ; i < GAUDI_NUMBER_OF_LBW_RR_REGS ; i++) {
|
||||
WREG32(gaudi_rr_lbw_hit_aw_regs[i],
|
||||
(1 << GAUDI_NUMBER_OF_LBW_RANGES) - 1);
|
||||
WREG32(gaudi_rr_lbw_hit_ar_regs[i],
|
||||
(1 << GAUDI_NUMBER_OF_LBW_RANGES) - 1);
|
||||
}
|
||||
|
||||
for (i = 0 ; i < GAUDI_NUMBER_OF_RR_REGS ; i++)
|
||||
for (i = 0 ; i < GAUDI_NUMBER_OF_LBW_RR_REGS ; i++)
|
||||
for (j = 0 ; j < GAUDI_NUMBER_OF_LBW_RANGES ; j++) {
|
||||
WREG32(gaudi_rr_lbw_min_aw_regs[i] + (j << 2),
|
||||
lbw_rng_start[j]);
|
||||
|
@ -12939,12 +12958,12 @@ static void gaudi_init_range_registers_hbw(struct hl_device *hdev)
|
|||
* 6th range is the host
|
||||
*/
|
||||
|
||||
for (i = 0 ; i < GAUDI_NUMBER_OF_RR_REGS ; i++) {
|
||||
for (i = 0 ; i < GAUDI_NUMBER_OF_HBW_RR_REGS ; i++) {
|
||||
WREG32(gaudi_rr_hbw_hit_aw_regs[i], 0x1F);
|
||||
WREG32(gaudi_rr_hbw_hit_ar_regs[i], 0x1D);
|
||||
}
|
||||
|
||||
for (i = 0 ; i < GAUDI_NUMBER_OF_RR_REGS ; i++) {
|
||||
for (i = 0 ; i < GAUDI_NUMBER_OF_HBW_RR_REGS ; i++) {
|
||||
WREG32(gaudi_rr_hbw_base_low_aw_regs[i], dram_addr_lo);
|
||||
WREG32(gaudi_rr_hbw_base_low_ar_regs[i], dram_addr_lo);
|
||||
|
||||
|
|
|
@ -308,6 +308,8 @@
|
|||
#define mmPCIE_AUX_FLR_CTRL 0xC07394
|
||||
#define mmPCIE_AUX_DBI 0xC07490
|
||||
|
||||
#define mmPCIE_CORE_MSI_REQ 0xC04100
|
||||
|
||||
#define mmPSOC_PCI_PLL_NR 0xC72100
|
||||
#define mmSRAM_W_PLL_NR 0x4C8100
|
||||
#define mmPSOC_HBM_PLL_NR 0xC74100
|
||||
|
|
|
@ -351,9 +351,25 @@ static int b53_mdio_probe(struct mdio_device *mdiodev)
|
|||
static void b53_mdio_remove(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct b53_device *dev = dev_get_drvdata(&mdiodev->dev);
|
||||
struct dsa_switch *ds = dev->ds;
|
||||
|
||||
dsa_unregister_switch(ds);
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
b53_switch_remove(dev);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static void b53_mdio_shutdown(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct b53_device *dev = dev_get_drvdata(&mdiodev->dev);
|
||||
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
b53_switch_shutdown(dev);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id b53_of_match[] = {
|
||||
|
@ -373,6 +389,7 @@ MODULE_DEVICE_TABLE(of, b53_of_match);
|
|||
static struct mdio_driver b53_mdio_driver = {
|
||||
.probe = b53_mdio_probe,
|
||||
.remove = b53_mdio_remove,
|
||||
.shutdown = b53_mdio_shutdown,
|
||||
.mdiodrv.driver = {
|
||||
.name = "bcm53xx",
|
||||
.of_match_table = b53_of_match,
|
||||
|
|
|
@ -316,9 +316,21 @@ static int b53_mmap_remove(struct platform_device *pdev)
|
|||
if (dev)
|
||||
b53_switch_remove(dev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void b53_mmap_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct b53_device *dev = platform_get_drvdata(pdev);
|
||||
|
||||
if (dev)
|
||||
b53_switch_shutdown(dev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id b53_mmap_of_table[] = {
|
||||
{ .compatible = "brcm,bcm3384-switch" },
|
||||
{ .compatible = "brcm,bcm6328-switch" },
|
||||
|
@ -331,6 +343,7 @@ MODULE_DEVICE_TABLE(of, b53_mmap_of_table);
|
|||
static struct platform_driver b53_mmap_driver = {
|
||||
.probe = b53_mmap_probe,
|
||||
.remove = b53_mmap_remove,
|
||||
.shutdown = b53_mmap_shutdown,
|
||||
.driver = {
|
||||
.name = "b53-switch",
|
||||
.of_match_table = b53_mmap_of_table,
|
||||
|
|
|
@ -228,6 +228,11 @@ static inline void b53_switch_remove(struct b53_device *dev)
|
|||
dsa_unregister_switch(dev->ds);
|
||||
}
|
||||
|
||||
static inline void b53_switch_shutdown(struct b53_device *dev)
|
||||
{
|
||||
dsa_switch_shutdown(dev->ds);
|
||||
}
|
||||
|
||||
#define b53_build_op(type_op_size, val_type) \
|
||||
static inline int b53_##type_op_size(struct b53_device *dev, u8 page, \
|
||||
u8 reg, val_type val) \
|
||||
|
|
|
@ -321,9 +321,21 @@ static int b53_spi_remove(struct spi_device *spi)
|
|||
if (dev)
|
||||
b53_switch_remove(dev);
|
||||
|
||||
spi_set_drvdata(spi, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void b53_spi_shutdown(struct spi_device *spi)
|
||||
{
|
||||
struct b53_device *dev = spi_get_drvdata(spi);
|
||||
|
||||
if (dev)
|
||||
b53_switch_shutdown(dev);
|
||||
|
||||
spi_set_drvdata(spi, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id b53_spi_of_match[] = {
|
||||
{ .compatible = "brcm,bcm5325" },
|
||||
{ .compatible = "brcm,bcm5365" },
|
||||
|
@ -344,6 +356,7 @@ static struct spi_driver b53_spi_driver = {
|
|||
},
|
||||
.probe = b53_spi_probe,
|
||||
.remove = b53_spi_remove,
|
||||
.shutdown = b53_spi_shutdown,
|
||||
};
|
||||
|
||||
module_spi_driver(b53_spi_driver);
|
||||
|
|
|
@ -629,17 +629,34 @@ static int b53_srab_probe(struct platform_device *pdev)
|
|||
static int b53_srab_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct b53_device *dev = platform_get_drvdata(pdev);
|
||||
struct b53_srab_priv *priv = dev->priv;
|
||||
|
||||
b53_srab_intr_set(priv, false);
|
||||
if (!dev)
|
||||
return 0;
|
||||
|
||||
b53_srab_intr_set(dev->priv, false);
|
||||
b53_switch_remove(dev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void b53_srab_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct b53_device *dev = platform_get_drvdata(pdev);
|
||||
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
b53_switch_shutdown(dev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
static struct platform_driver b53_srab_driver = {
|
||||
.probe = b53_srab_probe,
|
||||
.remove = b53_srab_remove,
|
||||
.shutdown = b53_srab_shutdown,
|
||||
.driver = {
|
||||
.name = "b53-srab-switch",
|
||||
.of_match_table = b53_srab_of_match,
|
||||
|
|
|
@ -68,7 +68,7 @@ static unsigned int bcm_sf2_num_active_ports(struct dsa_switch *ds)
|
|||
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
|
||||
unsigned int port, count = 0;
|
||||
|
||||
for (port = 0; port < ARRAY_SIZE(priv->port_sts); port++) {
|
||||
for (port = 0; port < ds->num_ports; port++) {
|
||||
if (dsa_is_cpu_port(ds, port))
|
||||
continue;
|
||||
if (priv->port_sts[port].enabled)
|
||||
|
@ -1512,6 +1512,9 @@ static int bcm_sf2_sw_remove(struct platform_device *pdev)
|
|||
{
|
||||
struct bcm_sf2_priv *priv = platform_get_drvdata(pdev);
|
||||
|
||||
if (!priv)
|
||||
return 0;
|
||||
|
||||
priv->wol_ports_mask = 0;
|
||||
/* Disable interrupts */
|
||||
bcm_sf2_intr_disable(priv);
|
||||
|
@ -1523,6 +1526,8 @@ static int bcm_sf2_sw_remove(struct platform_device *pdev)
|
|||
if (priv->type == BCM7278_DEVICE_ID)
|
||||
reset_control_assert(priv->rcdev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1530,6 +1535,9 @@ static void bcm_sf2_sw_shutdown(struct platform_device *pdev)
|
|||
{
|
||||
struct bcm_sf2_priv *priv = platform_get_drvdata(pdev);
|
||||
|
||||
if (!priv)
|
||||
return;
|
||||
|
||||
/* For a kernel about to be kexec'd we want to keep the GPHY on for a
|
||||
* successful MDIO bus scan to occur. If we did turn off the GPHY
|
||||
* before (e.g: port_disable), this will also power it back on.
|
||||
|
@ -1538,6 +1546,10 @@ static void bcm_sf2_sw_shutdown(struct platform_device *pdev)
|
|||
*/
|
||||
if (priv->hw_params.num_gphy == 1)
|
||||
bcm_sf2_gphy_enable_set(priv->dev->ds, true);
|
||||
|
||||
dsa_switch_shutdown(priv->dev->ds);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
|
|
@ -340,10 +340,29 @@ static int dsa_loop_drv_probe(struct mdio_device *mdiodev)
|
|||
static void dsa_loop_drv_remove(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev);
|
||||
struct dsa_loop_priv *ps = ds->priv;
|
||||
struct dsa_loop_priv *ps;
|
||||
|
||||
if (!ds)
|
||||
return;
|
||||
|
||||
ps = ds->priv;
|
||||
|
||||
dsa_unregister_switch(ds);
|
||||
dev_put(ps->netdev);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static void dsa_loop_drv_shutdown(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev);
|
||||
|
||||
if (!ds)
|
||||
return;
|
||||
|
||||
dsa_switch_shutdown(ds);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static struct mdio_driver dsa_loop_drv = {
|
||||
|
@ -352,6 +371,7 @@ static struct mdio_driver dsa_loop_drv = {
|
|||
},
|
||||
.probe = dsa_loop_drv_probe,
|
||||
.remove = dsa_loop_drv_remove,
|
||||
.shutdown = dsa_loop_drv_shutdown,
|
||||
};
|
||||
|
||||
#define NUM_FIXED_PHYS (DSA_LOOP_NUM_PORTS - 2)
|
||||
|
|
|
@ -1916,6 +1916,9 @@ static int hellcreek_remove(struct platform_device *pdev)
|
|||
{
|
||||
struct hellcreek *hellcreek = platform_get_drvdata(pdev);
|
||||
|
||||
if (!hellcreek)
|
||||
return 0;
|
||||
|
||||
hellcreek_hwtstamp_free(hellcreek);
|
||||
hellcreek_ptp_free(hellcreek);
|
||||
dsa_unregister_switch(hellcreek->ds);
|
||||
|
@ -1924,6 +1927,18 @@ static int hellcreek_remove(struct platform_device *pdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void hellcreek_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct hellcreek *hellcreek = platform_get_drvdata(pdev);
|
||||
|
||||
if (!hellcreek)
|
||||
return;
|
||||
|
||||
dsa_switch_shutdown(hellcreek->ds);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
static const struct hellcreek_platform_data de1soc_r1_pdata = {
|
||||
.name = "r4c30",
|
||||
.num_ports = 4,
|
||||
|
@ -1946,6 +1961,7 @@ MODULE_DEVICE_TABLE(of, hellcreek_of_match);
|
|||
static struct platform_driver hellcreek_driver = {
|
||||
.probe = hellcreek_probe,
|
||||
.remove = hellcreek_remove,
|
||||
.shutdown = hellcreek_shutdown,
|
||||
.driver = {
|
||||
.name = "hellcreek",
|
||||
.of_match_table = hellcreek_of_match,
|
||||
|
|
|
@ -1379,6 +1379,12 @@ int lan9303_remove(struct lan9303 *chip)
|
|||
}
|
||||
EXPORT_SYMBOL(lan9303_remove);
|
||||
|
||||
void lan9303_shutdown(struct lan9303 *chip)
|
||||
{
|
||||
dsa_switch_shutdown(chip->ds);
|
||||
}
|
||||
EXPORT_SYMBOL(lan9303_shutdown);
|
||||
|
||||
MODULE_AUTHOR("Juergen Borleis <kernel@pengutronix.de>");
|
||||
MODULE_DESCRIPTION("Core driver for SMSC/Microchip LAN9303 three port ethernet switch");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
|
|
@ -10,3 +10,4 @@ extern const struct lan9303_phy_ops lan9303_indirect_phy_ops;
|
|||
|
||||
int lan9303_probe(struct lan9303 *chip, struct device_node *np);
|
||||
int lan9303_remove(struct lan9303 *chip);
|
||||
void lan9303_shutdown(struct lan9303 *chip);
|
||||
|
|
|
@ -67,13 +67,28 @@ static int lan9303_i2c_probe(struct i2c_client *client,
|
|||
|
||||
static int lan9303_i2c_remove(struct i2c_client *client)
|
||||
{
|
||||
struct lan9303_i2c *sw_dev;
|
||||
struct lan9303_i2c *sw_dev = i2c_get_clientdata(client);
|
||||
|
||||
sw_dev = i2c_get_clientdata(client);
|
||||
if (!sw_dev)
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
|
||||
return lan9303_remove(&sw_dev->chip);
|
||||
lan9303_remove(&sw_dev->chip);
|
||||
|
||||
i2c_set_clientdata(client, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void lan9303_i2c_shutdown(struct i2c_client *client)
|
||||
{
|
||||
struct lan9303_i2c *sw_dev = i2c_get_clientdata(client);
|
||||
|
||||
if (!sw_dev)
|
||||
return;
|
||||
|
||||
lan9303_shutdown(&sw_dev->chip);
|
||||
|
||||
i2c_set_clientdata(client, NULL);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
@ -97,6 +112,7 @@ static struct i2c_driver lan9303_i2c_driver = {
|
|||
},
|
||||
.probe = lan9303_i2c_probe,
|
||||
.remove = lan9303_i2c_remove,
|
||||
.shutdown = lan9303_i2c_shutdown,
|
||||
.id_table = lan9303_i2c_id,
|
||||
};
|
||||
module_i2c_driver(lan9303_i2c_driver);
|
||||
|
|
|
@ -138,6 +138,20 @@ static void lan9303_mdio_remove(struct mdio_device *mdiodev)
|
|||
return;
|
||||
|
||||
lan9303_remove(&sw_dev->chip);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static void lan9303_mdio_shutdown(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct lan9303_mdio *sw_dev = dev_get_drvdata(&mdiodev->dev);
|
||||
|
||||
if (!sw_dev)
|
||||
return;
|
||||
|
||||
lan9303_shutdown(&sw_dev->chip);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
@ -155,6 +169,7 @@ static struct mdio_driver lan9303_mdio_driver = {
|
|||
},
|
||||
.probe = lan9303_mdio_probe,
|
||||
.remove = lan9303_mdio_remove,
|
||||
.shutdown = lan9303_mdio_shutdown,
|
||||
};
|
||||
mdio_module_driver(lan9303_mdio_driver);
|
||||
|
||||
|
|
|
@ -2184,6 +2184,9 @@ static int gswip_remove(struct platform_device *pdev)
|
|||
struct gswip_priv *priv = platform_get_drvdata(pdev);
|
||||
int i;
|
||||
|
||||
if (!priv)
|
||||
return 0;
|
||||
|
||||
/* disable the switch */
|
||||
gswip_mdio_mask(priv, GSWIP_MDIO_GLOB_ENABLE, 0, GSWIP_MDIO_GLOB);
|
||||
|
||||
|
@ -2197,9 +2200,23 @@ static int gswip_remove(struct platform_device *pdev)
|
|||
for (i = 0; i < priv->num_gphy_fw; i++)
|
||||
gswip_gphy_fw_remove(priv, &priv->gphy_fw[i]);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gswip_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct gswip_priv *priv = platform_get_drvdata(pdev);
|
||||
|
||||
if (!priv)
|
||||
return;
|
||||
|
||||
dsa_switch_shutdown(priv->ds);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
static const struct gswip_hw_info gswip_xrx200 = {
|
||||
.max_ports = 7,
|
||||
.cpu_port = 6,
|
||||
|
@ -2223,6 +2240,7 @@ MODULE_DEVICE_TABLE(of, gswip_of_match);
|
|||
static struct platform_driver gswip_driver = {
|
||||
.probe = gswip_probe,
|
||||
.remove = gswip_remove,
|
||||
.shutdown = gswip_shutdown,
|
||||
.driver = {
|
||||
.name = "gswip",
|
||||
.of_match_table = gswip_of_match,
|
||||
|
|
|
@ -94,6 +94,8 @@ static int ksz8795_spi_remove(struct spi_device *spi)
|
|||
if (dev)
|
||||
ksz_switch_remove(dev);
|
||||
|
||||
spi_set_drvdata(spi, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -101,8 +103,15 @@ static void ksz8795_spi_shutdown(struct spi_device *spi)
|
|||
{
|
||||
struct ksz_device *dev = spi_get_drvdata(spi);
|
||||
|
||||
if (dev && dev->dev_ops->shutdown)
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
if (dev->dev_ops->shutdown)
|
||||
dev->dev_ops->shutdown(dev);
|
||||
|
||||
dsa_switch_shutdown(dev->ds);
|
||||
|
||||
spi_set_drvdata(spi, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id ksz8795_dt_ids[] = {
|
||||
|
|
|
@ -191,6 +191,18 @@ static void ksz8863_smi_remove(struct mdio_device *mdiodev)
|
|||
|
||||
if (dev)
|
||||
ksz_switch_remove(dev);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static void ksz8863_smi_shutdown(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct ksz_device *dev = dev_get_drvdata(&mdiodev->dev);
|
||||
|
||||
if (dev)
|
||||
dsa_switch_shutdown(dev->ds);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id ksz8863_dt_ids[] = {
|
||||
|
@ -203,6 +215,7 @@ MODULE_DEVICE_TABLE(of, ksz8863_dt_ids);
|
|||
static struct mdio_driver ksz8863_driver = {
|
||||
.probe = ksz8863_smi_probe,
|
||||
.remove = ksz8863_smi_remove,
|
||||
.shutdown = ksz8863_smi_shutdown,
|
||||
.mdiodrv.driver = {
|
||||
.name = "ksz8863-switch",
|
||||
.of_match_table = ksz8863_dt_ids,
|
||||
|
|
|
@ -56,7 +56,10 @@ static int ksz9477_i2c_remove(struct i2c_client *i2c)
|
|||
{
|
||||
struct ksz_device *dev = i2c_get_clientdata(i2c);
|
||||
|
||||
ksz_switch_remove(dev);
|
||||
if (dev)
|
||||
ksz_switch_remove(dev);
|
||||
|
||||
i2c_set_clientdata(i2c, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -65,8 +68,15 @@ static void ksz9477_i2c_shutdown(struct i2c_client *i2c)
|
|||
{
|
||||
struct ksz_device *dev = i2c_get_clientdata(i2c);
|
||||
|
||||
if (dev && dev->dev_ops->shutdown)
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
if (dev->dev_ops->shutdown)
|
||||
dev->dev_ops->shutdown(dev);
|
||||
|
||||
dsa_switch_shutdown(dev->ds);
|
||||
|
||||
i2c_set_clientdata(i2c, NULL);
|
||||
}
|
||||
|
||||
static const struct i2c_device_id ksz9477_i2c_id[] = {
|
||||
|
|
|
@ -72,6 +72,8 @@ static int ksz9477_spi_remove(struct spi_device *spi)
|
|||
if (dev)
|
||||
ksz_switch_remove(dev);
|
||||
|
||||
spi_set_drvdata(spi, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -79,8 +81,10 @@ static void ksz9477_spi_shutdown(struct spi_device *spi)
|
|||
{
|
||||
struct ksz_device *dev = spi_get_drvdata(spi);
|
||||
|
||||
if (dev && dev->dev_ops->shutdown)
|
||||
dev->dev_ops->shutdown(dev);
|
||||
if (dev)
|
||||
dsa_switch_shutdown(dev->ds);
|
||||
|
||||
spi_set_drvdata(spi, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id ksz9477_dt_ids[] = {
|
||||
|
|
|
@ -3286,6 +3286,9 @@ mt7530_remove(struct mdio_device *mdiodev)
|
|||
struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev);
|
||||
int ret = 0;
|
||||
|
||||
if (!priv)
|
||||
return;
|
||||
|
||||
ret = regulator_disable(priv->core_pwr);
|
||||
if (ret < 0)
|
||||
dev_err(priv->dev,
|
||||
|
@ -3301,11 +3304,26 @@ mt7530_remove(struct mdio_device *mdiodev)
|
|||
|
||||
dsa_unregister_switch(priv->ds);
|
||||
mutex_destroy(&priv->reg_mutex);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static void mt7530_shutdown(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev);
|
||||
|
||||
if (!priv)
|
||||
return;
|
||||
|
||||
dsa_switch_shutdown(priv->ds);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static struct mdio_driver mt7530_mdio_driver = {
|
||||
.probe = mt7530_probe,
|
||||
.remove = mt7530_remove,
|
||||
.shutdown = mt7530_shutdown,
|
||||
.mdiodrv.driver = {
|
||||
.name = "mt7530",
|
||||
.of_match_table = mt7530_of_match,
|
||||
|
|
|
@ -290,7 +290,24 @@ static void mv88e6060_remove(struct mdio_device *mdiodev)
|
|||
{
|
||||
struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev);
|
||||
|
||||
if (!ds)
|
||||
return;
|
||||
|
||||
dsa_unregister_switch(ds);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static void mv88e6060_shutdown(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev);
|
||||
|
||||
if (!ds)
|
||||
return;
|
||||
|
||||
dsa_switch_shutdown(ds);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id mv88e6060_of_match[] = {
|
||||
|
@ -303,6 +320,7 @@ static const struct of_device_id mv88e6060_of_match[] = {
|
|||
static struct mdio_driver mv88e6060_driver = {
|
||||
.probe = mv88e6060_probe,
|
||||
.remove = mv88e6060_remove,
|
||||
.shutdown = mv88e6060_shutdown,
|
||||
.mdiodrv.driver = {
|
||||
.name = "mv88e6060",
|
||||
.of_match_table = mv88e6060_of_match,
|
||||
|
|
|
@ -3071,7 +3071,7 @@ static void mv88e6xxx_teardown(struct dsa_switch *ds)
|
|||
{
|
||||
mv88e6xxx_teardown_devlink_params(ds);
|
||||
dsa_devlink_resources_unregister(ds);
|
||||
mv88e6xxx_teardown_devlink_regions(ds);
|
||||
mv88e6xxx_teardown_devlink_regions_global(ds);
|
||||
}
|
||||
|
||||
static int mv88e6xxx_setup(struct dsa_switch *ds)
|
||||
|
@ -3215,7 +3215,7 @@ unlock:
|
|||
if (err)
|
||||
goto out_resources;
|
||||
|
||||
err = mv88e6xxx_setup_devlink_regions(ds);
|
||||
err = mv88e6xxx_setup_devlink_regions_global(ds);
|
||||
if (err)
|
||||
goto out_params;
|
||||
|
||||
|
@ -3229,6 +3229,16 @@ out_resources:
|
|||
return err;
|
||||
}
|
||||
|
||||
static int mv88e6xxx_port_setup(struct dsa_switch *ds, int port)
|
||||
{
|
||||
return mv88e6xxx_setup_devlink_regions_port(ds, port);
|
||||
}
|
||||
|
||||
static void mv88e6xxx_port_teardown(struct dsa_switch *ds, int port)
|
||||
{
|
||||
mv88e6xxx_teardown_devlink_regions_port(ds, port);
|
||||
}
|
||||
|
||||
/* prod_id for switch families which do not have a PHY model number */
|
||||
static const u16 family_prod_id_table[] = {
|
||||
[MV88E6XXX_FAMILY_6341] = MV88E6XXX_PORT_SWITCH_ID_PROD_6341,
|
||||
|
@ -6116,6 +6126,8 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
|
|||
.change_tag_protocol = mv88e6xxx_change_tag_protocol,
|
||||
.setup = mv88e6xxx_setup,
|
||||
.teardown = mv88e6xxx_teardown,
|
||||
.port_setup = mv88e6xxx_port_setup,
|
||||
.port_teardown = mv88e6xxx_port_teardown,
|
||||
.phylink_validate = mv88e6xxx_validate,
|
||||
.phylink_mac_link_state = mv88e6xxx_serdes_pcs_get_state,
|
||||
.phylink_mac_config = mv88e6xxx_mac_config,
|
||||
|
@ -6389,7 +6401,12 @@ out:
|
|||
static void mv88e6xxx_remove(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev);
|
||||
struct mv88e6xxx_chip *chip = ds->priv;
|
||||
struct mv88e6xxx_chip *chip;
|
||||
|
||||
if (!ds)
|
||||
return;
|
||||
|
||||
chip = ds->priv;
|
||||
|
||||
if (chip->info->ptp_support) {
|
||||
mv88e6xxx_hwtstamp_free(chip);
|
||||
|
@ -6410,6 +6427,20 @@ static void mv88e6xxx_remove(struct mdio_device *mdiodev)
|
|||
mv88e6xxx_g1_irq_free(chip);
|
||||
else
|
||||
mv88e6xxx_irq_poll_free(chip);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static void mv88e6xxx_shutdown(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev);
|
||||
|
||||
if (!ds)
|
||||
return;
|
||||
|
||||
dsa_switch_shutdown(ds);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id mv88e6xxx_of_match[] = {
|
||||
|
@ -6433,6 +6464,7 @@ MODULE_DEVICE_TABLE(of, mv88e6xxx_of_match);
|
|||
static struct mdio_driver mv88e6xxx_driver = {
|
||||
.probe = mv88e6xxx_probe,
|
||||
.remove = mv88e6xxx_remove,
|
||||
.shutdown = mv88e6xxx_shutdown,
|
||||
.mdiodrv.driver = {
|
||||
.name = "mv88e6085",
|
||||
.of_match_table = mv88e6xxx_of_match,
|
||||
|
|
|
@ -647,26 +647,25 @@ static struct mv88e6xxx_region mv88e6xxx_regions[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static void
|
||||
mv88e6xxx_teardown_devlink_regions_global(struct mv88e6xxx_chip *chip)
|
||||
void mv88e6xxx_teardown_devlink_regions_global(struct dsa_switch *ds)
|
||||
{
|
||||
struct mv88e6xxx_chip *chip = ds->priv;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(mv88e6xxx_regions); i++)
|
||||
dsa_devlink_region_destroy(chip->regions[i]);
|
||||
}
|
||||
|
||||
static void
|
||||
mv88e6xxx_teardown_devlink_regions_port(struct mv88e6xxx_chip *chip,
|
||||
int port)
|
||||
void mv88e6xxx_teardown_devlink_regions_port(struct dsa_switch *ds, int port)
|
||||
{
|
||||
struct mv88e6xxx_chip *chip = ds->priv;
|
||||
|
||||
dsa_devlink_region_destroy(chip->ports[port].region);
|
||||
}
|
||||
|
||||
static int mv88e6xxx_setup_devlink_regions_port(struct dsa_switch *ds,
|
||||
struct mv88e6xxx_chip *chip,
|
||||
int port)
|
||||
int mv88e6xxx_setup_devlink_regions_port(struct dsa_switch *ds, int port)
|
||||
{
|
||||
struct mv88e6xxx_chip *chip = ds->priv;
|
||||
struct devlink_region *region;
|
||||
|
||||
region = dsa_devlink_port_region_create(ds,
|
||||
|
@ -681,40 +680,10 @@ static int mv88e6xxx_setup_devlink_regions_port(struct dsa_switch *ds,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
mv88e6xxx_teardown_devlink_regions_ports(struct mv88e6xxx_chip *chip)
|
||||
{
|
||||
int port;
|
||||
|
||||
for (port = 0; port < mv88e6xxx_num_ports(chip); port++)
|
||||
mv88e6xxx_teardown_devlink_regions_port(chip, port);
|
||||
}
|
||||
|
||||
static int mv88e6xxx_setup_devlink_regions_ports(struct dsa_switch *ds,
|
||||
struct mv88e6xxx_chip *chip)
|
||||
{
|
||||
int port;
|
||||
int err;
|
||||
|
||||
for (port = 0; port < mv88e6xxx_num_ports(chip); port++) {
|
||||
err = mv88e6xxx_setup_devlink_regions_port(ds, chip, port);
|
||||
if (err)
|
||||
goto out;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
while (port-- > 0)
|
||||
mv88e6xxx_teardown_devlink_regions_port(chip, port);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mv88e6xxx_setup_devlink_regions_global(struct dsa_switch *ds,
|
||||
struct mv88e6xxx_chip *chip)
|
||||
int mv88e6xxx_setup_devlink_regions_global(struct dsa_switch *ds)
|
||||
{
|
||||
bool (*cond)(struct mv88e6xxx_chip *chip);
|
||||
struct mv88e6xxx_chip *chip = ds->priv;
|
||||
struct devlink_region_ops *ops;
|
||||
struct devlink_region *region;
|
||||
u64 size;
|
||||
|
@ -753,30 +722,6 @@ out:
|
|||
return PTR_ERR(region);
|
||||
}
|
||||
|
||||
int mv88e6xxx_setup_devlink_regions(struct dsa_switch *ds)
|
||||
{
|
||||
struct mv88e6xxx_chip *chip = ds->priv;
|
||||
int err;
|
||||
|
||||
err = mv88e6xxx_setup_devlink_regions_global(ds, chip);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = mv88e6xxx_setup_devlink_regions_ports(ds, chip);
|
||||
if (err)
|
||||
mv88e6xxx_teardown_devlink_regions_global(chip);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
void mv88e6xxx_teardown_devlink_regions(struct dsa_switch *ds)
|
||||
{
|
||||
struct mv88e6xxx_chip *chip = ds->priv;
|
||||
|
||||
mv88e6xxx_teardown_devlink_regions_ports(chip);
|
||||
mv88e6xxx_teardown_devlink_regions_global(chip);
|
||||
}
|
||||
|
||||
int mv88e6xxx_devlink_info_get(struct dsa_switch *ds,
|
||||
struct devlink_info_req *req,
|
||||
struct netlink_ext_ack *extack)
|
||||
|
|
|
@ -12,8 +12,10 @@ int mv88e6xxx_devlink_param_get(struct dsa_switch *ds, u32 id,
|
|||
struct devlink_param_gset_ctx *ctx);
|
||||
int mv88e6xxx_devlink_param_set(struct dsa_switch *ds, u32 id,
|
||||
struct devlink_param_gset_ctx *ctx);
|
||||
int mv88e6xxx_setup_devlink_regions(struct dsa_switch *ds);
|
||||
void mv88e6xxx_teardown_devlink_regions(struct dsa_switch *ds);
|
||||
int mv88e6xxx_setup_devlink_regions_global(struct dsa_switch *ds);
|
||||
void mv88e6xxx_teardown_devlink_regions_global(struct dsa_switch *ds);
|
||||
int mv88e6xxx_setup_devlink_regions_port(struct dsa_switch *ds, int port);
|
||||
void mv88e6xxx_teardown_devlink_regions_port(struct dsa_switch *ds, int port);
|
||||
|
||||
int mv88e6xxx_devlink_info_get(struct dsa_switch *ds,
|
||||
struct devlink_info_req *req,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright 2019-2021 NXP Semiconductors
|
||||
/* Copyright 2019-2021 NXP
|
||||
*
|
||||
* This is an umbrella module for all network switches that are
|
||||
* register-compatible with Ocelot and that perform I/O to their host CPU
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/* Copyright 2019 NXP Semiconductors
|
||||
/* Copyright 2019 NXP
|
||||
*/
|
||||
#ifndef _MSCC_FELIX_H
|
||||
#define _MSCC_FELIX_H
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue