Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3485948imu; Sun, 11 Nov 2018 16:10:53 -0800 (PST) X-Google-Smtp-Source: AJdET5d5z8At2BgpwxywDz7oy/NCoNfzqnt6gTYJKvu3eroyPY5CBp5wLEus1SZHf1G2roXptY1I X-Received: by 2002:a63:3c44:: with SMTP id i4mr15374175pgn.286.1541981453205; Sun, 11 Nov 2018 16:10:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981453; cv=none; d=google.com; s=arc-20160816; b=cXxe52J6C70JRKIK7zR8pZnKoLHA1pRcj4jofdDTL/TBv1w1o/ILp5sXIAkpJnsprC BJMusMuprX976beg35hi6w18N2fTTgcJn2JM7wcQElRWVlUUhJxmJp1F2fkaWaPyr6Lb BxO618+K1RoxyFi1dV8i4PJp7hnid6tvT3MLdzdhfHlCHIEG8jRpzDXz82Oij3dK6LLO yBna7FTlvlZFXQK3b9hKU4xv0ZGDMduCHSjyleywpfD2h7kZhf8gte0aMd2t93v8KpWp MLeL7vmr44FrFuOXXKotoja/kzo2scUAfoiqfXn9SyxKzcFKGV3aHY4o63VCOjW4LB42 QRDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CRAcdOtOXNxC17PeT7Tb5n7TaTT5KuqnqleGQ/j3lCo=; b=Vo8wPe/DNkG+JFokU8NrZrR8y9iCTTb6ecxUP4hmEXctAjMchb+iT8gEdYWsNQxOZI GZ0D1jUm7m3xxPesQJ9Wp3++E/qpSGr7DW9Npehz3tD4QC9Xu2AB+NZN6j4af79DBSKC Qtn8Sxkf3ZNFI5zMRVjpHBBFhcA6vKP0Ci2THSUZz39B1/P04Lq8xex5fcGUVl7XjWOz 8m3ayvl7FtclrmrVPTab5bK2jo0e/moT8kdObEXO500vOZoyA8eCMI7Lf1ILPjIHpbmP 2lPPjgc/825iLIwJ1DUvz/uQ12eeIpXsGPRHRzg2kBKuloyFAOD36NlZLOhyrRAEDruq Z9bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OFEhYsvM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si13719961pgs.264.2018.11.11.16.10.38; Sun, 11 Nov 2018 16:10:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OFEhYsvM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731142AbeKLIR3 (ORCPT + 99 others); Mon, 12 Nov 2018 03:17:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:60278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731012AbeKLIR2 (ORCPT ); Mon, 12 Nov 2018 03:17:28 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 83EF921508; Sun, 11 Nov 2018 22:27:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975252; bh=rCJs9OuvTiJQKweACCj1eYVs1IIonDkDDo3sfe74oqc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OFEhYsvMuBLM9xOg3J+91ppEAzHbIkfbqJc9upj4xa41kjjyTcp1YGq09muUMrJKe wLfJ6MOcV1AGagOVi4nVD+A7NgZsMxFToKYI3vWn0a5ENgGA1wCQqGT92zkIo2t0oQ 9oNo15R86lY5ng3Jzz375BeNAC2+GjSif0HOtbvw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Antoine Tenart , Russell King , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 102/361] net: phy: phylink: ensure the carrier is off when starting phylink Date: Sun, 11 Nov 2018 14:17:29 -0800 Message-Id: <20181111221633.985072099@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Antoine Tenart [ Upstream commit aeeb2e8fdefdd5d257a1446351c70cb3df540199 ] Phylink made an assumption about the carrier state being down when calling phylink_start(). If this assumption isn't satisfied, the internal phylink state could misbehave and a net device could end up not being functional. This patch fixes this by explicitly calling netif_carrier_off() in phylink_start(). Signed-off-by: Antoine Tenart Acked-by: Russell King Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/phylink.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -907,6 +907,9 @@ void phylink_start(struct phylink *pl) phylink_an_mode_str(pl->link_an_mode), phy_modes(pl->link_config.interface)); + /* Always set the carrier off */ + netif_carrier_off(pl->netdev); + /* Apply the link configuration to the MAC when starting. This allows * a fixed-link to start with the correct parameters, and also * ensures that we set the appropriate advertisement for Serdes links.