From: Stephen Boyd <swboyd@chromium.org>
To: Dikshita Agarwal <quic_dikshita@quicinc.com>,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org, stanimir.varbanov@linaro.org,
quic_vgarodia@quicinc.com
Subject: Re: [PATCH] venus: Add support for SSR trigger using fault injection
Date: Fri, 10 Jun 2022 13:38:21 -0700 [thread overview]
Message-ID: <CAE-0n50q5GJ_q9Pojjrh+34W+i6BXhxSDCS6M_6NLP0pyZYuQg@mail.gmail.com> (raw)
In-Reply-To: <1654775566-21953-1-git-send-email-quic_dikshita@quicinc.com>
Quoting Dikshita Agarwal (2022-06-09 04:52:46)
> diff --git a/drivers/media/platform/qcom/venus/dbgfs.c b/drivers/media/platform/qcom/venus/dbgfs.c
> index 52de47f..a0bfb9e 100644
> --- a/drivers/media/platform/qcom/venus/dbgfs.c
> +++ b/drivers/media/platform/qcom/venus/dbgfs.c
> @@ -4,13 +4,31 @@
> */
>
> #include <linux/debugfs.h>
> +#include <linux/fault-inject.h>
>
> #include "core.h"
>
> +#ifdef CONFIG_FAULT_INJECTION
> +static DECLARE_FAULT_ATTR(venus_ssr_attr);
> +#endif
> +
> +bool venus_fault_inject_ssr(void)
> +{
> +#ifdef CONFIG_FAULT_INJECTION
> + return should_fail(&venus_ssr_attr, 1);
> +#else
> + return false;
> +#endif
> +}
It would be better to remove the ifdef in this function and define a
static inline version that returns false when CONFIG_FAULT_INJECTION is
disabled so that the compiler doesn't have to insert a function call to
venus_fault_inject_ssr() when the config is disabled. It may also be
good to avoid the jump when enabled by exporting the attribute to the
irq handler file.
> +
> void venus_dbgfs_init(struct venus_core *core)
> {
> core->root = debugfs_create_dir("venus", NULL);
> debugfs_create_x32("fw_level", 0644, core->root, &venus_fw_debug);
> +
> +#ifdef CONFIG_FAULT_INJECTION
> + fault_create_debugfs_attr("fail_ssr", core->root, &venus_ssr_attr);
> +#endif
> }
>
> void venus_dbgfs_deinit(struct venus_core *core)
prev parent reply other threads:[~2022-06-10 20:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-09 11:52 [PATCH] venus: Add support for SSR trigger using fault injection Dikshita Agarwal
2022-06-10 20:38 ` Stephen Boyd [this message]
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=CAE-0n50q5GJ_q9Pojjrh+34W+i6BXhxSDCS6M_6NLP0pyZYuQg@mail.gmail.com \
--to=swboyd@chromium.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=quic_dikshita@quicinc.com \
--cc=quic_vgarodia@quicinc.com \
--cc=stanimir.varbanov@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).