diff mbox series

[net-next,2/3] dpaa2-eth: add phylink_mac_ops stub callbacks

Message ID 1574363727-5437-3-git-send-email-ioana.ciornei@nxp.com
State Changes Requested
Delegated to: David Miller
Headers show
Series dpaa2-eth: MAC phylink fixes | expand

Commit Message

Ioana Ciornei Nov. 21, 2019, 7:15 p.m. UTC
For the moment, we do not have a way to query the PCS link state
or to restart aneg on it. Add stub functions for both of the callbacks
since phylink can provoke an oops when an SFP module has been inserted.

Fixes: 719479230893 ("dpaa2-eth: add MAC/PHY support through phylink")
Reported-by: Russell King <linux@armlinux.org.uk>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Russell King (Oracle) Nov. 22, 2019, 12:27 a.m. UTC | #1
On Thu, Nov 21, 2019 at 09:15:26PM +0200, Ioana Ciornei wrote:
> For the moment, we do not have a way to query the PCS link state
> or to restart aneg on it. Add stub functions for both of the callbacks
> since phylink can provoke an oops when an SFP module has been inserted.
> 
> Fixes: 719479230893 ("dpaa2-eth: add MAC/PHY support through phylink")
> Reported-by: Russell King <linux@armlinux.org.uk>
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>

This is independent of patch 1.

Acked-by: Russell King <rmk+kernel@armlinux.org.uk>

> ---
>  drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
> index 0200308d1bc7..efc587515661 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
> @@ -183,11 +183,24 @@ static void dpaa2_mac_link_down(struct phylink_config *config,
>  		netdev_err(mac->net_dev, "dpmac_set_link_state() = %d\n", err);
>  }
>  
> +static void dpaa2_mac_an_restart(struct phylink_config *config)
> +{
> +	/* Not supported */
> +}
> +
> +static void dpaa2_mac_pcs_get_state(struct phylink_config *config,
> +				    struct phylink_link_state *state)
> +{
> +	/* Not supported */
> +}
> +
>  static const struct phylink_mac_ops dpaa2_mac_phylink_ops = {
>  	.validate = dpaa2_mac_validate,
>  	.mac_config = dpaa2_mac_config,
>  	.mac_link_up = dpaa2_mac_link_up,
>  	.mac_link_down = dpaa2_mac_link_down,
> +	.mac_an_restart = dpaa2_mac_an_restart,
> +	.mac_pcs_get_state = dpaa2_mac_pcs_get_state,
>  };
>  
>  bool dpaa2_mac_is_type_fixed(struct fsl_mc_device *dpmac_dev,
> -- 
> 1.9.1
> 
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
index 0200308d1bc7..efc587515661 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
@@ -183,11 +183,24 @@  static void dpaa2_mac_link_down(struct phylink_config *config,
 		netdev_err(mac->net_dev, "dpmac_set_link_state() = %d\n", err);
 }
 
+static void dpaa2_mac_an_restart(struct phylink_config *config)
+{
+	/* Not supported */
+}
+
+static void dpaa2_mac_pcs_get_state(struct phylink_config *config,
+				    struct phylink_link_state *state)
+{
+	/* Not supported */
+}
+
 static const struct phylink_mac_ops dpaa2_mac_phylink_ops = {
 	.validate = dpaa2_mac_validate,
 	.mac_config = dpaa2_mac_config,
 	.mac_link_up = dpaa2_mac_link_up,
 	.mac_link_down = dpaa2_mac_link_down,
+	.mac_an_restart = dpaa2_mac_an_restart,
+	.mac_pcs_get_state = dpaa2_mac_pcs_get_state,
 };
 
 bool dpaa2_mac_is_type_fixed(struct fsl_mc_device *dpmac_dev,