1. 23 11月, 2013 1 次提交
    • R
      ACPI / scan: Define non-empty device removal handler · d783156e
      Rafael J. Wysocki 提交于
      If an ACPI namespace node is removed (usually, as a result of a
      table unload), and there is a data object attached to that node,
      acpi_ns_delete_node() executes the removal handler submitted to
      acpi_attach_data() for that object.  That handler is currently empty
      for struct acpi_device objects, so it is necessary to detach those
      objects from the corresponding ACPI namespace nodes in advance every
      time a table unload may happen.  That is cumbersome and inefficient
      and leads to some design constraints that turn out to be quite
      inconvenient (in particular, struct acpi_device objects cannot be
      registered for namespace nodes representing devices that are not
      reported as present or functional by _STA).
      
      For this reason, introduce a non-empty removal handler for ACPI
      device objects that will unregister them when their ACPI namespace
      nodes go away.
      
      This code modification alone should not change functionality except
      for the ordering of the ACPI hotplug workqueue which should not
      matter (without subsequent code changes).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      d783156e
  2. 08 11月, 2013 1 次提交
    • R
      ACPI / hotplug: Consolidate deferred execution of ACPI hotplug routines · 7b98118a
      Rafael J. Wysocki 提交于
      There are two different interfaces for queuing up work items on the
      ACPI hotplug workqueue, alloc_acpi_hp_work() used by PCI and PCI host
      bridge hotplug code and acpi_os_hotplug_execute() used by the common
      ACPI hotplug code and docking stations.  They both are somewhat
      cumbersome to use and work slightly differently.
      
      The users of alloc_acpi_hp_work() have to submit a work function that
      will extract the necessary data items from a struct acpi_hp_work
      object allocated by alloc_acpi_hp_work() and then will free that
      object, while it would be more straightforward to simply use a work
      function with one more argument and let the interface take care of
      the execution details.
      
      The users of acpi_os_hotplug_execute() also have to deal with the
      fact that it takes only one argument in addition to the work function
      pointer, although acpi_os_execute_deferred() actually takes care of
      the allocation and freeing of memory, so it would have been able to
      pass more arguments to the work function if it hadn't been
      constrained by the connection with acpi_os_execute().
      
      Moreover, while alloc_acpi_hp_work() makes GFP_KERNEL memory
      allocations, which is correct, because hotplug work items are
      always queued up from process context, acpi_os_hotplug_execute()
      uses GFP_ATOMIC, as that is needed by acpi_os_execute().  Also,
      acpi_os_execute_deferred() queued up by it waits for the ACPI event
      workqueues to flush before executing the work function, whereas
      alloc_acpi_hp_work() can't do anything similar.  That leads to
      somewhat arbitrary differences in behavior between various ACPI
      hotplug code paths and has to be straightened up.
      
      For this reason, replace both alloc_acpi_hp_work() and
      acpi_os_hotplug_execute() with a single interface,
      acpi_hotplug_execute(), combining their behavior and being more
      friendly to its users than any of the two.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      7b98118a
  3. 18 10月, 2013 1 次提交
  4. 25 9月, 2013 2 次提交
  5. 15 8月, 2013 1 次提交
  6. 13 8月, 2013 1 次提交
  7. 31 7月, 2013 1 次提交
  8. 26 7月, 2013 1 次提交
  9. 23 7月, 2013 2 次提交
    • L
      ACPI: Add facility to remove all _OSI strings · 741d8128
      Lv Zheng 提交于
      This patch changes the "acpi_osi=" boot parameter implementation so
      that:
      1. "acpi_osi=!" can be used to disable all _OSI OS vendor strings by
         default.  It is meaningless to specify "acpi_osi=!" multiple
         times as it can only affect the default state of the target _OSI
         strings.
      2. "acpi_osi=!*" can be used to remove all _OSI OS vendor strings
         and all _OSI feature group strings.  It is useful to specify
         "acpi_osi=!*" multiple times through kernel command line to
         override the current state of the target _OSI strings.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Reviewed-by: NZhang Rui <rui.zhang@intel.com>
      Acked-by: NLen Brown <len.brown@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      741d8128
    • L
      ACPI: Add facility to disable all _OSI OS vendor strings · 5dc17986
      Lv Zheng 提交于
      This patch introduces "acpi_osi=!" command line to force Linux replying
      "UNSUPPORTED" to all of the _OSI strings.  This patch is based on an
      ACPICA enhancement - the new API acpi_update_interfaces().
      
      The _OSI object provides the platform with the ability to query OSPM
      to determine the set of ACPI related interfaces, behaviors, or
      features that the operating system supports.  The argument passed to
      the _OSI is a string like the followings:
      1. Feature Group String, examples include
         Module Device
         Processor Device
         3.0 _SCP Extensions
         Processor Aggregator Device
         ...
      2. OS Vendor String, examples include
         Linux
         FreeBSD
         Windows
         ...
      
      There are AML codes provided in the ACPI namespace written in the
      following style to determine OSPM interfaces / features:
          Method(OSCK)
          {
              if (CondRefOf(_OSI, Local0))
              {
                  if (\_OSI("Windows"))
                  {
                      Return (One)
                  }
                  if (\_OSI("Windows 2006"))
                  {
                      Return (Ones)
                  }
                  Return (Zero)
              }
              Return (Zero)
          }
      
      There is a debugging facility implemented in Linux.  Users can pass
      "acpi_osi=" boot parameters to the kernel to tune the _OSI evaluation
      result so that certain AML codes can be executed.  Current
      implementation includes:
      1. 'acpi_osi=' - this makes CondRefOf(_OSI, Local0) TRUE
      2. 'acpi_osi="Windows"' - this makes \_OSI("Windows") TRUE
      3. 'acpi_osi="!Windows"' - this makes \_OSI("Windows") FALSE
      The function to implement this feature is also used as a quirk mechanism
      in the Linux ACPI subystem.
      
      When _OSI is evaluatated by the AML codes, ACPICA replies "SUPPORTED"
      to all Windows operating system vendor strings.  This is because
      Windows operating systems return "SUPPORTED" if the argument to the
      _OSI method specifies an earlier version of Windows.  Please refer to
      the following MSDN document:
      
      How to Identify the Windows Version in ACPI by Using _OSI
      http://msdn.microsoft.com/en-us/library/hardware/gg463275.aspx
      
      This adds difficulties when developers want to feed specific Windows
      operating system vendor string to the BIOS codes for debugging
      purpose, multiple acpi_osi="!xxx" have to be specified in the command
      line to force Linux replying "UNSUPPORTED" to the Windows OS vendor
      strings listed in the AML codes.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Reviewed-by: NZhang Rui <rui.zhang@intel.com>
      Acked-by: NLen Brown <len.brown@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5dc17986
  10. 28 6月, 2013 1 次提交
    • M
      ACPI: implement acpi_os_get_timer() according the spec · 10619066
      Mika Westerberg 提交于
      ACPI Timer() opcode should return monotonically increasing clock with 100ns
      granularity according the ACPI 5.0 spec.
      
      Testing the current Timer() implementation with following ASL code (and an
      additional debug print in acpi_os_sleep() to get the sleep times dumped out
      to dmesg):
      
      	// Test: 10ms
      	Store(Timer, Local1)
      	Sleep(10)
      	Divide(Subtract(Timer, Local1), 10000,, Local1)
      	Sleep(Local1)
      
      	// Test: 200ms
      	Store(Timer, Local1)
      	Sleep(200)
      	Divide(Subtract(Timer, Local1), 10000,, Local1)
      	Sleep(Local1)
      
      	// Test 1300ms
      	Store(Timer, Local1)
      	Sleep(1300)
      	Divide(Subtract(Timer, Local1), 10000,, Local1)
      	Sleep(Local1)
      
      The second sleep value is calculated using Timer(). If the implementation
      is good enough we should be able to get the second value pretty close to
      the first.
      
      However, the current Timer() gives pretty bad sleep times:
      
      	[   11.488100] ACPI: acpi_os_get_timer() TBD
      	[   11.492150] ACPI: Sleep(10)
      	[   11.502993] ACPI: Sleep(0)
      	[   11.506315] ACPI: Sleep(200)
      	[   11.706237] ACPI: Sleep(0)
      	[   11.709550] ACPI: Sleep(1300)
      	[   13.008929] ACPI: Sleep(0)
      
      Fix this with the help of ktime_get(). Once the fix is applied and run
      against the same ASL code we get:
      
      	[   11.486786] ACPI: Sleep(10)
      	[   11.499029] ACPI: Sleep(12)
      	[   11.512350] ACPI: Sleep(200)
      	[   11.712282] ACPI: Sleep(200)
      	[   11.912170] ACPI: Sleep(1300)
      	[   13.211577] ACPI: Sleep(1300)
      
      That is much more closer to the values we expected.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      10619066
  11. 16 6月, 2013 1 次提交
  12. 24 4月, 2013 1 次提交
  13. 25 3月, 2013 1 次提交
  14. 10 2月, 2013 1 次提交
  15. 31 1月, 2013 1 次提交
    • M
      efi: Make 'efi_enabled' a function to query EFI facilities · 83e68189
      Matt Fleming 提交于
      Originally 'efi_enabled' indicated whether a kernel was booted from
      EFI firmware. Over time its semantics have changed, and it now
      indicates whether or not we are booted on an EFI machine with
      bit-native firmware, e.g. 64-bit kernel with 64-bit firmware.
      
      The immediate motivation for this patch is the bug report at,
      
          https://bugs.launchpad.net/ubuntu-cdimage/+bug/1040557
      
      which details how running a platform driver on an EFI machine that is
      designed to run under BIOS can cause the machine to become
      bricked. Also, the following report,
      
          https://bugzilla.kernel.org/show_bug.cgi?id=47121
      
      details how running said driver can also cause Machine Check
      Exceptions. Drivers need a new means of detecting whether they're
      running on an EFI machine, as sadly the expression,
      
          if (!efi_enabled)
      
      hasn't been a sufficient condition for quite some time.
      
      Users actually want to query 'efi_enabled' for different reasons -
      what they really want access to is the list of available EFI
      facilities.
      
      For instance, the x86 reboot code needs to know whether it can invoke
      the ResetSystem() function provided by the EFI runtime services, while
      the ACPI OSL code wants to know whether the EFI config tables were
      mapped successfully. There are also checks in some of the platform
      driver code to simply see if they're running on an EFI machine (which
      would make it a bad idea to do BIOS-y things).
      
      This patch is a prereq for the samsung-laptop fix patch.
      
      Cc: David Airlie <airlied@linux.ie>
      Cc: Corentin Chary <corentincj@iksaif.net>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Dave Jiang <dave.jiang@intel.com>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Peter Jones <pjones@redhat.com>
      Cc: Colin Ian King <colin.king@canonical.com>
      Cc: Steve Langasek <steve.langasek@canonical.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      83e68189
  16. 26 1月, 2013 1 次提交
  17. 21 1月, 2013 1 次提交
  18. 15 11月, 2012 2 次提交
  19. 01 10月, 2012 3 次提交
  20. 01 6月, 2012 1 次提交
  21. 19 4月, 2012 1 次提交
    • T
      Revert "ACPI: Make ACPI interrupt threaded" · 9ecf8c0d
      Thomas Gleixner 提交于
      This reverts commit 6fe0d062.
      
      Paul bisected this regression.
      
      The conversion was done blindly and is wrong, as it does not provide a
      primary handler to disable the level type irq on the device level.
      Neither does it set the IRQF_ONESHOT flag which handles that at the irq
      line level.  This can't be done as the interrupt might be shared, though
      we might extend the core to force it.
      
      So an interrupt on this line will wake up the thread, but immediately
      unmask the irq after that.  Due to the interrupt being level type the
      hardware interrupt is raised over and over and prevents the irq thread
      from handling it.  Fail.
      
      request_irq() unfortunately does not refuse such a request and the patch
      was obviously never tested with real interrupts.
      Bisected-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9ecf8c0d
  22. 30 3月, 2012 3 次提交
  23. 22 3月, 2012 2 次提交
  24. 14 3月, 2012 1 次提交
  25. 21 1月, 2012 2 次提交
    • M
      ACPI, APEI: Add RAM mapping support to ACPI · ba242d5b
      Myron Stowe 提交于
      This patch adds support for RAM to ACPI's mapping capabilities in order
      to support APEI error injection (EINJ) actions.
      
      This patch re-factors similar functionality introduced in commit
      76da3fb3, bringing it into osl.c in preparation for removing
      ./drivers/acpi/atomicio.[ch].
      Signed-off-by: NMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      ba242d5b
    • M
      ACPI, APEI: Add 64-bit read/write support for APEI on i386 · e615bf5b
      Myron Stowe 提交于
      Base ACPI (CA) currently does not support atomic 64-bit reads and writes
      (acpi_read() and acpi_write() split 64-bit loads/stores into two
      32-bit transfers) yet APEI expects 64-bit transfer capability, even
      when running on 32-bit systems.
      
      This patch implements 64-bit read and write routines for APEI usage.
      
      This patch re-factors similar functionality introduced in commit
      04c25997, bringing it into the ACPI subsystem in preparation for
      removing ./drivers/acpi/atomicio.[ch].  In the implementation I have
      replicated acpi_os_read_memory() and acpi_os_write_memory(), creating
      64-bit versions for APEI to utilize, as opposed to something more
      elegant.  My thinking is that we should attempt to see if we can get
      ACPI's CA/OSL changed so that the existing acpi_read() and acpi_write()
      interfaces are natively 64-bit capable and then subsequently remove the
      replication.
      Signed-off-by: NMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      e615bf5b
  26. 17 1月, 2012 3 次提交
  27. 15 10月, 2011 1 次提交
    • P
      PCI hotplug: acpiphp: Prevent deadlock on PCI-to-PCI bridge remove · 6af8bef1
      Prarit Bhargava 提交于
      I originally submitted a patch to workaround this by pushing all Ejection
      Requests and Device Checks onto the kacpi_hotplug queue.
      
      http://marc.info/?l=linux-acpi&m=131678270930105&w=2
      
      The patch is still insufficient in that Bus Checks also need to be added.
      
      Rather than add all events, including non-PCI-hotplug events, to the
      hotplug queue, mjg suggested that a better approach would be to modify
      the acpiphp driver so only acpiphp events would be added to the
      kacpi_hotplug queue.
      
      It's a longer patch, but at least we maintain the benefit of having separate
      queues in ACPI.  This, of course, is still only a workaround the problem.
      As Bjorn and mjg pointed out, we have to refactor a lot of this code to do
      the right thing but at this point it is a better to have this code working.
      
      The acpi core places all events on the kacpi_notify queue.  When the acpiphp
      driver is loaded and a PCI card with a PCI-to-PCI bridge is removed the
      following call sequence occurs:
      
      cleanup_p2p_bridge()
      	    -> cleanup_bridge()
      		    -> acpi_remove_notify_handler()
      			    -> acpi_os_wait_events_complete()
      				    -> flush_workqueue(kacpi_notify_wq)
      
      which is the queue we are currently executing on and the process will hang.
      
      Move all hotplug acpiphp events onto the kacpi_hotplug workqueue.  In
      handle_hotplug_event_bridge() and handle_hotplug_event_func() we can simply
      push the rest of the work onto the kacpi_hotplug queue and then avoid the
      deadlock.
      Signed-off-by: NPrarit Bhargava <prarit@redhat.com>
      Cc: mjg@redhat.com
      Cc: bhelgaas@google.com
      Cc: linux-acpi@vger.kernel.org
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      6af8bef1
  28. 03 8月, 2011 1 次提交
  29. 02 8月, 2011 1 次提交