Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1924260rwd; Mon, 15 May 2023 05:09:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6iQSFqmxYX3o1xMfoMSeWYCV9L+NFog+ki9HesyQBK/AOwIOuB/JyBJBJ73WXuAx9d90dC X-Received: by 2002:a17:90a:6048:b0:252:db76:71da with SMTP id h8-20020a17090a604800b00252db7671damr7654614pjm.9.1684152571210; Mon, 15 May 2023 05:09:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684152571; cv=none; d=google.com; s=arc-20160816; b=nQYLAwL3Y4F2Wurtxx5osxagZpWBEt23Ebe6J6MNXkr3UiMGdLhaDewsapMx9CgYmu S5JdMjTXdmB6p7eu7mKmcdxVnIaFqvhXgxGx0STPm4nkTuwNjV7MGBSMZM9lMhrCQD84 nRdWg30TrwEkHAG1Cj181SZOn2nv/G7AQNzF251W6gjInf1GCun2Efk9IhgJyuwY6vW/ Xyamfi9BvwnBp06a0ZxiOI5UOorCuIVsKw0F4LrldMA3DUi1pkiJ+LLOenf5/u2nOtyl 77H105z2JrFfXTmYmip+zYJWRYhkG+JeWd+RXgz2oHbfQMQFErG9G9UPi4Mi7UzPF0F7 g9Cg== 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:feedback-id :dkim-signature:dkim-signature; bh=YN2hehfhebmIswf1/JIgo//Dtk1KbSx4NssivhFQ048=; b=G9V3i7lkZtfkCrY5I/4lusPgMW1m4iI1nAxo4kMTZCRcdZgq8rGDlxe1ctR8UwZ9uu 80v3O+CT3ex8gZh/Bmq1mnwcg9jXaWAb/pnGE8gDtfKd5h2OcAVKFMCx0BfF1tZyYd2V 3RPgILp/GKsrCLSb57dAXJDZf+YZPToQdZBJyOLno8iTH0ZFtSw5Pq8vSxfYpcIrCE1d R5jSYxAACYwIQ17C+5MX2KyeVtpDtsT8jL+N9cXFxi9MWlFcsY98oJQO1Cr0Cy2jJ5/s RZb2zJOxo+JM8f8dEM9YfYkSIOEJ/YLSG+4OQbSZnE5OVV9a3xfKvSCBpKgvhhPyT4q7 0NoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=dkUb9tOV; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=DTiL8tED; 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=cerno.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a17090b070300b0023b481b8dcesi13741408pjz.102.2023.05.15.05.09.14; Mon, 15 May 2023 05:09:31 -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 header.i=@cerno.tech header.s=fm3 header.b=dkUb9tOV; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=DTiL8tED; 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=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241268AbjEOL5w (ORCPT + 99 others); Mon, 15 May 2023 07:57:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238242AbjEOL53 (ORCPT ); Mon, 15 May 2023 07:57:29 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 762B526B6; Mon, 15 May 2023 04:54:44 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D091B5C010F; Mon, 15 May 2023 07:54:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 15 May 2023 07:54:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1684151683; x=1684238083; bh=YN 2hehfhebmIswf1/JIgo//Dtk1KbSx4NssivhFQ048=; b=dkUb9tOVLQsK1ucevf PxqBQ9/HL1CaFY8DERKLlLvBKWesFX3to23gFbHHn/PU2hCbKbUsGWGnovWK+sdO mZTMnndEiGxt+KDOqwPtF4gu51pGo8iFmjsHragoMjW9Sw52DKTj6yXPVeR+uQY6 BuXIFC777I/xSBANw72S9AUmatINBBrPtw4BPhsksGBnezW7BDkxUuQ3iJzZuMs1 ew/ltpk44IYQDTEQxuAQppC1K+ejD+PfaPsWAswv49cx0mLvST7LeDyMc/lGSJKL oi5j/NYbZgX2/4tWeEQtdVEkIhaanQIZkmRJFIbyRAUA34HZWhH0+2anhZfEvVRT nPZw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1684151683; x=1684238083; bh=YN2hehfhebmIs wf1/JIgo//Dtk1KbSx4NssivhFQ048=; b=DTiL8tEDchy/0FstCPucVIhziirSW yO+pzo+dbqz7u35lHvfvktCJDhPnKbn/YOgJ5/tG+zHUye7C3t3Pt2TxcpQpn+VL HNo+mcpzemSMyVU6f8bf6Iyq3JrVirlKDnlHDtilOoaIIAci3GZS4D2VhEgl94eX Htn4XjGmXRa9sUxPS3r5Gzg/XH83AV9/BHI/SYkV6T0KxAmHuGWjOl/RC4ljEEGK V8fXpxAH0rxHl69b99hly5vW1qjH/VpHqMdYZ3jSF7AfJCPDI9YnTcDpQDMjPIrg Y0I9Wc8WdeFo+9ALMuxMlrzC+6hhHOGNtkGNOqe/7HfAAEIaspoGZdRtQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeehjedggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtsfertddtvdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeeuveduheeutdekvefgudevjeeufedvvdevhfejgfelgfdtkeevueegteek gfelfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 15 May 2023 07:54:42 -0400 (EDT) Date: Mon, 15 May 2023 13:54:41 +0200 From: Maxime Ripard To: Christophe JAILLET Cc: Vasily Khoruzhick , Yangtao Li , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Philipp Zabel , Ondrej Jirman , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH v2] thermal/drivers/sun8i: Fix some error handling paths in sun8i_ths_probe() Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="va3mhj5nkg6jbttn" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 --va3mhj5nkg6jbttn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Sun, May 14, 2023 at 08:46:05PM +0200, Christophe JAILLET wrote: > Should an error occur after calling sun8i_ths_resource_init() in the probe > function, some resources need to be released, as already done in the > .remove() function. >=20 > Switch to the devm_clk_get_enabled() helper and add a new devm_action to > turn sun8i_ths_resource_init() into a fully managed function. >=20 > Move the place where reset_control_deassert() is called so that the > recommended order of reset release/clock enable steps is kept. > A64 manual states that: >=20 > 3.3.6.4. Gating and reset >=20 > Make sure that the reset signal has been released before the release of > module clock gating; >=20 > This fixes the issue and removes some LoC at the same time. It should really be three different patches: - One to fix the resource release, that can be backported to stable releases - One to switch to devm_clk_get_enabled - and one to change the order of clock enable vs reset deassertion Maxime --va3mhj5nkg6jbttn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZGIdgQAKCRDj7w1vZxhR xdmkAP9r4P7s+lWbUxXVJ+/Zx6Wfdpi7/HSi+H/K9rivRGupwAD/VW72Kfz4XlEp oAzjFCvvawU+fc7nkk/gA4tjCfH5MQ0= =KQEQ -----END PGP SIGNATURE----- --va3mhj5nkg6jbttn--