diff mbox

staging: octeon: Call SET_NETDEV_DEV()

Message ID 20161215011326.8852-1-f.fainelli@gmail.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Florian Fainelli Dec. 15, 2016, 1:13 a.m. UTC
The Octeon driver calls into PHYLIB which now checks for
net_device->dev.parent, so make sure we do set it before calling into
any MDIO/PHYLIB related function.

Fixes: ec988ad78ed6 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/staging/octeon/ethernet.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Florian Fainelli Dec. 21, 2016, 1:02 a.m. UTC | #1
On 12/14/2016 05:13 PM, Florian Fainelli wrote:
> The Octeon driver calls into PHYLIB which now checks for
> net_device->dev.parent, so make sure we do set it before calling into
> any MDIO/PHYLIB related function.
> 
> Fixes: ec988ad78ed6 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
> Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Greg, David, since this is a fix for a regression introduced in the net
tree, it may make sense that David take it via his tree.

Thanks

> ---
>  drivers/staging/octeon/ethernet.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
> index 8130dfe89745..4971aa54756a 100644
> --- a/drivers/staging/octeon/ethernet.c
> +++ b/drivers/staging/octeon/ethernet.c
> @@ -770,6 +770,7 @@ static int cvm_oct_probe(struct platform_device *pdev)
>  			/* Initialize the device private structure. */
>  			struct octeon_ethernet *priv = netdev_priv(dev);
>  
> +			SET_NETDEV_DEV(dev, &pdev->dev);
>  			dev->netdev_ops = &cvm_oct_pow_netdev_ops;
>  			priv->imode = CVMX_HELPER_INTERFACE_MODE_DISABLED;
>  			priv->port = CVMX_PIP_NUM_INPUT_PORTS;
> @@ -816,6 +817,7 @@ static int cvm_oct_probe(struct platform_device *pdev)
>  			}
>  
>  			/* Initialize the device private structure. */
> +			SET_NETDEV_DEV(dev, &pdev->dev);
>  			priv = netdev_priv(dev);
>  			priv->netdev = dev;
>  			priv->of_node = cvm_oct_node_for_port(pip, interface,
>
David Miller Dec. 21, 2016, 3:20 a.m. UTC | #2
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 20 Dec 2016 17:02:37 -0800

> On 12/14/2016 05:13 PM, Florian Fainelli wrote:
>> The Octeon driver calls into PHYLIB which now checks for
>> net_device->dev.parent, so make sure we do set it before calling into
>> any MDIO/PHYLIB related function.
>> 
>> Fixes: ec988ad78ed6 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
>> Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> 
> Greg, David, since this is a fix for a regression introduced in the net
> tree, it may make sense that David take it via his tree.

Since the change in question is in Linus's tree, it's equally valid
for Greg to take it as well.
Florian Fainelli Dec. 27, 2016, 10:15 p.m. UTC | #3
On 12/20/2016 07:20 PM, David Miller wrote:
> From: Florian Fainelli <f.fainelli@gmail.com>
> Date: Tue, 20 Dec 2016 17:02:37 -0800
> 
>> On 12/14/2016 05:13 PM, Florian Fainelli wrote:
>>> The Octeon driver calls into PHYLIB which now checks for
>>> net_device->dev.parent, so make sure we do set it before calling into
>>> any MDIO/PHYLIB related function.
>>>
>>> Fixes: ec988ad78ed6 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
>>> Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
>>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>>
>> Greg, David, since this is a fix for a regression introduced in the net
>> tree, it may make sense that David take it via his tree.
> 
> Since the change in question is in Linus's tree, it's equally valid
> for Greg to take it as well.

Sure, Greg, can you take this change? Thank you!
Greg KH Jan. 3, 2017, 4:11 p.m. UTC | #4
On Tue, Dec 27, 2016 at 02:15:57PM -0800, Florian Fainelli wrote:
> On 12/20/2016 07:20 PM, David Miller wrote:
> > From: Florian Fainelli <f.fainelli@gmail.com>
> > Date: Tue, 20 Dec 2016 17:02:37 -0800
> > 
> >> On 12/14/2016 05:13 PM, Florian Fainelli wrote:
> >>> The Octeon driver calls into PHYLIB which now checks for
> >>> net_device->dev.parent, so make sure we do set it before calling into
> >>> any MDIO/PHYLIB related function.
> >>>
> >>> Fixes: ec988ad78ed6 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
> >>> Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> >>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> >>
> >> Greg, David, since this is a fix for a regression introduced in the net
> >> tree, it may make sense that David take it via his tree.
> > 
> > Since the change in question is in Linus's tree, it's equally valid
> > for Greg to take it as well.
> 
> Sure, Greg, can you take this change? Thank you!

Will do so now, thanks,

greg k-h
diff mbox

Patch

diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 8130dfe89745..4971aa54756a 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -770,6 +770,7 @@  static int cvm_oct_probe(struct platform_device *pdev)
 			/* Initialize the device private structure. */
 			struct octeon_ethernet *priv = netdev_priv(dev);
 
+			SET_NETDEV_DEV(dev, &pdev->dev);
 			dev->netdev_ops = &cvm_oct_pow_netdev_ops;
 			priv->imode = CVMX_HELPER_INTERFACE_MODE_DISABLED;
 			priv->port = CVMX_PIP_NUM_INPUT_PORTS;
@@ -816,6 +817,7 @@  static int cvm_oct_probe(struct platform_device *pdev)
 			}
 
 			/* Initialize the device private structure. */
+			SET_NETDEV_DEV(dev, &pdev->dev);
 			priv = netdev_priv(dev);
 			priv->netdev = dev;
 			priv->of_node = cvm_oct_node_for_port(pip, interface,