Subject: Re: [PATCH] ibm_newemac: emac_close() needs to call netif_carrier_off()

From: Stephen Hemminger <[email-masked]>
Date: Wed, 19 Aug 2009 14:11:36 -0700

On Wed, 19 Aug 2009 14:00:00 -0700 (PDT)
Petri Gynther <[email-masked]> wrote:

> When ibm_newemac netdev instance is shutdown with "ifconfig down",
> the netdev interface does not go properly down. netif_carrier_ok()
> keeps returning TRUE even after "ifconfig down".
> 
> The problem can be seen when ibm_newemac instances are slaves of
> a bonding interface. The bonding interface code uses netif_carrier_ok()
> to determine the link status of its slaves. When ibm_newemac slave is
> shutdown with "ifconfig down", the bonding interface won't detect any
> link status change because netif_carrier_ok() keeps returning TRUE.

Bonding should be testing for netif_running() && netif_carrier_ok().

In many devices state of carrier is undefined when device is down.