Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp110055rdh; Tue, 13 Feb 2024 10:51:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWOoC9DSCGyiAVWePSlCn/HePmBrNFGfijQHrdfSVqERcNzgbSK04WiD7sSlJUVKMaFm9RAbxEPUpge8aFzRmVrKriJm47GJ0ksKtwVxQ== X-Google-Smtp-Source: AGHT+IFM6fYCA2JGFo6FnAzn2+NjoZeZR1WdDGHeUvWqTIggP0sJ9nLNMlCxYhWxO97ZSN/BZs7s X-Received: by 2002:a05:6358:7f0a:b0:176:4e87:a974 with SMTP id p10-20020a0563587f0a00b001764e87a974mr119285rwn.19.1707850277586; Tue, 13 Feb 2024 10:51:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707850277; cv=pass; d=google.com; s=arc-20160816; b=s1sNHSJpNWUYCZw+BlyDiW6S8qIkSblA0YH5CrJQjwljB5jFi6Jl3416CxJRwsTTHB tqVi07HaGn9UMzcRRazZKheLHBTsaGWiAjhNmUCbpPNEDDkTi1g2tFGD7FZbn71V5jPG HCHWvZPH9NFrwKUisacIyK5PAFmV5bNEXYR1VXNzoxt9Ubj5RzM3MI28zNUOt4XBF2pF puKEy4LfkR8Uyv7Zheheb9xvVQBBt/1UVA3AkJlumPQ9bJyV/G0aDvVTCoRzZUZoAZ/n pCkAa+deDl0BuyJ5Z2m5fuStafBAyyOw9k+K2RGXNBOWJUDb6zcMdIOaTvLOkC6SRBIe Dd5g== 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=3XeLjS7yUXexGit1/+ZjYAFdk3R9Y2+oOfIWTeb8D+o=; fh=kQPn89J7enO4oQHYUr309NQuOx+RjgE7a6vy3wpXDC8=; b=FJX5BMuj52h3WtqUS4ru/6N3ug5IqfU3W72MLVBT1bSEfAOpiVLVKOxQAI1rukdEXi xtxyNWCgiAtxAu/TnwtWaN8009DGsZxU2y2Ry2cYTITc8aZYc1WmcQj6Z00rYQ+Zp9Ws /g5RQhGj9yDgQeE56DOOGxLbjWf0Mm3PFHL/OKCqfoUA8Eh6OmU0NztLjCDkqmwLRaMz cGNIShAVyrdJw6yFkXr2jPWcxYa3iNNutGz5IUsNfYsGr1Ezd0Mh5pa2qQAM//W/86+v bYokuEiq18xNCG6mRfq9D/KLDOzrl9yEEhSLCXZa+Qibl0JCRB0ujIHmGH5aUuU92ikg MOLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=2MT5sfTZ; 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-64116-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64116-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch X-Forwarded-Encrypted: i=2; AJvYcCVnZBkvhRsrCjT04vWrpuWEzuG2JpiFySfI/o9JE5m09O8i5HxgeMgn4IjwLXxvLdFbEJvuAaA26EPOEsXa7R8thiPHKpm6RaSgYB7O1w== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l73-20020a633e4c000000b005dc3d92a492si2412200pga.39.2024.02.13.10.51.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 10:51:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64116-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=2MT5sfTZ; 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-64116-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64116-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 35C292906B2 for ; Tue, 13 Feb 2024 18:51:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6608510A19; Tue, 13 Feb 2024 18:46:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="2MT5sfTZ" 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 0CE9F1CA8F; Tue, 13 Feb 2024 18:46:46 +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=1707850008; cv=none; b=TEOTl9Rurpe5gaWwSNUVcbE7bGrZ0JKcsZ8MEXl4fC8LCKmHlFvIdBHpk4GhGv1CCb00pMbwWF4s5rPFajYWhMR/vA767wmNfOsubKP1fo0o/Zq7ObA5OP4ZqJ2W+cBa4XU00viPqy8JUMXIbhV75CqvHbNGJfkXlDCLSmYAAdk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707850008; c=relaxed/simple; bh=lcWJKroqnVoZeeUmZmZEfdTXGoqvGouIATK9PaCgMg4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fYTIJV01g/c21zemhtfy8dcx6zOTWyrXYxqjFhCMoBjljxEd6FeMEHUgtMC80yNTg1qsKldJSD/uDdQ3HDNEzOeHrXeXWzHTF29qM6asNH6i5MytBKAIaEAiQPi02KEPrV4xFi+YMDH4mim+NAqAXAa3P81F1zF3U6or+z/5wxs= 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=2MT5sfTZ; 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=3XeLjS7yUXexGit1/+ZjYAFdk3R9Y2+oOfIWTeb8D+o=; b=2MT5sfTZ3I0vGDcXw9vLNINaGz XQWphb/FQ6NVP3K6r4/eqDb7Xja5HcYg+SbohdEZZ3CZwLF3VcPgBv1aUYJAuluT4WgvWb4M3auOx NkyzNPwdzK3mjCi5s+MH+KYl8avTmrNvuoT/w5e94OCbW0ZVhRs4G/YTywMxRcuWZUzk=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rZxnp-007iIQ-Ok; Tue, 13 Feb 2024 19:46:45 +0100 Date: Tue, 13 Feb 2024 19:46:45 +0100 From: Andrew Lunn To: Christian Marangi Cc: Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Robert Marko , "Russell King (Oracle)" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [net-next RFC PATCH 0/2] net: phy: aquantia: fix system interface provision Message-ID: References: <20240213182415.17223-1-ansuelsmth@gmail.com> 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: <20240213182415.17223-1-ansuelsmth@gmail.com> On Tue, Feb 13, 2024 at 07:24:10PM +0100, Christian Marangi wrote: > Posting this as RFC as I think this require some discussion on the topic. > > There is currently a problem. OEM multiple time provision Aquantia FW > with random and wrong data that may apply for one board but doesn't for > another. And at the same time OEM use the same broken FW for multiple > board and apply fixup at runtime. > > This is the common case for AQR112 where downstream (uboot, OEM sdk, > openwrt to have the port correctly working) hack patch are used to fixup > broken system interface provision from the FW. > > The downstream patch do one simple thing, they setup the SERDES startup > rate (that the FW may wrongly not init) and overwrite the > global system config for each rate to default values for the rwquested PHY > interface. > > Now setting the SERDES startup value is SAFE, and this can be implemented > right away. > > Overwriting the SERDES modes for each rate tho might pose some question > on how this is correct or wrong. > > Reality is that probably every user an Aquantia PHY in one way or another > makes use of the SDK and have this patch in use making any kind of > provision on the FW ignored, (since the default values are always applied > at runtime) making the introduction of this change safe and restoring > correct functionality of AQR112 in the case of a broken FW loaded. This is part of the discussion i had with Aquantia about provisioning. Basically, you cannot trust any register to contain a known value, e.g the value the data sheet indicates the reset value should be, or that the 802.3 standard says it should be. So in effect, the driver needs to write every single register it depends on. > This might be the safest change but again would not give us 100% idea that > the thing provision by the FW are correct. I would say, we have to assume provision is 100% wrong. Write every single register with the needed value. Is the provisioning information available? Can it be read from the flash? Can it be dumped from firmware we have on disk? Dumping it for a number of devices could give a list of register values which are highly suspect, ones that OEMs typically mess with. We could start by always setting those registers. Andrew