Re: [PATCH] mips: kdump: Crash kernel should be able to see old memories

2021-04-19 Thread Youling Tang
Hi, Jiaxun On 04/20/2021 09:11 AM, Jiaxun Yang wrote: 在 2021/4/19 18:56, Youling Tang 写道: From: Huacai Chen kexec-tools use mem=X@Y to pass usable memories to crash kernel, but in commit a94e4f24ec836c8984f83959 ("MIPS: init: Drop boot_mem_map") all BIOS passed memories a

Re: [PATCH] MIPS: Fix cmdline "mem=" parameter parsing

2021-04-19 Thread Youling Tang
Hi, Jiaxun On 04/20/2021 09:05 AM, Jiaxun Yang wrote: 在 2021/4/19 18:50, Youling Tang 写道: This problem may only occur on NUMA platforms. When machine start with the "mem=" parameter on Loongson64, it cannot boot. When parsing the "mem=" parameter, first remove all RAM,

[PATCH] mips: kdump: Crash kernel should be able to see old memories

2021-04-19 Thread Youling Tang
ash kernel, because a crash kernel should be able to see all old memories, even though it is not supposed to use them. Fixes: a94e4f24ec836c8984f83959 ("MIPS: init: Drop boot_mem_map") Signed-off-by: Huacai Chen Signed-off-by: Youling Tang --- arch/mips/kernel/setup.c | 2 ++ 1 file changed, 2

[PATCH] MIPS: Fix cmdline "mem=" parameter parsing

2021-04-19 Thread Youling Tang
add it to the corresponding node through memblock_add_node(). Signed-off-by: Jinyang He Signed-off-by: Youling Tang --- arch/mips/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 279be01..b86e241 100644 --- a/

[PATCH 2/2] MIPS: kdump: Provide arch_kexec_protect(unprotect)_crashkres()

2021-04-16 Thread Youling Tang
ystem call related to kdump is made. This arch_kexec_unprotect_crashkres() will undo the protection of the reserved memory. Signed-off-by: Youling Tang --- arch/mips/kernel/machine_kexec.c | 40 1 file changed, 40 insertions(+) diff --git a/arch/m

[PATCH 1/2] MIPS: mm: Add ARCH_HAS_SET_MEMORY support

2021-04-16 Thread Youling Tang
/set_memory.h). Signed-off-by: Youling Tang --- arch/mips/Kconfig | 1 + arch/mips/include/asm/set_memory.h | 19 + arch/mips/mm/Makefile | 1 + arch/mips/mm/pageattr.c| 157 + 4 files changed, 178 insertions

[PATCH] MIPS: pgtable: Add swp pte related macros definition and check

2021-04-14 Thread Youling Tang
Add definitions for the bit masks/shifts/sizes, and implement MAX_SWAPFILES_CHECK() such that we fail to build if we are unable to properly encode the swp type field. Signed-off-by: Youling Tang --- arch/mips/include/asm/pgtable-32.h | 32 arch/mips/include/asm

[PATCH v4] MIPS: Loongson64: Add kexec/kdump support

2021-04-13 Thread Youling Tang
cond MB, the second 64K, KEXEC data Cc: Eric Biederman Tested-by: Jinyang He Signed-off-by: Huacai Chen Signed-off-by: Jinyang He Signed-off-by: Youling Tang --- v3 -> v4: - Use the macro kexec_smp_wait_final and move the platform-specific code into the kernel-entry-init.h file. This su

Re: [PATCH] staging: fix ignoring return value warning

2021-02-08 Thread Youling Tang
Hi, Dan On 02/09/2021 03:02 AM, Dan Carpenter wrote: On Mon, Feb 08, 2021 at 04:06:18PM +0100, Sascha Hauer wrote: Hi Dan, On Mon, Feb 08, 2021 at 04:45:17PM +0300, Dan Carpenter wrote: On Sun, Feb 07, 2021 at 05:23:28PM +0800, Youling Tang wrote: Fix the below ignoring return value

[PATCH] staging: fix ignoring return value warning

2021-02-07 Thread Youling Tang
ink-gdma/ralink-gdma.c:836:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result] device_reset(>dev); ^~~~ ~~ Signed-off-by: Youling Tang --- drivers/staging/mt7621-dma/mtk-hsdma.c| 6 +- drivers/s

[PATCH v2] MIPS: crash_dump.c: Simplify copy_oldmem_page()

2021-02-06 Thread Youling Tang
Replace kmap_atomic_pfn() with kmap_local_pfn() which is preemptible and can take page faults. Remove the indirection of the dump page and the related cruft which is not longer required. Remove unused or redundant header files. Reported-by: kernel test robot Signed-off-by: Youling Tang

[PATCH] MIPS: crash_dump.c: Simplify copy_oldmem_page()

2021-02-05 Thread Youling Tang
Replace kmap_atomic_pfn() with kmap_local_pfn() which is preemptible and can take page faults. Remove the indirection of the dump page and the related cruft which is not longer required. Remove unused or redundant header files. Signed-off-by: Youling Tang --- arch/mips/kernel/crash_dump.c

[PATCH v3] i2c: ismt: Use dma_set_mask_and_coherent

2020-12-02 Thread Youling Tang
'pci_set_dma_mask()' + 'pci_set_consistent_dma_mask()' can be replaced by an equivalent 'dma_set_mask_and_coherent()' which is much less verbose. Reported-by: kernel test robot Signed-off-by: Youling Tang --- v3: Fix build errors of incompatible pointer types. drivers/i2c/busses/i2c-ismt.c

[PATCH v2] i2c: ismt: Use dma_set_mask_and_coherent

2020-12-02 Thread Youling Tang
'pci_set_dma_mask()' + 'pci_set_consistent_dma_mask()' can be replaced by an equivalent 'dma_set_mask_and_coherent()' which is much less verbose. Signed-off-by: Youling Tang --- drivers/i2c/busses/i2c-ismt.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/i2c

Re: [PATCH] i2c: busses: Use dma_set_mask_and_coherent

2020-12-02 Thread Youling Tang
Hi, Wolfram On 12/03/2020 12:01 AM, Wolfram Sang wrote: On Tue, Nov 24, 2020 at 09:08:35PM +0800, Youling Tang wrote: 'pci_set_dma_mask()' + 'pci_set_consistent_dma_mask()' can be replaced by an equivalent 'dma_set_mask_and_coherent()' which is much less verbose. Signed-off-by: Youling Tang

[PATCH] powerpc: Use common STABS_DEBUG and DWARF_DEBUG and ELF_DETAILS macro

2020-11-26 Thread Youling Tang
Use the common STABS_DEBUG and DWARF_DEBUG and ELF_DETAILS macro rule for the linker script in an effort. Signed-off-by: Youling Tang --- arch/powerpc/kernel/vdso32/vdso32.lds.S | 42 - arch/powerpc/kernel/vdso64/vdso64.lds.S | 42

Re: [PATCH v2] acpi: Fix use-after-free in acpi_ipmi.c

2020-11-26 Thread Youling Tang
Hi, On 11/26/2020 10:22 PM, Rafael J. Wysocki wrote: On Thu, Nov 26, 2020 at 2:26 AM Youling Tang wrote: kfree() has been called inside put_device so anther kfree would cause a use-after-free bug. Signed-off-by: Youling Tang --- drivers/acpi/acpi_ipmi.c | 1 - 1 file changed, 1 deletion

[PATCH] tools: selftests: Add missing munmap() in check_error_paths()

2020-11-26 Thread Youling Tang
Add the missing munmap(addr_ro, PAGE_SIZE) before return. Signed-off-by: Youling Tang --- tools/testing/selftests/ptrace/peeksiginfo.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/ptrace/peeksiginfo.c b/tools/testing/selftests/ptrace

[PATCH] sparc: Removes code duplication between arch_ptrace and compat_arch_ptrace

2020-11-26 Thread Youling Tang
The patch removes code duplication between arch_ptrace and compat_arch_ptrace, in large part by having the former call into the later for all requests that don't need any special "compat" treatment. Signed-off-by: Youling Tang --- arch/sparc/kernel/ptrace

[PATCH] alpha: ptrace generic requests

2020-11-26 Thread Youling Tang
This removes duplicated code by calling the generic ptrace_request function for the things they already handle. Signed-off-by: Youling Tang --- arch/alpha/kernel/ptrace.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c index

[PATCH v2] acpi: Fix use-after-free in acpi_ipmi.c

2020-11-25 Thread Youling Tang
kfree() has been called inside put_device so anther kfree would cause a use-after-free bug. Signed-off-by: Youling Tang --- drivers/acpi/acpi_ipmi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/acpi/acpi_ipmi.c b/drivers/acpi/acpi_ipmi.c index 9d6c0fc..18edf8b 100644 --- a/drivers

Re: [PATCH] acpi: Fix use-after-free in acpi_ipmi.c

2020-11-25 Thread Youling Tang
Hi, On 11/25/2020 11:53 PM, Rafael J. Wysocki wrote: On Tue, Nov 24, 2020 at 1:51 PM Youling Tang wrote: kfree() has been called inside put_device so anther kfree would cause a use-after-free bug. Signed-off-by: Youling Tang --- drivers/acpi/acpi_ipmi.c | 2 -- 1 file changed, 2

[PATCH] i2c: busses: Use dma_set_mask_and_coherent

2020-11-24 Thread Youling Tang
'pci_set_dma_mask()' + 'pci_set_consistent_dma_mask()' can be replaced by an equivalent 'dma_set_mask_and_coherent()' which is much less verbose. Signed-off-by: Youling Tang --- drivers/i2c/busses/i2c-ismt.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/i2c

[PATCH] acpi: Fix use-after-free in acpi_ipmi.c

2020-11-24 Thread Youling Tang
kfree() has been called inside put_device so anther kfree would cause a use-after-free bug. Signed-off-by: Youling Tang --- drivers/acpi/acpi_ipmi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/acpi/acpi_ipmi.c b/drivers/acpi/acpi_ipmi.c index 9d6c0fc..72902b6 100644

Re: [PATCH] microblaze: Use the common INIT_DATA_SECTION macro in vmlinux.lds.S

2020-11-20 Thread Youling Tang
Hi, Michal On 11/20/2020 09:31 PM, Michal Simek wrote: Hi, On 19. 11. 20 2:40, Youling Tang wrote: Use the common INIT_DATA_SECTION rule for the linker script in an effort to regularize the linker script. Signed-off-by: Youling Tang --- arch/microblaze/kernel/vmlinux.lds.S | 24

[PATCH 2/2] m68k: Add a missing ELF_DETAILS in link script

2020-11-19 Thread Youling Tang
Commit c604abc3f6e3 ("vmlinux.lds.h: Split ELF_DETAILS from STABS_DEBUG") after should add a missing ELF_DETAILS, at the same time, the .comment section has been included in the ELF_DETAILS. Signed-off-by: Youling Tang --- arch/m68k/kernel/vmlinux-nommu.lds | 2 +- arch/m68k/kern

[PATCH 1/2] m68k: Drop redundant NOTES in link script

2020-11-19 Thread Youling Tang
Commit eaf937075c9a ("vmlinux.lds.h: Move NOTES into RO_DATA") after should remove redundant NOTES. Signed-off-by: Youling Tang --- arch/m68k/kernel/vmlinux-nommu.lds | 1 - arch/m68k/kernel/vmlinux-std.lds | 1 - arch/m68k/kernel/vmlinux-sun3.lds | 1 - 3 files changed, 3 deletion

[PATCH] c6x: Use common DISCARDS in vmlinux.lds.S

2020-11-19 Thread Youling Tang
Use the common DISCARDS rule for the linker script in an effort to regularize the linker script. Signed-off-by: Youling Tang --- arch/c6x/kernel/vmlinux.lds.S | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/c6x/kernel/vmlinux.lds.S b/arch/c6x/kernel

Re: [PATCH] arm64: vmlinux.lds.S: Drop redundant *.init.rodata.*

2020-11-19 Thread Youling Tang
Hi, Ard On 11/19/2020 03:18 PM, Ard Biesheuvel wrote: On Thu, 19 Nov 2020 at 02:45, Youling Tang wrote: We currently try to emit *.init.rodata.* twice, once in INIT_DATA, and once in the line immediately following it. As the two section definitions are identical, the latter is redundant

[PATCH] arm64: vmlinux.lds.S: Drop redundant *.init.rodata.*

2020-11-18 Thread Youling Tang
We currently try to emit *.init.rodata.* twice, once in INIT_DATA, and once in the line immediately following it. As the two section definitions are identical, the latter is redundant and can be dropped. This patch drops the redundant *.init.rodata.* section definition. Signed-off-by: Youling

[PATCH] microblaze: Use the common INIT_DATA_SECTION macro in vmlinux.lds.S

2020-11-18 Thread Youling Tang
Use the common INIT_DATA_SECTION rule for the linker script in an effort to regularize the linker script. Signed-off-by: Youling Tang --- arch/microblaze/kernel/vmlinux.lds.S | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/arch/microblaze/kernel

[PATCH] rtc: Fix memleak in sun6i_rtc_clk_init

2020-11-13 Thread Youling Tang
When rtc->base or rtc->int_osc or rtc->losc or rtc->ext_losc is NULL, we should free clk_data and rtc before the function returns to prevent memleak. Signed-off-by: Youling Tang --- drivers/rtc/rtc-sun6i.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a

[PATCH 2/2] arm: Fix kfree NULL pointer in omap2xxx_clkt_vps_init

2020-11-13 Thread Youling Tang
The returns pointer is NULL when kzalloc fails to apply for space, so fix kfree NULL pointer. Signed-off-by: Youling Tang --- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch

[PATCH 1/2] arm: Fix memleak in omap2xxx_clkt_vps_init

2020-11-13 Thread Youling Tang
If the clk_register fails, we should free hw before function returns to prevent memleak. Signed-off-by: Youling Tang --- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2

[PATCH] mips: loongson64: Remove unnecessary external declaration

2020-11-04 Thread Youling Tang
prom_init_memory() unused in loongson64, only used in loongson2ef, and has been declared in arch/mips/include/asm/mach-loongson2ef/loongson.h, so remove the external declaration in loongson64. Signed-off-by: Youling Tang --- arch/mips/include/asm/mach-loongson64/loongson.h | 1 - 1 file changed

[PATCH] mips: Use the common RW_DATA macro in vmlinux.lds.S

2020-11-04 Thread Youling Tang
Use the common RW_DATA rule for the linker script in an effort to regularize the linker script. Signed-off-by: Youling Tang --- arch/mips/kernel/vmlinux.lds.S | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel

[PATCH] powerpc: Use the common INIT_DATA_SECTION macro in vmlinux.lds.S

2020-11-04 Thread Youling Tang
Use the common INIT_DATA_SECTION rule for the linker script in an effort to regularize the linker script. Signed-off-by: Youling Tang --- arch/powerpc/kernel/vmlinux.lds.S | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/arch/powerpc/kernel/vmlinux.lds.S

[PATCH] mips: Modify the FLAGS attribute value of text segment in PHDRS

2020-11-04 Thread Youling Tang
The attribute of the text segment should be read-only and executable, FLAGS(7) should be changed to FLAGS(5), like x86, s390 architecture. Signed-off-by: Youling Tang --- arch/mips/boot/compressed/ld.script | 2 +- arch/mips/kernel/vmlinux.lds.S | 2 +- 2 files changed, 2 insertions(+), 2

[PATCH] arm64: Change the location of DISCARDS

2020-11-04 Thread Youling Tang
In the include/asm-generic/vmlinux.lds.h file, the "must be the last" comment indicates that DISCARDS should be placed in the last position of SECTIONS, like x86, mips, riscv, etc. Signed-off-by: Youling Tang --- arch/arm64/kernel/vmlinux.lds.S | 13 +++-- 1 file changed, 7

Re: [PATCH] MIPS: kexec: Add crashkernel=YM handling

2020-09-19 Thread Youling Tang
On 09/19/2020 03:02 PM, Jiaxun Yang wrote: 于 2020年9月19日 GMT+08:00 上午9:55:46, Youling Tang 写到: When the kernel crashkernel parameter is specified with just a size, we are supposed to allocate a region from RAM to store the crashkernel. However, MIPS merely reserves physical address zero

[PATCH] MIPS: kexec: Add crashkernel=YM handling

2020-09-18 Thread Youling Tang
000-00b47f87 : Kernel code 00b47f88-00df : Kernel data 00e6-01f73c7f : Kernel bss 0400-09ff : Crash kernel 1a00-1bff : pci@1a00 ... Signed-off-by: Youling Tang --- arch/mips/kernel/setup.c | 24 +--- 1 file changed, 21 insertions(+), 3 deleti

Re: [PATCH] MIPS: Remove unused BOOT_MEM_INIT_RAM

2020-09-14 Thread Youling Tang
On 09/14/2020 12:32 PM, Jiaxun Yang wrote: 在 2020/9/12 9:59, Youling Tang 写道: Commit a94e4f24ec83 ("MIPS: init: Drop boot_mem_map") left the BOOT_MEM_INIT_RAM unused, remove it. Signed-off-by: Youling Tang --- arch/mips/include/asm/bootinfo.h | 1 - 1 file changed, 1 deletio

[PATCH] MIPS: Remove unused BOOT_MEM_INIT_RAM

2020-09-11 Thread Youling Tang
Commit a94e4f24ec83 ("MIPS: init: Drop boot_mem_map") left the BOOT_MEM_INIT_RAM unused, remove it. Signed-off-by: Youling Tang --- arch/mips/include/asm/bootinfo.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/mips/include/asm/bootinfo.h b/arch/mips/include/asm/bootin

[PATCH] MIPS: netlogic: Remove unused code

2020-09-11 Thread Youling Tang
Remove some unused code. Signed-off-by: Youling Tang --- arch/mips/include/asm/netlogic/psb-bootinfo.h | 15 --- 1 file changed, 15 deletions(-) diff --git a/arch/mips/include/asm/netlogic/psb-bootinfo.h b/arch/mips/include/asm/netlogic/psb-bootinfo.h index 6878307..272544b 100644

[PATCH] gpu: amd: Remove duplicate semicolons at the end of line

2020-08-22 Thread Youling Tang
Remove duplicate semicolons at the end of line. Signed-off-by: Youling Tang --- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH] MIPS: Loongson64: Fix build error about redeclaration of enumerator 'VIRTUAL' and "CONFIG_DM_THIN_PROVISIONING"

2020-08-18 Thread Youling Tang
^ scripts/Makefile.build:283: recipe for target 'drivers/md/dm-thin.o' failed make[2]: *** [drivers/md/dm-thin.o] Error 1 Signed-off-by: Youling Tang --- arch/mips/include/asm/mach-loongson64/boot_param.h | 2 +- arch/mips/loongson64/env.c | 4 ++-- 2 files

Re: [PATCH] kexec: Delete an unnecessary comparison

2020-08-14 Thread Youling Tang
On 08/14/2020 02:07 PM, Joe Perches wrote: On Thu, 2020-08-13 at 20:45 +0800, Youling Tang wrote: Regardless of whether the ret value is zero or non-zero, the trajectory of the program execution is the same, so there is no need to compare. Signed-off-by: Youling Tang --- kernel

[PATCH] kexec: Delete an unnecessary comparison

2020-08-13 Thread Youling Tang
Regardless of whether the ret value is zero or non-zero, the trajectory of the program execution is the same, so there is no need to compare. Signed-off-by: Youling Tang --- kernel/kexec_file.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index

[PATCH] sound/soc/intel: Fix spelling mistake "cant" --> "can't"

2020-08-13 Thread Youling Tang
There is some spelling mistakes in a dev_err message. Fix it. Signed-off-by: Youling Tang --- sound/soc/intel/common/sst-firmware.c | 4 ++-- sound/soc/intel/haswell/sst-haswell-ipc.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/intel/common/sst

[PATCH v3] tools/objtool: Fix unnecessary jumps

2020-08-11 Thread Youling Tang
off-by: Youling Tang Reviewed-by: Kamalesh Babulal --- tools/objtool/check.c | 30 ++ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index e034a8f..b9bfcb5 100644 --- a/tools/objtool/check.c +++ b/tools/objt

[PATCH] [v2] tools/objtool: Fix unnecessary jumps

2020-08-10 Thread Youling Tang
There is no need to jump to the "out" tag when "ret < 0", just return directly to "ret". Signed-off-by: Youling Tang --- tools/objtool/check.c | 30 ++ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/tools/objtool/chec

Re: [PATCH] tools/objtool: Fix unnecessary jumps

2020-08-10 Thread Youling Tang
Thank you for your reply and suggestions, I will remove the "out" label code. Thanks, Youling On 08/10/2020 08:57 PM, Kamalesh Babulal wrote: On 10/08/20 9:36 am, Youling Tang wrote: There is no need to jump to the "out" tag when "ret < 0", just retu

[PATCH] tools/objtool: Fix unnecessary jumps

2020-08-09 Thread Youling Tang
There is no need to jump to the "out" tag when "ret < 0", just return directly to "ret". Signed-off-by: Youling Tang --- tools/objtool/check.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/objtool/check.c b/to

[PATCH] kernel/debug: Fix spelling mistake in debug_core.c

2020-08-07 Thread Youling Tang
Fix typo: "notifiter" --> "notifier" "overriden" --> "overridden" Signed-off-by: Youling Tang --- kernel/debug/debug_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/debug/debug_core.c b/kernel/de

[PATCH] scsi/aic7xxx/aicasm: Add missing fclose() call

2020-08-02 Thread Youling Tang
Add missing fclose() call to close "regdiagfile" in the function stop(). Signed-off-by: Youling Tang --- drivers/scsi/aic7xxx/aicasm/aicasm.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm.c b/drivers/scsi/aic7xxx/aicasm/aicasm.c ind