From patchwork Tue Sep 19 16:17:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 113036 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp5105131qgf; Tue, 19 Sep 2017 09:18:24 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCBCkMvpSvplROnG5TZyPduJ8revD7Pzunh8kwKjoaKbJGFNGQyIy2okgLfYWHOkYihlKBM X-Received: by 10.84.129.7 with SMTP id 7mr1795765plb.40.1505837903900; Tue, 19 Sep 2017 09:18:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505837903; cv=none; d=google.com; s=arc-20160816; b=MOCBkbmlm5JtdCM9YYoeRVYZCq3KQ0KyfYb9YxsgtMjxT+DavsQCKsI1i/OSMje12o d55FIN1gqHI34629A1+iGrxtKYBTtf7HSuboaRt4SpumzlOp4OpM5PWsKJpA85x288fU rlsUVdfC9XNevaL4GnkYTebylJGky4487Qsa6g8yFo6XM6eJnH6z69Y1GslVB/eiBOi+ ILMVo3o2PVld4ozd8Jyp2lpohwGGvmx+Iuw5UB79zX08HfriJCSggDFAwlub1hPYKiQK ZswrBuGq9TsHjq1nJph1zuVOExTXEWUvneqA7/boTS7Ub87CGLq5FZrjmu/F7MTMQS8I l84g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=dDivSL0S2NUaeLKIYgOMS5Ge0Nyf8SjCpb6v/qlWZVg=; b=qaEyjf7Dc5Wi0tvk19fsrGHdo3mGUNKDUSdvdBCGZZRLT3/mq352I3Bh+KMg5XPyOZ ruGqDxTqjms6h7mdF/eOZGTXpBQYmgXnwxGRx/gJK1rTzC/9PexEGD/RPrp67DNS11QW APw1NtMR+EIkL82/ynFsuePToEG17Z3L1iO2jpENb4mhZd7Hq4CzLy3QtcTOZ6JrAwIc CamVuC4psm+ju0xflu6s/T3X++1i8+e8uTZBduwwiNbhAyTIyGmMWL4CSDi+ht6XanoR mINRzwBnZ0pyLFbgFeHuBSVosDMV7XMuGL6wfg/AFTrBT5O8SbTuriJGlK8RLaHAMOqh GjWw== ARC-Authentication-Results: i=1; mx.google.com; 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 k12si1668132pgq.184.2017.09.19.09.18.23; Tue, 19 Sep 2017 09:18:23 -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; 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 S1751929AbdISQSV (ORCPT + 26 others); Tue, 19 Sep 2017 12:18:21 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6496 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbdISQSQ (ORCPT ); Tue, 19 Sep 2017 12:18:16 -0400 Received: from 172.30.72.60 (EHLO DGGEMS414-HUB.china.huawei.com) ([172.30.72.60]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DHO40855; Wed, 20 Sep 2017 00:18:12 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.203.181.154) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.301.0; Wed, 20 Sep 2017 00:18:02 +0800 From: Salil Mehta To: CC: , , , , , , , Subject: [PATCH V2 net 4/7] net: hns3: Fixes the initialization of MAC address in hardware Date: Tue, 19 Sep 2017 17:17:13 +0100 Message-ID: <20170919161716.92680-5-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20170919161716.92680-1-salil.mehta@huawei.com> References: <20170919161716.92680-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.203.181.154] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.59C14344.01A7, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6f3075af8b9ff4e951bacf1caef2c997 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lipeng This patch fixes the initialization of MAC address, fetched from HNS3 firmware i.e. when it is not randomly generated, to the HNS3 hardware. Fixes: ca60906d2795 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Lipeng Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c index 1c3e294..4d68d6e 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c @@ -2705,10 +2705,11 @@ static void hns3_init_mac_addr(struct net_device *netdev) eth_hw_addr_random(netdev); dev_warn(priv->dev, "using random MAC address %pM\n", netdev->dev_addr); - /* Also copy this new MAC address into hdev */ - if (h->ae_algo->ops->set_mac_addr) - h->ae_algo->ops->set_mac_addr(h, netdev->dev_addr); } + + if (h->ae_algo->ops->set_mac_addr) + h->ae_algo->ops->set_mac_addr(h, netdev->dev_addr); + } static void hns3_nic_set_priv_ops(struct net_device *netdev)