Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1699708
| From | Lv Zheng <lv.zheng@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 1/4] ACPI / EC: Cleanup EC GPE mask flag |
| Date | 2017-07-31 07:50 +0200 |
| Message-ID | <u9bKy-2gK-29@gated-at.bofh.it> (permalink) |
| References | <u7LS9-3l2-5@gated-at.bofh.it> <u9bKx-2gK-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
EC_FLAGS_COMMAND_STORM is actually used to mask GPE during IRQ processing.
This patch cleans it up using more readable flag/function names.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/ec.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index ddb01e9..54879c7 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -112,8 +112,7 @@ enum {
EC_FLAGS_EVT_HANDLER_INSTALLED, /* _Qxx handlers installed */
EC_FLAGS_STARTED, /* Driver is started */
EC_FLAGS_STOPPED, /* Driver is stopped */
- EC_FLAGS_COMMAND_STORM, /* GPE storms occurred to the
- * current command processing */
+ EC_FLAGS_GPE_MASKED, /* GPE masked */
};
#define ACPI_EC_COMMAND_POLL 0x01 /* Available for command byte */
@@ -421,19 +420,19 @@ static void acpi_ec_complete_request(struct acpi_ec *ec)
wake_up(&ec->wait);
}
-static void acpi_ec_set_storm(struct acpi_ec *ec, u8 flag)
+static void acpi_ec_mask_gpe(struct acpi_ec *ec)
{
- if (!test_bit(flag, &ec->flags)) {
+ if (!test_bit(EC_FLAGS_GPE_MASKED, &ec->flags)) {
acpi_ec_disable_gpe(ec, false);
ec_dbg_drv("Polling enabled");
- set_bit(flag, &ec->flags);
+ set_bit(EC_FLAGS_GPE_MASKED, &ec->flags);
}
}
-static void acpi_ec_clear_storm(struct acpi_ec *ec, u8 flag)
+static void acpi_ec_unmask_gpe(struct acpi_ec *ec)
{
- if (test_bit(flag, &ec->flags)) {
- clear_bit(flag, &ec->flags);
+ if (test_bit(EC_FLAGS_GPE_MASKED, &ec->flags)) {
+ clear_bit(EC_FLAGS_GPE_MASKED, &ec->flags);
acpi_ec_enable_gpe(ec, false);
ec_dbg_drv("Polling disabled");
}
@@ -460,7 +459,7 @@ static bool acpi_ec_submit_flushable_request(struct acpi_ec *ec)
static void acpi_ec_submit_query(struct acpi_ec *ec)
{
- acpi_ec_set_storm(ec, EC_FLAGS_COMMAND_STORM);
+ acpi_ec_mask_gpe(ec);
if (!acpi_ec_event_enabled(ec))
return;
if (!test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) {
@@ -476,7 +475,7 @@ static void acpi_ec_complete_query(struct acpi_ec *ec)
if (test_and_clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags))
ec_dbg_evt("Command(%s) unblocked",
acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY));
- acpi_ec_clear_storm(ec, EC_FLAGS_COMMAND_STORM);
+ acpi_ec_unmask_gpe(ec);
}
static inline void __acpi_ec_enable_event(struct acpi_ec *ec)
@@ -688,7 +687,7 @@ static void advance_transaction(struct acpi_ec *ec)
++t->irq_count;
/* Allow triggering on 0 threshold */
if (t->irq_count == ec_storm_threshold)
- acpi_ec_set_storm(ec, EC_FLAGS_COMMAND_STORM);
+ acpi_ec_mask_gpe(ec);
}
}
out:
@@ -786,7 +785,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
spin_lock_irqsave(&ec->lock, tmp);
if (t->irq_count == ec_storm_threshold)
- acpi_ec_clear_storm(ec, EC_FLAGS_COMMAND_STORM);
+ acpi_ec_unmask_gpe(ec);
ec_dbg_req("Command(%s) stopped", acpi_ec_cmd_string(t->command));
ec->curr = NULL;
/* Disable GPE for command processing (IBF=0/OBF=1) */
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/3] ACPI / EC: Cleanup EC GPE mask flag Lv Zheng <lv.zheng@intel.com> - 2017-07-27 10:00 +0200
[PATCH v2 3/4] ACPI / EC: Add support to handle EC events earlier Lv Zheng <lv.zheng@intel.com> - 2017-07-31 07:50 +0200
[PATCH v2 4/4] ACPI / EC: Enable noirq stage GPE polling Lv Zheng <lv.zheng@intel.com> - 2017-07-31 07:50 +0200
[PATCH v2 2/4] ACPI / EC: Add IRQ polling support for noirq stages Lv Zheng <lv.zheng@intel.com> - 2017-07-31 07:50 +0200
[PATCH v2 1/4] ACPI / EC: Cleanup EC GPE mask flag Lv Zheng <lv.zheng@intel.com> - 2017-07-31 07:50 +0200
[PATCH v2 0/4] ACPI / EC: Solve EC event handling issues Lv Zheng <lv.zheng@intel.com> - 2017-07-31 07:50 +0200
[PATCH v3 2/4] ACPI / EC: Add IRQ polling support for noirq stages Lv Zheng <lv.zheng@intel.com> - 2017-08-11 08:40 +0200
[PATCH v3 0/4] ACPI / EC: Poll more EC events during suspend/resume Lv Zheng <lv.zheng@intel.com> - 2017-08-11 08:40 +0200
[PATCH v3 3/4] ACPI / EC: Add support to handle EC events earlier Lv Zheng <lv.zheng@intel.com> - 2017-08-11 08:40 +0200
[PATCH v3 1/4] ACPI / EC: Cleanup EC GPE mask flag Lv Zheng <lv.zheng@intel.com> - 2017-08-11 08:40 +0200
[PATCH v3 4/4] ACPI / EC: Enable noirq stage GPE polling Lv Zheng <lv.zheng@intel.com> - 2017-08-11 08:40 +0200
csiph-web