From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796130376; b=KmvZ9GiepfZq5iBSg1ckPQIY9pezwsQ56lGmuJa1vBza7ipQeP7dXSVqlcVBMc2bBTlo dNkBhAiCG9cjz6hsqSZsNTIhYVSD5Q+ZEVmutbx0hUVNOT1UPSHUXaHR/pnnSar3oSWTF GX5VcZADg+9ZgUBTIhrAPVZn0iKaaDNYaJ/HIUecPYhm2sq/K0XtJmXFubUJ7ritufaZD A2qHxHuIfxKNBiIrxR1QARU9PhhJvZ4JHXzQr4I3+TBK/AkKgLik+31kCDCOB8UVGDrH+ 7R9KTLCGHO/ea23W7V1VJynJFyxTNSYvcTBkf9N+6J/WP5YOnjPymY1ZTdSik07DTpw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796130376; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=jFVqKk0yZS0Sf2rZ3fi2bBnTnI57X3lEyvpjV6thPS8=; b=JlurwCWlULdJ0nh8fOZ7s0lU2uS6KWVmWBiCw81AfrdNgJz68CgglKhV9EihlN5zkSwO 5kn1P3mMfhlHd4SoV43dm/MZ50vDvXlp+a9z/0dmfI/5baDDZ5JHeutqhQUuAgPGzV95E cW8T2dFKWePfA2tSi43XFJ7ssxorLmvKqbMUl9MUeztpEPGBHXaXcUOIkoHXZUjFgv8fJ 2vBYY7qmSOMKStY4mM93NkPpad2HL1ZGtXYS54VX38ZRhQ4JuOBmf1wT7A++TnsMFef9M VPH0HuSPMPgHpxdOFSqdq7Jpj8N0nlI2N71JXq8/6UIeumQQm/dl/jjGXSGmAcCB/kw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=heJmK4he; arc=none smtp.remote-ip=156.67.10.101 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57568606A31A; Tue, 1 Dec 2026 13:06:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 57568606A31A 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=heJmK4he DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding: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=jFVqKk0yZS0Sf2rZ3fi2bBnTnI57X3lEyvpjV6thPS8=; b=he JmK4heK+m0O29sp5cNfiT6MVrU3D9OgL0D6PL7lwM3hWPuih4cStpgEaUa7E1u2nEBQ53njauMmJI pszUNQE88Ax5UWh7mBfNq696EN2RH4K8vtCNBcNrCAgox9LPaBLSy56NdXEgiKqKcwJQObeLRISpY olA3MMfs84ktTsk=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1xYNYL-002cO2-1J; Tue, 01 Dec 2026 14:05:49 +0100 Date: Tue, 1 Dec 2026 14:05:48 +0100 From: Andrew Lunn To: Alexey Charkov Cc: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heiner Kallweit , Russell King , Willem de Bruijn , Simon Horman , Ryan Leung , Ricardo Pardini , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 3/5] net: of_net: Derive MAC addresses from a unique device ID Message-ID: References: <20261125-rk3576-otp-cpuid-mac-v5-0-b3125c9a5fc8@flipper.net> <20261125-rk3576-otp-cpuid-mac-v5-3-b3125c9a5fc8@flipper.net> <0a48577d-32e1-4f59-8b3d-4274174bfaf1@lunn.ch> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Dec 01, 2026 at 08:17:03AM +0400, Alexey Charkov wrote: > On Tue, Dec 1, 2026 at 5:30 AM Andrew Lunn wrote: > > > > > @@ -142,7 +239,11 @@ int of_get_mac_address(struct device_node *np, u8 *addr) > > > if (!ret) > > > return 0; > > > > > > - return of_get_mac_address_nvmem(np, addr); > > > + ret = of_get_mac_address_nvmem(np, addr); > > > + if (!ret || ret == -EPROBE_DEFER) > > > + return ret; > > > > You need to be careful here. There might be devices which currently > > work because they return EPROBE_DEFER here and try again later. > > But that's exactly why I'm catching EPROBE_DEFER and returning it > immediately, so that the driver core can retry once the NVMEM cell > appears, instead of falling through to the next case. Am I missing > anything? > > > Also, none of the other sources of the MAC address in this function > > special case it. > > I don't think any of the others can defer, because they don't rely on > an external provider. While NVMEM relies on the nvmem driver, which > might be a module. Ah, this function is not great. Generally we consider real errors as fatal and return them. EIO, ETIMEDOUT, EINVAL etc indicate something has gone wrong. EPROBE_DEFER would also fall into that class. Errors like ENODEV would indicate the property does not exist, and we should try the next. However, this code does not do that. All errors are ignored, and the next source is tried. So your change is correct, in this context. And it is probably too late to add proper error handling. Reviewed-by: Andrew Lunn Andrew