Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp968990lqo; Fri, 17 May 2024 07:07:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXyiYnFHJkxkXLrv1iGcwHHMWDglkDxQpjk0NMxtAY0zU3GCXUWx/E2+5MeHgq2P7pKLqID1OsVKiM9TMVnprVmlRB/maC767kUCzYFqw== X-Google-Smtp-Source: AGHT+IF9cvJPXkAmyGY13inefxy4O1AUtOm/B8aVnE9OScqmjHcWCuhEgjeikHoIxxKjNjx14Kdz X-Received: by 2002:a05:6808:f15:b0:3c9:9307:563 with SMTP id 5614622812f47-3c996f4b3c5mr26406569b6e.0.1715954844231; Fri, 17 May 2024 07:07:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715954844; cv=pass; d=google.com; s=arc-20160816; b=jzFRmZrehCAq0jUMaghV7yMZpaCnU8s4jLqa/zV50L+nNdOKj/KiutqQe1qyrYx+DO YO496G8mwaOgMSMhMBlOL7pObv2CsGXjfXLLlgqndxZEdzENuaAYB0qdCs0O0d+F4sR1 mB31C/U52Qd1e7wB65YZnxX48Oj4nOEC7zBQtk05J7/AwlRfeJt9J5LNZVeQEtZWPHrw i3HhaPfbRZWWTpAJqkCiuUQZe0tybWRGO9WkYY9+4+RZknaIdn3Vw9C/uyhrsO89NFh/ YrlUVEN/PeIbnHjxntdEPFj3JB9u1w/BmUmaa5nU2C8NM97NedVWp4t3GL5pt3GklSPI ZFxw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KlplUe8Ht1enlQJkqiZ1Vrv1E6x10yAgj42W7lSPNo0=; fh=q2wPXpWCm1ur8Fq3msniAKF8Gq+zwEk5/NCM12tnXpY=; b=XEFvH5p7h+h5EdeQe2hN4ERLAr50aWovasb8rVcjR+aapkva6LCucYU7CMiokhc5NM 5p8ehCdMsCQz32t4BlwKeyjVLLcbypcr+QgMgVv4zCaRszdPaF5cNifkcw9cH5wgFa4N ih06oWRdILxJsNxv2sHOKBKZbdHKx+d27fWf6WzwCUZfNHGmVUJnn1+oaRfIi3tPNN9S sD8z0QBMiZWXcSUt2EpL8OJET80pkJAwsd0IuS/5TXxI17mi20dPaUUmo8VhY5CM1H7/ EAWnwve/vYy81PQlkjUm5ocWShQ1fV4nd7VR9fTmr0siY2bPikWpn5NTb6J+QyaI4O8Q 43fQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=OOfFO3mK; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-182171-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182171-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a1e0cc1a2514c-7f8ffa09d12si3765627241.49.2024.05.17.07.07.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 07:07:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182171-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=OOfFO3mK; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-182171-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182171-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BB5C31C2294F for ; Fri, 17 May 2024 14:07:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 501E45C60D; Fri, 17 May 2024 14:07:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="OOfFO3mK" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A55D91E507; Fri, 17 May 2024 14:07:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715954834; cv=none; b=fFU1ahdWAr2uezDXGNkQxRyYluiiIGldZsEC3DLhIfC7AF7P3JvWGT21/StiRyk/6XaMGLATW9okL6H0XXPiK1OEiFDSqQTDHv9qKRs3L1kE9pNvfgBtJzZueeLvKNw69YNlKLc3hy2e4UGECNz4xzTSuoy/04sfvZ2VAOv7jps= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715954834; c=relaxed/simple; bh=58zpZNrKH2bAbX6lE62TvJuqFc/Sa70l+BacQmg0IuE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JwbJAmXjLEbmvSRQcO3P9POhwuw2E7AnI1OwfQC3jHSx68OxZ26oFsedAj/gPuem3gzYPcscgBR1vXAe6NGFRwLHUcsJfeedLy13ZtOGzF2i9gXuhWl2huAwRZ1OfcYgXOXbPujUgjrXaNTtAZLo8wC+Wegn5gN4zuyncCys1bk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=OOfFO3mK; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=KlplUe8Ht1enlQJkqiZ1Vrv1E6x10yAgj42W7lSPNo0=; b=OOfFO3mKJHphCnd2wpvhhgeC3a tf33ucAw550xP77EhoxjPIV+u5LmiBv8Fhs2OZMIW5zkfSPlvYuvNrFBF0uR3Tc7a4Ek0Ux9SCUdG /n9zjJcQXSSguYSperSvp+M7avM7A+45fI5Qyy/HbAhsWbtooRwbkedzuRpEYdKFGVYE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1s7yEm-00FZwy-BQ; Fri, 17 May 2024 16:07:08 +0200 Date: Fri, 17 May 2024 16:07:08 +0200 From: Andrew Lunn To: "Leon M. Busch-George" Cc: linux-kernel@vger.kernel.org, "David S. Miller" , devicetree@vger.kernel.org, netdev@vger.kernel.org, Matthias Brugger Subject: Re: [PATCH 1/2] net: add option to ignore 'local-mac-address' property Message-ID: <7471f037-f396-4924-8c8d-e704507de361@lunn.ch> References: <20240517123909.680686-1-leon@georgemail.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240517123909.680686-1-leon@georgemail.de> On Fri, May 17, 2024 at 02:39:07PM +0200, Leon M. Busch-George wrote: > From: "Leon M. Busch-George" > > Here is the definition of a mac that looks like its address would be > loaded from nvmem: > > mac@0 { > compatible = "mediatek,eth-mac"; > reg = <0>; > phy-mode = "2500base-x"; > phy-handle = <&rtl8221b_phy>; > > nvmem-cell-names = "mac-address"; > nvmem-cells = <&macaddr_bdinfo_de00 1>; /* this is ignored */ > }; > > Because the boot program inserts a 'local-mac-address', which is preferred > over other detection methods, the definition using nvmem is ignored. > By itself, that is only a mild annoyance when dealing with device trees. > After all, the 'local-mac-address' property exists primarily to pass MAC > addresses to the kernel. > > But it is also possible for this address to be randomly generated (on each > boot), which turns an annoyance into a hindrance. In such a case, it is no > longer possible to set the correct address from the device tree. This > behaviour has been observed on two types of MT7981B devices from different > vendors (Cudy M3000, Yuncore AX835). > > Restore the ability to set addresses through the device tree by adding an > option to ignore the 'local-mac-address' property. I'm not convinced you are fixing the right thing here. To me, this is the bootloader which is broken. You should be fixing the bootloader. One concession might be, does the bootloader correctly generate a random MAC address? i.e. does it have the locally administered bit set? If that bit is set, and there are other sources of a MAC address, then it seems worth while checking them to see if there is a better MAC address available, which as global scope. Andrew