Merge patch series "riscv: some CMO alternative related clean up"
These cleanups came up as part of the discussion on the "riscv: Reduce ARCH_KMALLOC_MINALIGN to 8" patch set, but that needs additional work and thus will be delayed at least a cycle. * b4-shazam-merge: riscv: mm: mark noncoherent_supported as __ro_after_init riscv: mm: mark CBO relate initialization funcs as __init riscv: errata: thead: only set cbom size & noncoherent during boot Link: https://lore.kernel.org/linux-riscv/20230526165958.908-1-jszhang@kernel.org/ Link: https://lore.kernel.org/r/20230614165504.532-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
This commit is contained in:
commit
e8605e8fdf
|
@ -45,8 +45,11 @@ static bool errata_probe_cmo(unsigned int stage,
|
||||||
if (stage == RISCV_ALTERNATIVES_EARLY_BOOT)
|
if (stage == RISCV_ALTERNATIVES_EARLY_BOOT)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (stage == RISCV_ALTERNATIVES_BOOT) {
|
||||||
riscv_cbom_block_size = L1_CACHE_BYTES;
|
riscv_cbom_block_size = L1_CACHE_BYTES;
|
||||||
riscv_noncoherent_supported();
|
riscv_noncoherent_supported();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ EXPORT_SYMBOL_GPL(riscv_cbom_block_size);
|
||||||
unsigned int riscv_cboz_block_size;
|
unsigned int riscv_cboz_block_size;
|
||||||
EXPORT_SYMBOL_GPL(riscv_cboz_block_size);
|
EXPORT_SYMBOL_GPL(riscv_cboz_block_size);
|
||||||
|
|
||||||
static void cbo_get_block_size(struct device_node *node,
|
static void __init cbo_get_block_size(struct device_node *node,
|
||||||
const char *name, u32 *block_size,
|
const char *name, u32 *block_size,
|
||||||
unsigned long *first_hartid)
|
unsigned long *first_hartid)
|
||||||
{
|
{
|
||||||
|
@ -126,7 +126,7 @@ static void cbo_get_block_size(struct device_node *node,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void riscv_init_cbo_blocksizes(void)
|
void __init riscv_init_cbo_blocksizes(void)
|
||||||
{
|
{
|
||||||
unsigned long cbom_hartid, cboz_hartid;
|
unsigned long cbom_hartid, cboz_hartid;
|
||||||
u32 cbom_block_size = 0, cboz_block_size = 0;
|
u32 cbom_block_size = 0, cboz_block_size = 0;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
#include <asm/cacheflush.h>
|
#include <asm/cacheflush.h>
|
||||||
|
|
||||||
static bool noncoherent_supported;
|
static bool noncoherent_supported __ro_after_init;
|
||||||
|
|
||||||
void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
|
void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
|
||||||
enum dma_data_direction dir)
|
enum dma_data_direction dir)
|
||||||
|
|
Loading…
Reference in New Issue