]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'pm/linux-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 01:55:18 +0000 (12:55 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 01:55:18 +0000 (12:55 +1100)
Conflicts:
drivers/acpi/internal.h
drivers/acpi/scan.c
drivers/pci/hotplug/acpiphp_glue.c
drivers/pci/pci-acpi.c

19 files changed:
1  2 
Documentation/kernel-parameters.txt
arch/arm64/kernel/process.c
arch/microblaze/kernel/process.c
arch/x86/Kconfig
drivers/Makefile
drivers/acpi/Kconfig
drivers/acpi/custom_method.c
drivers/acpi/internal.h
drivers/acpi/osl.c
drivers/acpi/pci_root.c
drivers/acpi/pci_slot.c
drivers/acpi/scan.c
drivers/ata/libata-acpi.c
drivers/pci/hotplug/acpiphp_glue.c
drivers/pci/hotplug/sgi_hotplug.c
drivers/pci/pci-acpi.c
drivers/platform/x86/eeepc-laptop.c
include/acpi/acpi_bus.h
include/acpi/acpiosxf.h

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index e09ce0373d41f9ca2db5b5d33ca6a9b603aa60e7,79092328cf064b237c090690c29b64ec1a733063..61312bd169a2cfeecde6080cd037bad50a18963f
@@@ -67,13 -94,6 +94,12 @@@ struct acpi_ec 
  
  extern struct acpi_ec *first_ec;
  
- int acpi_pci_root_init(void);
 +#ifdef        CONFIG_ACPI_PCI_SLOT
 +void acpi_pci_slot_init(void);
 +#else
 +static inline void acpi_pci_slot_init(void) { }
 +#endif
 +void acpi_pci_root_hp_init(void);
  int acpi_ec_init(void);
  int acpi_ec_ecdt_probe(void);
  int acpi_boot_ec_enable(void);
Simple merge
index 8b5a73b7620205c3f300fb091b369c7617a4fa14,b3cc69c5caf1e07bd93aa4111bfcbb0a0d4293b5..0ac546d5e53f5b0f079792c71419dd07001fe892
@@@ -599,8 -624,10 +596,8 @@@ end
        return result;
  }
  
- static int acpi_pci_root_remove(struct acpi_device *device, int type)
+ static void acpi_pci_root_remove(struct acpi_device *device)
  {
 -      acpi_status status;
 -      acpi_handle handle;
        struct acpi_pci_root *root = acpi_driver_data(device);
        struct acpi_pci_driver *driver;
  
@@@ -628,142 -658,8 +624,138 @@@ void __init acpi_pci_root_init(void
  {
        acpi_hest_init();
  
-       if (acpi_pci_disabled)
-               return 0;
-       pci_acpi_crs_quirks();
-       if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0)
-               return -ENODEV;
-       return 0;
+       if (!acpi_pci_disabled) {
+               pci_acpi_crs_quirks();
+               acpi_scan_add_handler(&pci_root_handler);
+       }
  }
 +/* Support root bridge hotplug */
 +
 +static void handle_root_bridge_insertion(acpi_handle handle)
 +{
 +      struct acpi_device *device;
 +
 +      if (!acpi_bus_get_device(handle, &device)) {
 +              printk(KERN_DEBUG "acpi device exists...\n");
 +              return;
 +      }
 +
 +      if (acpi_bus_scan(handle))
 +              printk(KERN_ERR "cannot add bridge to acpi list\n");
 +}
 +
 +static void handle_root_bridge_removal(struct acpi_device *device)
 +{
 +      struct acpi_eject_event *ej_event;
 +
 +      ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL);
 +      if (!ej_event) {
 +              /* Inform firmware the hot-remove operation has error */
 +              (void) acpi_evaluate_hotplug_ost(device->handle,
 +                                      ACPI_NOTIFY_EJECT_REQUEST,
 +                                      ACPI_OST_SC_NON_SPECIFIC_FAILURE,
 +                                      NULL);
 +              return;
 +      }
 +
 +      ej_event->device = device;
 +      ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
 +
 +      acpi_bus_hot_remove_device(ej_event);
 +}
 +
 +static void _handle_hotplug_event_root(struct work_struct *work)
 +{
 +      struct acpi_pci_root *root;
 +      struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER };
 +      struct acpi_hp_work *hp_work;
 +      acpi_handle handle;
 +      u32 type;
 +
 +      hp_work = container_of(work, struct acpi_hp_work, work);
 +      handle = hp_work->handle;
 +      type = hp_work->type;
 +
 +      root = acpi_pci_find_root(handle);
 +
 +      acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
 +
 +      switch (type) {
 +      case ACPI_NOTIFY_BUS_CHECK:
 +              /* bus enumerate */
 +              printk(KERN_DEBUG "%s: Bus check notify on %s\n", __func__,
 +                               (char *)buffer.pointer);
 +              if (!root)
 +                      handle_root_bridge_insertion(handle);
 +
 +              break;
 +
 +      case ACPI_NOTIFY_DEVICE_CHECK:
 +              /* device check */
 +              printk(KERN_DEBUG "%s: Device check notify on %s\n", __func__,
 +                               (char *)buffer.pointer);
 +              if (!root)
 +                      handle_root_bridge_insertion(handle);
 +              break;
 +
 +      case ACPI_NOTIFY_EJECT_REQUEST:
 +              /* request device eject */
 +              printk(KERN_DEBUG "%s: Device eject notify on %s\n", __func__,
 +                               (char *)buffer.pointer);
 +              if (root)
 +                      handle_root_bridge_removal(root->device);
 +              break;
 +      default:
 +              printk(KERN_WARNING "notify_handler: unknown event type 0x%x for %s\n",
 +                               type, (char *)buffer.pointer);
 +              break;
 +      }
 +
 +      kfree(hp_work); /* allocated in handle_hotplug_event_bridge */
 +      kfree(buffer.pointer);
 +}
 +
 +static void handle_hotplug_event_root(acpi_handle handle, u32 type,
 +                                      void *context)
 +{
 +      alloc_acpi_hp_work(handle, type, context,
 +                              _handle_hotplug_event_root);
 +}
 +
 +static acpi_status __init
 +find_root_bridges(acpi_handle handle, u32 lvl, void *context, void **rv)
 +{
 +      acpi_status status;
 +      char objname[64];
 +      struct acpi_buffer buffer = { .length = sizeof(objname),
 +                                    .pointer = objname };
 +      int *count = (int *)context;
 +
 +      if (!acpi_is_root_bridge(handle))
 +              return AE_OK;
 +
 +      (*count)++;
 +
 +      acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
 +
 +      status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
 +                                      handle_hotplug_event_root, NULL);
 +      if (ACPI_FAILURE(status))
 +              printk(KERN_DEBUG "acpi root: %s notify handler is not installed, exit status: %u\n",
 +                                objname, (unsigned int)status);
 +      else
 +              printk(KERN_DEBUG "acpi root: %s notify handler is installed\n",
 +                               objname);
 +
 +      return AE_OK;
 +}
 +
 +void __init acpi_pci_root_hp_init(void)
 +{
 +      int num = 0;
 +
 +      acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
 +              ACPI_UINT32_MAX, find_root_bridges, NULL, &num, NULL);
 +
 +      printk(KERN_DEBUG "Found %d acpi root devices\n", num);
 +}
Simple merge
index d9ee41eacf51ea354922653f9314701648869a3b,daee7497efd30137f2dddef2497f9968555d4e26..8aba2a93eb15d778abb98e0b73e79d06390066fe
@@@ -1685,10 -1778,13 +1778,14 @@@ int __init acpi_scan_init(void
                printk(KERN_ERR PREFIX "Could not register bus type\n");
        }
  
-       acpi_power_init();
        acpi_pci_root_init();
 +      acpi_pci_slot_init();
+       acpi_pci_link_init();
+       acpi_platform_init();
+       acpi_csrt_init();
+       acpi_container_init();
  
+       mutex_lock(&acpi_scan_lock);
        /*
         * Enumerate devices in the ACPI namespace.
         */
  
        acpi_update_all_gpes();
  
-       return 0;
 +      acpi_pci_root_hp_init();
 +
+  out:
+       mutex_unlock(&acpi_scan_lock);
+       return result;
  }
Simple merge
index 4681d2c9b1dd96ba708d3654e2ecd828fe53e7aa,a951c22921d165bb1553de35cb68ffc95ddc3abf..f9264331a7ebb495f23805975cb1088ac2d2cd86
@@@ -1136,11 -1214,29 +1132,13 @@@ static void _handle_hotplug_event_bridg
        acpi_handle handle;
        u32 type;
  
 -      hp_work = container_of(work, struct acpiphp_hp_work, work);
 +      hp_work = container_of(work, struct acpi_hp_work, work);
        handle = hp_work->handle;
        type = hp_work->type;
 +      bridge = (struct acpiphp_bridge *)hp_work->context;
  
 -      if (acpi_bus_get_device(handle, &device)) {
 -              /* This bridge must have just been physically inserted */
 -              handle_bridge_insertion(handle, type);
 -              goto out;
 -      }
 -
 -      bridge = acpiphp_handle_to_bridge(handle);
 -      if (type == ACPI_NOTIFY_BUS_CHECK) {
 -              acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, ACPI_UINT32_MAX,
 -                      count_sub_bridges, NULL, &num_sub_bridges, NULL);
 -      }
 -
 -      if (!bridge && !num_sub_bridges) {
 -              err("cannot get bridge info\n");
 -              goto out;
 -      }
 -
+       acpi_scan_lock_acquire();
        acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
  
        switch (type) {
                break;
        }
  
 -out:
+       acpi_scan_lock_release();
        kfree(hp_work); /* allocated in handle_hotplug_event_bridge */
  }
  
@@@ -1237,6 -1342,10 +1236,8 @@@ static void _handle_hotplug_event_func(
  
        acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
  
 -      func = (struct acpiphp_func *)context;
 -
+       acpi_scan_lock_acquire();
        switch (type) {
        case ACPI_NOTIFY_BUS_CHECK:
                /* bus re-enumerate */
Simple merge
index c685ff5e12d24c9bcfbf4969fe75cf0ef4e89e11,e407c61559ca0f09c452b9f130a07ac93ad3dba6..39c937f9b426ef392e3820ee2c7f69e128da403e
@@@ -307,8 -325,26 +307,7 @@@ static void pci_acpi_setup(struct devic
        struct pci_dev *pci_dev = to_pci_dev(dev);
        acpi_handle handle = ACPI_HANDLE(dev);
        struct acpi_device *adev;
 -      acpi_status status;
 -      acpi_handle dummy;
 -
 -      /*
 -       * Evaluate and parse _PRT, if exists.  This code allows parsing of
 -       * _PRT objects within the scope of non-bridge devices.  Note that
 -       * _PRTs within the scope of a PCI bridge assume the bridge's
 -       * subordinate bus number.
 -       *
 -       * TBD: Can _PRTs exist within the scope of non-bridge PCI devices?
 -       */
 -      status = acpi_get_handle(handle, METHOD_NAME__PRT, &dummy);
 -      if (ACPI_SUCCESS(status)) {
 -              unsigned char bus;
 -
 -              bus = pci_dev->subordinate ?
 -                      pci_dev->subordinate->number : pci_dev->bus->number;
 -              acpi_pci_irq_add_prt(handle, pci_domain_nr(pci_dev->bus), bus);
 -      }
  
-       acpi_power_resource_register_device(dev, handle);
        if (acpi_bus_get_device(handle, &adev) || !adev->wakeup.flags.valid)
                return;
  
@@@ -330,7 -367,10 +329,6 @@@ static void pci_acpi_cleanup(struct dev
                device_set_run_wake(dev, false);
                pci_acpi_remove_pm_notifier(adev);
        }
-       acpi_power_resource_unregister_device(dev, handle);
 -
 -      if (pci_dev->subordinate)
 -              acpi_pci_irq_del_prt(pci_domain_nr(pci_dev->bus),
 -                                   pci_dev->subordinate->number);
  }
  
  static struct acpi_bus_type acpi_pci_bus = {
Simple merge
Simple merge
Simple merge