mbox series

[net-next,0/3] dpaa2-mac: add PCS support through the Lynx module

Message ID 20200921162031.12921-1-ioana.ciornei@nxp.com
Headers show
Series dpaa2-mac: add PCS support through the Lynx module | expand

Message

Ioana Ciornei Sept. 21, 2020, 4:20 p.m. UTC
This patch set aims to add PCS support in the dpaa2-eth driver by
leveraging the Lynx PCS module.

The first two patches are some missing pieces: the first one adding
support for 10GBASER in Lynx PCS while the second one adds a new
function - of_mdio_find_device - which is helpful in retrieving the PCS
represented as a mdio_device.  The final patch adds the glue logic
between phylink and the Lynx PCS module: it retrieves the PCS
represented as an mdio_device and registers it to Lynx and phylink.

Comments

Andrew Lunn Sept. 21, 2020, 5:07 p.m. UTC | #1
On Mon, Sep 21, 2020 at 07:20:31PM +0300, Ioana Ciornei wrote:
> +static void dpaa2_pcs_destroy(struct dpaa2_mac *mac)
> +{
> +	struct lynx_pcs *pcs = mac->pcs;
> +
> +	if (pcs) {
> +		put_device(&pcs->mdio->dev);
> +		lynx_pcs_destroy(pcs);
> +		mac->pcs = NULL;

Hi Ioana

Maybe the put_device() should come after the destroy? It is then the
reverse of the creation.

	Andrew
Ioana Ciornei Sept. 21, 2020, 6:06 p.m. UTC | #2
On Mon, Sep 21, 2020 at 07:07:21PM +0200, Andrew Lunn wrote:
> On Mon, Sep 21, 2020 at 07:20:31PM +0300, Ioana Ciornei wrote:
> > +static void dpaa2_pcs_destroy(struct dpaa2_mac *mac)
> > +{
> > +	struct lynx_pcs *pcs = mac->pcs;
> > +
> > +	if (pcs) {
> > +		put_device(&pcs->mdio->dev);
> > +		lynx_pcs_destroy(pcs);
> > +		mac->pcs = NULL;
> 
> Hi Ioana
> 
> Maybe the put_device() should come after the destroy? It is then the
> reverse of the creation.
> 
> 	Andrew

Hi Andrew,

The lynx_pcs_destroy() function doesn't do much with the pcs, just a
kfree on it. I did it this way to avoid keeping the device in a
temporary variable but if you think we should do this in a symetrical
way, I can make the change.

Ioana
David Miller Sept. 23, 2020, 12:10 a.m. UTC | #3
From: Ioana Ciornei <ioana.ciornei@nxp.com>
Date: Mon, 21 Sep 2020 19:20:28 +0300

> This patch set aims to add PCS support in the dpaa2-eth driver by
> leveraging the Lynx PCS module.
> 
> The first two patches are some missing pieces: the first one adding
> support for 10GBASER in Lynx PCS while the second one adds a new
> function - of_mdio_find_device - which is helpful in retrieving the PCS
> represented as a mdio_device.  The final patch adds the glue logic
> between phylink and the Lynx PCS module: it retrieves the PCS
> represented as an mdio_device and registers it to Lynx and phylink.
> From that point on, any PCS callbacks are treated by Lynx, without
> dpaa2-eth interaction.

Please make the PCS destroy symmetric with the create as
requested by Andrew.

Thanks.