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: <20181125232450.GA3774@basecamp>
Date:   Sun, 25 Nov 2018 18:24:50 -0500
From:   Brian Masney <masneyb@...tation.org>
To:     Doug Anderson <dianders@...omium.org>
Cc:     Mark Brown <broonie@...nel.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: Question about "regulator: core: Only count load for enabled
 consumers" in -next

Hi Doug,

On Sun, Nov 25, 2018 at 09:20:02AM -0800, Doug Anderson wrote:
> On Sun, Nov 25, 2018 at 1:37 AM Brian Masney <masneyb@...tation.org> wrote:
> > I bisected the issue to the following commit:
> >
> > 5451781dadf8 ("regulator: core: Only count load for enabled consumers")
> >
> > We have to increase the load for the sdhci in device tree in order for
> > the phone to boot properly. This change was made with the commit:
> >
> > 03864e57770a ("ARM: dts: qcom: msm8974-hammerhead: increase load on l20
> > for sdhci")
> 
> You have a 200 mA system load on this regulator?

Yes.

> I guess this is a workaround for drivers that don't set the load
> properly themselves?

I'm honestly not sure when the load should be set in the driver or in
device tree. None of the drivers in drivers/mmc/ call
regulator_set_load. The dt bindings describes the regulator-system-load
property in Documentation/devicetree/bindings/regulator/regulator.txt.

I see that there are 8 users of regulator-system-load but most are all
addressing this same issue with the SD card. 
qcom-msm8974-sony-xperia-castor.dts sets the load to 500 mA but all of
the other msm8974-based SOCs use 200 mA. I'm not sure if this is
correct.

> I wonder if there is a bug in my patch where the system load doesn't
> take effect if nobody ever calls set_load.  Let's see...  Does the
> below fix things for you?  It's totally untested and whitespace
> damaged but I wanted to get a response out quick and I'm just walking
> out the door.  I'll test more / dig more either tonight or at work
> tomorrow:
> 
> +++ b/drivers/regulator/core.c
> @@ -1344,6 +1344,12 @@ static int set_machine_constraints(struct
> regulator_dev *rdev,
>                         rdev_err(rdev, "failed to set initial mode: %d\n", ret);
>                         return ret;
>                 }
> +       } else if (rdev->constraints->system_load) {
> +               /*
> +                * We'll only apply the initial system load if an
> +                * initial mode wasn't specified.
> +                */
> +               drms_uA_update(rdev);
>         }

Yes, this patch corrects the issue for me. You can add my tags if you
end up applying it:

Reported-by: Brian Masney <masneyb@...tation.org>
Tested-by: Brian Masney <masneyb@...tation.org>

Feel free to send me any other patches if you'd like me to do
additional testing.

Thanks for the quick response!

Brian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ