Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1104682rdh; Fri, 27 Oct 2023 05:06:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6bi8p7NC346n+4NPRM0VZyv8zyHw+esIytHAJvXPyaNLKoeCIGOKZGVr4hHFuG0bR/0Wg X-Received: by 2002:a81:ca04:0:b0:5ae:fd4b:f06a with SMTP id p4-20020a81ca04000000b005aefd4bf06amr2750006ywi.30.1698408401527; Fri, 27 Oct 2023 05:06:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698408401; cv=none; d=google.com; s=arc-20160816; b=xxYDMBQcAZ4qt/ON0p/rRRiz6r/chV/QqBc8QeggmZJMBmKYXcAhCqb6p96SyBKA6s 21vPrCcncmwydbJ6d4TTvPi4RPaN3O2Cr567l2hxcYBprJHHarHoMl9KLPB3TZAh2sdP wS2lfWc2HSWVY/GAQc4U4rqat0mbPvi0pxsmYA4Gkz2lycp83LsmTgMfNmDXF3fZmcLR 2F1f70kHeGxUuGu2ebDVzcvk52ljJQQFwmWo+cihT39qiwra2iGiO6rtPM5guQIqFSes 19nFJ5WCzTPokW1NGZSSGjVqo7Cp+/3x6KHBR95JrQg1iBRhgjVky3wcCK9eejnB2RsU /jxA== 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:dkim-signature; bh=TfjG1MPQZh4uBcGLC6VVWkeSnIlrjqD/R5zPMvQS/b8=; fh=kbm4s1EmWs5PIV1qR+c4+jEwat3/OkApp5cTiWtnCeY=; b=q4ltF88CdN1ndyPavOtfnnzmFKAbVSBRDWXf50q/o4GDZgj/f4iLmYi5RtzqtJTLzR fKJLzwn6xDytzq9BSqCtlj3rvNuPufI+Kc5xzCGsS8zEyTOCtO4UUGmD3YLvyhPs79cX fE++o3/5Hi3gG8+A/FpyuTHw84JdmUrKLwgTQjDSwzX1C9wfGCi0ZMetJLspu907iVV1 c0h4mFOupd8FIOONk49oMMgRyPoQo3I15UutRVdE4UohEN7dn3UXJhT5CCDBSdAPzw6a q1fXPnZCGtLe8dhWWa8RgJJX7G5ecjv3soqWd/xUwMAkjw93fBlRz1uDnmonGVd/Ky2O 3Dig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=O56UF0X8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id w186-20020a8149c3000000b0059f5be68e7asi2465125ywa.14.2023.10.27.05.06.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 05:06:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=O56UF0X8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id A421783ACB4D; Fri, 27 Oct 2023 05:06:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345803AbjJ0MG2 (ORCPT + 99 others); Fri, 27 Oct 2023 08:06:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345739AbjJ0MG1 (ORCPT ); Fri, 27 Oct 2023 08:06:27 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80BDE10A; Fri, 27 Oct 2023 05:06:24 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-507a55302e0so2532035e87.0; Fri, 27 Oct 2023 05:06:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698408383; x=1699013183; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=TfjG1MPQZh4uBcGLC6VVWkeSnIlrjqD/R5zPMvQS/b8=; b=O56UF0X8TYqnQJelqPKWY59qOu61pgg/Kx7+SYxOXvXm8UXwsx79XgU4eOtX0xO2tA HL3PIPEUntGNnVAu8hTXEPC3YD0k/7oe5AHRHUf4wsq1U+6lIrjtMvESiXLMvGAqCM3v 7h8y7GrGgCWvCk1Do+PM0BihuvcYEHdmbSpPOsk7Kz3Gel7453Zz+HOApb2skg69oA/F peh+DgsxRkBbjjdlKiBAp3KkvvfBlx5dHsX8Qd/HApv3pAvUdhMzmXtbJfQhXYLhcbU6 wk4kSHqB0ngZDPPnGaVl2hx5Ifj3YFcaUlfFnZtBr38Tuy8Dav/eBVtWtUK0bXueI/jx 1x7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698408383; x=1699013183; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TfjG1MPQZh4uBcGLC6VVWkeSnIlrjqD/R5zPMvQS/b8=; b=DqWIPp1NVHGD2O6WIngSBaEO0p34WiQP0FUez2VY5fZdy0Q0TKguzI8B8LOIU3JVZE HH6D4Zor445EfibzPXrxHtCHL5KCik2PJsoDQnQjr4lyoD35FwG7mQnDbnCrqL7JIWMR 1gKvtSQHwnCzFQ8nMoLdZeybsTCKy5cznoyitCZJ9Ul+kA0nuKzxWR05utpi6Ijz+aZ8 nBY/6UUzklY5Oaxd2Qxl459ODKfF3O5JOFDYoBjsETSTgUrLqzA4pLuiAI9fJkVQ68fL ZvdY6QWt4Z42d8L5q+d3pfJoI+B1T11iYURTF7piHAeWEShaeLayU8q8NG3nJbnNDxV/ 9Xog== X-Gm-Message-State: AOJu0YzoEzTabHjmSDyI4emtO84xtIcruKRCSC81EjSFC7y8LpzVMUE+ Y8HknQEQnKIzABdir+7lR3Q= X-Received: by 2002:a05:6512:239c:b0:507:a8ed:ee0b with SMTP id c28-20020a056512239c00b00507a8edee0bmr2171773lfv.65.1698408382010; Fri, 27 Oct 2023 05:06:22 -0700 (PDT) Received: from mobilestation ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id 18-20020ac24852000000b004ff8e79bc75sm256430lfy.285.2023.10.27.05.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 05:06:21 -0700 (PDT) Date: Fri, 27 Oct 2023 15:06:19 +0300 From: Serge Semin To: "Russell King (Oracle)" Cc: Raju Lakkaraju , netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, linux-kernel@vger.kernel.org, andrew@lunn.ch, Jose.Abreu@synopsys.com, UNGLinuxDriver@microchip.com Subject: Re: [PATCH net-next V3] net: pcs: xpcs: Add 2500BASE-X case in get state for XPCS drivers Message-ID: <6j7szthl34z5q2ea4qnno7e2fnde3djxifx7chhhaihqty23q6@7j42bte7b3dv> References: <20231027044306.291250-1-Raju.Lakkaraju@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 27 Oct 2023 05:06:38 -0700 (PDT) Hi Russell On Fri, Oct 27, 2023 at 12:54:36PM +0100, Russell King (Oracle) wrote: > On Fri, Oct 27, 2023 at 02:04:15PM +0300, Serge Semin wrote: > > Cc += Russell > > > > * It's a good practice to add all the reviewers to Cc in the new patch > > * revisions. > > > > On Fri, Oct 27, 2023 at 10:13:06AM +0530, Raju Lakkaraju wrote: > > > Add DW_2500BASEX case in xpcs_get_state( ) to update speed, duplex and pause > > > > > > Signed-off-by: Raju Lakkaraju > > > > With a nitpick below clarified, feel free to add: > > Reviewed-by: Serge Semin > > > > > --- > > > drivers/net/pcs/pcs-xpcs.c | 29 +++++++++++++++++++++++++++++ > > > drivers/net/pcs/pcs-xpcs.h | 2 ++ > > > 2 files changed, 31 insertions(+) > > > > > > diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c > > > index 4dbc21f604f2..31f0beba638a 100644 > > > --- a/drivers/net/pcs/pcs-xpcs.c > > > +++ b/drivers/net/pcs/pcs-xpcs.c > > > @@ -1090,6 +1090,28 @@ static int xpcs_get_state_c37_1000basex(struct dw_xpcs *xpcs, > > > return 0; > > > } > > > > > > +static int xpcs_get_state_2500basex(struct dw_xpcs *xpcs, > > > + struct phylink_link_state *state) > > > +{ > > > + int ret; > > > + > > > + ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_STS); > > > + if (ret < 0) { > > > + state->link = 0; > > > + return ret; > > > + } > > > + > > > + state->link = !!(ret & DW_VR_MII_MMD_STS_LINK_STS); > > > + if (!state->link) > > > + return 0; > > > + > > > + state->speed = SPEED_2500; > > > > > + state->pause |= MLO_PAUSE_TX | MLO_PAUSE_RX; > > > > Why is it '|=' instead of just '='? Is it possible to have the 'pause' > > field having some additional flags set which would be required to > > preserve? > > The code is correct. There are other flags on state->pause other than > these, and phylink initialises state->pause prior to calling the > function. The only flags that should be modified here are these two > bits that the code is setting. > > Phylink will initialise it to MLO_PAUSE_NONE if expecting autoneg, or > the configured values if autoneg on the link is disabled. Thanks for clarification. Then no more comments from my side in this patch regard. Regarding the XPCS driver in general. Based on what you said the rest of the XPCS state getters are wrong in fully re-writing the 'pause' field. Right? -Serge(y) > > -- > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ > FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!