<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">That is good idea. Will do it.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">thanks,<o:p></o:p></p>
<p class="MsoNormal">Oak<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Deucher, Alexander <br>
<b>Sent:</b> Monday, November 26, 2018 11:02 AM<br>
<b>To:</b> Zeng, Oak <Oak.Zeng@amd.com>; Alex Deucher <alexdeucher@gmail.com><br>
<b>Cc:</b> amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH 5/7] drm/amdgpu: Call doorbell index init on device initialization<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div id="divtagdefaultwrapper">
<p><span style="font-size:12.0pt;color:black">Maybe it would be better to add this as a callback to struct amdgpu_asic_funcs to avoid adding asic specific code to amdgpu_device.c<o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;color:black">Alex<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">amd-gfx-bounces@lists.freedesktop.org</a>> on behalf of Deucher, Alexander <<a href="mailto:Alexander.Deucher@amd.com">Alexander.Deucher@amd.com</a>><br>
<b>Sent:</b> Monday, November 26, 2018 10:59:02 AM<br>
<b>To:</b> Zeng, Oak; Alex Deucher<br>
<b>Cc:</b> <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<b>Subject:</b> Re: [PATCH 5/7] drm/amdgpu: Call doorbell index init on device initialization</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div id="x_divtagdefaultwrapper">
<p><span style="font-size:12.0pt;color:black">Ah, ok.  no problem.<o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;color:black">Alex<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="x_divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">amd-gfx-bounces@lists.freedesktop.org</a>> on behalf of Zeng, Oak <<a href="mailto:Oak.Zeng@amd.com">Oak.Zeng@amd.com</a>><br>
<b>Sent:</b> Monday, November 26, 2018 10:31:04 AM<br>
<b>To:</b> Alex Deucher<br>
<b>Cc:</b> <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<b>Subject:</b> RE: [PATCH 5/7] drm/amdgpu: Call doorbell index init on device initialization</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Yes, that was my first version. But during debug, I found amdgpu_device_doorbell_init uses adev->doorbell_index.max_assignment which is initialized in *_doorbell_index_init. So I have to call *_doorbell_index_init before amdgpu_device_doorbell_init.
 *_set_ip_blocks() is too late.<br>
<br>
In a later version, I moved calling of *_doorbell_index_init to the top of amdgpu_device_doorbell_init.<br>
<br>
thanks,<br>
Oak<br>
<br>
-----Original Message-----<br>
From: Alex Deucher <<a href="mailto:alexdeucher@gmail.com">alexdeucher@gmail.com</a>>
<br>
Sent: Sunday, November 25, 2018 1:43 PM<br>
To: Zeng, Oak <<a href="mailto:Oak.Zeng@amd.com">Oak.Zeng@amd.com</a>><br>
Subject: Fwd: [PATCH 5/7] drm/amdgpu: Call doorbell index init on device initialization<br>
<br>
---------- Forwarded message ---------<br>
From: Alex Deucher <<a href="mailto:alexdeucher@gmail.com">alexdeucher@gmail.com</a>><br>
Date: Wed, Nov 21, 2018 at 11:21 AM<br>
Subject: Re: [PATCH 5/7] drm/amdgpu: Call doorbell index init on device initialization<br>
To: <<a href="mailto:ozeng@amd.com">ozeng@amd.com</a>><br>
Cc: amd-gfx list <<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>>, Oak Zeng <<a href="mailto:Oak.Zeng@amd.com">Oak.Zeng@amd.com</a>><br>
<br>
<br>
On Wed, Nov 21, 2018 at 10:52 AM Oak Zeng <<a href="mailto:ozeng@amd.com">ozeng@amd.com</a>> wrote:<br>
><br>
> Change-Id: I2f004bbbe2565035460686f4fc16e86b77a2a9b5<br>
> Signed-off-by: Oak Zeng <<a href="mailto:ozeng@amd.com">ozeng@amd.com</a>><br>
> Suggested-by: Felix Kuehling <<a href="mailto:Felix.Kuehling@amd.com">Felix.Kuehling@amd.com</a>><br>
> Suggested-by: Alex Deucher <<a href="mailto:alexander.deucher@amd.com">alexander.deucher@amd.com</a>><br>
<br>
I think it would be cleaner to add this to the *_set_ip_blocks() functions in cik.c, vi.c, and soc15.c so it aligns with the<br>
*_reg_base_init() calls.<br>
<br>
Alex<br>
<br>
> ---<br>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++<br>
>  1 file changed, 7 insertions(+)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c <br>
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> index cb06e68..a942a88 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> @@ -513,6 +513,13 @@ void amdgpu_device_pci_config_reset(struct amdgpu_device *adev)<br>
>   */<br>
>  static int amdgpu_device_doorbell_init(struct amdgpu_device *adev)  {<br>
> +       if (adev->asic_type < CHIP_VEGA10)<br>
> +               vi_doorbell_index_init(adev);<br>
> +       else if (adev->asic_type == CHIP_VEGA10)<br>
> +               vega10_doorbell_index_init(adev);<br>
> +       else<br>
> +               vega12_doorbell_index_init(adev);<br>
> +<br>
>         /* No doorbell on SI hardware generation */<br>
>         if (adev->asic_type < CHIP_BONAIRE) {<br>
>                 adev->doorbell.base = 0;<br>
> --<br>
> 2.7.4<br>
><br>
> _______________________________________________<br>
> amd-gfx mailing list<br>
> <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
_______________________________________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>