[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1398270087.7767.157.camel@deadeye.wl.decadent.org.uk>
Date: Wed, 23 Apr 2014 17:21:27 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: Claudiu Manoil <claudiu.manoil@...escale.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH net] gianfar: Check if phydev present on ethtool -A
On Wed, 2014-04-23 at 16:38 +0300, Claudiu Manoil wrote:
> This fixes a seg fault on 'ethtool -A' entry if the
> interface is down. Obviously we need to have the
> phy device initialized / "connected" (see of_phy_connect())
> to be able to advertise pause frame capabilities.
Why is the phydev detached while the interface is down?!
> Fixes: 23402bddf9e56eecb27bbd1e5467b3b79b3dbe58
> Signed-off-by: Claudiu Manoil <claudiu.manoil@...escale.com>
> ---
> drivers/net/ethernet/freescale/gianfar_ethtool.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
> index 891dbee..76d7070 100644
> --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
> +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
> @@ -533,6 +533,9 @@ static int gfar_spauseparam(struct net_device *dev,
> struct gfar __iomem *regs = priv->gfargrp[0].regs;
> u32 oldadv, newadv;
>
> + if (!phydev)
> + return -ENODEV;
> +
> if (!(phydev->supported & SUPPORTED_Pause) ||
> (!(phydev->supported & SUPPORTED_Asym_Pause) &&
> (epause->rx_pause != epause->tx_pause)))
I think you can instead remove the following check, as pause support is
a property of the MAC not the PHY.
Ben.
--
Ben Hutchings
Beware of programmers who carry screwdrivers. - Leonard Brandwein
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)
Powered by blists - more mailing lists