1. 12 5月, 2013 9 次提交
    • R
      ACPI / memhotplug: Bind removable memory blocks to ACPI device nodes · e2ff3940
      Rafael J. Wysocki 提交于
      During ACPI memory hotplug configuration bind memory blocks residing
      in modules removable through the standard ACPI mechanism to struct
      acpi_device objects associated with ACPI namespace objects
      representing those modules.  Accordingly, unbind those memory blocks
      from the struct acpi_device objects when the memory modules in
      question are being removed.
      
      When "offline" operation for devices representing memory blocks is
      introduced, this will allow the ACPI core's device hot-remove code to
      use it to carry out remove_memory() for those memory blocks and check
      the results of that before it actually removes the modules holding
      them from the system.
      
      Since walk_memory_range() is used for accessing all memory blocks
      corresponding to a given ACPI namespace object, it is exported from
      memory_hotplug.c so that the code in acpi_memhotplug.c can use it.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NVasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
      Reviewed-by: NToshi Kani <toshi.kani@hp.com>
      e2ff3940
    • 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 / hotplug: Use device offline/online for graceful hot-removal · 683058e3
      Rafael J. Wysocki 提交于
      Modify the generic ACPI hotplug code to be able to check if devices
      scheduled for hot-removal may be gracefully removed from the system
      using the device offline/online mechanism introduced previously.
      
      Namely, make acpi_scan_hot_remove() handling device hot-removal call
      device_offline() for all physical companions of the ACPI device nodes
      involved in the operation and check the results.  If any of the
      device_offline() calls fails, the function will not progress to the
      removal phase (which cannot be aborted), unless its (new) force
      argument is set (in case of a failing offline it will put the devices
      offlined by it back online).
      
      In support of 'forced' device hot-removal, add a new sysfs attribute
      'force_remove' that will reside under /sys/firmware/acpi/hotplug/.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NToshi Kani <toshi.kani@hp.com>
      683058e3
    • R
      Driver core: Use generic offline/online for CPU offline/online · 0902a904
      Rafael J. Wysocki 提交于
      Rework the CPU hotplug code in drivers/base/cpu.c to use the
      generic offline/online support introduced previously instead of
      its own CPU-specific code.
      
      For this purpose, modify cpu_subsys to provide offline and online
      callbacks for CONFIG_HOTPLUG_CPU set and remove the code handling
      the CPU-specific 'online' sysfs attribute.
      
      This modification is not supposed to change the user-observable
      behavior of the kernel (i.e. the 'online' attribute will be present
      in exactly the same place in sysfs and should trigger exactly the
      same actions as before).
      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>
      0902a904
    • R
      Driver core: Add offline/online device operations · 4f3549d7
      Rafael J. Wysocki 提交于
      In some cases, graceful hot-removal of devices is not possible,
      although in principle the devices in question support hotplug.
      For example, that may happen for the last CPU in the system or
      for memory modules holding kernel memory.
      
      In those cases it is nice to be able to check if the given device
      can be gracefully hot-removed before triggering a removal procedure
      that cannot be aborted or reversed.  Unfortunately, however, the
      kernel currently doesn't provide any support for that.
      
      To address that deficiency, introduce support for offline and
      online operations that can be performed on devices, respectively,
      before a hot-removal and in case when it is necessary (or convenient)
      to put a device back online after a successful offline (that has not
      been followed by removal).  The idea is that the offline will fail
      whenever the given device cannot be gracefully removed from the
      system and it will not be allowed to use the device after a
      successful offline (until a subsequent online) in analogy with the
      existing CPU offline/online mechanism.
      
      For now, the offline and online operations are introduced at the
      bus type level, as that should be sufficient for the most urgent use
      cases (CPUs and memory modules).  In the future, however, the
      approach may be extended to cover some more complicated device
      offline/online scenarios involving device drivers etc.
      
      The lock_device_hotplug() and unlock_device_hotplug() functions are
      introduced because subsequent patches need to put larger pieces of
      code under device_hotplug_lock to prevent race conditions between
      device offline and removal from happening.
      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>
      4f3549d7
    • L
      ACPI / AC: Add sleep quirk for Thinkpad e530 · 0ab5bb64
      Lan Tianyu 提交于
      The Thinkpad e530's BIOS notifies the AC device first and then
      sleeps for certain amount of time before doing real work in the
      EC event handler (_Qxx):
      
       Method (_Q27, 0, NotSerialized)
       {
             Notify (AC, 0x80)
             Sleep (0x03E8)
             Store (Zero, PWRS)
             PNOT ()
       }
      
      This causes the AC driver to report an outdated AC state to user
      space, because it reads the state information from the device while
      the EC handler is sleeping.
      
      Introduce a quirk to cause the AC driver to wait in acpi_ac_notify()
      before calling acpi_ac_get_state() on systems known to have this
      problem and add Thinkpad e530 to the list of quirky machines (with
      a 1s delay which has been verified to be sufficient for that
      machine).
      
      [rjw: Changelog]
      References: https://bugzilla.kernel.org/show_bug.cgi?id=45221Signed-off-by: NLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0ab5bb64
    • L
      ACPI / EC: Restart transaction even when the IBF flag set · 28fe5c82
      Lan Tianyu 提交于
      The EC driver works abnormally with IBF flag always set.
      IBF means "The host has written a byte of data to the command
      or data port, but the embedded controller has not yet read it".
      If IBF is set in the EC status and not cleared, this will cause
      all subsequent EC requests to fail with a timeout error.
      
      Change the EC driver so that it doesn't refuse to restart a
      transaction if IBF is set in the status.  Also increase the
      number of transaction restarts to 5, as it turns out that 2
      is not sufficient in some cases.
      
      This bug happens on several different machines (Asus V1S,
      Dell Latitude E6530, Samsung R719, Acer Aspire 5930G,
      Sony Vaio SR19VN and others).
      
      [rjw: Changelog]
      References: https://bugzilla.kernel.org/show_bug.cgi?id=14733
      References: https://bugzilla.kernel.org/show_bug.cgi?id=15560
      References: https://bugzilla.kernel.org/show_bug.cgi?id=15946
      References: https://bugzilla.kernel.org/show_bug.cgi?id=42945
      References: https://bugzilla.kernel.org/show_bug.cgi?id=48221Signed-off-by: NLan Tianyu <tianyu.lan@intel.com>
      Cc: All <stable@vger.kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      28fe5c82
    • A
      ACPI video: ignore BIOS initial backlight value for HP 1000 · 4ef366c5
      Alex Hung 提交于
      On HP 1000 lapops, BIOS reports minimum backlight on boot and
      causes backlight to dim completely. This ignores the initial backlight
      values and set to max brightness.
      
      References:: https://bugs.launchpad.net/bugs/1167760Signed-off-by: NAlex Hung <alex.hung@canonical.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      4ef366c5
    • 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
  2. 10 5月, 2013 31 次提交