Skip to content

Commit

Permalink
Automatic merge of 'next-test' into merge-test (2023-12-27 09:44)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpe committed Dec 26, 2023
2 parents 659e464 + 375e659 commit f07a302
Show file tree
Hide file tree
Showing 29 changed files with 101 additions and 113 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ config THREAD_SHIFT
int "Thread shift" if EXPERT
range 13 15
default "15" if PPC_256K_PAGES
default "15" if PPC_PSERIES || PPC_POWERNV
default "14" if PPC64
default "13"
help
Expand Down
20 changes: 10 additions & 10 deletions arch/powerpc/include/asm/hvcall.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,16 @@
#define H_GET_ENERGY_SCALE_INFO 0x450
#define H_PKS_SIGNED_UPDATE 0x454
#define H_WATCHDOG 0x45C
#define MAX_HCALL_OPCODE H_WATCHDOG
#define H_GUEST_GET_CAPABILITIES 0x460
#define H_GUEST_SET_CAPABILITIES 0x464
#define H_GUEST_CREATE 0x470
#define H_GUEST_CREATE_VCPU 0x474
#define H_GUEST_GET_STATE 0x478
#define H_GUEST_SET_STATE 0x47C
#define H_GUEST_RUN_VCPU 0x480
#define H_GUEST_COPY_MEMORY 0x484
#define H_GUEST_DELETE 0x488
#define MAX_HCALL_OPCODE H_GUEST_DELETE

/* Scope args for H_SCM_UNBIND_ALL */
#define H_UNBIND_SCOPE_ALL (0x1)
Expand Down Expand Up @@ -393,15 +402,6 @@
#define H_ENTER_NESTED 0xF804
#define H_TLB_INVALIDATE 0xF808
#define H_COPY_TOFROM_GUEST 0xF80C
#define H_GUEST_GET_CAPABILITIES 0x460
#define H_GUEST_SET_CAPABILITIES 0x464
#define H_GUEST_CREATE 0x470
#define H_GUEST_CREATE_VCPU 0x474
#define H_GUEST_GET_STATE 0x478
#define H_GUEST_SET_STATE 0x47C
#define H_GUEST_RUN_VCPU 0x480
#define H_GUEST_COPY_MEMORY 0x484
#define H_GUEST_DELETE 0x488

/* Flags for H_SVM_PAGE_IN */
#define H_PAGE_IN_SHARED 0x1
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/machdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct pci_host_bridge;
struct machdep_calls {
const char *name;
const char *compatible;
const char * const *compatibles;
#ifdef CONFIG_PPC64
#ifdef CONFIG_PM
void (*iommu_restore)(void);
Expand Down
5 changes: 2 additions & 3 deletions arch/powerpc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,14 @@ static __always_inline void call_do_irq(struct pt_regs *regs, void *sp)
void __do_IRQ(struct pt_regs *regs)
{
struct pt_regs *old_regs = set_irq_regs(regs);
void *cursp, *irqsp, *sirqsp;
void *cursp, *irqsp;

/* Switch to the irq stack to handle this */
cursp = (void *)(current_stack_pointer & ~(THREAD_SIZE - 1));
irqsp = hardirq_ctx[raw_smp_processor_id()];
sirqsp = softirq_ctx[raw_smp_processor_id()];

/* Already there ? If not switch stack and call */
if (unlikely(cursp == irqsp || cursp == sirqsp))
if (unlikely(cursp == irqsp))
__do_irq(regs, current_stack_pointer);
else
call_do_irq(regs, irqsp);
Expand Down
8 changes: 6 additions & 2 deletions arch/powerpc/kernel/secure_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ bool is_ppc_secureboot_enabled(void)
if (enabled)
goto out;

if (!of_property_read_u32(of_root, "ibm,secure-boot", &secureboot))
node = of_find_node_by_path("/");
if (!of_property_read_u32(node, "ibm,secure-boot", &secureboot))
enabled = (secureboot > 1);
of_node_put(node);

out:
pr_info("Secure boot mode %s\n", enabled ? "enabled" : "disabled");
Expand All @@ -54,8 +56,10 @@ bool is_ppc_trustedboot_enabled(void)
if (enabled)
goto out;

if (!of_property_read_u32(of_root, "ibm,trusted-boot", &trustedboot))
node = of_find_node_by_path("/");
if (!of_property_read_u32(node, "ibm,trusted-boot", &trustedboot))
enabled = (trustedboot > 0);
of_node_put(node);

out:
pr_info("Trusted boot mode %s\n", enabled ? "enabled" : "disabled");
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/setup-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,8 @@ static __init void probe_machine(void)
DBG(" %s ...\n", machine_id->name);
if (machine_id->compatible && !of_machine_is_compatible(machine_id->compatible))
continue;
if (machine_id->compatibles && !of_machine_compatible_match(machine_id->compatibles))
continue;
memcpy(&ppc_md, machine_id, sizeof(struct machdep_calls));
if (ppc_md.probe && !ppc_md.probe())
continue;
Expand Down
8 changes: 5 additions & 3 deletions arch/powerpc/kexec/ranges.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,16 @@ int add_opal_mem_range(struct crash_mem **mem_ranges)
int add_reserved_mem_ranges(struct crash_mem **mem_ranges)
{
int n_mem_addr_cells, n_mem_size_cells, i, len, cells, ret = 0;
struct device_node *root = of_find_node_by_path("/");
const __be32 *prop;

prop = of_get_property(of_root, "reserved-ranges", &len);
prop = of_get_property(root, "reserved-ranges", &len);
n_mem_addr_cells = of_n_addr_cells(root);
n_mem_size_cells = of_n_size_cells(root);
of_node_put(root);
if (!prop)
return 0;

n_mem_addr_cells = of_n_addr_cells(of_root);
n_mem_size_cells = of_n_size_cells(of_root);
cells = n_mem_addr_cells + n_mem_size_cells;

/* Each reserved range is an (address,size) pair */
Expand Down
10 changes: 5 additions & 5 deletions arch/powerpc/mm/drmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,17 +393,17 @@ static const __be32 *of_get_usable_memory(struct device_node *dn)
int walk_drmem_lmbs(struct device_node *dn, void *data,
int (*func)(struct drmem_lmb *, const __be32 **, void *))
{
struct device_node *root = of_find_node_by_path("/");
const __be32 *prop, *usm;
int ret = -ENODEV;

if (!of_root)
if (!root)
return ret;

/* Get the address & size cells */
of_node_get(of_root);
n_root_addr_cells = of_n_addr_cells(of_root);
n_root_size_cells = of_n_size_cells(of_root);
of_node_put(of_root);
n_root_addr_cells = of_n_addr_cells(root);
n_root_size_cells = of_n_size_cells(root);
of_node_put(root);

if (init_drmem_lmb_size(dn))
return ret;
Expand Down
6 changes: 4 additions & 2 deletions arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)

static void __init find_possible_nodes(void)
{
struct device_node *rtas;
struct device_node *rtas, *root;
const __be32 *domains = NULL;
int prop_length, max_nodes;
u32 i;
Expand All @@ -1132,10 +1132,12 @@ static void __init find_possible_nodes(void)
* If the LPAR is migratable, new nodes might be activated after a LPM,
* so we should consider the max number in that case.
*/
if (!of_get_property(of_root, "ibm,migratable-partition", NULL))
root = of_find_node_by_path("/");
if (!of_get_property(root, "ibm,migratable-partition", NULL))
domains = of_get_property(rtas,
"ibm,current-associativity-domains",
&prop_length);
of_node_put(root);
if (!domains) {
domains = of_get_property(rtas, "ibm,max-associativity-domains",
&prop_length);
Expand Down
9 changes: 3 additions & 6 deletions arch/powerpc/platforms/40x/ppc40x_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,13 @@ static const char * const board[] __initconst = {

static int __init ppc40x_probe(void)
{
if (of_device_compatible_match(of_root, board)) {
pci_set_flags(PCI_REASSIGN_ALL_RSRC);
return 1;
}

return 0;
pci_set_flags(PCI_REASSIGN_ALL_RSRC);
return 1;
}

define_machine(ppc40x_simple) {
.name = "PowerPC 40x Platform",
.compatibles = board,
.probe = ppc40x_probe,
.progress = udbg_progress,
.init_IRQ = uic_init_tree,
Expand Down
4 changes: 1 addition & 3 deletions arch/powerpc/platforms/512x/mpc512x_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ static const char * const board[] __initconst = {
*/
static int __init mpc512x_generic_probe(void)
{
if (!of_device_compatible_match(of_root, board))
return 0;

mpc512x_init_early();

return 1;
}

define_machine(mpc512x_generic) {
.name = "MPC512x generic",
.compatibles = board,
.probe = mpc512x_generic_probe,
.init = mpc512x_init,
.setup_arch = mpc512x_setup_arch,
Expand Down
4 changes: 3 additions & 1 deletion arch/powerpc/platforms/52xx/efika.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,10 @@ static void __init efika_setup_arch(void)

static int __init efika_probe(void)
{
const char *model = of_get_property(of_root, "model", NULL);
struct device_node *root = of_find_node_by_path("/");
const char *model = of_get_property(root, "model", NULL);

of_node_put(root);
if (model == NULL)
return 0;
if (strcmp(model, "EFIKA5K2"))
Expand Down
10 changes: 1 addition & 9 deletions arch/powerpc/platforms/52xx/lite5200.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,9 @@ static const char * const board[] __initconst = {
NULL,
};

/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
static int __init lite5200_probe(void)
{
return of_device_compatible_match(of_root, board);
}

define_machine(lite5200) {
.name = "lite5200",
.probe = lite5200_probe,
.compatibles = board,
.setup_arch = lite5200_setup_arch,
.discover_phbs = mpc52xx_setup_pci,
.init = mpc52xx_declare_of_platform_devices,
Expand Down
10 changes: 1 addition & 9 deletions arch/powerpc/platforms/52xx/mpc5200_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,9 @@ static const char *board[] __initdata = {
NULL
};

/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
static int __init mpc5200_simple_probe(void)
{
return of_device_compatible_match(of_root, board);
}

define_machine(mpc5200_simple_platform) {
.name = "mpc5200-simple-platform",
.probe = mpc5200_simple_probe,
.compatibles = board,
.setup_arch = mpc5200_simple_setup_arch,
.discover_phbs = mpc52xx_setup_pci,
.init = mpc52xx_declare_of_platform_devices,
Expand Down
10 changes: 1 addition & 9 deletions arch/powerpc/platforms/83xx/mpc830x_rdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,11 @@ static const char *board[] __initdata = {
NULL
};

/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
static int __init mpc830x_rdb_probe(void)
{
return of_device_compatible_match(of_root, board);
}

machine_device_initcall(mpc830x_rdb, mpc83xx_declare_of_platform_devices);

define_machine(mpc830x_rdb) {
.name = "MPC830x RDB",
.probe = mpc830x_rdb_probe,
.compatibles = board,
.setup_arch = mpc830x_rdb_setup_arch,
.discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
Expand Down
10 changes: 1 addition & 9 deletions arch/powerpc/platforms/83xx/mpc831x_rdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,11 @@ static const char *board[] __initdata = {
NULL
};

/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
static int __init mpc831x_rdb_probe(void)
{
return of_device_compatible_match(of_root, board);
}

machine_device_initcall(mpc831x_rdb, mpc83xx_declare_of_platform_devices);

define_machine(mpc831x_rdb) {
.name = "MPC831x RDB",
.probe = mpc831x_rdb_probe,
.compatibles = board,
.setup_arch = mpc831x_rdb_setup_arch,
.discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
Expand Down
10 changes: 1 addition & 9 deletions arch/powerpc/platforms/83xx/mpc837x_rdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,9 @@ static const char * const board[] __initconst = {
NULL
};

/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
static int __init mpc837x_rdb_probe(void)
{
return of_device_compatible_match(of_root, board);
}

define_machine(mpc837x_rdb) {
.name = "MPC837x RDB/WLAN",
.probe = mpc837x_rdb_probe,
.compatibles = board,
.setup_arch = mpc837x_rdb_setup_arch,
.discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
Expand Down
5 changes: 3 additions & 2 deletions arch/powerpc/platforms/83xx/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,10 @@ static int mpc83xx_suspend_begin(suspend_state_t state)

static int agent_thread_fn(void *data)
{
set_freezable();

while (1) {
wait_event_interruptible(agent_wq, pci_pm_state >= 2);
try_to_freeze();
wait_event_freezable(agent_wq, pci_pm_state >= 2);

if (signal_pending(current) || pci_pm_state < 2)
continue;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/85xx/corenet_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static int __init corenet_generic_probe(void)
extern struct smp_ops_t smp_85xx_ops;
#endif

if (of_device_compatible_match(of_root, boards))
if (of_machine_compatible_match(boards))
return 1;

/* Check if we're running under the Freescale hypervisor */
Expand Down
10 changes: 1 addition & 9 deletions arch/powerpc/platforms/85xx/tqm85xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,9 @@ static const char * const board[] __initconst = {
NULL
};

/*
* Called very early, device-tree isn't unflattened
*/
static int __init tqm85xx_probe(void)
{
return of_device_compatible_match(of_root, board);
}

define_machine(tqm85xx) {
.name = "TQM85xx",
.probe = tqm85xx_probe,
.compatibles = board,
.setup_arch = tqm85xx_setup_arch,
.init_IRQ = tqm85xx_pic_init,
.show_cpuinfo = tqm85xx_show_cpuinfo,
Expand Down
7 changes: 0 additions & 7 deletions arch/powerpc/platforms/86xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,3 @@ config MPC8641
select MPIC
default y if GEF_SBC610 || GEF_SBC310 || GEF_PPC9A \
|| MVME7100

config MPC8610
bool
select HAVE_PCI
select FSL_PCI if PCI
select PPC_UDBG_16550
select MPIC
4 changes: 3 additions & 1 deletion arch/powerpc/platforms/pasemi/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,18 @@ static int __init pas_add_bridge(struct device_node *dev)

void __init pas_pci_init(void)
{
struct device_node *root = of_find_node_by_path("/");
struct device_node *np;
int res;

pci_set_flags(PCI_SCAN_ALL_PCIE_DEVS);

np = of_find_compatible_node(of_root, NULL, "pasemi,rootbus");
np = of_find_compatible_node(root, NULL, "pasemi,rootbus");
if (np) {
res = pas_add_bridge(np);
of_node_put(np);
}
of_node_put(root);
}

void __iomem *__init pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset)
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/platforms/powernv/opal-prd.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ static bool opal_prd_range_is_valid(uint64_t addr, uint64_t size)
const char *label;

addrp = of_get_address(node, 0, &range_size, NULL);
if (!addrp)
continue;

range_addr = of_read_number(addrp, 2);
range_end = range_addr + range_size;
Expand Down
Loading

0 comments on commit f07a302

Please sign in to comment.