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] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <OS8PR06MB7541E77E1EA78D658E5444A6F2C32@OS8PR06MB7541.apcprd06.prod.outlook.com>
Date: Tue, 25 Feb 2025 02:20:25 +0000
From: Ryan Chen <ryan_chen@...eedtech.com>
To: Philipp Zabel <p.zabel@...gutronix.de>, Krzysztof Kozlowski
	<krzk@...nel.org>, Michael Turquette <mturquette@...libre.com>, Stephen Boyd
	<sboyd@...nel.org>, Joel Stanley <joel@....id.au>, Andrew Jeffery
	<andrew@...id.au>, Rob Herring <robh@...nel.org>, Krzysztof Kozlowski
	<krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
	"linux-clk@...r.kernel.org" <linux-clk@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-aspeed@...ts.ozlabs.org"
	<linux-aspeed@...ts.ozlabs.org>, "devicetree@...r.kernel.org"
	<devicetree@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v9 2/3] reset: aspeed: register AST2700 reset auxiliary
 bus device

> Subject: Re: [PATCH v9 2/3] reset: aspeed: register AST2700 reset auxiliary bus
> device
> 
> On Mo, 2025-02-24 at 11:15 +0100, Krzysztof Kozlowski wrote:
> > On 24/02/2025 11:12, Krzysztof Kozlowski wrote:
> > > On 24/02/2025 10:55, Ryan Chen wrote:
> > > > +
> > > > +static void aspeed_reset_unregister_adev(void *_adev) {
> > > > +	struct auxiliary_device *adev = _adev;
> > > > +
> > > > +	auxiliary_device_delete(adev);
> > > > +	auxiliary_device_uninit(adev);
> > > > +}
> > > > +
> > > > +static void aspeed_reset_adev_release(struct device *dev) {
> > > > +	struct auxiliary_device *adev = to_auxiliary_dev(dev);
> > > > +
> > > > +	kfree(adev);
> > > > +}
> > > > +
> > >
> > > Every exported function *must* have kerneldoc.
> > >
> > > > +int aspeed_reset_controller_register(struct device *clk_dev, void
> __iomem *base,
> > > > +				     const char *adev_name)
> > > > +{
> > > > +	struct auxiliary_device *adev;
> > > > +	int ret;
> > > > +
> > > > +	adev = kzalloc(sizeof(*adev), GFP_KERNEL);
> > > > +	if (!adev)
> > > > +		return -ENOMEM;
> > > > +
> > > > +	adev->name = adev_name;
> > > > +	adev->dev.parent = clk_dev;
> > > > +	adev->dev.release = aspeed_reset_adev_release;
> > > > +	adev->id = 666u;
> > > > +
> > > > +	ret = auxiliary_device_init(adev);
> > > > +	if (ret) {
> > > > +		kfree(adev);
> > > > +		return ret;
> > > > +	}
> > > > +
> > > > +	ret = auxiliary_device_add(adev);
> > > > +	if (ret) {
> > > > +		auxiliary_device_uninit(adev);
> > > > +		return ret;
> > > > +	}
> > > > +
> > > > +	adev->dev.platform_data = (__force void *)base;
> > > > +
> > > > +	return devm_add_action_or_reset(clk_dev,
> > > > +aspeed_reset_unregister_adev, adev); }
> > > > +EXPORT_SYMBOL_GPL(aspeed_reset_controller_register);
> > >
> > > No, you cannot export functions without users. There is no single
> > > user of this, so this is not justified at all.
> > My mistake, I missed patch #3 which uses it.
> >
> > I don't get why do you need to export this in the first place, instead
> > of putting it in the clock driver, as usually expected. Handling child
> > creation is logically the task of the device having children, the
> > parent. Not the child.
> 
> Also, consider basing this on top of:
> 
> https://lore.kernel.org/all/20250218-aux-device-create-helper-v4-0-c3d7dfdea
> 2e6@...libre.com/

Hello, Base on this series, I will use adev = devm_auxiliary_device_create instead addev_alloc, adev_releas.
But it still have EXPORT_SYMBOL_GPL(aspeed_reset_controller_register);
Am I right?

> regards
> Philipp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ