Commit b1534a05 authored by Joel Stanley's avatar Joel Stanley

fsi: sbefifo: Add detailed debugging information

Provide more output on the timeout status, and make some vdbg calls into
dbg calls so they can be enabled at runtime.
Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20220415050757.281158-1-joel@jms.id.auSigned-off-by: default avatarJoel Stanley <joel@jms.id.au>
parent 362fbc83
...@@ -477,7 +477,8 @@ static int sbefifo_wait(struct sbefifo *sbefifo, bool up, ...@@ -477,7 +477,8 @@ static int sbefifo_wait(struct sbefifo *sbefifo, bool up,
if (!ready) { if (!ready) {
sysfs_notify(&sbefifo->dev.kobj, NULL, dev_attr_timeout.attr.name); sysfs_notify(&sbefifo->dev.kobj, NULL, dev_attr_timeout.attr.name);
sbefifo->timed_out = true; sbefifo->timed_out = true;
dev_err(dev, "%s FIFO Timeout ! status=%08x\n", up ? "UP" : "DOWN", sts); dev_err(dev, "%s FIFO Timeout (%u ms)! status=%08x\n",
up ? "UP" : "DOWN", jiffies_to_msecs(timeout), sts);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
dev_vdbg(dev, "End of wait status: %08x\n", sts); dev_vdbg(dev, "End of wait status: %08x\n", sts);
...@@ -497,8 +498,8 @@ static int sbefifo_send_command(struct sbefifo *sbefifo, ...@@ -497,8 +498,8 @@ static int sbefifo_send_command(struct sbefifo *sbefifo,
u32 status; u32 status;
int rc; int rc;
dev_vdbg(dev, "sending command (%zd words, cmd=%04x)\n", dev_dbg(dev, "sending command (%zd words, cmd=%04x)\n",
cmd_len, be32_to_cpu(command[1])); cmd_len, be32_to_cpu(command[1]));
/* As long as there's something to send */ /* As long as there's something to send */
timeout = msecs_to_jiffies(SBEFIFO_TIMEOUT_START_CMD); timeout = msecs_to_jiffies(SBEFIFO_TIMEOUT_START_CMD);
...@@ -551,21 +552,23 @@ static int sbefifo_read_response(struct sbefifo *sbefifo, struct iov_iter *respo ...@@ -551,21 +552,23 @@ static int sbefifo_read_response(struct sbefifo *sbefifo, struct iov_iter *respo
size_t len; size_t len;
int rc; int rc;
dev_vdbg(dev, "reading response, buflen = %zd\n", iov_iter_count(response)); dev_dbg(dev, "reading response, buflen = %zd\n", iov_iter_count(response));
timeout = msecs_to_jiffies(sbefifo->timeout_start_rsp_ms); timeout = msecs_to_jiffies(sbefifo->timeout_start_rsp_ms);
for (;;) { for (;;) {
/* Grab FIFO status (this will handle parity errors) */ /* Grab FIFO status (this will handle parity errors) */
rc = sbefifo_wait(sbefifo, false, &status, timeout); rc = sbefifo_wait(sbefifo, false, &status, timeout);
if (rc < 0) if (rc < 0) {
dev_dbg(dev, "timeout waiting (%u ms)\n", jiffies_to_msecs(timeout));
return rc; return rc;
}
timeout = msecs_to_jiffies(SBEFIFO_TIMEOUT_IN_RSP); timeout = msecs_to_jiffies(SBEFIFO_TIMEOUT_IN_RSP);
/* Decode status */ /* Decode status */
len = sbefifo_populated(status); len = sbefifo_populated(status);
eot_set = sbefifo_eot_set(status); eot_set = sbefifo_eot_set(status);
dev_vdbg(dev, " chunk size %zd eot_set=0x%x\n", len, eot_set); dev_dbg(dev, " chunk size %zd eot_set=0x%x\n", len, eot_set);
/* Go through the chunk */ /* Go through the chunk */
while(len--) { while(len--) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment