Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3326246pxf; Mon, 22 Mar 2021 03:58:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKOgEem/sEExrSZfakDu7ijbtFz8NCdQt4GdJJfmtA3wcvn7EnHJ0nbxd+RUsz+cVfzEPP X-Received: by 2002:a17:906:19d9:: with SMTP id h25mr19331548ejd.453.1616410715882; Mon, 22 Mar 2021 03:58:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616410715; cv=none; d=google.com; s=arc-20160816; b=Uj5tBtQ0NCrm+TlG8KHEsA0wMWDACVBykVS7uIGk8WGOAjS2EtmTc/zu3pr51IHlHK iKEthBkqfprLSEzbsScOKedaLQNWsCDJueMMze9W8x+sGXWDfVlZPWP+1Wo5CZAkVCzg zmmhsO32jJRlkZ4lo2GSAYX5sqNX4Whuf9FNUu5XU69nDC9yv/7bkCMiXiOKGhvFd5/3 C7cKMPcYOsM0NOKUbNhmjM4YJdnyd0up+zPgyggsKRPhTkkD235B3/FzNTz7VizUchNA 5IEs5396LhtQOvC86IW8UeGDWfm0X0MYWYfw1j7/ILLkIOOKw9keQhm8MfNngNVIXgEu RSpA== 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; bh=uFSylAAQp3FryVa4hHyQT9E2obfNXap1LDgc7VwjnvI=; b=vqMCPV6FTrbaO+xelNZy2GtgfTlUJwvPcdfT+EudZ5jR+hxS/c4m0CfjSBzdRq0S6K kQY+WJ13PmPTeGruKdB19kHhFP48mwhIY0g6mOApjf3Zs/UKJF0zaiz0AcwlJOyiwj/K sfpZ28m3s0NwNUDJcd5S9L2qmiOg0w3F/0QbpYrdgV5EilzANjaxHRmneaENlstJVed/ kRqPySpatSH26/pNNxryUXTTljCrJDuxMuG5H0oPLV1uMuyG2mRoQn3wXRZgWlcsPDXT DeUD5gtiqTh2rQTGlyWnO6+X8+eMMyCc2IlhCTy0MwYMUK3eW90f+qjFpL1LYh9t7jKr tjtg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=free.fr Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si10761481edv.439.2021.03.22.03.58.13; Mon, 22 Mar 2021 03:58:35 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=free.fr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230209AbhCVK5J (ORCPT + 99 others); Mon, 22 Mar 2021 06:57:09 -0400 Received: from ns.iliad.fr ([212.27.33.1]:36080 "EHLO ns.iliad.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230443AbhCVK4p (ORCPT ); Mon, 22 Mar 2021 06:56:45 -0400 X-Greylist: delayed 554 seconds by postgrey-1.27 at vger.kernel.org; Mon, 22 Mar 2021 06:56:44 EDT Received: from ns.iliad.fr (localhost [127.0.0.1]) by ns.iliad.fr (Postfix) with ESMTP id 00E542105A; Mon, 22 Mar 2021 11:47:30 +0100 (CET) Received: from [192.168.108.81] (freebox.vlq16.iliad.fr [213.36.7.13]) by ns.iliad.fr (Postfix) with ESMTP id D7A002105F; Mon, 22 Mar 2021 11:47:29 +0100 (CET) Subject: Re: [PATCH v11 5/9] drivers: thermal: tsens: Fix bug in sensor enable for msm8960 To: Ansuel Smith , Thara Gopinath Cc: Bjorn Andersson , Amit Kucheria , Zhang Rui , Daniel Lezcano , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210319005228.1250-1-ansuelsmth@gmail.com> <20210319005228.1250-6-ansuelsmth@gmail.com> From: Marc Gonzalez Message-ID: Date: Mon, 22 Mar 2021 11:47:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210319005228.1250-6-ansuelsmth@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP ; ns.iliad.fr ; Mon Mar 22 11:47:30 2021 +0100 (CET) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/03/2021 01:52, Ansuel Smith wrote: > Device based on tsens VER_0 contains a hardware bug that results in some > problem with sensor enablement. Sensor id 6-11 can't be enabled > selectively and all of them must be enabled in one step. > > Signed-off-by: Ansuel Smith > --- > drivers/thermal/qcom/tsens-8960.c | 24 +++++++++++++++++++++--- > 1 file changed, 21 insertions(+), 3 deletions(-) > > diff --git a/drivers/thermal/qcom/tsens-8960.c b/drivers/thermal/qcom/tsens-8960.c > index 86585f439985..bdc64d4188bf 100644 > --- a/drivers/thermal/qcom/tsens-8960.c > +++ b/drivers/thermal/qcom/tsens-8960.c > @@ -27,9 +27,9 @@ > #define EN BIT(0) > #define SW_RST BIT(1) > #define SENSOR0_EN BIT(3) > +#define MEASURE_PERIOD BIT(18) > #define SLP_CLK_ENA BIT(26) > #define SLP_CLK_ENA_8660 BIT(24) > -#define MEASURE_PERIOD 1 > #define SENSOR0_SHIFT 3 > > /* INT_STATUS_ADDR bitmasks */ > @@ -126,17 +126,35 @@ static int resume_8960(struct tsens_priv *priv) > static int enable_8960(struct tsens_priv *priv, int id) > { > int ret; > - u32 reg, mask; > + u32 reg, mask = BIT(id); > > ret = regmap_read(priv->tm_map, CNTL_ADDR, ®); > if (ret) > return ret; > > - mask = BIT(id + SENSOR0_SHIFT); > + /* HARDWARE BUG: > + * On platform with more than 6 sensors, all the remaining > + * sensors needs to be enabled all togheder or underfined s/On platform/On platforms s/sensors needs/sensors need s/togheder/together s/underfined/undefined Suggested fix up: On platforms with more than 6 sensors, all remaining sensors must be enabled together, otherwise undefined results are expected. Regards.