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  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:	Fri, 08 Aug 2014 09:59:48 +0200
From:	Krzysztof Kozlowski <k.kozlowski@...sung.com>
To:	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Cc:	Samuel Ortiz <sameo@...ux.intel.com>,
	Lee Jones <lee.jones@...aro.org>,
	Javier Martinez Canillas <javier.martinez@...labora.co.uk>,
	Doug Anderson <dianders@...omium.org>,
	Kyungmin Park <kyungmin.park@...sung.com>,
	linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mfd: max77686: fix support for devices without irq
 specified

On czw, 2014-08-07 at 18:09 +0200, Bartlomiej Zolnierkiewicz wrote:
> Before commit 6f1c1e71d933 ("mfd: max77686: Convert to use regmap_irq")
> max77686_irq_init() return value was never checked so devices without
> irq specified (like Hardkernel's Exynos4412 based ODROID-U3 board)
> worked fine even though -ENODEV was returned by the function.  Add
> handling for no irq specified case in max77686_i2c_probe() restoring
> the previous driver's behavior.
> 
> The patch fixes boot for Hardkernel's Exynos4412 based ODROID-U3 board.
> 
> Error messages before the patch:
> ...
> [    0.163995] max77686 0-0009: Failed to request IRQ 0 for max77686-pmic: -22
> [    0.164020] max77686 0-0009: failed to add PMIC irq chip: -22
> [    0.164478] max77686: probe of 0-0009 failed with error -22
> ...
> 
> Fixes: 6f1c1e71d933 ("mfd: max77686: Convert to use regmap_irq")
> Cc: Krzysztof Kozlowski <k.kozlowski@...sung.com>
> Cc: Javier Martinez Canillas <javier.martinez@...labora.co.uk>
> Cc: Doug Anderson <dianders@...omium.org>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
> Acked-by: Kyungmin Park <kyungmin.park@...sung.com>
> ---
> patch is against next-20140804 branch of linux-next kernel
> 
>  drivers/mfd/max77686.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c
> index 86e5523..5fe024c 100644
> --- a/drivers/mfd/max77686.c
> +++ b/drivers/mfd/max77686.c
> @@ -314,6 +314,11 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
>  		}
>  	}
>  
> +	if (!max77686->irq) {
> +		dev_info(max77686->dev, "irq is not specified\n");
> +		goto skip_irq_setup;
> +	}
> +
>  	ret = regmap_add_irq_chip(max77686->regmap, max77686->irq,
>  				  IRQF_TRIGGER_FALLING | IRQF_ONESHOT |
>  				  IRQF_SHARED, 0, irq_chip,
> @@ -332,6 +337,7 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
>  		goto err_del_irqc;
>  	}
>  
> +skip_irq_setup:
>  	ret = mfd_add_devices(max77686->dev, -1, cells, n_devs, NULL, 0, NULL);
>  	if (ret < 0) {
>  		dev_err(&i2c->dev, "failed to add MFD devices: %d\n", ret);

Not sufficient. You have to also fix RTC driver (OOPS from Trats2
attached). Also consider adding checks for (max77686->irq) to the
suspend and resume.

Best regards,
Krzysztof



View attachment "max77686-oops.txt" of type "text/plain" (17547 bytes)

Powered by blists - more mailing lists