Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp898334rwb; Wed, 7 Dec 2022 06:23:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf7q3pewkjqaFICtXWJieZoQs60ngymLLAx8U/TXPj2vww0eSJQCsXmSnmBgTcPNpZCP+tWp X-Received: by 2002:a17:907:16a5:b0:7be:42dc:4cfc with SMTP id hc37-20020a17090716a500b007be42dc4cfcmr42587623ejc.128.1670423006207; Wed, 07 Dec 2022 06:23:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670423006; cv=none; d=google.com; s=arc-20160816; b=wJ/yNLzOfwP5jxmgX/AD7x2usB0TtFCdqgCsvpQf0SXExZg4wqk4BOJxn6K1BRmhIh m26ysiwThDQsv+fd61XRK+oHURmQpFuuUD43abow4NGdH/fA8oCHjinkr3OJEMpxr7Sm H7efuWFZG9W8FxHi78QiD47S0suAL2P/lZEXPLqdSYorvi+SequCH3MUnU3yU40f/gWG pOLu4UeHchViJwo2wq8HH5yFxZb0grsCLhnand4fkeA1liGIUlPqPDaDj729Wi06/eez OZcHEizGz2Prc2DDWACcY37VF5kRTy0wblX25xymTn6ilFlWgTbtYNNxPcpUe4oecZqk bt8w== 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=fM4Ue57KpFKFDSFH+YV7t40a1Sc6yCwSXiEZl7JSvBM=; b=BzldHMzPbQWZVn+7lyOQMh3VDCjurhXZQyc+SX5rdGm8d6FdxWjs5SZfNae6J7BHzO Vx90JNG78602UDr2yjZ6JhdxEPbFy2/NlaCjolGRKI9MfBsCTmhSMJ0jWYsy80RSAcW+ TGTSiMJw+d9Qad6FSZbRo1AqOUT0kbjZVAv0HoqxsOKapn94bRsOjfqmwOdhBy431JVl Ppuv5D+0AmDN2+ETen7Quu8gpvY0s5xGAYabw1hmGcQtJQ5ORsXVTfo+tBCBXHWc+Ji4 hNO0oH/yDMk1Fl3zlIctZSCeHlKnqoJ5lid8TBq078ebJhOYfg2LD8r1Z/MBj1pbDP15 mvwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=NCARY8rD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb29-20020a1709076d9d00b0078dcdbb3e87si15159718ejc.530.2022.12.07.06.23.07; Wed, 07 Dec 2022 06:23:26 -0800 (PST) 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=pass header.i=@lunn.ch header.s=20171124 header.b=NCARY8rD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229749AbiLGNp4 (ORCPT + 75 others); Wed, 7 Dec 2022 08:45:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbiLGNpz (ORCPT ); Wed, 7 Dec 2022 08:45:55 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 350CA59147; Wed, 7 Dec 2022 05:45:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=fM4Ue57KpFKFDSFH+YV7t40a1Sc6yCwSXiEZl7JSvBM=; b=NCARY8rDBeekeP9LTUhVaxU5Px WFYvdfPFuPTon9eE9yjGGy1YmSLHh/7OAB7a61INnw+fwmgv1Qc08Za6Y85AVBcUYDWv5DHeLb6gZ vjQnGARnVs8q5UeCLgBSZaYgd7aaZxt/j59RdZBzG/Oe9KRSvxjtqz0pGj5xVwcK+o3Y=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1p2ujF-004elC-H7; Wed, 07 Dec 2022 14:44:53 +0100 Date: Wed, 7 Dec 2022 14:44:53 +0100 From: Andrew Lunn To: Piergiorgio Beruto Cc: Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Oleksij Rempel Subject: Re: [PATCH v4 net-next 5/5] drivers/net/phy: add driver for the onsemi NCN26000 10BASE-T1S PHY Message-ID: References: <1816cb14213fc2050b1a7e97a68be7186340d994.1670329232.git.piergiorgio.beruto@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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_PASS,SPF_PASS 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 What might also play a role here is the application these PHYs are used in. Automotive. So the devices are generally 'appliances'. They have one purpose, rather than being general purpose. So i expect the network is very static. DT is supposed to describe the hardware, not really configuration of the hardware. But a lot of this is very hardware near so should be O.K. in DT. > Enable of enhanced-noise-immunity mode > - This trades off CSMA/CD performance for noise immunity. It could be a > static setting, but the user may want to conditionally enable it > depending on application decisions. E.g. some people may want to > enable/disable this when using CSMA/CD as a fallback in case the PLCA > coordinator disappears. Of course, there are better ways of doing > this, but it is a possible use-case that some people want to use. I would probably leave this one for the moment, until somebody really needs it. It also sounds generic, not specific to this PHY. > Tuning of internal impedance to match the line/MDI > - This is really board dependent, so DT seems good to me DT sounds good. It also sounds generic, not specific to this PHY. > Tuning of PMA filters to optimize SNR > - same as above? Also sounds generic? > Tuning of TX voltage levels > - I am not 100% sure that is static (DT) but for the time being it could > be considered as such. It basically trades-off EMI (immunity) for EME > (emissions). There has been general interest in this for a while, but nobody has implemented it. Marvell PHYs allow you to change the amplitude for example, which i've seen used to work around EMC issues. Part of the problem here is keeping within the standard, and dealing with the dynamic behaviour of the network. Somebody might reduce the voltage and it works. And then the cable is swapped, to a longer cable, and it stops working because the voltage is too low. So there was discussion about on link down, the setting reverts back to default, to ensure it works when the link comes back up again. A PHY tunable was suggested for this. But it needs thinking about. For automotive/appliance setting, maybe this can be simplified, since you don't expect the cabling to change. > Topology Discovery > - This is a special mode to detect the physical distance among nodes on > the multi-drop cable. It is also being standardized in the OPEN > Alliance, but for the time being, it is proprietary. I think it will > require some kernel support as a protocol is also involved (but not > standardized, yet). This might fall under cable test. It can already return cable length, which normally means length along cable to fault, but it is a bit ambiguous, so can also mean just length. Adding an extra attribute it could easily mean length to node. Proprietary vs standard does not matter, since cable testing in general is proprietary. You just need to see how you can plug it into the current API. > Multi-putrpose I/Os (LED, GPIO, SFD detect). > - I know the kernel already has the infrastructure for those functions > (not sure about SFD) so I assume this could be some DT work and some > code to configure the MUX to achieve the specific function. LEDs are a long long story, which has not yet reached its conclusion. But they will end up as being Linux LEDs, which can be accelerated using hardware. GPIOs are just linux GPIOs. You might have some DT to indicate how the external pin is wired, pinmux. But pinmux is also standardized within Linux. I should point out that many PHY silicons support GPIOs, but nobody has ever used the capability in Mainline Linux. > Selection of link status triggers > - This is what I was trying to achieve with the module parameter. i.e., > the link status can be a simple on/off based on the link_control > setting (this is what it is for CSMA/CD as there is no link concept) > or it could be masked by PLCA status whrn PLCA is enabled. This is a > design choice of the user. In the former case, you don't get a link > down if the PHY automatically go back to CSMA/CD as a result of PLCA > status being 0. In the latter case you get a link down until PLCA is > up & running, preventing the application to send data before time. This is an interesting one. I don't know of any other link technology which operates like this. The link is either up, or down. There is support for downshift, when a T4 phy discovers a broken pair and swaps from 1G to 100Mbps using two of the working pairs. You get down/up events when this happens, and you can see the actual speed as opposed to the expected speed. I'm not sure i would actually make this configurable. Some applications might be happy with best effort, will others want to wait for PLCA to be active. There is already a link state netlink message which gets broadcast to userspace when ever some property of the link changes. I would add PLCA status to it. Applications then just need to listen for the message. Also, you need real use cases. Linux is not a collection of SDKs bolted together. Vendor crap SDKs tend to have an API for everything the hardware can do, and 90% of it is never used. That just adds maintenance burden. We push back on this in mainline. We only add stuff when there is somebody who needs it. So having the vendor provide the core driver is great, but it is better that a user of the device added the needed bells and whistles, for their real use case. Andrew