Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp312113pxh; Wed, 10 Nov 2021 02:08:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCD0T3PEyfoioxsc2SQmqZQSjSQy6h1PWMHzoPhpjOhhYYKR9Fuj7WLlJ9cYvFgJByjhwC X-Received: by 2002:a6b:e60e:: with SMTP id g14mr9081869ioh.28.1636538931489; Wed, 10 Nov 2021 02:08:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636538931; cv=none; d=google.com; s=arc-20160816; b=gT96sWPUEHCACCL/v82PM1frH6DL8zUeCyKNibB8YD9UHPzsjewlrJhSx0tb6M0VMJ 9K7TaZ4vDY6YzhE1URnqNoTp7OXiDf5clb07JNnm2Mss9f3pVIqnsjqJQCig+MQ4sBGp v9/TydKOrahN0O9B1NUVQRFkpeG/uAYwyoiVDzxgX8FpZ/7ETR2876pN6vbpK7FcmYyq wptsgSdPDZxmgGrngTXlWVcYzP5KYbT9QJiSmIMaYeAHy0qT8BbO9VLL2u/eq8CwKJlP xsMQfV1ya3kFaHyzxTZr7Bkc0Z2hf9stbIwpqqfE+vDF+vCdj8sABdewWjOHsRFbNT32 Upwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=dd4tweGuclD5iB1Lg5dfzSruG+i/XLfegDyheWwHhSE=; b=B4trjo36+kAki5xLYj37fMQaoJqCHS8VDAIhmtYfgNvn4JgZ8t6QNJt8+JldOa9U/u uX0UWxl/+SCCLRLpLxLa9Q4l2D/tpUXR35yW6KjJiYEnDQO6oS28j60TkjMXWi07loiA X+JRMnI/xkkPAqzwODqYUOoVtq7OL0vP1IA4an8eurYF4q1vCwfxiy9WO2BxofXIyCMe vaaasd+kQUfuPp6e1fon55WcSF8TwpeCdoX26rTCyDwAunIYb/qGohGT65KpdzIyaVoP AUOD0mo//Kv/SWhEhELElVcEzzYVRXGPmFQv2imufLIEysFJIR9V+/GhRp2zSYxGG6cF QVNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ysoft.com header.s=20160406-ysoft-com header.b=LFZeOvbi; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ysoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t34si8623566jal.104.2021.11.10.02.08.38; Wed, 10 Nov 2021 02:08:51 -0800 (PST) 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; dkim=pass (test mode) header.i=@ysoft.com header.s=20160406-ysoft-com header.b=LFZeOvbi; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ysoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231144AbhKJKKW (ORCPT + 99 others); Wed, 10 Nov 2021 05:10:22 -0500 Received: from uho.ysoft.cz ([81.19.3.130]:18961 "EHLO uho.ysoft.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229831AbhKJKKV (ORCPT ); Wed, 10 Nov 2021 05:10:21 -0500 Received: from [10.0.29.210] (unknown [10.0.29.210]) by uho.ysoft.cz (Postfix) with ESMTP id 0A381A0753; Wed, 10 Nov 2021 11:07:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ysoft.com; s=20160406-ysoft-com; t=1636538852; bh=dd4tweGuclD5iB1Lg5dfzSruG+i/XLfegDyheWwHhSE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=LFZeOvbiVMfXPvItc40LgittKMeQljGiubYm5zvEVqxxCfcDoemPzcsrEMUipFshv mSAl2Pfw0mnGkege/Q+S1mmN7dZ8HJUVT7OpNKgYcAhpnuS6Cehe/tgKAM2mH4+28o Oa2Q88yz+My1z8ntDZxAmZ7T5bekDfbIRSdIKmNc= Subject: Re: [PATCH v2] thermal: imx: implement runtime PM support To: Oleksij Rempel Cc: Daniel Lezcano , linux-pm@vger.kernel.org, Shawn Guo , Sascha Hauer , 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, Petr Benes References: <20211019130809.21281-1-o.rempel@pengutronix.de> <20211020050459.GE16320@pengutronix.de> <20211021172048.GE2298@pengutronix.de> From: =?UTF-8?B?TWljaGFsIFZva8OhxI0=?= Message-ID: <8692108c-1b46-3d3d-6911-300ac27c2980@ysoft.com> Date: Wed, 10 Nov 2021 11:07:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25. 10. 21 13:06, Petr Benes wrote: > Hi Oleksij, > > On Thu, 21 Oct 2021 at 19:21, Oleksij Rempel wrote: >> >> Hi Petr, >> >> On Wed, Oct 20, 2021 at 05:53:03PM +0200, Petr Benes wrote: >>> On Wed, 20 Oct 2021 at 07:05, Oleksij Rempel wrote: >>>> >>>> Hi Petr and Michal, >>>> >>>> I forgot to add you for v2 in CC. Please test/review this version. >>> >>> Hi Oleksij, >>> >>> It works good. with PM as well as without PM. The only minor issue I found is, >>> that the first temperature reading (when the driver probes) fails. That is >>> (val & soc_data->temp_valid_mask) == 0) holds true. How does >>> pm_runtime_resume_and_get() behave in imx_thermal_probe()? >>> Does it go through imx_thermal_runtime_resume() with usleep_range()? >> >> How exactly did you reproduce it? Even more or less understanding how > > I just placed my debug print into get_temp() > > if ((val & soc_data->temp_valid_mask) == 0) { > dev_dbg(&tz->device, "temp measurement never finished\n"); > printk("Wrong temperature reading!!!!!!\n"); > return -EAGAIN; > } > >> this can potentially happen, i never had this issue on my HW. Is it something >> HW specific? > > IMHO it is just product of the following sequence: > > pm_runtime_set_active(&pdev->dev); > pm_runtime_enable(data->dev); > pm_runtime_resume_and_get(data->dev); > thermal_zone_device_enable(data->tz); > > With assumption imx_thermal_runtime_resume() didn't run, > hence the sensor didn't get enough time to come up. > > I didn't have time to spend it on and you have better knowledge of the > area. If it is not that straightforward I can try to diagnose it better. > Hi Oleksij, Did you manage to further debug and reproduce this problem? Do you plan to send the v3? Regarding your question about the HW - this problem occured once we upgraded the SoC on our SBC from i.MX6DL to i.MX6Q/QP. With the DualLite we never had this problem but the Quad is getting hot quite fast. We have pretty limited cooling options so the core is operated at its upper temperature limits when fully loaded. Best regards, Michal