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 4E707C433EF for ; Tue, 26 Oct 2021 16:50:06 +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 8FBDA60E8B for ; Tue, 26 Oct 2021 16:50:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8FBDA60E8B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 75C9182EA5; Tue, 26 Oct 2021 18:50:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="LYD9jIZo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BFDCA8327C; Tue, 26 Oct 2021 18:50:00 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3B1C780F5F for ; Tue, 26 Oct 2021 18:49:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 2A50460F70; Tue, 26 Oct 2021 16:49:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635266995; bh=nzOJE2QWv8vMDk0cPd8Ar2bo2jW/dDBAN8fR88vEJSs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LYD9jIZo3CMBAmI9z2ULiHvwZGUwd/Vf12cHjhMq8fYLT9X299fRB6gXRdKTkffq7 +p8AZdzTqi2qgRL/xA73CX6frjlOTsq10IPXsn2yzUkG12AdRDW57GFJrmQI/O2gQt LDxH2hMsaqPaY5gvZR/G2v/ah0qyWnf2ahf8YxvG3abfoPBazurhJYp4RWW6V5kYUh QxHEYSx7xq8VtpAlE10xFEpEURuJovoOuH4m6Dq1M5xx6YzxUsluzCW81kPx9/cCNI R9JTHpJxpg3hhXTbbrpfaGclFC11akfB55IYkftA8UWkM3kRRa9bdH9l87MkjNSCzn tcXbYHeTWoJKQ== Date: Tue, 26 Oct 2021 18:49:50 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Roman Bacik Cc: Simon Glass , U-Boot Mailing List , Bharat Gooty , Aswath Govindraju , Bin Meng , Franck LENORMAND , Heinrich Schuchardt , Kory Maincent , Michal Simek , Patrick Delaunay , Peng Fan , Priyanka Jain , Rayagonda Kokatanur , Sean Anderson Subject: Re: [PATCH v3 2/2] cmd: brcm: netXtreme commands Message-ID: <20211026184950.47bcd1af@thinkpad> In-Reply-To: References: <20211025234444.1237-1-roman.bacik@broadcom.com> <20211025164424.v3.2.I1edaad77041c1300213c307eef6741499504047@changeid> <20211026151742.42b0fcfa@thinkpad> <20211026175519.418d4864@thinkpad> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 On Tue, 26 Oct 2021 09:02:54 -0700 Roman Bacik wrote: > On Tue, Oct 26, 2021 at 8:55 AM Marek Beh=C3=BAn wrote: > > > > On Tue, 26 Oct 2021 08:14:28 -0700 > > Roman Bacik wrote: > > =20 > > > Hi Marek, > > > > > > We do not want this driver to be automatically probed. It is not need= ed > > > all the time and also slows down the boot time. We have stripped down > > > everything else to bare minimum. > > > Thanks, > > > > > > Roman =20 > > > > Hi Roman, > > > > OK, that is reasonable, but not reasonable enough to introduce a new > > vendor specific command. > > > > Still NAK. > > > > So you have the bnxt_drv_probe method defined in the driver, but you > > don't set a pointer to it into the U_BOOT_DRIVER structure, and instead > > you call this method when "brcm probe" command is called. > > > > I think this introduction of another vendor specific command is wrong. > > > > If probing takes too much time and should be done only when the device > > is needed, there are 2 things you could do: > > > > - you can create new driver flag saying that the device should be > > probeb only when needed, wire necessary code and add this flag to your > > driver (this could get very complicated, though) > > - you can do minimum stuff in probe method, and move the stuff that > > takes long time into bnxt_start(), which is called only when network > > via this ethernet controller is requested for by U-Boot commands. =20 >=20 > So renaming bnxt probe/remove to bnxt start/stop will do, right? No. The whole idea of adding the new "bnxt" command is wrong, because the command is *vendor specific*. The ethernet controller should work out of the box with standard U-Boot commands, i.e. it if I use the dhcp command, it should work, without needing to call the "bnxt" command. > > > > Also, you're still doing > > > > + if (env_get("ethaddr")) > > + secondary =3D 1; =20 >=20 > Why can't we access the env variable from our "bnxt start" method? Is > there a blacklist of env variables one must not access from a driver? Because the "ethaddr" variable is the MAC address of the 0-th ethernet controller on the board, which does not have anything to do with yout broadcom netXtreme controller, unless your broadcom netXtreme controller is the zero-th ethernet controller on the board. For example if I connect you controller to the PCIe slot on Turris Omnia, where there are 3 ethernet controllers already, and their MAC addresses are stored in ethaddr eth1addr eth2addr the MAC address of the netXtreme controller would be stored in variable eth3addr So in your UCLASS_ETH driver, you should only look at dev_seq(dev) ethaddr, by using eth_env_get/set_enetaddr_by_index("eth", dev_seq(dev), ...); Marek