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:   Sun, 1 Oct 2017 09:34:44 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     Geert Uytterhoeven <geert+renesas@...der.be>,
        "David S . Miller" <davem@...emloft.net>,
        Simon Horman <horms@...ge.net.au>,
        Magnus Damm <magnus.damm@...il.com>,
        Andrew Lunn <andrew@...n.ch>,
        Niklas Söderlund 
        <niklas.soderlund+renesas@...natech.se>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: [PATCH 2/4] ravb: Add optional PHY reset during system resume



On 09/30/2017 01:23 PM, Sergei Shtylyov wrote:
> Hello!
> 
> On 09/28/2017 10:21 PM, Florian Fainelli wrote:
> 
>>>>> If the optional "reset-gpios" property is specified in DT, the generic
>>>>> MDIO bus code takes care of resetting the PHY during device probe.
>>>>> However, the PHY may still have to be reset explicitly after system
>>>>> resume.
>>>>>
>>>>> This allows to restore Ethernet operation after resume from s2ram on
>>>>> Salvator-XS, where the enable pin of the regulator providing PHY power
>>>>> is connected to PRESETn, and PSCI suspend powers down the SoC.
>>>>>
>>>>> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
>>>>> ---
>>>>>   drivers/net/ethernet/renesas/ravb_main.c | 9 +++++++++
>>>>>   1 file changed, 9 insertions(+)
>>>>>
>>>>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c
>>>>> b/drivers/net/ethernet/renesas/ravb_main.c
>>>>> index fdf30bfa403bf416..96d1d48e302f8c9a 100644
>>>>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>>>>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> [...]
>>>>> @@ -2302,6 +2304,13 @@ static int __maybe_unused ravb_resume(struct
>>>>> device *dev)
>>>>>         * reopen device if it was running before system suspended.
>>>>>         */
>>>>>
>>>>> +     /* PHY reset */
>>>>> +     if (bus->reset_gpiod) {
>>>>> +             gpiod_set_value_cansleep(bus->reset_gpiod, 1);
>>>>> +             udelay(bus->reset_delay_us);
>>>>> +             gpiod_set_value_cansleep(bus->reset_gpiod, 0);
>>>>> +     }
>>>>
>>>> This is a clever hack, but unfortunately this is also misusing the MDIO
>>>> bus reset line into a PHY reset line. As commented in patch 3, if this
>>>> reset line is tied to the PHY, then this should be a PHY property and
>>>
>>> OK.
>>>
>>>> you cannot (ab)use the MDIO bus GPIO reset logic anymore...
>>>
>>> And then I should add reset-gpios support to drivers/net/phy/micrel.c?
>>> Or is there already generic code to handle per-PHY reset? I couldn't
>>> find it.
>>
>> There is not such a thing unfortunately, but it would presumably be
> 
>    It's strange you don't remember about my (abandoned) patches to
> handle per=PHY reset GPIOs -- perhaps it's time to unearth them. Here
> they are:
> 
> http://patchwork.ozlabs.org/patch/616495/
> http://patchwork.ozlabs.org/patch/616501/
> 
>    I had v3 in the works before abandoning this series -- it doesn't
> apply now.

Should Geert pick-up where you left and address the feedback given in
v2, or do you plan to post a rebased v3?

> 
>> called within drivers/net/phy/mdio_bus.c during bus->reset() time
>> because you need the PHY reset to be deasserted before you can
>> successfully read/write from the PHY, and if you can't read/write from
>> the PHY, the MDIO bus layer cannot read the PHY ID, and therefore cannot
>> match a PHY device with its driver, so things don't work.
> 
>    I did this a bit differently...
> 
> [...]
> 
> MBR, Sergei

-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ