Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4264595ybi; Mon, 3 Jun 2019 08:08:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwoi3EOGCmlTDGGDJRfxrhS1TwiWv9Q5vL19MXNxfxX28nEQHlf9eaRwPA4YJpy6/gpmiLE X-Received: by 2002:a17:90a:628a:: with SMTP id d10mr2115118pjj.7.1559574502390; Mon, 03 Jun 2019 08:08:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559574502; cv=none; d=google.com; s=arc-20160816; b=0yFkwLrFYmw0NHlBgqYcnVvM9mhOTbP8mzFa8zEAkx0tknR15IuU+sUXTBa6C3pCwj 6DbAjrUzzaWra6bgyP3BLHtbkBCgXIbP96uWeV4Efbm3KRPvvL3udnaEA2uSuczX1Dim eJk/LwXfu6Q5ZhHGqz2Qc7fA2x1Mu4tSLwTzfi42wUX8PB/LjrbmGSXMHKu4NVZfjLZf OylqNiKuD0MhAf6Mq4OZ/nY7VtTMrHOJq5NDTrwkkRxVoJhr93MzigGNeqpqeGs3KeJy mXVHSaguRsb60gMiiTgEsEr0Kil/N5JEZXZX5dTbXAJ1kFWmfZEyCE3xSaS0OKcWcQ3f v1NQ== 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=HVCAKnGE2o6vcUDUe+ngXqRsklPv7HNwpc9aiFTjxqY=; b=yQKB3Ji1Ku/BK5ZavQBlvzmfPk6CPROjW9Jkcx6c/BM3WLZR9e2GHIGeR8Gs/TfdMJ mCIKMPAYc8zbGxBxLPirdiFGbxHd6WAUU+CmRYTiYTouhEUaVW+F60z7NqW3L5ByzHBf qVxGp+HyKmHB6JeaJlNfsefVKsfIhZGds5Ov4M6O6v0Tox/EE9R8h8hknhhxrww0o2b3 SBpcB+Q+WbP9eY640Wz+ovsvbcEmGSJvPvBCS3kpLHCmlJS8Y8/5OT0VcRQW3onMt8Ey 8YA69oAgiGad9e7H47aUrPr7nBgNTBZtI4R5bw6Gj95ZY+eHmXQ1NeWAWk5JCmPFrNvr 2Hyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=tPEEj9eo; 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 j40si20037643plb.352.2019.06.03.08.08.05; Mon, 03 Jun 2019 08:08:22 -0700 (PDT) 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=tPEEj9eo; 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 S1729365AbfFCPG1 (ORCPT + 99 others); Mon, 3 Jun 2019 11:06:27 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:50754 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729081AbfFCPG0 (ORCPT ); Mon, 3 Jun 2019 11:06:26 -0400 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=HVCAKnGE2o6vcUDUe+ngXqRsklPv7HNwpc9aiFTjxqY=; b=tPEEj9eo0d/eQNi5ewgQrBGxFP GQsLe/xdWnEr2bRxVObacb7/WZlL7Cnmry6dWAs75DziNxOi486Eqc7Ge73JRDNkcEp6wEqbacgKU J9kdRbEtsvrUPrBN88a7uEK6mHjxIWbahGlf6xPFNrbyz5zFJ7UFnndMZqvt1qmB1J5w=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hXoXV-000612-Ku; Mon, 03 Jun 2019 17:06:21 +0200 Date: Mon, 3 Jun 2019 17:06:21 +0200 From: Andrew Lunn To: Rasmus Villemoes Cc: Vivien Didelot , Florian Fainelli , "David S. Miller" , Rasmus Villemoes , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH net-next v3 07/10] net: dsa: mv88e6xxx: implement port_link_state for mv88e6250 Message-ID: <20190603150621.GF19627@lunn.ch> References: <20190603144112.27713-1-rasmus.villemoes@prevas.dk> <20190603144112.27713-8-rasmus.villemoes@prevas.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190603144112.27713-8-rasmus.villemoes@prevas.dk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 03, 2019 at 02:42:20PM +0000, Rasmus Villemoes wrote: > The mv88e6250 has a rather different way of reporting the link, speed > and duplex status. A simple difference is that the link bit is bit 12 > rather than bit 11 of the port status register. > > It gets more complicated for speed and duplex, which do not have > separate fields. Instead, there's a four-bit PortMode field, and > decoding that depends on whether it's a phy or mii port. For the phy > ports, only four of the 16 values have defined meaning; the rest are > called "reserved", so returning {SPEED,DUPLEX}_UNKNOWN seems > reasonable. > > For the mii ports, most possible values are documented (0x3 and 0x5 > are reserved), but I'm unable to make sense of them all. Since the > bits simply reflect the Px_MODE[3:0] configuration pins, just support > the subset that I'm certain about. Support for other setups can be > added later. The code looks sensible and covers the most likely scenarios. Reviewed-by: Andrew Lunn Andrew