1. 10 5月, 2007 1 次提交
    • A
      ACPI: created a dedicated workqueue for notify() execution · 88db5e14
      Alexey Starikovskiy 提交于
      HP nx6125/nx6325/... machines have a _GPE handler with an infinite
      loop sending Notify() events to different ACPI subsystems.
      
      Notify handler in ACPI driver is a C-routine, which may call ACPI
      interpreter again to get access to some ACPI variables
      (acpi_evaluate_xxx).
      On these HP machines such an evaluation changes state of some variable
      and lets the loop above break.
      
      In the current ACPI implementation Notify requests are being deferred
      to the same kacpid workqueue on which the above GPE handler with
      infinite loop is executing. Thus we have a deadlock -- loop will
      continue to spin, sending notify events, and at the same time
      preventing these notify events from being run on a workqueue. All
      notify events are deferred, thus we see increase in memory consumption
      noticed by author of the thread. Also as GPE handling is bloked,
      machines overheat. Eventually by external poll of the same
      acpi_evaluate, kacpid is released and all the queued notify events are
      free to run, thus 100% cpu utilization by kacpid for several seconds
      or more.
      
      To prevent all these horrors it's needed to not put notify events to
      kacpid workqueue by either executing them immediately or putting them
      on some other thread. It's dangerous to execute notify events in
      place, as it will put several ACPI interpreter stacks on top of each
      other (at least 4 in case of nx6125), thus causing kernel  stack
      overflow.
      
      First attempt to create a new thread was done by Peter Wainwright
      He created a bunch of threads, which were stealing work from a kacpid
      workqueue.
      This patch appeared in 2.6.15 kernel shipped with Ubuntu 6.06 LTS.
      
      Second attempt was done by me, I created a new thread for each Notify
      event. This worked OK on HP nx machines, but broke Linus' Compaq
      n620c, by producing threads with a speed what they stopped the machine
      completely. Thus this patch was reverted from 18-rc2 as I remember.
      I re-made the patch to create second workqueue just for notify events,
      thus hopping it will not break Linus' machine. Patch was tested on the
      same HP nx machines in #5534 and #7122, but I did not received reply
      from Linus on a test patch sent to him.
      Patch went to 19-rc and was rejected with much fanfare again.
      There was 4th patch, which inserted schedule_timeout(1) into deferred
      execution of kacpid, if we had any notify requests pending, but Linus
      decided that it was too complex (involved either changes to workqueue
      to see if it's empty or atomic inc/dec).
      Now you see last variant which adds yield() to every GPE execution.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=5534
      http://bugzilla.kernel.org/show_bug.cgi?id=8385Signed-off-by: NAlexey Starikovskiy <alexey.y.starikovskiy@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      88db5e14
  2. 09 5月, 2007 1 次提交
  3. 17 2月, 2007 1 次提交
  4. 16 2月, 2007 2 次提交
  5. 13 2月, 2007 1 次提交
  6. 03 2月, 2007 2 次提交
  7. 26 1月, 2007 1 次提交
    • B
      ACPI: move FADT resource reservations from motherboard driver to osl · 9a47cdb1
      Bjorn Helgaas 提交于
      Resources described by the FADT aren't really a good fit for the
      ACPI motherboard driver.
      
      The motherboard driver cares about PNP0C01 and PNP0C02 devices and
      their resources.
      
      The FADT describes some resources used by the ACPI core.  Often, they
      are also described by by the _CRS of a motherboard device, but I think
      it's better to reserve them specifically in the ACPI osl.c because
      (a) the motherboard driver is optional and ACPI uses the resources even
      if the driver is absent, and (b) I want to remove the ACPI motherboard
      driver because it's mostly redundant with the PNP system.c driver.
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      9a47cdb1
  8. 20 12月, 2006 1 次提交
  9. 22 11月, 2006 1 次提交
    • D
      WorkStruct: Pass the work_struct pointer instead of context data · 65f27f38
      David Howells 提交于
      Pass the work_struct pointer to the work function rather than context data.
      The work function can use container_of() to work out the data.
      
      For the cases where the container of the work_struct may go away the moment the
      pending bit is cleared, it is made possible to defer the release of the
      structure by deferring the clearing of the pending bit.
      
      To make this work, an extra flag is introduced into the management side of the
      work_struct.  This governs auto-release of the structure upon execution.
      
      Ordinarily, the work queue executor would release the work_struct for further
      scheduling or deallocation by clearing the pending bit prior to jumping to the
      work function.  This means that, unless the driver makes some guarantee itself
      that the work_struct won't go away, the work function may not access anything
      else in the work_struct or its container lest they be deallocated..  This is a
      problem if the auxiliary data is taken away (as done by the last patch).
      
      However, if the pending bit is *not* cleared before jumping to the work
      function, then the work function *may* access the work_struct and its container
      with no problems.  But then the work function must itself release the
      work_struct by calling work_release().
      
      In most cases, automatic release is fine, so this is the default.  Special
      initiators exist for the non-auto-release case (ending in _NAR).
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      65f27f38
  10. 18 11月, 2006 1 次提交
    • L
      Revert "ACPI: created a dedicated workqueue for notify() execution" · b976fe19
      Linus Torvalds 提交于
      This reverts commit 37605a69.
      
      Again.
      
      This same bug has now been introduced twice: it was done earlier by
      commit b8d35192, only to be reverted
      last time in commit 72945b2b.
      
      We must NOT try to queue up notify handlers to another thread than the
      normal ACPI execution thread, because the notifications on some systems
      seem to just keep on accumulating until we run out of memory and/or
      threads.
      
      Keeping events within the one deferred execution thread automatically
      throttles the events properly.
      
      At least the Compaq N620c will lock up completely on the first thermal
      event without this patch reverted.
      
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Len Brown <len.brown@intel.com>
      Cc: Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b976fe19
  11. 14 10月, 2006 2 次提交
  12. 05 10月, 2006 1 次提交
    • D
      IRQ: Maintain regs pointer globally rather than passing to IRQ handlers · 7d12e780
      David Howells 提交于
      Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
      of passing regs around manually through all ~1800 interrupt handlers in the
      Linux kernel.
      
      The regs pointer is used in few places, but it potentially costs both stack
      space and code to pass it around.  On the FRV arch, removing the regs parameter
      from all the genirq function results in a 20% speed up of the IRQ exit path
      (ie: from leaving timer_interrupt() to leaving do_IRQ()).
      
      Where appropriate, an arch may override the generic storage facility and do
      something different with the variable.  On FRV, for instance, the address is
      maintained in GR28 at all times inside the kernel as part of general exception
      handling.
      
      Having looked over the code, it appears that the parameter may be handed down
      through up to twenty or so layers of functions.  Consider a USB character
      device attached to a USB hub, attached to a USB controller that posts its
      interrupts through a cascaded auxiliary interrupt controller.  A character
      device driver may want to pass regs to the sysrq handler through the input
      layer which adds another few layers of parameter passing.
      
      I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
      main part of the code on FRV and i386, though I can't test most of the drivers.
      I've also done partial conversion for powerpc and MIPS - these at least compile
      with minimal configurations.
      
      This will affect all archs.  Mostly the changes should be relatively easy.
      Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
      
      	struct pt_regs *old_regs = set_irq_regs(regs);
      
      And put the old one back at the end:
      
      	set_irq_regs(old_regs);
      
      Don't pass regs through to generic_handle_irq() or __do_IRQ().
      
      In timer_interrupt(), this sort of change will be necessary:
      
      	-	update_process_times(user_mode(regs));
      	-	profile_tick(CPU_PROFILING, regs);
      	+	update_process_times(user_mode(get_irq_regs()));
      	+	profile_tick(CPU_PROFILING);
      
      I'd like to move update_process_times()'s use of get_irq_regs() into itself,
      except that i386, alone of the archs, uses something other than user_mode().
      
      Some notes on the interrupt handling in the drivers:
      
       (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
           the input_dev struct.
      
       (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
           something different depending on whether it's been supplied with a regs
           pointer or not.
      
       (*) Various IRQ handler function pointers have been moved to type
           irq_handler_t.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
      7d12e780
  13. 27 9月, 2006 1 次提交
  14. 17 8月, 2006 1 次提交
  15. 13 7月, 2006 1 次提交
  16. 10 7月, 2006 1 次提交
  17. 03 7月, 2006 1 次提交
  18. 01 7月, 2006 1 次提交
  19. 30 6月, 2006 1 次提交
  20. 28 6月, 2006 1 次提交
    • B
      ACPI: ACPICA 20060623 · 967440e3
      Bob Moore 提交于
      Implemented a new acpi_spinlock type for the OSL lock
      interfaces.  This allows the type to be customized to
      the host OS for improved efficiency (since a spinlock is
      usually a very small object.)
      
      Implemented support for "ignored" bits in the ACPI
      registers.  According to the ACPI specification, these
      bits should be preserved when writing the registers via
      a read/modify/write cycle. There are 3 bits preserved
      in this manner: PM1_CONTROL[0] (SCI_EN), PM1_CONTROL[9],
      and PM1_STATUS[11].
      http://bugzilla.kernel.org/show_bug.cgi?id=3691
      
      Implemented the initial deployment of new OSL mutex
      interfaces.  Since some host operating systems have
      separate mutex and semaphore objects, this feature was
      requested. The base code now uses mutexes (and the new
      mutex interfaces) wherever a binary semaphore was used
      previously. However, for the current release, the mutex
      interfaces are defined as macros to map them to the
      existing semaphore interfaces.
      
      Fixed several problems with the support for the control
      method SyncLevel parameter. The SyncLevel now works
      according to the ACPI specification and in concert with the
      Mutex SyncLevel parameter, since the current SyncLevel is
      a property of the executing thread. Mutual exclusion for
      control methods is now implemented with a mutex instead
      of a semaphore.
      
      Fixed three instances of the use of the C shift operator
      in the bitfield support code (exfldio.c) to avoid the use
      of a shift value larger than the target data width. The
      behavior of C compilers is undefined in this case and can
      cause unpredictable results, and therefore the case must
      be detected and avoided.  (Fiodor Suietov)
      
      Added an info message whenever an SSDT or OEM table
      is loaded dynamically via the Load() or LoadTable()
      ASL operators. This should improve debugging capability
      since it will show exactly what tables have been loaded
      (beyond the tables present in the RSDT/XSDT.)
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      967440e3
  21. 27 6月, 2006 4 次提交
  22. 14 6月, 2006 4 次提交
    • B
      ACPI: ACPICA 20060608 · 4c90ece2
      Bob Moore 提交于
      Converted the locking mutex used for the ACPI hardware
      to a spinlock. This change should eliminate all problems
      caused by attempting to acquire a semaphore at interrupt
      level, and it means that all ACPICA external interfaces
      that directly access the ACPI hardware can be safely
      called from interrupt level.
      
      Fixed a regression introduced in 20060526 where the ACPI
      device initialization could be prematurely aborted with
      an AE_NOT_FOUND if a device did not have an optional
      _INI method.
      
      Fixed an IndexField issue where a write to the Data
      Register should be limited in size to the AccessSize
      (width) of the IndexField itself. (BZ 433, Fiodor Suietov)
      
      Fixed problem reports (Valery Podrezov) integrated: - Allow
      store of ThermalZone objects to Debug object.
      http://bugzilla.kernel.org/show_bug.cgi?id=5369
      http://bugzilla.kernel.org/show_bug.cgi?id=5370
      
      Fixed problem reports (Fiodor Suietov) integrated: -
      acpi_get_table_header() doesn't handle multiple instances
      correctly (BZ 364)
      
      Removed four global mutexes that were obsolete and were
      no longer being used.
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      4c90ece2
    • A
      ACPI: execute Notify() handlers on new thread · b8d35192
      Alexey Starikovskiy 提交于
      http://bugzilla.kernel.org/show_bug.cgi?id=5534
      
      Thanks to Peter Wainwright for isolating the issue.
      Thanks to Andi Kleen and Bob Moore for feedback.
      Thanks to Richard Mace and others for testing.
      Updates by Konstantin Karasyov.
      Signed-off-by: NKonstantin Karasyov <konstantin.a.karasyov@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      b8d35192
    • B
      ACPI: ACPICA 20060421 · b229cf92
      Bob Moore 提交于
      Removed a device initialization optimization introduced in
      20051216 where the _STA method was not run unless an _INI
      was also present for the same device. This optimization
      could cause problems because it could allow _INI methods
      to be run within a not-present device subtree (If a
      not-present device had no _INI, _STA would not be run,
      the not-present status would not be discovered, and the
      children of the device would be incorrectly traversed.)
      
      Implemented a new _STA optimization where namespace
      subtrees that do not contain _INI are identified and
      ignored during device initialization. Selectively running
      _STA can significantly improve boot time on large machines
      (with assistance from Len Brown.)
      
      Implemented support for the device initialization case
      where the returned _STA flags indicate a device not-present
      but functioning. In this case, _INI is not run, but the
      device children are examined for presence, as per the
      ACPI specification.
      
      Implemented an additional change to the IndexField support
      in order to conform to MS behavior. The value written to
      the Index Register is not simply a byte offset, it is a
      byte offset in units of the access width of the parent
      Index Field. (Fiodor Suietov)
      
      Defined and deployed a new OSL interface,
      acpi_os_validate_address().  This interface is called during
      the creation of all AML operation regions, and allows
      the host OS to exert control over what addresses it will
      allow the AML code to access. Operation Regions whose
      addresses are disallowed will cause a runtime exception
      when they are actually accessed (will not affect or abort
      table loading.)
      
      Defined and deployed a new OSL interface,
      acpi_os_validate_interface().  This interface allows the host OS
      to match the various "optional" interface/behavior strings
      for the _OSI predefined control method as appropriate
      (with assistance from Bjorn Helgaas.)
      
      Restructured and corrected various problems in the
      exception handling code paths within DsCallControlMethod
      and DsTerminateControlMethod in dsmethod (with assistance
      from Takayoshi Kochi.)
      
      Modified the Linux source converter to ignore quoted string
      literals while converting identifiers from mixed to lower
      case. This will correct problems with the disassembler
      and other areas where such strings must not be modified.
      
      The ACPI_FUNCTION_* macros no longer require quotes around
      the function name. This allows the Linux source converter
      to convert the names, now that the converter ignores
      quoted strings.
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      b229cf92
    • B
      [ACPI] ACPICA 20060317 · 61686124
      Bob Moore 提交于
      Implemented the use of a cache object for all internal
      namespace nodes. Since there are about 1000 static nodes
      in a typical system, this will decrease memory use for
      cache implementations that minimize per-allocation overhead
      (such as a slab allocator.)
      
      Removed the reference count mechanism for internal
      namespace nodes, since it was deemed unnecessary. This
      reduces the size of each namespace node by about 5%-10%
      on all platforms. Nodes are now 20 bytes for the 32-bit
      case, and 32 bytes for the 64-bit case.
      
      Optimized several internal data structures to reduce
      object size on 64-bit platforms by packing data within
      the 64-bit alignment. This includes the frequently used
      ACPI_OPERAND_OBJECT, of which there can be ~1000 static
      instances corresponding to the namespace objects.
      
      Added two new strings for the predefined _OSI method:
      "Windows 2001.1 SP1" and "Windows 2006".
      
      Split the allocation tracking mechanism out to a separate
      file, from utalloc.c to uttrack.c. This mechanism appears
      to be only useful for application-level code. Kernels may
      wish to not include uttrack.c in distributions.
      
      Removed all remnants of the obsolete ACPI_REPORT_* macros
      and the associated code. (These macros have been replaced
      by the ACPI_ERROR and ACPI_WARNING macros.)
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      61686124
  23. 01 4月, 2006 1 次提交
  24. 27 3月, 2006 2 次提交
  25. 31 1月, 2006 1 次提交
    • B
      [ACPI] ACPICA 20060127 · b8e4d893
      Bob Moore 提交于
      Implemented support in the Resource Manager to allow
      unresolved namestring references within resource package
      objects for the _PRT method. This support is in addition
      to the previously implemented unresolved reference
      support within the AML parser. If the interpreter slack
      mode is enabled (true on Linux unless acpi=strict),
      these unresolved references will be passed through
      to the caller as a NULL package entry.
      http://bugzilla.kernel.org/show_bug.cgi?id=5741
      
      Implemented and deployed new macros and functions for
      error and warning messages across the subsystem. These
      macros are simpler and generate less code than their
      predecessors. The new macros ACPI_ERROR, ACPI_EXCEPTION,
      ACPI_WARNING, and ACPI_INFO replace the ACPI_REPORT_*
      macros.
      
      Implemented the acpi_cpu_flags type to simplify host OS
      integration of the Acquire/Release Lock OSL interfaces.
      Suggested by Steven Rostedt and Andrew Morton.
      
      Fixed a problem where Alias ASL operators are sometimes
      not correctly resolved. causing AE_AML_INTERNAL
      http://bugzilla.kernel.org/show_bug.cgi?id=5189
      http://bugzilla.kernel.org/show_bug.cgi?id=5674
      
      Fixed several problems with the implementation of the
      ConcatenateResTemplate ASL operator. As per the ACPI
      specification, zero length buffers are now treated as a
      single EndTag. One-length buffers always cause a fatal
      exception. Non-zero length buffers that do not end with
      a full 2-byte EndTag cause a fatal exception.
      
      Fixed a possible structure overwrite in the
      AcpiGetObjectInfo external interface. (With assistance
      from Thomas Renninger)
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      b8e4d893
  26. 09 1月, 2006 1 次提交
  27. 04 1月, 2006 1 次提交
  28. 28 12月, 2005 1 次提交
  29. 10 12月, 2005 1 次提交
    • B
      [ACPI] ACPICA 20051021 · 0897831b
      Bob Moore 提交于
      Implemented support for the EM64T and other x86_64
      processors. This essentially entails recognizing
      that these processors support non-aligned memory
      transfers. Previously, all 64-bit processors were assumed
      to lack hardware support for non-aligned transfers.
      
      Completed conversion of the Resource Manager to nearly
      full table-driven operation. Specifically, the resource
      conversion code (convert AML to internal format and the
      reverse) and the debug code to dump internal resource
      descriptors are fully table-driven, reducing code and data
      size and improving maintainability.
      
      The OSL interfaces for Acquire and Release Lock now use a
      64-bit flag word on 64-bit processors instead of a fixed
      32-bit word. (Alexey Starikovskiy)
      
      Implemented support within the resource conversion code
      for the Type-Specific byte within the various ACPI 3.0
      *WordSpace macros.
      
      Fixed some issues within the resource conversion code for
      the type-specific flags for both Memory and I/O address
      resource descriptors. For Memory, implemented support
      for the MTP and TTP flags. For I/O, split the TRS and TTP
      flags into two separate fields.
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      0897831b
  30. 07 11月, 2005 1 次提交