1. 15 11月, 2012 4 次提交
    • R
      ACPI / PM: Split device wakeup management routines · dee8370c
      Rafael J. Wysocki 提交于
      Two device wakeup management routines in device_pm.c and sleep.c,
      acpi_pm_device_run_wake() and acpi_pm_device_sleep_wake(), take a
      device pointer argument and use it to obtain the ACPI handle of the
      corresponding ACPI namespace node.  That handle is then used to get
      the address of the struct acpi_device object corresponding to the
      struct device passed as the argument.
      
      Unfortunately, that last operation may be costly, because it involves
      taking the global ACPI namespace mutex, so it shouldn't be carried
      out too often.  However, the callers of those routines usually call
      them in a row with acpi_pm_device_sleep_state() which also takes that
      mutex for the same reason, so it would be more efficient if they ran
      acpi_bus_get_device() themselves to obtain a pointer to the struct
      acpi_device object in question and then passed that pointer to the
      appropriate PM routines.
      
      To make that possible, split each of the PM routines mentioned above
      in two parts, one taking a struct acpi_device pointer argument and
      the other implementing the current interface for compatibility.
      
      Additionally, change acpi_pm_device_run_wake() to actually return
      an error code if there is an error while setting up runtime remote
      wakeup for the device.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      dee8370c
    • R
      ACPI / PM: Move device power state selection routine to device_pm.c · 86b3832c
      Rafael J. Wysocki 提交于
      The ACPI function for choosing device power state is now located
      in drivers/acpi/sleep.c, but drivers/acpi/device_pm.c is a more
      logical place for it, so move it there.
      
      However, instead of moving the function entirely, move its core only
      under a different name and with a different list of arguments, so
      that it is more flexible, and leave a wrapper around it in the
      original location.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      86b3832c
    • R
      ACPI / PM: Move routines for adding/removing device wakeup notifiers · ec2cd81c
      Rafael J. Wysocki 提交于
      ACPI routines for adding and removing device wakeup notifiers are
      currently defined in a PCI-specific file, but they will be necessary
      for non-PCI devices too, so move them to a separate file under
      drivers/acpi and rename them to indicate their ACPI origins.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ec2cd81c
    • R
      ACPI / PM: Fix device PM kernedoc comments and #ifdefs · bdda27fb
      Rafael J. Wysocki 提交于
      The kerneldoc comments for acpi_pm_device_sleep_state(),
      acpi_pm_device_run_wake(), and acpi_pm_device_sleep_wake() are
      outdated or otherwise inaccurate and/or don't follow the common
      kerneldoc patterns, so fix them.
      
      Additionally, notice that acpi_pm_device_run_wake() should be under
      CONFIG_PM_RUNTIME rather than under CONFIG_PM_SLEEP, so fix that too.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bdda27fb
  2. 07 10月, 2012 1 次提交
    • L
      ACPI: Add new sysfs interface to export device description · d1efe3c3
      Lance Ortiz 提交于
      Add support to export the device description obtained from the ACPI _STR
      method, if one exists for a device, to user-space via a sysfs interface.
      This new interface provides a standard and platform neutral way for users
      to obtain the description text stored in the ACPI _STR method.  If no
      _STR method exists for the device, no sysfs 'description' file will be
      created.  The 'description' file will be located in the /sys/devices/
      directory using the device's path.
      
      /sys/device/<bus>/<bridge path>/<device path>.../firmware_node/description
      
      Example:
      
      /sys/devices/pci0000:00/0000:00.07.0/0000:0e:00.0/firmware_node/description
      
      It can also be located using the ACPI device path, for example:
      
      /sys/devices/LNXSYSTM:00/device:00/ACPI0004:00/PNP0A08:00/device:13/device:15/description
      /sys/devices/LNXSYSTM:00/device:00/ACPI0004:00/ACPI0004:01/ACPI0007:02/description
      
      Execute the 'cat' command on the 'description' file to obtain the
      description string for that device.
      
      This patch also includes documentation describing how the new sysfs
      interface works
      
      Changes from v1-v2 based on comments by Len Brown and Fengguang Wu
      * Removed output "No Description" and leaving a NULL attribute if the
      _STR method failed to evaluate.
      
      * In acpi_device_remove_files() removed the redundent check of
      dev->pnp.str_obj before calling free.  This check triggered a message
      from smatch.
      Signed-off-by: NLance Ortiz <lance.ortiz@hp.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      d1efe3c3
  3. 22 9月, 2012 2 次提交
    • M
      ACPI: introduce module_acpi_driver() helper macro · 0d2cf8f5
      Mika Westerberg 提交于
      Add a helper macro module_acpi_driver() which reduces the boilerplate code
      for ACPI drivers. This is similar what is done for other busses (PCI, SPI,
      I2C etc).
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      0d2cf8f5
    • L
      ACPI: Allow ACPI binding with USB-3.0 hub · 1033f904
      Lan Tianyu 提交于
      A USB port's position and connectability can't be identified on some boards
      via USB hub registers. ACPI _UPC and _PLD can help to resolve this issue
      and so it is necessary to bind USB with ACPI. This patch is to allow ACPI
      binding with USB-3.0 hub.
      
      Current ACPI only can bind one struct-device to one ACPI device node.
      This can not work with USB-3.0 hub, because the USB-3.0 hub has two logical
      devices. Each works for USB-2.0 and USB-3.0 devices. In the Linux USB subsystem,
      those two logical hubs are treated as two seperate devices that have two struct
      devices. But in the ACPI DSDT, these two logical hubs share one ACPI device
      node. So there is a requirement to bind multi struct-devices to one ACPI
      device node. This patch is to resolve such problem.
      
      Following is the ACPI device nodes' description under xhci hcd.
      
      Device (XHC)
                  Device (RHUB)
                      Device (HSP1)
                      Device (HSP2)
                      Device (HSP3)
                      Device (HSP4)
                      Device (SSP1)
                      Device (SSP2)
                      Device (SSP3)
                      Device (SSP4)
      
      Topology in the Linux
      
      	device XHC
      	   USB-2.0 logical hub    USB-3.0 logical hub
      		HSP1			SSP1
      		HSP2			SSP2
      		HSP3			SSP3
      		HSP4			SSP4
      
      This patch also modifies the output of /proc/acpi/wakeup. One ACPI node
      can be associated with multiple devices:
      
      XHC		S4	*enabled	pci:0000:00:14.0
      RHUB	S0	disabled	usb:usb1
      			disabled	usb:usb2
      Signed-off-by: NLan Tianyu <tianyu.lan@intel.com>
      Acked-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      1033f904
  4. 21 9月, 2012 1 次提交
  5. 01 7月, 2012 2 次提交
  6. 24 6月, 2012 1 次提交
  7. 23 6月, 2012 1 次提交
  8. 04 6月, 2012 3 次提交
    • T
      ACPI: Add _OST support for sysfs eject · c4753e57
      Toshi Kani 提交于
      Changed acpi_bus_hot_remove_device() to support _OST. This function is
      also changed to global so that it can be called from hotplug notify
      handlers to perform hot-remove operation.
      
      Changed acpi_eject_store(), which is the sysfs eject handler. It checks
      eject_pending to see if the request was originated from ACPI eject
      notification. If not, it calls _OST(0x103,84,) per Figure 6-37 in ACPI
      5.0 spec.
      
      Added eject_pending bit to acpi_device_flags. This bit is set when the
      kernel has received an ACPI eject notification, but does not initiate
      its hot-remove operation by itself.
      
      Added struct acpi_eject_event. This structure is used to pass extended
      information to acpi_bus_hot_remove_device(), which has a single argument
      to support asynchronous call
      Signed-off-by: NToshi Kani <toshi.kani@hp.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      c4753e57
    • T
      ACPI: Add an interface to evaluate _OST · 275c58d7
      Toshi Kani 提交于
      Added acpi_evaluate_hotplug_opt(). All ACPI hotplug handlers must call
      this function when evaluating _OST for hotplug operations. If the
      platform does not support _OST, this function returns AE_NOT_FOUND and
      has no effect on the platform.
      
      ACPI_HOTPLUG_OST is defined when all relevant ACPI hotplug operations,
      such as CPU, memory and container hotplug, are enabled. This assures
      consistent behavior among the hotplug operations with regarding the
      _OST support. When ACPI_HOTPLUG_OST is not defined, this function is
      a no-op.
      
      ACPI PCI hotplug is not enhanced to support _OST at this time since it
      is a legacy method being replaced by PCIe native hotplug. _OST support
      for ACPI PCI hotplug may be added in future if necessary.
      
      Some platforms may require the OS to support _OST in order to support
      ACPI hotplug operations. For example, if a platform has the management
      console where user can request a hotplug operation from, this _OST
      support would be required for the management console to show the result
      of the hotplug request to user.
      
      Added macro definitions of _OST source events and status codes.
      Also renamed OSC_SB_CPUHP_OST_SUPPORT to OSC_SB_HOTPLUG_OST_SUPPORT
      since this _OSC bit is not specific to CPU hotplug. This bit is
      defined in Table 6-147 of ACPI 5.0 as follows.
      
        Bits:       3
        Field Name: Insertion / Ejection _OST Processing Support
        Definition: This bit is set if OSPM will evaluate the _OST
                    object defined under a device when processing
                    insertion and ejection source event codes.
      Signed-off-by: NToshi Kani <toshi.kani@hp.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      275c58d7
    • L
      ACPI: fix acpi_bus.h build warnings when ACPI is not enabled · 7ae30986
      Len Brown 提交于
      introduced in Linux-3.5-rc1 by
      66886d6f
      (ACPI: Add stubs for (un)register_acpi_bus_type)
      
      Fix header file warnings when CONFIG_ACPI is not enabled:
      
      include/acpi/acpi_bus.h:443:42: warning: 'struct acpi_bus_type' declared inside parameter list
      include/acpi/acpi_bus.h:443:42: warning: its scope is only this definition or declaration, which is probably not
      include/acpi/acpi_bus.h:444:44: warning: 'struct acpi_bus_type' declared inside parameter list
      Signed-off-by: NLen Brown <len.brown@intel.com>
      7ae30986
  9. 12 5月, 2012 2 次提交
  10. 30 3月, 2012 2 次提交
  11. 14 7月, 2011 1 次提交
  12. 15 3月, 2011 1 次提交
  13. 25 2月, 2011 1 次提交
    • R
      ACPI: Remove the wakeup.run_wake_count device field · 51907267
      Rafael J. Wysocki 提交于
      The wakeup.run_wake_count ACPI device field is only used by the PCI
      runtime PM code to "protect" devices from being prepared for
      generating wakeup signals more than once in a row.  However, it
      really doesn't provide any protection, because (1) all of the
      functions it is supposed to protect use their own reference counters
      effectively ensuring that the device will be set up for generating
      wakeup signals just once and (2) the PCI runtime PM code uses
      wakeup.run_wake_count in a racy way, since nothing prevents
      acpi_dev_run_wake() from being called concurrently from two different
      threads for the same device.
      
      Remove the wakeup.run_wake_count ACPI device field which is
      unnecessary, confusing and used in a wrong way.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      51907267
  14. 12 1月, 2011 4 次提交
  15. 07 1月, 2011 1 次提交
  16. 16 10月, 2010 1 次提交
  17. 02 10月, 2010 1 次提交
  18. 25 8月, 2010 1 次提交
    • R
      ACPI/PCI: Do not preserve _OSC control bits returned by a query · 2b8fd918
      Rafael J. Wysocki 提交于
      There is the assumption in acpi_pci_osc_control_set() that it is
      always sufficient to compare the mask of _OSC control bits to be
      requested with the result of an _OSC query where all of the known
      control bits have been checked.  However, in general, that need not
      be the case.  For example, if an _OSC feature A depends on an _OSC
      feature B and control of A, B plus another _OSC feature C is
      requested simultaneously, the BIOS may return A, B, C, while it would
      only return C if A and C were requested without B.
      
      That may result in passing a wrong mask of _OSC control bits to an
      _OSC control request, in which case the BIOS may only grant control
      of a subset of the requested features.  Moreover, acpi_pci_run_osc()
      will return error code if that happens and the caller of
      acpi_pci_osc_control_set() will not know that it's been granted
      control of some _OSC features.  Consequently, the system will
      generally not work as expected.
      
      Apart from this acpi_pci_osc_control_set() always uses the mask
      of _OSC control bits returned by the very first invocation of
      acpi_pci_query_osc(), but that is done with the second argument
      equal to OSC_PCI_SEGMENT_GROUPS_SUPPORT which generally happens
      to affect the returned _OSC control bits.
      
      For these reasons, make acpi_pci_osc_control_set() always check if
      control of the requested _OSC features will be granted before making
      the final control request.  As a result, the osc_control_qry and
      osc_queried members of struct acpi_pci_root are not necessary any
      more, so drop them and remove the remaining code referring to them.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      2b8fd918
  19. 04 4月, 2010 1 次提交
    • B
      ACPI: pci_root: save downstream bus range · 6ad95513
      Bjorn Helgaas 提交于
      Previously, we only saved the root bus number, i.e., the beginning of the
      downstream bus range.  We now support IORESOURCE_BUS resources, so this
      patch uses that to keep track of both the beginning and the end of the
      downstream bus range.
      
      It's important to know both the beginning and the end for supporting _CBA
      (see PCI Firmware spec, rev 3.0, sec 4.1.3) and so we know the limits for
      any possible PCI bus renumbering (we can't renumber downstream buses to be
      outside the bus number range claimed by the host bridge).
      
      It's clear from the spec that the bus range is supposed to be in _CRS, but
      if we don't find it there, we'll assume [_BBN - 0xFF] or [0 - 0xFF].
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Reviewed-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      6ad95513
  20. 23 2月, 2010 2 次提交
    • R
      PCI / ACPI / PM: Platform support for PCI PME wake-up · b67ea761
      Rafael J. Wysocki 提交于
      Although the majority of PCI devices can generate PMEs that in
      principle may be used to wake up devices suspended at run time,
      platform support is generally necessary to convert PMEs into wake-up
      events that can be delivered to the kernel.  If ACPI is used for this
      purpose, PME signals generated by a PCI device will trigger the ACPI
      GPE associated with the device to generate an ACPI wake-up event that
      we can set up a handler for, provided that everything is configured
      correctly.
      
      Unfortunately, the subset of PCI devices that have GPEs associated
      with them is quite limited.  The devices without dedicated GPEs have
      to rely on the GPEs associated with other devices (in the majority of
      cases their upstream bridges and, possibly, the root bridge) to
      generate ACPI wake-up events in response to PME signals from them.
      
      Add ACPI platform support for PCI PME wake-up:
      o Add a framework making is possible to use ACPI system notify
        handlers for run-time PM.
      o Add new PCI platform callback ->run_wake() to struct
        pci_platform_pm_ops allowing us to enable/disable the platform to
        generate wake-up events for given device.  Implemet this callback
        for the ACPI platform.
      o Define ACPI wake-up handlers for PCI devices and PCI root buses and
        make the PCI-ACPI binding code register wake-up notifiers for all
        PCI devices present in the ACPI tables.
      o Add function pci_dev_run_wake() which can be used by PCI drivers to
        check if given device is capable of generating wake-up events at
        run time.
      
      Developed in cooperation with Matthew Garrett <mjg@redhat.com>.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      b67ea761
    • R
      ACPI / PM: Add more run-time wake-up fields · f517709d
      Rafael J. Wysocki 提交于
      Use the run_wake flag to mark all devices for which run-time wake-up
      events may be generated by the platform.  Introduce a new wake-up
      flag, always_enabled, for marking devices that should be permanently
      enabled to generate run-time events.  Also, introduce a reference
      counter for run-wake devices and a function that will initialize all
      of the run-time wake-up fields for given device.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NLen Brown <len.brown@intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      f517709d
  21. 28 1月, 2010 1 次提交
  22. 26 9月, 2009 6 次提交