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]
Date:	Mon, 18 Jul 2011 10:44:09 +0100
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Wim Van Sebroeck <wim@...ana.be>
Cc:	Nick Bowler <nbowler@...iptictech.com>,
	linux-watchdog@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/3] SP805 updates for Versatile Express

On Fri, Jul 15, 2011 at 10:59:54PM +0200, Wim Van Sebroeck wrote:
> Hi Nick,
> 
> > Here are some updates to get the SP805 watchdog working on the ARM
> > Versatile Express.  The first two patches fix observed issues; the
> > third fixes a potential (but not observed) issue with asynchronous
> > posted writes.
> > 
> > All three patches are independent and should be applicable in any
> > order, with some fuzz on the third.
> 
> looks good at first glance.
> 
> Russel: what's your opinion?

Win,

This series looks fine.  However, looking through the driver, there's
a few oddities:

static u32 wdt_timeleft(void)
{
        u64 load, rate;

        rate = clk_get_rate(wdt->clk);

        spin_lock(&wdt->lock);
        load = readl(wdt->base + WDTVALUE);

        /*If the interrupt is inactive then time left is WDTValue + WDTLoad. */
        if (!(readl(wdt->base + WDTRIS) & INT_MASK))
                load += wdt->load_val + 1;
        spin_unlock(&wdt->lock);

        return div_u64(load, rate);
}

clk_get_rate returns an unsigned long, not a u64.  There's no point
expanding it to a 64-bit int for div_u64 - rate might as well be
declared as an unsigned long.

Same goes for wdt_setload, and there stuff like "div_u64(rate, 2)"
can become normal maths rather than the special 64-bit stuff.

Then there's:

        if (!request_mem_region(adev->res.start, resource_size(&adev->res),
                                "sp805_wdt")) {
                dev_warn(&adev->dev, "Failed to get memory region resource\n");
                ret = -ENOENT;
                goto err;
        }

Is amba_request_regions()/amba_release_regions() not good enough to
handle requesting/releasing these regions?
--
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