All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>,
	 "Deucher, Alexander" <alexander.deucher@amd.com>
Subject: Re: [PATCH 2/2] drm/amdgpu: Fix resume failures when device is gone
Date: Mon, 20 Sep 2021 12:12:10 -0400	[thread overview]
Message-ID: <CADnq5_P+Jd1FjfbbgiAnL=eY-LCf0zeJS0PAUjiNCpN1SRazVw@mail.gmail.com> (raw)
In-Reply-To: <20210917113045.22194-2-andrey.grodzovsky@amd.com>

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

On Fri, Sep 17, 2021 at 7:31 AM Andrey Grodzovsky
<andrey.grodzovsky@amd.com> wrote:
>
> Problem:
> When device goes into suspend and unplugged during it
> then all HW programming during resume fails leading
> to a bad SW during pci remove handling which follows.
> Because device is first resumed and only later removed
> we cannot rely on drm_dev_enter/exit here.
>
> Fix:
> Use a flag we use for PCIe error recovery to avoid
> accessing registres. This allows to successfully complete
> pm resume sequence and finish pci remove.
>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index db21af5e84ed..04fb4e74fb20 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -1522,6 +1522,10 @@ static int amdgpu_pmops_resume(struct device *dev)
>         struct amdgpu_device *adev = drm_to_adev(drm_dev);
>         int r;
>
> +       /* Avoids registers access if device is physically gone */
> +       if (!pci_device_is_present(adev->pdev))
> +               adev->no_hw_access = true;
> +
>         r = amdgpu_device_resume(drm_dev, true);
>         if (amdgpu_acpi_is_s0ix_active(adev))
>                 adev->in_s0ix = false;
> --
> 2.25.1
>

  parent reply	other threads:[~2021-09-20 16:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 11:30 [PATCH 1/2] drm/amdgpu: Fix MMIO access page fault Andrey Grodzovsky
2021-09-17 11:30 ` [PATCH 2/2] drm/amdgpu: Fix resume failures when device is gone Andrey Grodzovsky
2021-09-17 20:50   ` Andrey Grodzovsky
2021-09-20 16:12   ` Alex Deucher [this message]
2021-09-17 12:00 ` [PATCH 1/2] drm/amdgpu: Fix MMIO access page fault James Zhu
2021-09-17 12:04   ` James Zhu
2021-09-17 14:06     ` Andrey Grodzovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADnq5_P+Jd1FjfbbgiAnL=eY-LCf0zeJS0PAUjiNCpN1SRazVw@mail.gmail.com' \
    --to=alexdeucher@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andrey.grodzovsky@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.