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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080227230941.f0885763.akpm@linux-foundation.org>
Date:	Wed, 27 Feb 2008 23:09:41 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	Dmitry Torokhov <dtor@...l.ru>, linux-input@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Liam Girdwood <liam.girdwood@...fsonmicro.com>,
	Graeme Gregory <gg@...nsource.wolfsonmicro.com>,
	Mike Arthur <mike.arthur@...fsonmicro.com>,
	Dmitry Baryshkov <dbaryshkov@...il.com>,
	Stanley Cai <stanley.cai@...el.com>,
	Rodolfo Giometti <giometti@...eenne.com>,
	Russell King <rmk@....linux.org.uk>,
	Marc Kleine-Budde <mkl@...gutronix.de>,
	Pete MacKay <linux01@...hitechnical.net>,
	Ian Molton <spyro@....com>, Vince Sanders <vince@...likki.org>,
	Andrew Zabolotny <zap@...elink.ru>
Subject: Re: [PATCH 5/6] Driver for WM97xx touchscreens in streaming mode on
 Mainstone

On Tue, 26 Feb 2008 13:40:17 +0000 Mark Brown <broonie@...nsource.wolfsonmicro.com> wrote:

> +#ifdef CONFIG_PXA27x
> +static void wm97xx_acc_pen_up(struct wm97xx *wm)
> +{
> +	set_current_state(TASK_INTERRUPTIBLE);
> +	schedule_timeout(1);
> +
> +	while (MISR & (1 << 2))
> +		MODR;
> +}
> +#else
> +static void wm97xx_acc_pen_up(struct wm97xx *wm)
> +{
> +	int count = 16;
> +	set_current_state(TASK_INTERRUPTIBLE);
> +	schedule_timeout(1);
> +
> +	while (count < 16) {
> +		MODR;
> +		count--;
> +	}
> +}
> +#endif

Can use schedule_timeout_interruptible() here.

If the calling process happens to have a signal pending then the
schedule_timeout() becomes a no-op.  Will the driver still function
correctly?

> +static int wm97xx_acc_pen_down(struct wm97xx *wm)
> +{
> +	u16 x, y, p = 0x100 | WM97XX_ADCSEL_PRES;
> +	int reads = 0;
> +
> +	/* data is never immediately available after pen down irq */
> +	set_current_state(TASK_INTERRUPTIBLE);
> +	schedule_timeout(1);

dittoes.

> +	if (tries > 5) {
> +		tries = 0;
> +		return RC_PENUP;
> +	}
> +
> +	x = MODR;
> +	if (x == last) {
> +		tries++;
> +		return RC_AGAIN;
> +	}
> +	last = x;
> +	do {
> +		if (reads)
> +			x = MODR;
> +		y = MODR;
> +		if (pressure)
> +			p = MODR;
> +
> +		/* are samples valid */
> +		if ((x & 0x7000) != WM97XX_ADCSEL_X ||
> +			(y & 0x7000) != WM97XX_ADCSEL_Y ||
> +			(p & 0x7000) != WM97XX_ADCSEL_PRES)
> +			goto up;
> +
> +		/* coordinate is good */
> +		tries = 0;
> +		input_report_abs(wm->input_dev, ABS_X, x & 0xfff);
> +		input_report_abs(wm->input_dev, ABS_Y, y & 0xfff);
> +		input_report_abs(wm->input_dev, ABS_PRESSURE, p & 0xfff);
> +		input_sync(wm->input_dev);
> +		reads++;
> +	} while (reads < cinfo[sp_idx].reads);
> +up:
> +	return RC_PENDOWN | RC_AGAIN;
> +}
> +

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