linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] ACPI/EC: Improve GPE handling model.
@ 2014-06-18  3:17 Lv Zheng
  2014-06-18  3:17 ` [PATCH 1/9] ACPICA: Events: Reduce indent divergences of events files Lv Zheng
                   ` (13 more replies)
  0 siblings, 14 replies; 63+ messages in thread
From: Lv Zheng @ 2014-06-18  3:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi

This patchset is based on the previous ACPI/EC bug fixes series.

This patchset has fixed the following issues:
1. Enables the ideal GPE handling model.
   The ideal GPE handling model should be able to handle the following
   cases:
   1. When upper layers (the users of the driver) submit requests to the
      drivers, it means they care about the underlying hardware. For this
      case, acpi_enable_gpe() should be invoked. When the reference count
      is increased from 0 to 1, driver enables the hardware IRQ. And
      acpi_disable_gpe() is used as the reversal when the users have
      completed the submitted requests.
   2. Driver may temporarily disables the IRQ and wants to re-enable it
      later, this case is normally used in order to prevent IRQ storm.
      When a driver cannot fully solve the condition that triggered the IRQ
      in the IRQ context, in order not to trigger IRQ storm, driver has to
      disable IRQ and re-enables it in the deferred execution environment
      - which should be in a task context. The acpi_set_gpe() API should be
      used exactly for this purpose.
   The reason why this model hasn't been enabled for the current Linux ACPI
   drivers is:
     In ACPICA, the same GPE lock is held while invoking the GPE handler
     callback, it's thus impossible to invoke GPE APIs in the GPE handler
     because the APIs requires to hold the GPE lock. The recursive locking
     leads to dead locks. This is a simple design defect, callbacks should
     always be invoked in a lockless environment, normally in Linux, this
     is achieved by RCU locking, and in ACPICA, we achieve this using
     reference counting.
   After fixing the above bug and doing necessary cleanups in the ACPICA
   GPE handling code, we now can enable this ideal GPE handling model for
   the EC driver to use.
2. Enables the EC commands flushing.
   This is quite important for ACPI platforms. Some EC driven ACPI devices
   may require all submitted EC commands to be completed before they can
   be safely suspended or unplugged. Otherwise the state of such devices
   will be broken.
   When implementing IO flushing, there always need to be 2 flags to
   indicate an intermediate state - old IO submissions observe the
   (STARTED) flag to continue; new IO submissions observe the (STOPPED)
   flag to be discarded. After introducing the 2 flags, a "stop waiter"
   is implemented for the suspending/removing operations of the EC driver.

The refined patches are passed the runtime/suspend tests carried out on the
following platforms:
  "Dell Inspiron Mini 1010" - i386 kernel
  "Dell Latitude 6430u" - x86_64 kernel
In this patchset, a unit test facility is also implemented. Test results
show that the GPE APIs and EC GPE model are now safe for hotplug support.

Lv Zheng (9):
  ACPICA: Events: Reduce indent divergences of events files.
  ACPICA: Events: Fix an issue that GPE APIs cannot be invoked in
    atomic context.
  ACPICA: Events: Introduce acpi_set_gpe()/acpi_finish_gpe() to reduce
    divergences.
  ACPICA: Events: Remove acpi_ev_enable_gpe().
  ACPICA: Events: Reduce divergences to honor notify handler enabled
    GPEs.
  ACPI/EC: Introduce STARTED/STOPPED flags to replace BLOCKED flag.
  ACPI/EC: Add detailed command/query debugging information.
  ACPI/EC: Deploy the new GPE handling model.
  ACPI/EC: Add unit test support for EC driver hotplug.

 drivers/acpi/acpica/acevents.h |    1 +
 drivers/acpi/acpica/aclocal.h  |    5 +-
 drivers/acpi/acpica/evgpe.c    |  130 ++++++++++++++++--------------
 drivers/acpi/acpica/evxface.c  |   41 +++++++---
 drivers/acpi/acpica/evxfgpe.c  |  105 ++++++++++++++++++++++++
 drivers/acpi/ec.c              |  174 +++++++++++++++++++++++++++++++++-------
 6 files changed, 350 insertions(+), 106 deletions(-)

-- 
1.7.10


^ permalink raw reply	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2015-02-05 15:19 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-18  3:17 [PATCH 0/9] ACPI/EC: Improve GPE handling model Lv Zheng
2014-06-18  3:17 ` [PATCH 1/9] ACPICA: Events: Reduce indent divergences of events files Lv Zheng
2014-06-18  3:17 ` [PATCH 2/9] ACPICA: Events: Fix an issue that GPE APIs cannot be invoked in atomic context Lv Zheng
2014-06-18  3:17 ` [PATCH 3/9] ACPICA: Events: Introduce acpi_set_gpe()/acpi_finish_gpe() to reduce divergences Lv Zheng
2014-06-18  3:17 ` [PATCH 4/9] ACPICA: Events: Remove acpi_ev_enable_gpe() Lv Zheng
2014-06-18  3:17 ` [PATCH 5/9] ACPICA: Events: Reduce divergences to honor notify handler enabled GPEs Lv Zheng
2014-06-18  3:17 ` [PATCH 6/9] ACPI/EC: Introduce STARTED/STOPPED flags to replace BLOCKED flag Lv Zheng
2014-06-18  3:18 ` [PATCH 7/9] ACPI/EC: Add detailed command/query debugging information Lv Zheng
2014-06-18  3:18 ` [PATCH 8/9] ACPI/EC: Deploy the new GPE handling model Lv Zheng
2014-06-18  3:18 ` [PATCH 9/9] ACPI/EC: Add unit test support for EC driver hotplug Lv Zheng
2014-07-15  3:07 ` [PATCH v2 0/9] ACPICA: Improve GPE handling model Lv Zheng
2014-07-15  3:07   ` [PATCH v2 1/9] ACPICA: Events: Reduce indent divergences of events files Lv Zheng
2014-07-15  3:07   ` [PATCH v2 2/9] ACPICA: Events: Fix an issue that GPE APIs cannot be invoked in atomic context Lv Zheng
2014-07-15  3:07   ` [PATCH v2 3/9] ACPICA: Events: Fix an issue that GPE APIs cannot be invoked in deferred handlers Lv Zheng
2014-07-15  3:07   ` [PATCH v2 4/9] ACPICA: Events: Introduce acpi_set_gpe()/acpi_finish_gpe() to reduce divergences Lv Zheng
2014-07-15  3:07   ` [PATCH v2 5/9] ACPICA: Events: Fix an issue that acpi_set_gpe() cannot unconditionally enable GPEs Lv Zheng
2014-07-15  3:07   ` [PATCH v2 6/9] ACPICA: Events: Fix an issue that status of GPEs are unexpectedly cleared Lv Zheng
2014-07-15  3:07   ` [PATCH v2 7/9] ACPICA: Events: Fix an issue that originally_enabled check is not paired Lv Zheng
2014-07-15  3:08   ` [PATCH v2 8/9] ACPICA: Events: Add a flag to disable internal auto GPE clearing Lv Zheng
2014-07-15  3:08   ` [PATCH v2 9/9] ACPI: Update interrupt handler to honor new ACPI_REENABLE_GPE bit Lv Zheng
2014-07-15 12:25   ` [PATCH v2 0/9] ACPICA: Improve GPE handling model Rafael J. Wysocki
2014-07-16  0:36     ` Zheng, Lv
2014-07-15  3:14 ` [PATCH v2 00/10] ACPI/EC: Add event storm prevention and cleanup command storm prevention Lv Zheng
2014-07-15  3:14   ` [PATCH v2 01/10] ACPI/EC: Introduce STARTED/STOPPED flags to replace BLOCKED flag Lv Zheng
2014-07-15  3:14   ` [PATCH v2 02/10] ACPI/EC: Add detailed command/query debugging information Lv Zheng
2014-07-15  3:14   ` [PATCH v2 03/10] ACPI/EC: Deploy the new GPE handling model Lv Zheng
2014-07-15  3:14   ` [PATCH v2 04/10] ACPI/EC: Refine command storm prevention support Lv Zheng
2014-07-15  3:14   ` [PATCH v2 05/10] ACPI/EC: Add reference counting for query handlers Lv Zheng
2014-07-15  3:15   ` [PATCH v2 06/10] ACPI/EC: Add a warning message to indicate event storms Lv Zheng
2014-07-15  3:15   ` [PATCH v2 07/10] ACPI/EC: Refine event/query debugging messages Lv Zheng
2014-07-15  3:15   ` [PATCH v2 08/10] ACPI/EC: Add command flushing support Lv Zheng
2014-07-15  3:15   ` [PATCH v2 09/10] ACPI/EC: Add event storm prevention support Lv Zheng
2014-07-15  3:15   ` [PATCH v2 10/10] ACPI/EC: Add unit test support for EC driver hotplug Lv Zheng
2014-07-15  7:09 ` [PATCH v2] ACPI/EC: Enable storm prevention mechanisms Lv Zheng
2014-07-16  0:44   ` Andi Kleen
2014-07-16  0:55     ` Zheng, Lv
2014-07-21  6:04 ` [RFC PATCH v3 00/14] ACPI/EC: Add event storm prevention and cleanup command storm prevention Lv Zheng
2014-07-21  6:05   ` [RFC PATCH v3 01/14] ACPI/EC: Introduce STARTED/STOPPED flags to replace BLOCKED flag Lv Zheng
2014-07-21  6:05   ` [RFC PATCH v3 02/14] ACPI/EC: Add detailed command/query debugging information Lv Zheng
2014-07-21  6:05   ` [RFC PATCH v3 03/14] ACPI/EC: Cleanup command storm prevention using the new GPE handling model Lv Zheng
2014-07-21  6:05   ` [RFC PATCH v3 04/14] ACPI/EC: Refine command storm prevention support Lv Zheng
2014-07-21  6:05   ` [RFC PATCH v3 05/14] ACPI/EC: Add reference counting for query handlers Lv Zheng
2014-07-21  6:05   ` [RFC PATCH v3 06/14] ACPI/EC: Add command flushing support Lv Zheng
2014-07-21  6:05   ` [RFC PATCH v3 07/14] ACPI/EC: Add a warning message to indicate event storms Lv Zheng
2014-07-21  6:05   ` [RFC PATCH v3 08/14] ACPI/EC: Refine event/query debugging messages Lv Zheng
2014-07-21  6:06   ` [RFC PATCH v3 09/14] ACPI/EC: Add CPU ID to " Lv Zheng
2014-07-21  6:06   ` [RFC PATCH v3 10/14] ACPI/EC: Cleanup QR_SC command processing by adding a kernel thread to poll EC events Lv Zheng
2014-07-21  6:06   ` [RFC PATCH v3 11/14] ACPI/EC: Add event storm prevention support Lv Zheng
2014-07-21  6:06   ` [RFC PATCH v3 12/14] ACPI/EC: Add GPE reference counting debugging messages Lv Zheng
2014-07-21  6:06   ` [RFC PATCH v3 13/14] ACPI/EC: Add unit test support for EC driver hotplug Lv Zheng
2014-07-21  6:06   ` [RFC PATCH v3 14/14] ACPI/EC: Cleanup coding style Lv Zheng
2014-07-22  1:11   ` [RFC PATCH v3 00/14] ACPI/EC: Add event storm prevention and cleanup command storm prevention Rafael J. Wysocki
2014-07-22  1:25     ` Zheng, Lv
2014-07-22 22:15       ` Rafael J. Wysocki
2014-07-23  1:31         ` Zheng, Lv
2015-02-05  8:24 ` [PATCH v4 0/6] ACPI / EC: Fix GPE handling related races Lv Zheng
2015-02-05  8:27   ` [PATCH v4 1/6] ACPICA: Events: Introduce ACPI_GPE_DISPATCH_RAW_HANDLER to fix 2 issues for the current GPE APIs Lv Zheng
2015-02-05  8:27   ` [PATCH v4 2/6] ACPICA: Events: Introduce acpi_set_gpe()/acpi_finish_gpe() to reduce divergences Lv Zheng
2015-02-05  8:27   ` [PATCH v4 3/6] ACPICA: Events: Enable APIs to allow interrupt/polling adaptive request based GPE handling model Lv Zheng
2015-02-05  8:27   ` [PATCH v4 4/6] ACPI / EC: Fix several GPE handling issues by deploying ACPI_GPE_DISPATCH_RAW_HANDLER mode Lv Zheng
2015-02-05  8:27   ` [PATCH v4 5/6] ACPI / EC: Reduce ec_poll() by referencing the last register access timestamp Lv Zheng
2015-02-05  8:27   ` [PATCH v4 6/6] ACPI / EC: Update revision due to raw handler mode Lv Zheng
2015-02-05 15:19   ` [PATCH v4 0/6] ACPI / EC: Fix GPE handling related races Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).