Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2374712rdb; Fri, 8 Dec 2023 06:28:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFM5PG2mOo6lw/9adSGz7Bh7CIg33i+cIGTh1ZanbuQPY4qG7ZnmrRiLQxXX5JsFsjLz5y X-Received: by 2002:a05:6a20:158b:b0:18f:97c:5b8e with SMTP id h11-20020a056a20158b00b0018f097c5b8emr73383pzj.92.1702045718944; Fri, 08 Dec 2023 06:28:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702045718; cv=none; d=google.com; s=arc-20160816; b=aMRpNIHvCONKx9TdXERZpDeQQTM7Xl0sf1kyKSCQVBBuhaY6V48HVrLX5KuxsQTBL4 qA+CaUKW6b1UBiNsvwMdHdi2lhsXsQTB8Cc6Gshrq4tE6C3bkmjYOO37IKyRl2uC1L7b ZcHCZiZXwgIxUP/rXgd3nRarM/nqitsS1oapNjlrJKqYg9+Q+43AaZNK2+e4FiKcu2Y/ +ZPdxikABKYIQH5z1s/5Cj6pBG8K/x7gXxwRx+Ixy3bGrxvFlpoOnnlVm14X5+HPmGj0 a4AEp5ANCWUixdpuWrSWEw5ustUVarRPEHihyDMMc5Xj9msDdV7AlTsv/rQPwFf7YtfD xqug== 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=Do5YXZvpx1oH456IeLehOp7UBGB2jGfxbiAhA8fLLOw=; fh=CjffO3W0TJDLjj4wc4I51YHmZ8agQOb6/B+bC9OEbZ4=; b=gMGBkyugREF2LoL5IU0CfuQht1DGJ7Lwme+8PWh8VLkfUl0/OtVI5nxFavKhTGetrp XqPkYGowl57okX9kxydoOHrKGqiXPvrcdSPKOeOtGuzzSld2pu9r33i4DSZn8fr5AgyL PMvneKjfBPhK+i1Q7/ACoqEvBgyPtOpCbZrQl8GM2D6CWPN4c3QzslX9UhIu35XSB1il 06ri5QOC5FAFw2h75Mf3LEY4ifYeZsyLIYXhOJ+bOF2NgSwY7tnPkf/faFJBY3XJpQn3 tDjXhpVYOP/qSYcMQEw4a3ynepunaMiX4EM8Jm79bG0B/2wdaKynXx5FMGPUY73u1Znd Iqmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cFzW2p3M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id ci2-20020a17090afc8200b0028694fc7a61si1716585pjb.13.2023.12.08.06.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 06:28:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cFzW2p3M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id EE5DA80ADF16; Fri, 8 Dec 2023 06:28:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573959AbjLHO2V (ORCPT + 99 others); Fri, 8 Dec 2023 09:28:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573958AbjLHO2T (ORCPT ); Fri, 8 Dec 2023 09:28:19 -0500 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4799E173B; Fri, 8 Dec 2023 06:28:25 -0800 (PST) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2c9fbb846b7so23902751fa.2; Fri, 08 Dec 2023 06:28:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702045703; x=1702650503; 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=Do5YXZvpx1oH456IeLehOp7UBGB2jGfxbiAhA8fLLOw=; b=cFzW2p3MyYfpTjkfLMr/KOZ4XnMsSo0j1jZTzhfTCd2X/auxaJxXCUjXd+BCiK4CgF IDKtmecombAWYTfAAs8X/sLkfFeG89AnwNwnRKjgIB66qqjrLEs18bCGS639wP+qvIYT rZAZG/ndxJEVjdDGu3F5i+Dbx5em6rwc3s1xs/CrA6Q+qX9YHHn+SDgBFxHK4UgphhuH D7hbfQX8ZUa/pYJg6cHQuqD7H9nCtPH77O+3GCvELMOZgcps7/pPxcsPFyvYmMVvkHZE vvpkzMBVXCN0hrThycYaYltEeiYigPqtOMfjTxIHw6FOskl4TbI2KrMoAhIiZixctZfd ZEsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702045703; x=1702650503; 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=Do5YXZvpx1oH456IeLehOp7UBGB2jGfxbiAhA8fLLOw=; b=gOQyJJaZ9pzYCAvRpr4DR9Ay7977x1f0tH2Wr1l8ozC5YWcg1iHbWv6hswlMxp9FmE bacWV81wCR6AEZFTBqv2dl1bKJucmp13RHW+tls6LWPNapUstpy8sBr9O8erVuheLATG FOUHFlTcvsUSXv26Lzc1o25vG0HsVHBfCyiDmZH0aVc1QcgfzQK0oPxK5rHhLxzvXPD0 wSWM7oV5Mxvd48fGH81hqi8GsD4iwV6N0CrUzNNNRz1U/xhBApwRAO6MRo33AiNyyK8c aCKPdw64Cmz++wn0ZC6vz2bMh8ifoUDNXckckYL8x5U3Z7uPuIWLqhwrqSvmGzMOeSQ4 vElg== X-Gm-Message-State: AOJu0YyhytYxeHR3aUoWFIP6rl9+ZO8nWAuG0BCOJnlWeqNwWTBvtjvQ NwdmoAQrYXHMmGxCbCmyxQ4= X-Received: by 2002:a2e:97d3:0:b0:2ca:30a:838c with SMTP id m19-20020a2e97d3000000b002ca030a838cmr2470312ljj.99.1702045703253; Fri, 08 Dec 2023 06:28:23 -0800 (PST) Received: from mobilestation ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id j16-20020a2e3c10000000b002c9ff0457f8sm241983lja.11.2023.12.08.06.28.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 06:28:22 -0800 (PST) Date: Fri, 8 Dec 2023 17:28:20 +0300 From: Serge Semin To: Maxime Chevallier , Jiangfeng Ma Cc: Jiangfeng Ma , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Simon Horman , Andrew Halaney , Bartosz Golaszewski , Shenwei Wang , Johannes Zink , "Russell King (Oracle" , Jochen Henneberg , "open list:STMMAC ETHERNET DRIVER" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" , open list , James Li , Martin McKenny Subject: Re: [PATCH] net:stmmac:stmmac_platform:Add snps,xpcs devicetree parsing Message-ID: References: <20231208091408.071680db@device.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231208091408.071680db@device.home> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 08 Dec 2023 06:28:38 -0800 (PST) Hi Maxime, Jiangfeng On Fri, Dec 08, 2023 at 09:14:08AM +0100, Maxime Chevallier wrote: > Hello, > > On Fri, 8 Dec 2023 07:02:19 +0000 > Jiangfeng Ma wrote: > > > In order to setup xpcs, has_xpcs must be set to a non-zero value. > > Add new optional devicetree properties representing this. > > > > If has_xpcs is set to true, then xpcs_an_inband should preferably be > > consistent with it, Otherwise, some errors may occur when starting > > the network, For example, the phy interface that xpcs already supports, > > but link up fails. > > Can you elaborate on why you need this, and on which platform > especially ? Usually drivers for the various stmmac variants know if > they have XPCS or not, or can guess it based on some info such as the > configured PHY mode (dwmac-intel). > > Besides that, there are a few issues with your submission. If DT is the > way to go (and I don't say it is), you would also need to update the > bindings to document that property. > > > The types of has_xpcs and xpcs_an_inband are unsigned int, > > and generally used as flags. So it may be more reasonable to set them to > > bool type. This can also be confirmed from the type of @ovr_an_inband. > > And this part would go into a separate patch. In addition to what Maxime already said having DT-bindings adjusted to fit to the pattern implemented in the software part is a wrong way to go. The best choice in this case is to add the DW XPCS DT-node to the DW MAC MDIO/MI bus and then use the "pcs-handle" to inform the MAC (mainly it's driver) of what PCS-device is actually attached to it. The series I submitted on this week is exactly about that: https://lore.kernel.org/netdev/20231205103559.9605-1-fancer.lancer@gmail.com/ I guess I'll need about a month or so to settle all the comments, but the solution implemented there will be better than this one really. -Serge(y) > > Thanks, > > Maxime >