From: Yabin Cui <yabinc@google.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>,
James Clark <james.clark@arm.com>
Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Yabin Cui <yabinc@google.com>
Subject: [PATCH] coresight: tmc-etr: Handle enable failure in tmc_read_unprepare_etr
Date: Fri, 10 Feb 2023 23:43:11 +0000 [thread overview]
Message-ID: <20230210234311.1661312-1-yabinc@google.com> (raw)
In-Reply-To: <77bd4509-bd8b-3bcc-e94a-7593505e27c0@arm.com>
It's similar to what we did in tmc_read_unprepare_etb.
Signed-off-by: Yabin Cui <yabinc@google.com>
---
drivers/hwtracing/coresight/coresight-tmc-etr.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c
index 918d461fcf4a..b04f12079efd 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-etr.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c
@@ -1763,6 +1763,7 @@ int tmc_read_unprepare_etr(struct tmc_drvdata *drvdata)
{
unsigned long flags;
struct etr_buf *sysfs_buf = NULL;
+ int rc = 0;
/* config types are set a boot time and never change */
if (WARN_ON_ONCE(drvdata->config_type != TMC_CONFIG_TYPE_ETR))
@@ -1777,7 +1778,11 @@ int tmc_read_unprepare_etr(struct tmc_drvdata *drvdata)
* buffer. Since the tracer is still enabled drvdata::buf can't
* be NULL.
*/
- __tmc_etr_enable_hw(drvdata);
+ rc = __tmc_etr_enable_hw(drvdata);
+ if (rc) {
+ spin_unlock_irqrestore(&drvdata->spinlock, flags);
+ return rc;
+ }
} else {
/*
* The ETR is not tracing and the buffer was just read.
--
2.39.1.581.gbfd45094c4-goog
next prev parent reply other threads:[~2023-02-10 23:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-09 23:43 [PATCH] coresight: tmc-etr: Don't enable ETR when it's not ready Yabin Cui
2023-01-10 9:30 ` James Clark
2023-01-10 17:48 ` Mike Leach
2023-01-10 18:04 ` Suzuki K Poulose
2023-01-10 21:06 ` Yabin Cui
2023-01-24 20:09 ` Yabin Cui
2023-01-25 10:21 ` James Clark
2023-01-25 10:27 ` Suzuki K Poulose
2023-01-27 23:10 ` [PATCH v2] coresight: tmc: Don't enable TMC " Yabin Cui
2023-02-01 20:43 ` Mike Leach
2023-02-02 11:24 ` Suzuki K Poulose
2023-02-02 20:54 ` Yabin Cui
2023-02-02 21:46 ` [PATCH v3] " Yabin Cui
2023-02-09 1:08 ` Yabin Cui
2023-02-09 10:31 ` Suzuki K Poulose
2023-02-10 23:43 ` Yabin Cui [this message]
2023-02-21 18:38 ` [PATCH] coresight: tmc-etr: Handle enable failure in tmc_read_unprepare_etr Yabin Cui
2023-02-22 9:33 ` Suzuki K Poulose
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=20230210234311.1661312-1-yabinc@google.com \
--to=yabinc@google.com \
--cc=coresight@lists.linaro.org \
--cc=james.clark@arm.com \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=mike.leach@linaro.org \
--cc=suzuki.poulose@arm.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®