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: <2026891.KGZ2uNuXyI@amdc3058>
Date:   Mon, 28 May 2018 13:29:07 +0200
From:   Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
To:     Linus Walleij <linus.walleij@...aro.org>
Cc:     Mark Brown <broonie@...nel.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        Sangbeom Kim <sbkim73@...sung.com>,
        Chanwoo Choi <cw00.choi@...sung.com>
Subject: Re: [PATCH 10/19 v3] regulator: s2mps11: Pass descriptor instead of
 GPIO number


Hi Linus,

On Monday, May 28, 2018 10:41:31 AM Linus Walleij wrote:
> On Sat, May 26, 2018 at 12:02 PM, Mark Brown <broonie@...nel.org> wrote:
> > On Mon, May 14, 2018 at 10:06:31AM +0200, Linus Walleij wrote:
> >> Instead of passing a global GPIO number for the enable GPIO, pass
> >> a descriptor looked up with the standard devm_gpiod_get_optional()
> >> call.
> >>
> >> This regulator supports passing platform data, but enable/sleep
> >> regulators are looked up from the device tree exclusively, so
> >> we can need not touch other files.
> >
> > This seems to have broken the boot on Odroid XU3 so I'm going to revert
> > it:
> >
> > https://storage.kernelci.org/next/master/v4.17-rc6-9523-g47b9cef0672d/arm/multi_v7_defconfig/lab-baylibre-seattle/boot-exynos5422-odroidxu3.html
> 
> How annoying. I will check with a colleague who might have this
> board so I can test it on hardware.

I've reproduced the problem on TM2e board and the patch below fixes
it (old code always initialized the structure, new code does it only
in case GPIO properties are provided).

I've also tested the new code (with fixup) on Artik5 board (which
actually uses GPIO properties) and discovered the other problem,
the GPIO core code doesn't handle shared GPIOs which are used by
many platforms.

Old code:
[    1.094950] s2mps11-pmic s2mps14-regulator: Using GPIO 21 for ext-control over 10/LDO11
[    1.095210] s2mps11-pmic s2mps14-regulator: Using GPIO 21 for ext-control over 11/LDO12

New code (with fixup):
[    1.114288] s2mps11-pmic s2mps14-regulator: Using GPIO for ext-control over 10/LDO11
[    1.143209] s2mps11-pmic s2mps14-regulator: Failed to get control GPIO for 11/LDO12

[ It fails with -EBUSY on gpiod_request() in gpiod_get_from_of_node(). ]

Therefore it seems that more work is needed before s2mps11 driver
can be converted to use GPIO descriptors.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


Index: b/drivers/regulator/s2mps11.c
===================================================================
--- a/drivers/regulator/s2mps11.c	2018-05-28 10:53:58.121322472 +0200
+++ b/drivers/regulator/s2mps11.c	2018-05-28 11:33:38.613382421 +0200
@@ -1147,7 +1147,7 @@ static int s2mps11_pmic_probe(struct pla
 		return -EINVAL;
 	}
 
-	s2mps11->ext_control_gpiod = devm_kmalloc(&pdev->dev,
+	s2mps11->ext_control_gpiod = devm_kzalloc(&pdev->dev,
 			sizeof(*s2mps11->ext_control_gpiod) * rdev_num,
 			GFP_KERNEL);
 	if (!s2mps11->ext_control_gpiod)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ