From mboxrd@z Thu Jan 1 00:00:00 1970 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 57084C433F5 for ; Tue, 16 Nov 2021 21:14:56 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55FEA61BBD for ; Tue, 16 Nov 2021 21:14:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 55FEA61BBD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4DE7782D5B; Tue, 16 Nov 2021 22:14:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="ZP0S9/Iq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 24EED82D5B; Tue, 16 Nov 2021 22:14:50 +0100 (CET) Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EC07C81FD5 for ; Tue, 16 Nov 2021 22:14:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf31.google.com with SMTP id a24so490175qvb.5 for ; Tue, 16 Nov 2021 13:14:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OHBT3DsErOnF0P72cjkV9MdDVYjEQ0VBSQj1F+cPBF4=; b=ZP0S9/IqzH4N1MTfQ4dzjSnYsXEkHPkwxgO/4mLVm3wG1f/qXrJJ776z2XQY05olMJ 7LK13mk1nX8h8/VvBnL7oljwELMVJY26O4nrd9qSC4uTLD0vzUWptlwId81ZHi44Y3Fm FI+dNH1Ayq64JQsxLnU8QCij/2fMfrTAZCS+g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OHBT3DsErOnF0P72cjkV9MdDVYjEQ0VBSQj1F+cPBF4=; b=xpaNsyYcC9/RigkgsW6mARxzRZlZSrKmVmsKFYm26H8/armSM+VwmDbA4bR0DUiZD8 5rzOWBXc6NQiV2uL2aRq5wha6MH9Ftv5vN+KFoY7UZai78lo4bLFRm9NwIRlPe/b1mtN UeQdNMF8Xv8T/eUjyfRu/SkZmdfk1KNeDYebfBE4wzFP7getcGjJ/1mHx3T1m8MtnFoz yGuDagfhnn8POJar2drD5yA/kgS5l4WqOcbF4Ys1S5NBNvfMIs1rIRvrHk6mq+ukCbxG ppy5jbv/trLhan3cDmhciMlEQ/nxEQuYAmoLon3UCTH9yJBfD/H79ZEnYEeMfvFWYXrM 4L/A== X-Gm-Message-State: AOAM533KQM2NgaLfMfY0dRgBejxzsIOPdD3Vxu25I8DfKBGqhd9HGdPx hr2J3q43uonWF+rAAJL/m5pu1wlmeTc+ag== X-Google-Smtp-Source: ABdhPJxy2mOuLlawACH5kcB+mAFt+exswt5L28US77+tcg+6COsdIiTjyvUVP4W421NpoALVX3wczQ== X-Received: by 2002:a05:6214:1c8a:: with SMTP id ib10mr50103420qvb.46.1637097284583; Tue, 16 Nov 2021 13:14:44 -0800 (PST) Received: from bill-the-cat (2603-6081-7b01-cbda-c5ad-ec44-3eaa-133f.res6.spectrum.com. [2603:6081:7b01:cbda:c5ad:ec44:3eaa:133f]) by smtp.gmail.com with ESMTPSA id z8sm2511212qta.50.2021.11.16.13.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Nov 2021 13:14:43 -0800 (PST) Date: Tue, 16 Nov 2021 16:14:42 -0500 From: Tom Rini To: Michael Walle Cc: u-boot@lists.denx.de Subject: Re: [PATCH 10/10] board: sl28: disable random MAC address generation Message-ID: <20211116211442.GS24579@bill-the-cat> References: <20211115224551.3549744-1-michael@walle.cc> <20211115224551.3549744-11-michael@walle.cc> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MCUf75FhzKYr3rkB" Content-Disposition: inline In-Reply-To: <20211115224551.3549744-11-michael@walle.cc> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.35 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --MCUf75FhzKYr3rkB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 15, 2021 at 11:45:51PM +0100, Michael Walle wrote: > Nowadays, u-boot (when CONFIG_NET_RANDOM_ETHADDR is set) will set > enetaddr to a random value if not set and then pass the randomly > generated MAC address to linux. First, for clarity I'm not nak'ing this. I kind of would like to see a slight reword as I think some things aren't 100% correct, even if the "save random MAC to ethaddr environment variable" change goes in. For example, it's quite long standing that (dev|pdata)->enetaddr populates "mac-address" and "local-mac-address" and it seems in some older cases we only set the "local-mac-address" property. > This is bad for the following reasons: > (1) it makes it impossible for linux to detect this error > (2) linux won't trigger any fallback mechanism for the case where > it didn't find any valid MAC address This feels in some ways to be a limitation of the binding: https://www.kernel.org/doc/Documentation/devicetree/bindings/net/ethernet-c= ontroller.yaml And it reads like we really must be populating "mac-address" with that random one and while providing a blank "local-mac-address" would be a way to say we don't know the true device one, it seems that wouldn't be used / noticed? > (3) a saveenv will store this randomly generated MAC address in the > environment >=20 > Probably, the user will also be unaware that something is wrong. He will > just get different MAC addresses on each reboot, asking himself why this > is the case. >=20 > As this board usually have a serial port, the user can just fix this by > setting the MAC address manually in the environment. Also disable the > netconsole just in case, because it cannot be guaranteed that it will > work in any case. After all, this was just a convenience option, because > the bootloader - right now - doesn't have the ability to read the MAC > address, which is stored in the OTP. But it is far more important to > have a clear view of whats wrong with a board and that means we can no > longer use this Kconfig option. >=20 > Signed-off-by: Michael Walle > --- > configs/kontron_sl28_defconfig | 2 -- > 1 file changed, 2 deletions(-) >=20 > diff --git a/configs/kontron_sl28_defconfig b/configs/kontron_sl28_defcon= fig > index af907175f1..7fb6bdbe82 100644 > --- a/configs/kontron_sl28_defconfig > +++ b/configs/kontron_sl28_defconfig > @@ -59,8 +59,6 @@ CONFIG_OF_LIST=3D"" > CONFIG_ENV_OVERWRITE=3Dy > CONFIG_ENV_IS_IN_SPI_FLASH=3Dy > CONFIG_SYS_REDUNDAND_ENVIRONMENT=3Dy > -CONFIG_NET_RANDOM_ETHADDR=3Dy > -CONFIG_NETCONSOLE=3Dy > CONFIG_SPL_DM_SEQ_ALIAS=3Dy > CONFIG_SCSI_AHCI=3Dy > CONFIG_SATA_CEVA=3Dy Now, an alternate solution here would be to enable these two options still and write an ft_board_setup() with: =2E.. if ethaddr is in the locally administered pool then fdt_delprop(... "mac-address"); fdt_delprop(... "local-mac-address"); And that should cause the kernel to fall through the cases to find out where to get the real MAC from. I'm not super happy with this at first, but I also don't see anything clever in the binding we can do. --=20 Tom --MCUf75FhzKYr3rkB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmGUHzsACgkQFHw5/5Y0 tyyFCAv+P2y92FpAQf1qEtSvBm8uVindpqoB6rSxyKnVw2I/18K6OCkliJS041H3 1VO3ni7IkiGP6I0r7apiAUlsIDhIv60Py+ucU9oP9OBL85Ut/mUN4OGFRBrTWsN0 eEZ5KTrmH6WDI+6+Z844i+tqppjScIreUfJLyyXEP3fKkPungNiqIMelVrarj2eZ 3w6cyC1dulsXJuvISMbcHgP7Sznvqmq09hS4K7dbE0bOPw3dCfkYfu0gzCfyPioa ixBr0xMp7rYRzLOXKwWGmr8yiuO0VJ/+BLw7Q5aYUdH6XBXRQd9thMJG3rRPbRuH 4CIhNxG/59lpK6VZZu55JKAzCoFB4VkeE9hUDBHAvZxTujeUKGBNmwUzTX3kE48G gdkJJwUkrbvwsMdlWuwD1trQ6yCKGNNes6lNbIH8X4MRP/c755S0DQWgkl00uso1 0+ZCKPk3KlP4ZQ4lZ6kK2olh/vYxfq3gY2DK5nbb0IQ4qntN9H2oAaqNtDfIb2uX yRGOaz/C =v32W -----END PGP SIGNATURE----- --MCUf75FhzKYr3rkB--