All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] accel/ivpu: Replace profiling frequency debugfs with test mode bit
@ 2026-11-03  9:42 Andrzej Kacprowski
  2026-11-03 10:57 ` Wachowski, Karol
  2026-11-03 16:55 ` Jeff Hugo
  0 siblings, 2 replies; 4+ messages in thread
From: Andrzej Kacprowski @ 2026-11-03  9:42 UTC (permalink / raw)
  To: dri-devel
  Cc: oded.gabbay, jeff.hugo, karol.wachowski, lizhi.hou,
	dawid.osuchowski, Andrzej Kacprowski

Remove the profiling frequency debugfs control.
Add IVPU_TEST_MODE_PROF_FREQ_HIGH to select
PLL_PROFILING_FREQ_HIGH during driver initialization.
High frequency profiling is for debugging purposes
and it can be set at initialization time - there is
no need to control it via debugfs.

Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
---
 drivers/accel/ivpu/ivpu_debugfs.c | 29 -----------------------------
 drivers/accel/ivpu/ivpu_drv.h     |  1 +
 drivers/accel/ivpu/ivpu_hw.c      | 13 -------------
 drivers/accel/ivpu/ivpu_hw.h      |  1 -
 drivers/accel/ivpu/ivpu_hw_btrs.c |  7 ++++++-
 5 files changed, 7 insertions(+), 44 deletions(-)

diff --git a/drivers/accel/ivpu/ivpu_debugfs.c b/drivers/accel/ivpu/ivpu_debugfs.c
index dc20bc73c6ed..ae535fe49274 100644
--- a/drivers/accel/ivpu/ivpu_debugfs.c
+++ b/drivers/accel/ivpu/ivpu_debugfs.c
@@ -226,33 +226,6 @@ static const struct file_operations fw_log_fops = {
 	.release = single_release,
 };
 
-static ssize_t
-fw_profiling_freq_fops_write(struct file *file, const char __user *user_buf,
-			     size_t size, loff_t *pos)
-{
-	struct ivpu_device *vdev = file->private_data;
-	bool enable;
-	int ret;
-
-	ret = kstrtobool_from_user(user_buf, size, &enable);
-	if (ret < 0)
-		return ret;
-
-	ivpu_hw_profiling_freq_drive(vdev, enable);
-
-	ret = pci_try_reset_function(to_pci_dev(vdev->drm.dev));
-	if (ret)
-		return ret;
-
-	return size;
-}
-
-static const struct file_operations fw_profiling_freq_fops = {
-	.owner = THIS_MODULE,
-	.open = simple_open,
-	.write = fw_profiling_freq_fops_write,
-};
-
 static ssize_t
 fw_trace_destination_mask_fops_write(struct file *file, const char __user *user_buf,
 				     size_t size, loff_t *pos)
@@ -513,8 +486,6 @@ void ivpu_debugfs_init(struct ivpu_device *vdev)
 			    &ivpu_resume_engine_fops);
 
 	if (ivpu_hw_ip_gen(vdev) >= IVPU_HW_IP_40XX) {
-		debugfs_create_file("fw_profiling_freq_drive", 0200,
-				    debugfs_root, vdev, &fw_profiling_freq_fops);
 		debugfs_create_file("dct", 0644, debugfs_root, vdev, &ivpu_dct_fops);
 	}
 
diff --git a/drivers/accel/ivpu/ivpu_drv.h b/drivers/accel/ivpu/ivpu_drv.h
index ea5b8dc612d1..b33a53101894 100644
--- a/drivers/accel/ivpu/ivpu_drv.h
+++ b/drivers/accel/ivpu/ivpu_drv.h
@@ -238,6 +238,7 @@ extern bool ivpu_force_snoop;
 #define IVPU_TEST_MODE_CLK_RELINQ_DISABLE BIT(11)
 #define IVPU_TEST_MODE_CLK_RELINQ_ENABLE  BIT(12)
 #define IVPU_TEST_MODE_D0I2_DISABLE       BIT(13)
+#define IVPU_TEST_MODE_PROF_FREQ_HIGH     BIT(14)
 extern int ivpu_test_mode;
 
 struct ivpu_file_priv *ivpu_file_priv_get(struct ivpu_file_priv *file_priv);
diff --git a/drivers/accel/ivpu/ivpu_hw.c b/drivers/accel/ivpu/ivpu_hw.c
index 86679d64fc14..2cc2915ab5c5 100644
--- a/drivers/accel/ivpu/ivpu_hw.c
+++ b/drivers/accel/ivpu/ivpu_hw.c
@@ -359,19 +359,6 @@ int ivpu_hw_boot_fw(struct ivpu_device *vdev)
 	return ret;
 }
 
-void ivpu_hw_profiling_freq_drive(struct ivpu_device *vdev, bool enable)
-{
-	if (ivpu_hw_ip_gen(vdev) == IVPU_HW_IP_37XX) {
-		vdev->hw->pll.profiling_freq = PLL_PROFILING_FREQ_DEFAULT;
-		return;
-	}
-
-	if (enable)
-		vdev->hw->pll.profiling_freq = PLL_PROFILING_FREQ_HIGH;
-	else
-		vdev->hw->pll.profiling_freq = PLL_PROFILING_FREQ_DEFAULT;
-}
-
 void ivpu_irq_handlers_init(struct ivpu_device *vdev)
 {
 	if (ivpu_hw_btrs_gen(vdev) == IVPU_HW_BTRS_MTL)
diff --git a/drivers/accel/ivpu/ivpu_hw.h b/drivers/accel/ivpu/ivpu_hw.h
index 8c1b61df6cd4..de3dcb8e6173 100644
--- a/drivers/accel/ivpu/ivpu_hw.h
+++ b/drivers/accel/ivpu/ivpu_hw.h
@@ -61,7 +61,6 @@ int ivpu_hw_power_up(struct ivpu_device *vdev);
 int ivpu_hw_power_down(struct ivpu_device *vdev);
 int ivpu_hw_reset(struct ivpu_device *vdev);
 int ivpu_hw_boot_fw(struct ivpu_device *vdev);
-void ivpu_hw_profiling_freq_drive(struct ivpu_device *vdev, bool enable);
 void ivpu_irq_handlers_init(struct ivpu_device *vdev);
 void ivpu_hw_irq_enable(struct ivpu_device *vdev);
 void ivpu_hw_irq_disable(struct ivpu_device *vdev);
diff --git a/drivers/accel/ivpu/ivpu_hw_btrs.c b/drivers/accel/ivpu/ivpu_hw_btrs.c
index 840983a618ca..602d09e511e5 100644
--- a/drivers/accel/ivpu/ivpu_hw_btrs.c
+++ b/drivers/accel/ivpu/ivpu_hw_btrs.c
@@ -153,7 +153,12 @@ static int info_init_lnl(struct ivpu_device *vdev)
 		return ret;
 
 	hw->tile_fuse = tile_fuse_config;
-	hw->pll.profiling_freq = PLL_PROFILING_FREQ_DEFAULT;
+
+	if (ivpu_test_mode & IVPU_TEST_MODE_PROF_FREQ_HIGH)
+		hw->pll.profiling_freq = PLL_PROFILING_FREQ_HIGH;
+	else
+		hw->pll.profiling_freq = PLL_PROFILING_FREQ_DEFAULT;
+
 	hw->btrs_irq_mask = BTRS_LNL_IRQ_MASK;
 
 	if (ivpu_test_mode & IVPU_TEST_MODE_FREQ_CHANGE_ENABLE)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] accel/ivpu: Replace profiling frequency debugfs with test mode bit
  2026-11-03  9:42 [PATCH] accel/ivpu: Replace profiling frequency debugfs with test mode bit Andrzej Kacprowski
@ 2026-11-03 10:57 ` Wachowski, Karol
  2026-11-03 16:55 ` Jeff Hugo
  1 sibling, 0 replies; 4+ messages in thread
From: Wachowski, Karol @ 2026-11-03 10:57 UTC (permalink / raw)
  To: Andrzej Kacprowski, dri-devel
  Cc: oded.gabbay, jeff.hugo, lizhi.hou, dawid.osuchowski

On 03-Nov-26 10:42, Andrzej Kacprowski wrote:
> Remove the profiling frequency debugfs control.
> Add IVPU_TEST_MODE_PROF_FREQ_HIGH to select
> PLL_PROFILING_FREQ_HIGH during driver initialization.
> High frequency profiling is for debugging purposes
> and it can be set at initialization time - there is
> no need to control it via debugfs.
> 
> Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
> ---

Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>

>   drivers/accel/ivpu/ivpu_debugfs.c | 29 -----------------------------
>   drivers/accel/ivpu/ivpu_drv.h     |  1 +
>   drivers/accel/ivpu/ivpu_hw.c      | 13 -------------
>   drivers/accel/ivpu/ivpu_hw.h      |  1 -
>   drivers/accel/ivpu/ivpu_hw_btrs.c |  7 ++++++-
>   5 files changed, 7 insertions(+), 44 deletions(-)
> 
> diff --git a/drivers/accel/ivpu/ivpu_debugfs.c b/drivers/accel/ivpu/ivpu_debugfs.c
> index dc20bc73c6ed..ae535fe49274 100644
> --- a/drivers/accel/ivpu/ivpu_debugfs.c
> +++ b/drivers/accel/ivpu/ivpu_debugfs.c
> @@ -226,33 +226,6 @@ static const struct file_operations fw_log_fops = {
>   	.release = single_release,
>   };
>   
> -static ssize_t
> -fw_profiling_freq_fops_write(struct file *file, const char __user *user_buf,
> -			     size_t size, loff_t *pos)
> -{
> -	struct ivpu_device *vdev = file->private_data;
> -	bool enable;
> -	int ret;
> -
> -	ret = kstrtobool_from_user(user_buf, size, &enable);
> -	if (ret < 0)
> -		return ret;
> -
> -	ivpu_hw_profiling_freq_drive(vdev, enable);
> -
> -	ret = pci_try_reset_function(to_pci_dev(vdev->drm.dev));
> -	if (ret)
> -		return ret;
> -
> -	return size;
> -}
> -
> -static const struct file_operations fw_profiling_freq_fops = {
> -	.owner = THIS_MODULE,
> -	.open = simple_open,
> -	.write = fw_profiling_freq_fops_write,
> -};
> -
>   static ssize_t
>   fw_trace_destination_mask_fops_write(struct file *file, const char __user *user_buf,
>   				     size_t size, loff_t *pos)
> @@ -513,8 +486,6 @@ void ivpu_debugfs_init(struct ivpu_device *vdev)
>   			    &ivpu_resume_engine_fops);
>   
>   	if (ivpu_hw_ip_gen(vdev) >= IVPU_HW_IP_40XX) {
> -		debugfs_create_file("fw_profiling_freq_drive", 0200,
> -				    debugfs_root, vdev, &fw_profiling_freq_fops);
>   		debugfs_create_file("dct", 0644, debugfs_root, vdev, &ivpu_dct_fops);
>   	}
>   
> diff --git a/drivers/accel/ivpu/ivpu_drv.h b/drivers/accel/ivpu/ivpu_drv.h
> index ea5b8dc612d1..b33a53101894 100644
> --- a/drivers/accel/ivpu/ivpu_drv.h
> +++ b/drivers/accel/ivpu/ivpu_drv.h
> @@ -238,6 +238,7 @@ extern bool ivpu_force_snoop;
>   #define IVPU_TEST_MODE_CLK_RELINQ_DISABLE BIT(11)
>   #define IVPU_TEST_MODE_CLK_RELINQ_ENABLE  BIT(12)
>   #define IVPU_TEST_MODE_D0I2_DISABLE       BIT(13)
> +#define IVPU_TEST_MODE_PROF_FREQ_HIGH     BIT(14)
>   extern int ivpu_test_mode;
>   
>   struct ivpu_file_priv *ivpu_file_priv_get(struct ivpu_file_priv *file_priv);
> diff --git a/drivers/accel/ivpu/ivpu_hw.c b/drivers/accel/ivpu/ivpu_hw.c
> index 86679d64fc14..2cc2915ab5c5 100644
> --- a/drivers/accel/ivpu/ivpu_hw.c
> +++ b/drivers/accel/ivpu/ivpu_hw.c
> @@ -359,19 +359,6 @@ int ivpu_hw_boot_fw(struct ivpu_device *vdev)
>   	return ret;
>   }
>   
> -void ivpu_hw_profiling_freq_drive(struct ivpu_device *vdev, bool enable)
> -{
> -	if (ivpu_hw_ip_gen(vdev) == IVPU_HW_IP_37XX) {
> -		vdev->hw->pll.profiling_freq = PLL_PROFILING_FREQ_DEFAULT;
> -		return;
> -	}
> -
> -	if (enable)
> -		vdev->hw->pll.profiling_freq = PLL_PROFILING_FREQ_HIGH;
> -	else
> -		vdev->hw->pll.profiling_freq = PLL_PROFILING_FREQ_DEFAULT;
> -}
> -
>   void ivpu_irq_handlers_init(struct ivpu_device *vdev)
>   {
>   	if (ivpu_hw_btrs_gen(vdev) == IVPU_HW_BTRS_MTL)
> diff --git a/drivers/accel/ivpu/ivpu_hw.h b/drivers/accel/ivpu/ivpu_hw.h
> index 8c1b61df6cd4..de3dcb8e6173 100644
> --- a/drivers/accel/ivpu/ivpu_hw.h
> +++ b/drivers/accel/ivpu/ivpu_hw.h
> @@ -61,7 +61,6 @@ int ivpu_hw_power_up(struct ivpu_device *vdev);
>   int ivpu_hw_power_down(struct ivpu_device *vdev);
>   int ivpu_hw_reset(struct ivpu_device *vdev);
>   int ivpu_hw_boot_fw(struct ivpu_device *vdev);
> -void ivpu_hw_profiling_freq_drive(struct ivpu_device *vdev, bool enable);
>   void ivpu_irq_handlers_init(struct ivpu_device *vdev);
>   void ivpu_hw_irq_enable(struct ivpu_device *vdev);
>   void ivpu_hw_irq_disable(struct ivpu_device *vdev);
> diff --git a/drivers/accel/ivpu/ivpu_hw_btrs.c b/drivers/accel/ivpu/ivpu_hw_btrs.c
> index 840983a618ca..602d09e511e5 100644
> --- a/drivers/accel/ivpu/ivpu_hw_btrs.c
> +++ b/drivers/accel/ivpu/ivpu_hw_btrs.c
> @@ -153,7 +153,12 @@ static int info_init_lnl(struct ivpu_device *vdev)
>   		return ret;
>   
>   	hw->tile_fuse = tile_fuse_config;
> -	hw->pll.profiling_freq = PLL_PROFILING_FREQ_DEFAULT;
> +
> +	if (ivpu_test_mode & IVPU_TEST_MODE_PROF_FREQ_HIGH)
> +		hw->pll.profiling_freq = PLL_PROFILING_FREQ_HIGH;
> +	else
> +		hw->pll.profiling_freq = PLL_PROFILING_FREQ_DEFAULT;
> +
>   	hw->btrs_irq_mask = BTRS_LNL_IRQ_MASK;
>   
>   	if (ivpu_test_mode & IVPU_TEST_MODE_FREQ_CHANGE_ENABLE)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] accel/ivpu: Replace profiling frequency debugfs with test mode bit
  2026-11-03  9:42 [PATCH] accel/ivpu: Replace profiling frequency debugfs with test mode bit Andrzej Kacprowski
  2026-11-03 10:57 ` Wachowski, Karol
@ 2026-11-03 16:55 ` Jeff Hugo
  2026-11-05  8:50   ` Karol Wachowski
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff Hugo @ 2026-11-03 16:55 UTC (permalink / raw)
  To: Andrzej Kacprowski, dri-devel
  Cc: oded.gabbay, karol.wachowski, lizhi.hou, dawid.osuchowski

On 11/3/2026 2:42 AM, Andrzej Kacprowski wrote:
> Remove the profiling frequency debugfs control.
> Add IVPU_TEST_MODE_PROF_FREQ_HIGH to select
> PLL_PROFILING_FREQ_HIGH during driver initialization.
> High frequency profiling is for debugging purposes
> and it can be set at initialization time - there is
> no need to control it via debugfs.
> 
> Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] accel/ivpu: Replace profiling frequency debugfs with test mode bit
  2026-11-03 16:55 ` Jeff Hugo
@ 2026-11-05  8:50   ` Karol Wachowski
  0 siblings, 0 replies; 4+ messages in thread
From: Karol Wachowski @ 2026-11-05  8:50 UTC (permalink / raw)
  To: Jeff Hugo, Andrzej Kacprowski, dri-devel
  Cc: oded.gabbay, lizhi.hou, dawid.osuchowski

On 03-Nov-26 17:55, Jeff Hugo wrote:
> On 11/3/2026 2:42 AM, Andrzej Kacprowski wrote:
>> Remove the profiling frequency debugfs control.
>> Add IVPU_TEST_MODE_PROF_FREQ_HIGH to select
>> PLL_PROFILING_FREQ_HIGH during driver initialization.
>> High frequency profiling is for debugging purposes
>> and it can be set at initialization time - there is
>> no need to control it via debugfs.
>>
>> Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
> Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>

Thanks, applied to drm-misc-next.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-05  8:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-03  9:42 [PATCH] accel/ivpu: Replace profiling frequency debugfs with test mode bit Andrzej Kacprowski
2026-11-03 10:57 ` Wachowski, Karol
2026-11-03 16:55 ` Jeff Hugo
2026-11-05  8:50   ` Karol Wachowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.