From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10284C04AB4 for ; Fri, 17 May 2019 07:32:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D5E46206A3 for ; Fri, 17 May 2019 07:32:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VotAtYoc"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="J0wRT2Ip" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5E46206A3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ub7+eq0g8ipj3x0EmZhbpljvBcQ0+6kROY/HaUvcTfo=; b=VotAtYocdq/OttPnTpf0r1ZUL BjUNIlAGxdCg9DNsInvahxTVPI9zuixM/5eCkHsJ4+sJNRdem0ZxW/RMQ9690EwLYXFhptP+9zfVU UEN4HWOw+itCyppeqhKW+OXrcnPBvSRlQ+x1ZP7r5neJkDWfHLf8sgk5YRSsi2LoDNZe9C6FA2PJv q1FTKur0VgCU/ew9IZNZ14vPo8K9w7MwfgmaDFzc88FXZCCIKXYfV96ORM4wESggxwoC8yuWX0geF B/QdlV3AovMRQ+6xBLWaJLCKfgM0PG1TtrrB7v/BiKSWCDe93MfEFUH46j9BMREhjrZoAtfmGQbOE rGR832euQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hRXMA-0000oG-Bo; Fri, 17 May 2019 07:32:42 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hRXM9-0000no-5I for linux-arm-kernel@bombadil.infradead.org; Fri, 17 May 2019 07:32:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WA9Je5qHBQ57M+8e8gQClXiHlF1u7LL7msoAAP9qc8E=; b=J0wRT2IpmeYVQWLRl7eYfqpFJ XRRgNq5HzCBpmzI3y/FlBYGpQXyEwS4pCU1odttks9V043fp0EWsU05DVIbMvlFKkJxsE5UEsLojO 8GCp3rWSkty7IpFF8lbOqPbEJoRrECuLbVrt6kSmdANgQjdB1ejs0QyL0t/GiC+wI9PzXjj6DIhJ5 2Iy74XZd1rzgY4JnhVmdLgHBZ6Ck9dzh7MM2d0at/I7jjmH3Vf9XInwJ6B3SpB+UdU3j2QMaoXzi3 DL4Mfj1GQEhOMFdTukEos0v/crjCLiBO6Wn3rU16LVtDEhWV/BAlUX17NWPFvWejg6migK6AL4Qjv qxEjuIELA==; Received: from relay2-d.mail.gandi.net ([217.70.183.194]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hRXM5-0000io-Gi for linux-arm-kernel@lists.infradead.org; Fri, 17 May 2019 07:32:39 +0000 X-Originating-IP: 80.215.154.25 Received: from localhost (unknown [80.215.154.25]) (Authenticated sender: maxime.ripard@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 347BA40009; Fri, 17 May 2019 07:31:52 +0000 (UTC) Date: Fri, 17 May 2019 09:31:51 +0200 From: Maxime Ripard To: Frank Lee Subject: Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6 Message-ID: <20190517073151.mz6hcmzubk7iqfre@flea> References: <20190512082614.9045-1-tiny.windzz@gmail.com> <20190512082614.9045-3-tiny.windzz@gmail.com> <20190512133930.t5txssl7mou2gljt@flea> <20190512214128.qjyys3vfpwdiacib@core.my.home> <20190516150252.hf4u3bloo37chy6q@flea> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190517_083237_569744_31B89AF2 X-CRM114-Status: GOOD ( 22.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , catalin.marinas@arm.com, will.deacon@arm.com, bjorn.andersson@linaro.org, marc.w.gonzalez@free.fr, Mauro Carvalho Chehab , paulmck@linux.ibm.com, stefan.wahren@i2se.com, Daniel Lezcano , Chen-Yu Tsai , Jagan Teki , Andy Gross , rui.zhang@intel.com, devicetree@vger.kernel.org, Linux PM , Eduardo Valentin , olof@lixom.net, robh+dt@kernel.org, Jonathan.Cameron@huawei.com, Linux ARM , Greg Kroah-Hartman , Linux Kernel Mailing List , enric.balletbo@collabora.com, David Miller Content-Type: multipart/mixed; boundary="===============6765139085906580092==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============6765139085906580092== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lfvwzxrwqixjwfma" Content-Disposition: inline --lfvwzxrwqixjwfma Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 17, 2019 at 02:10:47AM +0800, Frank Lee wrote: > > On Sun, May 12, 2019 at 11:41:28PM +0200, Ond=C5=99ej Jirman wrote: > > > > > +static int tsens_get_temp(void *data, int *temp) > > > > > +{ > > > > > + struct tsensor *s =3D data; > > > > > + struct tsens_device *tmdev =3D s->tmdev; > > > > > + int val; > > > > > + > > > > > + regmap_read(tmdev->regmap, tmdev->chip->temp_data_base + > > > > > + 0x4 * s->id, &val); > > > > > + > > > > > + if (unlikely(val =3D=3D 0)) > > > > > + return -EBUSY; > > > > > > > > I'm not sure why a val equals to 0 would be associated with EBUSY? > > > > > > Thermal zone driver can (will) call get_temp before we got the > > > first interrupt and the thermal data. In that case val will be 0. > > > > > > Resulting in: > > > > > > (val + offset) * scale =3D (-2794) * -67 =3D 187198 > > > > > > 187=C2=B0C and immediate shutdown during boot - based on cirtical > > > temperature being reached. > > > > > > Busy here means, get_temp does not yet have data. Thermal zone > > > driver just reports any error to dmesg output. > > > > Ah, that makes sense. > > > > I guess if we're switching to an interrupt-based driver, then we can > > just use a waitqueue, or is get_temp supposed to be atomic? > > I think get_temp should not be bloacked. Why not? Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --lfvwzxrwqixjwfma Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXN5jZwAKCRDj7w1vZxhR xRjwAQCF+RoytL/Gdpf15Jq+KQoPxEwYs/XaBIKW6ehF38tr0QD/T1i40/vfptIH f1vUZGQCwcHvI4eTbggzXinFNG1BsAM= =UQjS -----END PGP SIGNATURE----- --lfvwzxrwqixjwfma-- --===============6765139085906580092== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============6765139085906580092==--