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]
Message-ID: <fa686aa41002051222o4670a35alea373d45c3f7498d@mail.gmail.com>
Date:	Fri, 5 Feb 2010 12:22:16 -0800
From:	Grant Likely <grant.likely@...retlab.ca>
To:	John Linn <John.Linn@...inx.com>
Cc:	netdev@...r.kernel.org, linuxppc-dev@...abs.org, jgarzik@...ox.com,
	jwboyer@...ux.vnet.ibm.com, john.williams@...alogix.com,
	Sadanand Mutyala <sadanan@...inx.com>
Subject: Re: [PATCH] net: emaclite: adding MDIO and phy lib support

On Fri, Feb 5, 2010 at 10:50 AM, John Linn <John.Linn@...inx.com> wrote:
>> -----Original Message-----
>> From: Grant Likely
>> Sent: Thurs, 4 Feb 2010 11:12:29 AM
>> To: John Linn
>> Subject: FW: [PATCH] net: emaclite: adding MDIO and phy lib support
>>
>> Hi John and Sadanand.  Looks like a good patch, but a few issues to
>> resolve.  Comments below.
>>
>> g.
>
> Somehow I didn't get this message but found it out on the web, so this
> is a contrived version of the message so I could respond :)
>
>>
>> On Wed, Feb 3, 2010 at 5:49 PM, John Linn <john.linn@...xxxxxxx>
> wrote:
>> > These changes add MDIO and phy lib support to the driver as the
>> > IP core now supports the MDIO bus.
>> >
>> > The MDIO bus and phy are added as a child to the emaclite in the
> device
>> > tree as illustrated below.
>> >
>> > mdio {
>> >        #address-cells = <1>;
>> >        #size-cells = <0>;
>> >        phy0: phy@7 {
>> >                reg = <7>;
>>
>> For completeness, phy node need a "compatible" property.
>
> It seems like this is in the device tree only but the driver won't use
> it. So no real affect on the driver unless I'm not synced up with you.

That's right.  That's why I said "for completeness".  This is just an
example phy node, but it is good practice to give accurate examples.
:-)

>> >        /* Set the MAC address in the EmacLite device */
>> > -       xemaclite_set_mac_address(lp, ndev->dev_addr);
>> > +       xemaclite_update_address(lp, ndev->dev_addr);
>> > +
>> > +       /* Check if MDIO is included in the HW */
>> > +       lp->has_mdio = get_bool(ofdev, "xlnx,include-mdio");
>> > +       if (lp->has_mdio) {
>> > +               lp->phy_node = of_parse_phandle(ofdev->node,
> "phy-handle", 0);
>> > +               rc = xemaclite_mdio_setup(lp, &ofdev->dev);
>> > +               if (rc)
>> > +                       dev_warn(&ofdev->dev, "error registering
> MDIO bus\n");
>> > +       }
>>
>> What if the phy is attached to a different MDIO bus (which is
>> completely possible)?  The fetching of phy_node should be performed
>> regardless of whether or not xlnx,include-mdio is set.
>>
>
> So the issue here is that the IP core can be built without any PHY
> interface and MDIO bus.

Right, but just because the *core* doesn't have a phy interface built
in, doesn't mean that the PHY isn't attached to a different MDIO bus
(ie. on another emaclite, or on a gpio driven MDIO bus).  So even if
mdio is configured out, the driver should still handle the case of it
having an valid phy-handle.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ