Skip to content

Commit 9295162

Browse files
Automatic merge of 'next' into merge (2025-01-13 18:04)
2 parents df6c128 + 2bf66e6 commit 9295162

File tree

4 files changed

+22
-30
lines changed

4 files changed

+22
-30
lines changed

arch/powerpc/kernel/iommu.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ void iommu_table_clear(struct iommu_table *tbl)
687687
void iommu_table_reserve_pages(struct iommu_table *tbl,
688688
unsigned long res_start, unsigned long res_end)
689689
{
690-
int i;
690+
unsigned long i;
691691

692692
WARN_ON_ONCE(res_end < res_start);
693693
/*

arch/powerpc/kernel/prom_init.c

+14-25
Original file line numberDiff line numberDiff line change
@@ -2792,7 +2792,6 @@ static void __init flatten_device_tree(void)
27922792
dt_struct_start, dt_struct_end);
27932793
}
27942794

2795-
#ifdef CONFIG_PPC_CHRP
27962795
/*
27972796
* Pegasos and BriQ lacks the "ranges" property in the isa node
27982797
* Pegasos needs decimal IRQ 14/15, not hexadecimal
@@ -2843,11 +2842,7 @@ static void __init fixup_device_tree_chrp(void)
28432842
}
28442843
}
28452844
}
2846-
#else
2847-
#define fixup_device_tree_chrp()
2848-
#endif
28492845

2850-
#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC)
28512846
static void __init fixup_device_tree_pmac64(void)
28522847
{
28532848
phandle u3, i2c, mpic;
@@ -2887,11 +2882,7 @@ static void __init fixup_device_tree_pmac64(void)
28872882
prom_setprop(i2c, "/u3@0,f8000000/i2c@f8001000", "interrupt-parent",
28882883
&parent, sizeof(parent));
28892884
}
2890-
#else
2891-
#define fixup_device_tree_pmac64()
2892-
#endif
28932885

2894-
#ifdef CONFIG_PPC_PMAC
28952886
static void __init fixup_device_tree_pmac(void)
28962887
{
28972888
__be32 val = 1;
@@ -2911,11 +2902,7 @@ static void __init fixup_device_tree_pmac(void)
29112902
prom_setprop(node, NULL, "#size-cells", &val, sizeof(val));
29122903
}
29132904
}
2914-
#else
2915-
static inline void fixup_device_tree_pmac(void) { }
2916-
#endif
29172905

2918-
#ifdef CONFIG_PPC_EFIKA
29192906
/*
29202907
* The MPC5200 FEC driver requires an phy-handle property to tell it how
29212908
* to talk to the phy. If the phy-handle property is missing, then this
@@ -3047,11 +3034,7 @@ static void __init fixup_device_tree_efika(void)
30473034
/* Make sure ethernet phy-handle property exists */
30483035
fixup_device_tree_efika_add_phy();
30493036
}
3050-
#else
3051-
#define fixup_device_tree_efika()
3052-
#endif
30533037

3054-
#ifdef CONFIG_PPC_PASEMI_NEMO
30553038
/*
30563039
* CFE supplied on Nemo is broken in several ways, biggest
30573040
* problem is that it reassigns ISA interrupts to unused mpic ints.
@@ -3127,17 +3110,23 @@ static void __init fixup_device_tree_pasemi(void)
31273110

31283111
prom_setprop(iob, name, "device_type", "isa", sizeof("isa"));
31293112
}
3130-
#else /* !CONFIG_PPC_PASEMI_NEMO */
3131-
static inline void fixup_device_tree_pasemi(void) { }
3132-
#endif
31333113

31343114
static void __init fixup_device_tree(void)
31353115
{
3136-
fixup_device_tree_chrp();
3137-
fixup_device_tree_pmac();
3138-
fixup_device_tree_pmac64();
3139-
fixup_device_tree_efika();
3140-
fixup_device_tree_pasemi();
3116+
if (IS_ENABLED(CONFIG_PPC_CHRP))
3117+
fixup_device_tree_chrp();
3118+
3119+
if (IS_ENABLED(CONFIG_PPC_PMAC))
3120+
fixup_device_tree_pmac();
3121+
3122+
if (IS_ENABLED(CONFIG_PPC_PMAC) && IS_ENABLED(CONFIG_PPC64))
3123+
fixup_device_tree_pmac64();
3124+
3125+
if (IS_ENABLED(CONFIG_PPC_EFIKA))
3126+
fixup_device_tree_efika();
3127+
3128+
if (IS_ENABLED(CONFIG_PPC_PASEMI_NEMO))
3129+
fixup_device_tree_pasemi();
31413130
}
31423131

31433132
static void __init prom_find_boot_cpu(void)

arch/powerpc/platforms/pseries/iommu.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,8 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn)
16501650
iommu_table_setparms_common(newtbl, pci->phb->bus->number, create.liobn,
16511651
dynamic_addr, dynamic_len, page_shift, NULL,
16521652
&iommu_table_lpar_multi_ops);
1653-
iommu_init_table(newtbl, pci->phb->node, start, end);
1653+
iommu_init_table(newtbl, pci->phb->node,
1654+
start >> page_shift, end >> page_shift);
16541655

16551656
pci->table_group->tables[default_win_removed ? 0 : 1] = newtbl;
16561657

@@ -2065,7 +2066,9 @@ static long spapr_tce_create_table(struct iommu_table_group *table_group, int nu
20652066
offset, 1UL << window_shift,
20662067
IOMMU_PAGE_SHIFT_4K, NULL,
20672068
&iommu_table_lpar_multi_ops);
2068-
iommu_init_table(tbl, pci->phb->node, start, end);
2069+
iommu_init_table(tbl, pci->phb->node,
2070+
start >> IOMMU_PAGE_SHIFT_4K,
2071+
end >> IOMMU_PAGE_SHIFT_4K);
20692072

20702073
table_group->tables[0] = tbl;
20712074

@@ -2136,7 +2139,7 @@ static long spapr_tce_create_table(struct iommu_table_group *table_group, int nu
21362139
/* New table for using DDW instead of the default DMA window */
21372140
iommu_table_setparms_common(tbl, pci->phb->bus->number, create.liobn, win_addr,
21382141
1UL << len, page_shift, NULL, &iommu_table_lpar_multi_ops);
2139-
iommu_init_table(tbl, pci->phb->node, start, end);
2142+
iommu_init_table(tbl, pci->phb->node, start >> page_shift, end >> page_shift);
21402143

21412144
pci->table_group->tables[num] = tbl;
21422145
set_iommu_table_base(&pdev->dev, tbl);

tools/testing/selftests/powerpc/benchmarks/gettimeofday.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static int test_gettimeofday(void)
2020
gettimeofday(&tv_end, NULL);
2121
}
2222

23-
timersub(&tv_start, &tv_end, &tv_diff);
23+
timersub(&tv_end, &tv_start, &tv_diff);
2424

2525
printf("time = %.6f\n", tv_diff.tv_sec + (tv_diff.tv_usec) * 1e-6);
2626

0 commit comments

Comments
 (0)