All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/amdgpu: fix incorrect translation about the PCIe MLW info
@ 2019-03-19  4:26 Chengming Gui
       [not found] ` <1552969591-13386-1-git-send-email-Jack.Gui-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Chengming Gui @ 2019-03-19  4:26 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Chengming Gui

Max Link Width's full mask is 0x3f,
and it's highest bit express X16.

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 964a4d3..435f0d7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3763,15 +3763,6 @@ static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
 		} else {
 			switch (platform_link_width) {
 			case PCIE_LNK_X32:
-				adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X32 |
-							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X16 |
-							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 |
-							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 |
-							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 |
-							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 |
-							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X1);
-				break;
-			case PCIE_LNK_X16:
 				adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X16 |
 							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 |
 							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 |
@@ -3779,13 +3770,14 @@ static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
 							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 |
 							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X1);
 				break;
-			case PCIE_LNK_X12:
+			case PCIE_LNK_X16:
 				adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 |
 							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 |
 							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 |
 							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 |
 							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X1);
 				break;
+			case PCIE_LNK_X12:
 			case PCIE_LNK_X8:
 				adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 |
 							  CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 |
-- 
2.7.4

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

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

* Re: [PATCH] drm/amd/amdgpu: fix incorrect translation about the PCIe MLW info
       [not found] ` <1552969591-13386-1-git-send-email-Jack.Gui-5C7GfCeVMHo@public.gmane.org>
@ 2019-03-19 14:43   ` Alex Deucher
       [not found]     ` <CADnq5_Pkr6FAHjZpZdYzK74qykV0YBVkP1taci1QP7yQQ=7u1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2019-03-19 14:43 UTC (permalink / raw)
  To: Chengming Gui; +Cc: amd-gfx list

On Tue, Mar 19, 2019 at 12:26 AM Chengming Gui <Jack.Gui@amd.com> wrote:
>
> Max Link Width's full mask is 0x3f,
> and it's highest bit express X16.
>
> Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 964a4d3..435f0d7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3763,15 +3763,6 @@ static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
>                 } else {
>                         switch (platform_link_width) {
>                         case PCIE_LNK_X32:
> -                               adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X32 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X16 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X1);
> -                               break;
> -                       case PCIE_LNK_X16:
>                                 adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X16 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 |
> @@ -3779,13 +3770,14 @@ static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X1);
>                                 break;
> -                       case PCIE_LNK_X12:
> +                       case PCIE_LNK_X16:

Not sure I understand this change or the one below.  If we have a x16
link, why don't you want CAIL_PCIE_LINK_WIDTH_SUPPORT_X16 set?

Alex

>                                 adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X1);
>                                 break;
> +                       case PCIE_LNK_X12:
>                         case PCIE_LNK_X8:
>                                 adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 |
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] drm/amd/amdgpu: fix incorrect translation about the PCIe MLW info
       [not found]     ` <CADnq5_Pkr6FAHjZpZdYzK74qykV0YBVkP1taci1QP7yQQ=7u1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2019-03-20  8:21       ` Gui, Jack
       [not found]         ` <MN2PR12MB35821A29C60457C092C5C2528B410-rweVpJHSKTr2mYjuiDFEwwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Gui, Jack @ 2019-03-20  8:21 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx list

Hi Alex,

I will rethink the patch.

Polaris10 encounted issue about the PCIe dpm feature (some platform, not all).
If we update pcie table with X16 link width, system will hang, 
But update with X8, our driver will modprobe successfully.
The link width got from the config register is real X16.

Could you give me some insight for this?

BR,
Jack Gui

-----Original Message-----
From: Alex Deucher <alexdeucher@gmail.com> 
Sent: Tuesday, March 19, 2019 10:43 PM
To: Gui, Jack <Jack.Gui@amd.com>
Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amd/amdgpu: fix incorrect translation about the PCIe MLW info

On Tue, Mar 19, 2019 at 12:26 AM Chengming Gui <Jack.Gui@amd.com> wrote:
>
> Max Link Width's full mask is 0x3f,
> and it's highest bit express X16.
>
> Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 964a4d3..435f0d7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3763,15 +3763,6 @@ static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
>                 } else {
>                         switch (platform_link_width) {
>                         case PCIE_LNK_X32:
> -                               adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X32 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X16 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X1);
> -                               break;
> -                       case PCIE_LNK_X16:
>                                 adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X16 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 |
>                                                           
> CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 | @@ -3779,13 +3770,14 @@ static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X1);
>                                 break;
> -                       case PCIE_LNK_X12:
> +                       case PCIE_LNK_X16:

Not sure I understand this change or the one below.  If we have a x16 link, why don't you want CAIL_PCIE_LINK_WIDTH_SUPPORT_X16 set?

Alex

>                                 adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X1);
>                                 break;
> +                       case PCIE_LNK_X12:
>                         case PCIE_LNK_X8:
>                                 adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 |
>                                                           
> CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 |
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] drm/amd/amdgpu: fix incorrect translation about the PCIe MLW info
       [not found]         ` <MN2PR12MB35821A29C60457C092C5C2528B410-rweVpJHSKTr2mYjuiDFEwwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-03-20  9:18           ` Xu, Feifei
  0 siblings, 0 replies; 4+ messages in thread
From: Xu, Feifei @ 2019-03-20  9:18 UTC (permalink / raw)
  To: Gui, Jack, Alex Deucher; +Cc: amd-gfx list

Hi Jack,

Is the failure happens at link width training at X12? 

Thanks
Feifei

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Gui, Jack
Sent: Wednesday, March 20, 2019 4:22 PM
To: Alex Deucher <alexdeucher@gmail.com>
Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
Subject: RE: [PATCH] drm/amd/amdgpu: fix incorrect translation about the PCIe MLW info

Hi Alex,

I will rethink the patch.

Polaris10 encounted issue about the PCIe dpm feature (some platform, not all).
If we update pcie table with X16 link width, system will hang, But update with X8, our driver will modprobe successfully.
The link width got from the config register is real X16.

Could you give me some insight for this?

BR,
Jack Gui

-----Original Message-----
From: Alex Deucher <alexdeucher@gmail.com>
Sent: Tuesday, March 19, 2019 10:43 PM
To: Gui, Jack <Jack.Gui@amd.com>
Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amd/amdgpu: fix incorrect translation about the PCIe MLW info

On Tue, Mar 19, 2019 at 12:26 AM Chengming Gui <Jack.Gui@amd.com> wrote:
>
> Max Link Width's full mask is 0x3f,
> and it's highest bit express X16.
>
> Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 964a4d3..435f0d7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3763,15 +3763,6 @@ static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
>                 } else {
>                         switch (platform_link_width) {
>                         case PCIE_LNK_X32:
> -                               adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X32 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X16 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 |
> -                                                         CAIL_PCIE_LINK_WIDTH_SUPPORT_X1);
> -                               break;
> -                       case PCIE_LNK_X16:
>                                 adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X16 |
>                                                           
> CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 |
>                                                           
> CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 | @@ -3779,13 +3770,14 @@ static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X1);
>                                 break;
> -                       case PCIE_LNK_X12:
> +                       case PCIE_LNK_X16:

Not sure I understand this change or the one below.  If we have a x16 link, why don't you want CAIL_PCIE_LINK_WIDTH_SUPPORT_X16 set?

Alex

>                                 adev->pm.pcie_mlw_mask = (CAIL_PCIE_LINK_WIDTH_SUPPORT_X12 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 |
>                                                           CAIL_PCIE_LINK_WIDTH_SUPPORT_X1);
>                                 break;
> +                       case PCIE_LNK_X12:
>                         case PCIE_LNK_X8:
>                                 adev->pm.pcie_mlw_mask = 
> (CAIL_PCIE_LINK_WIDTH_SUPPORT_X8 |
>                                                           
> CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 |
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2019-03-20  9:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19  4:26 [PATCH] drm/amd/amdgpu: fix incorrect translation about the PCIe MLW info Chengming Gui
     [not found] ` <1552969591-13386-1-git-send-email-Jack.Gui-5C7GfCeVMHo@public.gmane.org>
2019-03-19 14:43   ` Alex Deucher
     [not found]     ` <CADnq5_Pkr6FAHjZpZdYzK74qykV0YBVkP1taci1QP7yQQ=7u1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-03-20  8:21       ` Gui, Jack
     [not found]         ` <MN2PR12MB35821A29C60457C092C5C2528B410-rweVpJHSKTr2mYjuiDFEwwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-03-20  9:18           ` Xu, Feifei

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.