1. 15 7月, 2013 1 次提交
    • P
      acpi: delete __cpuinit usage from all acpi files · fe7bf106
      Paul Gortmaker 提交于
      The __cpuinit type of throwaway sections might have made sense
      some time ago when RAM was more constrained, but now the savings
      do not offset the cost and complications.  For example, the fix in
      commit 5e427ec2 ("x86: Fix bit corruption at CPU resume time")
      is a good example of the nasty type of bugs that can be created
      with improper use of the various __init prefixes.
      
      After a discussion on LKML[1] it was decided that cpuinit should go
      the way of devinit and be phased out.  Once all the users are gone,
      we can then finally remove the macros themselves from linux/init.h.
      
      This removes all the drivers/acpi uses of the __cpuinit macros
      from all C files.
      
      [1] https://lkml.org/lkml/2013/5/20/589
      
      Cc: Len Brown <lenb@kernel.org>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: linux-acpi@vger.kernel.org
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      fe7bf106
  2. 24 6月, 2013 1 次提交
  3. 31 5月, 2013 1 次提交
  4. 12 5月, 2013 2 次提交
    • R
      ACPI / processor: Use common hotplug infrastructure · ac212b69
      Rafael J. Wysocki 提交于
      Split the ACPI processor driver into two parts, one that is
      non-modular, resides in the ACPI core and handles the enumeration
      and hotplug of processors and one that implements the rest of the
      existing processor driver functionality.
      
      The non-modular part uses an ACPI scan handler object to enumerate
      processors on the basis of information provided by the ACPI namespace
      and to hook up with the common ACPI hotplug infrastructure.  It also
      populates the ACPI handle of each processor device having a
      corresponding object in the ACPI namespace, which allows the driver
      proper to bind to those devices, and makes the driver bind to them
      if it is readily available (i.e. loaded) when the scan handler's
      .attach() routine is running.
      
      There are a few reasons to make this change.
      
      First, switching the ACPI processor driver to using the common ACPI
      hotplug infrastructure reduces code duplication and size considerably,
      even though a new file is created along with a header comment etc.
      
      Second, since the common hotplug code attempts to offline devices
      before starting the (non-reversible) removal procedure, it will abort
      (and possibly roll back) hot-remove operations involving processors
      if cpu_down() returns an error code for one of them instead of
      continuing them blindly (if /sys/firmware/acpi/hotplug/force_remove
      is unset).  That is a more desirable behavior than what the current
      code does.
      
      Finally, the separation of the scan/hotplug part from the driver
      proper makes it possible to simplify the driver's .remove() routine,
      because it doesn't need to worry about the possible cleanup related
      to processor removal any more (the scan/hotplug part is responsible
      for that now) and can handle device removal and driver removal
      symmetricaly (i.e. as appropriate).
      
      Some user-visible changes in sysfs are made (for example, the
      'sysdev' link from the ACPI device node to the processor device's
      directory is gone and a 'physical_node' link is present instead
      and a corresponding 'firmware_node' is present in the processor
      device's directory, the processor driver is now visible under
      /sys/bus/cpu/drivers/ and bound to the processor device), but
      that shouldn't affect the functionality that users care about
      (frequency scaling, C-states and thermal management).
      
      Tested on my venerable Toshiba Portege R500.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reviewed-by: NToshi Kani <toshi.kani@hp.com>
      ac212b69
    • R
      ACPI / PM: Move processor suspend/resume to syscore_ops · 0a3b15ac
      Rafael J. Wysocki 提交于
      The system suspend routine of the ACPI processor driver saves
      the BUS_MASTER_RLD register and its resume routine restores it.
      However, there can be only one such register in the system and it
      really should be saved after non-boot CPUs have been offlined and
      restored before they are put back online during resume.
      
      For this reason, move the saving and restoration of BUS_MASTER_RLD
      to syscore suspend and syscore resume, respectively, and drop the no
      longer necessary suspend/resume callbacks from the ACPI processor
      driver.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0a3b15ac
  5. 04 3月, 2013 1 次提交
  6. 24 2月, 2013 1 次提交
  7. 13 2月, 2013 1 次提交
    • 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
  8. 26 1月, 2013 1 次提交
  9. 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
  10. 15 1月, 2013 1 次提交
  11. 03 1月, 2013 2 次提交
    • R
      ACPI: Make acpi_bus_scan() and acpi_bus_add() take only one argument · 0cd6ac52
      Rafael J. Wysocki 提交于
      The callers of acpi_bus_add() usually assume that if it has
      succeeded, then a struct acpi_device object has been attached to
      the handle passed as the first argument.  Unfortunately, however,
      this assumption is wrong, because acpi_bus_scan(), and acpi_bus_add()
      too as a result, may return a pointer to a different struct
      acpi_device object on success (it may be an object corresponding to
      one of the descendant ACPI nodes in the namespace scope below that
      handle).
      
      For this reason, the callers of acpi_bus_add() who care about
      whether or not a struct acpi_device object has been created for
      its first argument need to check that using acpi_bus_get_device()
      anyway, so the second argument of acpi_bus_add() is not really
      useful for them.  The same observation applies to acpi_bus_scan()
      executed directly from acpi_scan_init().
      
      Therefore modify the relevant callers of acpi_bus_add() to check the
      existence of the struct acpi_device in question with the help of
      acpi_bus_get_device() and drop the no longer necessary second
      argument of acpi_bus_add().  Accordingly, modify acpi_scan_init() to
      use acpi_bus_get_device() to get acpi_root and drop the no longer
      needed second argument of acpi_bus_scan().
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      0cd6ac52
    • R
      ACPI: Remove the arguments of acpi_bus_add() that are not used · 636458de
      Rafael J. Wysocki 提交于
      Notice that acpi_bus_add() uses only 2 of its 4 arguments and
      redefine its header to match the body.  Update all of its callers as
      necessary and observe that this leads to quite a number of removed
      lines of code (Linus will like that).
      
      Add a kerneldoc comment documenting acpi_bus_add() and wonder how
      its callers make wrong assumptions about the second argument (make
      note to self to take care of that later).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      636458de
  12. 22 11月, 2012 1 次提交
  13. 15 11月, 2012 2 次提交
  14. 26 10月, 2012 1 次提交
  15. 16 9月, 2012 2 次提交
  16. 03 8月, 2012 1 次提交
  17. 06 7月, 2012 1 次提交
  18. 01 7月, 2012 1 次提交
  19. 04 6月, 2012 1 次提交
  20. 30 3月, 2012 2 次提交
  21. 29 3月, 2012 1 次提交
  22. 09 2月, 2012 2 次提交
    • Y
      ACPI: remove duplicated lines of merging problems with acpi_processor_start · 976a0be0
      Yinghai Lu 提交于
      When checking driver-core tree, found crazying warnings on my setups.
      
      [  216.025849] calling  acpi_processor_init+0x0/0x81 @ 1
      [  216.045332] ACPI: Requesting acpi_cpufreq
      [  216.047454] Monitor-Mwait will be used to enter C-1 state
      [  216.047912] Monitor-Mwait will be used to enter C-3 state
      [  216.065270] ACPI: acpi_idle registered with cpuidle
      [  216.068241] kobject (ffff8870364a1940): tried to init an initialized object, something is seriously wrong.
      [  216.085287] Pid: 1, comm: swapper/0 Not tainted 3.3.0-rc2-tip-yh-02428-ge663840-dirty #247
      [  216.105041] Call Trace:
      [  216.105192]  [<ffffffff813a9c06>] kobject_init+0x33/0x83
      [  216.124880]  [<ffffffff813aa1f8>] kobject_init_and_add+0x23/0x57
      [  216.125158]  [<ffffffff819f3a08>] cpuidle_add_sysfs+0x49/0x62
      [  216.144850]  [<ffffffff819f2a28>] __cpuidle_register_device+0xe6/0x10e
      [  216.145182]  [<ffffffff819f2ea4>] cpuidle_register_device+0x25/0x4d
      [  216.164912]  [<ffffffff81cb5774>] acpi_processor_power_init+0x13e/0x16c
      [  216.165205]  [<ffffffff81427620>] ? acpi_processor_get_throttling_info+0x128/0x158
      [  216.185012]  [<ffffffff81c68ae5>] acpi_processor_start+0x62/0x11d
      [  216.204861]  [<ffffffff81cb55ff>] acpi_processor_add+0x1b0/0x1e7
      [  216.205144]  [<ffffffff81402a7e>] acpi_device_probe+0x4e/0x11c
      [  216.225063]  [<ffffffff8148f0e7>] really_probe+0x99/0x126
      [  216.225328]  [<ffffffff8148f2a3>] driver_probe_device+0x3b/0x56
      [  216.244846]  [<ffffffff8148f31d>] __driver_attach+0x5f/0x82
      [  216.245101]  [<ffffffff8148f2be>] ? driver_probe_device+0x56/0x56
      [  216.264668]  [<ffffffff8148db80>] bus_for_each_dev+0x5c/0x88
      [  216.264942]  [<ffffffff8148eea7>] driver_attach+0x1e/0x20
      [  216.284639]  [<ffffffff8148eaec>] bus_add_driver+0xca/0x21d
      [  216.284903]  [<ffffffff81095827>] ? local_clock+0xf/0x3c
      [  216.304580]  [<ffffffff82814177>] ? acpi_fan_init+0x18/0x18
      [  216.304849]  [<ffffffff8148f79b>] driver_register+0x91/0xfe
      [  216.324545]  [<ffffffff82814177>] ? acpi_fan_init+0x18/0x18
      [  216.324813]  [<ffffffff81403705>] acpi_bus_register_driver+0x43/0x45
      [  216.344563]  [<ffffffff828141a7>] acpi_processor_init+0x30/0x81
      [  216.344845]  [<ffffffff82814177>] ? acpi_fan_init+0x18/0x18
      [  216.364590]  [<ffffffff810001e7>] do_one_initcall+0x57/0x134
      [  216.364868]  [<ffffffff827e6f8c>] kernel_init+0x146/0x1c0
      [  216.384512]  [<ffffffff81d03aa4>] kernel_thread_helper+0x4/0x10
      [  216.384819]  [<ffffffff81cfbb5d>] ? retint_restore_args+0xe/0xe
      [  216.404578]  [<ffffffff827e6e46>] ? start_kernel+0x3ab/0x3ab
      [  216.424530]  [<ffffffff81d03aa0>] ? gs_change+0xb/0xb
      [  216.424793] ------------[ cut here ]------------
      [  216.425038] WARNING: at fs/sysfs/dir.c:502 sysfs_add_one+0x97/0xab()
      [  216.444480] Hardware name: Sun Fire X4800
      [  216.444668] sysfs: cannot create duplicate filename '/devices/system/cpu/cpu0/cpuidle'
      ...
      
      It turns out acpi_processor_power_init() get called two time in acpi_processor_add and acpi_processor_start.
      
      Found several lines are duplicated in those two functions even related commit move them.
      
      The related patches are ok.  Not sure how it could happen, looks like git problem.
      
      -v2: add back acpi_processor_load_module(pr) to acpi_processor_load_start
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Acked-by: NThomas Renninger <trenn@suse.de>
      Cc: Len Brown <lenb@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      976a0be0
    • Y
      ACPI: remove duplicated lines of merging problems with acpi_processor_add · 15f51136
      Yinghai Lu 提交于
      Those lines have two copies.
      
      Not sure how it could happen, looks like git problem.
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Thomas Renninger <trenn@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      15f51136
  23. 08 2月, 2012 1 次提交
  24. 27 1月, 2012 1 次提交
  25. 20 1月, 2012 2 次提交
  26. 18 1月, 2012 2 次提交
  27. 17 1月, 2012 1 次提交
  28. 22 12月, 2011 1 次提交
    • K
      cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem · 8a25a2fd
      Kay Sievers 提交于
      This moves the 'cpu sysdev_class' over to a regular 'cpu' subsystem
      and converts the devices to regular devices. The sysdev drivers are
      implemented as subsystem interfaces now.
      
      After all sysdev classes are ported to regular driver core entities, the
      sysdev implementation will be entirely removed from the kernel.
      
      Userspace relies on events and generic sysfs subsystem infrastructure
      from sysdev devices, which are made available with this conversion.
      
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Borislav Petkov <bp@amd64.org>
      Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: Dave Jones <davej@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8a25a2fd
  29. 07 11月, 2011 1 次提交
  30. 03 3月, 2011 1 次提交
  31. 11 1月, 2011 1 次提交
  32. 14 12月, 2010 1 次提交