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:	Wed, 30 Apr 2014 09:29:51 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Roger Quadros <rogerq@...com>
Cc:	rydberg@...omail.se, balbi@...com, dmurphy@...com,
	mugunthanvnm@...com, nsekhar@...com, linux-input@...r.kernel.org,
	linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v3 2/7] Input: pixcir_i2c_ts: Initialize interrupt mode
 and power mode

Hi Roger,

On Wed, Apr 30, 2014 at 03:36:27PM +0300, Roger Quadros wrote:
> +static int pixcir_stop(struct pixcir_i2c_ts_data *ts)
> +{
> +	struct device *dev = &ts->client->dev;
> +	int ret;
> +
> +	/* exit ISR if running, no more report parsing */
> +	ts->exiting = true;
> +	mb();	/* update status before we synchronize irq */
> +
> +	/* disable ISR from running again */
> +	disable_irq(ts->client->irq);
> +
> +	/* wait till running ISR complete */
> +	synchronize_irq(ts->client->irq);
> +
> +	/* disable interrupt generation */
> +	ret = pixcir_int_enable(ts, 0);
> +	if (ret)
> +		dev_err(dev, "Failed to disable interrupt generation\n");
> +
> +	/* restore IRQ */
> +	enable_irq(ts->client->irq);
> +
> +	return ret;

Should not this be:

	pixcir_int_enable(ts, 0);
	ts->exiting = true;
	mb();
	synchronize_irq(ts->client->irq);

Why do we also need to disable/enable irq?

By the way, disable_irq() implies synchronize_irq().

Thanks.

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