From mboxrd@z Thu Jan 1 00:00:00 1970 From: mans@mansr.com (=?iso-8859-1?Q?M=E5ns_Rullg=E5rd?=) Date: Tue, 14 Nov 2017 12:38:59 +0000 Subject: [PATCH v3 2/4] net: nb8800: Simplify nb8800_pause_config() In-Reply-To: (Marc Gonzalez's message of "Tue, 14 Nov 2017 11:55:40 +0100") References: <230165aa-eaf1-6e2b-7ff3-45b3ee4ffc62@sigmadesigns.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Marc Gonzalez writes: > The "flow control enable" bit can be tweaked, even if DMA is enabled. No, it can't. Maybe on some of your newer chips it can, but not on the older ones. > Signed-off-by: Marc Gonzalez > --- > drivers/net/ethernet/aurora/nb8800.c | 18 +----------------- > 1 file changed, 1 insertion(+), 17 deletions(-) > > diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c > index 26f719e2d6ca..09b8001e1ecc 100644 > --- a/drivers/net/ethernet/aurora/nb8800.c > +++ b/drivers/net/ethernet/aurora/nb8800.c > @@ -633,7 +633,6 @@ static void nb8800_pause_config(struct net_device *dev) > { > struct nb8800_priv *priv = netdev_priv(dev); > struct phy_device *phydev = dev->phydev; > - u32 rxcr; > > if (priv->pause_aneg) { > if (!phydev || !phydev->link) > @@ -644,22 +643,7 @@ static void nb8800_pause_config(struct net_device *dev) > } > > nb8800_modb(priv, NB8800_RX_CTL, RX_PAUSE_EN, priv->pause_rx); > - > - rxcr = nb8800_readl(priv, NB8800_RXC_CR); > - if (!!(rxcr & RCR_FL) == priv->pause_tx) > - return; > - > - if (netif_running(dev)) { > - napi_disable(&priv->napi); > - netif_tx_lock_bh(dev); > - nb8800_dma_stop(dev); > - nb8800_modl(priv, NB8800_RXC_CR, RCR_FL, priv->pause_tx); > - nb8800_start_rx(dev); > - netif_tx_unlock_bh(dev); > - napi_enable(&priv->napi); > - } else { > - nb8800_modl(priv, NB8800_RXC_CR, RCR_FL, priv->pause_tx); > - } > + nb8800_modl(priv, NB8800_RXC_CR, RCR_FL, priv->pause_tx); > } > > static void nb8800_link_reconfigure(struct net_device *dev) > -- -- M?ns Rullg?rd From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= Subject: Re: [PATCH v3 2/4] net: nb8800: Simplify nb8800_pause_config() Date: Tue, 14 Nov 2017 12:38:59 +0000 Message-ID: References: <230165aa-eaf1-6e2b-7ff3-45b3ee4ffc62@sigmadesigns.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: Florian Fainelli , Mason , netdev , Thibaud Cornic , David Miller , Linux ARM To: Marc Gonzalez Return-path: In-Reply-To: (Marc Gonzalez's message of "Tue, 14 Nov 2017 11:55:40 +0100") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org List-Id: netdev.vger.kernel.org Marc Gonzalez writes: > The "flow control enable" bit can be tweaked, even if DMA is enabled. No, it can't. Maybe on some of your newer chips it can, but not on the older ones. > Signed-off-by: Marc Gonzalez > --- > drivers/net/ethernet/aurora/nb8800.c | 18 +----------------- > 1 file changed, 1 insertion(+), 17 deletions(-) > > diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/= aurora/nb8800.c > index 26f719e2d6ca..09b8001e1ecc 100644 > --- a/drivers/net/ethernet/aurora/nb8800.c > +++ b/drivers/net/ethernet/aurora/nb8800.c > @@ -633,7 +633,6 @@ static void nb8800_pause_config(struct net_device *de= v) > { > struct nb8800_priv *priv =3D netdev_priv(dev); > struct phy_device *phydev =3D dev->phydev; > - u32 rxcr; > > if (priv->pause_aneg) { > if (!phydev || !phydev->link) > @@ -644,22 +643,7 @@ static void nb8800_pause_config(struct net_device *d= ev) > } > > nb8800_modb(priv, NB8800_RX_CTL, RX_PAUSE_EN, priv->pause_rx); > - > - rxcr =3D nb8800_readl(priv, NB8800_RXC_CR); > - if (!!(rxcr & RCR_FL) =3D=3D priv->pause_tx) > - return; > - > - if (netif_running(dev)) { > - napi_disable(&priv->napi); > - netif_tx_lock_bh(dev); > - nb8800_dma_stop(dev); > - nb8800_modl(priv, NB8800_RXC_CR, RCR_FL, priv->pause_tx); > - nb8800_start_rx(dev); > - netif_tx_unlock_bh(dev); > - napi_enable(&priv->napi); > - } else { > - nb8800_modl(priv, NB8800_RXC_CR, RCR_FL, priv->pause_tx); > - } > + nb8800_modl(priv, NB8800_RXC_CR, RCR_FL, priv->pause_tx); > } > > static void nb8800_link_reconfigure(struct net_device *dev) > -- = -- = M=E5ns Rullg=E5rd