[PATCH] parisc: check hardcoded value of SHMLBA against value reported by firmware

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Our value of SHMLBA is hardcoded to 4MB on parisc due to aliasing restrictions
of the platform. The firmware function PDC_CACHE does return the machine
dependend value of this aliasing requirement.
So, if there is a difference between those two - which we don't expect - let's
report it at least.

Signed-off-by: Helge Deller <deller@xxxxxx>

diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index c035673..3523e20 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -142,6 +142,15 @@ parisc_cache_init(void)
 	if (pdc_cache_info(&cache_info) < 0)
 		panic("parisc_cache_init: pdc_cache_info failed");
 
+	/*
+	 * The alias field returned by PDC_CACHE specifies the aliasing
+	 * boundaries for virtual addresses.  So, let's verify if our hardcoded
+	 * value of SHMLBA (4 MB) is correct for this machine.
+	 */
+	if ((4096UL << (cache_info.dc_conf.cc_alias-1)) != SHMLBA)
+		pr_warn("WARNING: PDC_CACHE returns aliasing of %lu kB.\n",
+			(4UL << (cache_info.dc_conf.cc_alias-1)));
+
 #if 0
 	printk("ic_size %lx dc_size %lx it_size %lx\n",
 		cache_info.ic_size,
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux