Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2232811ybi; Thu, 20 Jun 2019 11:17:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQdWPmhOgYg4qbNzKpsGz6QGUfYDxfHXW8i1KRhbI8GuUA9PUNkqwAaB8DUuoOqae+JUg+ X-Received: by 2002:a62:e806:: with SMTP id c6mr21372526pfi.158.1561054675989; Thu, 20 Jun 2019 11:17:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054675; cv=none; d=google.com; s=arc-20160816; b=R8xdZleH0PyoWjN4cn+U2/N6N3QiF/BJY0dn6PFzSLtNaZ66sIyuNclhTcMmEYCtrN 3hcgkhanzAALLBTY5J7mvoNRFyzVXi4a7zXUcvNARuMvOLJFXtg6TPbaA/DglGVdEOgs vm16qFaLe4hvGie0l75KfEN8StgtSfKueRQXUcFU8pEjEt7xEvFJZJyYpDKcHg368G7/ EgngwrO+ORW418tbo4fbn1RW+kcTZmYUpU67LeBiU9BMdBybp+harYlqJs9kxL75QL1m 2MfNMOx4cATAukkUMujkByID6vV46YzI92swn2KM/Gm5kWNskXrW5ifyJgLCM4vZo6Vw AIbw== 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=gByc9v7jyU/GfYdBtkJx+wd5p4vjnDgujhMY/A4+z7I=; b=v+9TCqe4JgBu/r/FOsrSNh1YRv8YUuOAFQKqy89iwSZwYP/e/JE/YmleIoXjIKXoPy /Sqa2al0Pc4cr+HswJWYzuPDo90FBb93wZ6L43axs4j2vNwH5MCd1lUXz56oKYc+Gd3e iPcYmMArxZVgjeoAxkBWgQLWZZhqRPZWoHw9ACsy/49sPtXu2VAwsOmu/TQ2tRd55daj sRf7/2BKY/qXQusY0hQS/ca6Ivd8EyArupSa7w5aN8xFP7OeB8Gmiq6ifBvM5fb5adpy FaHfZUbOfSTPrgqphWQXYK6FZvhI03nXR7cOx00sKYM3Mue4e3o4CXUZjL+Ey2hHocjL ZZjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U+3AbsNO; 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 g17si374059plo.69.2019.06.20.11.17.40; Thu, 20 Jun 2019 11:17:55 -0700 (PDT) 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=U+3AbsNO; 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 S1729953AbfFTSRj (ORCPT + 99 others); Thu, 20 Jun 2019 14:17:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:46944 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729951AbfFTSRg (ORCPT ); Thu, 20 Jun 2019 14:17:36 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 20F9D205F4; Thu, 20 Jun 2019 18:17:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054655; bh=UYULzn93A56phEQURk35RZhM5uJHEBZUBnFkb6r3RXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U+3AbsNOzaFvDBJbHhPU9+7Jq83Rkt3wguZmWpllnRGn/QpUVZdu4qDUrlz3a4gJs Fu4ma/9abqxbqCY48Uz9CtgHw0hg7kEfe7F1QJsXbA4Jul//R1lTU31eyMKcfEAPHk Aabajr/YbjpSy48CcKD4ns3Vbuu0MKTW9mj6TJkg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Russell King , "David S. Miller" , Sasha Levin Subject: [PATCH 5.1 84/98] net: phylink: ensure consistent phy interface mode Date: Thu, 20 Jun 2019 19:57:51 +0200 Message-Id: <20190620174353.556736178@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit c678726305b9425454be7c8a7624290b602602fc ] Ensure that we supply the same phy interface mode to mac_link_down() as we did for the corresponding mac_link_up() call. This ensures that MAC drivers that use the phy interface mode in these methods can depend on mac_link_down() always corresponding to a mac_link_up() call for the same interface mode. Signed-off-by: Russell King Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/phylink.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index d8f919fe49fd..507baa10ec70 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -51,6 +51,10 @@ struct phylink { /* The link configuration settings */ struct phylink_link_state link_config; + + /* The current settings */ + phy_interface_t cur_interface; + struct gpio_desc *link_gpio; struct timer_list link_poll; void (*get_fixed_state)(struct net_device *dev, @@ -453,12 +457,12 @@ static void phylink_resolve(struct work_struct *w) if (!link_state.link) { netif_carrier_off(ndev); pl->ops->mac_link_down(ndev, pl->link_an_mode, - pl->phy_state.interface); + pl->cur_interface); netdev_info(ndev, "Link is Down\n"); } else { + pl->cur_interface = link_state.interface; pl->ops->mac_link_up(ndev, pl->link_an_mode, - pl->phy_state.interface, - pl->phydev); + pl->cur_interface, pl->phydev); netif_carrier_on(ndev); -- 2.20.1