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:   Wed, 31 Aug 2016 15:46:27 -0500
From:   Rob Herring <robh@...nel.org>
To:     Timur Tabi <timur@...eaurora.org>
Cc:     netdev <netdev@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        Sagar Dharia <sdharia@...eaurora.org>,
        Shanker Donthineni <shankerd@...eaurora.org>,
        Vikram Sethi <vikrams@...eaurora.org>,
        Christopher Covington <cov@...eaurora.org>,
        Gilad Avidov <gavidov@...eaurora.org>,
        Andrew Lunn <andrew@...n.ch>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Mark Langsdorf <mlangsdo@...hat.com>,
        "jcm@...hat.com" <jcm@...hat.com>,
        Andy Gross <agross@...eaurora.org>,
        David Miller <davem@...emloft.net>,
        Florian Fainelli <f.fainelli@...il.com>,
        Lino Sanfilippo <LinoSanfilippo@....de>
Subject: Re: [PATCH] [v9] net: emac: emac gigabit ethernet controller driver

On Wed, Aug 31, 2016 at 10:11 AM, Timur Tabi <timur@...eaurora.org> wrote:
> Rob Herring wrote:
>
>>> +               internal-phy = <&emac_sgmii>;
>>
>>
>> Can't this use the standard generic phy binding (i.e. 'phys'). It's a
>> bit confusing as there's the ethernet phy binding (phy-handle) and the
>> generic one.
>
>
> It's not a generic phy.  It's a funky "internal phy" that differs among
> SOCs.  I call it the internal phy, but I could use another name. Internally,
> some people call it the "sgmii phy", but I don't think that's accurate.

Funky internal PHYs are precisely the types of PHYs this binding is
for. It is generic in that the type is not defined. It can be USB,
HDMI, DSI, LVDS, etc.

>
> I can call it "emac-phy", but I don't know if that's any better.
>
>>> +               phy-handle = <&phy0>;
>>
>>
>> This is bit redundant as the phy is the child node. I guess if you had
>> multiple devices on the mdio bus you would need it. I'd drop it if you
>> don't envision needing it and the kernel doesn't require it.
>
>
> That's what I thought to, but without it, of_phy_find_device() won't work.
> I need a pointer to the phy node, and I use of_parse_phandle() to get it:
>
>         struct device_node *phy_np;
>
>         ret = of_mdiobus_register(mii_bus, np);
>         if (ret) {
>                 dev_err(&pdev->dev, "could not register mdio bus\n");
>                 return ret;
>         }
>
>         phy_np = of_parse_phandle(np, "phy-handle", 0);

You can just as easily find the child node called ethernet-phy.

>         adpt->phydev = of_phy_find_device(phy_np);
>
>>> +
>>> +               #address-cells = <1>;
>>> +               #size-cells = <0>;
>>> +               phy0: ethernet-phy@0 {
>>
>>
>> It's just an example, but don't we require compatible strings for phys
>> now?
>
>
> Nope. I had a compatible property, but it broke of_mdiobus_child_is_phy().
> I don't want to specify why kind of phy it is.  I want to let phylib figure
> it out.

Okay, I'll defer to the mdio folks.

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ