Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1869233lqg; Mon, 4 Mar 2024 06:24:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUXw2QF/rZVroWnjZLjwXsBYCVlHeHHG0A0f0KIYLCL/Wk8EAzjboy04WqRQKsFIItZlGbCChTDSq0zuGTPEE9T9GMUGvN7tdJ1EkE8/g== X-Google-Smtp-Source: AGHT+IF5O4XyC3u4KtWxeptb1yDOCZ+Te4FdznlMyHScSRfisV9JMejS1l9IPIX/uji9NcAIq9xH X-Received: by 2002:a05:622a:592:b0:42e:e125:33ef with SMTP id c18-20020a05622a059200b0042ee12533efmr7430420qtb.33.1709562247603; Mon, 04 Mar 2024 06:24:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709562247; cv=pass; d=google.com; s=arc-20160816; b=0BvUY2PIGdo5GI+2nhxnCuHKEpf09Xer6rRFsHpZn3tEkJk6DtWMy9k9U7STpM6yFC rXYEB254YKsfdvwJuwYR6LUpZRrTClGvhGpG+79tCsl5K0Ob33pe4iqCgAoOOultHpb/ CsNeMRJJ8OOOtFl4LuELmL1c330TLykVaBlZrGyDbbYKkY+JsjHEb2jxHtl2KGTDnEDs GRaKro2Whe2SmMZk5tkqKV43rTPCQh9PcjNaB8H1HHQxtIpz2mR7Jq9nTFXAcZXEp/fQ NnNezW5zI41gMkoNvQg6q3auBKrgbt2YCPTQskMreo1FknWFN6/hrTi6nJ3mdWR4zP1M xz+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=qm+RYXD0vN8vu0XErV/R9I6fxETiEMMPL4eeJRBe57I=; fh=wSYW6BK74oue2ztpgocFgY/fECz3tAuiOLMkiXK2o/s=; b=KTTHOWD6WRv3S2/CL4KAF/F6xRyxj8Euyu2gv2W5IH8KNT6mos1ncy4beyaV7QpkVU SXkytkwSytv0SUddEDARHCvW9fk6noFnKGolmqScz2snHVQpuyolKIWrnCm6cqiEdq4X CPdEzi4Kb6PRnHfeLDIqqKGbv59DRU+ZWwyVtFCbpUcif7yDcxIA7nCFYMXIYGGFOgD1 ivqtijVBv9F546BGjdq9I5+Pel6jMEqDOxAMxGdXE6ctfpWAyluQ/BzX6Ldcd3lriWSe D2EGqWNeQ42jgFwb+i6bH43xnS8fodHCLQ1ShlQFi6W4g7Lg8Lf/B31e5cYie+p9Q+Ot QGAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-90722-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90722-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v10-20020ac8578a000000b0042ef6c2e6b0si1113616qta.38.2024.03.04.06.24.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 06:24:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90722-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-90722-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90722-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 54BB31C22227 for ; Mon, 4 Mar 2024 14:24:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8CA841C70; Mon, 4 Mar 2024 14:23:51 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98F4C3FB32 for ; Mon, 4 Mar 2024 14:23:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709562231; cv=none; b=qNTsMcQn/OL+irCJaD7Jsz4/nST0SfhcLq7ci0UcUMD1mth+TaVb991Up0Uctv4O+z6FM5q2It3Sr5KYoIh+0WsMdcIpX+B+Q/vxUY3oGlvH7DfkfVfqkFWQ/E3oLeZYmFsNxNgf3iAf/P91ttyuM5VkW6IvwhJYPWSUGiNzGpw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709562231; c=relaxed/simple; bh=ObcxFbtc6CHI8exv2xXtNHEcKxe9mw8/hFp5f4FVeIQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZtbDlJJyOZQE9t5tHPe0kRfDnHk0t/SRCUUy5XGlGy1V8fTpJUhxJxh6ONwg/P/Pcm8pk1eZHde1LoCyMOsNmwiUFaBTRZSLt0bt09DEAbXxq23DBfkz5bt6Nd+8eOqKKDUsivHuBrtEpQoPHT43gMPlA17/cu0CbOn1csxr/ag= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rh9Du-00016V-Bk; Mon, 04 Mar 2024 15:23:22 +0100 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rh9Dt-004N6X-1P; Mon, 04 Mar 2024 15:23:21 +0100 Received: from ore by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rh9Ds-001ulU-30; Mon, 04 Mar 2024 15:23:20 +0100 Date: Mon, 4 Mar 2024 15:23:20 +0100 From: Oleksij Rempel To: Andrew Lunn Cc: =?utf-8?B?S8O2cnk=?= Maincent , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Luis Chamberlain , Russ Weight , Greg Kroah-Hartman , "Rafael J. Wysocki" , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mark Brown , Frank Rowand , Heiner Kallweit , Russell King , Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, Dent Project Subject: Re: [PATCH net-next v5 13/17] net: pse-pd: Use regulator framework within PSE framework Message-ID: References: <20240227-feature_poe-v5-0-28f0aa48246d@bootlin.com> <20240227-feature_poe-v5-13-28f0aa48246d@bootlin.com> <20240304102708.5bb5d95c@kmaincent-XPS-13-7390> <84b300c7-8295-424b-9117-c604fb4cd73e@lunn.ch> <290c516e-6cf7-4db2-9b32-c9dc7200fe73@lunn.ch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <290c516e-6cf7-4db2-9b32-c9dc7200fe73@lunn.ch> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Mon, Mar 04, 2024 at 02:53:54PM +0100, Andrew Lunn wrote: > On Mon, Mar 04, 2024 at 02:39:08PM +0100, Oleksij Rempel wrote: > > On Mon, Mar 04, 2024 at 02:32:50PM +0100, Andrew Lunn wrote: > > > > > > + psec = dev_find_pse_control(&phy->mdio.dev); > > > > > > + if (IS_ERR(psec)) { > > > > > > + rc = PTR_ERR(psec); > > > > > > + goto unregister_phy; > > > > > > + } > > > > > > + > > > > > > > > > > I do not think it is a good idea to make PSE controller depend on > > > > > phy->mdio.dev. The only reason why we have fwnode_find_pse_control() > > > > > here was the missing port abstraction. > > > > > > > > I totally agree that having port abstraction would be more convenient. > > > > Maxime Chevallier is currently working on this and will post it after his > > > > multi-phy series get merged. > > > > Meanwhile, we still need a device pointer for getting the regulator. The > > > > phy->mdio.dev is the only one I can think of as a regulator consumer. > > > > Another idea? > > > > > > Sorry, i've not been keeping up... > > > > > > Doesn't the device tree binding determine this? Where is the consumer > > > in the tree? > > > > The real consumer is outside of the system. > > The device on the other end of the cable? yes. > > Withing the system, it would be the RJ45 port, but we have no > > abstraction for ports so far. > > A Linux regulator is generally used in a producer/consumer pair. If > there is no consumer device, why have a producer? What is going to use > the consumer API? We already consulted Mark Brown in precious iterations of this patch series and got his OK. I also described all advantages of using regulator framework within the PSE subsystem. I need to search it. Short answer, it is relatively common to have open-ended regulator with consumer outside of the system. A PSE system can be relatively complex, representing all supply dependencies from power supplies (one or multiple) to the ports will help to provide needed diagnostic information and power saving if port are disabled. Some functionality is currently not supported by the regulator framework, but need to be extended - power budged, priorities and reservation. All of this are not exclusive PSE challenges. So, using regulator framework seems to be a straightforward decision. > When we have a port representor, do we expect it to have active > elements? Something which will consume this regulator? Not in a usual sense. There are two levels of PSE control: - autodetected by PSE controller - fine tuned by using LLDP wich may respond to PD requests by allocating more or reducing/disabling power. Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |