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 X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A377C6379D for ; Tue, 24 Nov 2020 09:43:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF43120657 for ; Tue, 24 Nov 2020 09:43:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="Pob53MAW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731705AbgKXJnX (ORCPT ); Tue, 24 Nov 2020 04:43:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731697AbgKXJnU (ORCPT ); Tue, 24 Nov 2020 04:43:20 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07DB3C0613D6 for ; Tue, 24 Nov 2020 01:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=EuT23AKRIC/iMYu9c3D4WIiXJeSq7VPYKY9MWUx0yKQ=; b=Pob53MAWrGWSpBPg73zphTZK9 TjX/s/aT62xfEQ9rXzjIPe3TKhH9wKQAL2WSsvCMct7bHOcK+78JiYqXC37NM7SUUHsqbHl5YFWCf j2bQHOE091PMnnXJup7d49Sv5NkF61f+DTL6x761vbRVnO/3SW9QQy3/E5d+YU3lnVyd3STXoY4Zb LvQws5xxL9YS0vrb+qz5yTQdL3AT9x6FoB0wPrtUjaGf4hGaqpFHLtGyBATwTt9npX3Lx3QVoVoWF Vq0RFf+605REjHXGKBAAI1VVjaQhvaw3TLgAIhsri9aOvX9Yxx1RXzqrFyxHs2uXZDtYtowthMbkN L/TQXx0Jw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35434) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khUqy-0007QG-T7; Tue, 24 Nov 2020 09:43:17 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1khUqw-0007Ew-QD; Tue, 24 Nov 2020 09:43:14 +0000 Date: Tue, 24 Nov 2020 09:43:14 +0000 From: Russell King - ARM Linux admin To: Andrew Lunn Cc: Heiner Kallweit , "David S. Miller" , netdev@vger.kernel.org, Jakub Kicinski Subject: Re: [PATCH net-next] net: sfp: VSOL V2801F / CarlitoxxPro CPGOS03-0490 v2.0 workaround Message-ID: <20201124094314.GC1551@shell.armlinux.org.uk> References: <20201124002021.GB2031446@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201124002021.GB2031446@lunn.ch> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King - ARM Linux admin Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Nov 24, 2020 at 01:20:21AM +0100, Andrew Lunn wrote: > > @@ -335,10 +336,19 @@ static int sfp_i2c_read(struct sfp *sfp, bool a2, u8 dev_addr, void *buf, > > size_t len) > > { > > struct i2c_msg msgs[2]; > > - u8 bus_addr = a2 ? 0x51 : 0x50; > > + size_t block_size; > > size_t this_len; > > + u8 bus_addr; > > int ret; > > > > + if (a2) { > > + block_size = 16; > > + bus_addr = 0x51; > > Hi Russell, Thomas > > Does this man the diagnostic page can be read 16 bytes at a time, even > when the other page has to be 1 bytes at a time? That seems rather > odd. Or is the diagnostic page not implemented in these SFPs? SFF8472 requires that multibyte values are read using sequential reads. So we can't use single byte reads to read a multibyte value - it's just not atomic. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!