OSDN Git Service

powerpc/machdep: Remove stale functions from ppc_md structure
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Tue, 31 Aug 2021 08:30:24 +0000 (08:30 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 22 Oct 2021 04:22:05 +0000 (15:22 +1100)
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
arch/powerpc/include/asm/iommu.h
arch/powerpc/include/asm/kexec.h
arch/powerpc/include/asm/machdep.h
arch/powerpc/kernel/setup-common.c
arch/powerpc/kernel/swsusp_64.c
arch/powerpc/kernel/swsusp_asm64.S
arch/powerpc/kexec/core.c
arch/powerpc/kexec/core_32.c
arch/powerpc/kexec/core_64.c

index bf3b841..c361212 100644 (file)
@@ -280,12 +280,6 @@ extern void iommu_init_early_dart(struct pci_controller_ops *controller_ops);
 extern void iommu_init_early_pasemi(void);
 
 #if defined(CONFIG_PPC64) && defined(CONFIG_PM)
-static inline void iommu_save(void)
-{
-       if (ppc_md.iommu_save)
-               ppc_md.iommu_save();
-}
-
 static inline void iommu_restore(void)
 {
        if (ppc_md.iommu_restore)
index 88d0d7c..c6f250e 100644 (file)
@@ -79,7 +79,6 @@ extern int crash_wake_offline;
 struct kimage;
 struct pt_regs;
 extern void default_machine_kexec(struct kimage *image);
-extern int default_machine_kexec_prepare(struct kimage *image);
 extern void default_machine_crash_shutdown(struct pt_regs *regs);
 extern int crash_shutdown_register(crash_shutdown_t handler);
 extern int crash_shutdown_unregister(crash_shutdown_t handler);
index 764f273..a683110 100644 (file)
@@ -29,7 +29,6 @@ struct machdep_calls {
        char            *name;
 #ifdef CONFIG_PPC64
 #ifdef CONFIG_PM
-       void            (*iommu_save)(void);
        void            (*iommu_restore)(void);
 #endif
 #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
@@ -43,7 +42,6 @@ struct machdep_calls {
        void            (*setup_arch)(void); /* Optional, may be NULL */
        /* Optional, may be NULL. */
        void            (*show_cpuinfo)(struct seq_file *m);
-       void            (*show_percpuinfo)(struct seq_file *m, int i);
        /* Returns the current operating frequency of "cpu" in Hz */
        unsigned long   (*get_proc_freq)(unsigned int cpu);
 
@@ -74,8 +72,6 @@ struct machdep_calls {
        int             (*set_rtc_time)(struct rtc_time *);
        void            (*get_rtc_time)(struct rtc_time *);
        time64_t        (*get_boot_time)(void);
-       unsigned char   (*rtc_read_val)(int addr);
-       void            (*rtc_write_val)(int addr, unsigned char val);
 
        void            (*calibrate_decr)(void);
 
@@ -141,8 +137,6 @@ struct machdep_calls {
           May be NULL. */
        void            (*init)(void);
 
-       void            (*kgdb_map_scc)(void);
-
        /*
         * optional PCI "hooks"
         */
@@ -187,13 +181,6 @@ struct machdep_calls {
 #ifdef CONFIG_KEXEC_CORE
        void (*kexec_cpu_down)(int crash_shutdown, int secondary);
 
-       /* Called to do what every setup is needed on image and the
-        * reboot code buffer. Returns 0 on success.
-        * Provide your own (maybe dummy) implementation if your platform
-        * claims to support kexec.
-        */
-       int (*machine_kexec_prepare)(struct kimage *image);
-
        /* Called to perform the _real_ kexec.
         * Do NOT allocate memory or fail here. We are past the point of
         * no return.
index b1e43b6..0b7894e 100644 (file)
@@ -278,9 +278,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                seq_printf(m, "clock\t\t: %lu.%06luMHz\n",
                           proc_freq / 1000000, proc_freq % 1000000);
 
-       if (ppc_md.show_percpuinfo != NULL)
-               ppc_md.show_percpuinfo(m, cpu_id);
-
        /* If we are a Freescale core do a simple check so
         * we dont have to keep adding cases in the future */
        if (PVR_VER(pvr) & 0x8000) {
index aeea97a..16ee3ba 100644 (file)
@@ -17,8 +17,3 @@ void do_after_copyback(void)
        touch_softlockup_watchdog();
        mb();
 }
-
-void _iommu_save(void)
-{
-       iommu_save();
-}
index 6d31898..96bb207 100644 (file)
@@ -128,7 +128,6 @@ END_FW_FTR_SECTION_IFCLR(FW_FEATURE_LPAR)
         * stack pointer on the stack like a real stackframe */
        addi    r1,r1,-128
 
-       bl _iommu_save
        bl swsusp_save
 
        /* restore LR */
index 48525e8..a224201 100644 (file)
@@ -48,19 +48,6 @@ void machine_crash_shutdown(struct pt_regs *regs)
        default_machine_crash_shutdown(regs);
 }
 
-/*
- * Do what every setup is needed on image and the
- * reboot code buffer to allow us to avoid allocations
- * later.
- */
-int machine_kexec_prepare(struct kimage *image)
-{
-       if (ppc_md.machine_kexec_prepare)
-               return ppc_md.machine_kexec_prepare(image);
-       else
-               return default_machine_kexec_prepare(image);
-}
-
 void machine_kexec_cleanup(struct kimage *image)
 {
 }
index bf9f1f9..b50aed4 100644 (file)
@@ -63,7 +63,7 @@ void default_machine_kexec(struct kimage *image)
        (*rnk)(page_list, reboot_code_buffer_phys, image->start);
 }
 
-int default_machine_kexec_prepare(struct kimage *image)
+int machine_kexec_prepare(struct kimage *image)
 {
        return 0;
 }
index 89c069d..6667851 100644 (file)
@@ -32,7 +32,7 @@
 #include <asm/svm.h>
 #include <asm/ultravisor.h>
 
-int default_machine_kexec_prepare(struct kimage *image)
+int machine_kexec_prepare(struct kimage *image)
 {
        int i;
        unsigned long begin, end;       /* limits of segment */