Skip to contentSkip to conversation

missing wire up of nbif_v6_3_1_sriov_funcs ?

DISCUSSION Dr. David Alan Gilbert 3 participants 4 messages Feb 19, 2025

lore
Share & tools
lore
#0 lore raw

Hi All,
I think you may be misisng some wiring of nbif_v6_3_1_sriov_funcs.

My scripts noticed 'nbif_v6_3_1_sriov_funcs' was unused;
It was added in:
Commit: 894c6d3522d1 ("drm/amdgpu: Add nbif v6_3_1 ip block support")

and is:
drivers/gpu/drm/amd/amdgpu/nbif_v6_3_1.c:
const struct amdgpu_nbio_funcs nbif_v6_3_1_sriov_funcs = {

but, it's not referenced, which makes me think it perhaps should be in:
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

I see for 4.3.x there is:
case IP_VERSION(4, 3, 0):
case IP_VERSION(4, 3, 1):

    if (amdgpu_sriov_vf(adev))
      adev->nbio.funcs = &nbio_v4_3_sriov_funcs;
    else
      adev->nbio.funcs = &nbio_v4_3_funcs;
    adev->nbio.hdp_flush_reg = &nbio_v4_3_hdp_flush_reg;
    break;

but for 6.3.1 we have:

  case IP_VERSION(6, 3, 1):
    adev->nbio.funcs = &nbif_v6_3_1_funcs;
    adev->nbio.hdp_flush_reg = &nbif_v6_3_1_hdp_flush_reg;
    break;

so is that supposed to have something similar?

Dave

Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/
#1 lore raw
Quoted 29 lines · Dr. David Alan Gilbert

Hi All,
I think you may be misisng some wiring of nbif_v6_3_1_sriov_funcs.

My scripts noticed 'nbif_v6_3_1_sriov_funcs' was unused;
It was added in:
Commit: 894c6d3522d1 ("drm/amdgpu: Add nbif v6_3_1 ip block support")

and is:
drivers/gpu/drm/amd/amdgpu/nbif_v6_3_1.c:
const struct amdgpu_nbio_funcs nbif_v6_3_1_sriov_funcs = {

but, it's not referenced, which makes me think it perhaps should be in:
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

I see for 4.3.x there is:
case IP_VERSION(4, 3, 0):
case IP_VERSION(4, 3, 1):

    if (amdgpu_sriov_vf(adev))
      adev->nbio.funcs = &nbio_v4_3_sriov_funcs;
    else
      adev->nbio.funcs = &nbio_v4_3_funcs;
    adev->nbio.hdp_flush_reg = &nbio_v4_3_hdp_flush_reg;
    break;

but for 6.3.1 we have:

Quoted 7 lines
  case IP_VERSION(6, 3, 1):
    adev->nbio.funcs = &nbif_v6_3_1_funcs;
    adev->nbio.hdp_flush_reg = &nbif_v6_3_1_hdp_flush_reg;
    break;

so is that supposed to have something similar?

They can be dropped. I think they were just copy and paste leftovers.

Alex

Quoted 8 lines

Dave

--
-----Open up your eyes, open up your mind, open up your code -------

/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/
#3 lore raw
In reply to Dr. David Alan Gilbert
Quoted 39 lines · Dr. David Alan Gilbert
Quoted 37 lines · * Alex Deucher ([email protected]) wrote:
Quoted 35 lines · Dr. David Alan Gilbert

Hi All,
I think you may be misisng some wiring of nbif_v6_3_1_sriov_funcs.

My scripts noticed 'nbif_v6_3_1_sriov_funcs' was unused;
It was added in:
Commit: 894c6d3522d1 ("drm/amdgpu: Add nbif v6_3_1 ip block support")

and is:
drivers/gpu/drm/amd/amdgpu/nbif_v6_3_1.c:
const struct amdgpu_nbio_funcs nbif_v6_3_1_sriov_funcs = {

but, it's not referenced, which makes me think it perhaps should be in:
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

I see for 4.3.x there is:
case IP_VERSION(4, 3, 0):
case IP_VERSION(4, 3, 1):

    if (amdgpu_sriov_vf(adev))
      adev->nbio.funcs = &nbio_v4_3_sriov_funcs;
    else
      adev->nbio.funcs = &nbio_v4_3_funcs;
    adev->nbio.hdp_flush_reg = &nbio_v4_3_hdp_flush_reg;
    break;

but for 6.3.1 we have:

  case IP_VERSION(6, 3, 1):
    adev->nbio.funcs = &nbif_v6_3_1_funcs;
    adev->nbio.hdp_flush_reg = &nbif_v6_3_1_hdp_flush_reg;
    break;
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

so is that supposed to have something similar?

They can be dropped. I think they were just copy and paste leftovers.

Thanks for the reply.

OK, I'll send a patch then to remove nbif_v6_3_1_sriov_funcs.

Thanks!

Alex

Quoted 18 lines

Dave

Quoted 10 lines

Alex

Quoted 8 lines

Dave

--
-----Open up your eyes, open up your mind, open up your code -------

/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

--
-----Open up your eyes, open up your mind, open up your code -------

/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/
#2 lore raw
In reply to Alex Deucher
Quoted 37 lines · * Alex Deucher ([email protected]) wrote:
Quoted 35 lines · Dr. David Alan Gilbert

Hi All,
I think you may be misisng some wiring of nbif_v6_3_1_sriov_funcs.

My scripts noticed 'nbif_v6_3_1_sriov_funcs' was unused;
It was added in:
Commit: 894c6d3522d1 ("drm/amdgpu: Add nbif v6_3_1 ip block support")

and is:
drivers/gpu/drm/amd/amdgpu/nbif_v6_3_1.c:
const struct amdgpu_nbio_funcs nbif_v6_3_1_sriov_funcs = {

but, it's not referenced, which makes me think it perhaps should be in:
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

I see for 4.3.x there is:
case IP_VERSION(4, 3, 0):
case IP_VERSION(4, 3, 1):

    if (amdgpu_sriov_vf(adev))
      adev->nbio.funcs = &nbio_v4_3_sriov_funcs;
    else
      adev->nbio.funcs = &nbio_v4_3_funcs;
    adev->nbio.hdp_flush_reg = &nbio_v4_3_hdp_flush_reg;
    break;

but for 6.3.1 we have:

  case IP_VERSION(6, 3, 1):
    adev->nbio.funcs = &nbif_v6_3_1_funcs;
    adev->nbio.hdp_flush_reg = &nbif_v6_3_1_hdp_flush_reg;
    break;
Quoted 3 lines
Quoted 1 line

so is that supposed to have something similar?

They can be dropped. I think they were just copy and paste leftovers.

Thanks for the reply.

OK, I'll send a patch then to remove nbif_v6_3_1_sriov_funcs.

Dave

Quoted 10 lines

Alex

Quoted 8 lines

Dave

--
-----Open up your eyes, open up your mind, open up your code -------

/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/
Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/