forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/arch/ia64/kernel/uncached.c
....@@ -1,9 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2001-2008 Silicon Graphics, Inc. All rights reserved.
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms of version 2 of the GNU General Public License
6
- * as published by the Free Software Foundation.
74 *
85 * A simple uncached page allocator using the generic allocator. This
96 * allocator first utilizes the spare (spill) pages found in the EFI
....@@ -22,12 +19,11 @@
2219 #include <linux/nmi.h>
2320 #include <linux/genalloc.h>
2421 #include <linux/gfp.h>
22
+#include <linux/pgtable.h>
2523 #include <asm/page.h>
2624 #include <asm/pal.h>
27
-#include <asm/pgtable.h>
2825 #include <linux/atomic.h>
2926 #include <asm/tlbflush.h>
30
-#include <asm/sn/arch.h>
3127
3228
3329 extern void __init efi_memmap_walk_uc(efi_freemem_callback_t, void *);
....@@ -124,18 +120,15 @@
124120 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
125121 if (status == PAL_VISIBILITY_OK_REMOTE_NEEDED) {
126122 atomic_set(&uc_pool->status, 0);
127
- status = smp_call_function(uncached_ipi_visibility, uc_pool, 1);
128
- if (status || atomic_read(&uc_pool->status))
123
+ smp_call_function(uncached_ipi_visibility, uc_pool, 1);
124
+ if (atomic_read(&uc_pool->status))
129125 goto failed;
130126 } else if (status != PAL_VISIBILITY_OK)
131127 goto failed;
132128
133129 preempt_disable();
134130
135
- if (ia64_platform_is("sn2"))
136
- sn_flush_all_caches(uc_addr, IA64_GRANULE_SIZE);
137
- else
138
- flush_icache_range(uc_addr, uc_addr + IA64_GRANULE_SIZE);
131
+ flush_icache_range(uc_addr, uc_addr + IA64_GRANULE_SIZE);
139132
140133 /* flush the just introduced uncached translation from the TLB */
141134 local_flush_tlb_all();
....@@ -146,8 +139,8 @@
146139 if (status != PAL_STATUS_SUCCESS)
147140 goto failed;
148141 atomic_set(&uc_pool->status, 0);
149
- status = smp_call_function(uncached_ipi_mc_drain, uc_pool, 1);
150
- if (status || atomic_read(&uc_pool->status))
142
+ smp_call_function(uncached_ipi_mc_drain, uc_pool, 1);
143
+ if (atomic_read(&uc_pool->status))
151144 goto failed;
152145
153146 /*