Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp909029pxb; Thu, 19 Nov 2020 17:32:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1Tmah4VxfY6aF8DYtkLvUZniq7Xwcqang4+9M50pp76JgYEaoUP0Gwn3xJaPo5En8fmyr X-Received: by 2002:a17:906:6dc3:: with SMTP id j3mr14837242ejt.320.1605835924640; Thu, 19 Nov 2020 17:32:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605835924; cv=none; d=google.com; s=arc-20160816; b=tX44YQ9Nj3F2X1mQVPbkcq75ReATNt1t7NK7xIbdjiBTXos5/+uzR1jgH6fj2+Ye+D 6w+Wnv9asP6oKRufPn1Trp8sRYkNw48yz8muV4LqeCrb3dvZg886XBCpjPB2nbQlouOI vAS6cagbXZqqqHmXic7FCHorCMniaEfc/fSl7W7KvU44p8HWJkQJlQZAVk0Mr+O27nW9 oNnXdsCYCmnCm75X4L/RZO0gKz4LFcfnO8YlpIpo67bfcLgKSY514CcqRLn3aW8cHXUI ruUVAVhKiLC18iuqXFz5auwvr5CrIl48jlNEFgQZI/bcl2TdZC8ph1m7MOY093ElveNn E+Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=utirl0DE58O8Mrm6DUN+5oNrnFzEGe602zAc/yaXNcU=; b=Q2PtqnP7bxpA0eXVDXMi6J81GNNjzEFqQvdgKgzrtmb2hh91G/F9uQqF4yHL7NahBv V0cenwz6gLHaDQqZEOCfIRJvF20B1YWwFzqkUQFRwrjK8yyjwIM8PPtQGKy4xanu1+7b 6dBywQZetdXBq1cREykgbbntiOKEnNuEsgZzjwjw/P+FWaD4Un6M5fQwBOgHmRAedK1d 5/bOY6cgAj0Ka3awCPIP1q4rkb1lVn59kafUY6RcjOOQC8DIxc2e5vvabJwxV7QmTSdc yrAlG/zP4OrO8Gmp25RDrZjHhwkaIA0vjBpF4k/Y4g/UvuSpZO2aqKj/JzwbDijI02m9 Tqsg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y11si1014713edm.309.2020.11.19.17.31.41; Thu, 19 Nov 2020 17:32:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726776AbgKTB3V (ORCPT + 99 others); Thu, 19 Nov 2020 20:29:21 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:40248 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726295AbgKTB3U (ORCPT ); Thu, 19 Nov 2020 20:29:20 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kfvEY-0082d5-4S; Fri, 20 Nov 2020 02:29:06 +0100 Date: Fri, 20 Nov 2020 02:29:06 +0100 From: Andrew Lunn To: Pavana Sharma Cc: lkp@intel.com, ashkan.boldaji@digi.com, clang-built-linux@googlegroups.com, davem@davemloft.net, f.fainelli@gmail.com, gregkh@linuxfoundation.org, kbuild-all@lists.01.org, kuba@kernel.org, linux-kernel@vger.kernel.org, marek.behun@nic.cz, netdev@vger.kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, vivien.didelot@gmail.com Subject: Re: [PATCH v10 4/4] net: dsa: mv88e6xxx: Add support for mv88e6393x family of Marvell Message-ID: <20201120012906.GA1804098@lunn.ch> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -222,8 +231,8 @@ static int mv88e6xxx_port_set_speed_duplex(struct mv88e6xxx_chip *chip, > return err; > > reg &= ~(MV88E6XXX_PORT_MAC_CTL_SPEED_MASK | > - MV88E6XXX_PORT_MAC_CTL_FORCE_DUPLEX | > - MV88E6XXX_PORT_MAC_CTL_DUPLEX_FULL); > + MV88E6XXX_PORT_MAC_CTL_FORCE_DUPLEX | > + MV88E6XXX_PORT_MAC_CTL_DUPLEX_FULL); This looks like a white space change? > if (alt_bit) > reg &= ~MV88E6390_PORT_MAC_CTL_ALTSPEED; > @@ -390,6 +399,84 @@ phy_interface_t mv88e6390x_port_max_speed_mode(int port) > return PHY_INTERFACE_MODE_NA; > } > > +/* Support 10, 100, 200, 1000, 2500, 5000, 10000 Mbps (e.g. 88E6393X) */ > +int mv88e6393x_port_set_speed_duplex(struct mv88e6xxx_chip *chip, int port, > + int speed, int duplex) > +{ > + u16 reg, ctrl; > + int err; > + > + if (speed == SPEED_MAX) > + speed = (port > 0 && port < 9) ? 1000 : 10000; > + > + if (speed == 200 && port != 0) > + return -EOPNOTSUPP; > + > + if (speed >= 2500 && port > 0 && port < 9) > + return -EOPNOTSUPP; Maybe i'm missing something, but it looks like at this point you can call return mv88e6xxx_port_set_speed_duplex(chip, port, speed, true, true, duplex); > +/* Offset 0x0E: Policy & MGMT Control Register for FAMILY 6191X 6193X 6393X */ > + > +static int mv88e6393x_port_policy_write(struct mv88e6xxx_chip *chip, u16 pointer, > + u8 data) > +{ > + > + int err = 0; > + int port; > + u16 reg; > + > + /* Setup per Port policy register */ > + for (port = 0; port < mv88e6xxx_num_ports(chip); port++) { > + if (dsa_is_unused_port(chip->ds, port)) > + continue; > + > + /* Prevent the use of an invalid port. */ > + if (mv88e6xxx_is_invalid_port(chip, port)) { > + dev_err(chip->dev, "port %d is invalid\n", port); > + return -EINVAL; > + } /* Mark certain ports as invalid. This is required for example for the * MV88E6220 (which is in general a MV88E6250 with 7 ports) but the * ports 2-4 are not routed to pins. */ unsigned int invalid_port_mask; You have not set this in the info structure of the 6393x devices, so you can skip this check. > +/* Only Ports 0, 9 and 10 have SERDES lanes. Return the SERDES lane address > + * a port is using else Returns -ENODEV. > + */ > +int mv88e6393x_serdes_get_lane(struct mv88e6xxx_chip *chip, int port) > +{ > + u8 cmode = chip->ports[port].cmode; > + int lane = -ENODEV; > + > + if (port == 0 || port == 9 || port == 10) { Maybe if (port != 0 && port != 9 && port == 10) return -ENODEV > + if (cmode == MV88E6XXX_PORT_STS_CMODE_1000BASEX || > + cmode == MV88E6XXX_PORT_STS_CMODE_SGMII || > + cmode == MV88E6XXX_PORT_STS_CMODE_2500BASEX || > + cmode == MV88E6XXX_PORT_STS_CMODE_5GBASER || > + cmode == MV88E6XXX_PORT_STS_CMODE_10GBASER || > + cmode == MV88E6XXX_PORT_STS_CMODE_USXGMII) Indentation is messed up. > + lane = port; return port; Andrew