aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-27 20:13:29 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-27 20:13:29 -0400
commit3f66c315f5929d0ad19d8e9d29c8001543aa9be2 (patch)
tree61a61a3d6558963d1dc6583e3ea67632560cf9c0
parent5c2aae8355f7ec1341d5c473c500a77bbfa7f701 (diff)
parentbee7f9c83e1d18af6fee06b97b6558cbd1cded45 (diff)
Merge branch 'acpi-tables'
* acpi-tables: ACPI / x86: Increase override tables number limit
-rw-r--r--arch/x86/include/asm/acpi.h1
-rw-r--r--drivers/acpi/osl.c44
2 files changed, 33 insertions, 12 deletions
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
index b1977bad5435..c8c1e700c26e 100644
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -26,6 +26,7 @@
26#include <acpi/pdc_intel.h> 26#include <acpi/pdc_intel.h>
27 27
28#include <asm/numa.h> 28#include <asm/numa.h>
29#include <asm/fixmap.h>
29#include <asm/processor.h> 30#include <asm/processor.h>
30#include <asm/mmu.h> 31#include <asm/mmu.h>
31#include <asm/mpspec.h> 32#include <asm/mpspec.h>
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index e5f416c7f66e..88bb9d05b038 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -569,8 +569,10 @@ static const char * const table_sigs[] = {
569 569
570#define ACPI_HEADER_SIZE sizeof(struct acpi_table_header) 570#define ACPI_HEADER_SIZE sizeof(struct acpi_table_header)
571 571
572/* Must not increase 10 or needs code modification below */ 572#define ACPI_OVERRIDE_TABLES 64
573#define ACPI_OVERRIDE_TABLES 10 573static struct cpio_data __initdata acpi_initrd_files[ACPI_OVERRIDE_TABLES];
574
575#define MAP_CHUNK_SIZE (NR_FIX_BTMAPS << PAGE_SHIFT)
574 576
575void __init acpi_initrd_override(void *data, size_t size) 577void __init acpi_initrd_override(void *data, size_t size)
576{ 578{
@@ -579,8 +581,6 @@ void __init acpi_initrd_override(void *data, size_t size)
579 struct acpi_table_header *table; 581 struct acpi_table_header *table;
580 char cpio_path[32] = "kernel/firmware/acpi/"; 582 char cpio_path[32] = "kernel/firmware/acpi/";
581 struct cpio_data file; 583 struct cpio_data file;
582 struct cpio_data early_initrd_files[ACPI_OVERRIDE_TABLES];
583 char *p;
584 584
585 if (data == NULL || size == 0) 585 if (data == NULL || size == 0)
586 return; 586 return;
@@ -625,8 +625,8 @@ void __init acpi_initrd_override(void *data, size_t size)
625 table->signature, cpio_path, file.name, table->length); 625 table->signature, cpio_path, file.name, table->length);
626 626
627 all_tables_size += table->length; 627 all_tables_size += table->length;
628 early_initrd_files[table_nr].data = file.data; 628 acpi_initrd_files[table_nr].data = file.data;
629 early_initrd_files[table_nr].size = file.size; 629 acpi_initrd_files[table_nr].size = file.size;
630 table_nr++; 630 table_nr++;
631 } 631 }
632 if (table_nr == 0) 632 if (table_nr == 0)
@@ -652,14 +652,34 @@ void __init acpi_initrd_override(void *data, size_t size)
652 memblock_reserve(acpi_tables_addr, all_tables_size); 652 memblock_reserve(acpi_tables_addr, all_tables_size);
653 arch_reserve_mem_area(acpi_tables_addr, all_tables_size); 653 arch_reserve_mem_area(acpi_tables_addr, all_tables_size);
654 654
655 p = early_ioremap(acpi_tables_addr, all_tables_size); 655 /*
656 656 * early_ioremap only can remap 256k one time. If we map all
657 * tables one time, we will hit the limit. Need to map chunks
658 * one by one during copying the same as that in relocate_initrd().
659 */
657 for (no = 0; no < table_nr; no++) { 660 for (no = 0; no < table_nr; no++) {
658 memcpy(p + total_offset, early_initrd_files[no].data, 661 unsigned char *src_p = acpi_initrd_files[no].data;
659 early_initrd_files[no].size); 662 phys_addr_t size = acpi_initrd_files[no].size;
660 total_offset += early_initrd_files[no].size; 663 phys_addr_t dest_addr = acpi_tables_addr + total_offset;
664 phys_addr_t slop, clen;
665 char *dest_p;
666
667 total_offset += size;
668
669 while (size) {
670 slop = dest_addr & ~PAGE_MASK;
671 clen = size;
672 if (clen > MAP_CHUNK_SIZE - slop)
673 clen = MAP_CHUNK_SIZE - slop;
674 dest_p = early_ioremap(dest_addr & PAGE_MASK,
675 clen + slop);
676 memcpy(dest_p + slop, src_p, clen);
677 early_iounmap(dest_p, clen + slop);
678 src_p += clen;
679 dest_addr += clen;
680 size -= clen;
681 }
661 } 682 }
662 early_iounmap(p, all_tables_size);
663} 683}
664#endif /* CONFIG_ACPI_INITRD_TABLE_OVERRIDE */ 684#endif /* CONFIG_ACPI_INITRD_TABLE_OVERRIDE */
665 685