Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp51047rdb; Tue, 16 Jan 2024 14:45:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBfSqGQIlIo/gDcIx5aZvJ/pmQWmnslQnHMjuXA62vWNkxWNpS06X3THj4LeCtvX8yLeMt X-Received: by 2002:a05:6402:134c:b0:559:b79c:2ad with SMTP id y12-20020a056402134c00b00559b79c02admr756399edw.13.1705445146167; Tue, 16 Jan 2024 14:45:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705445146; cv=pass; d=google.com; s=arc-20160816; b=P+gCEBa/70ad+tV9SwCbYwF3psIhcIqGY2SqUoZgK2+iR33NgqPK0ccmVXnSzZ6nuR y98OEijLfDMBH8xnz6i26dyGbRiEqozhEHkBkV22YtutBmOXk3euzw25QFunbUf6IG/2 LBz+R1TZE6Oda6d0L49WlqqoQ/LzUiR8I77mQzIYwXR6Awtf8cqTYr6Au8Gj8UKAU90n z7GDVaBPsEMu2ez83yAlJmL6h7MoB/2HXwXGaXptiquehiJKwqJYX0Om/5WHS1vt41Im VzpnqR9iMfuKufJunAp1attZk74+5ozZJJMfL32UUzXzTGKyxQN7N+dsIbUiKW8EtDwT tJ2Q== 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=RdhTevdQVBdb8wlxJd7xNXUyeRnkCEOfn9WkZe/WJWg=; fh=KEQaCYtWYMKkYAhHxBHJzXFoh9klLLmHCkdP7pqEgaw=; b=KGYmPoyMmbttipIsj25oRStBqg5GEgsPMRG4J+pD0LQTiafM08cFGL94XQ7J6UVmgi T/YiwxExFYkwTYHgT4vrm6LMJNZ/eQE2GVeHLggy7Fwne947uOx6fIX6Gi6zLLcCfflP HGBw/XpwcFanCviHdPVTlsH6BecwbyNXBNLiBH5tJKYszhQQQbbIbx8vo/NCUU7z7A12 rYnUwqCTNLhPl9ex3F8ehRgFU1icmD/1eU199kK1F7xkqFPGnZyiti2Tzx2ZZ1pXlR+V 7InwWwpRtjim2iTjGozAgXk4zz5DR7Nnvw1QJv9mFah7G9ciJnB8FA3eQlZ2YaN2nH7y /HQQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=W4QtaqR7; 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-28356-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28356-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o6-20020a056402444600b005598c32f214si987007edb.255.2024.01.16.14.45.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 14:45:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28356-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=W4QtaqR7; 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-28356-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28356-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 am.mirrors.kernel.org (Postfix) with ESMTPS id E10B51F2A3F3 for ; Tue, 16 Jan 2024 22:45:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A08C620B04; Tue, 16 Jan 2024 22:35:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="W4QtaqR7" 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 1B7601DA2C; Tue, 16 Jan 2024 22:35:33 +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=1705444535; cv=none; b=K8pUXTsXWe+4eH5kTc+RaM8265Tb6e2+dOwFhx+8bDu3uYPWSiCymerG+MadktsnO7WXyvzHedFYU+ykW7rYSuPYaKUr9DU/sl3rdawJMfd+0ggg1LD/368QRsmWHKBsLwNduArA7NMcbkMXdgS0jTz86eWmYKX8MyOlq8YqRGM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705444535; c=relaxed/simple; bh=ins1IDJZ4lyx0ENQCIEAJzl9MLbVaW2Mn2TyaG9gBUk=; h=DKIM-Signature:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; b=RkAuIsnsIYdmGz0T/10Wgla8HRqYWhtFGIleudFeZMHH2FuhzumNojP4tqUOJZZBRo9qgZYRR5AhfWiVIngNuvi3eDhmzE/KyFg276JySFgPgD3zNSiiMBRYNBAUx1klAtBh9Kf1Oh5Wut90vH9hyvstQVAepWJnMX1vC3xHD5Q= 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=W4QtaqR7; 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=RdhTevdQVBdb8wlxJd7xNXUyeRnkCEOfn9WkZe/WJWg=; b=W4QtaqR7NHIOIWimMjGhfOWFsm PKzYCRa3+vm+SUCtszEcpa18+cQMWn8Ejkyd5cqqhgi1CABB5bYt/tfUAaef97tbwOiDzLu/Snc/8 0lCmYOUU+tGPH4RRI+IvLjzC/LbYe7R7yW5ch1462y3MpeZSzi3H/L2Bf/SozwnqO3UA=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rPs1e-005MRS-8j; Tue, 16 Jan 2024 23:35:18 +0100 Date: Tue, 16 Jan 2024 23:35:18 +0100 From: Andrew Lunn To: Bernd Edlinger Cc: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, "linux-kernel@vger.kernel.org" , Jiri Pirko , Andrew Morton Subject: Re: [PATCH v2] net: stmmac: Wait a bit for the reset to take effect Message-ID: <6e33c038-45a7-4941-b5d9-ce5704e13d48@lunn.ch> References: 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: On Mon, Jan 15, 2024 at 08:21:42PM +0100, Bernd Edlinger wrote: > otherwise the synopsys_id value may be read out wrong, > because the GMAC_VERSION register might still be in reset > state, for at least 1 us after the reset is de-asserted. > > Add a wait for 10 us before continuing to be on the safe side. > > > From what have you got that delay value? > > Just try and error, with very old linux versions and old gcc versions > the synopsys_id was read out correctly most of the time (but not always), > with recent linux versions and recnet gcc versions it was read out > wrongly most of the time, but again not always. > I don't have access to the VHDL code in question, so I cannot > tell why it takes so long to get the correct values, I also do not > have more than a few hardware samples, so I cannot tell how long > this timeout must be in worst case. > Experimentally I can tell that the register is read several times > as zero immediately after the reset is de-asserted Is zero a valid synopsys_id? If its not, maybe do the wait conditional on the first read returning 0? Andrew