From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1607923A5 for ; Tue, 13 Jun 2023 08:49:27 +0000 (UTC) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-3f6e13940daso54851655e9.0 for ; Tue, 13 Jun 2023 01:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686646166; x=1689238166; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=a0I2pNeOiPYcUgKjv6OV6+sPS7erJxX4fRSV8gqz1fw=; b=JVPJNR2G9K5SB+ZbY//2raud+kEc/EIAVOrsIkSCHCmc2c4Oc6QBLqmbAJj6j3hweh dXw485acl4adLieocy3FOyHxXRAgmSs7fYxE/6DLnxURl8KbWfJgNdJokpDwb9gmRuxE 8vi0l5DYkgzMbZHMjWiPGqZIJmixY2tpz+wUZMgxmoVIYjGHIIHg9N2A/8pft+GbW14+ tD3UKjvjxMKY11ZJl1oYQqi7rrIoQvusSCgRULOOcpSZjoFmQoP3c7ZshW17QdSs9XKA gJTHWOERR1npxo0rAFS+CBJ5UZbvkh0Ami8TVlfy6pYx70reg/k1ctOhT9JFkPDRYK5R TSHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686646166; x=1689238166; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=a0I2pNeOiPYcUgKjv6OV6+sPS7erJxX4fRSV8gqz1fw=; b=WAGNYwPBc6FDnKpm6ZrWKt8EXrrEXrUMZIdWbMhzz6VhB3viz1dHEuuplnIF5eydsB qqQaEvfFDaoTMcX+3G3A7PQmz27FZ28LrRhauQgMCZpQSCD/Vir1waXX/qq+bF0Evj9r 5kSdi8j3ouXuTxiCnu2qWUuuz3u7EFABOCxfV65GOSft2uDYR7HqNYO59+YO272OAhoT XvJM+NiV+Lqn2dmDDqoq/vEevOYEbuhgQUOB24lxCbwqVQoaNELg+ih9t3i7NOaSQYwl /CPPccTWP9I6A2cSzi7F0uVzXQW877Ji5J/BNrbgln8QHv75Y/kffUOuJtxsSahFmwVG CwWQ== X-Gm-Message-State: AC+VfDxJkturaLEeVL7X8fqI+RQOC7YcqWyvUNcSVfI2ZPvXbuBy9jvz E+6xStuS3dtG9Jj56ovA5gTpkg== X-Google-Smtp-Source: ACHHUZ42xf9bgppziC+evXWZEQ23sTzyp1CSrHHwD55tNkhkvnVJMtZkpVFyXvbIV1n6bLMqRSDXhg== X-Received: by 2002:a7b:c7d8:0:b0:3f6:1474:905 with SMTP id z24-20020a7bc7d8000000b003f614740905mr9375762wmk.29.1686646165959; Tue, 13 Jun 2023 01:49:25 -0700 (PDT) Received: from ?IPV6:2a05:6e02:1041:c10:b5a8:28ff:af00:a97f? ([2a05:6e02:1041:c10:b5a8:28ff:af00:a97f]) by smtp.googlemail.com with ESMTPSA id z15-20020a7bc7cf000000b003f6129d2e30sm13796467wmk.1.2023.06.13.01.49.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Jun 2023 01:49:25 -0700 (PDT) Message-ID: Date: Tue, 13 Jun 2023 10:49:24 +0200 Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v2] thermal/drivers/sun8i: Fix some error handling paths in sun8i_ths_probe() Content-Language: en-US To: =?UTF-8?Q?Ond=c5=99ej_Jirman?= , Maxime Ripard , Christophe JAILLET , Vasily Khoruzhick , Yangtao Li , "Rafael J. Wysocki" , Amit Kucheria , Zhang Rui , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Philipp Zabel , 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 References: From: Daniel Lezcano In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 15/05/2023 14:33, Ondřej Jirman wrote: > Hi Maxime, > > On Mon, May 15, 2023 at 01:54:41PM +0200, Maxime Ripard wrote: >> 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. >>> >>> 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. >>> >>> 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: >>> >>> 3.3.6.4. Gating and reset >>> >>> Make sure that the reset signal has been released before the release of >>> module clock gating; >>> >>> 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 > > The order was correct before this patch. I don't think an incorrect order > should be intorduced, even if temporarily between two patches. Maxime ? -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog