Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp716508pxu; Thu, 7 Jan 2021 16:53:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyv+CBo/wl6ZePRtyIZ7cgsj+db0g+bAUNwXDxXz7LQzBeV/inQMg1Mu0+mDEr4+izyl5Cq X-Received: by 2002:aa7:db56:: with SMTP id n22mr3622322edt.4.1610067182255; Thu, 07 Jan 2021 16:53:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610067182; cv=none; d=google.com; s=arc-20160816; b=I8V+AAtn1yHTuGo/I0zhZTLvb+EkydPGZFuQEUBNR6V7YhxJBCuoEeQXNilwssdVL2 pNJI8F2Ryk0NAU5LGUB/UD1fv5Ub3PgXr5tFIKBpdRBKzcvwG0G5ZXmMah3/0AX3VqFC OYct1SW24rE2Y/xWUk4TDOi4+GO4jvKfN9PmuMiDCQ45TviV88zbGz0QflkU3LkwQ4+p Et/K3NI5MYKMZDjfPwFMl60Hgy5A6c8CJFtDB8citc3A/q5Ulaln6QpOIMd3pM9q6d48 mD8wz5YGJJOWMfetkGh+H1q18/5VOLT35yAnw0FtQmpc2Urwo1ZZ8sYpPC/i0vHStbnE 2b/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WWKbJcJqLnmUTbJAjuiOgsFp7ckTC1cjztsUuk5Y9Kk=; b=iyXc8tNrow3VkSaNRBvYJVXhlYkQvjXVbuVMv23KOLf1Ew5oIaPJ3yRJ6BC9o5moKP hPYvOWkDy7PtTXbWCqXiEeUHL1BLK6O6GsFWCbduHm3WXAlKZL6vw+j7P9pdxBwaWakn UlK1K/JwbwpfYjxVv7syhYeO30q7QQ/o7NNQPKdeLnDTwtt1FXD7TjKY6lYulmtfIb/D wsa2Rhi38OTcWsTSXj/4sIasWi86w/UCffLkuzSzHA6mrNYCv6j2rDepUk6MhVvyanpd dni3mlWyLak7duIsv8/keVaTlyHBFf9fzeFkr+BPnEoyJzUJI3Icq+zNxHVW9LuQtOmV +rDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=heJA5rUG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k10si2916967eji.9.2021.01.07.16.52.38; Thu, 07 Jan 2021 16:53:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=heJA5rUG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729597AbhAHAuK (ORCPT + 99 others); Thu, 7 Jan 2021 19:50:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:34122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727695AbhAHAuK (ORCPT ); Thu, 7 Jan 2021 19:50:10 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8428E23447; Fri, 8 Jan 2021 00:49:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610066969; bh=S+brV20O/Ncak/QxhHlEcqydPjggfGUBM/oMewgZuiY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=heJA5rUGZZ8Stu4gU4lQ7ce+PBTsPq1CJAo964dxV0y/lEtwtH3Yo6y+MEm1TvzHr 8qVpcovPDwNS0j1iVuUO3X/MrVmLL+E7w7YpFYuOr6uV8FuADmTGB1CnfSj9K5c83y /DHfsMJ4YJuZm1EEniAqJzCC6CygD1D4Gq1rhWH8RDMsKn0NrBrkzlcLy8qomWeEaF 60D00VFXDi4Gi1Py6U8gTbtaKW04C7DtDz3+93ULP56EMRY+hl/nEUIkrn8FtZwEi4 5Y6ra+L0NI/QgrwjYWMeKp1yWHCkacON/o0feXQL5P7cf877DnVbzSp+mT01WirZnG aKRrx7JmaTJ7w== Received: by pali.im (Postfix) id 34E9AAF1; Fri, 8 Jan 2021 01:49:27 +0100 (CET) Date: Fri, 8 Jan 2021 01:49:27 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Marek =?utf-8?B?QmVow7pu?= Cc: Russell King - ARM Linux admin , Andrew Lunn , "David S. Miller" , Jakub Kicinski , Thomas Schreiber , Heiner Kallweit , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips Message-ID: <20210108004927.jr5tclbi7tzjpk6x@pali> References: <20201230154755.14746-1-pali@kernel.org> <20210106153749.6748-1-pali@kernel.org> <20210106153749.6748-2-pali@kernel.org> <20210107194549.GR1551@shell.armlinux.org.uk> <20210107212116.44a2baea@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210107212116.44a2baea@kernel.org> User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 07 January 2021 21:21:16 Marek BehĂșn wrote: > On Thu, 7 Jan 2021 19:45:49 +0000 > Russell King - ARM Linux admin wrote: > > > I think you're not reading the code very well. It checks for bytes at > > offset 1..blocksize-1, blocksize+1..2*blocksize-1, etc are zero. It > > does _not_ check that byte 0 or the byte at N*blocksize is zero - these > > bytes are skipped. In other words, the first byte of each transfer can > > be any value. The other bytes of the _entire_ ID must be zero. > > Wouldn't it be better, instead of checking if 1..blocksize-1 are zero, > to check whether reading byte by byte returns the same as reading 16 > bytes whole? It would means to read EEPROM two times unconditionally for every SFP. With current solution we read EEPROM two times only for these buggy RTL-based SFP modules. For all other SFPs EEPROM content is read only one time. I like current solution because we do not change the way how are other (non-broken) SFPs detected. It is better to not touch things which are not broken. And as we know that these zeros are expected behavior on these broken RTL-based SFPs I think such test is fine. Moreover there are Nokia SFPs which do not like one byte read and locks i2c bus. Yes, it happens only for EEPROM content on second address (therefore ID part for this test is not affected) but who knows how broken would be any other SFPs in future.