amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Fix the incomplete product number
@ 2022-07-18 12:08 yehonsun
  2022-07-18 12:35 ` Christian König
  0 siblings, 1 reply; 12+ messages in thread
From: yehonsun @ 2022-07-18 12:08 UTC (permalink / raw)
  To: amd-gfx; +Cc: yehonsun

The comments say that the product number is a 16-digit HEX string so the
buffer needs to be at least 17 characters to hold the NUL terminator.

The comments say that the product number is a 16-digit HEX string so the
buffer needs to be at least 17 characters to hold the NUL terminator.

Signed-off-by: yehonsun <yehonsun@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 9f729a648005..187e3dae3965 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1019,7 +1019,7 @@ struct amdgpu_device {
 	bool                            psp_sysfs_en;
 
 	/* Chip product information */
-	char				product_number[16];
+	char				product_number[20];
 	char				product_name[AMDGPU_PRODUCT_NAME_LEN];
 	char				serial[20];
 
-- 
2.34.1


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

* Re: [PATCH] drm/amdgpu: Fix the incomplete product number
  2022-07-18 12:08 [PATCH] drm/amdgpu: Fix the incomplete product number yehonsun
@ 2022-07-18 12:35 ` Christian König
  0 siblings, 0 replies; 12+ messages in thread
From: Christian König @ 2022-07-18 12:35 UTC (permalink / raw)
  To: yehonsun, amd-gfx

Am 18.07.22 um 14:08 schrieb yehonsun:
> The comments say that the product number is a 16-digit HEX string so the
> buffer needs to be at least 17 characters to hold the NUL terminator.
>
> The comments say that the product number is a 16-digit HEX string so the
> buffer needs to be at least 17 characters to hold the NUL terminator.

Well first of all you repeated the commit message twice.

Then when it is fixed 16 digit Hex string then we probably don't have a 
NUL terminator in the first place.

Please double check.

Regards,
Christian.

>
> Signed-off-by: yehonsun <yehonsun@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 9f729a648005..187e3dae3965 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1019,7 +1019,7 @@ struct amdgpu_device {
>   	bool                            psp_sysfs_en;
>   
>   	/* Chip product information */
> -	char				product_number[16];
> +	char				product_number[20];
>   	char				product_name[AMDGPU_PRODUCT_NAME_LEN];
>   	char				serial[20];
>   


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

* Re: [PATCH] drm/amdgpu: Fix the incomplete product number
  2022-07-22  4:56 Roy Sun
  2022-07-25  7:29 ` Sun, Roy
@ 2022-07-25 19:38 ` André Almeida
  1 sibling, 0 replies; 12+ messages in thread
From: André Almeida @ 2022-07-25 19:38 UTC (permalink / raw)
  To: Roy Sun; +Cc: amd-gfx

Às 01:56 de 22/07/22, Roy Sun escreveu:
> The comments say that the product number is a 16-digit HEX string so the
> buffer needs to be at least 17 characters to hold the NUL terminator. Expand
> the buffer size to 20 to avoid the alignment issues.
> 
> The comment:Product number should only be 16 characters. Any
> more,and something could be wrong. Cap it at 16 to be safe
> 
> Signed-off-by: Roy Sun <Roy.Sun@amd.com>
> ---

Reviewed-by: André Almeida <andrealmeid@igalia.com>

Next time, please make your subject as [PATCH v2] and add a changelog to
make review easier.

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

* Re: [PATCH] drm/amdgpu: Fix the incomplete product number
  2022-07-25  7:29 ` Sun, Roy
@ 2022-07-25 13:35   ` Alex Deucher
  0 siblings, 0 replies; 12+ messages in thread
From: Alex Deucher @ 2022-07-25 13:35 UTC (permalink / raw)
  To: Sun, Roy; +Cc: amd-gfx

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

On Mon, Jul 25, 2022 at 3:29 AM Sun, Roy <Roy.Sun@amd.com> wrote:
>
> [AMD Official Use Only - General]
>
> Ping
>
> -----Original Message-----
> From: Roy Sun <Roy.Sun@amd.com>
> Sent: Friday, July 22, 2022 12:57 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Sun, Roy <Roy.Sun@amd.com>
> Subject: [PATCH] drm/amdgpu: Fix the incomplete product number
>
> The comments say that the product number is a 16-digit HEX string so the buffer needs to be at least 17 characters to hold the NUL terminator. Expand the buffer size to 20 to avoid the alignment issues.
>
> The comment:Product number should only be 16 characters. Any more,and something could be wrong. Cap it at 16 to be safe
>
> Signed-off-by: Roy Sun <Roy.Sun@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 9f729a648005..187e3dae3965 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1019,7 +1019,7 @@ struct amdgpu_device {
>         bool                            psp_sysfs_en;
>
>         /* Chip product information */
> -       char                            product_number[16];
> +       char                            product_number[20];
>         char                            product_name[AMDGPU_PRODUCT_NAME_LEN];
>         char                            serial[20];
>
> --
> 2.34.1

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

* RE: [PATCH] drm/amdgpu: Fix the incomplete product number
  2022-07-22  4:56 Roy Sun
@ 2022-07-25  7:29 ` Sun, Roy
  2022-07-25 13:35   ` Alex Deucher
  2022-07-25 19:38 ` André Almeida
  1 sibling, 1 reply; 12+ messages in thread
From: Sun, Roy @ 2022-07-25  7:29 UTC (permalink / raw)
  To: Sun, Roy, amd-gfx

[AMD Official Use Only - General]

Ping

-----Original Message-----
From: Roy Sun <Roy.Sun@amd.com> 
Sent: Friday, July 22, 2022 12:57 PM
To: amd-gfx@lists.freedesktop.org
Cc: Sun, Roy <Roy.Sun@amd.com>
Subject: [PATCH] drm/amdgpu: Fix the incomplete product number

The comments say that the product number is a 16-digit HEX string so the buffer needs to be at least 17 characters to hold the NUL terminator. Expand the buffer size to 20 to avoid the alignment issues.

The comment:Product number should only be 16 characters. Any more,and something could be wrong. Cap it at 16 to be safe

Signed-off-by: Roy Sun <Roy.Sun@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 9f729a648005..187e3dae3965 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1019,7 +1019,7 @@ struct amdgpu_device {
 	bool                            psp_sysfs_en;
 
 	/* Chip product information */
-	char				product_number[16];
+	char				product_number[20];
 	char				product_name[AMDGPU_PRODUCT_NAME_LEN];
 	char				serial[20];
 
--
2.34.1

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

* [PATCH] drm/amdgpu: Fix the incomplete product number
@ 2022-07-22  4:56 Roy Sun
  2022-07-25  7:29 ` Sun, Roy
  2022-07-25 19:38 ` André Almeida
  0 siblings, 2 replies; 12+ messages in thread
From: Roy Sun @ 2022-07-22  4:56 UTC (permalink / raw)
  To: amd-gfx; +Cc: Roy Sun

The comments say that the product number is a 16-digit HEX string so the
buffer needs to be at least 17 characters to hold the NUL terminator. Expand
the buffer size to 20 to avoid the alignment issues.

The comment:Product number should only be 16 characters. Any
more,and something could be wrong. Cap it at 16 to be safe

Signed-off-by: Roy Sun <Roy.Sun@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 9f729a648005..187e3dae3965 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1019,7 +1019,7 @@ struct amdgpu_device {
 	bool                            psp_sysfs_en;
 
 	/* Chip product information */
-	char				product_number[16];
+	char				product_number[20];
 	char				product_name[AMDGPU_PRODUCT_NAME_LEN];
 	char				serial[20];
 
-- 
2.34.1


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

* Re: [PATCH] drm/amdgpu: Fix the incomplete product number
  2022-07-20  8:26 Roy Sun
                   ` (2 preceding siblings ...)
  2022-07-20 14:26 ` André Almeida
@ 2022-07-20 17:23 ` André Almeida
  3 siblings, 0 replies; 12+ messages in thread
From: André Almeida @ 2022-07-20 17:23 UTC (permalink / raw)
  To: Roy Sun; +Cc: amd-gfx

Às 05:26 de 20/07/22, Roy Sun escreveu:
> The comments say that the product number is a 16-digit HEX string so the
> buffer needs to be at least 17 characters to hold the NUL terminator.
> 
> Signed-off-by: Roy Sun <Roy.Sun@amd.com>
> ---

Reviewed-by: André Almeida <andrealmeid@igalia.com>

...but I would appreciate a more detailed commit message with the points
I raised in the review

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

* Re: [PATCH] drm/amdgpu: Fix the incomplete product number
  2022-07-20 14:26 ` André Almeida
@ 2022-07-20 14:30   ` Christian König
  0 siblings, 0 replies; 12+ messages in thread
From: Christian König @ 2022-07-20 14:30 UTC (permalink / raw)
  To: André Almeida, Roy Sun; +Cc: amd-gfx

Am 20.07.22 um 16:26 schrieb André Almeida:
> Às 05:26 de 20/07/22, Roy Sun escreveu:
>> The comments say that the product number is a 16-digit HEX string so the
>> buffer needs to be at least 17 characters to hold the NUL terminator.
>>
> Which comment?

In internal documentation of the eeprom layout I think.

>
>> Signed-off-by: Roy Sun <Roy.Sun@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> index 9f729a648005..187e3dae3965 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> @@ -1019,7 +1019,7 @@ struct amdgpu_device {
>>   	bool                            psp_sysfs_en;
>>   
>>   	/* Chip product information */
>> -	char				product_number[16];
>> +	char				product_number[20];
> If 17 is enough, why setting as 20?

That's the next multiple of 4 and so avoids alignment issues.


Christian.

>
>>   	char				product_name[AMDGPU_PRODUCT_NAME_LEN];
>>   	char				serial[20];
>>   


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

* Re: [PATCH] drm/amdgpu: Fix the incomplete product number
  2022-07-20  8:26 Roy Sun
  2022-07-20  8:28 ` Sun, Roy
  2022-07-20 12:48 ` Christian König
@ 2022-07-20 14:26 ` André Almeida
  2022-07-20 14:30   ` Christian König
  2022-07-20 17:23 ` André Almeida
  3 siblings, 1 reply; 12+ messages in thread
From: André Almeida @ 2022-07-20 14:26 UTC (permalink / raw)
  To: Roy Sun; +Cc: amd-gfx

Às 05:26 de 20/07/22, Roy Sun escreveu:
> The comments say that the product number is a 16-digit HEX string so the
> buffer needs to be at least 17 characters to hold the NUL terminator.
> 

Which comment?

> Signed-off-by: Roy Sun <Roy.Sun@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 9f729a648005..187e3dae3965 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1019,7 +1019,7 @@ struct amdgpu_device {
>  	bool                            psp_sysfs_en;
>  
>  	/* Chip product information */
> -	char				product_number[16];
> +	char				product_number[20];

If 17 is enough, why setting as 20?

>  	char				product_name[AMDGPU_PRODUCT_NAME_LEN];
>  	char				serial[20];
>  

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

* Re: [PATCH] drm/amdgpu: Fix the incomplete product number
  2022-07-20  8:26 Roy Sun
  2022-07-20  8:28 ` Sun, Roy
@ 2022-07-20 12:48 ` Christian König
  2022-07-20 14:26 ` André Almeida
  2022-07-20 17:23 ` André Almeida
  3 siblings, 0 replies; 12+ messages in thread
From: Christian König @ 2022-07-20 12:48 UTC (permalink / raw)
  To: Roy Sun, amd-gfx

Am 20.07.22 um 10:26 schrieb Roy Sun:
> The comments say that the product number is a 16-digit HEX string so the
> buffer needs to be at least 17 characters to hold the NUL terminator.
>
> Signed-off-by: Roy Sun <Roy.Sun@amd.com>

Acked-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 9f729a648005..187e3dae3965 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1019,7 +1019,7 @@ struct amdgpu_device {
>   	bool                            psp_sysfs_en;
>   
>   	/* Chip product information */
> -	char				product_number[16];
> +	char				product_number[20];
>   	char				product_name[AMDGPU_PRODUCT_NAME_LEN];
>   	char				serial[20];
>   


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

* Re: [PATCH] drm/amdgpu: Fix the incomplete product number
  2022-07-20  8:26 Roy Sun
@ 2022-07-20  8:28 ` Sun, Roy
  2022-07-20 12:48 ` Christian König
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Sun, Roy @ 2022-07-20  8:28 UTC (permalink / raw)
  To: amd-gfx

[-- Attachment #1: Type: text/plain, Size: 1259 bytes --]

[AMD Official Use Only - General]

Double checked.

BR
Roy
________________________________
From: Roy Sun <Roy.Sun@amd.com>
Sent: Wednesday, July 20, 2022 4:26 PM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Sun, Roy <Roy.Sun@amd.com>
Subject: [PATCH] drm/amdgpu: Fix the incomplete product number

The comments say that the product number is a 16-digit HEX string so the
buffer needs to be at least 17 characters to hold the NUL terminator.

Signed-off-by: Roy Sun <Roy.Sun@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 9f729a648005..187e3dae3965 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1019,7 +1019,7 @@ struct amdgpu_device {
         bool                            psp_sysfs_en;

         /* Chip product information */
-       char                            product_number[16];
+       char                            product_number[20];
         char                            product_name[AMDGPU_PRODUCT_NAME_LEN];
         char                            serial[20];

--
2.34.1


[-- Attachment #2: Type: text/html, Size: 3518 bytes --]

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

* [PATCH] drm/amdgpu: Fix the incomplete product number
@ 2022-07-20  8:26 Roy Sun
  2022-07-20  8:28 ` Sun, Roy
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Roy Sun @ 2022-07-20  8:26 UTC (permalink / raw)
  To: amd-gfx; +Cc: Roy Sun

The comments say that the product number is a 16-digit HEX string so the
buffer needs to be at least 17 characters to hold the NUL terminator.

Signed-off-by: Roy Sun <Roy.Sun@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 9f729a648005..187e3dae3965 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1019,7 +1019,7 @@ struct amdgpu_device {
 	bool                            psp_sysfs_en;
 
 	/* Chip product information */
-	char				product_number[16];
+	char				product_number[20];
 	char				product_name[AMDGPU_PRODUCT_NAME_LEN];
 	char				serial[20];
 
-- 
2.34.1


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

end of thread, other threads:[~2022-07-25 19:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 12:08 [PATCH] drm/amdgpu: Fix the incomplete product number yehonsun
2022-07-18 12:35 ` Christian König
2022-07-20  8:26 Roy Sun
2022-07-20  8:28 ` Sun, Roy
2022-07-20 12:48 ` Christian König
2022-07-20 14:26 ` André Almeida
2022-07-20 14:30   ` Christian König
2022-07-20 17:23 ` André Almeida
2022-07-22  4:56 Roy Sun
2022-07-25  7:29 ` Sun, Roy
2022-07-25 13:35   ` Alex Deucher
2022-07-25 19:38 ` André Almeida

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).