From: Lv Zheng <zetalog@gmail.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Len Brown <len.brown@intel.com>
Cc: Lv Zheng <zetalog@gmail.com>, Lv Zheng <lv.zheng@intel.com>,
<linux-kernel@vger.kernel.org>,
linux-acpi@vger.kernel.org
Subject: [PATCH v2 7/7] ACPI/EC: Add detailed fields debugging support of EC_SC(R).
Date: Sun, 15 Jun 2014 08:42:42 +0800 [thread overview]
Message-ID: <2a8af368df76ec52e4114c23e685a10c4eeb8a3e.1402792240.git.lv.zheng@intel.com> (raw)
In-Reply-To: <cover.1402792240.git.lv.zheng@intel.com>
From: Lv Zheng <lv.zheng@intel.com>
Developers really don't need to translate EC_SC(R) in mind as long as the
field details are decoded in the debugging message.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Tested-by: Gareth Williams <gareth@garethwilliams.me.uk>
Tested-by: Steffen Weber <steffen.weber@gmail.com>
---
drivers/acpi/ec.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 051ac47..c3299f6 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -55,6 +55,7 @@
/* EC status register */
#define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */
#define ACPI_EC_FLAG_IBF 0x02 /* Input buffer full */
+#define ACPI_EC_FLAG_CMD 0x08 /* Input buffer contains a command */
#define ACPI_EC_FLAG_BURST 0x10 /* burst mode */
#define ACPI_EC_FLAG_SCI 0x20 /* EC-SCI occurred */
@@ -133,26 +134,33 @@ static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
{
u8 x = inb(ec->command_addr);
- pr_debug("---> status = 0x%2.2x\n", x);
+ pr_debug("EC_SC(R) = 0x%2.2x "
+ "SCI_EVT=%d BURST=%d CMD=%d IBF=%d OBF=%d\n",
+ x,
+ !!(x & ACPI_EC_FLAG_SCI),
+ !!(x & ACPI_EC_FLAG_BURST),
+ !!(x & ACPI_EC_FLAG_CMD),
+ !!(x & ACPI_EC_FLAG_IBF),
+ !!(x & ACPI_EC_FLAG_OBF));
return x;
}
static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
{
u8 x = inb(ec->data_addr);
- pr_debug("---> data = 0x%2.2x\n", x);
+ pr_debug("EC_DATA(R) = 0x%2.2x\n", x);
return x;
}
static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
{
- pr_debug("<--- command = 0x%2.2x\n", command);
+ pr_debug("EC_SC(W) = 0x%2.2x\n", command);
outb(command, ec->command_addr);
}
static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
{
- pr_debug("<--- data = 0x%2.2x\n", data);
+ pr_debug("EC_DATA(W) = 0x%2.2x\n", data);
outb(data, ec->data_addr);
}
--
1.7.10
next prev parent reply other threads:[~2014-06-15 0:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1402543079.git.lv.zheng@intel.com>
2014-06-15 0:40 ` [PATCH v2 0/7] ACPI/EC: Critical bug fixes related to EC and event handling Lv Zheng
2014-06-15 0:41 ` [PATCH v2 1/7] ACPI/EC: Fix an issue that advance_transaction() processes stale hardware status Lv Zheng
2014-06-15 0:41 ` [PATCH v2 2/7] ACPI/EC: Add asynchronous command byte write support Lv Zheng
2014-06-15 0:41 ` [PATCH v2 3/7] ACPI/EC: Remove duplicated ec_wait_ibf0() waiter Lv Zheng
2014-06-15 0:42 ` [PATCH v2 4/7] ACPI/EC: Fix a race condition in ec_transaction_completed() Lv Zheng
2014-06-15 0:42 ` [PATCH v2 5/7] ACPI/EC: Update revision due to full asynchrnous command support Lv Zheng
2014-06-15 0:42 ` [PATCH v2 6/7] ACPICA: Events: Fix edge-triggered GPE by disabling before acknowledging it Lv Zheng
2014-06-15 0:42 ` Lv Zheng [this message]
2014-07-07 3:09 ` [UPDATE PATCH v2 0/6] ACPI/EC: Critical race fixes Lv Zheng
2014-07-07 3:09 ` [UPDATE PATCH v2 1/6] ACPI/EC: Fix an issue that advance_transaction() processes stale hardware status Lv Zheng
2014-07-07 3:10 ` [UPDATE PATCH v2 2/6] ACPI/EC: Add asynchronous command byte write support Lv Zheng
2014-07-07 3:10 ` [UPDATE PATCH v2 3/6] ACPI/EC: Remove duplicated ec_wait_ibf0() waiter Lv Zheng
2014-07-07 3:10 ` [UPDATE PATCH v2 4/6] ACPI/EC: Fix a race condition in ec_transaction_completed() Lv Zheng
2014-07-07 3:10 ` [UPDATE PATCH v2 5/6] ACPI/EC: Update revision due to full asynchrnous command support Lv Zheng
2014-07-07 3:10 ` [UPDATE PATCH v2 6/6] ACPI/EC: Add detailed fields debugging support of EC_SC(R) Lv Zheng
2014-07-07 11:18 ` [UPDATE PATCH v2 0/6] ACPI/EC: Critical race fixes Rafael J. Wysocki
2014-07-08 0:00 ` Zheng, Lv
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2a8af368df76ec52e4114c23e685a10c4eeb8a3e.1402792240.git.lv.zheng@intel.com \
--to=zetalog@gmail.com \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lv.zheng@intel.com \
--cc=rafael.j.wysocki@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®