Linux Power Management development
 help / color / mirror / Atom feed
From: "Sverdlin, Alexander" <alexander.sverdlin@siemens.com>
To: "andrew@lunn.ch" <andrew@lunn.ch>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"sre@kernel.org" <sre@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC] power: reset: restart-poweroff: convert to module
Date: Thu, 22 Feb 2024 07:16:20 +0000	[thread overview]
Message-ID: <35e30e3260f6669b28dcdde6ea58f480eac3db91.camel@siemens.com> (raw)
In-Reply-To: <6964c19f-6ffb-4d9a-bc02-ffaf52aa23b5@lunn.ch>

On Wed, 2024-02-21 at 22:56 +0100, Andrew Lunn wrote:
> > @@ -47,15 +45,8 @@ static const struct of_device_id of_restart_poweroff_match[] = {
> >   };
> >   MODULE_DEVICE_TABLE(of, of_restart_poweroff_match);
> >   
> > -static struct platform_driver restart_poweroff_driver = {
> > -       .probe = restart_poweroff_probe,
> > -       .remove = restart_poweroff_remove,
> > -       .driver = {
> > -               .name = "poweroff-restart",
> > -               .of_match_table = of_restart_poweroff_match,
> > -       },
> > -};
> 
> of_restart_poweroff_match now seems to be disconnected from the
> driver.
> 
> kirkwood-linkstation.dtsi:              compatible = "restart-poweroff";
> kirkwood-lsxl.dtsi:             compatible = "restart-poweroff";
> orion5x-linkstation.dtsi:               compatible = "restart-poweroff";
> orion5x-lswsgl.dts:             compatible = "restart-poweroff";
> 
> How do these devices get this driver loaded?
> 
> This appears to be another reason to NACK it.

That's why MODULE_DEVICE_TABLE() was preserved for backwards compatibility,
because *loading* happens via MODULE_DEVICE_TABLE(). But I didn't realize
it was never buildable as module as Sebastian pointed out, because of
machine_restart().

For your use case it would continue to work as before I believe, just
the callback would be installed because of the fact the code
was compiled-in, not because there was a fake platform device.

I also didn't understand what is so special about bootloader support
for this functionality if no data is passed to the bootloader.
After ARM-specifics was removed from the code quite some time ago
any platform could re-use the code for the deployments which meant
to be "always on".

But If the resistance is so serious, so be it.

-- 
Alexander Sverdlin
Siemens AG
www.siemens.com

  reply	other threads:[~2024-02-22  7:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21 17:46 [PATCH RFC] power: reset: restart-poweroff: convert to module A. Sverdlin
2024-02-21 21:01 ` Sebastian Reichel
2024-02-21 21:56 ` Andrew Lunn
2024-02-22  7:16   ` Sverdlin, Alexander [this message]
2024-02-22 14:44     ` Andrew Lunn
2024-02-21 22:37 ` Andrew Lunn
2024-02-22  7:55   ` Sverdlin, Alexander
2024-02-22 14:55     ` Andrew Lunn

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=35e30e3260f6669b28dcdde6ea58f480eac3db91.camel@siemens.com \
    --to=alexander.sverdlin@siemens.com \
    --cc=andrew@lunn.ch \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox