Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp514870lqh; Thu, 28 Mar 2024 08:22:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWXVtoJO8C4vYGISOBeP0PjPsth08w9eoMCY25ZinV2MBZTYupJuiEmefM/DjlXP2b+2R3pcbRc8rl/FvpstLbVYwBFJgWYWpWZqdz1Eg== X-Google-Smtp-Source: AGHT+IF7wVpDCBjfnPdvFO0shauCijMKJhxKv9wcrxGxuFw86gFVlWj1iAS8AiDqjfQjKLgYUNwG X-Received: by 2002:a05:6122:997:b0:4c0:254f:75d5 with SMTP id g23-20020a056122099700b004c0254f75d5mr3935969vkd.10.1711639356709; Thu, 28 Mar 2024 08:22:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711639356; cv=pass; d=google.com; s=arc-20160816; b=ReRh1daK+t7X5hEV+aI6dJtZKqahTQlF2J2py3VNkUN0DBXGxe9YeAZtv8j5VIZxtq yz66Ml70oytp8slP1gc+aZwQ1J8BtSJ5Lzxpa2P8WkWfgfYU7nViEIgDSds7zBlIEEWe 4CyqoAm+RS2b7YozjTUOqMKH59/npmmDiHSiGBVTwwYtg31UrNzm47iSWgI2fRk1KbKM 7iLvUTedBqsCjshTpbyvSsheEauB1ygOOIWNg1QQpJCVa6LKdtbyo+yXHTzCTB8PRiE4 HDiHpA3fECYXsRjnNBKirqt8libdbjIMQWlIf95G5sxQ1q+v/SwWdL+ASEfos+OJxYOM NkPQ== 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:dkim-signature; bh=0KikSW9ib+1cYtRn9w2uRLKS6BuW9Jey9jBSZin/1jU=; fh=EIDyYCD643PSDPWJn1DAwzXG9uVAN9zutgG0ofe7kGI=; b=waxPyEXrvgk0R/+i0CNOpvrFbxRDunrtyBng0COV3uLR+qg5l8sGI6OUt2tU5SqWCK FrDMqxew7m1H7gdAxF08gBWh6C+bvuK2kDSwcyjJJdAauESMigoTJG4q9QrBYrdPeN+8 1I+GB8ghpXi6TQ190LpyvSmLIJdWOPmNCRpXR+0lPSL5Mghq3iIWVtY/0hLwHaiTBi4h ASs1hoGkxcI5pID85vh1qrjxQsXj7LY2GbNFxWizGS/zM40cGxNEk+4F+6UQY7rEo8Xu heKJgX55sIbr6mtay67aIEVPS9X+qBRESHL+88A3jRAsIdnkTurPfwlHs8+6GL5TW8YM BF1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=cUmTmHgU; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-123146-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123146-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f25-20020ac5c5b9000000b004d472fdec00si258786vkl.134.2024.03.28.08.22.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 08:22:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123146-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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=cUmTmHgU; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-123146-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123146-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch 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 6C0341C26D21 for ; Thu, 28 Mar 2024 15:22:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D03CA12F599; Thu, 28 Mar 2024 15:22:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="cUmTmHgU" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 22A588004F; Thu, 28 Mar 2024 15:22:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711639345; cv=none; b=M6r263yO2sKvG7Mka8YukvFi49KhIBvILbFKTnfksml+tlZnUcxLQ3Wv3sikyt6YB3XoqLhRgLupuechnpLqqVFSg/6j8sEMTj3F43+Vl5fhW+ZB4Xsvf2vgxV/gFj8Prut+uKc5LriDO93CyBPxRZ5UP97T/ynxw5cxxbxxBmU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711639345; c=relaxed/simple; bh=bLg2e6mwBKjSve4OEmRJ0swgtQbc1H7j1+RXrYDfSrE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AA/tcOkWe3HJ+3CyhvJ56qb0ADK5HtL1DXry/Mmr0STIv/ZTrhVNrX66vlEA21c71nLbN+jZoL031+vwMrjxmL/8i6n/ea70vjqeX2LQQ1zjBL7p8MMq2ddi9lBqzAvgbs4p4fzOUdSs3Em2IyBC2U13WavNwCYBYQJT3B1GQLU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=cUmTmHgU; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch 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=0KikSW9ib+1cYtRn9w2uRLKS6BuW9Jey9jBSZin/1jU=; b=cUmTmHgUj+sE8DS9wRyBTtTkJ/ lJDbO1E6Wtrjuk7CAXb74Ve72lGwIat6hzsxeftbnWWjAXDnv9H042dx0nk7TKn/372JTknDKKxTh 9sI5+OituYqypJRXFELZUWuonXIf1ypJyZf4H522b+Z/nx9noHpJRzGWHfTO1kUmNIIc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rprZt-00BVng-WF; Thu, 28 Mar 2024 16:22:06 +0100 Date: Thu, 28 Mar 2024 16:22:05 +0100 From: Andrew Lunn To: Kory Maincent Cc: "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 , Oleksij Rempel , 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 v6 13/17] net: pse-pd: Use regulator framework within PSE framework Message-ID: <0d91784a-48db-4e25-88e5-9994dfd3d68f@lunn.ch> References: <20240326-feature_poe-v6-0-c1011b6ea1cb@bootlin.com> <20240326-feature_poe-v6-13-c1011b6ea1cb@bootlin.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240326-feature_poe-v6-13-c1011b6ea1cb@bootlin.com> On Tue, Mar 26, 2024 at 03:04:50PM +0100, Kory Maincent wrote: > From: Kory Maincent (Dent Project) > > Integrate the regulator framework to the PSE framework for enhanced > access to features such as voltage, power measurement, and limits, which > are akin to regulators. Additionally, PSE features like port priorities > could potentially enhance the regulator framework. Note that this > integration introduces some implementation complexity, including wrapper > callbacks, but the potential benefits make it worthwhile. > > Regulator are using enable counter with specific behavior. > Two calls to regulator_disable will trigger kernel warnings. > If the counter exceeds one, regulator_disable call won't disable the > PSE PI. These behavior isn't suitable for PSE control. > Added a boolean 'enabled' state to prevent multiple calls to > regulator_enable/disable. These calls will only be called from PSE > framework as it won't have any regulator children, therefore no mutex are > needed to safeguards this boolean. > > regulator_get needs the consumer device pointer. Use PSE as regulator > provider and consumer device until we have RJ45 ports represented in > the Kernel. > > Signed-off-by: Kory Maincent Reviewed-by: Andrew Lunn Andrew