Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1180177rwi; Thu, 20 Oct 2022 09:30:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5KIZmoQKvfJbenK9P+FOed7ocy9rmufzPl74LoYjE6g6ozysJ6GeT2ECiBj1xaByRCvsM3 X-Received: by 2002:a05:6a00:228b:b0:563:b52e:4cc0 with SMTP id f11-20020a056a00228b00b00563b52e4cc0mr14345589pfe.79.1666283436624; Thu, 20 Oct 2022 09:30:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666283436; cv=none; d=google.com; s=arc-20160816; b=xR0ver8Gd/sba+b7IvxqCrBQGbaOuPThW1FhzZAhFYqedZDCpep9RyBJTDlj/vgcUS cnGZ5wTE9VgXjckyxH7lHrIlpPv8l9ek8Xr4Wyg/43Ua4Jr+K7eVSAGeojUlmIgjRuLt h3bDoJWBCk/BkcoBAVVffo2/6n5bQALkS5DVEqxR5fsHwUcf16QdqKvbBi/3QznM3YFD sUViw6HUTxc+s6R7K93WWuKGZdQi4IL1/6lsVylrq57wCVOEF+iap9/HuiYC9TFMnyJq U6CCYwEADp2dPtnyjj2F3R60Ah1aUFAKajm/MfFVI3E5xxvU+wKmVV9ImoHwcg1p6PUR 1xEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=lESwXvm7/TM1xJl1haYY/cX2oj4VfSDfgY65rchWdvg=; b=WXFWjw1DYq1nQIzwUulHy+4PJJABTsNpTyA4b/ERHOHtIokAG/62jqxzXWaN1BD+4g zGBKtzVtaVXEjbKYKbTNioaTbKrRMXWNNaT1scmPdVjVOK93ubnlbeo33khqBymnZfVw un5ip4YJCAm8YU0z6MtxwZXBJfsL669bc2JhmLSLO7CFIEezRgRutXY2fUzd9W1uXICt 0zS4vy5opPaU/7GEBIqX6PZ+Q49bhR/0sXFnxLHtXu3a73N6AoLrSUepj4IY/B92STSo c4s7pI/niGdg6cibV01Jsgjwd+JOBrx2z6E0o+CI0YD77E9mI2Y4ZX/9WW+7KBcf8LPX 2EHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=QvK+ioe3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 77-20020a630050000000b00460b572d264si21900490pga.579.2022.10.20.09.30.19; Thu, 20 Oct 2022 09:30:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=QvK+ioe3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230409AbiJTQSG (ORCPT + 99 others); Thu, 20 Oct 2022 12:18:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229876AbiJTQSE (ORCPT ); Thu, 20 Oct 2022 12:18:04 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01F3410573; Thu, 20 Oct 2022 09:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: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=lESwXvm7/TM1xJl1haYY/cX2oj4VfSDfgY65rchWdvg=; b=QvK+ioe3eZ2LCAB86gz7Gd5G95 x0fPcG2Db25FHsXiK/+Sw24enuFw55evax9BQKac4ROlOtV4+Q/AGvtRu2zCpjUdS+eUlFdJaCj4x RToIx5OUJMTOe74dz3GKKjvingM8LPXxAT3crT+3oOy9acGTgfzr0bZqAFuFTf1ZXJmJu3P+7majd mBCgwI1R5d3DCeoJ/+omEjyTxcL+oKtRS+wbca543Mz5cVhxgdoJ/qmkLsxPVLmhx0WkNLZYKXA6K CzK5goRxtiHEORaGz2DoZVCYCxgsXfv5ZXuMC/McJEeEsdN/ewB7uxoUqmCqsbzIqFVUQtNJbuVN8 XHZH51KQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:34828) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1olYEr-0007UG-6T; Thu, 20 Oct 2022 17:17:45 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1olYEn-0003IX-Hp; Thu, 20 Oct 2022 17:17:41 +0100 Date: Thu, 20 Oct 2022 17:17:41 +0100 From: "Russell King (Oracle)" To: Frank Wunderlich Cc: linux-mediatek@lists.infradead.org, Alexander Couzens , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Frank Wunderlich Subject: Re: [PATCH v2] net: mtk_sgmii: implement mtk_pcs_ops Message-ID: References: <20221020144431.126124-1-linux@fw-web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221020144431.126124-1-linux@fw-web.de> Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 20, 2022 at 04:44:31PM +0200, Frank Wunderlich wrote: > diff --git a/drivers/net/ethernet/mediatek/mtk_sgmii.c b/drivers/net/ethernet/mediatek/mtk_sgmii.c > index 736839c84130..8b7465057e57 100644 > --- a/drivers/net/ethernet/mediatek/mtk_sgmii.c > +++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c > @@ -122,7 +122,21 @@ static void mtk_pcs_link_up(struct phylink_pcs *pcs, unsigned int mode, > regmap_write(mpcs->regmap, SGMSYS_SGMII_MODE, val); > } > > +static void mtk_pcs_get_state(struct phylink_pcs *pcs, struct phylink_link_state *state) > +{ > + struct mtk_pcs *mpcs = pcs_to_mtk_pcs(pcs); > + unsigned int val; > + > + regmap_read(mpcs->regmap, mpcs->ana_rgc3, &val); > + state->speed = val & RG_PHY_SPEED_3_125G ? SPEED_2500 : SPEED_1000; > + Sorry, looking back at my initial comment on the first revision of this patch, I see my second point was confused. It should have read: "2) There should also be a setting for state->duplex." IOW, "duplex" instead of "pause". Also, is there no way to read the link partner advertisement? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!