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:   Sat, 4 Apr 2020 12:00:18 +1100
From:   Evan Benn <evanbenn@...omium.org>
To:     Julius Werner <jwerner@...omium.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Xingyu Chen <xingyu.chen@...ogic.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Anson Huang <Anson.Huang@....com>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Catalin Marinas <catalin.marinas@....com>,
        "David S. Miller" <davem@...emloft.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Guenter Roeck <linux@...ck-us.net>,
        Jonathan Cameron <Jonathan.Cameron@...wei.com>,
        Leonard Crestez <leonard.crestez@....com>,
        Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
        Marcin Juszkiewicz <marcin.juszkiewicz@...aro.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
        Olof Johansson <olof@...om.net>, Rob Herring <robh@...nel.org>,
        Shawn Guo <shawnguo@...nel.org>,
        Valentin Schneider <valentin.schneider@....com>,
        Vinod Koul <vkoul@...nel.org>, Will Deacon <will@...nel.org>,
        Wim Van Sebroeck <wim@...ux-watchdog.org>,
        "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 
        <linux-arm-kernel@...ts.infradead.org>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-mediatek@...ts.infradead.org>,
        LINUX-WATCHDOG <linux-watchdog@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] watchdog: Add new arm_smd_wdt watchdog driver

On Sat, Apr 4, 2020 at 9:56 AM Julius Werner <jwerner@...omium.org> wrote:
>
> > +       wdd->info = &smcwd_info;
> > +       /* get_timeleft is optional */
> > +       if (smcwd_call(SMCWD_GET_TIMELEFT, 0, NULL))
>
> How is this supposed to work? A firmware that implements this call
> would return the time left here which may not be 0 (maybe the watchdog
> was already primed by the bootloader or whatever), so smcwd_call()
> would interpret it as an error.
>
> I think the cleanest solution would be to stick to the same return
> codes in a0 and use a1 to report the time left when a0 is
> PSCI_SUCCESS. This is more consistent with SMCWD_INIT too.

Yes you are right, I have the wrong return code in the get_timeleft
implementation. It should use ->a1 for the actual timeleft, a0 is for
the error code.

Here smcwd_call returns the error code, which is NOT_IMPLEMENTED if
the firmware does not implement timeleft. The timeleft itself cannot
return error codes else we would just return that there I guess.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ