]> Git Repo - linux.git/commitdiff
Merge branches 'acpica', 'aml-custom', 'bugzilla-16548', 'bugzilla-20242', 'd3-cold...
authorLen Brown <[email protected]>
Sun, 29 May 2011 08:38:48 +0000 (04:38 -0400)
committerLen Brown <[email protected]>
Sun, 29 May 2011 08:38:48 +0000 (04:38 -0400)
1  2  3  4  5  6  7 
drivers/acpi/ec.c
drivers/acpi/osl.c
include/acpi/actypes.h

diff --combined drivers/acpi/ec.c
index fa848c4116a84b3572f0142ccb3d87df8dff2ada,fa848c4116a84b3572f0142ccb3d87df8dff2ada,fa848c4116a84b3572f0142ccb3d87df8dff2ada,62628e5eba399f0a781903e355198e2d28685f27,fa848c4116a84b3572f0142ccb3d87df8dff2ada,30ca71791bf2ad2bda6b478e6d6615525c89a319,fa848c4116a84b3572f0142ccb3d87df8dff2ada..0b954c6702be15bf6ffb378e8984536d8606d404
@@@@@@@@ -938,8 -938,8 -938,8 -938,16 -938,8 -938,11 -938,8 +938,19 @@@@@@@@ static struct dmi_system_id __initdata 
        ec_flag_msi, "MSI hardware", {
        DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-STAR")}, NULL},
        {
+++ +++ ec_flag_msi, "Quanta hardware", {
+++ +++ DMI_MATCH(DMI_SYS_VENDOR, "Quanta"),
+++ +++ DMI_MATCH(DMI_PRODUCT_NAME, "TW8/SW8/DW8"),}, NULL},
+++ +++ {
+++ +++ ec_flag_msi, "Quanta hardware", {
+++ +++ DMI_MATCH(DMI_SYS_VENDOR, "Quanta"),
+++ +++ DMI_MATCH(DMI_PRODUCT_NAME, "TW9/SW9"),}, NULL},
+++ +++ {
        ec_validate_ecdt, "ASUS hardware", {
        DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL},
+++++ + {
+++++ + ec_validate_ecdt, "ASUS hardware", {
+++++ + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc.") }, NULL},
        {},
       };
       
diff --combined drivers/acpi/osl.c
index cf750a7a952317376e0af14250b984e2b0de3f32,45ad4ffef5334ba692e7883515399f863fe22e24,45ad4ffef5334ba692e7883515399f863fe22e24,45ad4ffef5334ba692e7883515399f863fe22e24,45ad4ffef5334ba692e7883515399f863fe22e24,45ad4ffef5334ba692e7883515399f863fe22e24,c90c76aa7f8b79152ab4f449dbddbf9ba4983b93..52ca9649d76925abc1718e9c3bed4391cf189006
@@@@@@@@ -76,7 -76,6 -76,6 -76,6 -76,6 -76,6 -76,7 +76,6 @@@@@@@@ EXPORT_SYMBOL(acpi_in_debugger)
       extern char line_buf[80];
       #endif                           /*ENABLE_DEBUGGER */
       
-     -static unsigned int acpi_irq_irq;
       static acpi_osd_handler acpi_irq_handler;
       static void *acpi_irq_context;
       static struct workqueue_struct *kacpid_wq;
@@@@@@@@ -105,11 -104,11 -104,11 -104,11 -104,11 -104,11 -105,11 +104,11 @@@@@@@@ struct acpi_ioremap 
        void __iomem *virt;
        acpi_physical_address phys;
        acpi_size size;
-     - struct kref ref;
+     + unsigned long refcount;
       };
       
       static LIST_HEAD(acpi_ioremaps);
-     -static DEFINE_SPINLOCK(acpi_ioremap_lock);
+     +static DEFINE_MUTEX(acpi_ioremap_lock);
       
       static void __init acpi_osi_setup_late(void);
       
@@@@@@@@ -285,6 -284,22 -284,22 -284,22 -284,22 -284,22 -285,6 +284,22 @@@@@@@@ acpi_map_vaddr_lookup(acpi_physical_add
        return NULL;
       }
       
+     +void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size)
+     +{
+     + struct acpi_ioremap *map;
+     + void __iomem *virt = NULL;
+     +
+     + mutex_lock(&acpi_ioremap_lock);
+     + map = acpi_map_lookup(phys, size);
+     + if (map) {
+     +         virt = map->virt + (phys - map->phys);
+     +         map->refcount++;
+     + }
+     + mutex_unlock(&acpi_ioremap_lock);
+     + return virt;
+     +}
+     +EXPORT_SYMBOL_GPL(acpi_os_get_iomem);
+     +
       /* Must be called with 'acpi_ioremap_lock' or RCU read lock held. */
       static struct acpi_ioremap *
       acpi_map_lookup_virt(void __iomem *virt, acpi_size size)
       void __iomem *__init_refok
       acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
       {
-     - struct acpi_ioremap *map, *tmp_map;
-     - unsigned long flags;
+     + struct acpi_ioremap *map;
        void __iomem *virt;
        acpi_physical_address pg_off;
        acpi_size pg_sz;
        if (!acpi_gbl_permanent_mmap)
                return __acpi_map_table((unsigned long)phys, size);
       
+     + mutex_lock(&acpi_ioremap_lock);
+     + /* Check if there's a suitable mapping already. */
+     + map = acpi_map_lookup(phys, size);
+     + if (map) {
+     +         map->refcount++;
+     +         goto out;
+     + }
+     +
        map = kzalloc(sizeof(*map), GFP_KERNEL);
-     - if (!map)
+     + if (!map) {
+     +         mutex_unlock(&acpi_ioremap_lock);
                return NULL;
+     + }
       
        pg_off = round_down(phys, PAGE_SIZE);
        pg_sz = round_up(phys + size, PAGE_SIZE) - pg_off;
        virt = acpi_os_ioremap(pg_off, pg_sz);
        if (!virt) {
+     +         mutex_unlock(&acpi_ioremap_lock);
                kfree(map);
                return NULL;
        }
        map->virt = virt;
        map->phys = pg_off;
        map->size = pg_sz;
-     - kref_init(&map->ref);
-     -
-     - spin_lock_irqsave(&acpi_ioremap_lock, flags);
-     - /* Check if page has already been mapped. */
-     - tmp_map = acpi_map_lookup(phys, size);
-     - if (tmp_map) {
-     -         kref_get(&tmp_map->ref);
-     -         spin_unlock_irqrestore(&acpi_ioremap_lock, flags);
-     -         iounmap(map->virt);
-     -         kfree(map);
-     -         return tmp_map->virt + (phys - tmp_map->phys);
-     - }
+     + map->refcount = 1;
+     +
        list_add_tail_rcu(&map->list, &acpi_ioremaps);
-     - spin_unlock_irqrestore(&acpi_ioremap_lock, flags);
       
+     + out:
+     + mutex_unlock(&acpi_ioremap_lock);
        return map->virt + (phys - map->phys);
       }
       EXPORT_SYMBOL_GPL(acpi_os_map_memory);
       
-     -static void acpi_kref_del_iomap(struct kref *ref)
+     +static void acpi_os_drop_map_ref(struct acpi_ioremap *map)
       {
-     - struct acpi_ioremap *map;
+     + if (!--map->refcount)
+     +         list_del_rcu(&map->list);
+     +}
       
-     - map = container_of(ref, struct acpi_ioremap, ref);
-     - list_del_rcu(&map->list);
+     +static void acpi_os_map_cleanup(struct acpi_ioremap *map)
+     +{
+     + if (!map->refcount) {
+     +         synchronize_rcu();
+     +         iounmap(map->virt);
+     +         kfree(map);
+     + }
       }
       
       void __ref acpi_os_unmap_memory(void __iomem *virt, acpi_size size)
       {
        struct acpi_ioremap *map;
-     - unsigned long flags;
-     - int del;
       
        if (!acpi_gbl_permanent_mmap) {
                __acpi_unmap_table(virt, size);
                return;
        }
       
-     - spin_lock_irqsave(&acpi_ioremap_lock, flags);
+     + mutex_lock(&acpi_ioremap_lock);
        map = acpi_map_lookup_virt(virt, size);
        if (!map) {
-     -         spin_unlock_irqrestore(&acpi_ioremap_lock, flags);
-     -         printk(KERN_ERR PREFIX "%s: bad address %p\n", __func__, virt);
-     -         dump_stack();
+     +         mutex_unlock(&acpi_ioremap_lock);
+     +         WARN(true, PREFIX "%s: bad address %p\n", __func__, virt);
                return;
        }
+     + acpi_os_drop_map_ref(map);
+     + mutex_unlock(&acpi_ioremap_lock);
       
-     - del = kref_put(&map->ref, acpi_kref_del_iomap);
-     - spin_unlock_irqrestore(&acpi_ioremap_lock, flags);
-     -
-     - if (!del)
-     -         return;
-     -
-     - synchronize_rcu();
-     - iounmap(map->virt);
-     - kfree(map);
+     + acpi_os_map_cleanup(map);
       }
       EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);
       
@@@@@@@@ -397,7 -411,7 -411,7 -411,7 -411,7 -411,7 -397,7 +411,7 @@@@@@@@ void __init early_acpi_os_unmap_memory(
                __acpi_unmap_table(virt, size);
       }
       
-     -int acpi_os_map_generic_address(struct acpi_generic_address *addr)
+     +static int acpi_os_map_generic_address(struct acpi_generic_address *addr)
       {
        void __iomem *virt;
       
       
        return 0;
       }
-     -EXPORT_SYMBOL_GPL(acpi_os_map_generic_address);
       
-     -void acpi_os_unmap_generic_address(struct acpi_generic_address *addr)
+     +static void acpi_os_unmap_generic_address(struct acpi_generic_address *addr)
       {
-     - void __iomem *virt;
-     - unsigned long flags;
-     - acpi_size size = addr->bit_width / 8;
+     + struct acpi_ioremap *map;
       
        if (addr->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
                return;
        if (!addr->address || !addr->bit_width)
                return;
       
-     - spin_lock_irqsave(&acpi_ioremap_lock, flags);
-     - virt = acpi_map_vaddr_lookup(addr->address, size);
-     - spin_unlock_irqrestore(&acpi_ioremap_lock, flags);
+     + mutex_lock(&acpi_ioremap_lock);
+     + map = acpi_map_lookup(addr->address, addr->bit_width / 8);
+     + if (!map) {
+     +         mutex_unlock(&acpi_ioremap_lock);
+     +         return;
+     + }
+     + acpi_os_drop_map_ref(map);
+     + mutex_unlock(&acpi_ioremap_lock);
       
-     - acpi_os_unmap_memory(virt, size);
+     + acpi_os_map_cleanup(map);
       }
-     -EXPORT_SYMBOL_GPL(acpi_os_unmap_generic_address);
       
       #ifdef ACPI_FUTURE_USAGE
       acpi_status
@@@@@@@@ -516,11 -531,15 -531,15 -531,15 -531,15 -531,15 -516,11 +531,15 @@@@@@@@ acpi_os_install_interrupt_handler(u32 g
        acpi_irq_stats_init();
       
        /*
-     -  * Ignore the GSI from the core, and use the value in our copy of the
-     -  * FADT. It may not be the same if an interrupt source override exists
-     -  * for the SCI.
+     +  * ACPI interrupts different from the SCI in our copy of the FADT are
+     +  * not supported.
         */
-     - gsi = acpi_gbl_FADT.sci_interrupt;
+     + if (gsi != acpi_gbl_FADT.sci_interrupt)
+     +         return AE_BAD_PARAMETER;
+     +
+     + if (acpi_irq_handler)
+     +         return AE_ALREADY_ACQUIRED;
+     +
        if (acpi_gsi_to_irq(gsi, &irq) < 0) {
                printk(KERN_ERR PREFIX "SCI (ACPI GSI %d) not registered\n",
                       gsi);
        acpi_irq_context = context;
        if (request_irq(irq, acpi_irq, IRQF_SHARED, "acpi", acpi_irq)) {
                printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq);
+     +         acpi_irq_handler = NULL;
                return AE_NOT_ACQUIRED;
        }
-     - acpi_irq_irq = irq;
       
        return AE_OK;
       }
       
       acpi_status acpi_os_remove_interrupt_handler(u32 irq, acpi_osd_handler handler)
       {
-     - if (irq) {
-     -         free_irq(irq, acpi_irq);
-     -         acpi_irq_handler = NULL;
-     -         acpi_irq_irq = 0;
-     - }
+     + if (irq != acpi_gbl_FADT.sci_interrupt)
+     +         return AE_BAD_PARAMETER;
+     +
+     + free_irq(irq, acpi_irq);
+     + acpi_irq_handler = NULL;
       
        return AE_OK;
       }
@@@@@@@@ -883,6 -902,14 -902,14 -902,14 -902,14 -902,14 -883,14 +902,6 @@@@@@@@ void acpi_os_wait_events_complete(void 
       
       EXPORT_SYMBOL(acpi_os_wait_events_complete);
       
 ------/*
 ------ * Deallocate the memory for a spinlock.
 ------ */
 ------void acpi_os_delete_lock(acpi_spinlock handle)
 ------{
 ------ return;
 ------}
 ------
       acpi_status
       acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle)
       {
@@@@@@@@ -1313,31 -1340,6 -1340,6 -1340,6 -1340,6 -1340,6 -1321,6 +1332,31 @@@@@@@@ int acpi_resources_are_enforced(void
       }
       EXPORT_SYMBOL(acpi_resources_are_enforced);
       
 ++++++/*
 ++++++ * Create and initialize a spinlock.
 ++++++ */
 ++++++acpi_status
 ++++++acpi_os_create_lock(acpi_spinlock *out_handle)
 ++++++{
 ++++++ spinlock_t *lock;
 ++++++
 ++++++ lock = ACPI_ALLOCATE(sizeof(spinlock_t));
 ++++++ if (!lock)
 ++++++         return AE_NO_MEMORY;
 ++++++ spin_lock_init(lock);
 ++++++ *out_handle = lock;
 ++++++
 ++++++ return AE_OK;
 ++++++}
 ++++++
 ++++++/*
 ++++++ * Deallocate the memory for a spinlock.
 ++++++ */
 ++++++void acpi_os_delete_lock(acpi_spinlock handle)
 ++++++{
 ++++++ ACPI_FREE(handle);
 ++++++}
 ++++++
       /*
        * Acquire a spinlock.
        *
@@@@@@@@ -1606,9 -1608,9 -1608,9 -1608,9 -1608,9 -1608,9 -1589,9 +1625,9 @@@@@@@@ acpi_status __init acpi_os_initialize(v
       
       acpi_status __init acpi_os_initialize1(void)
       {
-     - kacpid_wq = create_workqueue("kacpid");
-     - kacpi_notify_wq = create_workqueue("kacpi_notify");
-     - kacpi_hotplug_wq = create_workqueue("kacpi_hotplug");
+     + kacpid_wq = alloc_workqueue("kacpid", 0, 1);
+     + kacpi_notify_wq = alloc_workqueue("kacpi_notify", 0, 1);
+     + kacpi_hotplug_wq = alloc_workqueue("kacpi_hotplug", 0, 1);
        BUG_ON(!kacpid_wq);
        BUG_ON(!kacpi_notify_wq);
        BUG_ON(!kacpi_hotplug_wq);
       acpi_status acpi_os_terminate(void)
       {
        if (acpi_irq_handler) {
-     -         acpi_os_remove_interrupt_handler(acpi_irq_irq,
+     +         acpi_os_remove_interrupt_handler(acpi_gbl_FADT.sci_interrupt,
                                                 acpi_irq_handler);
        }
       
diff --combined include/acpi/actypes.h
index a6412b82a572a13eb1e3c58d4b218f8d031677b2,64f838beaabffdeead528c4aaf2c4240fb9e9701,64f838beaabffdeead528c4aaf2c4240fb9e9701,64f838beaabffdeead528c4aaf2c4240fb9e9701,f72cbe574296a67558292ab042e94bf8e74e44be,64f838beaabffdeead528c4aaf2c4240fb9e9701,64f838beaabffdeead528c4aaf2c4240fb9e9701..b67231bef632714add11abf65eac32c82cda4dd6
@@@@@@@@ -501,8 -501,8 -501,8 -501,8 -501,9 -501,8 -501,8 +501,9 @@@@@@@@ typedef u64 acpi_integer
       #define ACPI_STATE_D1                   (u8) 1
       #define ACPI_STATE_D2                   (u8) 2
       #define ACPI_STATE_D3                   (u8) 3
---- --#define ACPI_D_STATES_MAX               ACPI_STATE_D3
---- --#define ACPI_D_STATE_COUNT              4
++++ ++#define ACPI_STATE_D3_COLD              (u8) 4
++++ ++#define ACPI_D_STATES_MAX               ACPI_STATE_D3_COLD
++++ ++#define ACPI_D_STATE_COUNT              5
       
       #define ACPI_STATE_C0                   (u8) 0
       #define ACPI_STATE_C1                   (u8) 1
@@@@@@@@ -712,24 -712,8 -712,8 -712,8 -713,8 -712,8 -712,8 +713,24 @@@@@@@@ typedef u8 acpi_adr_space_type
       #define ACPI_ADR_SPACE_CMOS             (acpi_adr_space_type) 5
       #define ACPI_ADR_SPACE_PCI_BAR_TARGET   (acpi_adr_space_type) 6
       #define ACPI_ADR_SPACE_IPMI             (acpi_adr_space_type) 7
 ------#define ACPI_ADR_SPACE_DATA_TABLE       (acpi_adr_space_type) 8
 ------#define ACPI_ADR_SPACE_FIXED_HARDWARE   (acpi_adr_space_type) 127
 ++++++
 ++++++#define ACPI_NUM_PREDEFINED_REGIONS     8
 ++++++
 ++++++/*
 ++++++ * Special Address Spaces
 ++++++ *
 ++++++ * Note: A Data Table region is a special type of operation region
 ++++++ * that has its own AML opcode. However, internally, the AML
 ++++++ * interpreter simply creates an operation region with an an address
 ++++++ * space type of ACPI_ADR_SPACE_DATA_TABLE.
 ++++++ */
 ++++++#define ACPI_ADR_SPACE_DATA_TABLE       (acpi_adr_space_type) 0x7E       /* Internal to ACPICA only */
 ++++++#define ACPI_ADR_SPACE_FIXED_HARDWARE   (acpi_adr_space_type) 0x7F
 ++++++
 ++++++/* Values for _REG connection code */
 ++++++
 ++++++#define ACPI_REG_DISCONNECT             0
 ++++++#define ACPI_REG_CONNECT                1
       
       /*
        * bit_register IDs
This page took 0.089209 seconds and 4 git commands to generate.