* [PATCH] net: ethernet: davinci_emac: Fix devioctl while in fixed link
@ 2016-04-25 17:41 Neil Armstrong
2016-04-26 6:07 ` Mugunthan V N
2016-04-28 19:52 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Neil Armstrong @ 2016-04-25 17:41 UTC (permalink / raw)
To: David S. Miller, Andrew Lunn, Tom Lendacky, Mugunthan V N, netdev,
linux-kernel
Cc: Neil Armstrong, Brian Hutchinson
When configured in fixed link, the DaVinci emac driver sets the
priv->phydev to NULL and further ioctl calls to the phy_mii_ioctl()
causes the kernel to crash.
Cc: Brian Hutchinson <b.hutchman@gmail.com>
Fixes: 1bb6aa56bb38 ("net: davinci_emac: Add support for fixed-link PHY")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
drivers/net/ethernet/ti/davinci_emac.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 58d58f0..f56d66e 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1512,7 +1512,10 @@ static int emac_devioctl(struct net_device *ndev, struct ifreq *ifrq, int cmd)
/* TODO: Add phy read and write and private statistics get feature */
- return phy_mii_ioctl(priv->phydev, ifrq, cmd);
+ if (priv->phydev)
+ return phy_mii_ioctl(priv->phydev, ifrq, cmd);
+ else
+ return -EOPNOTSUPP;
}
static int match_first_device(struct device *dev, void *data)
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: ethernet: davinci_emac: Fix devioctl while in fixed link
2016-04-25 17:41 [PATCH] net: ethernet: davinci_emac: Fix devioctl while in fixed link Neil Armstrong
@ 2016-04-26 6:07 ` Mugunthan V N
2016-04-28 19:52 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Mugunthan V N @ 2016-04-26 6:07 UTC (permalink / raw)
To: Neil Armstrong, David S. Miller, Andrew Lunn, Tom Lendacky,
netdev, linux-kernel
Cc: Brian Hutchinson
On Monday 25 April 2016 11:11 PM, Neil Armstrong wrote:
> When configured in fixed link, the DaVinci emac driver sets the
> priv->phydev to NULL and further ioctl calls to the phy_mii_ioctl()
> causes the kernel to crash.
>
> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Fixes: 1bb6aa56bb38 ("net: davinci_emac: Add support for fixed-link PHY")
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
Regards
Mugunthan V N
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: ethernet: davinci_emac: Fix devioctl while in fixed link
2016-04-25 17:41 [PATCH] net: ethernet: davinci_emac: Fix devioctl while in fixed link Neil Armstrong
2016-04-26 6:07 ` Mugunthan V N
@ 2016-04-28 19:52 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-04-28 19:52 UTC (permalink / raw)
To: narmstrong
Cc: andrew, thomas.lendacky, mugunthanvnm, netdev, linux-kernel,
b.hutchman
From: Neil Armstrong <narmstrong@baylibre.com>
Date: Mon, 25 Apr 2016 19:41:38 +0200
> When configured in fixed link, the DaVinci emac driver sets the
> priv->phydev to NULL and further ioctl calls to the phy_mii_ioctl()
> causes the kernel to crash.
>
> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Fixes: 1bb6aa56bb38 ("net: davinci_emac: Add support for fixed-link PHY")
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Applied, thanks Neil.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-28 19:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-25 17:41 [PATCH] net: ethernet: davinci_emac: Fix devioctl while in fixed link Neil Armstrong
2016-04-26 6:07 ` Mugunthan V N
2016-04-28 19:52 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).