Skip to content

Commit

Permalink
Automatic merge of 'next-test' into merge-test (2023-09-14 23:55)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpe committed Sep 14, 2023
2 parents 5e36c31 + 7258f49 commit 294a99c
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 10 deletions.
4 changes: 4 additions & 0 deletions arch/powerpc/configs/debug.config
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG=y
CONFIG_PPC_IRQ_SOFT_MASK_DEBUG=y
CONFIG_PPC_KUAP_DEBUG=y
CONFIG_PPC_RFI_SRR_DEBUG=y
CONFIG_SCOM_DEBUGFS=y
2 changes: 1 addition & 1 deletion arch/powerpc/configs/pmac32_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ CONFIG_DM_SNAPSHOT=m
CONFIG_DM_MIRROR=m
CONFIG_DM_ZERO=m
CONFIG_ADB=y
CONFIG_ADB_CUDA=y
CONFIG_ADB_PMU=y
CONFIG_ADB_PMU_LED=y
CONFIG_ADB_PMU_LED_DISK=y
Expand Down Expand Up @@ -181,6 +180,7 @@ CONFIG_SERIAL_PMACZILOG_TTYS=y
CONFIG_SERIAL_PMACZILOG_CONSOLE=y
CONFIG_NVRAM=y
CONFIG_I2C_CHARDEV=m
CONFIG_POWER_RESET=y
CONFIG_APM_POWER=y
CONFIG_BATTERY_PMU=y
CONFIG_HWMON=m
Expand Down
8 changes: 6 additions & 2 deletions arch/powerpc/include/asm/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ void relocate_new_kernel(unsigned long indirection_page, unsigned long reboot_co

void kexec_copy_flush(struct kimage *image);

#if defined(CONFIG_CRASH_DUMP) && defined(CONFIG_PPC_RTAS)
#if defined(CONFIG_CRASH_DUMP)
bool is_kdump_kernel(void);
#define is_kdump_kernel is_kdump_kernel
#if defined(CONFIG_PPC_RTAS)
void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);
#define crash_free_reserved_phys_range crash_free_reserved_phys_range
#endif
#endif /* CONFIG_PPC_RTAS */
#endif /* CONFIG_CRASH_DUMP */

#ifdef CONFIG_KEXEC_FILE
extern const struct kexec_file_ops kexec_elf64_ops;
Expand Down
12 changes: 12 additions & 0 deletions arch/powerpc/kernel/crash_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/uio.h>
#include <asm/rtas.h>
#include <asm/inst.h>
#include <asm/fadump.h>

#ifdef DEBUG
#include <asm/udbg.h>
Expand Down Expand Up @@ -92,6 +93,17 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,
return csize;
}

/*
* Return true only when kexec based kernel dump capturing method is used.
* This ensures all restritions applied for kdump case are not automatically
* applied for fadump case.
*/
bool is_kdump_kernel(void)
{
return !is_fadump_active() && elfcorehdr_addr != ELFCORE_ADDR_MAX;
}
EXPORT_SYMBOL_GPL(is_kdump_kernel);

#ifdef CONFIG_PPC_RTAS
/*
* The crashkernel region will almost always overlap the RTAS region, so
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/kexec/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ void arch_crash_save_vmcoreinfo(void)
#ifndef CONFIG_NUMA
VMCOREINFO_SYMBOL(contig_page_data);
#endif
VMCOREINFO_SYMBOL(cur_cpu_spec);
VMCOREINFO_OFFSET(cpu_spec, mmu_features);
#if defined(CONFIG_PPC64) && defined(CONFIG_SPARSEMEM_VMEMMAP)
VMCOREINFO_SYMBOL(vmemmap_list);
VMCOREINFO_SYMBOL(mmu_vmemmap_psize);
Expand Down
8 changes: 6 additions & 2 deletions arch/powerpc/kexec/file_load_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1138,11 +1138,15 @@ static int update_pci_dma_nodes(void *fdt, const char *dmapropname)
continue;

ret = copy_property(fdt, pci_offset, dn, "ibm,dma-window");
if (ret < 0)
if (ret < 0) {
of_node_put(dn);
break;
}
ret = copy_property(fdt, pci_offset, dn, dmapropname);
if (ret < 0)
if (ret < 0) {
of_node_put(dn);
break;
}
}

return ret;
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/platforms/powermac/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
config PPC_PMAC
bool "Apple PowerMac based machines"
depends on PPC_BOOK3S && CPU_BIG_ENDIAN
select ADB_CUDA if POWER_RESET && PPC32
select MPIC
select FORCE_PCI
select PPC_INDIRECT_PCI if PPC32
Expand Down
4 changes: 3 additions & 1 deletion arch/powerpc/platforms/powermac/low_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,8 +925,10 @@ static void __init smu_i2c_probe(void)

sz = sizeof(struct pmac_i2c_bus) + sizeof(struct smu_i2c_cmd);
bus = kzalloc(sz, GFP_KERNEL);
if (bus == NULL)
if (bus == NULL) {
of_node_put(busnode);
return;
}

bus->controller = controller;
bus->busnode = of_node_get(busnode);
Expand Down
4 changes: 3 additions & 1 deletion arch/powerpc/platforms/powermac/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,10 @@ static void __init smp_core99_setup_i2c_hwsync(int ncpus)
name = "Pulsar";
break;
}
if (pmac_tb_freeze != NULL)
if (pmac_tb_freeze != NULL) {
of_node_put(cc);
break;
}
}
if (pmac_tb_freeze != NULL) {
/* Open i2c bus for synchronous access */
Expand Down
8 changes: 5 additions & 3 deletions include/linux/crash_dump.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void vmcore_cleanup(void);
#define vmcore_elf64_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x))
#endif

#ifndef is_kdump_kernel
/*
* is_kdump_kernel() checks whether this kernel is booting after a panic of
* previous kernel or not. This is determined by checking if previous kernel
Expand All @@ -64,6 +65,7 @@ static inline bool is_kdump_kernel(void)
{
return elfcorehdr_addr != ELFCORE_ADDR_MAX;
}
#endif

/* is_vmcore_usable() checks if the kernel is booting after a panic and
* the vmcore region is usable.
Expand All @@ -75,7 +77,8 @@ static inline bool is_kdump_kernel(void)

static inline int is_vmcore_usable(void)
{
return is_kdump_kernel() && elfcorehdr_addr != ELFCORE_ADDR_ERR ? 1 : 0;
return elfcorehdr_addr != ELFCORE_ADDR_ERR &&
elfcorehdr_addr != ELFCORE_ADDR_MAX ? 1 : 0;
}

/* vmcore_unusable() marks the vmcore as unusable,
Expand All @@ -84,8 +87,7 @@ static inline int is_vmcore_usable(void)

static inline void vmcore_unusable(void)
{
if (is_kdump_kernel())
elfcorehdr_addr = ELFCORE_ADDR_ERR;
elfcorehdr_addr = ELFCORE_ADDR_ERR;
}

/**
Expand Down

0 comments on commit 294a99c

Please sign in to comment.