1. 07 12月, 2013 2 次提交
    • R
      ACPI / bind: Rework struct acpi_bus_type · e3f02c52
      Rafael J. Wysocki 提交于
      Replace the .find_device function pointer in struct acpi_bus_type
      with a new one, .find_companion, that is supposed to point to a
      function returning struct acpi_device pointer (instead of an int)
      and takes one argument (instead of two).  This way the role of
      this callback is more clear and the implementation of it can
      be more straightforward.
      
      Update all of the users of struct acpi_bus_type (PCI, PNP/ACPI and
      USB) to reflect the structure change.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: Lan Tianyu <tianyu.lan@intel.com> # for USB/ACPI
      e3f02c52
    • L
      ACPI: Clean up inclusions of ACPI header files · 8b48463f
      Lv Zheng 提交于
      Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and
      <acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h>
      inclusions and remove some inclusions of those files that aren't
      necessary.
      
      First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>
      should not be included directly from any files that are built for
      CONFIG_ACPI unset, because that generally leads to build warnings about
      undefined symbols in !CONFIG_ACPI builds.  For CONFIG_ACPI set,
      <linux/acpi.h> includes those files and for CONFIG_ACPI unset it
      provides stub ACPI symbols to be used in that case.
      
      Second, there are ordering dependencies between those files that always
      have to be met.  Namely, it is required that <acpi/acpi_bus.h> be included
      prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the
      latter depends on are always there.  And <acpi/acpi.h> which provides
      basic ACPICA type declarations should always be included prior to any other
      ACPI headers in CONFIG_ACPI builds.  That also is taken care of including
      <linux/acpi.h> as appropriate.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Acked-by: Bjorn Helgaas <bhelgaas@google.com> (drivers/pci stuff)
      Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> (Xen stuff)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8b48463f
  2. 15 11月, 2013 1 次提交
  3. 24 9月, 2013 1 次提交
  4. 30 7月, 2013 1 次提交
  5. 04 3月, 2013 1 次提交
    • 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
  6. 01 2月, 2013 1 次提交
  7. 08 12月, 2012 1 次提交
  8. 30 11月, 2012 1 次提交
    • R
      ACPI / PNP: Do not crash due to stale pointer use during system resume · a6b5e88c
      Rafael J. Wysocki 提交于
      During resume from system suspend the 'data' field of
      struct pnp_dev in pnpacpi_set_resources() may be a stale pointer,
      due to removal of the associated ACPI device node object in the
      previous suspend-resume cycle.  This happens, for example, if a
      dockable machine is booted in the docking station and then suspended
      and resumed and suspended again.  If that happens,
      pnpacpi_build_resource_template() called from pnpacpi_set_resources()
      attempts to use that pointer and crashes.
      
      However, pnpacpi_set_resources() actually checks the device's ACPI
      handle, attempts to find the ACPI device node object attached to it
      and returns an error code if that fails, so in fact it knows what the
      correct value of dev->data should be.  Use this observation to update
      dev->data with the correct value if necessary and dump a call trace
      if that's the case (once).
      
      We still need to fix the root cause of this issue, but preventing
      systems from crashing because of it is an improvement too.
      Reported-and-tested-by: NZdenek Kabelac <zdenek.kabelac@gmail.com>
      References: https://bugzilla.kernel.org/show_bug.cgi?id=51071
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a6b5e88c
  9. 24 11月, 2012 1 次提交
  10. 22 9月, 2012 1 次提交
    • 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
  11. 24 6月, 2012 1 次提交
  12. 30 3月, 2012 1 次提交
  13. 01 11月, 2011 1 次提交
  14. 12 1月, 2011 1 次提交
    • R
      PNP / ACPI: Use DEVICE_ACPI_HANDLE() for device ACPI handle access · cc8e7a35
      Rafael J. Wysocki 提交于
      The PNP ACPI driver squirrels the ACPI handles of PNP devices' ACPI
      companions, but this isn't correct, because those handles should be
      accessed using the DEVICE_ACPI_HANDLE() macro operating on struct
      device objects.
      
      Using DEVICE_ACPI_HANDLE() in the PNP ACPI driver instead of the
      driver's own copies of the ACPI handles allows us to avoid a problem
      with docking stations where a machine docked before suspend to RAM
      and undocked while suspended crashes during the subsequent resume (in
      that case the ACPI companion of the PNP device in question doesn't
      exist any more while the device is being resumed).  It also allows us
      to avoid the problem where suspend to RAM fails when the machine was
      undocked while suspended before (again, the ACPI companion of the PNP
      device is not present any more while it is being suspended).
      
      This change doesn't fix all of the the PNP ACPI driver's problems
      with PNP devices in docking stations (generally speaking, the driver
      has no idea that devices can come and go and doesn't even attempt to
      handle such events), but at least it makes suspend work for the
      users of docking stations who don't use the PNP devices located in
      there.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=15100Reported-and-tested-by: NToralf Förster <toralf.foerster@gmx.de>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      cc8e7a35
  15. 11 12月, 2010 1 次提交
  16. 02 10月, 2010 1 次提交
  17. 01 10月, 2010 1 次提交
  18. 19 7月, 2010 1 次提交
  19. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  20. 16 12月, 2009 1 次提交
  21. 11 12月, 2009 1 次提交
  22. 26 9月, 2009 3 次提交
  23. 27 8月, 2009 1 次提交
    • B
      ACPICA: Major update for acpi_get_object_info external interface · 15b8dd53
      Bob Moore 提交于
      Completed a major update for the acpi_get_object_info external interface.
      Changes include:
       - Support for variable, unlimited length HID, UID, and CID strings
       - Support Processor objects the same as Devices (HID,UID,CID,ADR,STA, etc.)
       - Call the _SxW power methods on behalf of a device object
       - Determine if a device is a PCI root bridge
       - Change the ACPI_BUFFER parameter to ACPI_DEVICE_INFO.
      These changes will require an update to all callers of this interface.
      See the ACPICA Programmer Reference for details.
      
      Also, update all invocations of acpi_get_object_info interface
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NLin Ming <ming.m.lin@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      15b8dd53
  24. 08 5月, 2009 1 次提交
  25. 04 4月, 2009 1 次提交
    • W
      Enable PNPACPI _PSx Support, v3 · 6328a574
      Witold Szczeponik 提交于
      (This is an update to the patch presented earlier in
      http://lkml.org/lkml/2008/12/8/284, with new error handling.)
      
      This patch sets the power of PnP ACPI devices to D0 when they
      are activated and to D3 when they are disabled.  The latter is
      in correspondence with the ACPI 3.0 specification, whereas the
      former is added in order to be able to power up a device after
      it has been previously disabled (or when booting up a system).
      (As a consequence, the patch makes the PnP ACPI code more ACPI
      compliant.)
      
      Section 6.2.2 of the ACPI Specification (at least versions 1.0b
      and 3.0a) states: "Prior to running this control method [_DIS],
      the OS[PM] will have already put the device in the D3 state."
      Unfortunately, there is no clear statement as to when to put
      a device in the D0 state. :-( Therefore, the patch executes the
      method calls as _PS3/_DIS and _SRS/_PS0. What is clear: "If the
      device is disabled, _SRS enables the device at the specified
      resources." (From the ACPI 3.0a Specification.)
      
      The patch fixes a problem with some IBM ThinkPads (at least the
      600E and the 600X) where the serial ports have a dedicated
      power source that needs to be brought up before the serial port
      can be used.  Without this patch, the serial port is enabled
      but has no power. (In the past, the tpctl utility had to be
      utilized to turn on the power, but support for this feature
      stopped with version 5.9 as it did not support the more recent
      kernel versions.)
      
      The error handlers that handle any errors that can occur during
      the power up/power down phases return the error codes to the
      caller directly.  Comments welcome! :-)
      
      No regressions were observed on hardware that does not require
      this patch.
      
      The patch is applied against 2.6.27.x.
      Signed-off-by: NWitold Szczeponik <Witold.Szczeponik@gmx.net>
      Acked-by: NZhao Yakui <yakui.zhao@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      6328a574
  26. 31 12月, 2008 1 次提交
  27. 23 10月, 2008 1 次提交
  28. 11 10月, 2008 2 次提交
  29. 10 10月, 2008 1 次提交
    • L
      PnP: move pnpacpi/pnpbios_init to after PCI init · ed458df4
      Linus Torvalds 提交于
      We already did that a long time ago for pnp_system_init, but
      pnpacpi_init and pnpbios_init remained as subsys_initcalls, and get
      linked into the kernel before the arch-specific routines that finalize
      the PCI resources (pci_subsys_init).
      
      This means that the PnP routines would either register their resources
      before the PCI layer could, or would be unable to check whether a PCI
      resource had already been registered.  Both are problematic.
      
      I wanted to do this before 2.6.27, but every time we change something
      like this, something breaks.  That said, _every_ single time we trust
      some firmware (like PnP tables) more than we trust the hardware itself
      (like PCI probing), the problems have been worse.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ed458df4
  30. 17 7月, 2008 1 次提交
  31. 12 6月, 2008 1 次提交
  32. 01 5月, 2008 1 次提交
  33. 29 4月, 2008 4 次提交