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=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 3F4CFC433DF for ; Tue, 20 Oct 2020 00:18:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EAFFD2242F for ; Tue, 20 Oct 2020 00:18:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389349AbgJTASN (ORCPT ); Mon, 19 Oct 2020 20:18:13 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:35704 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389331AbgJTASN (ORCPT ); Mon, 19 Oct 2020 20:18:13 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kUfLj-002Zrt-JM; Tue, 20 Oct 2020 02:17:59 +0200 Date: Tue, 20 Oct 2020 02:17:59 +0200 From: Andrew Lunn To: Chris Packham Cc: vivien.didelot@gmail.com, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, kuba@kernel.org, linux@armlinux.org.uk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] net: dsa: mv88e6xxx: Support serdes ports on MV88E6097/6095/6185 Message-ID: <20201020001759.GT456889@lunn.ch> References: <20201019024355.30717-1-chris.packham@alliedtelesis.co.nz> <20201019024355.30717-3-chris.packham@alliedtelesis.co.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201019024355.30717-3-chris.packham@alliedtelesis.co.nz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 19, 2020 at 03:43:54PM +1300, Chris Packham wrote: > Implement serdes_power, serdes_get_lane and serdes_pcs_get_state ops for > the MV88E6097/6095/6185 so that ports 8 & 9 can be supported as serdes > ports and directly connected to other network interfaces or to SFPs > without a PHY. > > Signed-off-by: Chris Packham Reviewed-by: Andrew Lunn Just a nit pick below. > +int mv88e6185_serdes_power(struct mv88e6xxx_chip *chip, int port, u8 lane, > + bool up) > +{ > + /* The serdes power can't be controlled on this switch chip but we need > + * to supply this function to avoid returning -EOPNOTSUPP in > + * mv88e6xxx_serdes_power_up/mv88e6xxx_serdes_power_down > + */ > + return 0; > +} > + > +u8 mv88e6185_serdes_get_lane(struct mv88e6xxx_chip *chip, int port) > +{ > + switch (chip->ports[port].cmode) { > + case MV88E6185_PORT_STS_CMODE_SERDES: > + case MV88E6185_PORT_STS_CMODE_1000BASE_X: > + return 0xff; /* Unused */ > + default: > + return 0; > + } > +} mv88e6185_serdes_power() has a nice comment about why it exists and just returns 0. It would be nice to have something similar here, that there are no SERDES lane registers, but something other than 0 has to be returned to indicate there is in fact a SERDES for the given port. Andrew