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]
Date:	Fri, 19 Sep 2014 10:19:20 -0500
From:	Josh Cartwright <joshc@...eaurora.org>
To:	Guenter Roeck <linux@...ck-us.net>
Cc:	Bjorn Andersson <bjorn.andersson@...ymobile.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-arm-msm@...r.kernel.org,
	Pramod Gurav <pramod.gurav@...rtplayin.com>
Subject: Re: [PATCH] pinctrl: qcom: use restart_notifier mechanism for ps_hold

On Thu, Sep 18, 2014 at 08:34:41PM -0700, Guenter Roeck wrote:
> On 09/18/2014 07:54 PM, Guenter Roeck wrote:
> >On 09/18/2014 03:32 PM, Josh Cartwright wrote:
> >>By converting to the restart_notifier mechanism for restart, we allow
> >>for other mechanisms, like the watchdog, to be used for restart in the
> >>case where PS_HOLD has failed to reset the chip.
> >>
> >>Choose priority 128, as according to documentation, this mechanism "is
> >>sufficient to restart the entire system".
> >>
> >>Cc: Pramod Gurav <pramod.gurav@...rtplayin.com>
> >>Cc: Guenter Roeck <linux@...ck-us.net>
> >>Signed-off-by: Josh Cartwright <joshc@...eaurora.org>
> >>---
[..]
> >>  int msm_pinctrl_probe(struct platform_device *pdev,
> >>                const struct msm_pinctrl_soc_data *soc_data)
> >>@@ -943,6 +948,15 @@ int msm_pinctrl_remove(struct platform_device *pdev)
> >>
> >>      pinctrl_unregister(pctrl->pctrl);
> >>
> >>+    if (pctrl->restart_nb.notifier_call) {
>
> One more comment: The conditional is really unnecessary. Just let
> unregister_restart_handler deal with it ...
>
> >>+        ret = unregister_restart_handler(&pctrl->restart_nb);
> 
> and just ignore the error return. The function will only return an error
> if the entry was not found, and then it is a don't care.

Awesome, thanks.  I like simplifications :).  I was hijacking
notifier_call to indicate whether or not the restart notifier was
registered at all (because it's conditional on the particular chipset
having a "ps_hold" function).  But, nice to know
unregister_restart_handler() does the right thing if the handler wasn't
registered in the first place.

  Josh

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
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