diff mbox

[SRU,T/V/W] qeth: initialize net_device with carrier off

Message ID 1455125299-46337-1-git-send-email-tim.gardner@canonical.com
State New
Headers show

Commit Message

Tim Gardner Feb. 10, 2016, 5:28 p.m. UTC
From: Ursula Braun <ubraun@linux.vnet.ibm.com>

BugLink: http://bugs.launchpad.net/bugs/1541907

/sys/class/net/<interface>/operstate for an active qeth network
interface offen shows "unknown", which translates to "state UNKNOWN
in output of "ip link show". It is caused by a missing initialization
of the __LINK_STATE_NOCARRIER bit in the net_device state field.
This patch adds a netif_carrier_off() invocation when creating the
net_device for a qeth device.

Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Acked-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Reference-ID: Bugzilla 133209
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e5ebe63214d44d4dcf43df02edf3613e04d671b9)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 drivers/s390/net/qeth_l2_main.c | 1 +
 drivers/s390/net/qeth_l3_main.c | 1 +
 2 files changed, 2 insertions(+)

Comments

Kamal Mostafa Feb. 10, 2016, 8:23 p.m. UTC | #1
Clean cherry-pick. (Suitable for stable kernels too).

Note: Should also be applied to lts-utopic!
Brad Figg Feb. 11, 2016, 6:12 p.m. UTC | #2
On Wed, Feb 10, 2016 at 10:28:19AM -0700, tim.gardner@canonical.com wrote:
> From: Ursula Braun <ubraun@linux.vnet.ibm.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1541907
> 
> /sys/class/net/<interface>/operstate for an active qeth network
> interface offen shows "unknown", which translates to "state UNKNOWN
> in output of "ip link show". It is caused by a missing initialization
> of the __LINK_STATE_NOCARRIER bit in the net_device state field.
> This patch adds a netif_carrier_off() invocation when creating the
> net_device for a qeth device.
> 
> Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
> Acked-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
> Reference-ID: Bugzilla 133209
> Signed-off-by: David S. Miller <davem@davemloft.net>
> (cherry picked from commit e5ebe63214d44d4dcf43df02edf3613e04d671b9)
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
> ---
>  drivers/s390/net/qeth_l2_main.c | 1 +
>  drivers/s390/net/qeth_l3_main.c | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
> index ec8ccda..8cd15fe 100644
> --- a/drivers/s390/net/qeth_l2_main.c
> +++ b/drivers/s390/net/qeth_l2_main.c
> @@ -965,6 +965,7 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
>  	qeth_l2_request_initial_mac(card);
>  	SET_NETDEV_DEV(card->dev, &card->gdev->dev);
>  	netif_napi_add(card->dev, &card->napi, qeth_l2_poll, QETH_NAPI_WEIGHT);
> +	netif_carrier_off(card->dev);
>  	return register_netdev(card->dev);
>  }
>  
> diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
> index c1b0b27..c882aab 100644
> --- a/drivers/s390/net/qeth_l3_main.c
> +++ b/drivers/s390/net/qeth_l3_main.c
> @@ -3307,6 +3307,7 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
>  
>  	SET_NETDEV_DEV(card->dev, &card->gdev->dev);
>  	netif_napi_add(card->dev, &card->napi, qeth_l3_poll, QETH_NAPI_WEIGHT);
> +	netif_carrier_off(card->dev);
>  	return register_netdev(card->dev);
>  }
>  
> -- 
> 2.7.0
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Kamal Mostafa Feb. 11, 2016, 7:20 p.m. UTC | #3

diff mbox

Patch

diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index ec8ccda..8cd15fe 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -965,6 +965,7 @@  static int qeth_l2_setup_netdev(struct qeth_card *card)
 	qeth_l2_request_initial_mac(card);
 	SET_NETDEV_DEV(card->dev, &card->gdev->dev);
 	netif_napi_add(card->dev, &card->napi, qeth_l2_poll, QETH_NAPI_WEIGHT);
+	netif_carrier_off(card->dev);
 	return register_netdev(card->dev);
 }
 
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index c1b0b27..c882aab 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -3307,6 +3307,7 @@  static int qeth_l3_setup_netdev(struct qeth_card *card)
 
 	SET_NETDEV_DEV(card->dev, &card->gdev->dev);
 	netif_napi_add(card->dev, &card->napi, qeth_l3_poll, QETH_NAPI_WEIGHT);
+	netif_carrier_off(card->dev);
 	return register_netdev(card->dev);
 }