From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4C894C4332F for ; Thu, 13 Oct 2022 06:57:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jnrx7mBrZlX7WQ9lZGDj5EHt/wEQrnV2ZrH20m2uG6E=; b=z+SFkpNNCZqMei RmOYxycbP6k78KB8d8ZPMPLOSa96QTuUSar+LFWEcY9iYQ03oMbrwN7dlSwQ3OJlwgMXMctLzts1o wUH7ijIma4dRlu+kuv7rwVvxR2P8PeMA0FULS2NhI4NGXph7Fxod42uPXTu74/sKKaaC89ly//zaH QO9Xn/QUREIdebxhSGWZpXr9ibFb2MnchbLe5u3nHKNFC5nV4IH4GiCFCnNBFrJ87uT5siTmCaR4r Bz+wDetYNx+mqSz7ws3pq6fsOka8RlYBgZ5ze6KFV8+KvLj1luLdzNTp29aSrMofxVExQJ0+badWR q/xelgsveIPOe6QKtg0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ois89-00AvAz-87; Thu, 13 Oct 2022 06:55:45 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ois84-00Av8r-HT for linux-arm-kernel@lists.infradead.org; Thu, 13 Oct 2022 06:55:43 +0000 Received: by mail-ed1-x534.google.com with SMTP id a67so1266972edf.12 for ; Wed, 12 Oct 2022 23:55:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20210112.gappssmtp.com; s=20210112; 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=9bgNN7X2bMAPvjWH29NOgtDY27vanw717rBtzJJwDbg=; b=Ktc61kE9Kv6nh7yMDKWn1BqjT2xoztkpay/J/uSQP50IGWNBGXKmPQ9ciUP9Z2T26k 0icBep1Uz5i0A+DYVEK4d+kQWpnBgN/rAQFy41npkCbGeXh9FdL1Eq4hurFqr6dlWLaC 5lott/W5CHuL3CsfLnbVY8Tt9ELskSwun+f9raN68k4VE1BOe3gwrFyJ/XAjH+cUGx5D V8Cn9n1QatYvFKGct6knXI3P6mlY38GeNQxg/mhgTBGu4N839FzSm2WJ1mgdEjnY5W/2 s230v3eQq/cfmIeyI3J4G4dtdJbi1E7qcjJkEPUz98t127EDk3nZbUT3U3by/och4EEp q1Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=9bgNN7X2bMAPvjWH29NOgtDY27vanw717rBtzJJwDbg=; b=NpGPARqXL3Yj18CnbMFbggLCNti+/TXIGfpwqN2q7UrTNoRGL761lFZ6vjWd2xinWL 8Tji4ZTeDeeW4zEOlKlHD2iODS/3MNB08c8Iuq+IWAou0KYnQzAmBD/gwMAxuNRE15Jl ESLlCkavXnV7j5yd9OYXWOKbvchwYixmAawzV2z+uAH355qnvPxVfN4J0Fi8R3LvRomj Y9pdmkUuTpcH8+kTpvfRE0Il8emyouS/EAwKY5oBRNDSdZgRouD6bmCEoAXRrcr9LKAX +TsumV1bYn6rd4rK4utrHolOpp7ngp1Yd4wRe9uvK2MIXwa9T19jEGWRdML747m+zSui f7dA== X-Gm-Message-State: ACrzQf0cjvN9YFGRw0mPr9hL6hQQjwC36J48pvUuyAb74+ZnhX0nU1Ow QpAeJZ6brSC3wJ6E6VdeCe0VNg== X-Google-Smtp-Source: AMsMyM6JUAOH69tO0WMYoFMsBQaKPo/jHOKhwzMRRQ4YgwYSCeBg0GqdzQRG/qtNzqnA3SjB+QnABA== X-Received: by 2002:a50:fd8b:0:b0:459:31f9:d3b with SMTP id o11-20020a50fd8b000000b0045931f90d3bmr30883080edt.304.1665644136573; Wed, 12 Oct 2022 23:55:36 -0700 (PDT) Received: from localhost ([86.61.181.4]) by smtp.gmail.com with ESMTPSA id q2-20020a1709063d4200b0078b1ff41f05sm2460243ejf.43.2022.10.12.23.55.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Oct 2022 23:55:35 -0700 (PDT) Date: Thu, 13 Oct 2022 08:55:34 +0200 From: Jiri Pirko To: Vadim Fedorenko Cc: Jakub Kicinski , Arkadiusz Kubalewski , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Vadim Fedorenko Subject: Re: [RFC PATCH v3 1/6] dpll: Add DPLL framework base functions Message-ID: References: <20221010011804.23716-1-vfedorenko@novek.ru> <20221010011804.23716-2-vfedorenko@novek.ru> <24d1d750-7fd0-44e2-318c-62f6a4a23ea5@novek.ru> <9a3608cf-21bb-18b1-796a-7325a613b641@novek.ru> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a3608cf-21bb-18b1-796a-7325a613b641@novek.ru> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221012_235540_806414_C588397F X-CRM114-Status: GOOD ( 52.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Wed, Oct 12, 2022 at 10:12:43PM CEST, vfedorenko@novek.ru wrote: >On 12.10.2022 07:44, Jiri Pirko wrote: >> Tue, Oct 11, 2022 at 11:31:25PM CEST, vfedorenko@novek.ru wrote: >> > On 11.10.2022 09:47, Jiri Pirko wrote: >> > > Tue, Oct 11, 2022 at 10:32:22AM CEST, jiri@resnulli.us wrote: >> > > > Mon, Oct 10, 2022 at 09:54:26PM CEST, vfedorenko@novek.ru wrote: >> > > > > On 10.10.2022 10:18, Jiri Pirko wrote: >> > > > > > Mon, Oct 10, 2022 at 03:17:59AM CEST, vfedorenko@novek.ru wrote: >> > > > > > > From: Vadim Fedorenko >> > > >> > > [...] >> > > >> > > >> > > > > I see your point. We do have hardware which allows changing type of SMA >> > > > > connector, and even the direction, each SMA could be used as input/source or >> > > > > output of different signals. But there are limitation, like not all SMAs can >> > > > > produce IRIG-B signal or only some of them can be used to get GNSS 1PPS. The >> > > > >> > > > Okay, so that is not the *type* of source, but rather attribute of it. >> > > > Example: >> > > > >> > > > $ dpll X show >> > > > index 0 >> > > > type EXT >> > > > signal 1PPS >> > > > supported_signals >> > > > 1PPS 10MHz >> > > > >> > > > $ dpll X set source index 1 signal_type 10MHz >> > > > $ dpll X show >> > > > index 0 >> > > > type EXT >> > > > signal 10MHz >> > > > supported_signals >> > > > 1PPS 10MHz >> > > > >> > > > So one source with index 0 of type "EXT" (could be "SMA", does not >> > > > matter) supports 1 signal types. >> > > > >> > > > >> > > > Thinking about this more and to cover the case when one SMA could be >> > > > potencially used for input and output. It already occured to me that >> > > > source/output are quite similar, have similar/same attributes. What if >> > > > they are merged together to say a "pin" object only with extra >> > > > PERSONALITY attribute? >> > > > >> > > > Example: >> > > > >> > > > -> DPLL_CMD_PIN_GET - dump >> > > > ATTR_DEVICE_ID X >> > > > >> > > > <- DPLL_CMD_PIN_GET >> > > > >> > > > ATTR_DEVICE_ID X >> > > > ATTR_PIN_INDEX 0 >> > > > ATTR_PIN_TYPE EXT >> > > > ATTR_PIN_SIGNAL 1PPS (selected signal) >> > > > ATTR_PIN_SUPPORTED_SIGNALS (nest) >> > > > ATTR_PIN_SIGNAL 1PPS >> > > > ATTR_PIN_SIGNAL 10MHZ >> > > > ATTR_PIN_PERSONALITY OUTPUT (selected personality) >> > > > ATTR_PIN_SUPPORTED_PERSONALITIES (nest) >> > > > ATTR_PIN_PERSONALITY DISCONNECTED >> > > > ATTR_PIN_PERSONALITY INPUT >> > > > ATTR_PIN_PERSONALITY OUTPUT (note this supports both input and >> > > > output) >> > > > >> > > > ATTR_DEVICE_ID X >> > > > ATTR_PIN_INDEX 1 >> > > > ATTR_PIN_TYPE EXT >> > > > ATTR_PIN_SIGNAL 10MHz (selected signal) >> > > > ATTR_PIN_SUPPORTED_SIGNALS (nest) >> > > > ATTR_PIN_SIGNAL 1PPS >> > > > ATTR_PIN_SIGNAL 10MHZ >> > > > ATTR_PIN_PERSONALITY DISCONNECTED (selected personality - not >> > > > connected currently) >> > > > ATTR_PIN_SUPPORTED_PERSONALITIES (nest) >> > > > ATTR_PIN_PERSONALITY DISCONNECTED >> > > > ATTR_PIN_PERSONALITY INPUT (note this supports only input) >> > > > >> > > > ATTR_DEVICE_ID X >> > > > ATTR_PIN_INDEX 2 >> > > > ATTR_PIN_TYPE GNSS >> > > > ATTR_PIN_SIGNAL 1PPS (selected signal) >> > > > ATTR_PIN_SUPPORTED_SIGNALS (nest) >> > > > ATTR_PIN_SIGNAL 1PPS >> > > > ATTR_PIN_PERSONALITY INPUT (selected personality - note this is >> > > > now he selected source, being only >> > > > pin with INPUT personality) >> > > > ATTR_PIN_SUPPORTED_PERSONALITIES (nest) >> > > > ATTR_PIN_PERSONALITY DISCONNECTED >> > > > ATTR_PIN_PERSONALITY INPUT (note this supports only input) >> > > > >> > > > ATTR_DEVICE_ID X >> > > > ATTR_PIN_INDEX 3 >> > > > ATTR_PIN_TYPE SYNCE_ETH_PORT >> > > > ATTR_PIN_NETDEV_IFINDEX 20 >> > > > ATTR_PIN_PERSONALITY OUTPUT (selected personality) >> > > > ATTR_PIN_SUPPORTED_PERSONALITIES (nest) >> > > > ATTR_PIN_PERSONALITY DISCONNECTED >> > > > ATTR_PIN_PERSONALITY INPUT >> > > > ATTR_PIN_PERSONALITY OUTPUT (note this supports both input and >> > > > output) >> > > > >> > > > ATTR_DEVICE_ID X >> > > > ATTR_PIN_INDEX 4 >> > > > ATTR_PIN_TYPE SYNCE_ETH_PORT >> > > > ATTR_PIN_NETDEV_IFINDEX 30 >> > > > ATTR_PIN_PERSONALITY OUTPUT (selected personality) >> > > > ATTR_PIN_SUPPORTED_PERSONALITIES (nest) >> > > > ATTR_PIN_PERSONALITY DISCONNECTED >> > > > ATTR_PIN_PERSONALITY INPUT >> > > > ATTR_PIN_PERSONALITY OUTPUT (note this supports both input and >> > > > output) >> > > > >> > > > >> > > > This allows the user to actually see the full picture: >> > > > 1) all input/output pins in a single list, no duplicates >> > > > 2) each pin if of certain type (ATTR_PIN_TYPE) EXT/GNSS/SYNCE_ETH_PORT >> > > > 3) the pins that can change signal type contain the selected and list of >> > > > supported signal types (ATTR_PIN_SIGNAL, ATTR_PIN_SUPPORTED_SIGNALS) >> > > > 4) direction/connection of the pin to the DPLL is exposed over >> > > > ATTR_PIN_PERSONALITY. For each pin, the driver would expose it can >> > > > act as INPUT/OUTPUT and even more, it can indicate the pin can >> > > > disconnect from DPLL entirely (if possible). >> > > > 5) user can select the source by setting ATTR_PIN_PERSONALITY of certain >> > > > pin to INPUT. Only one pin could be set to INPUT and that is the >> > > > souce of DPLL. >> > > > In case no pin have personality set to INPUT, the DPLL is >> > > > free-running. >> > > >> > > Okay, thinking about it some more, I would leave the source select >> > > indepentent from the ATTR_PIN_PERSONALITY and selectable using device >> > > set cmd and separate attribute. It works better even more when consider >> > > autoselect mode. >> > > >> > > Well of course only pins with ATTR_PIN_PERSONALITY INPUT could be >> > > selected as source. >> > > >> > >> > Overall, I agree with this proposal, and as I've already said, the work is >> > going exactly the same way - to introduce pin object with separate set of >> > attributes. >> > I don't really like 'PERSONALITY' naming, I think we have to find a better >> > name. It looks like DIRECTION is slightly better. And the >> > CONNECTED/DISCONNECTED should be different attribute. And we also need >> >> Yeah, it is a matter of implementation. I just thought that this is >> possible to be done in a single attribute, because when the pin is >> disconnected, the direction has no meaning. >> >> >> > attribute PRIORITY to be able to configure (or hint) auto-select mode. There >> >> Sure, I didn't put the PRIORITY attribute to the example, but I believe >> it is very straightforward extension to add it. >> >> >> > are also special objects called muxes, which consist of several inputs and >> > one output, but they cannot synthonise signal, only pass one of the inputs to >> > output. We are still in kind of discussion whether to have them as separate >> > objects, or extend the amount of pins of DPLL device in this case. The >> > problem again in the auto-select mode and priorities. It would be great to >> > hear your thoughts about such objects. >> >> Does the mux have any attribute/configuration valuable for the user. >> If yes, it might make sense to have it as a separate object. Then we >> can have it as a tree of object of type MUX with leaves of PIN. > >Yes, that was the first thought, but implementation details are not great for now. > >> The question really is, if the user needs to know about muxes and work >> with them, or they can be abstracted out by the driver. > >Both ways will work I believe. It's more like our will to give users full >picture or hide it somehow with the implementation. >> >> Could you elaborate a bit more why auto-select mode and priorities are >> problematic with muxes in picture? > >AFAIU, some mux devices are not smart enough to make a decision suitable for >autoselect for the pins they have. In this case the autoselect process is >done in the DPLL device, which selects mux and not the pin directly. At the >same time there could be muxes that are smart enough to make a decision, and >it will be autoselect on top of autoselect (and several more layers) and it >doesn't sound great to me. I believe Arkadiusz will explain the mux a bit >better. >From what you write in this reply, I have a feeling that these details are not really interesting for user to see. So I tend to lean forward to abstract this out and leave the details to HW/FW/driver. > >> >> >> > >> > > > >> > > > This would introduce quite nice flexibility, exposes source/output >> > > > capabilities and provides good visilibity of current configuration. >> > > > >> > > > >> > > > > interface was created to cover such case. I believe we have to improve it to >> > > > > cover SyncE configuration better, but I personally don't have SyncE hardware >> > > > > ready to test and that's why I have to rely on suggestions from yours or >> > > > > Arkadiusz's experience. From what I can see now there is need for special >> > > > > attribute to link source to net device, and I'm happy to add it. In case of >> > > > > fixed configuration of sources, the device should provide only one type as >> > > > > supported and that's it. >> > > > > >> > > >> > > [...] >> > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel