Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/machdep: Remove stale functions from ppc_md structure

ppc_md.iommu_save() is not set anymore by any platform after
commit c40785ad305b ("powerpc/dart: Use a cachable DART").
So iommu_save() has become a nop and can be removed.

ppc_md.show_percpuinfo() is not set anymore by any platform after
commit 4350147a816b ("[PATCH] ppc64: SMU based macs cpufreq support").

Last users of ppc_md.rtc_read_val() and ppc_md.rtc_write_val() were
removed by commit 0f03a43b8f0f ("[POWERPC] Remove todc code from
ARCH=powerpc")

Last user of kgdb_map_scc() was removed by commit 17ce452f7ea3 ("kgdb,
powerpc: arch specific powerpc kgdb support").

ppc.machine_kexec_prepare() has not been used since
commit 8ee3e0d69623 ("powerpc: Remove the main legacy iSerie platform
code"). This allows the removal of machine_kexec_prepare() and the
rename of default_machine_kexec_prepare() into machine_kexec_prepare()

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Daniel Axtens <dja@axtens.net>
[mpe: Drop prototype for default_machine_kexec_prepare() as noted by dja]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/24d4ca0ada683c9436a5f812a7aeb0a1362afa2b.1630398606.git.christophe.leroy@csgroup.eu

authored by

Christophe Leroy and committed by
Michael Ellerman
8f7fadb4 e606a2f4

+2 -44
-6
arch/powerpc/include/asm/iommu.h
··· 280 280 extern void iommu_init_early_pasemi(void); 281 281 282 282 #if defined(CONFIG_PPC64) && defined(CONFIG_PM) 283 - static inline void iommu_save(void) 284 - { 285 - if (ppc_md.iommu_save) 286 - ppc_md.iommu_save(); 287 - } 288 - 289 283 static inline void iommu_restore(void) 290 284 { 291 285 if (ppc_md.iommu_restore)
-1
arch/powerpc/include/asm/kexec.h
··· 79 79 struct kimage; 80 80 struct pt_regs; 81 81 extern void default_machine_kexec(struct kimage *image); 82 - extern int default_machine_kexec_prepare(struct kimage *image); 83 82 extern void default_machine_crash_shutdown(struct pt_regs *regs); 84 83 extern int crash_shutdown_register(crash_shutdown_t handler); 85 84 extern int crash_shutdown_unregister(crash_shutdown_t handler);
-13
arch/powerpc/include/asm/machdep.h
··· 29 29 char *name; 30 30 #ifdef CONFIG_PPC64 31 31 #ifdef CONFIG_PM 32 - void (*iommu_save)(void); 33 32 void (*iommu_restore)(void); 34 33 #endif 35 34 #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE ··· 42 43 void (*setup_arch)(void); /* Optional, may be NULL */ 43 44 /* Optional, may be NULL. */ 44 45 void (*show_cpuinfo)(struct seq_file *m); 45 - void (*show_percpuinfo)(struct seq_file *m, int i); 46 46 /* Returns the current operating frequency of "cpu" in Hz */ 47 47 unsigned long (*get_proc_freq)(unsigned int cpu); 48 48 ··· 72 74 int (*set_rtc_time)(struct rtc_time *); 73 75 void (*get_rtc_time)(struct rtc_time *); 74 76 time64_t (*get_boot_time)(void); 75 - unsigned char (*rtc_read_val)(int addr); 76 - void (*rtc_write_val)(int addr, unsigned char val); 77 77 78 78 void (*calibrate_decr)(void); 79 79 ··· 137 141 May be NULL. */ 138 142 void (*init)(void); 139 143 140 - void (*kgdb_map_scc)(void); 141 - 142 144 /* 143 145 * optional PCI "hooks" 144 146 */ ··· 180 186 181 187 #ifdef CONFIG_KEXEC_CORE 182 188 void (*kexec_cpu_down)(int crash_shutdown, int secondary); 183 - 184 - /* Called to do what every setup is needed on image and the 185 - * reboot code buffer. Returns 0 on success. 186 - * Provide your own (maybe dummy) implementation if your platform 187 - * claims to support kexec. 188 - */ 189 - int (*machine_kexec_prepare)(struct kimage *image); 190 189 191 190 /* Called to perform the _real_ kexec. 192 191 * Do NOT allocate memory or fail here. We are past the point of
-3
arch/powerpc/kernel/setup-common.c
··· 278 278 seq_printf(m, "clock\t\t: %lu.%06luMHz\n", 279 279 proc_freq / 1000000, proc_freq % 1000000); 280 280 281 - if (ppc_md.show_percpuinfo != NULL) 282 - ppc_md.show_percpuinfo(m, cpu_id); 283 - 284 281 /* If we are a Freescale core do a simple check so 285 282 * we dont have to keep adding cases in the future */ 286 283 if (PVR_VER(pvr) & 0x8000) {
-5
arch/powerpc/kernel/swsusp_64.c
··· 17 17 touch_softlockup_watchdog(); 18 18 mb(); 19 19 } 20 - 21 - void _iommu_save(void) 22 - { 23 - iommu_save(); 24 - }
-1
arch/powerpc/kernel/swsusp_asm64.S
··· 128 128 * stack pointer on the stack like a real stackframe */ 129 129 addi r1,r1,-128 130 130 131 - bl _iommu_save 132 131 bl swsusp_save 133 132 134 133 /* restore LR */
-13
arch/powerpc/kexec/core.c
··· 48 48 default_machine_crash_shutdown(regs); 49 49 } 50 50 51 - /* 52 - * Do what every setup is needed on image and the 53 - * reboot code buffer to allow us to avoid allocations 54 - * later. 55 - */ 56 - int machine_kexec_prepare(struct kimage *image) 57 - { 58 - if (ppc_md.machine_kexec_prepare) 59 - return ppc_md.machine_kexec_prepare(image); 60 - else 61 - return default_machine_kexec_prepare(image); 62 - } 63 - 64 51 void machine_kexec_cleanup(struct kimage *image) 65 52 { 66 53 }
+1 -1
arch/powerpc/kexec/core_32.c
··· 63 63 (*rnk)(page_list, reboot_code_buffer_phys, image->start); 64 64 } 65 65 66 - int default_machine_kexec_prepare(struct kimage *image) 66 + int machine_kexec_prepare(struct kimage *image) 67 67 { 68 68 return 0; 69 69 }
+1 -1
arch/powerpc/kexec/core_64.c
··· 32 32 #include <asm/svm.h> 33 33 #include <asm/ultravisor.h> 34 34 35 - int default_machine_kexec_prepare(struct kimage *image) 35 + int machine_kexec_prepare(struct kimage *image) 36 36 { 37 37 int i; 38 38 unsigned long begin, end; /* limits of segment */