1. 20 6月, 2013 1 次提交
    • R
      ACPI / PM: Rename function acpi_device_power_state() and make it static · b25c77ef
      Rafael J. Wysocki 提交于
      There is a name clash between function acpi_device_power_state()
      defined in drivers/acpi/device_pm.c and structure type
      acpi_device_power_state defined in include/acpi/acpi_bus.h, which
      may be resolved by renaming the function.  Additionally, that
      funtion may be made static, because it is not used anywhere outside
      of the file it is defined in.
      
      Rename acpi_device_power_state() to acpi_dev_pm_get_state(), which
      better reflects its purpose, and make it static.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b25c77ef
  2. 22 5月, 2013 1 次提交
    • R
      ACPI / PM: Allow device power states to be used for CONFIG_PM unset · ec4602a9
      Rafael J. Wysocki 提交于
      Currently, drivers/acpi/device_pm.c depends on CONFIG_PM and all of
      the functions defined in there are replaced with static inline stubs
      if that option is unset.  However, CONFIG_PM means, roughly, "runtime
      PM or suspend/hibernation support" and some of those functions are
      useful regardless of that.  For example, they are used by the ACPI
      fan driver for controlling fans and acpi_device_set_power() is called
      during device removal.  Moreover, device initialization may depend on
      setting device power states properly.
      
      For these reasons, make the routines manipulating ACPI device power
      states defined in drivers/acpi/device_pm.c available for CONFIG_PM
      unset too.
      Reported-by: NZhang Rui <rui.zhang@intel.com>
      Reported-and-tested-by: NMichel Lespinasse <walken@google.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: 3.9+ <stable@vger.kernel.org>
      ec4602a9
  3. 12 5月, 2013 2 次提交
  4. 22 4月, 2013 1 次提交
  5. 12 4月, 2013 1 次提交
  6. 25 3月, 2013 2 次提交
  7. 12 3月, 2013 9 次提交
  8. 06 3月, 2013 1 次提交
    • K
      acpi: Export the acpi_processor_get_performance_info · c705c78c
      Konrad Rzeszutek Wilk 提交于
      The git commit d5aaffa9
      (cpufreq: handle cpufreq being disabled for all exported function)
      tightens the cpufreq API by returning errors when disable_cpufreq()
      had been called.
      
      The problem we are hitting is that the module xen-acpi-processor which
      uses the ACPI's functions: acpi_processor_register_performance,
      acpi_processor_preregister_performance, and acpi_processor_notify_smm
      fails at acpi_processor_register_performance with -22.
      
      Note that earlier during bootup in arch/x86/xen/setup.c there is also
      an call to cpufreq's API: disable_cpufreq().
      
      This is b/c we want the Linux kernel to parse the ACPI data, but leave
      the cpufreq decisions to the hypervisor.
      
      In v3.9 all the checks that d5aaffa9
      added are now hit and the calls to cpufreq_register_notifier will now
      fail. This means that acpi_processor_ppc_init ends up printing:
      
      "Warning: Processor Platform Limit not supported"
      
      and the acpi_processor_ppc_status is not set.
      
      The repercussions of that is that the call to
      acpi_processor_register_performance fails right away at:
      
      	if (!(acpi_processor_ppc_status & PPC_REGISTERED))
      
      and we don't progress any further on parsing and extracting the _P*
      objects.
      
      The only reason the Xen code called that function was b/c it was
      exported and the only way to gather the P-states. But we can also
      just make acpi_processor_get_performance_info be exported and not
      use acpi_processor_register_performance. This patch does so.
      Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      c705c78c
  9. 04 3月, 2013 4 次提交
    • R
      ACPI / hotplug: Introduce user space interface for hotplug profiles · 3f8055c3
      Rafael J. Wysocki 提交于
      Introduce user space interface for manipulating hotplug profiles
      associated with ACPI scan handlers.
      
      The interface consists of sysfs directories under
      /sys/firmware/acpi/hotplug/, one for each hotplug profile, containing
      an attribute allowing user space to manipulate the enabled field of
      the corresponding profile.  Namely, switching the enabled attribute
      from '0' to '1' will cause the common hotplug notify handler to be
      installed for all ACPI namespace objects representing devices matching
      the scan handler associated with the given hotplug profile (and
      analogously for the converse switch).
      
      Drivers willing to use the new user space interface should add their
      ACPI scan handlers with the help of new funtion
      acpi_scan_add_handler_with_hotplug().
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      Tested-by: NToshi Kani <toshi.kani@hp.com>
      3f8055c3
    • R
      ACPI / scan: Introduce common code for ACPI-based device hotplug · a33ec399
      Rafael J. Wysocki 提交于
      Multiple drivers handling hotplug-capable ACPI device nodes install
      notify handlers covering the same types of events in a very similar
      way.  Moreover, those handlers are installed in separate namespace
      walks, although that really should be done during namespace scans
      carried out by acpi_bus_scan().  This leads to substantial code
      duplication, unnecessary overhead and behavior that is hard to
      follow.
      
      For this reason, introduce common code in drivers/acpi/scan.c for
      handling hotplug-related notification and carrying out device
      insertion and eject operations in a generic fashion, such that it
      may be used by all of the relevant drivers in the future.  To cover
      the existing differences between those drivers introduce struct
      acpi_hotplug_profile for representing collections of hotplug
      settings associated with different ACPI scan handlers that can be
      used by the drivers to make the common code reflect their current
      behavior.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      Tested-by: NToshi Kani <toshi.kani@hp.com>
      a33ec399
    • R
      ACPI / glue: Drop .find_bridge() callback from struct acpi_bus_type · 92414481
      Rafael J. Wysocki 提交于
      After PCI and USB have stopped using the .find_bridge() callback in
      struct acpi_bus_type, the only remaining user of it is SATA, but SATA
      only pretends to be a user, because it points that callback to a stub
      always returning -ENODEV.
      
      For this reason, drop the SATA's dummy .find_bridge() callback and
      remove .find_bridge(), which is not used any more, from struct
      acpi_bus_type entirely.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NJeff Garzik <jgarzik@pobox.com>
      92414481
    • R
      ACPI / glue: Add .match() callback to struct acpi_bus_type · 53540098
      Rafael J. Wysocki 提交于
      USB uses the .find_bridge() callback from struct acpi_bus_type
      incorrectly, because as a result of the way it is used by USB every
      device in the system that doesn't have a bus type or parent is
      passed to usb_acpi_find_device() for inspection.
      
      What USB actually needs, though, is to call usb_acpi_find_device()
      for USB ports that don't have a bus type defined, but have
      usb_port_device_type as their device type, as well as for USB
      devices.
      
      To fix that replace the struct bus_type pointer in struct
      acpi_bus_type used for matching devices to specific subsystems
      with a .match() callback to be used for this purpose and update
      the users of struct acpi_bus_type, including USB, accordingly.
      Define the .match() callback routine for USB, usb_acpi_bus_match(),
      in such a way that it will cover both USB devices and USB ports
      and remove the now redundant .find_bridge() callback pointer from
      usb_acpi_bus.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NJeff Garzik <jgarzik@pobox.com>
      53540098
  10. 26 2月, 2013 1 次提交
  11. 22 2月, 2013 1 次提交
  12. 17 2月, 2013 1 次提交
  13. 13 2月, 2013 2 次提交
    • R
      ACPI / hotplug: Fix concurrency issues and memory leaks · 3757b948
      Rafael J. Wysocki 提交于
      This changeset is aimed at fixing a few different but related
      problems in the ACPI hotplug infrastructure.
      
      First of all, since notify handlers may be run in parallel with
      acpi_bus_scan(), acpi_bus_trim() and acpi_bus_hot_remove_device()
      and some of them are installed for ACPI handles that have no struct
      acpi_device objects attached (i.e. before those objects are created),
      those notify handlers have to take acpi_scan_lock to prevent races
      from taking place (e.g. a struct acpi_device is found to be present
      for the given ACPI handle, but right after that it is removed by
      acpi_bus_trim() running in parallel to the given notify handler).
      Moreover, since some of them call acpi_bus_scan() and
      acpi_bus_trim(), this leads to the conclusion that acpi_scan_lock
      should be acquired by the callers of these two funtions rather by
      these functions themselves.
      
      For these reasons, make all notify handlers that can handle device
      addition and eject events take acpi_scan_lock and remove the
      acpi_scan_lock locking from acpi_bus_scan() and acpi_bus_trim().
      Accordingly, update all of their users to make sure that they
      are always called under acpi_scan_lock.
      
      Furthermore, since eject operations are carried out asynchronously
      with respect to the notify events that trigger them, with the help
      of acpi_bus_hot_remove_device(), even if notify handlers take the
      ACPI scan lock, it still is possible that, for example,
      acpi_bus_trim() will run between acpi_bus_hot_remove_device() and
      the notify handler that scheduled its execution and that
      acpi_bus_trim() will remove the device node passed to
      acpi_bus_hot_remove_device() for ejection.  In that case, the struct
      acpi_device object obtained by acpi_bus_hot_remove_device() will be
      invalid and not-so-funny things will ensue.  To protect agaist that,
      make the users of acpi_bus_hot_remove_device() run get_device() on
      ACPI device node objects that are about to be passed to it and make
      acpi_bus_hot_remove_device() run put_device() on them and check if
      their ACPI handles are not NULL (make acpi_device_unregister() clear
      the device nodes' ACPI handles for that check to work).
      
      Finally, observe that acpi_os_hotplug_execute() actually can fail,
      in which case its caller ought to free memory allocated for the
      context object to prevent leaks from happening.  It also needs to
      run put_device() on the device node that it ran get_device() on
      previously in that case.  Modify the code accordingly.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      3757b948
    • R
      ACPI: Drop the container.h header file · 87d4a4da
      Rafael J. Wysocki 提交于
      The include/acpi/container.h only contains a definition of a
      structure that is not used any more, so drop it entirely.
      
      Similar change was proposed earlier by Toshi Kani.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      87d4a4da
  14. 30 1月, 2013 1 次提交
    • R
      ACPI / scan: Introduce struct acpi_scan_handler · ca589f94
      Rafael J. Wysocki 提交于
      Introduce struct acpi_scan_handler for representing objects that
      will do configuration tasks depending on ACPI device nodes'
      hardware IDs (HIDs).
      
      Currently, those tasks are done either directly by the ACPI namespace
      scanning code or by ACPI device drivers designed specifically for
      this purpose.  None of the above is desirable, however, because
      doing that directly in the namespace scanning code makes that code
      overly complicated and difficult to follow and doing that in
      "special" device drivers leads to a great deal of confusion about
      their role and to confusing interactions with the driver core (for
      example, sysfs directories are created for those drivers, but they
      are completely unnecessary and only increase the kernel's memory
      footprint in vain).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      ca589f94
  15. 26 1月, 2013 4 次提交
  16. 25 1月, 2013 2 次提交
  17. 24 1月, 2013 1 次提交
  18. 20 1月, 2013 1 次提交
  19. 19 1月, 2013 1 次提交
    • R
      ACPI / scan: Drop acpi_bus_add() and use acpi_bus_scan() instead · b8bd759a
      Rafael J. Wysocki 提交于
      The only difference between acpi_bus_scan() and acpi_bus_add() is the
      invocation of acpi_update_all_gpes() in the latter which in fact is
      unnecessary, because acpi_update_all_gpes() has already been called
      by acpi_scan_init() and the way it is implemented guarantees the next
      invocations of it to do nothing.
      
      For this reason, drop acpi_bus_add() and make all its callers use
      acpi_bus_scan() directly instead of it.  Additionally, rearrange the
      code in acpi_scan_init() slightly to improve the visibility of the
      acpi_update_all_gpes() call in there.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      b8bd759a
  20. 17 1月, 2013 3 次提交