1. 18 7月, 2013 3 次提交
    • R
      ACPI / video / i915: No ACPI backlight if firmware expects Windows 8 · 8c5bd7ad
      Rafael J. Wysocki 提交于
      According to Matthew Garrett, "Windows 8 leaves backlight control up
      to individual graphics drivers rather than making ACPI calls itself.
      There's plenty of evidence to suggest that the Intel driver for
      Windows [8] doesn't use the ACPI interface, including the fact that
      it's broken on a bunch of machines when the OS claims to support
      Windows 8.  The simplest thing to do appears to be to disable the
      ACPI backlight interface on these systems".
      
      There's a problem with that approach, however, because simply
      avoiding to register the ACPI backlight interface if the firmware
      calls _OSI for Windows 8 may not work in the following situations:
       (1) The ACPI backlight interface actually works on the given system
           and the i915 driver is not loaded (e.g. another graphics driver
           is used).
       (2) The ACPI backlight interface doesn't work on the given system,
           but there is a vendor platform driver that will register its
           own, equally broken, backlight interface if not prevented from
           doing so by the ACPI subsystem.
      Therefore we need to allow the ACPI backlight interface to be
      registered until the i915 driver is loaded which then will unregister
      it if the firmware has called _OSI for Windows 8 (or will register
      the ACPI video driver without backlight support if not already
      present).
      
      For this reason, introduce an alternative function for registering
      ACPI video, acpi_video_register_with_quirks(), that will check
      whether or not the ACPI video driver has already been registered
      and whether or not the backlight Windows 8 quirk has to be applied.
      If the quirk has to be applied, it will block the ACPI backlight
      support and either unregister the backlight interface if the ACPI
      video driver has already been registered, or register the ACPI
      video driver without the backlight interface otherwise.  Make
      the i915 driver use acpi_video_register_with_quirks() instead of
      acpi_video_register() in i915_driver_load().
      
      This change is based on earlier patches from Matthew Garrett,
      Chun-Yi Lee and Seth Forshee and includes a fix from Aaron Lu's.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=51231Tested-by: NAaron Lu <aaron.lu@intel.com>
      Tested-by: NIgor Gnatenko <i.gnatenko.brain@gmail.com>
      Tested-by: NYves-Alexis Perez <corsac@debian.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NAaron Lu <aaron.lu@intel.com>
      Acked-by: NMatthew Garrett <matthew.garrett@nebula.com>
      8c5bd7ad
    • M
      ACPI / video: Always call acpi_video_init_brightness() on init · c04c697c
      Matthew Garrett 提交于
      We have to call acpi_video_init_brightness() even if we're not going
      to initialise the backlight - Thinkpads seem to use this as the
      trigger for enabling ACPI notifications rather than handling it in
      firmware.
      
      [rjw: Drop the brightness object created by
       acpi_video_init_brightness() if we are not going to use it.]
      Signed-off-by: NMatthew Garrett <matthew.garrett@nebula.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c04c697c
    • A
      ACPICA: expose OSI version · 242b2287
      Aaron Lu 提交于
      Expose acpi_gbl_osi_data so that code outside of ACPICA can check
      the value of the last successfull _OSI call.  The definitions for
      OSI versions are moved to actypes.h so that other components can
      access them too.
      
      Based on a patch from Matthew Garrett which in turn was based on
      an earlier patch from Seth Forshee.
      
      [rjw: Changelog]
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      242b2287
  2. 05 7月, 2013 1 次提交
  3. 04 7月, 2013 5 次提交
    • N
      ACPI / fan: Initialize acpi_state variable · 85eb9827
      Naresh Bhat 提交于
      Make the following compiler warning go away:
      
       CC      drivers/acpi/fan.o
      drivers/acpi/fan.c: In function ‘fan_get_cur_state’:
      drivers/acpi/fan.c:96:9: warning: ‘acpi_state’ may be used uninitialized in this function [-Wuninitialized]
      
      by initializing the local variable acpi_state in fan_get_cur_state().
      
      [rjw: Changelog]
      Signed-off-by: NNaresh Bhat <naresh.bhat@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      85eb9827
    • H
      ACPI / scan: remove unused LIST_HEAD(acpi_device_list) · b67cf7c4
      Haicheng Li 提交于
      The acpi_device_list list is not used, so removed it.
      
      [rjw: Changelog]
      Signed-off-by: NHaicheng Li <haicheng.li@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b67cf7c4
    • R
      ACPI / dock: Actually define acpi_dock_init() as void · 2ce65fe8
      Rafael J. Wysocki 提交于
      Commit 94add0f8 (ACPI / dock: Initialize ACPI dock subsystem upfront)
      changed the header of acpi_dock_init() in internal.h so that it is
      supposed to be a void function now, but it forgot to update its
      actual definition in dock.c according to which it still is supposed
      to return int.
      
      Although that didn't cause any visible breakage or even a compiler
      warning to be thrown, which is odd enough, fix it.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: 3.10+ <stable@vger.kernel.org>
      2ce65fe8
    • R
      ACPI / PM: Fix corner case in acpi_bus_update_power() · 91bdad0b
      Rafael J. Wysocki 提交于
      The role of acpi_bus_update_power() is to update the given ACPI
      device object's power.state field to reflect the current physical
      state of the device (as inferred from the configuration of power
      resources and _PSC, if available).  For this purpose it calls
      acpi_device_set_power() that should update the power resources'
      reference counters and set power.state as appropriate.  However,
      that doesn't work if the "new" state is D1, D2 or D3hot and the
      the current value of power.state means D3cold, because in that
      case acpi_device_set_power() will refuse to transition the device
      from D3cold to non-D0.
      
      To address this problem, make acpi_bus_update_power() call
      acpi_power_transition() directly to update the power resources'
      reference counters and only use acpi_device_set_power() to put
      the device into D0 if the current physical state of it cannot
      be determined.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: 3.9+ <stable@vger.kernel.org>
      91bdad0b
    • K
      clean up scary strncpy(dst, src, strlen(src)) uses · 096a8aac
      Kees Cook 提交于
      Fix various weird constructions of strncpy(dst, src, strlen(src)).
      
      Length limits should be about the space available in the destination,
      not repurposed as a method to either always include or always exclude a
      trailing NULL byte.  Either the NULL should always be copied (using
      strlcpy), or it should not be copied (using something like memcpy).
      Readable code should not depend on the weird behavior of strncpy when it
      hits the length limit.  Better to avoid the anti-pattern entirely.
      
      [akpm@linux-foundation.org: revert getdelays.c part due to missing bsd/string.h]
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>	[staging]
      Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>	[acpi]
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Ursula Braun <ursula.braun@de.ibm.com>
      Cc: Frank Blaschka <blaschka@linux.vnet.ibm.com>
      Cc: Richard Weinberger <richard@nod.at>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      096a8aac
  4. 01 7月, 2013 1 次提交
  5. 29 6月, 2013 1 次提交
    • L
      acpi: Eliminate console msg if pstore.backend excludes ERST · 74fd6c6f
      Lenny Szubowicz 提交于
      This is patch 2/3 of a patch set that avoids what misleadingly appears
      to be a error during boot:
      
      ERST: Could not register with persistent store
      
      This message is displayed if the system has a valid ACPI ERST table and the
      pstore.backend kernel parameter has been used to disable use of ERST by
      pstore. But this same message is used for errors that preclude registration.
      
      In erst_init don't complain if the setting of kernel parameter pstore.backend
      precludes use of ACPI ERST for pstore. Routine pstore_register will inform
      about the facility that does register.
      
      Also, don't leave a dangling pointer to deallocated mem for the pstore
      buffer when registration fails.
      Signed-off-by: NLenny Szubowicz <lszubowi@redhat.com>
      Reported-by: NNaotaka Hamaguchi <n.hamaguchi@jp.fujitsu.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      74fd6c6f
  6. 28 6月, 2013 4 次提交
  7. 26 6月, 2013 1 次提交
  8. 24 6月, 2013 2 次提交
    • H
      ACPI / processor: Remove unused macros in processor_driver.c · 86d6725a
      Hanjun Guo 提交于
      ACPI_PROCESSOR_FILE_INFO, ACPI_PROCESSOR_FILE_THROTTLING and
      ACPI_PROCESSOR_FILE_LIMIT are used for procfs, but this feature was removed
      in commit d09fe555 (ACPI processor: remove deprecated ACPI procfs I/F) long
      ago. So, these macros should also be removed.
      
      ACPI_PROCESSOR_LIMIT_USER and ACPI_PROCESSOR_LIMIT_THERMAL are not used
      by any code, remove them too.
      Signed-off-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      86d6725a
    • R
      ACPI / dock / PCI: Synchronous handling of dock events for PCI devices · 21a31013
      Rafael J. Wysocki 提交于
      The interactions between the ACPI dock driver and the ACPI-based PCI
      hotplug (acpiphp) are currently problematic because of ordering
      issues during hot-remove operations.
      
      First of all, the current ACPI glue code expects that physical
      devices will always be deleted before deleting the companion ACPI
      device objects.  Otherwise, acpi_unbind_one() will fail with a
      warning message printed to the kernel log, for example:
      
      [  185.026073] usb usb5: Oops, 'acpi_handle' corrupt
      [  185.035150] pci 0000:1b:00.0: Oops, 'acpi_handle' corrupt
      [  185.035515] pci 0000:18:02.0: Oops, 'acpi_handle' corrupt
      [  180.013656]  port1: Oops, 'acpi_handle' corrupt
      
      This means, in particular, that struct pci_dev objects have to
      be deleted before the struct acpi_device objects they are "glued"
      with.
      
      Now, the following happens the during the undocking of an ACPI-based
      dock station:
       1) hotplug_dock_devices() invokes registered hotplug callbacks to
          destroy physical devices associated with the ACPI device objects
          depending on the dock station.  It calls dd->ops->handler() for
          each of those device objects.
       2) For PCI devices dd->ops->handler() points to
          handle_hotplug_event_func() that queues up a separate work item
          to execute _handle_hotplug_event_func() for the given device and
          returns immediately.  That work item will be executed later.
       3) hotplug_dock_devices() calls dock_remove_acpi_device() for each
          device depending on the dock station.  This runs acpi_bus_trim()
          for each of them, which causes the underlying ACPI device object
          to be destroyed, but the work items queued up by
          handle_hotplug_event_func() haven't been started yet.
       4) _handle_hotplug_event_func() queued up in step 2) are executed
          and cause the above failure to happen, because the PCI devices
          they handle do not have the companion ACPI device objects any
          more (those objects have been deleted in step 3).
      
      The possible breakage doesn't end here, though, because
      hotplug_dock_devices() may return before at least some of the
      _handle_hotplug_event_func() work items spawned by it have a
      chance to complete and then undock() will cause _DCK to be
      evaluated and that will cause the devices handled by the
      _handle_hotplug_event_func() to go away possibly while they are
      being accessed.
      
      This means that dd->ops->handler() for PCI devices should not point
      to handle_hotplug_event_func().  Instead, it should point to a
      function that will do the work of _handle_hotplug_event_func()
      synchronously.  For this reason, introduce such a function,
      hotplug_event_func(), and modity acpiphp_dock_ops to point to
      it as the handler.
      
      Unfortunately, however, this is not sufficient, because if the dock
      code were not changed further, hotplug_event_func() would now
      deadlock with hotplug_dock_devices() that called it, since it would
      run unregister_hotplug_dock_device() which in turn would attempt to
      acquire the dock station's hp_lock mutex already acquired by
      hotplug_dock_devices().
      
      To resolve that deadlock use the observation that
      unregister_hotplug_dock_device() won't need to acquire hp_lock
      if PCI bridges the devices on the dock station depend on are
      prevented from being removed prematurely while the first loop in
      hotplug_dock_devices() is in progress.
      
      To make that possible, introduce a mechanism by which the callers of
      register_hotplug_dock_device() can provide "init" and "release"
      routines that will be executed, respectively, during the addition
      and removal of the physical device object associated with the
      given ACPI device handle.  Make acpiphp use two new functions,
      acpiphp_dock_init() and acpiphp_dock_release(), that call
      get_bridge() and put_bridge(), respectively, on the acpiphp bridge
      holding the given device, for this purpose.
      
      In addition to that, remove the dock station's list of
      "hotplug devices" and make the dock code always walk the whole list
      of "dependent devices" instead in such a way that the loops in
      hotplug_dock_devices() and dock_event() (replacing the loops over
      "hotplug devices") will take references to the list entries that
      register_hotplug_dock_device() has been called for.  That prevents
      the "release" routines associated with those entries from being
      called while the given entry is being processed and for PCI
      devices this means that their bridges won't be removed (by a
      concurrent thread) while hotplug_event_func() handling them is
      being executed.
      
      This change is based on two earlier patches from Jiang Liu.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=59501Reported-and-tested-by: NAlexander E. Patrakov <patrakov@gmail.com>
      Tracked-down-by: NJiang Liu <jiang.liu@huawei.com>
      Tested-by: NIllya Klymov <xanf@xanf.me>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Cc: 3.9+ <stable@vger.kernel.org>
      21a31013
  9. 23 6月, 2013 1 次提交
  10. 20 6月, 2013 17 次提交
  11. 19 6月, 2013 3 次提交
  12. 16 6月, 2013 1 次提交