Re: [PATCH] drm/amdgpu: Add "harvest" to IP discovery sysfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At the moment it's 0 across all IPs.
I doubt there are any consumers of the harvest data at the moment.
Since this will be fixed in VBIOS eventually, I suggest we add it now for completeness and it'll be there when this is fixed in VBIOS.

Regards,
Luben


On 2022-02-15 03:58, Chen, Guchun wrote:
> [Public]
> 
> Hi Luben,
> 
> I suggest holding on this pls. Harvest bit per IP data structure from VBIOS is not consistently correct. Exposing it to use via sysfs may confuse users.
> 
> Regards,
> Guchun
> 
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Luben Tuikov
> Sent: Tuesday, February 15, 2022 7:22 AM
> To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Tuikov, Luben <Luben.Tuikov@xxxxxxx>
> Subject: [PATCH] drm/amdgpu: Add "harvest" to IP discovery sysfs
> 
> Add the "harvest" field to the IP attributes in the IP discovery sysfs visualization, as this field is present in the binary data.
> 
> Cc: Alex Deucher <Alexander.Deucher@xxxxxxx>
> Signed-off-by: Luben Tuikov <luben.tuikov@xxxxxxx>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> index c8dbdb78988ce0..0496d369504641 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> @@ -393,6 +393,7 @@ struct ip_hw_instance {
>  	int hw_id;
>  	u8  num_instance;
>  	u8  major, minor, revision;
> +	u8  harvest;
>  
>  	int num_base_addresses;
>  	u32 base_addr[];
> @@ -440,6 +441,11 @@ static ssize_t revision_show(struct ip_hw_instance *ip_hw_instance, char *buf)
>  	return sysfs_emit(buf, "%d\n", ip_hw_instance->revision);  }
>  
> +static ssize_t harvest_show(struct ip_hw_instance *ip_hw_instance, char 
> +*buf) {
> +	return sysfs_emit(buf, "0x%01X\n", ip_hw_instance->harvest); }
> +
>  static ssize_t num_base_addresses_show(struct ip_hw_instance *ip_hw_instance, char *buf)  {
>  	return sysfs_emit(buf, "%d\n", ip_hw_instance->num_base_addresses);
> @@ -471,6 +477,7 @@ static struct ip_hw_instance_attr ip_hw_attr[] = {
>  	__ATTR_RO(major),
>  	__ATTR_RO(minor),
>  	__ATTR_RO(revision),
> +	__ATTR_RO(harvest),
>  	__ATTR_RO(num_base_addresses),
>  	__ATTR_RO(base_addr),
>  };
> @@ -708,6 +715,7 @@ static int amdgpu_discovery_sysfs_ips(struct amdgpu_device *adev,
>  			ip_hw_instance->major = ip->major;
>  			ip_hw_instance->minor = ip->minor;
>  			ip_hw_instance->revision = ip->revision;
> +			ip_hw_instance->harvest = ip->harvest;
>  			ip_hw_instance->num_base_addresses = ip->num_base_address;
>  
>  			for (kk = 0; kk < ip_hw_instance->num_base_addresses; kk++)
> 
> base-commit: d8604f1d237a145db48bae4ea60b85a5875df307
> --
> 2.35.1.102.g2b9c120970

Regards,
-- 
Luben



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux