From patchwork Mon Oct 18 14:29:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12566641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6696DC433FE for ; Mon, 18 Oct 2021 14:31:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 328F16126A for ; Mon, 18 Oct 2021 14:31:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 328F16126A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R4V+WDXwiX1UWFkfsmLVGF8piMAU/D1LQmNEQ9fwvNE=; b=zPChxfZWfh7/9d NWasE20f4cFtIsNEOo7Jh/9XtUhRojgPEjCvHQNj3FSciHZaYaiKq2pK+xJUVARn58I5YwFTKTQq7 PKPZUI4ZXkqrjZdrpRZERl6td9dVF+J4o+GMBXHMhiTdVMatZpooZqSlglqmEUwkRGwSCOCLRmfBt 6vh0Wn+fukUlVGhohAPbYyTVm8cnNmrx/huyXnSPwoErAb7y6aMKKfcnP0itbif3SZaHosfv0Fn1b 6GEZmCtwQpKf/JU8tb5tc2+ryayiBr0JM2ActPJsOQAgMoMuUl2QWytiWfyauYvK+XxFgjH1hFM8E M49b0TCzQPZt0eLhR4bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcTeI-00G80e-5m; Mon, 18 Oct 2021 14:29:58 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcTe9-00G7zh-O3 for linux-arm-kernel@lists.infradead.org; Mon, 18 Oct 2021 14:29:51 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id E5D4A6103D; Mon, 18 Oct 2021 14:29:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634567389; bh=rxYtqshRFC/rSplWmHqaWKR8gFnDOHB5OS/vJvQB7hU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GTyDt7v1tJEtOc/cACuhOy7q9YBErgB8EcRMkppt78/GDQVRaouCjunzlMIpDmmS6 uJp6+oViMnLIVc1P8H6yZwDCLarqizOzjxB3LUGdXVuen0A6dYNOrROGT3Qi84iKDb 0ZCWjinJZWoPywtJj2IyeLvbBTQHIFn3+Gv1aQzFVzqWqo9DuIUve2Mb+kmn8l/vil eURn4bIipMTGMTxbtyopzVSTwt0KD/rEZgZUhkhCJN22nVDV6nWr3pLkWf6GdQ1ZOH Ny7PGGPtTQuE6GuDn2ncOMAyArKhflrxKmYORz60At1nyuLgtQPgSD+csBxvqqEvcT Q/1uvEYT/dOJA== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, Jakub Kicinski , vz@mleia.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next 03/12] ethernet: lpc: use eth_hw_addr_set() Date: Mon, 18 Oct 2021 07:29:23 -0700 Message-Id: <20211018142932.1000613-4-kuba@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211018142932.1000613-1-kuba@kernel.org> References: <20211018142932.1000613-1-kuba@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211018_072949_834104_DC512E5E X-CRM114-Status: GOOD ( 11.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers. Read the address into an array on the stack, then call eth_hw_addr_set(). Signed-off-by: Jakub Kicinski --- CC: vz@mleia.com CC: linux-arm-kernel@lists.infradead.org --- drivers/net/ethernet/nxp/lpc_eth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index fbfbf94e0377..a63cc295b979 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c @@ -1232,6 +1232,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) struct net_device *ndev; dma_addr_t dma_handle; struct resource *res; + u8 addr[ETH_ALEN]; int irq, ret; /* Setup network interface for RMII or MII mode */ @@ -1347,7 +1348,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) pldat->phy_node = of_parse_phandle(np, "phy-handle", 0); /* Get MAC address from current HW setting (POR state is all zeros) */ - __lpc_get_mac(pldat, ndev->dev_addr); + __lpc_get_mac(pldat, addr); + eth_hw_addr_set(ndev, addr); if (!is_valid_ether_addr(ndev->dev_addr)) { of_get_ethdev_address(np, ndev);