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:	Thu, 27 Mar 2014 23:13:40 +0200
From:	Georgi Djakov <gdjakov@...sol.com>
To:	Mike Looijmans <mike.looijmans@...ic.nl>, cjb@...top.org,
	linux-mmc@...r.kernel.org
CC:	linux-kernel@...r.kernel.org, git@...inx.com
Subject: Re: [PATCH] sdhci: Forward EPROBE_DEFER on vmmc and vqmmc regulators

On 27.03.14, 19:47, Mike Looijmans wrote:
> On 26-3-2014 16:09, Georgi Djakov wrote:
>> On 03/07/2014 04:18 PM, Mike Looijmans wrote:
>>> If vmmc or vqmmc regulators are controlled by an I2C device, the
>>> request for the regulator is likely to fail because the I2C bus has
>>> not been probed yet. The sdhci then incorrectly assumes that the user
>>> never wanted to use a regulator anyway and continues without ever
>>> enabling or configuring the required regulator.
>>>
>>> To solve this, when a required voltage regulator returns
>>> EPROBE_DEFER, signalling that the regulator exists but is not
>>> available yet, forward this error to the probe method instead
>>> of simply assuming that the user never wanted to use a regulator
>>> anyway.
>>>
>>> Tested on a custom board that has an I2C regulator for one of the sdhcis
>>> and no regulators at all for the other. This patch enables such a system
>>> to work correctly.
>>> ---
>>>   drivers/mmc/host/sdhci.c |    8 ++++++--
>>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>>> index 34aef81..43b90c1 100644
>>> --- a/drivers/mmc/host/sdhci.c
>>> +++ b/drivers/mmc/host/sdhci.c
>>> @@ -2972,6 +2972,8 @@ int sdhci_add_host(struct sdhci_host *host)
>>>       host->vqmmc = regulator_get_optional(mmc_dev(mmc), "vqmmc");
>>>       if (IS_ERR_OR_NULL(host->vqmmc)) {
>>>           if (PTR_ERR(host->vqmmc) < 0) {
>>> +            if (PTR_ERR(host->vqmmc) == -EPROBE_DEFER)
>>> +                return -EPROBE_DEFER;
>>>               pr_info("%s: no vqmmc regulator found\n",
>>>                   mmc_hostname(mmc));
>>>               host->vqmmc = NULL;
>>> @@ -3048,8 +3050,10 @@ int sdhci_add_host(struct sdhci_host *host)
>>>       host->vmmc = regulator_get_optional(mmc_dev(mmc), "vmmc");
>>>       if (IS_ERR_OR_NULL(host->vmmc)) {
>>>           if (PTR_ERR(host->vmmc) < 0) {
>>> -            pr_info("%s: no vmmc regulator found\n",
>>> -                mmc_hostname(mmc));
>>> +            if (PTR_ERR(host->vmmc) == -EPROBE_DEFER)
>>> +                return -EPROBE_DEFER;
>>> +            pr_info("%s: no vmmc regulator found (%d)\n",
>>
>> I suggest using %ld here. The rest looks fine to me! Thanks!
> 
> Does this mean you're waiting for a patch v2 that I should submit?
> 

Yes, please submit v2 and hope to get some more feedback from the community.

Thanks,
Georgi

>>
>>> +                mmc_hostname(mmc), PTR_ERR(host->vmmc));
>>>               host->vmmc = NULL;
>>>           }
>>>       }
>>>
>>
>> BR,
>> Georgi
>>

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