From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: <vkoul@kernel.org>, <pierre-louis.bossart@linux.intel.com>
Cc: <yung-chuan.liao@linux.intel.com>, <sanyog.r.kale@intel.com>,
<alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
<patches@opensource.cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>
Subject: [PATCH 1/2] soundwire: bus: Don't zero page registers after every transaction
Date: Thu, 1 Dec 2022 14:08:12 +0000 [thread overview]
Message-ID: <20221201140813.4062146-2-rf@opensource.cirrus.com> (raw)
In-Reply-To: <20221201140813.4062146-1-rf@opensource.cirrus.com>
Zeroing the page registers at the end of every paged transaction is just
overhead (40% overhead on a 1-register access, 25% on a 4-register
transaction). According to the spec the peripheral should only use the
values in the page registers if the address is paged, and since the page
registers are always overwritten at the start of a paged transaction there
will never be a transaction that uses the stale values from a previous
paged transaction.
For peripherals that need large amounts of data to be transferred, for
example firmware or filter coefficients, the overhead of page register
zeroing can become quite significant.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
drivers/soundwire/bus.c | 23 -----------------------
1 file changed, 23 deletions(-)
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index 76515c33e639..a02edcbfc282 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -247,23 +247,6 @@ static inline int do_transfer_defer(struct sdw_bus *bus,
return ret;
}
-static int sdw_reset_page(struct sdw_bus *bus, u16 dev_num)
-{
- int retry = bus->prop.err_threshold;
- enum sdw_command_response resp;
- int ret = 0, i;
-
- for (i = 0; i <= retry; i++) {
- resp = bus->ops->reset_page_addr(bus, dev_num);
- ret = find_response_code(resp);
- /* if cmd is ok or ignored return */
- if (ret == 0 || ret == -ENODATA)
- return ret;
- }
-
- return ret;
-}
-
static int sdw_transfer_unlocked(struct sdw_bus *bus, struct sdw_msg *msg)
{
int ret;
@@ -275,9 +258,6 @@ static int sdw_transfer_unlocked(struct sdw_bus *bus, struct sdw_msg *msg)
(msg->flags & SDW_MSG_FLAG_WRITE) ? "write" : "read",
msg->addr, msg->len);
- if (msg->page)
- sdw_reset_page(bus, msg->dev_num);
-
return ret;
}
@@ -352,9 +332,6 @@ int sdw_transfer_defer(struct sdw_bus *bus, struct sdw_msg *msg,
dev_err(bus->dev, "Defer trf on Slave %d failed:%d\n",
msg->dev_num, ret);
- if (msg->page)
- sdw_reset_page(bus, msg->dev_num);
-
return ret;
}
--
2.30.2
next prev parent reply other threads:[~2022-12-01 14:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-01 14:08 [PATCH 0/2] soundwire: Remove redundant zeroing of page registers Richard Fitzgerald
2022-12-01 14:08 ` Richard Fitzgerald [this message]
2022-12-01 14:08 ` [PATCH 2/2] soundwire: bus: Remove unused reset_page_addr() callback Richard Fitzgerald
2022-12-01 18:31 ` [PATCH 0/2] soundwire: Remove redundant zeroing of page registers Pierre-Louis Bossart
2022-12-02 11:26 ` Richard Fitzgerald
2022-12-02 16:45 ` Pierre-Louis Bossart
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=20221201140813.4062146-2-rf@opensource.cirrus.com \
--to=rf@opensource.cirrus.com \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=sanyog.r.kale@intel.com \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.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®