lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <sauwnl3nyyzgyop2qskjrczjgoog4jnjkkhwjf4ofwrthatvzk@2a5rb3vsf75z>
Date: Tue, 4 Nov 2025 12:23:52 +0100
From: Uwe Kleine-König <ukleinek@...nel.org>
To: Krzysztof Kozlowski <krzk@...nel.org>
Cc: Martyn Welch <martyn.welch@...labora.com>, kernel@...labora.com, 
	Sebastian Reichel <sebastian.reichel@...labora.com>, linux-pwm@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>, 
	devicetree@...r.kernel.org
Subject: Re: [PATCH] pwm: rz-mtu3: Share parent device node to MTU3 PWM

Hello,

On Tue, Oct 21, 2025 at 12:47:52PM +0200, Krzysztof Kozlowski wrote:
> On 21/10/2025 12:19, Uwe Kleine-König wrote:
> >> diff --git a/drivers/pwm/pwm-rz-mtu3.c b/drivers/pwm/pwm-rz-mtu3.c
> >> index ab39bd37edafc..5825875fa0128 100644
> >> --- a/drivers/pwm/pwm-rz-mtu3.c
> >> +++ b/drivers/pwm/pwm-rz-mtu3.c
> >> @@ -523,6 +523,12 @@ static int rz_mtu3_pwm_probe(struct platform_device *pdev)
> >>  	if (ret < 0)
> >>  		return ret;
> >>  
> >> +	/*
> >> +	 * There is only one DT node, get it from the parent MFD device, so
> >> +	 * that the PWM channels can be referenced via phandles
> >> +	 */
> >> +	dev->of_node = dev->parent->of_node;
> >> +
> > 
> > I (very quickly) talked to Krzysztof about this. He said that
> > of_node_get() should probably be used here. I wonder if
> > device_add_of_node() is the right function to use (which uses
> > of_node_get(), also handles fwnode and implements some safeguards).
> 
> 
> I am not so sure about device_add_of_node(). You do not need to
> get_device(), because reference is already hold. Although setting
> dev->fwnode might make sense... But, not that important I think, works
> with me.

Note that device_add_of_node() only holds the get_device() reference
temporarily as it calls put_device() before returning. So that's only to
assert that the device doesn't disappear in-flight. That "locking" might
not be needed here, but it also doesn't do any harm (apart from a minor
runtime overhead).

Best regards
Uwe

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ