From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Su Hui <suhui@nfschina.com>,
vkoul@kernel.org, yung-chuan.liao@linux.intel.com,
sanyog.r.kale@intel.com, nathan@kernel.org,
ndesaulniers@google.com, trix@redhat.com,
Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] soundwire: amd: add an error code check in amd_sdw_clock_stop_exit
Date: Wed, 15 Nov 2023 08:44:16 -0600 [thread overview]
Message-ID: <3e461bb5-fa6b-4729-8ff5-ccc1d2887066@linux.intel.com> (raw)
In-Reply-To: <20231115095407.1059704-1-suhui@nfschina.com>
On 11/15/23 03:54, Su Hui wrote:
> Clang static analyzer complains that value stored to 'ret' is never read.
> Add an error code check and print an error message if 'readl_poll_timeout'
> failed.
>
> Signed-off-by: Su Hui <suhui@nfschina.com>
> ---
> drivers/soundwire/amd_manager.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c
> index 3a99f6dcdfaf..f391b541f4b7 100644
> --- a/drivers/soundwire/amd_manager.c
> +++ b/drivers/soundwire/amd_manager.c
> @@ -1029,6 +1029,10 @@ static int amd_sdw_clock_stop_exit(struct amd_sdw_manager *amd_manager)
> ret = readl_poll_timeout(amd_manager->mmio + ACP_SW_CLK_RESUME_CTRL, val,
> (val & AMD_SDW_CLK_RESUME_DONE), ACP_DELAY_US,
> AMD_SDW_TIMEOUT);
> + if (ret)
> + dev_err(amd_manager->dev, "%s: timed out: %pe\n", __func__,
> + ERR_PTR(ret));
Is this really the desired behavior?
This patch fixes the static analysis issue by logging the error code,
but does it make sense to continue resuming here and trying to exit from
the clock stop mode?
At this point a bus reset might be a more relevant behavior...
> if (val & AMD_SDW_CLK_RESUME_DONE) {
> writel(0, amd_manager->mmio + ACP_SW_CLK_RESUME_CTRL);
> ret = sdw_bus_exit_clk_stop(&amd_manager->bus);
next prev parent reply other threads:[~2023-11-15 16:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 9:54 [PATCH] soundwire: amd: add an error code check in amd_sdw_clock_stop_exit Su Hui
2023-11-15 14:44 ` Pierre-Louis Bossart [this message]
2023-11-15 17:27 ` Mukunda,Vijendar
2023-11-15 19:51 ` Pierre-Louis Bossart
2023-11-16 6:45 ` Mukunda,Vijendar
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=3e461bb5-fa6b-4729-8ff5-ccc1d2887066@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=Vijendar.Mukunda@amd.com \
--cc=alsa-devel@alsa-project.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=sanyog.r.kale@intel.com \
--cc=suhui@nfschina.com \
--cc=trix@redhat.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