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:	Tue, 24 Jan 2012 17:04:12 +0530
From:	Viresh Kumar <viresh.kumar@...com>
To:	Christopher BLAIR <chris.blair@...ricsson.com>
Cc:	Linus WALLEIJ <linus.walleij@...ricsson.com>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Michel JAOUEN <michel.jaouen@...ricsson.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	Shiraz HASHIM <shiraz.hashim@...com>,
	Armando VISCONTI <armando.visconti@...com>
Subject: Re: [PATCH] mfd/stmpe: Add support for no-interrupt config

On 1/24/2012 3:48 PM, Linus WALLEIJ wrote:
> From: Chris Blair <chris.blair@...ricsson.com>
> 
> Adds support for boards which have an STMPE device without the
> interrupt pin connected.
> 
> Cc: Viresh Kumar <viresh.kumar@...com>
> Signed-off-by: Chris Blair <chris.blair@...ricsson.com>
> Tested-by: Michel Jaouen <michel.jaouen@...ricsson.com>
> Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@...ricsson.com>
> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
> ---
>  drivers/mfd/stmpe.c       |   72 +++++++++++++++++++++++++--------------------
>  include/linux/mfd/stmpe.h |    2 +
>  2 files changed, 42 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c

> @@ -988,7 +990,7 @@ int __devinit stmpe_probe(struct stmpe_client_info *ci, int partnum)
>  	if (ci->init)
>  		ci->init(stmpe);
>  
> -	if (pdata->irq_over_gpio) {
> +	if (!pdata->no_irq && pdata->irq_over_gpio) {
>  		ret = gpio_request_one(pdata->irq_gpio, GPIOF_DIR_IN, "stmpe");
>  		if (ret) {
>  			dev_err(stmpe->dev, "failed to request IRQ GPIO: %d\n",

[I will add the actual code present here after this change to describe the concern]

	if (!pdata->no_irq && pdata->irq_over_gpio) {
		ret = gpio_request_one(pdata->irq_gpio, GPIOF_DIR_IN, "stmpe");
		if (ret) {
			dev_err(stmpe->dev, "failed to request IRQ GPIO: %d\n",
					ret);
			goto out_free;
		}

		stmpe->irq = gpio_to_irq(pdata->irq_gpio);
	} else {
		stmpe->irq = ci->irq;
	}

Actually you want neither of them to work for no_irq case, if and else.
But with this code, if you pass no_irq = true, then else part will get called.

> @@ -1005,15 +1007,21 @@ int __devinit stmpe_probe(struct stmpe_client_info *ci, int partnum)
>  	if (ret)
>  		goto free_gpio;
>  
> -	ret = stmpe_irq_init(stmpe);
> -	if (ret)
> -		goto free_gpio;
> +	if (pdata->no_irq) {
> +		dev_info(stmpe->dev,
> +			"board config says IRQs are not supported\n");
> +	} else {
> +		ret = stmpe_irq_init(stmpe);
> +		if (ret)
> +			goto free_gpio;
>  

There are few more cases to handle in error part of probe and remove, where
following routines are called.

	free_irq(stmpe->irq, stmpe);
	stmpe_irq_remove(stmpe);
	if (pdata->irq_over_gpio)
		gpio_free(pdata->irq_gpio);

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