diff mbox series

[1/5] hwtracing: hisi_ptt: Disable interrupt after trace end

Message ID 20230809081825.11518-2-yangyicong@huawei.com (mailing list archive)
State Superseded
Headers show
Series Several updates for PTT driver | expand

Commit Message

Yicong Yang Aug. 9, 2023, 8:18 a.m. UTC
From: Yicong Yang <yangyicong@hisilicon.com>

On trace end we disable the hardware but leave the interrupt
unmasked. Mask the interrupt to make the process reverse to
the start. No actual issue since hardware should send no
interrupt after disabled.

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
---
 drivers/hwtracing/ptt/hisi_ptt.c | 4 ++++
 drivers/hwtracing/ptt/hisi_ptt.h | 1 +
 2 files changed, 5 insertions(+)

Comments

Jonathan Cameron Aug. 25, 2023, 11:23 a.m. UTC | #1
On Wed, 9 Aug 2023 16:18:21 +0800
Yicong Yang <yangyicong@huawei.com> wrote:

> From: Yicong Yang <yangyicong@hisilicon.com>
> 
> On trace end we disable the hardware but leave the interrupt
> unmasked. Mask the interrupt to make the process reverse to
> the start. No actual issue since hardware should send no
> interrupt after disabled.
> 
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/hwtracing/ptt/hisi_ptt.c | 4 ++++
>  drivers/hwtracing/ptt/hisi_ptt.h | 1 +
>  2 files changed, 5 insertions(+)
> 
> diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c
> index ba081b6d2435..5f0a8e653ae8 100644
> --- a/drivers/hwtracing/ptt/hisi_ptt.c
> +++ b/drivers/hwtracing/ptt/hisi_ptt.c
> @@ -183,6 +183,10 @@ static void hisi_ptt_wait_dma_reset_done(struct hisi_ptt *hisi_ptt)
>  static void hisi_ptt_trace_end(struct hisi_ptt *hisi_ptt)
>  {
>  	writel(0, hisi_ptt->iobase + HISI_PTT_TRACE_CTRL);
> +
> +	/* Mask the interrupt on the end */
> +	writel(HISI_PTT_TRACE_INT_MASK_ALL, hisi_ptt->iobase + HISI_PTT_TRACE_INT_MASK);
> +
>  	hisi_ptt->trace_ctrl.started = false;
>  }
>  
> diff --git a/drivers/hwtracing/ptt/hisi_ptt.h b/drivers/hwtracing/ptt/hisi_ptt.h
> index e17f045d7e72..46030aa88081 100644
> --- a/drivers/hwtracing/ptt/hisi_ptt.h
> +++ b/drivers/hwtracing/ptt/hisi_ptt.h
> @@ -47,6 +47,7 @@
>  #define HISI_PTT_TRACE_INT_STAT		0x0890
>  #define   HISI_PTT_TRACE_INT_STAT_MASK	GENMASK(3, 0)
>  #define HISI_PTT_TRACE_INT_MASK		0x0894
> +#define   HISI_PTT_TRACE_INT_MASK_ALL	GENMASK(3, 0)
>  #define HISI_PTT_TUNING_INT_STAT	0x0898
>  #define   HISI_PTT_TUNING_INT_STAT_MASK	BIT(0)
>  #define HISI_PTT_TRACE_WR_STS		0x08a0
diff mbox series

Patch

diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c
index ba081b6d2435..5f0a8e653ae8 100644
--- a/drivers/hwtracing/ptt/hisi_ptt.c
+++ b/drivers/hwtracing/ptt/hisi_ptt.c
@@ -183,6 +183,10 @@  static void hisi_ptt_wait_dma_reset_done(struct hisi_ptt *hisi_ptt)
 static void hisi_ptt_trace_end(struct hisi_ptt *hisi_ptt)
 {
 	writel(0, hisi_ptt->iobase + HISI_PTT_TRACE_CTRL);
+
+	/* Mask the interrupt on the end */
+	writel(HISI_PTT_TRACE_INT_MASK_ALL, hisi_ptt->iobase + HISI_PTT_TRACE_INT_MASK);
+
 	hisi_ptt->trace_ctrl.started = false;
 }
 
diff --git a/drivers/hwtracing/ptt/hisi_ptt.h b/drivers/hwtracing/ptt/hisi_ptt.h
index e17f045d7e72..46030aa88081 100644
--- a/drivers/hwtracing/ptt/hisi_ptt.h
+++ b/drivers/hwtracing/ptt/hisi_ptt.h
@@ -47,6 +47,7 @@ 
 #define HISI_PTT_TRACE_INT_STAT		0x0890
 #define   HISI_PTT_TRACE_INT_STAT_MASK	GENMASK(3, 0)
 #define HISI_PTT_TRACE_INT_MASK		0x0894
+#define   HISI_PTT_TRACE_INT_MASK_ALL	GENMASK(3, 0)
 #define HISI_PTT_TUNING_INT_STAT	0x0898
 #define   HISI_PTT_TUNING_INT_STAT_MASK	BIT(0)
 #define HISI_PTT_TRACE_WR_STS		0x08a0