public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ibft: Fix finding ibft with ACPI tables
@ 2011-12-08  8:22 Yinghai Lu
  2011-12-08 14:29 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 10+ messages in thread
From: Yinghai Lu @ 2011-12-08  8:22 UTC (permalink / raw)
  To: Peter Jones, Konrad Rzeszutek Wilk
  Cc: Ingo Molnar, linux-kernel@vger.kernel.org, Andrew Morton

Found one system with UEFI/iBFT is not detected.

the root cause: for x86, We move calling of find_ibft_region() much earlier.
in setup_arch() before ACPI is enabled.

Try to all find_ibft_region() second times in ibft_init()

at that time ACPI iBFT already get permanent mapped with ioremap.
So isa_virt_to_bus will get wrong phys from right virt address.
We could just skip that printing.
For legacy one, print the found address early.

Signed-off-by: Yinghai Lu <yinghai.lu@kernel.org>

---
 drivers/firmware/iscsi_ibft.c      |   18 +++++++++++++++---
 drivers/firmware/iscsi_ibft_find.c |    1 +
 2 files changed, 16 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/firmware/iscsi_ibft.c
===================================================================
--- linux-2.6.orig/drivers/firmware/iscsi_ibft.c
+++ linux-2.6/drivers/firmware/iscsi_ibft.c
@@ -753,9 +753,21 @@ static int __init ibft_init(void)
 {
 	int rc = 0;
 
+	/* find that from acpi tables */
+	if (!ibft_addr) {
+		unsigned long size = 0;
+
+		find_ibft_region(&size);
+		barrier();
+	}
+
 	if (ibft_addr) {
-		printk(KERN_INFO "iBFT detected at 0x%llx.\n",
-		       (u64)isa_virt_to_bus(ibft_addr));
+		/*
+		 * Second try is from acpi permanent map with ioremap
+		 *  can not simply convert back to phys addr.
+		 *  and We don't need to print that table phys addr.
+		 */
+		pr_info("iBFT detected.\n");
 
 		rc = ibft_check_device();
 		if (rc)
@@ -770,7 +782,7 @@ static int __init ibft_init(void)
 		if (rc)
 			goto out_free;
 	} else
-		printk(KERN_INFO "No iBFT detected.\n");
+		pr_info("No iBFT detected.\n");
 
 	return 0;
 
Index: linux-2.6/drivers/firmware/iscsi_ibft_find.c
===================================================================
--- linux-2.6.orig/drivers/firmware/iscsi_ibft_find.c
+++ linux-2.6/drivers/firmware/iscsi_ibft_find.c
@@ -94,6 +94,7 @@ static int __init find_ibft_in_mem(void)
 				 * the table cannot be valid. */
 				if (pos + len <= (IBFT_END-1)) {
 					ibft_addr = (struct acpi_table_ibft *)virt;
+					pr_info("iBFT found at 0x%lx.\n", pos);
 					goto done;
 				}
 			}

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-12-12 20:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-08  8:22 [PATCH] ibft: Fix finding ibft with ACPI tables Yinghai Lu
2011-12-08 14:29 ` Konrad Rzeszutek Wilk
2011-12-08 15:01   ` Peter Jones
2011-12-08 16:51   ` Yinghai Lu
2011-12-08 16:52   ` [PATCH -v2] ibft: Fix finding IBFT ACPI table on UEFI Yinghai Lu
2011-12-08 19:08     ` Konrad Rzeszutek Wilk
2011-12-08 21:16       ` Yinghai Lu
2011-12-08 21:17       ` [PATCH -v3] " Yinghai Lu
2011-12-12 17:17         ` Konrad Rzeszutek Wilk
2011-12-12 20:39           ` Yinghai Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox