Commit 7cfde0af authored by Jose Abreu's avatar Jose Abreu Committed by David S. Miller
Browse files

net: stmmac: Run HWIF Quirks after getting HW caps

Currently we were running HWIF quirks before getting HW capabilities.
This is not right because some HWIF callbacks depend on HW caps.

Lets save the quirks callback and use it in a later stage.

This fixes Altera socfpga.
Signed-off-by: default avatarJose Abreu <>
Fixes: 5f0456b4

 ("net: stmmac: Implement logic to automatically select HW Interface")
Reported-by: default avatarDinh Nguyen <>
Cc: David S. Miller <>
Cc: Joao Pinto <>
Cc: Vitor Soares <>
Cc: Giuseppe Cavallaro <>
Cc: Alexandre Torgue <>
Cc: Dinh Nguyen <>
Signed-off-by: default avatarDavid S. Miller <>
parent f6a6f203
......@@ -252,13 +252,8 @@ int stmmac_hwif_init(struct stmmac_priv *priv)
return ret;
/* Run quirks, if needed */
if (entry->quirks) {
ret = entry->quirks(priv);
if (ret)
return ret;
/* Save quirks, if needed for posterior use */
priv->hwif_quirks = entry->quirks;
return 0;
......@@ -129,6 +129,7 @@ struct stmmac_priv {
struct net_device *dev;
struct device *device;
struct mac_device_info *hw;
int (*hwif_quirks)(struct stmmac_priv *priv);
struct mutex lock;
/* RX Queue */
......@@ -4135,6 +4135,13 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
if (priv->dma_cap.tsoen)
dev_info(priv->device, "TSO supported\n");
/* Run HW quirks, if any */
if (priv->hwif_quirks) {
ret = priv->hwif_quirks(priv);
if (ret)
return ret;
return 0;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment