Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4811817yba; Tue, 30 Apr 2019 04:55:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxP9F/AB90CrNio+hiTVqjXk2eOk025ruv/OnlIT5dDLu8EOpLDvvJ03TbyHcnWetvDsZqo X-Received: by 2002:a17:902:2f:: with SMTP id 44mr68869681pla.137.1556625333515; Tue, 30 Apr 2019 04:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556625333; cv=none; d=google.com; s=arc-20160816; b=Ek0u3IclejsZEiDlJ1E44CWokIa+r5pnYq+HjloLU1RdTjY5YuUMtRHA8LPKHDf7F/ HaAircGbwkf3fy1AwIFaYLYuJqgiZEIbgwAcC5yKWQVtbaawqZT2IDx1VO5TC9HiqbNR OUVMcnYBfwqPVnMJtG3eSLzyH2dsVFB7MnvqGx3CEp1XEvOqJJIDeDfeQtCTN2Mkihol meNKteVyfgQ8/ZjhFsyaFWnPjZderyiqJMdtjhZtu3H8Lgn/nH2JedrgEmCM06ZYD7fa dzMoYbQg3+JoZeeCtzgLAJRzcy8dUkWSSjh7F2zMD2XWnLKsDD9GBIxS3m/m4DuTpdVN LvHw== 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=QcpAQVUFQNvbLGN+oPB/j9+mloKut8jPG6E7qDOVtGw=; b=gOZLsrzJBcCJkI3dMNjLy3li3e1cWXHHCeMnaSOh7aH0XYxszK5yxrUBmpdSNWjjsx fGF2XguCqF8It2Zwd6QquPTxm6bev2NVx3n+twRwXZTWUxqJKofUMjNJsix3vx948pcQ IG/oMUXZ4LzYG3cDNQfeJC9avMoGlQqVyPYoyqXjKpF5YtYUdK4p6QIdMDNHpcfq5HJf 2647T9vuQtuIRcFo4Vsbs4oxsXsCJLkgeYs3y91m3BagW0gfwc5lmFJvFd43nP3ypIou tz55rZ5pflZfQ91NSI5ursqRhMb9cs4GPvbXS8sj50pA/2RJxY/lzMTx0kAVDLJk3STw gNwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=auu5QSDg; 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 b23si37102650pls.430.2019.04.30.04.55.18; Tue, 30 Apr 2019 04:55:33 -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=auu5QSDg; 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 S1730275AbfD3LvN (ORCPT + 99 others); Tue, 30 Apr 2019 07:51:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:38646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731341AbfD3LvJ (ORCPT ); Tue, 30 Apr 2019 07:51:09 -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 AE76420449; Tue, 30 Apr 2019 11:51:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556625069; bh=vek708XiY9jinTBwmhYxGV6IqDP7VclEldcAHu22gA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=auu5QSDgz7vDfdbkQCFO1EoGZ/UuULiIwfb1ButX0JH2dFlL0YEf8FFi0QP3x1Ipb L4BwuxqNBFnf3K0Q2H672O6h8BBW7nbw7m96jos1WhG/n8f6IqhPb+mZjvADI8/teA OE5BKH8vE0YttJSxwnBbkjLNiD96ObWtCL+qgI+E= 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 5.0 78/89] net: stmmac: move stmmac_check_ether_addr() to driver probe Date: Tue, 30 Apr 2019 13:39:09 +0200 Message-Id: <20190430113613.428250383@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190430113609.741196396@linuxfoundation.org> References: <20190430113609.741196396@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 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 @@ -2590,8 +2590,6 @@ static int stmmac_open(struct net_device u32 chan; int ret; - stmmac_check_ether_addr(priv); - if (priv->hw->pcs != STMMAC_PCS_RGMII && priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI) { @@ -4265,6 +4263,8 @@ int stmmac_dvr_probe(struct device *devi if (ret) goto error_hw_init; + stmmac_check_ether_addr(priv); + /* Configure real RX and TX queues */ netif_set_real_num_rx_queues(ndev, priv->plat->rx_queues_to_use); netif_set_real_num_tx_queues(ndev, priv->plat->tx_queues_to_use);