Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp536869rwi; Thu, 20 Oct 2022 01:55:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6sjICsLJhZbvizKgy4UTj4qJ1Qh3pqEAbYGvKaSxmna2BpnEOyS/URDMncUCzaM18wJmsW X-Received: by 2002:a05:6402:274c:b0:45c:bb27:3d39 with SMTP id z12-20020a056402274c00b0045cbb273d39mr11156078edd.163.1666256124611; Thu, 20 Oct 2022 01:55:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666256124; cv=none; d=google.com; s=arc-20160816; b=z+QncPI7fRAgFN+f4xrIuXTvznaRPPuk6DQIlN6qKCW7meUeJRVu0YPCFGD+IcAQVN 8hC7T+DG7HKj6t5iJV/nkUWyX2Oc7SgzjNPXO3QpVDaQpPFjjdkgUkDS13D4gF0jIMqL 8IIo4qNiKpksS8e3HENds7LEAwQhAwnVs7A23GQ5TrnMumHd+dhqB9YfS571pAwGNgch he+PRDJ3RGpLCHPagxnjV7vV6fEYnFZZYwLfzdgT/NZZa7QQZ7WtjaQQS/no7OH9xUYv ZVDzgVyomXBBjQK2b75bA3mlsowL94DWh0va32sjSCkD5cpjZ41U8ye+22YERc2C2/dx U5vA== 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=V+1ef8CY4rNU4mQk37SBqFAMHnpg/IcaHQ4AFvuNoks=; b=li/RIZG/otKQCOhpUYPdf7xw116GwbkUEVqCUdixmucfY8HPsVJ7rEFd/nqACll8ci 8quvLt5j47YPo8tY6SzWEx9vWr9gfHayS58M0Yo7eS3J1+eBIBLZbJ+jBd6P0lZAPrnU MnpZ/cTXMiUYfVzYpmtGVTBZ8puRA8xbzjQa9qL3OlOQi8zDJcS6GwIoPe6mLBPVMYdh d2TXFhLPZx3EnZ3gJ3SYHh6g4/XR85RH15+b3v4jWVwaIle5HKVS5+ttBgBa9m09XAeT pmU5k6HaQRcx/PoGn7N3qEb8W0gkqm19u9WlIPv5edYd0aGcKZLCjnEW3gYDlU9qIJQG CG3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=GIL9tOLj; 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 hp19-20020a1709073e1300b0078212b2e6e2si17483371ejc.75.2022.10.20.01.54.58; Thu, 20 Oct 2022 01:55:24 -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=GIL9tOLj; 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 S230280AbiJTIeV (ORCPT + 99 others); Thu, 20 Oct 2022 04:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230305AbiJTIdj (ORCPT ); Thu, 20 Oct 2022 04:33:39 -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 278B918D469; Thu, 20 Oct 2022 01:33:38 -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=V+1ef8CY4rNU4mQk37SBqFAMHnpg/IcaHQ4AFvuNoks=; b=GIL9tOLjjdtmPdIM56MUg3cw+p q/vk9cqNJnqbmMS7KTOWoEWU83QMLOIuz74N0QNs5F4IdZEXwhpuQnnMnEg+kS1Vwj4ESaMeTsZ6v thzoxV6W6b7tBNawqRCx/aPDaRFAvnA4wZ6+9X3pWX9CHgN/qQJplDRGtQQVIAh/BTUOr1Tabszl8 v4N2z+vPWDHo/wbwHxfbWgL46ZgPHJ47CWnDFgPn+DJPR5I+C57B6kHquYYsZdWhd6LUwhCXlbuOc VrecXyGNCXTUMtamT+vZRsTcwYVr9hH9ueUauV1KTejAlhZWpcUtupe2JxRTbZughvjkLuVLTU8t0 q60AoVvQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:34818) 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 1olQzP-0006j5-TT; Thu, 20 Oct 2022 09:33:19 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1olQzL-00031C-LG; Thu, 20 Oct 2022 09:33:15 +0100 Date: Thu, 20 Oct 2022 09:33:15 +0100 From: "Russell King (Oracle)" To: Frank Wunderlich Cc: Frank Wunderlich , 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 Subject: Re: [PATCH] net: mtk_sgmii: implement mtk_pcs_ops Message-ID: References: <20221018153506.60944-1-linux@fw-web.de> <949F5EE5-B22D-40E2-9783-0F75ACFE2C1F@public-files.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <949F5EE5-B22D-40E2-9783-0F75ACFE2C1F@public-files.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 07:54:49AM +0200, Frank Wunderlich wrote: > Am 18. Oktober 2022 18:39:01 MESZ schrieb "Russell King (Oracle)" : > >Hi, > > > >A couple of points: > > > >On Tue, Oct 18, 2022 at 05:35:06PM +0200, Frank Wunderlich wrote: > > >> + regmap_read(mpcs->regmap, SGMSYS_PCS_CONTROL_1, &val); > >> + state->an_complete = !!(val & SGMII_AN_COMPLETE); > >> + state->link = !!(val & SGMII_LINK_STATYS); > >> + state->pause = 0; > > > >Finally, something approaching a reasonable implementation for this! > >Two points however: > >1) There's no need to set state->pause if there is no way to get that > > state. > >2) There should also be a setting for state->pause. > > Currently it looks like pause cannot be controlled in sgmii-mode so we disabled it here to not leave it undefined. Should i drop assignment here? Why do you think it would be undefined? static void phylink_mac_pcs_get_state(struct phylink *pl, struct phylink_link_state *state) { ... if (state->an_enabled) { ... state->pause = MLO_PAUSE_NONE; } else { ,,, state->pause = pl->link_config.pause; } ... if (pl->pcs) pl->pcs->ops->pcs_get_state(pl->pcs, state); So, phylink will call your pcs_get_state() function having initialised it to something sensible. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!