Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp434426pxb; Tue, 19 Oct 2021 06:02:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGdgkEPxecJewpxBlxBTH8KFhi8HyaSCrKhrfwbGl9RCNt88rz7IkboT75mZP6Hz4YqaFe X-Received: by 2002:a17:903:2303:b0:13f:e63:e27d with SMTP id d3-20020a170903230300b0013f0e63e27dmr32906353plh.84.1634648554301; Tue, 19 Oct 2021 06:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634648554; cv=none; d=google.com; s=arc-20160816; b=YjUNFjJhNuLf9itDK4EIO1UOb2yd0zlw5PqdQsCqA6P0W2dhl/Z6xAEtimf83lbM++ mPTQUDi1ECq+NRdFYUApi6kGcVqoEdM8pBbZ/O92Z7U4z77VRBwqilUG5AraokrqKXHT ycYEhBuqD6ZPVUOaR7mtqZilF6iaSnx/blqXiYdrR5IIfrm9ZPN+m5q2I50TZQm9AKqx m8G01RdRWqv2doAzeujf0qTNPj+q+uModI5NiPoYzfRwKNihlxaRSFWwwwfXw4LCUSkg 0QWu+RPduURAyIpguZ7EeQD/vccdL+pBZ5niMTgrQ4nePNIenrC9a8YyxcdgloNQGsGC RawQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KNDq+saSfN965F1ALORVXJI19du7HdhzgInWwD3iTbk=; b=u+mJFWj8SsxBt9hLFNKHbAW0k6UA8zB5K+4qBJwvjcYAx64OVGFEh4C2jeiQ20XEdj 9dApt8tE5dBXoZFtH5Rl0K3324jjFBu+zmkPQ97cwSdxbPipg2E9awlAl3r2TbXq+oKn 6Dl9xy2+ZK4SIJ0/mxmz4OQ6iG+oDOuCclLBhG62ho0fteAxZ6+uLuVLqnPkj3xkKg2b Bmj1I8fV2MnQV66h2Rk+5J78prdyb0sWVc1dXUpDYS/ZdmINoeoRuWjkiUZPyQ7pUBfI G4dx6WfEZrzJXtYy/hQ9IY3+IvepvpfaBCnw5U5QSF6cCn65qXyoMYx55ubX3wAFlnER zRpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b9si23658047plk.45.2021.10.19.06.02.18; Tue, 19 Oct 2021 06:02:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235786AbhJSNBt (ORCPT + 99 others); Tue, 19 Oct 2021 09:01:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235689AbhJSNBs (ORCPT ); Tue, 19 Oct 2021 09:01:48 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D74FEC06161C for ; Tue, 19 Oct 2021 05:59:35 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mcoiI-0006Gy-V5; Tue, 19 Oct 2021 14:59:30 +0200 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1mcoiH-0008NO-5k; Tue, 19 Oct 2021 14:59:29 +0200 Date: Tue, 19 Oct 2021 14:59:29 +0200 From: Oleksij Rempel To: Daniel Lezcano Cc: Shawn Guo , Sascha Hauer , linux-pm@vger.kernel.org, Petr Benes , Amit Kucheria , linux-kernel@vger.kernel.org, Andrzej Pietrasiewicz , NXP Linux Team , Pengutronix Kernel Team , David Jander , Zhang Rui , Fabio Estevam , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v1 1/1] thermal: imx: implement runtime PM support Message-ID: <20211019125929.GD16320@pengutronix.de> References: <20210924115032.29684-1-o.rempel@pengutronix.de> <19b2ab33-aa56-75fb-f6ef-3c928be9c50c@linaro.org> <20211019115151.GC16320@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 14:55:40 up 243 days, 16:19, 139 users, load average: 0.15, 0.13, 0.16 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 19, 2021 at 01:55:32PM +0200, Daniel Lezcano wrote: > On 19/10/2021 13:51, Oleksij Rempel wrote: > > Hi Daniel, > > > > On Tue, Oct 19, 2021 at 01:04:46PM +0200, Daniel Lezcano wrote: > >> On 24/09/2021 13:50, Oleksij Rempel wrote: > >>> Starting with commit d92ed2c9d3ff ("thermal: imx: Use driver's local > >>> data to decide whether to run a measurement") this driver stared using > >>> irq_enabled flag to make decision to power on/off the thermal core. This > >>> triggered a regression, where after reaching critical temperature, alarm > >>> IRQ handler set irq_enabled to false, disabled thermal core and was not > >>> able read temperature and disable cooling sequence. > >>> > >>> In case the cooling device is "CPU/GPU freq", the system will run with > >>> reduce performance until next reboot. > >>> > >>> To solve this issue, we need to move all parts implementing hand made > >>> runtime power management and let it handle actual runtime PM framework. > >>> > >>> Fixes: d92ed2c9d3ff ("thermal: imx: Use driver's local data to decide whether to run a measurement") > >>> Signed-off-by: Oleksij Rempel > >> > >> Thanks for this fix. > >> > >> Petr or Oleksij, > >> > >> could you confirm it is tested and working without CONFIG_PM ? > > > > Petr was right, no it is not working without PM. > Ok, thanks. > > I suppose the fix is related to the initialization of the sensor which > should be enabled with/out pm_runtime, right ? No, i did sanity check on pm_runtime_put() within the probe. Without PM it will properly return ENOSYS, so I aborted the probe. Looks like I should ignore return value on this function like every driver is doing it. > > > -- > Linaro.org │ Open source software for ARM SoCs > > Follow Linaro: Facebook | > Twitter | > Blog > -- 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 |