All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: improve error handling in pcie_bw
@ 2020-05-19 21:10 Alex Deucher
  2020-05-19 21:10 ` [PATCH 2/2] drm/amdgpu: drop navi pcie bw callback Alex Deucher
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2020-05-19 21:10 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

1. Initialize the counters to 0 in case the callback
   fails to initialize them.
2. The counters don't exist on APUs so return an error
   for them.
3. Return an error if the callback doesn't exist.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index bc7de2f62d12..72bbb8175b22 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -1646,9 +1646,15 @@ static ssize_t amdgpu_get_pcie_bw(struct device *dev,
 {
 	struct drm_device *ddev = dev_get_drvdata(dev);
 	struct amdgpu_device *adev = ddev->dev_private;
-	uint64_t count0, count1;
+	uint64_t count0 = 0, count1 = 0;
 	int ret;
 
+	if (adev->flags & AMD_IS_APU)
+		return -ENODATA;
+
+	if (!adev->asic_funcs->get_pcie_usage)
+		return -ENODATA;
+
 	ret = pm_runtime_get_sync(ddev->dev);
 	if (ret < 0)
 		return ret;
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH 2/2] drm/amdgpu: drop navi pcie bw callback
  2020-05-19 21:10 [PATCH 1/2] drm/amdgpu: improve error handling in pcie_bw Alex Deucher
@ 2020-05-19 21:10 ` Alex Deucher
  2020-05-21 16:52   ` Alex Deucher
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2020-05-19 21:10 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

It's not implemented yet so just drop it so the sysfs
pcie bw file returns an appropriate error instead of
garbage.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 9c42316c47c0..6655dd2009b6 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -548,13 +548,6 @@ static bool nv_need_full_reset(struct amdgpu_device *adev)
 	return true;
 }
 
-static void nv_get_pcie_usage(struct amdgpu_device *adev,
-			      uint64_t *count0,
-			      uint64_t *count1)
-{
-	/*TODO*/
-}
-
 static bool nv_need_reset_on_init(struct amdgpu_device *adev)
 {
 #if 0
@@ -629,7 +622,6 @@ static const struct amdgpu_asic_funcs nv_asic_funcs =
 	.invalidate_hdp = &nv_invalidate_hdp,
 	.init_doorbell_index = &nv_init_doorbell_index,
 	.need_full_reset = &nv_need_full_reset,
-	.get_pcie_usage = &nv_get_pcie_usage,
 	.need_reset_on_init = &nv_need_reset_on_init,
 	.get_pcie_replay_count = &nv_get_pcie_replay_count,
 	.supports_baco = &nv_asic_supports_baco,
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 2/2] drm/amdgpu: drop navi pcie bw callback
  2020-05-19 21:10 ` [PATCH 2/2] drm/amdgpu: drop navi pcie bw callback Alex Deucher
@ 2020-05-21 16:52   ` Alex Deucher
  2020-05-21 17:27     ` Zhao, Yong
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2020-05-21 16:52 UTC (permalink / raw)
  To: amd-gfx list; +Cc: Alex Deucher

Ping on this series?

On Tue, May 19, 2020 at 5:10 PM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> It's not implemented yet so just drop it so the sysfs
> pcie bw file returns an appropriate error instead of
> garbage.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/nv.c | 8 --------
>  1 file changed, 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
> index 9c42316c47c0..6655dd2009b6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/nv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/nv.c
> @@ -548,13 +548,6 @@ static bool nv_need_full_reset(struct amdgpu_device *adev)
>         return true;
>  }
>
> -static void nv_get_pcie_usage(struct amdgpu_device *adev,
> -                             uint64_t *count0,
> -                             uint64_t *count1)
> -{
> -       /*TODO*/
> -}
> -
>  static bool nv_need_reset_on_init(struct amdgpu_device *adev)
>  {
>  #if 0
> @@ -629,7 +622,6 @@ static const struct amdgpu_asic_funcs nv_asic_funcs =
>         .invalidate_hdp = &nv_invalidate_hdp,
>         .init_doorbell_index = &nv_init_doorbell_index,
>         .need_full_reset = &nv_need_full_reset,
> -       .get_pcie_usage = &nv_get_pcie_usage,
>         .need_reset_on_init = &nv_need_reset_on_init,
>         .get_pcie_replay_count = &nv_get_pcie_replay_count,
>         .supports_baco = &nv_asic_supports_baco,
> --
> 2.25.4
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 2/2] drm/amdgpu: drop navi pcie bw callback
  2020-05-21 16:52   ` Alex Deucher
@ 2020-05-21 17:27     ` Zhao, Yong
  2020-05-21 17:35       ` Russell, Kent
  0 siblings, 1 reply; 5+ messages in thread
From: Zhao, Yong @ 2020-05-21 17:27 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx list; +Cc: Deucher, Alexander


[-- Attachment #1.1: Type: text/plain, Size: 2366 bytes --]

[AMD Official Use Only - Internal Distribution Only]

The series are

Reviewed-by: Yong Zhao <Yong.Zhao@amd.com>
________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Alex Deucher <alexdeucher@gmail.com>
Sent: Thursday, May 21, 2020 12:52 PM
To: amd-gfx list <amd-gfx@lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: Re: [PATCH 2/2] drm/amdgpu: drop navi pcie bw callback

Ping on this series?

On Tue, May 19, 2020 at 5:10 PM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> It's not implemented yet so just drop it so the sysfs
> pcie bw file returns an appropriate error instead of
> garbage.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/nv.c | 8 --------
>  1 file changed, 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
> index 9c42316c47c0..6655dd2009b6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/nv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/nv.c
> @@ -548,13 +548,6 @@ static bool nv_need_full_reset(struct amdgpu_device *adev)
>         return true;
>  }
>
> -static void nv_get_pcie_usage(struct amdgpu_device *adev,
> -                             uint64_t *count0,
> -                             uint64_t *count1)
> -{
> -       /*TODO*/
> -}
> -
>  static bool nv_need_reset_on_init(struct amdgpu_device *adev)
>  {
>  #if 0
> @@ -629,7 +622,6 @@ static const struct amdgpu_asic_funcs nv_asic_funcs =
>         .invalidate_hdp = &nv_invalidate_hdp,
>         .init_doorbell_index = &nv_init_doorbell_index,
>         .need_full_reset = &nv_need_full_reset,
> -       .get_pcie_usage = &nv_get_pcie_usage,
>         .need_reset_on_init = &nv_need_reset_on_init,
>         .get_pcie_replay_count = &nv_get_pcie_replay_count,
>         .supports_baco = &nv_asic_supports_baco,
> --
> 2.25.4
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cyong.zhao%40amd.com%7C1a6de00e60b447bad54a08d7fda76316%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637256767681371342&amp;sdata=EWwfgYQtOR1TGw6%2BL6w8Cw7Y9e7ixVI1xDJoWTUsWtk%3D&amp;reserved=0

[-- Attachment #1.2: Type: text/html, Size: 4830 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 2/2] drm/amdgpu: drop navi pcie bw callback
  2020-05-21 17:27     ` Zhao, Yong
@ 2020-05-21 17:35       ` Russell, Kent
  0 siblings, 0 replies; 5+ messages in thread
From: Russell, Kent @ 2020-05-21 17:35 UTC (permalink / raw)
  To: Zhao, Yong, Alex Deucher, amd-gfx list; +Cc: Deucher, Alexander


[-- Attachment #1.1: Type: text/plain, Size: 3370 bytes --]

Sorry I missed this.
Series is Reviewed-By: Kent Russell <kent.russell@amd.com>

 Kent


KENT RUSSELL
Sr. Software Engineer | Linux Compute Kernel
1 Commerce Valley Drive East
Markham, ON L3T 7X6
O +(1) 289-695-2122 | Ext 72122
________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Zhao, Yong <Yong.Zhao@amd.com>
Sent: Thursday, May 21, 2020 1:27 PM
To: Alex Deucher <alexdeucher@gmail.com>; amd-gfx list <amd-gfx@lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: Re: [PATCH 2/2] drm/amdgpu: drop navi pcie bw callback


[AMD Official Use Only - Internal Distribution Only]


[AMD Official Use Only - Internal Distribution Only]

The series are

Reviewed-by: Yong Zhao <Yong.Zhao@amd.com>
________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Alex Deucher <alexdeucher@gmail.com>
Sent: Thursday, May 21, 2020 12:52 PM
To: amd-gfx list <amd-gfx@lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: Re: [PATCH 2/2] drm/amdgpu: drop navi pcie bw callback

Ping on this series?

On Tue, May 19, 2020 at 5:10 PM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> It's not implemented yet so just drop it so the sysfs
> pcie bw file returns an appropriate error instead of
> garbage.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/nv.c | 8 --------
>  1 file changed, 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
> index 9c42316c47c0..6655dd2009b6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/nv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/nv.c
> @@ -548,13 +548,6 @@ static bool nv_need_full_reset(struct amdgpu_device *adev)
>         return true;
>  }
>
> -static void nv_get_pcie_usage(struct amdgpu_device *adev,
> -                             uint64_t *count0,
> -                             uint64_t *count1)
> -{
> -       /*TODO*/
> -}
> -
>  static bool nv_need_reset_on_init(struct amdgpu_device *adev)
>  {
>  #if 0
> @@ -629,7 +622,6 @@ static const struct amdgpu_asic_funcs nv_asic_funcs =
>         .invalidate_hdp = &nv_invalidate_hdp,
>         .init_doorbell_index = &nv_init_doorbell_index,
>         .need_full_reset = &nv_need_full_reset,
> -       .get_pcie_usage = &nv_get_pcie_usage,
>         .need_reset_on_init = &nv_need_reset_on_init,
>         .get_pcie_replay_count = &nv_get_pcie_replay_count,
>         .supports_baco = &nv_asic_supports_baco,
> --
> 2.25.4
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cyong.zhao%40amd.com%7C1a6de00e60b447bad54a08d7fda76316%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637256767681371342&amp;sdata=EWwfgYQtOR1TGw6%2BL6w8Cw7Y9e7ixVI1xDJoWTUsWtk%3D&amp;reserved=0<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Ckent.russell%40amd.com%7Cb24bbf754a294cc666ba08d7fdac5228%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637256789747127637&sdata=m%2BJ73URIHmwFL3IH%2BC%2BSgryLmztoLuXswA33XTFiy90%3D&reserved=0>

[-- Attachment #1.2: Type: text/html, Size: 7503 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2020-05-21 17:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 21:10 [PATCH 1/2] drm/amdgpu: improve error handling in pcie_bw Alex Deucher
2020-05-19 21:10 ` [PATCH 2/2] drm/amdgpu: drop navi pcie bw callback Alex Deucher
2020-05-21 16:52   ` Alex Deucher
2020-05-21 17:27     ` Zhao, Yong
2020-05-21 17:35       ` Russell, Kent

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.