From nobody Wed Dec 17 03:34:00 2025 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9522E1DFE33 for ; Fri, 13 Dec 2024 14:49:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734101368; cv=none; b=sRoLX6y+H8iwKXo9XwajynMdCsMMKU0u+EAVbjs7VkQpac1eWYP/TdMrq33Ill2AfdGWquIpyi441CE+HJ37zKvzDZY1YuNYszr1MsAkgskUea5Jf5bdwWgHHC+TmnDfbnzpsJdQ+1zbLOce4pV4cNeTehQ/nvUMFxrS967o/tI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734101368; c=relaxed/simple; bh=SIsC3C9i1wELYLT6FCZ2zsprbHI9S3yM2hqoLVMVBu0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PtW/4Ysu0W4QGnTjLZydKlEIcIteEC1324ECYTeluEo1H4hKwasvuB9gsrSVbdqxdVgSE+tLaScsy6RpIhhDD13OmWdNY1t/4LrJoIsCMxKyEVQ/MrISsmzxyl3V7MJQPSQCqGNSl3tgQ53ZNNaQaFjGpva4TS0xEWQ6TwAe9X8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=t6n7TOqC; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="t6n7TOqC" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-43618283d48so13409015e9.1 for ; Fri, 13 Dec 2024 06:49:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734101365; x=1734706165; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=15AaAK2+TNf0pjNDy/UAqLLtCRlZm3/kpGALTDknfLk=; b=t6n7TOqCj4oVvwCCeh05j/IHlJZ1PtXHobd6m3/Wkq5CrU/6lzpQ/QJVmvp4cL0H0o QDIPBzhvY8YSExEg+20JTNgi0Yr3pQ2+zjs/rJCTfbg0Et3uM3t9xpGwJIyHGeSMMIGs rjyNjLHUiWObxjJvTBUbhoKR8+1Yu+ZYSqlq3q8cGBGXYqA7jA8zxQuX1DYyRLvGKYGK rtHSb3PQ3XMKgeE2s2mVVpRiE20OujMFd4CTWaz5A77X/khsVkTRljI+xwpeVzbWaR9W bep5hEd0MyRoeFIYfmiZhDyQw6sDuu1hEbx3N7rPl1JL4+zhhm3tM79fUs67DLgCbolG XKeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734101365; x=1734706165; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=15AaAK2+TNf0pjNDy/UAqLLtCRlZm3/kpGALTDknfLk=; b=skCTEEFG9n2GFVRrCkAyf0bwn38r077hGJHo3cyC/YtCVbGVHIdypSiRB7Ve1ompi2 fS85xnun+MQzE2KiwqZMSWHGHotIRHejmYu6PDUEYXjmBVdHp7jEmkzU/1qbOUoZP6Jt zQ21s0ySRr3ZQAKwjn+bHtGOTBR2kGuw9cTkLGT09JRx/I6nlTasK226iYuio42v1dz2 tE5U59lkEZCd9RZhr/Wi+b6irI2dpB6bJjp8ItFKkuzHQdBPoa1hW7SQiHlE6kgl09yV DghD0n8FuqQCTyNu6/HLs7sYu73468Fg7mMsxDsD+l3NKYo3ZJVV2bKnaNpEXl5u0k7j foiA== X-Gm-Message-State: AOJu0YzEeGMbMpIBzCgd4J6qghq8acCSsku3ryT6n1DgubvuTHKwtr+l IWZWXeUIrJpGR5Z+Y+Yk/lhQlJ39GlyMnACsFtRV9fwxIUDXMDPWDsBf4Hfc/8Baf6+lVzWQhXW w X-Gm-Gg: ASbGncsGKFk+wPM0QSCgOFV5MtST+OSZIzrktib944zIYMhcKQQKCmtRSYw9nI1aqXm 5cYc/RTYsOVt+sBTd6r98A6tov06n56Kph1M/MLbB0jJqnSoLh3NdHtvq4dy3nHUVLqWj2cwz8T MSfDoQ1KUCj25DXjiAHv1MznPn3urN0YeHG/XRtXz15lrGAXgABfMMBksD5hLuAOxhvKQHP5e60 rgqBuMjW6UXG1H9jZohwmQ4MPBqK5chCp9kxD2upC+9d4uzvlu0KTZtUw== X-Google-Smtp-Source: AGHT+IHO0M2mkaBgTv2bRXcbzSWDj4N1+DMABwuK3YzAtH8N7NuvAFA9fIE961ZHfmLSmGa1Mu+Zcg== X-Received: by 2002:a05:6000:2ad:b0:385:df6b:7ef6 with SMTP id ffacd0b85a97d-3888e0be442mr1907627f8f.51.1734101364916; Fri, 13 Dec 2024 06:49:24 -0800 (PST) Received: from linaro.org ([2a00:23c5:6829:901:dd7a:c2d:2b46:b1a9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-387824c50b7sm7196295f8f.57.2024.12.13.06.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 06:49:24 -0800 (PST) From: Mike Leach To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Cc: james.clark@linaro.org, mike.leach@linaro.org, suzuki.poulose@arm.com, alexander.shishkin@linux.intel.com Subject: [PATCH v2 1/3] coresight: Update timeout functions to allow return of test register value Date: Fri, 13 Dec 2024 14:49:17 +0000 Message-Id: <20241213144919.110642-2-mike.leach@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241213144919.110642-1-mike.leach@linaro.org> References: <20241213144919.110642-1-mike.leach@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Current coresight_timeout function spins on a bit on a test register, till bit value achieved or timeout hit. Add another function to return the full value of the register being tested. Signed-off-by: Mike Leach --- drivers/hwtracing/coresight/coresight-core.c | 50 +++++++++++++++----- include/linux/coresight.h | 2 + 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtraci= ng/coresight/coresight-core.c index ea38ecf26fcb..feb1a1db355f 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -1017,32 +1017,37 @@ static void coresight_remove_conns(struct coresight= _device *csdev) } =20 /** - * coresight_timeout - loop until a bit has changed to a specific register - * state. + * coresight_timeout_retval - loop until a bit has changed to a specific r= egister + * state. Return final register value * @csa: coresight device access for the device * @offset: Offset of the register from the base of the device. * @position: the position of the bit of interest. * @value: the value the bit should have. + * @rval: the last read value of the register being tested. * * Return: 0 as soon as the bit has taken the desired state or -EAGAIN if * TIMEOUT_US has elapsed, which ever happens first. */ -int coresight_timeout(struct csdev_access *csa, u32 offset, - int position, int value) +int coresight_timeout_retval(struct csdev_access *csa, u32 offset, + int position, int value, u32 *rval) { - int i; - u32 val; + int i, rc =3D -EAGAIN; + u32 val =3D 0; =20 for (i =3D TIMEOUT_US; i > 0; i--) { val =3D csdev_access_read32(csa, offset); /* waiting on the bit to go from 0 to 1 */ if (value) { - if (val & BIT(position)) - return 0; + if (val & BIT(position)) { + rc =3D 0; + goto return_rval; + } /* waiting on the bit to go from 1 to 0 */ } else { - if (!(val & BIT(position))) - return 0; + if (!(val & BIT(position))) { + rc =3D 0; + goto return_rval; + } } =20 /* @@ -1054,7 +1059,30 @@ int coresight_timeout(struct csdev_access *csa, u32 = offset, udelay(1); } =20 - return -EAGAIN; +return_rval: + *rval =3D val; + + return rc; +} +EXPORT_SYMBOL_GPL(coresight_timeout_retval); + +/** + * coresight_timeout - loop until a bit has changed to a specific register + * state + * @csa: coresight device access for the device + * @offset: Offset of the register from the base of the device. + * @position: the position of the bit of interest. + * @value: the value the bit should have. + * + * Return: 0 as soon as the bit has taken the desired state or -EAGAIN if + * TIMEOUT_US has elapsed, which ever happens first. + */ +int coresight_timeout(struct csdev_access *csa, u32 offset, + int position, int value) +{ + u32 rval =3D 0; + + return coresight_timeout_retval(csa, offset, position, value, &rval); } EXPORT_SYMBOL_GPL(coresight_timeout); =20 diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 055ce5cd5c44..29cb71e82b0b 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -639,6 +639,8 @@ extern int coresight_enable_sysfs(struct coresight_devi= ce *csdev); extern void coresight_disable_sysfs(struct coresight_device *csdev); extern int coresight_timeout(struct csdev_access *csa, u32 offset, int position, int value); +extern int coresight_timeout_retval(struct csdev_access *csa, u32 offset, + int position, int value, u32 *rval); =20 extern int coresight_claim_device(struct coresight_device *csdev); extern int coresight_claim_device_unlocked(struct coresight_device *csdev); --=20 2.25.1 From nobody Wed Dec 17 03:34:00 2025 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93CF71E1C09 for ; Fri, 13 Dec 2024 14:49:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734101370; cv=none; b=BLkyXjA8GaZusToxDr+G4AJncyp1WV9mgfvs9W+v4pF0zD/dzS/QwBnAVmMhGDlmokOWwEx2WNimwoFOkjDef8FrTq/ggKAIPHDdNhSPosfQ7Xarr0wPTRAbS9uoESmYu4vXx85zOZ5fRbMdTaPhuMxV58Q6oCr6DmK/rdWXRB8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734101370; c=relaxed/simple; bh=p0xHJvZoXjbk5ERaUq4AaNWghCS8HToY8pwcypXQFQY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Czh7kyAWY0kxekRnW9OXkh1zIDLvxJZpxETU/fcJhU9FFTn4sRd2oOJhSJnxWRqhxF420ykb87FBXzWKaqNBvyst/x9ew9J1Ifm4OGvS4r+WVLmqk+UgWJjGlL0oT79ennQuRrfwGJz0HYCLbWJY+SXFIZ5acH+lsBr96JFNYP0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=RS+kN+2G; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RS+kN+2G" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-3862d6d5765so1239173f8f.3 for ; Fri, 13 Dec 2024 06:49:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734101367; x=1734706167; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qoj5GqPpJoW7JmFtjxPMWybNEJbYYEOKTO2N9SmSlgA=; b=RS+kN+2G2ryrcRR9dfZw0UgrzeSomiFHF6dBSGnlSp2tE+50l/AaHi/vV6dEQ1TBzI QUGP/8n1F/lKCskqUPV3u8z8Y0uryzh6ogqrID/+AgcnXxkRiRd1EfoseBV8x9vRpZyi CEQobaYNekmpF1fYcUyyvEF2WTEGFRdnPryZdx0exC0RmgnHF7N8ezJCsWUAlyg8Cm4d 561xuSscTK40DUeSxsvuhDRpqh3leHCBA0f8GOGIDT5Q9bLVfPkt54oWkkmj5XHwdOqf 31xeQJhskABYPkB3/egzqqAni5GyfhiWe2bFNw1gg8+7o/UTADw+5gRrABjpOGFveXNo 84iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734101367; x=1734706167; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qoj5GqPpJoW7JmFtjxPMWybNEJbYYEOKTO2N9SmSlgA=; b=VVcbyF7lGfaM46sEwj0q6XSdq/K84iw0iysdOUXYyiBLRGAtlYBxWwv3P4zlLyFnNl wEmy/OaJXhaVldNgXO+bS4tHSz1foZPuBSFA/XLPuYgwt1yTBXc1h6asP+UUsFD4C80U ksCrDrLH2pAS2dzp3wCpPBzvITlOlttUds7mc9x7MgfyIgu+t1uJx3UGB7xBXqpbSWzI mi6rcEY06OOulOMs+EyXqd+xoVG0VSipaajfwh7Lqe7DNfZhZelFmyChQqu3YFSt+1d/ kpYRAvHYFKZ3zk7+AnhOltroo50LQYgEjuahYg4g7MN02DOtbdLlWdOJ9P5yUz9X7YWh rMHQ== X-Gm-Message-State: AOJu0Yzsf63/neE4E9TOQH8mwGJJhpPaPP7fuV3b1YK/JEZFiBBy9Cpp pEI5FgF2aUd1v2R5GLv6k16CQccsGBLqD1kEh3yZ78f93evGWvyIYDx/TzKV3Rk+yEIvwJ28Kx6 k X-Gm-Gg: ASbGncs4k6kjEaA7kc7NWHpvfwxI8/JqJKPV0kqfeWMRHDEnSU3Es8DZrQmym7KfBtQ TZVscwa3C2sy93iLsgOKTSM2skYKpcyuuhHSS5+Mhq82gcdxWsB6E5gbPpXfwUEeBoSZcztJTFZ KHKRmod7TmNSLc5XSBZ9VWqdPeUATSY+bZX3O3P+VpM0OmvAo9SGIGBwBiIuqB12jhJWI/XPcwB aJprmOzG9lGBL2tZONcHNKcMpCgCPwDCkIIhO/XllGWPG9DTtRbXmLtZA== X-Google-Smtp-Source: AGHT+IG89RNTzAe/9DbcvL6vbr1RIH/IF1uo8b6fNVKeWEEIDb5CO4Aje6k8AftMtkfUVUDJ7opmpQ== X-Received: by 2002:a5d:59a8:0:b0:385:f5c4:b30d with SMTP id ffacd0b85a97d-3888e0b882emr2286934f8f.39.1734101366915; Fri, 13 Dec 2024 06:49:26 -0800 (PST) Received: from linaro.org ([2a00:23c5:6829:901:dd7a:c2d:2b46:b1a9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-387824c50b7sm7196295f8f.57.2024.12.13.06.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 06:49:25 -0800 (PST) From: Mike Leach To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Cc: james.clark@linaro.org, mike.leach@linaro.org, suzuki.poulose@arm.com, alexander.shishkin@linux.intel.com Subject: [PATCH v2 2/3] coresight: tmc: Update error logging in tmc common functions Date: Fri, 13 Dec 2024 14:49:18 +0000 Message-Id: <20241213144919.110642-3-mike.leach@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241213144919.110642-1-mike.leach@linaro.org> References: <20241213144919.110642-1-mike.leach@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Enhance the error logging in the tmc_wait_for_tmcready() and tmc_flush_and_stop() to print key tmc register values on error conditions to improve hardware debug information. Signed-off-by: Mike Leach --- .../hwtracing/coresight/coresight-tmc-core.c | 37 +++++++++++++++---- drivers/hwtracing/coresight/coresight-tmc.h | 2 +- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwt= racing/coresight/coresight-tmc-core.c index e9876252a789..1a9299adae93 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-core.c +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c @@ -34,25 +34,36 @@ DEFINE_CORESIGHT_DEVLIST(etb_devs, "tmc_etb"); DEFINE_CORESIGHT_DEVLIST(etf_devs, "tmc_etf"); DEFINE_CORESIGHT_DEVLIST(etr_devs, "tmc_etr"); =20 +#define TMC_WAIT_READY_FMT_STR "timeout while waiting for TMC to be Ready = [STS=3D0x%04x]\n" + int tmc_wait_for_tmcready(struct tmc_drvdata *drvdata) { struct coresight_device *csdev =3D drvdata->csdev; struct csdev_access *csa =3D &csdev->access; + u32 tmc_sts =3D 0; =20 /* Ensure formatter, unformatter and hardware fifo are empty */ - if (coresight_timeout(csa, TMC_STS, TMC_STS_TMCREADY_BIT, 1)) { - dev_err(&csdev->dev, - "timeout while waiting for TMC to be Ready\n"); + if (coresight_timeout_retval(csa, TMC_STS, TMC_STS_TMCREADY_BIT, 1, + &tmc_sts)) { + dev_err(&csdev->dev, TMC_WAIT_READY_FMT_STR, tmc_sts); return -EBUSY; } return 0; } =20 -void tmc_flush_and_stop(struct tmc_drvdata *drvdata) +int tmc_flush_and_stop(struct tmc_drvdata *drvdata) { struct coresight_device *csdev =3D drvdata->csdev; struct csdev_access *csa =3D &csdev->access; - u32 ffcr; + u32 ffcr, ffsr, tmc_sts; + int rc =3D 0; + + /* note any MemErr present when stopping TMC */ + tmc_sts =3D readl_relaxed(drvdata->base + TMC_STS); + if (tmc_sts & TMC_STS_MEMERR) + dev_err(&csdev->dev, + "MemErr detected before Manual Flush; STS[0x%02x]\n", + tmc_sts); =20 ffcr =3D readl_relaxed(drvdata->base + TMC_FFCR); ffcr |=3D TMC_FFCR_STOP_ON_FLUSH; @@ -60,12 +71,22 @@ void tmc_flush_and_stop(struct tmc_drvdata *drvdata) ffcr |=3D BIT(TMC_FFCR_FLUSHMAN_BIT); writel_relaxed(ffcr, drvdata->base + TMC_FFCR); /* Ensure flush completes */ - if (coresight_timeout(csa, TMC_FFCR, TMC_FFCR_FLUSHMAN_BIT, 0)) { + if (coresight_timeout_retval(csa, TMC_FFCR, TMC_FFCR_FLUSHMAN_BIT, 0, + &ffcr)) { + ffsr =3D readl_relaxed(drvdata->base + TMC_FFSR); dev_err(&csdev->dev, - "timeout while waiting for completion of Manual Flush\n"); + "timeout while waiting for completion of Manual Flush\n"); + dev_err(&csdev->dev, + "regs: FFCR[0x%02x] FFSR[0x%02x] STS[0x%02x]\n", + ffcr, ffsr, tmc_sts); + rc =3D -EBUSY; } =20 - tmc_wait_for_tmcready(drvdata); + if (tmc_wait_for_tmcready(drvdata)) { + dev_err(&csdev->dev, "TMC ready error after Manual flush\n"); + rc =3D -EBUSY; + } + return rc; } =20 void tmc_enable_hw(struct tmc_drvdata *drvdata) diff --git a/drivers/hwtracing/coresight/coresight-tmc.h b/drivers/hwtracin= g/coresight/coresight-tmc.h index 2671926be62a..34513f07c3aa 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.h +++ b/drivers/hwtracing/coresight/coresight-tmc.h @@ -259,7 +259,7 @@ struct tmc_sg_table { =20 /* Generic functions */ int tmc_wait_for_tmcready(struct tmc_drvdata *drvdata); -void tmc_flush_and_stop(struct tmc_drvdata *drvdata); +int tmc_flush_and_stop(struct tmc_drvdata *drvdata); void tmc_enable_hw(struct tmc_drvdata *drvdata); void tmc_disable_hw(struct tmc_drvdata *drvdata); u32 tmc_get_memwidth_mask(struct tmc_drvdata *drvdata); --=20 2.25.1 From nobody Wed Dec 17 03:34:00 2025 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 982C01E2309 for ; Fri, 13 Dec 2024 14:49:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734101371; cv=none; b=b4NbXQiZFYp1pDC8RS1meZ48iYRuiuxXaaSgvtkVojE7Ad8MkjKyRHRTp/ZKuzxA6ZHVIAK7C8MBikrHQwvGR5iRhAP0B5Uhp64zIr2HyN4gQKkJg+9aiHjHMZ92juz05GqGMBYNO0CTK/SIUwJhPZHHjoPGOoq3YxOKSiUXr+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734101371; c=relaxed/simple; bh=m1RG8uDj8WQP7hbZHg/PSSoUtWF3HmCISvW9JYlyfUc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XY9YWUR8XMTu6ZEc8cFflExanInqUCNvYE3Rgn54fSO7IkGaU01y2+NP0zf1UIG2Oehc9mFYc492c1SCbVfF8w++acHda5EPQ1jzVlMiJmercOfriRzaIJbk1ET8MqoRWPbDYDBYGrejjqqz++SA6NWStPVQFqHQ+HMlS5ouP5Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dZhdlTzP; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dZhdlTzP" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-38632b8ae71so1340811f8f.0 for ; Fri, 13 Dec 2024 06:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734101368; x=1734706168; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QqYUm1i7e1fblFqY9jJKn51mYoOB0b0xVEyAilyqTvk=; b=dZhdlTzP4cRxkgIudvUB+aNZ00gwQDk8V+X1t8Bc5ZpQYvhx8OVZOppKKWFQQI8O5/ O423DO6DXwquWIUesOg9d9NfGGTlLSygAZIWhhYyesmPjTv7WPeBaLCVcBUP0WHtVh2Q K8FUyH8NnFbN3/+13FtB1T4AAc6Ie/15s+cqcklcbxz3CJhv6nxZFJWDCAS4NDe97jWj mjHwvThyENPXPqWwEz5sQYzLiwvI9HtIi5kh/s/30vK8dOpLb3ds9Y1z+Yta6k+YneeT YUx+COKMVfd2bvT26lb0WM6BbHtX0Y1MQbtgRXbpmBEl2tyxBxk8CKvKR0u9ENm9ySvJ DY8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734101368; x=1734706168; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QqYUm1i7e1fblFqY9jJKn51mYoOB0b0xVEyAilyqTvk=; b=gPhB0DZYrsvmDuKQTx9HdQMMXuUsbRPZsu93Qwap163G0dDnwQzUtAK4DpYgM+48YE PqXLNqIdgsda7Jbz/6ROnqGe4dUFzOsKKVZC7q0kkFwwv4sqjKDgLMiDEL8tt3VJb/1E 2I+5tV9C0okQ6jKhGkfgllmVFkMApgBv5XFQ7XhYTJpmJvxmEa4QvKsvin0OJO+guNbu 86f7PN9j9fDqwyTWkNZy2aX37TJ8BUn9zdyRS2TBlm0L7J2iRFRaic+7sZIabz7dd392 JonkHpWR7QG3QqaRZyEGbe6Ttgm0vxPet0a/23IFHK3KkdCP/hLl6Sly7PNh/HNX04EH BdEw== X-Gm-Message-State: AOJu0YxOclzq14eWxFJbxFNf2Yc3VGIIQClYQMPBywROtdMGt2F2bQCV JCBvRoTZuchj+q2gJ6TteT6C7bW5Nrq2flUpjWqAw8DzmmyyUflXtIh9u9lgJYU7TcuAsQ3y9Wa C X-Gm-Gg: ASbGncvcYuAvPISXy5cLejyWhvpu8wzGPxJ/5a+B5PCQ6K8j2VbN9+umr86am08fpzv MJ339RuPXvCTHfvmoMhFXPBe16ir8P0FZjULI/m/vf6+IKzT++m1wQuvVWrL0Th+e5EGwUiMYQz kyv93KeCaP078lxynufYCfEzI3YhLx5E8XTJh1GydYo8GcmPfUdB+cV00b+3Gedwr6o8Q0qml1/ OLDU95bvY8NdoSUBpFG/3BNCuRc2ELXRHBbHK3RgSEiWKl/3l5ZETE7qw== X-Google-Smtp-Source: AGHT+IFDVH3ne6sNymKAo1QgYJon0YdqlPVHMjDohMOhYt3kQjiXEykwiHRGKr2ebn9u641ZWv+SCw== X-Received: by 2002:a05:6000:3cd:b0:385:df5d:622c with SMTP id ffacd0b85a97d-38880adb0b3mr2087916f8f.30.1734101367931; Fri, 13 Dec 2024 06:49:27 -0800 (PST) Received: from linaro.org ([2a00:23c5:6829:901:dd7a:c2d:2b46:b1a9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-387824c50b7sm7196295f8f.57.2024.12.13.06.49.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 06:49:27 -0800 (PST) From: Mike Leach To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Cc: james.clark@linaro.org, mike.leach@linaro.org, suzuki.poulose@arm.com, alexander.shishkin@linux.intel.com Subject: [PATCH v2 3/3] coresight: etf: etr: Update logging around flush_and_stop() errors Date: Fri, 13 Dec 2024 14:49:19 +0000 Message-Id: <20241213144919.110642-4-mike.leach@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241213144919.110642-1-mike.leach@linaro.org> References: <20241213144919.110642-1-mike.leach@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Insert additional context around tmc_flush_and_stop() errors. Signed-off-by: Mike Leach --- drivers/hwtracing/coresight/coresight-tmc-etf.c | 12 +++++++++--- drivers/hwtracing/coresight/coresight-tmc-etr.c | 8 ++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtr= acing/coresight/coresight-tmc-etf.c index d4f641cd9de6..62b4b685c1a1 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -84,7 +84,9 @@ static void __tmc_etb_disable_hw(struct tmc_drvdata *drvd= ata) { CS_UNLOCK(drvdata->base); =20 - tmc_flush_and_stop(drvdata); + if (tmc_flush_and_stop(drvdata)) + dev_err(&drvdata->csdev->dev, + "Flush and stop error disabling ETB\n"); /* * When operating in sysFS mode the content of the buffer needs to be * read before the TMC is disabled. @@ -146,7 +148,9 @@ static void tmc_etf_disable_hw(struct tmc_drvdata *drvd= ata) =20 CS_UNLOCK(drvdata->base); =20 - tmc_flush_and_stop(drvdata); + if (tmc_flush_and_stop(drvdata)) + dev_err(&drvdata->csdev->dev, + "Flush and stop error disabling ETF\n"); tmc_disable_hw(drvdata); coresight_disclaim_device_unlocked(csdev); CS_LOCK(drvdata->base); @@ -496,7 +500,9 @@ static unsigned long tmc_update_etf_buffer(struct cores= ight_device *csdev, =20 CS_UNLOCK(drvdata->base); =20 - tmc_flush_and_stop(drvdata); + if (tmc_flush_and_stop(drvdata)) + dev_err(&drvdata->csdev->dev, + "Flush and stop error updating perf buffer\n"); =20 read_ptr =3D tmc_read_rrp(drvdata); write_ptr =3D tmc_read_rwp(drvdata); diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtr= acing/coresight/coresight-tmc-etr.c index a48bb85d0e7f..122a067d1bb8 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -1139,7 +1139,9 @@ static void __tmc_etr_disable_hw(struct tmc_drvdata *= drvdata) { CS_UNLOCK(drvdata->base); =20 - tmc_flush_and_stop(drvdata); + if (tmc_flush_and_stop(drvdata)) + dev_err(&drvdata->csdev->dev, + "Flush and stop error disabling ETR\n"); /* * When operating in sysFS mode the content of the buffer needs to be * read before the TMC is disabled. @@ -1578,7 +1580,9 @@ tmc_update_etr_buffer(struct coresight_device *csdev, =20 CS_UNLOCK(drvdata->base); =20 - tmc_flush_and_stop(drvdata); + if (tmc_flush_and_stop(drvdata)) + dev_err(&csdev->dev, + "Flush and Stop error updating perf buffer\n"); tmc_sync_etr_buf(drvdata); =20 CS_LOCK(drvdata->base); --=20 2.25.1