mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
net: stmmac: Drop TBI/RTBI PCS flags
First of all the flags are never set by any of the driver parts. If nobody have them set then the respective statements will always have the same result. Thus the statements can be simplified or even dropped with no risk to break things. Secondly shall any of the TBI or RTBI flag is set the MDIO-bus registration will be bypassed. Why? It really seems weird. It's perfectly fine to have a TBI/RTBI-capable PHY configured over the MDIO bus interface. Based on the notes above the TBI/RTBI PCS flags can be freely dropped thus simplifying the driver code. Reviewed-by: Andrew Halaney <ahalaney@redhat.com> Signed-off-by: Serge Semin <fancer.lancer@gmail.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Link: https://lore.kernel.org/r/E1sCErK-00EOPf-EP@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
a79d8fe2ff
commit
482b3c3ba7
2 changed files with 9 additions and 28 deletions
|
@ -271,8 +271,6 @@ struct stmmac_safety_stats {
|
||||||
/* PCS defines */
|
/* PCS defines */
|
||||||
#define STMMAC_PCS_RGMII (1 << 0)
|
#define STMMAC_PCS_RGMII (1 << 0)
|
||||||
#define STMMAC_PCS_SGMII (1 << 1)
|
#define STMMAC_PCS_SGMII (1 << 1)
|
||||||
#define STMMAC_PCS_TBI (1 << 2)
|
|
||||||
#define STMMAC_PCS_RTBI (1 << 3)
|
|
||||||
|
|
||||||
#define SF_DMA_MODE 1 /* DMA STORE-AND-FORWARD Operation Mode */
|
#define SF_DMA_MODE 1 /* DMA STORE-AND-FORWARD Operation Mode */
|
||||||
|
|
||||||
|
|
|
@ -471,13 +471,6 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
|
||||||
{
|
{
|
||||||
int eee_tw_timer = priv->eee_tw_timer;
|
int eee_tw_timer = priv->eee_tw_timer;
|
||||||
|
|
||||||
/* Using PCS we cannot dial with the phy registers at this stage
|
|
||||||
* so we do not support extra feature like EEE.
|
|
||||||
*/
|
|
||||||
if (priv->hw->pcs == STMMAC_PCS_TBI ||
|
|
||||||
priv->hw->pcs == STMMAC_PCS_RTBI)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
/* Check if MAC core supports the EEE feature. */
|
/* Check if MAC core supports the EEE feature. */
|
||||||
if (!priv->dma_cap.eee)
|
if (!priv->dma_cap.eee)
|
||||||
return false;
|
return false;
|
||||||
|
@ -3953,9 +3946,7 @@ static int __stmmac_open(struct net_device *dev,
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (priv->hw->pcs != STMMAC_PCS_TBI &&
|
if ((!priv->hw->xpcs ||
|
||||||
priv->hw->pcs != STMMAC_PCS_RTBI &&
|
|
||||||
(!priv->hw->xpcs ||
|
|
||||||
xpcs_get_an_mode(priv->hw->xpcs, mode) != DW_AN_C73)) {
|
xpcs_get_an_mode(priv->hw->xpcs, mode) != DW_AN_C73)) {
|
||||||
ret = stmmac_init_phy(dev);
|
ret = stmmac_init_phy(dev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
@ -7739,17 +7730,13 @@ int stmmac_dvr_probe(struct device *device,
|
||||||
if (!pm_runtime_enabled(device))
|
if (!pm_runtime_enabled(device))
|
||||||
pm_runtime_enable(device);
|
pm_runtime_enable(device);
|
||||||
|
|
||||||
if (priv->hw->pcs != STMMAC_PCS_TBI &&
|
|
||||||
priv->hw->pcs != STMMAC_PCS_RTBI) {
|
|
||||||
/* MDIO bus Registration */
|
|
||||||
ret = stmmac_mdio_register(ndev);
|
ret = stmmac_mdio_register(ndev);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err_probe(priv->device, ret,
|
dev_err_probe(priv->device, ret,
|
||||||
"%s: MDIO bus (id: %d) registration failed\n",
|
"MDIO bus (id: %d) registration failed\n",
|
||||||
__func__, priv->plat->bus_id);
|
priv->plat->bus_id);
|
||||||
goto error_mdio_register;
|
goto error_mdio_register;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->plat->speed_mode_2500)
|
if (priv->plat->speed_mode_2500)
|
||||||
priv->plat->speed_mode_2500(ndev, priv->plat->bsp_priv);
|
priv->plat->speed_mode_2500(ndev, priv->plat->bsp_priv);
|
||||||
|
@ -7790,8 +7777,6 @@ error_netdev_register:
|
||||||
error_phy_setup:
|
error_phy_setup:
|
||||||
stmmac_pcs_clean(ndev);
|
stmmac_pcs_clean(ndev);
|
||||||
error_pcs_setup:
|
error_pcs_setup:
|
||||||
if (priv->hw->pcs != STMMAC_PCS_TBI &&
|
|
||||||
priv->hw->pcs != STMMAC_PCS_RTBI)
|
|
||||||
stmmac_mdio_unregister(ndev);
|
stmmac_mdio_unregister(ndev);
|
||||||
error_mdio_register:
|
error_mdio_register:
|
||||||
stmmac_napi_del(ndev);
|
stmmac_napi_del(ndev);
|
||||||
|
@ -7833,10 +7818,8 @@ void stmmac_dvr_remove(struct device *dev)
|
||||||
reset_control_assert(priv->plat->stmmac_ahb_rst);
|
reset_control_assert(priv->plat->stmmac_ahb_rst);
|
||||||
|
|
||||||
stmmac_pcs_clean(ndev);
|
stmmac_pcs_clean(ndev);
|
||||||
|
|
||||||
if (priv->hw->pcs != STMMAC_PCS_TBI &&
|
|
||||||
priv->hw->pcs != STMMAC_PCS_RTBI)
|
|
||||||
stmmac_mdio_unregister(ndev);
|
stmmac_mdio_unregister(ndev);
|
||||||
|
|
||||||
destroy_workqueue(priv->wq);
|
destroy_workqueue(priv->wq);
|
||||||
mutex_destroy(&priv->lock);
|
mutex_destroy(&priv->lock);
|
||||||
bitmap_free(priv->af_xdp_zc_qps);
|
bitmap_free(priv->af_xdp_zc_qps);
|
||||||
|
|
Loading…
Add table
Reference in a new issue