Re: [PATCH] sparc32: remove deadwood swift_flush_tlb_page() debug code

Andreas Larsson <[email protected]> Fri, 12 Jun 2026 11:11:22 +0200
Newsgroups org.kernel.vger.sparclinux,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 2026-03-21 11:59, Kexin Sun wrote:
> Remove an #if 0 block that has been dead since at least
> Linux 2.6.12.  The block was marked "P3: deadwood to debug
> precise flushes on Swift" and contained a never-compiled
> alternative implementation of swift_flush_tlb_page().  It also
> referenced the since-removed srmmu_flush_tlb_page(), dropped
> in commit 3d5f7d37c8b4 ("sparc32: drop unused functions in
> pgtsrmmu.h").
> 
> Assisted-by: unnamed:deepseek-v3.2 coccinelle
> Signed-off-by: Kexin Sun <[email protected]>
> ---
>  arch/sparc/mm/srmmu.c | 29 -----------------------------
>  1 file changed, 29 deletions(-)
> 
> diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
> index 1b24c5e8d73d..9a74902ad181 100644
> --- a/arch/sparc/mm/srmmu.c
> +++ b/arch/sparc/mm/srmmu.c
> @@ -581,35 +581,6 @@ extern void swift_flush_tlb_range(struct vm_area_struct *vma,
>  				  unsigned long start, unsigned long end);
>  extern void swift_flush_tlb_page(struct vm_area_struct *vma, unsigned long page);
>  
> -#if 0  /* P3: deadwood to debug precise flushes on Swift. */
> -void swift_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
> -{
> -	int cctx, ctx1;
> -
> -	page &= PAGE_MASK;
> -	if ((ctx1 = vma->vm_mm->context) != -1) {
> -		cctx = srmmu_get_context();
> -/* Is context # ever different from current context? P3 */
> -		if (cctx != ctx1) {
> -			printk("flush ctx %02x curr %02x\n", ctx1, cctx);
> -			srmmu_set_context(ctx1);
> -			swift_flush_page(page);
> -			__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
> -					"r" (page), "i" (ASI_M_FLUSH_PROBE));
> -			srmmu_set_context(cctx);
> -		} else {
> -			 /* Rm. prot. bits from virt. c. */
> -			/* swift_flush_cache_all(); */
> -			/* swift_flush_cache_page(vma, page); */
> -			swift_flush_page(page);
> -
> -			__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
> -				"r" (page), "i" (ASI_M_FLUSH_PROBE));
> -			/* same as above: srmmu_flush_tlb_page() */
> -		}
> -	}
> -}
> -#endif
>  
>  /*
>   * The following are all MBUS based SRMMU modules, and therefore could

Reviewed-by: Andreas Larsson <[email protected]>

Picking this up to my for-next.

Thanks,
Andreas