Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1307225ybl; Tue, 3 Dec 2019 05:13:48 -0800 (PST) X-Google-Smtp-Source: APXvYqwZYPgGuWTnqhN3Ur+eqlZCdRjL9SSfY6ys+bV2CvDhBHPAntTURaOvLQgQ2RZqZp/AjzhV X-Received: by 2002:a9d:7b50:: with SMTP id f16mr3086205oto.18.1575378828848; Tue, 03 Dec 2019 05:13:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575378828; cv=none; d=google.com; s=arc-20160816; b=fITbcSfe7fNg9az3IOkIjP8+OPY6kyAxKL1auuYL3bGg8d7E7XIZ77H7IBKMA6Wwrz yHgRx784jyN3OsKxjl72oR+WWWhKCEtoBn2W85TvCIHygwT+0USNHGIDhEIuYIBHT6L1 hbXfG6qRx8irNX2GrpV7KGQvEz0RjD++wMHjJtvM8qFd/JqDLrPApMhdBfNjg2C9M1fh fv53pisHbGTkPQ7CdMIjEnNOwbK168D3xUADko41I1YWdnqqxNmMxa/RTiMVn0h886Sc nLsm+QPq21AG1TMKpuUkOUgA9XOizFezmDRc5Ub20StJrMwVNQUtiJ0PNbI3qp6w2Uxd PCIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xL+wwaRMBv9RSY39RaXiUDci1/m24RW4l6zvHxar+tc=; b=AneMKuoFImfYHXGEujU5X7kptLm7JSDD7nRHP6Li+9yTBkt4+98Evzli/fFIxJO2ta /CASGdMLqqQx7PKClopX3q8jf/Zla8a7XIX8jMdxmXaL095i85Ry33j2mTMyrov3wx17 UHVqfs69KmHc/09qsuvyICBinPxpl6XiK+UP4IPgwmFWTBRKGaAnCzzEOEeVo7ulBVdP VU23szztYPeKUUxVY3zouM5frY1B3l4k5ie4Qrs2vRnb0tSpMuTgbbqPwFm92nI7G6KU MgnN8Y5/BQgOVf8zu8fVN77txIIrbNU1ic6C1uSq07tBLjoFOEivJupTKoeWjeUMNQhQ cbcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=npXjDGoy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d24si1131225otp.110.2019.12.03.05.13.34; Tue, 03 Dec 2019 05:13:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=npXjDGoy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726330AbfLCNNA (ORCPT + 99 others); Tue, 3 Dec 2019 08:13:00 -0500 Received: from mail-lf1-f49.google.com ([209.85.167.49]:38505 "EHLO mail-lf1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725954AbfLCNM7 (ORCPT ); Tue, 3 Dec 2019 08:12:59 -0500 Received: by mail-lf1-f49.google.com with SMTP id r14so2915060lfm.5; Tue, 03 Dec 2019 05:12:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xL+wwaRMBv9RSY39RaXiUDci1/m24RW4l6zvHxar+tc=; b=npXjDGoyg1aRDYuFip3UFWBcqi0KI7PGwXUdKKMaSdLZpbuXsmOVKspSp1dIxAxMK0 +ytYzmmCzX1PU2SZhocTG4K4m/HLJqopdsCf9sk2eUzKOaN7ub6w5/2dVrGoEnbDUu7D yo89c1d7rrj6rgfHD5PwOD5w7lwR/sCyDn01KfwaO8wUyH2CAnB1P5V7ManXBcSr60FK /OvqlFAr/s561m5JLSabtK2+h4DwQAMoHV/8CAmunaUWbKtxs4u/mi9FrzQ+ClxVU5Y1 ndsL0wmPosCTTmN/gk/vYwcowBklRHotxOzVcQa84/p5wDUAPTLPLJgCvBxq9DwYZomM 4uNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xL+wwaRMBv9RSY39RaXiUDci1/m24RW4l6zvHxar+tc=; b=Mhe2BZ3LhMXaUGvYGLg4GXXFhqGERNEi5Adsw8n5qVISgn0XZbHc+uNFY1OYhP55PR VFbi+MYinWHWO7HAwvzKO709Wx76VKwF7f+R7ProaXAI3fdsybPnf5uPR3QOnzcqlt/I D7WBgOUQ1pLuaaLIT1trmvexFjNkIhAJqgzav/jgwsN+Og5iRnNm0rhWy3iZN68G24+2 5b4XnndJzfnsYJHPwkC6sRG58kvKmkt2ToMf7aBzKANFmsyPxgdQE65e3W/rafG1+tEx TFXds4AUfC+XPd99UUWNVF3Gllp4ioZpQ3nVBa7RFqALmkTYaHxZTovZjQRWI/g4J0vO JYJg== X-Gm-Message-State: APjAAAX9ijGw7TPu9pnWV+QktLNMbNXtmFZff6TyNkX0BGry56QcrKLk lKpzWGBp2gFq2jdW2f2XDmvt4DP337OILkBpIfA= X-Received: by 2002:ac2:4119:: with SMTP id b25mr2718591lfi.90.1575378776541; Tue, 03 Dec 2019 05:12:56 -0800 (PST) MIME-Version: 1.0 References: <08794fde-cdd0-287c-62bf-e2e3b8c80686@gmail.com> <20191203101509.wte47aad5k4mqu2y@pengutronix.de> In-Reply-To: From: Fabio Estevam Date: Tue, 3 Dec 2019 10:13:11 -0300 Message-ID: Subject: Re: Issue with imx_get_temp() To: Marco Felsch Cc: Igor Plyatov , Zhang Rui , Eduardo Valentin , Daniel Lezcano , Amit Kucheria , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , NXP Linux Team , linux-pm@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 3, 2019 at 9:04 AM Fabio Estevam wrote: > > Hi Marco, > > On Tue, Dec 3, 2019 at 7:15 AM Marco Felsch wrote: > > > Mh.. it seems that the irq gets enabled before a irq-handler is > > registered. As your backlog shows the thermal_zone_device_register() > > triggers a imx_get_temp() and during boot the irq_enabled is false and > > it seems that your temperature is below the alarm_temp. So in such a > > case the enable_irq() is executed. I don't know what happens if we > > enable a irq without a irq-handler. > > I think your analysis makes sense. > > Should we move the ' data->irq_enabled = true' just prior to calling > thermal_zone_device_register()? Or maybe we could call thermal_zone_device_register() later? Igor, Does the following patch help? http://code.bulix.org/l3rz2e-982595