All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] habanalabs: check if CoreSight is supported
@ 2020-05-10 11:10 Omer Shpigelman
  2020-05-11 11:50 ` Oded Gabbay
  0 siblings, 1 reply; 2+ messages in thread
From: Omer Shpigelman @ 2020-05-10 11:10 UTC (permalink / raw)
  To: oded.gabbay; +Cc: linux-kernel

Coresight is not supported on simulator, therefore add a boolean for
checking that (currently used by un-upstreamed code).

Signed-off-by: Omer Shpigelman <oshpigelman@habana.ai>
---
 drivers/misc/habanalabs/goya/goya.c  | 1 +
 drivers/misc/habanalabs/habanalabs.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
index b3e2354aaca2..fb2ff82e0db5 100644
--- a/drivers/misc/habanalabs/goya/goya.c
+++ b/drivers/misc/habanalabs/goya/goya.c
@@ -751,6 +751,7 @@ static int goya_sw_init(struct hl_device *hdev)
 	}
 
 	spin_lock_init(&goya->hw_queues_lock);
+	hdev->supports_coresight = true;
 
 	return 0;
 
diff --git a/drivers/misc/habanalabs/habanalabs.h b/drivers/misc/habanalabs/habanalabs.h
index a68df32094f1..cfb306daa8d4 100644
--- a/drivers/misc/habanalabs/habanalabs.h
+++ b/drivers/misc/habanalabs/habanalabs.h
@@ -1415,6 +1415,7 @@ struct hl_device_idle_busy_ts {
  * @cdev_sysfs_created: were char devices and sysfs nodes created.
  * @stop_on_err: true if engines should stop on error.
  * @supports_sync_stream: is sync stream supported.
+ * @supports_coresight: is CoreSight supported.
  */
 struct hl_device {
 	struct pci_dev			*pdev;
@@ -1498,6 +1499,7 @@ struct hl_device {
 	u8				cdev_sysfs_created;
 	u8				stop_on_err;
 	u8				supports_sync_stream;
+	u8				supports_coresight;
 
 	/* Parameters for bring-up */
 	u8				mmu_enable;
-- 
2.17.1


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

* Re: [PATCH] habanalabs: check if CoreSight is supported
  2020-05-10 11:10 [PATCH] habanalabs: check if CoreSight is supported Omer Shpigelman
@ 2020-05-11 11:50 ` Oded Gabbay
  0 siblings, 0 replies; 2+ messages in thread
From: Oded Gabbay @ 2020-05-11 11:50 UTC (permalink / raw)
  To: Omer Shpigelman; +Cc: Linux-Kernel@Vger. Kernel. Org

On Sun, May 10, 2020 at 2:10 PM Omer Shpigelman <oshpigelman@habana.ai> wrote:
>
> Coresight is not supported on simulator, therefore add a boolean for
> checking that (currently used by un-upstreamed code).
>
> Signed-off-by: Omer Shpigelman <oshpigelman@habana.ai>
> ---
>  drivers/misc/habanalabs/goya/goya.c  | 1 +
>  drivers/misc/habanalabs/habanalabs.h | 2 ++
>  2 files changed, 3 insertions(+)
>
> diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
> index b3e2354aaca2..fb2ff82e0db5 100644
> --- a/drivers/misc/habanalabs/goya/goya.c
> +++ b/drivers/misc/habanalabs/goya/goya.c
> @@ -751,6 +751,7 @@ static int goya_sw_init(struct hl_device *hdev)
>         }
>
>         spin_lock_init(&goya->hw_queues_lock);
> +       hdev->supports_coresight = true;
>
>         return 0;
>
> diff --git a/drivers/misc/habanalabs/habanalabs.h b/drivers/misc/habanalabs/habanalabs.h
> index a68df32094f1..cfb306daa8d4 100644
> --- a/drivers/misc/habanalabs/habanalabs.h
> +++ b/drivers/misc/habanalabs/habanalabs.h
> @@ -1415,6 +1415,7 @@ struct hl_device_idle_busy_ts {
>   * @cdev_sysfs_created: were char devices and sysfs nodes created.
>   * @stop_on_err: true if engines should stop on error.
>   * @supports_sync_stream: is sync stream supported.
> + * @supports_coresight: is CoreSight supported.
>   */
>  struct hl_device {
>         struct pci_dev                  *pdev;
> @@ -1498,6 +1499,7 @@ struct hl_device {
>         u8                              cdev_sysfs_created;
>         u8                              stop_on_err;
>         u8                              supports_sync_stream;
> +       u8                              supports_coresight;
>
>         /* Parameters for bring-up */
>         u8                              mmu_enable;
> --
> 2.17.1
>

This patch is:
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>

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

end of thread, other threads:[~2020-05-11 11:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-10 11:10 [PATCH] habanalabs: check if CoreSight is supported Omer Shpigelman
2020-05-11 11:50 ` Oded Gabbay

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.