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: <20081030151804.bc8bd02a.akpm@linux-foundation.org>
Date:	Thu, 30 Oct 2008 15:18:04 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	wim@...ana.be, linux-kernel@...r.kernel.org,
	broonie@...nsource.wolfsonmicro.com
Subject: Re: [PATCH] watchdog: Add support for the WM8350 watchdog

On Mon, 27 Oct 2008 15:31:56 +0000
Mark Brown <broonie@...nsource.wolfsonmicro.com> wrote:

> This driver implements support for the watchdog functionality provided
> by the Wolfson Microelectronics WM8350, a multi-function audio and
> power management subsystem intended for use in embedded systems. It is
> based on a driver originally written by Graeme Gregory, though it has
> been extensively modified since then.
> 
> Use of a GPIO to kick the watchdog is not yet supported.
> 
> ...
>
> +
> +static int wm8350_wdt_set_timeout(struct wm8350 *wm8350, u16 value)
> +{
> +	int ret;
> +	u16 reg;
> +
> +	mutex_lock(&wdt_mutex);
> +	wm8350_reg_unlock(wm8350);
> +
> +	reg = wm8350_reg_read(wm8350, WM8350_SYSTEM_CONTROL_2);
> +	reg &= ~WM8350_WDOG_TO_MASK;
> +	reg |= value;
> +	ret = wm8350_reg_write(wm8350, WM8350_SYSTEM_CONTROL_2, reg);
> +
> +	wm8350_reg_lock(wm8350);

I was curious about this wm8350_reg_lock/wm8350_reg_unlock thing, so I
went to have a look at it.  Nothing.  Obviously its authors felt there
was no benefit in having anyone else understand what it does.

> +	mutex_unlock(&wdt_mutex);
> +
> +	return ret;
> +}
>
> ...
>
> +static int wm8350_wdt_open(struct inode *inode, struct file *file)
> +{
> +	struct wm8350 *wm8350 = get_wm8350();
> +	int ret;
> +
> +	if (!wm8350)
> +		return -ENODEV;
> +
> +	if (test_and_set_bit(1, &wm8350_wdt_users))

It's odd that the driver uses bit 1 rather than bit 0.

--
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