net: stmmac: Add check for HWTSTAMP_FILTER_ALL filter

-HWTSTAMP_FILTER_ALL with ipa enabled not supported.
-Add check for above condition to avoid crash.

Change-Id: I443122489aa257be5208bdf6260b2b3a9c8096c1
Acked-by: Ning Cai <ncai@qti.qualcomm.com>
Signed-off-by: Sunil Paidimarri <hisunil@codeaurora.org>
tirimbino
Sunil Paidimarri 5 years ago
parent 31f91c4c18
commit 53b6970ecd
  1. 8
      drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
  2. 1
      drivers/net/ethernet/stmicro/stmmac/stmmac.h
  3. 7
      drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

@ -1768,6 +1768,14 @@ static int ethqos_set_early_eth_param(struct stmmac_priv *priv,
return ret;
}
bool qcom_ethqos_ipa_enabled(void)
{
#ifdef CONFIG_ETH_IPA_OFFLOAD
return pethqos->ipa_enabled;
#endif
return false;
}
static int qcom_ethqos_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;

@ -194,5 +194,6 @@ int stmmac_dvr_probe(struct device *device,
struct stmmac_resources *res);
void stmmac_disable_eee_mode(struct stmmac_priv *priv);
bool stmmac_eee_init(struct stmmac_priv *priv);
bool qcom_ethqos_ipa_enabled(void);
#endif /* __STMMAC_H__ */

@ -539,6 +539,13 @@ static int stmmac_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr)
sizeof(struct hwtstamp_config)))
return -EFAULT;
if (qcom_ethqos_ipa_enabled() &&
config.rx_filter == HWTSTAMP_FILTER_ALL) {
netdev_alert(priv->dev,
"No hw timestamping since ipa is enabled\n");
return -EOPNOTSUPP;
}
netdev_dbg(priv->dev, "%s config flags:0x%x, tx_type:0x%x, rx_filter:0x%x\n",
__func__, config.flags, config.tx_type, config.rx_filter);

Loading…
Cancel
Save