All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Mario Limonciello" <superm1@kernel.org>,
	"Christian König" <christian.koenig@amd.com>,
	alexander.deucher@amd.com, "Borislav Petkov" <bp@alien8.de>,
	amd-gfx@lists.freedesktop.org
Subject: Re: amdgpu vs kexec
Date: Thu, 19 Jun 2025 07:55:12 +0800	[thread overview]
Message-ID: <aFNR4E/4CR1b/MsG@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20250618091232.GD1613633@noisy.programming.kicks-ass.net>

On 06/18/25 at 11:12am, Peter Zijlstra wrote:
> On Wed, Jun 18, 2025 at 10:51:23AM +0200, Peter Zijlstra wrote:
> > On Tue, Jun 17, 2025 at 09:12:12PM -0500, Mario Limonciello wrote:
> > 
> > > How about if we reset before the kexec?  There is a symbol for drivers to
> > > use to know they're about to go through kexec to do $THINGS.
> > > 
> > > Something like this:
> > > 
> > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > > index 0fc0eeedc6461..2b1216b14d618 100644
> > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > > @@ -34,6 +34,7 @@
> > > 
> > >  #include <linux/cc_platform.h>
> > >  #include <linux/dynamic_debug.h>
> > > +#include <linux/kexec.h>
> > >  #include <linux/module.h>
> > >  #include <linux/mmu_notifier.h>
> > >  #include <linux/pm_runtime.h>
> > > @@ -2544,6 +2545,9 @@ amdgpu_pci_shutdown(struct pci_dev *pdev)
> > >                 adev->mp1_state = PP_MP1_STATE_UNLOAD;
> > >         amdgpu_device_ip_suspend(adev);
> > >         adev->mp1_state = PP_MP1_STATE_NONE;
> > > +
> > > +       if (kexec_in_progress)
> > > +               amdgpu_asic_reset(adev);
> > >  }
> > > 
> > >  static int amdgpu_pmops_prepare(struct device *dev)
> > 
> > I will throw this in the dev kernel... I'll let you know.
> 
> First hurdle appears to be that this symbol is not exported. I fixed
> that, but perhaps the kexec folks don't like drivers to use this?

I can't find the original mail of this thread, while we don't have a
known restriction about that afaik.


  parent reply	other threads:[~2025-06-19 14:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16  9:39 amdgpu vs kexec Peter Zijlstra
2025-06-16 11:51 ` Christian König
2025-06-16 14:54   ` Peter Zijlstra
2025-06-18  2:12     ` Mario Limonciello
2025-06-18  8:51       ` Peter Zijlstra
2025-06-18  9:05         ` Christian König
2025-06-18 13:34           ` Mario Limonciello
2025-06-18 13:46             ` Alex Deucher
2025-06-18  9:12         ` Peter Zijlstra
2025-06-18  9:26           ` Peter Zijlstra
2025-06-18 13:35             ` Mario Limonciello
2025-06-20 10:39             ` Lazar, Lijo
2025-06-18 23:55           ` Baoquan He [this message]
2025-06-19 13:32             ` Mario Limonciello
2025-06-16 14:02 ` Lazar, Lijo

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=aFNR4E/4CR1b/MsG@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bp@alien8.de \
    --cc=christian.koenig@amd.com \
    --cc=peterz@infradead.org \
    --cc=superm1@kernel.org \
    /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.