All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Sven Peter <sven@kernel.org>
Cc: Nick Chan <towinchenmi@gmail.com>,
	asahi@lists.linux.dev, Neal Gompa <neal@gompa.dev>,
	linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
	Hector Martin <marcan@marcan.st>,
	Conor Dooley <conor+dt@kernel.org>, Janne Grunau <j@jannau.net>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	Sebastian Reichel <sre@kernel.org>,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Marc Zyngier <maz@kernel.org>
Subject: Re: [PATCH v7 07/10] power: reset: macsmc-reboot: Add driver for rebooting via Apple SMC
Date: Wed, 23 Jul 2025 09:06:15 +0100	[thread overview]
Message-ID: <20250723080615.GM11056@google.com> (raw)
In-Reply-To: <d6b778ee-02c0-4dd2-b33f-cec16c17807c@kernel.org>

On Sat, 21 Jun 2025, Sven Peter wrote:

> On 16.06.25 06:13, Nick Chan wrote:
> > 
> > 
> > On 10/6/2025 23:29, Sven Peter wrote:
> > > From: Hector Martin <marcan@marcan.st>
> > > 
> > > This driver implements the reboot/shutdown support exposed by the SMC
> > > on Apple Silicon machines, such as Apple M1 Macs.
> > > 
> > > Signed-off-by: Hector Martin <marcan@marcan.st>
> > > Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
> > > Reviewed-by: Neal Gompa <neal@gompa.dev>
> > > Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> > > Signed-off-by: Sven Peter <sven@kernel.org>
> > > ---
> > >   MAINTAINERS                         |   1 +
> > >   drivers/power/reset/Kconfig         |   9 ++
> > >   drivers/power/reset/Makefile        |   1 +
> > >   drivers/power/reset/macsmc-reboot.c | 290 ++++++++++++++++++++++++++++++++++++
> > >   4 files changed, 301 insertions(+)
> > [...]
> > 
> > It seems that the reboot driver still probes even without the smc_reboot node in the smc node:
> 
> 
> That's odd...
> 
> Lee, is it expected that a mfd sub-device declared with
> MFD_CELL_OF("macsmc-reboot", NULL, NULL, 0, 0, "apple,smc-reboot"),
> is loaded even if there's no corresponding node in the device tree?
> 
> I'll have to re-add the check that makes sure the sub-device is available
> then.

Yes, that's expected.  MFD is orthogonal to DT with respect to device
registration, unless you specifically disable the node in DT.  If the
node is missing, the device will still be registered, but no link will
be made from the (non-existent) node to the 'of_node' pointer.

You have 3 choices; provide a DT node and explicitly set the status to
'disabled', optionally omit registration from MFD (i.e. do not call
mfd_add_devices()) or check for (!pdev->dev.of_node) in the sub-device's
.probe() and bomb out early if true.

-- 
Lee Jones [李琼斯]

  reply	other threads:[~2025-07-23  8:06 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10 15:29 [PATCH v7 00/10] Apple Mac System Management Controller Sven Peter
2025-06-10 15:29 ` [PATCH v7 01/10] dt-bindings: gpio: Add Apple Mac SMC GPIO block Sven Peter
2025-06-10 15:29 ` [PATCH v7 02/10] dt-bindings: power: reboot: Add Apple Mac SMC Reboot Controller Sven Peter
2025-06-10 15:29 ` [PATCH v7 03/10] dt-bindings: mfd: Add Apple Mac System Management Controller Sven Peter
2025-06-10 15:29 ` [PATCH v7 04/10] soc: apple: rtkit: Make shmem_destroy optional Sven Peter
2025-06-10 15:29 ` [PATCH v7 05/10] mfd: Add Apple Silicon System Management Controller Sven Peter
2025-06-11 14:22   ` kernel test robot
2025-06-19 11:49   ` Lee Jones
2025-06-21 15:51     ` Sven Peter
2025-06-22  0:50       ` Sebastian Reichel
2025-06-24 15:53       ` Lee Jones
2025-07-19 12:57         ` Sven Peter
2025-06-10 15:29 ` [PATCH v7 06/10] gpio: Add new gpio-macsmc driver for Apple Macs Sven Peter
2025-07-19 12:59   ` Sven Peter
2025-07-19 15:41     ` Linus Walleij
2025-07-19 15:52       ` Bartosz Golaszewski
2025-07-20 12:11         ` Sven Peter
2025-06-10 15:29 ` [PATCH v7 07/10] power: reset: macsmc-reboot: Add driver for rebooting via Apple SMC Sven Peter
2025-06-16  4:13   ` Nick Chan
2025-06-21 15:47     ` Sven Peter
2025-07-23  8:06       ` Lee Jones [this message]
2025-07-23  8:09         ` Lee Jones
2025-07-24  6:08         ` Sven Peter
2025-06-10 15:29 ` [PATCH v7 08/10] arm64: dts: apple: t8103: Add SMC node Sven Peter
2025-06-10 15:29 ` [PATCH v7 09/10] arm64: dts: apple: t8112: " Sven Peter
2025-06-10 15:29 ` [PATCH v7 10/10] arm64: dts: apple: t600x: " Sven Peter
2025-07-19 12:54 ` (subset) [PATCH v7 00/10] Apple Mac System Management Controller Sven Peter
2025-07-24  8:48 ` Lee Jones
2025-07-24 10:25 ` [GIT PULL] Immutable branch between MFD, GPIO, Power and SoC due for the v6.17 merge window Lee Jones
2025-08-10 18:25 ` (subset) [PATCH v7 00/10] Apple Mac System Management Controller Sven Peter

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=20250723080615.GM11056@google.com \
    --to=lee@kernel.org \
    --cc=alyssa@rosenzweig.io \
    --cc=asahi@lists.linux.dev \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=j@jannau.net \
    --cc=krzk+dt@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=maz@kernel.org \
    --cc=neal@gompa.dev \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=robh@kernel.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=sre@kernel.org \
    --cc=sven@kernel.org \
    --cc=towinchenmi@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 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.