History

Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft

* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft: ibft: Fix finding IBFT ACPI table on UEFI

Linus Torvalds committed 14 years ago

Commit 6f12d2e2 parents 88703f2 935a9fe2 files · +42 −26Browse files

Unified · Split

2 files
  1. drivers/firmware/iscsi_ibft.c +40 −2
  2. drivers/firmware/iscsi_ibft_find.c +2 −24
drivers/firmware/iscsi_ibft.c+40−2
@@ -746,6 +746,37 @@ static void __exit ibft_exit(void) · 745 unmodified lines
746746 ibft_cleanup();
747747 }
748748
749+#ifdef CONFIG_ACPI
750+static const struct {
751+ char *sign;
752+} ibft_signs[] = {
753+ /*
754+ * One spec says "IBFT", the other says "iBFT". We have to check
755+ * for both.
756+ */
757+ { ACPI_SIG_IBFT },
758+ { "iBFT" },
759+};
760+
761+static void __init acpi_find_ibft_region(void)
762+{
763+ int i;
764+ struct acpi_table_header *table = NULL;
765+
766+ if (acpi_disabled)
767+ return;
768+
769+ for (i = 0; i < ARRAY_SIZE(ibft_signs) && !ibft_addr; i++) {
770+ acpi_get_table(ibft_signs[i].sign, 0, &table);
771+ ibft_addr = (struct acpi_table_ibft *)table;
772+ }
773+}
774+#else
775+static void __init acpi_find_ibft_region(void)
776+{
777+}
778+#endif
779+
749780 /*
750781 * ibft_init() - creates sysfs tree entries for the iBFT data.
751782 */
@@ -753,9 +784,16 @@ static int __init ibft_init(void) · 1 unmodified line
753784 {
754785 int rc = 0;
755786
787+ /*
788+ As on UEFI systems the setup_arch()/find_ibft_region()
789+ is called before ACPI tables are parsed and it only does
790+ legacy finding.
791+ */
792+ if (!ibft_addr)
793+ acpi_find_ibft_region();
794+
756795 if (ibft_addr) {
757− printk(KERN_INFO "iBFT detected at 0x%llx.\n",
758− (u64)isa_virt_to_bus(ibft_addr));
796+ pr_info("iBFT detected.\n");
759797
760798 rc = ibft_check_device();
761799 if (rc)
drivers/firmware/iscsi_ibft_find.c+2−24
@@ -45,13 +45,6 @@ EXPORT_SYMBOL_GPL(ibft_addr); · 44 unmodified lines
4545 static const struct {
4646 char *sign;
4747 } ibft_signs[] = {
48−#ifdef CONFIG_ACPI
49− /*
50− * One spec says "IBFT", the other says "iBFT". We have to check
51− * for both.
52− */
53− { ACPI_SIG_IBFT },
54−#endif
5548 { "iBFT" },
5649 { "BIFT" }, /* Broadcom iSCSI Offload */
5750 };
@@ -62,14 +55,6 @@ static const struct { · 4 unmodified lines
6255 #define VGA_MEM 0xA0000 /* VGA buffer */
6356 #define VGA_SIZE 0x20000 /* 128kB */
6457
65−#ifdef CONFIG_ACPI
66−static int __init acpi_find_ibft(struct acpi_table_header *header)
67−{
68− ibft_addr = (struct acpi_table_ibft *)header;
69− return 0;
70−}
71−#endif /* CONFIG_ACPI */
72−
7358 static int __init find_ibft_in_mem(void)
7459 {
7560 unsigned long pos;
@@ -94,6 +79,7 @@ static int __init find_ibft_in_mem(void) · 18 unmodified lines
9479 * the table cannot be valid. */
9580 if (pos + len <= (IBFT_END-1)) {
9681 ibft_addr = (struct acpi_table_ibft *)virt;
82+ pr_info("iBFT found at 0x%lx.\n", pos);
9783 goto done;
9884 }
9985 }
@@ -108,20 +94,12 @@ done: · 8 unmodified lines
10894 */
10995 unsigned long __init find_ibft_region(unsigned long *sizep)
11096 {
111−#ifdef CONFIG_ACPI
112− int i;
113−#endif
11497 ibft_addr = NULL;
11598
116−#ifdef CONFIG_ACPI
117− for (i = 0; i < ARRAY_SIZE(ibft_signs) && !ibft_addr; i++)
118− acpi_table_parse(ibft_signs[i].sign, acpi_find_ibft);
119−#endif /* CONFIG_ACPI */
120−
12199 /* iBFT 1.03 section 1.4.3.1 mandates that UEFI machines will
122100 * only use ACPI for this */
123101
124− if (!ibft_addr && !efi_enabled)
102+ if (!efi_enabled)
125103 find_ibft_in_mem();
126104
127105 if (ibft_addr) {