<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>sure, I will add the delay to io_wreg.<br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Deucher, Alexander<br>
<b>Sent:</b> Tuesday, July 4, 2017 12:47:38 PM<br>
<b>To:</b> Wang, Ken; amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Wang, Ken<br>
<b>Subject:</b> RE: [PATCH] drm/amdgpu: fix S3 failure on specific platform</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">> -----Original Message-----<br>
> From: amd-gfx [<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">mailto:amd-gfx-bounces@lists.freedesktop.org</a>] On Behalf<br>
> Of Ken Wang<br>
> Sent: Tuesday, July 04, 2017 12:26 AM<br>
> To: amd-gfx@lists.freedesktop.org<br>
> Cc: Wang, Ken<br>
> Subject: [PATCH] drm/amdgpu: fix S3 failure on specific platform<br>
> <br>
> Change-Id: Ie932508ad6949f8bfc7c8db1f5874d3440d09fc6<br>
> Signed-off-by: Ken Wang <Qingqing.Wang@amd.com><br>
<br>
Do we need to add this to the io_rreg and io_wreg functions as well?  Atom uses them for IIO tables.  Might also want to give a brief description of the problem.  Something like:<br>
Certain MC registers need a delay after writing them to properly update in the init sequence.<br>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
<br>
> ---<br>
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h        | 3 +++<br>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++++++<br>
>  2 files changed, 11 insertions(+)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> index ecc33c4..54c30fe 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> @@ -1702,6 +1702,9 @@ struct amdgpu_device {<br>
>        /* record hw reset is performed */<br>
>        bool has_hw_reset;<br>
> <br>
> +     /* record last mm index being written through WREG32*/<br>
> +     unsigned long last_mm_index;<br>
> +<br>
>  };<br>
> <br>
>  static inline struct amdgpu_device *amdgpu_ttm_adev(struct<br>
> ttm_bo_device *bdev)<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> index 21e504a..24b908c 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> @@ -124,6 +124,10 @@ void amdgpu_mm_wreg(struct amdgpu_device<br>
> *adev, uint32_t reg, uint32_t v,<br>
>  {<br>
>        trace_amdgpu_mm_wreg(adev->pdev->device, reg, v);<br>
> <br>
> +     if (adev->asic_type >= CHIP_VEGA10 && reg == 0) {<br>
> +             adev->last_mm_index = v;<br>
> +     }<br>
> +<br>
>        if (!(acc_flags & AMDGPU_REGS_NO_KIQ) &&<br>
> amdgpu_sriov_runtime(adev)) {<br>
>                BUG_ON(in_interrupt());<br>
>                return amdgpu_virt_kiq_wreg(adev, reg, v);<br>
> @@ -139,6 +143,10 @@ void amdgpu_mm_wreg(struct amdgpu_device<br>
> *adev, uint32_t reg, uint32_t v,<br>
>                writel(v, ((void __iomem *)adev->rmmio) + (mmMM_DATA<br>
> * 4));<br>
>                spin_unlock_irqrestore(&adev->mmio_idx_lock, flags);<br>
>        }<br>
> +<br>
> +     if (adev->asic_type >= CHIP_VEGA10 && reg == 1 && adev-<br>
> >last_mm_index == 0x5702C) {<br>
> +             udelay(500);<br>
> +     }<br>
>  }<br>
> <br>
>  u32 amdgpu_io_rreg(struct amdgpu_device *adev, u32 reg)<br>
> --<br>
> 2.7.4<br>
> <br>
> _______________________________________________<br>
> amd-gfx mailing list<br>
> amd-gfx@lists.freedesktop.org<br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font>
</body>
</html>