Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2652682rwb; Mon, 15 Aug 2022 09:01:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR76XOW6GlG6DVafsWgl4TBKDrg6SIhq1F0w75ExewFjEmAt/FWuJOhgyvU7N9stT4KMVWYG X-Received: by 2002:a05:6402:4382:b0:43d:6fce:3f1b with SMTP id o2-20020a056402438200b0043d6fce3f1bmr15460454edc.361.1660579313237; Mon, 15 Aug 2022 09:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660579313; cv=none; d=google.com; s=arc-20160816; b=SXPAZreh6QrtE/25zEkYoOe9R5SKSHrZ0NnTv8Q6su6zMI9nqBI0LRcZCxj8vJzSMW BVKknvbLdZdOn118ku/DU87n6QBnmSTQ1OJqAMtuq9Y5Vueb5re3ePHUTQGTkbijIGEF JH+H2kcqXYT0QHzlAvPFZh8sCK8ZM8pJ3HhBIRV1cHwvXhcjnOuaSXVjTj9ZyMtaM1+N WJV2fjcBbpBSEvU5Spfgwkk9FLpeFHmFZqUjNIGVR0PqzdcKjUM8p2BEXTHrrKYHfn/I ToHntQXActymhilVHSn/hKpEQxyx+d1UGSE2iELDek/8i7uIj0kNtXQj3igK4602U9It lnfA== 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=4rxs6S+R7zohCdEBkSz05hMvFGzbem5RAiCTPfkqTx4=; b=inmIuvBhuAJU+mAfno061vVeiELBR4Ts2nTjHF0iQt7cZMV6Sy0SikxjpSaUZRfEgR q9rJo9SgOYXswOdolksjPMzlYh2XJ25WoRj1DD7Fm9PfzDLZAJz1kY1pqw0WDJZFBaKK ysUK0y2bC40Vw9sG3wiVROkaqjfz3ceXfC+z6T5OVM/P9NBsT18Jg4/OU7zFyjoANLz9 KaTPDoSwEjQxl18ElRBDDHlBsXbgH5LtsfhFRn8hq0VHEHErEHnyjMxqv0avAKjGZZB/ LdwMoo2SgJjNa+a34rJeCzPAqLQxSkTk9dWzjjVDr43PPWUz1lxsmkzR1ipHiXi9N59K FG/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=KkMqLgeA; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i13-20020a1709064fcd00b00734bbe8d2f7si8822084ejw.952.2022.08.15.09.01.24; Mon, 15 Aug 2022 09:01:53 -0700 (PDT) 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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=KkMqLgeA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232172AbiHOPzI (ORCPT + 99 others); Mon, 15 Aug 2022 11:55:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232201AbiHOPzF (ORCPT ); Mon, 15 Aug 2022 11:55:05 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F5191A05A; Mon, 15 Aug 2022 08:55:02 -0700 (PDT) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 26F5656D; Mon, 15 Aug 2022 17:54:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1660578899; bh=S8j7GbNbq17SRBvgGdMvUVVVDhDYQu28yqUMRIme4pw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KkMqLgeA3Hlou6eQxDNwuj/cAMOGRuZWf6psOJwAoE+lkqdgWTBYLUFWFiFmirC11 MV/sX2S9rJ9pHMvTFjbnnwFQbUhcqWxVXtYbPHGpZY4nQn8qmWU8YDavgsBevmlt5n 2eecXKodkdAhl5/HdCyGSGest6FWKhs5flNo+vq8= Date: Mon, 15 Aug 2022 18:54:45 +0300 From: Laurent Pinchart To: Mark Brown Cc: Matti Vaittinen , Matti Vaittinen , dri-devel@lists.freedesktop.org, Johan Hovold , Neil Armstrong , Lars-Peter Clausen , Kevin Hilman , linux-kernel@vger.kernel.org, Daniel Vetter , linux-amlogic@lists.infradead.org, Greg Kroah-Hartman , linux-doc@vger.kernel.org, Jonathan Cameron , Andy Shevchenko , Liam Girdwood , Michael Hennerich , Miaoqian Lin , linux-arm-kernel@lists.infradead.org, Alexandru Tachici , Jerome Brunet , Andrzej Hajda , Jonathan Corbet , Guenter Roeck , Jonas Karlman , Stephen Boyd , Lorenzo Bianconi , Michael Turquette , Jernej Skrabec , Martin Blumenstingl , Jean Delvare , Alexandru Ardelean , linux-hwmon@vger.kernel.org, linux-clk@vger.kernel.org, Nuno =?utf-8?B?U8Oh?= , Robert Foss , Aswath Govindraju , David Airlie , linux-iio@vger.kernel.org Subject: Re: (subset) [PATCH v2 0/7] Devm helpers for regulator get and enable Message-ID: References: <166057828406.697572.228317501909350108.b4-ty@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <166057828406.697572.228317501909350108.b4-ty@kernel.org> 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, 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 On Mon, Aug 15, 2022 at 04:44:44PM +0100, Mark Brown wrote: > On Fri, 12 Aug 2022 13:08:17 +0300, Matti Vaittinen wrote: > > Devm helpers for regulator get and enable > > > > First patch in the series is actually just a simple documentation fix > > which could be taken in as it is now. > > > > A few* drivers seem to use pattern demonstrated by pseudocode: > > > > [...] > > Applied to > > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next > > Thanks! > > [1/7] docs: devres: regulator: Add missing devm_* functions to devres.rst > commit: 9b6744f60b6b47bc0757a1955adb4d2c3ab22e13 > [2/7] regulator: Add devm helpers for get and enable > (no commit info) I didn't have time to reply to the series yet, but I think this isn't a great idea. There are two issues: - With devres, you don't have full control over the order in which resources will be released, which means that you can't control the power off sequence, in particular if it needs to be sequenced with GPIOs and clocks. That's not a concern for all drivers, but this API will creep in in places where it shouldn't be used, driver authours should really pay attention to power management and not live with the false impression that everything will be handled automatically for them. In the worst cases, an incorrect power off sequence could lead to hardware damage. - Powering regulators on at probe time and leaving them on is a very bad practice from a power management point of view, and should really be discouraged. Adding convenience helpers to make this easy is the wrong message, we should instead push driver authors to implement proper runtime PM. > All being well this means that it will be integrated into the linux-next > tree (usually sometime in the next 24 hours) and sent to Linus during > the next merge window (or sooner if it is a bug fix), however if > problems are discovered then the patch may be dropped or reverted. > > You may get further e-mails resulting from automated or manual testing > and review of the tree, please engage with people reporting problems and > send followup patches addressing any issues that are reported if needed. > > If any updates are required or you are submitting further changes they > should be sent as incremental updates against current git, existing > patches will not be replaced. > > Please add any relevant lists and maintainers to the CCs when replying > to this mail. -- Regards, Laurent Pinchart