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: <e5c5a44c84b95c4e48ed01c4dcffd35a@agner.ch>
Date:	Mon, 01 Dec 2014 18:24:37 +0100
From:	Stefan Agner <stefan@...er.ch>
To:	Mark Rutland <mark.rutland@....com>
Cc:	shawn.guo@...aro.org, kernel@...gutronix.de, linux@...ck-us.net,
	arnd@...db.de, sre@...nel.org, fkan@....com,
	grant.likely@...aro.org, robh+dt@...nel.org, dbaryshkov@...il.com,
	dwmw2@...radead.org, devicetree@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/3] power: reset: read priority from device tree

On 2014-12-01 18:11, Mark Rutland wrote:
> On Mon, Dec 01, 2014 at 05:03:07PM +0000, Stefan Agner wrote:
>> This patch adds an optional property which allows to specify the
>> reset source priority. This priority is used by the kernel restart
>> handler call chain to sort out the proper reset/restart method.
>> Depending on the power design of a board or other machine/board
>> specific peculiarity, it is not possible to pick a generic priority.
>>
>> Signed-off-by: Stefan Agner <stefan@...er.ch>
>> ---
>>  Documentation/devicetree/bindings/power/reset/syscon-reboot.txt | 3 +++
>>  drivers/power/reset/syscon-reboot.c                             | 5 ++++-
>>  2 files changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot.txt b/Documentation/devicetree/bindings/power/reset/syscon-reboot.txt
>> index 1190631..ee41d9c 100644
>> --- a/Documentation/devicetree/bindings/power/reset/syscon-reboot.txt
>> +++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot.txt
>> @@ -11,6 +11,9 @@ Required properties:
>>  - offset: offset in the register map for the reboot register (in bytes)
>>  - mask: the reset value written to the reboot register (32 bit access)
>>
>> +Optional properties:
>> +- priority: define the priority of the reset (0-255, defaults to 128)
>> +
> 
> NAK. This is a leak of Linux-internal details.
> 
> What is this necessary for?
> 
> Mark.

Hi Mark,

In my case, it is necessary to be called ahead of the watchdog, which
has a priority of 128. This syscon-reboot driver currently has a default
priority of 128 too. I could live with a higher default priority for the
syscon-reboot driver, in fact I proposed that in the discussion of v1 of
that patch:
https://lkml.org/lkml/2014/11/28/484

IMHO, this priority might make sense for most cases, I guess that
dedicated "syscon" capabilities are usually better suited as a reboot
source than watchdog.

If dt, then the question which arises: If there are different
capabilities to reset/reboot a whole system, how do we reflect which is
the best suited one in dt?

--
Stefan

> 
>>  Default will be little endian mode, 32 bit access only.
>>
>>  Examples:
>> diff --git a/drivers/power/reset/syscon-reboot.c b/drivers/power/reset/syscon-reboot.c
>> index 815b901..3060d6b 100644
>> --- a/drivers/power/reset/syscon-reboot.c
>> +++ b/drivers/power/reset/syscon-reboot.c
>> @@ -67,8 +67,11 @@ static int syscon_reboot_probe(struct platform_device *pdev)
>>  	if (of_property_read_u32(pdev->dev.of_node, "mask", &ctx->mask))
>>  		return -EINVAL;
>>
>> -	ctx->restart_handler.notifier_call = syscon_restart_handle;
>>  	ctx->restart_handler.priority = 128;
>> +	of_property_read_u32(pdev->dev.of_node, "priority",
>> +			     &ctx->restart_handler.priority);
>> +
>> +	ctx->restart_handler.notifier_call = syscon_restart_handle;
>>  	err = register_restart_handler(&ctx->restart_handler);
>>  	if (err)
>>  		dev_err(dev, "can't register restart notifier (err=%d)\n", err);
>> --
>> 2.1.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe devicetree" in
>> the body of a message to majordomo@...r.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ