netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next] tg3: allow ethtool -p to work for NICs in down state
@ 2019-04-02  5:07 Jon Maxwell
  2019-04-02  5:22 ` Michael Chan
  2019-04-02 17:55 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Jon Maxwell @ 2019-04-02  5:07 UTC (permalink / raw)
  To: davem, siva.kallam; +Cc: prashant, mchan, netdev, linux-kernel, jmaxwell

Make tg3 behave like other drivers and let "ethtool -p" identify the
NIC even when it's in the DOWN state. Before this patch it would get an 
error as follows if the NIC was down:

# ip link set down dev em4
# ethtool -p em4
Cannot identify NIC: Resource temporarily unavailable

With this patch ethtool identify works regardless of whether the NIC is up
or down as it does for other drivers.

Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>
---
 drivers/net/ethernet/broadcom/tg3.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 328373e0578f..3e458394f149 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -12763,9 +12763,6 @@ static int tg3_set_phys_id(struct net_device *dev,
 {
 	struct tg3 *tp = netdev_priv(dev);
 
-	if (!netif_running(tp->dev))
-		return -EAGAIN;
-
 	switch (state) {
 	case ETHTOOL_ID_ACTIVE:
 		return 1;	/* cycle on/off once per second */
-- 
2.13.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [net-next] tg3: allow ethtool -p to work for NICs in down state
  2019-04-02  5:07 [net-next] tg3: allow ethtool -p to work for NICs in down state Jon Maxwell
@ 2019-04-02  5:22 ` Michael Chan
  2019-04-02 17:55 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Chan @ 2019-04-02  5:22 UTC (permalink / raw)
  To: Jon Maxwell
  Cc: David Miller, Siva Reddy Kallam, prashant.sreedharan@broadcom.com,
	michael.chan@broadcom.com, Netdev, open list, jmaxwell

On Mon, Apr 1, 2019 at 10:09 PM Jon Maxwell <jmaxwell37@gmail.com> wrote:
>
> Make tg3 behave like other drivers and let "ethtool -p" identify the
> NIC even when it's in the DOWN state. Before this patch it would get an
> error as follows if the NIC was down:
>
> # ip link set down dev em4
> # ethtool -p em4
> Cannot identify NIC: Resource temporarily unavailable
>
> With this patch ethtool identify works regardless of whether the NIC is up
> or down as it does for other drivers.
>
> Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>

Acked-by: Michael Chan <michael.chan@broadcom.com>

We used to power down the chip in tg3_close() and that's why we cannot
do ethtool -p after close.  We don't do that any more so this is fine.
Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [net-next] tg3: allow ethtool -p to work for NICs in down state
  2019-04-02  5:07 [net-next] tg3: allow ethtool -p to work for NICs in down state Jon Maxwell
  2019-04-02  5:22 ` Michael Chan
@ 2019-04-02 17:55 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-04-02 17:55 UTC (permalink / raw)
  To: jmaxwell37; +Cc: siva.kallam, prashant, mchan, netdev, linux-kernel, jmaxwell

From: Jon Maxwell <jmaxwell37@gmail.com>
Date: Tue,  2 Apr 2019 16:07:56 +1100

> Make tg3 behave like other drivers and let "ethtool -p" identify the
> NIC even when it's in the DOWN state. Before this patch it would get an 
> error as follows if the NIC was down:
> 
> # ip link set down dev em4
> # ethtool -p em4
> Cannot identify NIC: Resource temporarily unavailable
> 
> With this patch ethtool identify works regardless of whether the NIC is up
> or down as it does for other drivers.
> 
> Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>

Applied, thanks Jon.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-02 17:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-02  5:07 [net-next] tg3: allow ethtool -p to work for NICs in down state Jon Maxwell
2019-04-02  5:22 ` Michael Chan
2019-04-02 17:55 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).