Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1756513ybh; Tue, 14 Jul 2020 06:36:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSSz7I0NKp3ONpVAyjZwVsrQnrLreOL+4g0dYxB3H28cf0OQOjiuo+nEoEdUryl5BFo4Wc X-Received: by 2002:a17:906:af43:: with SMTP id ly3mr4381372ejb.381.1594733789828; Tue, 14 Jul 2020 06:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594733789; cv=none; d=google.com; s=arc-20160816; b=lrJbYPQxCxPONmiNY2GsOekGDmrRsHqzjOu92kS0qhBP/Z5jQLJwxyn2Bxm6+adSbv UQgjUbJulnVTlu87RxjDnclJFUUzRdvERl0SytDCS83zUPNIbs8QQLIsuv1xyiB2zt6+ XvIMVAuYycasafcktOZiO5dDEyOgAGYfaPU5NI6zPOASjbpv5N+B7hrLchxum/f47Kcv Whytt83Tw0w7XrKwdyahm2omudLuA/olmb/2UOI/bVDHljY7vApKX3Wouh8NZqePg5oa hr4nQBlDSziBDoruDE1sMqtXwuNtPCXOsQEHjYjvl9oRUL7rt15olYkeNGxNJL6praI0 D1sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=cdvLuXPP8DA/0bawMT7HGnpZx0aY4cHv19IOeTcGUjk=; b=AnQYoVxZq8eOAAQ/IGQ8sZu3hp1LP4ef2fomhN1wss0jHY1cFnphZhAuCW6sdTaM0G 1KapkUn4Co7Jhm/LdrlD1ziH+jFeYenRNbfr1FEciElthTXxt7vmMQacHrCv6MPU/ddm sWAo5QsF+kwr8Gki8RiIKnTmWJi/oojtpolSfRQkZ9AbC6ui8AjoVEoksSxN2hzki0LS cx6xY6ZEPeZz94GHtuKaD1hndPLTw/rfEBKQDmuAhU5sTYokaupyuQo0reT93qZHk3nf 3Tmp66mJaY3wQtwTketw4Mzg6zqybTp95Slr/omkOv5f2yMRSB1UUJB4z5Y6DUVvzO7Y VIDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s3si11566924edq.57.2020.07.14.06.36.05; Tue, 14 Jul 2020 06:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728594AbgGNNfU (ORCPT + 99 others); Tue, 14 Jul 2020 09:35:20 -0400 Received: from inva021.nxp.com ([92.121.34.21]:48226 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727950AbgGNNfR (ORCPT ); Tue, 14 Jul 2020 09:35:17 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 710BB201016; Tue, 14 Jul 2020 15:35:15 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 654262001B2; Tue, 14 Jul 2020 15:35:15 +0200 (CEST) Received: from fsr-ub1864-126.ea.freescale.net (fsr-ub1864-126.ea.freescale.net [10.171.82.212]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 26AC3205A4; Tue, 14 Jul 2020 15:35:15 +0200 (CEST) From: Ioana Ciornei To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Ioana Ciornei Subject: [PATCH 1/6] staging: dpaa2-ethsw: fix reported link state Date: Tue, 14 Jul 2020 16:34:26 +0300 Message-Id: <20200714133431.17532-2-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200714133431.17532-1-ioana.ciornei@nxp.com> References: <20200714133431.17532-1-ioana.ciornei@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On the .ndo_open() callback set netif_carrier_off() until the link state interrupt is received so that the LOWER_UP flag does not show up incorrectly in the output of 'ip link show'. Signed-off-by: Ioana Ciornei --- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c index 546ad376df99..46aa37093e86 100644 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c @@ -473,6 +473,13 @@ static int port_open(struct net_device *netdev) /* No need to allow Tx as control interface is disabled */ netif_tx_stop_all_queues(netdev); + /* Explicitly set carrier off, otherwise + * netif_carrier_ok() will return true and cause 'ip link show' + * to report the LOWER_UP flag, even though the link + * notification wasn't even received. + */ + netif_carrier_off(netdev); + err = dpsw_if_enable(port_priv->ethsw_data->mc_io, 0, port_priv->ethsw_data->dpsw_handle, port_priv->idx); -- 2.25.1