From patchwork Wed May 15 10:53:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 164272 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp607201ili; Wed, 15 May 2019 04:06:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxDGDnC6YOd2NLXbRpN2x+9LyI7JzW8rpRCNw6GbnAGBJywvznx034UXQ/ysuxrfFIK58y X-Received: by 2002:a17:902:7e4f:: with SMTP id a15mr43703906pln.205.1557918388187; Wed, 15 May 2019 04:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557918388; cv=none; d=google.com; s=arc-20160816; b=nFF4zq/1/3O/Zh+/MA/2LFXZcpBNi6F6Jn79BJ2EtxOaNzYia2/hib3h4lZsIc7YQn qE//qoh0j+svQ/eK2l2rv1R83iS8vITHCh1fckfWvhfgIoewcXwTSAKcUi14NhuNn22F OTcEk90jKH5SuZpeUvvVSaq3v5SdrC+e3XDd7sh6bNGQnb1Xs/UAWTJJnU+rA6IOwjBm 1zMIxwyR0rbSc+Li3/bpONplniH/1PBi/L33ijdwFCvm89xidhvp0xZsmQkIKcF0mNY8 GGUwEqy6X1M5J1o0o92IIADuC2BhhZIpMYvd0NYKgmFO0t0TKwe2UPdAHksFu17E2Z+B cviw== 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=v/ZtVOEPpFDZuxF7nRB5FpmyhFUiI+oAD0n+nbJ1UIQ=; b=b+P7LVxG2IDokMmyINH4MwIYnNobJO5g1kUhHxb01tC1e/UU3yU4ymhSthut7LJwLA TRuPM3WAiVJE5o1WM62S8P3xKOBQfxqRFB/4kHXgDkD/cH/cuS8sTjMRghh9m+t406Ai MrARftIEIsYyuvAMk2vnQ4ZhKzk8BWdMaXHF2/5pNQxSay0L6abhQstV/zjni4p6WPPr eWdxdijJIyzuByE5XsAshxSAEnj9gG8HI0Z5+uQLzjO+mzX24YXgCKRAK3BQ14TH0arG X6UtDRbWDR7ArnMswq+gLF5zcKZonvwA4pQdltQWoGMAH24iDyCa1t68Hb5WYLh0b0UU F4yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JFrPqZIE; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 t5si1594777pgj.258.2019.05.15.04.06.26; Wed, 15 May 2019 04:06:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=JFrPqZIE; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727907AbfEOLEs (ORCPT + 14 others); Wed, 15 May 2019 07:04:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:34482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728501AbfEOLEr (ORCPT ); Wed, 15 May 2019 07:04:47 -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 AA76120881; Wed, 15 May 2019 11:04:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557918287; bh=nTbrl9azwyWAMVKJYg5a+5jWC/xxOt9b14id91UCd9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JFrPqZIE4gkfXjhu2gS1yWXmx73ZxSkxImBmQ6WYhkPYBHJU9CPGWOn373WIgNjkg NTjPKdCiqhLznbNkuEO2eNszxrJjtFHVHsx1VdlKqCzLRHhkEl30Kpd70/djP1dDsb N+8/MiWAWwtZa17m2ju2s8vPbe7+WxU9ihNL97ZY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiaofei Shen , Sneh Shah , Vinod Koul , Andrew Lunn , "David S. Miller" Subject: [PATCH 4.4 077/266] net: stmmac: move stmmac_check_ether_addr() to driver probe Date: Wed, 15 May 2019 12:53:04 +0200 Message-Id: <20190515090725.043029269@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090722.696531131@linuxfoundation.org> References: <20190515090722.696531131@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vinod Koul [ Upstream commit b561af36b1841088552464cdc3f6371d92f17710 ] stmmac_check_ether_addr() checks the MAC address and assigns one in driver open(). In many cases when we create slave netdevice, the dev addr is inherited from master but the master dev addr maybe NULL at that time, so move this call to driver probe so that address is always valid. Signed-off-by: Xiaofei Shen Tested-by: Xiaofei Shen Signed-off-by: Sneh Shah Signed-off-by: Vinod Koul Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1792,8 +1792,6 @@ static int stmmac_open(struct net_device struct stmmac_priv *priv = netdev_priv(dev); int ret; - stmmac_check_ether_addr(priv); - if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs != STMMAC_PCS_TBI && priv->pcs != STMMAC_PCS_RTBI) { ret = stmmac_init_phy(dev); @@ -2929,6 +2927,8 @@ int stmmac_dvr_probe(struct device *devi if (ret) goto error_hw_init; + stmmac_check_ether_addr(priv); + ndev->netdev_ops = &stmmac_netdev_ops; ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |