Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17541353ybl; Thu, 2 Jan 2020 07:22:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwHYdC/WS+P6lHYBWptaw1OzmbK+K9xnG0yxZpXOgLpACtvPviILiIK4p83c9LKqarqiFy9 X-Received: by 2002:a54:4507:: with SMTP id l7mr2253660oil.164.1577978560755; Thu, 02 Jan 2020 07:22:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577978560; cv=none; d=google.com; s=arc-20160816; b=wZ23gqB8o+6yC4rcnpnZlTSsP/pbGupNGjxnJ4AlBKAkcL+AOfqK3s997HeFpP9Xi5 bkjzTQZibGx4JPk00VhkLpfXh1USUCEQf/lRBZQjOawVB0mMT11IFUArCg6jpG80Du74 LffV0/Kr3aJnikuqEEvd42ZFhz6hiqImW7x4YO68+5mEPu7id7f/CTGAu5T28n8NOLm2 0a5xb1Qt2sc6waaKnnEkw9dnD3nsx6GGcQy4O36vdhELQ8G1obvmCIujZtI+5Ml5NIWL xo5BTQyocN3LVWKRUtjCIB+geF/Ba3pmoMDE4Kc6MR/93OVVRuTAj25qTvcJlsbdCpQe SLzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=IdYA3gvWlF+j5uZXez7KuYc1OVhRo4qko1KG34K9Acw=; b=vDuq6Cw0Ijbw5XRv6/Uiv4p2h8ftelSYz2Js9l9QmPzMPk2PHMa+CbDDmrGELW1L8d aIayUFTMrgs9WSvGVBxM8W2HKoe3scM0AHMGAR1923Xn/kzMgSVesay717burJSQebv5 7FjMLmWo1kt1d+jzQm27pA4TEEIk/ncJ45P82ATLO8Bzrp5+rMt70YdZXDMDv6+paQpF FpcwR+pMRkpCs0ql57HyOZSkYbqdHDZtoxb6S5VqRWQw1XZQ971gDj8hoglh/pKoAq5m GroGu23oZKGdi/dcieFh9nohRiVXPmvsDt+IqNeZULy/4Ipd25AmlONn1osTaqRALhUN Slug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=KMqWoFye; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9si25568955oif.92.2020.01.02.07.22.28; Thu, 02 Jan 2020 07:22:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=KMqWoFye; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728748AbgABPVr (ORCPT + 99 others); Thu, 2 Jan 2020 10:21:47 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:45446 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728561AbgABPVq (ORCPT ); Thu, 2 Jan 2020 10:21:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender: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=IdYA3gvWlF+j5uZXez7KuYc1OVhRo4qko1KG34K9Acw=; b=KMqWoFyek+invBAycpz5c8nKt+ RJyDFaB7TQ3rR838gMTmqtWLs7oKZOPPrvOc/yKmHCLgtDB20L+EmV41bpjr6H6SC/dT/dDS6u7zh WqhaKSoneqGg781l9GR+CNr4Oi4ovWXU2LquDFWq6d6KpaH/iwwUUzUsbwEuutf4igGI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1in2IB-0007nb-M2; Thu, 02 Jan 2020 16:21:43 +0100 Date: Thu, 2 Jan 2020 16:21:43 +0100 From: Andrew Lunn To: Kai Heng Feng Cc: Heiner Kallweit , Linux Netdev List , Kernel development list , Anthony Wong , Jason Yen Subject: Re: SFP+ support for 8168fp/8117 Message-ID: <20200102152143.GB1397@lunn.ch> References: <2D8F5FFE-3EC3-480B-9D15-23CACE5556DF@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2D8F5FFE-3EC3-480B-9D15-23CACE5556DF@canonical.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 02, 2020 at 02:59:42PM +0800, Kai Heng Feng wrote: > Hi Heiner, > > There's an 8168fp/8117 chip has SFP+ port instead of RJ45, the phy device ID matches "Generic FE-GE Realtek PHY" nevertheless. > The problems is that, since it uses SFP+, both BMCR and BMSR read are always zero, so Realtek phylib never knows if the link is up. > > However, the old method to read through MMIO correctly shows the link is up: > static unsigned int rtl8169_xmii_link_ok(struct rtl8169_private *tp) > { > return RTL_R8(tp, PHYstatus) & LinkStatus; > } > > Few ideas here: > - Add a link state callback for phylib like phylink's phylink_fixed_state_cb(). However there's no guarantee that other parts of this chip works. > - Add SFP+ support for this chip. However the phy device matches to "Generic FE-GE Realtek PHY" which may complicate things. > > Any advice will be welcome. Hi Kai Is the i2c bus accessible? Is there any documentation or example code? In order to correctly support SFP+ cages, we need access to the i2c bus to determine what sort of module has been inserted. It would also be good to have access to LOS, transmitter disable, etc, from the SFP cage. Andrew