From: Aaron Kling <webgeek1234@gmail.com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: "Thomas Gleixner" <tglx@linutronix.de>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Thierry Reding" <thierry.reding@gmail.com>,
"Jonathan Hunter" <jonathanh@nvidia.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Daniel Lezcano" <daniel.lezcano@linaro.org>,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH v4 4/4] PCI: tegra: Drop unused remove callback
Date: Sun, 11 May 2025 09:53:05 -0500 [thread overview]
Message-ID: <CALHNRZ84EmZ3reCns9c4s1DavZLYsPvdNtm0wstAiF-CbD=d4w@mail.gmail.com> (raw)
In-Reply-To: <nsldcdzdf7xazzm3dlb4jrjkehgt3hjlar7uc62twpkwocrer3@u5kirzyify4n>
On Sat, May 10, 2025 at 1:24 AM Manivannan Sadhasivam
<manivannan.sadhasivam@linaro.org> wrote:
>
> On Mon, May 05, 2025 at 11:59:27AM -0500, Aaron Kling wrote:
> > On Mon, May 5, 2025 at 11:48 AM Manivannan Sadhasivam
> > <manivannan.sadhasivam@linaro.org> wrote:
> > >
> > > On Mon, May 05, 2025 at 11:43:26AM -0500, Aaron Kling wrote:
> > > > On Mon, May 5, 2025 at 11:32 AM Manivannan Sadhasivam
> > > > <manivannan.sadhasivam@linaro.org> wrote:
> > > > >
> > > > > On Mon, May 05, 2025 at 09:59:01AM -0500, Aaron Kling via B4 Relay wrote:
> > > > > > From: Aaron Kling <webgeek1234@gmail.com>
> > > > > >
> > > > > > Debugfs cleanup is moved to a new shutdown callback to ensure the
> > > > > > debugfs nodes are properly cleaned up on shutdown and reboot.
> > > > > >
> > > > >
> > > > > Both are separate changes. You should remove the .remove() callback in the
> > > > > previous patch itself and add .shutdown() callback in this patch.
> > > > >
> > > > > And the shutdown callback should quiesce the device by putting it in L2/L3 state
> > > > > and turn off the supplies. It is not intended to perform resource cleanup.
> > > >
> > > > Then where would resource cleanup go?
> > > >
> > >
> > > .remove(), but it is not useful here since the driver is not getting removed.
> >
> > I may be misunderstanding how stuff works, but don't those resources
> > still need cleaned up on shutdown/reboot even if the driver can't be
> > unloaded? I recall seeing shutdown errors in the past when higher
> > level debugfs nodes tried to clean themselves up, but bad drivers had
> > left their nodes behind.
> >
>
> Each callback has its own purpose. The cleanup is only performed by the
> .remove() callback, but it will only get called when the driver gets removed.
>
> > In any case, do you want me to just not add .shutdown() at all, or try
> > to set the proper power state? Prior to the half-baked attempt to make
> > this driver a loadable module several years ago, there was no such
> > cleanup.
> >
>
> As a first step, you can ignore .shutdown() callback and just remove the
> .remove(). Shutdown callback implementation should follow the steps I mentioned
> above, so it can be done later.
This has already been done in v6 [0].
Sincerely,
Aaron
[0] https://lore.kernel.org/r/20250507-pci-tegra-module-v6-0-5fe363eaa302@gmail.com
prev parent reply other threads:[~2025-05-11 14:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-05 14:58 [PATCH v4 0/4] PCI: tegra: Allow building as a module Aaron Kling via B4 Relay
2025-05-05 14:58 ` [PATCH v4 1/4] irqdomain: Export irq_domain_free_irqs Aaron Kling via B4 Relay
2025-05-05 22:33 ` Thomas Gleixner
2025-05-05 14:58 ` [PATCH v4 2/4] cpuidle: tegra: Export tegra_cpuidle_pcie_irqs_in_use Aaron Kling via B4 Relay
2025-05-05 14:59 ` [PATCH v4 3/4] PCI: tegra: Allow building as a module Aaron Kling via B4 Relay
2025-05-05 14:59 ` [PATCH v4 4/4] PCI: tegra: Drop unused remove callback Aaron Kling via B4 Relay
2025-05-05 16:31 ` Manivannan Sadhasivam
2025-05-05 16:43 ` Aaron Kling
2025-05-05 16:48 ` Manivannan Sadhasivam
2025-05-05 16:59 ` Aaron Kling
2025-05-10 6:24 ` Manivannan Sadhasivam
2025-05-11 14:53 ` Aaron Kling [this message]
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='CALHNRZ84EmZ3reCns9c4s1DavZLYsPvdNtm0wstAiF-CbD=d4w@mail.gmail.com' \
--to=webgeek1234@gmail.com \
--cc=bhelgaas@google.com \
--cc=daniel.lezcano@linaro.org \
--cc=jonathanh@nvidia.com \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=tglx@linutronix.de \
--cc=thierry.reding@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).