From patchwork Wed Dec 30 15:47:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 11993347 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=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 4ECD7C433DB for ; Wed, 30 Dec 2020 15:49:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F6FD221F8 for ; Wed, 30 Dec 2020 15:49:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726469AbgL3Ps6 (ORCPT ); Wed, 30 Dec 2020 10:48:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:46620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbgL3Ps5 (ORCPT ); Wed, 30 Dec 2020 10:48:57 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 17F5F20575; Wed, 30 Dec 2020 15:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609343297; bh=YHufGG3AokDDJwfj0LlgBm3yCGwwV8pRMkMk3RZ2ZaE=; h=From:To:Cc:Subject:Date:From; b=oW8bFMQ97MBYUdhc0v4/ZygYifaGdHEJuWC97puhXx+qcn7QVPwroGwPyDK6f5Nb5 wFnrAuNDDly7Fcgu8HdeiNzGb1yoD/rXS65eyJUlXkQ5pxMn0grhmbSwfLxRCNRHa7 ql8qDJfPLpB8OoHHc7D5hlKgxyT2DzCp7aDdFrgUaqddPAvBFs5JKuy00Nb159oOUK Ydx+/abEZQ5KNFsk4qdU2dOwdrdZxLHdtECLSAy8L0WdP8UnBSlFywBOBzIfmRzSdd n9pbFqTPf1ntT0E+GACRCvQ9Btd7UeC6cr0vL/geT8//7kbFXICiKJgM9EWzWhCtqr 9yjUhSNI5QHsQ== Received: by pali.im (Postfix) id 9EA319F8; Wed, 30 Dec 2020 16:48:14 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Russell King , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Jakub Kicinski , =?utf-8?q?Marek_Beh=C3=BAn?= Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/4] net: sfp: add support for GPON RTL8672/RTL9601C and Ubiquiti U-Fiber Date: Wed, 30 Dec 2020 16:47:51 +0100 Message-Id: <20201230154755.14746-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch series add generic workaround for reading EEPROM content from broken GPON SFP modules based on Realtek RTL8672/RTL9601C chips and add another workarounds for GPON SFP module Ubiquiti U-Fiber Instant. GPON SFP modules based on Realtek RTL8672/RTL9601C chips do not have a real EEPROM but rather EEPROM emulator which is broken and needs special hack for reading its content. SFP module detection is done based on EEPROM content. But we obviously cannot read EEPROM correctly if we do not know what type of connected SFP module... And to have this chicken and egg problem more complicated, GPON vendors generally put garbage into their EEPROM content so even with knowing EEPROM content we do not know what kind of broken SFP is connected... Workaround for Realtek RTL8672/RTL9601C based modules is therefore done based on broken EEPROM reading characteristic. This patch series also available in my git branch sfp-rtl8672: https://git.kernel.org/pub/scm/linux/kernel/git/pali/linux.git/log/?h=sfp-rtl8672 Pali Rohár (4): net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips net: sfp: allow to use also SFP modules which are detected as SFF net: sfp: assume that LOS is not implemented if both LOS normal and inverted is set net: sfp: add mode quirk for GPON module Ubiquiti U-Fiber Instant drivers/net/phy/sfp-bus.c | 15 +++++ drivers/net/phy/sfp.c | 117 ++++++++++++++++++++++---------------- 2 files changed, 83 insertions(+), 49 deletions(-)