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] [day] [month] [year] [list]
Date:   Tue, 23 May 2017 15:30:33 -0400
From:   David Woods <dwoods@...lanox.com>
To:     Ulf Hansson <ulf.hansson@...aro.org>
CC:     Jaehoon Chung <jh80.chung@...sung.com>,
        Shawn Lin <shawn.lin@...k-chips.com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        <cmetcalf@...lanox.com>,
        "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        <stable@...r.linux.org>
Subject: Re: [PATCH 2/2] mmc: core: Use device_property_read instead of
 of_property_read

On 05/19/2017 04:23 AM, Ulf Hansson wrote:
> On 18 May 2017 at 00:17, David Woods <dwoods@...lanox.com> wrote:
>> Using the device_property interfaces allows mmc drivers to work
>> on platforms which run on either device tree or ACPI.
>>
>> Signed-off-by: David Woods <dwoods@...lanox.com>
>> Reviewed-by: Chris Metcalf <cmetcalf@...lanox.com>
>> Cc: stable@...r.linux.org
>> ---
>>   drivers/mmc/core/host.c | 72 ++++++++++++++++++++++++-------------------------
>>   1 file changed, 35 insertions(+), 37 deletions(-)
>>
>> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
>> index 3f8c85d..d2c059e 100644
>> --- a/drivers/mmc/core/host.c
>> +++ b/drivers/mmc/core/host.c
>> @@ -176,19 +176,17 @@ static void mmc_retune_timer(unsigned long data)
>>    */
>>   int mmc_of_parse(struct mmc_host *host)
>>   {
>> -       struct device_node *np;
>> +       struct device *dev = host->parent;
>>          u32 bus_width;
>>          int ret;
>>          bool cd_cap_invert, cd_gpio_invert = false;
>>          bool ro_cap_invert, ro_gpio_invert = false;
>>
>> -       if (!host->parent || !host->parent->of_node)
>> +       if (!dev)
>>                  return 0;
>>
> So earlier we stopped executing the OF parsing at this point, unless
> we had valid a of_node pointer. To be safe, I think we need to do
> something similar here.
>
> In other words, perhaps check the result from dev_fwnode(), before continue.

I will add that check.

> [...]
>
> mmc_pwrseq_alloc() is called from mmc_of_parse() which currently only
> supports OF parsing. I assume you would like to convert that as well?
> Perhaps that should even be the first step?

Our board does not have a power sequence device, so this is not 
something I have the hardware available to test.  It's not very clear to 
me how a pwrseq reference would be represented in ACPI or how to access 
it with the device_property API.  As it is, of_parse_phandle just 
returns NULL in the case where there is no parent->of_node.

-David Woods

>
> Kind regards
> Uffe


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ