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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 81855C433E0 for ; Fri, 8 Jan 2021 07:20:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 405E2233FC for ; Fri, 8 Jan 2021 07:20:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727130AbhAHHTx (ORCPT ); Fri, 8 Jan 2021 02:19:53 -0500 Received: from muru.com ([72.249.23.125]:41154 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725308AbhAHHTw (ORCPT ); Fri, 8 Jan 2021 02:19:52 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 200AE80B4; Fri, 8 Jan 2021 07:19:31 +0000 (UTC) Date: Fri, 8 Jan 2021 09:19:02 +0200 From: Tony Lindgren To: =?utf-8?B?UMOpdGVy?= Ujfalusi Cc: Amit Kucheria , Daniel Lezcano , Zhang Rui , Eduardo Valentin , Keerthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, Adam Ford , Carl Philipp Klemm , Merlijn Wajer , Pavel Machek , Sebastian Reichel Subject: Re: [PATCH 1/3] thermal: ti-soc-thermal: Fix stuck sensor with continuous mode for 4430 Message-ID: References: <20201230084338.19410-1-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Péter Ujfalusi [201231 12:55]: > On 12/30/20 10:43 AM, Tony Lindgren wrote: > > @@ -58,7 +58,8 @@ omap4430_adc_to_temp[OMAP4430_ADC_END_VALUE - OMAP4430_ADC_START_VALUE + 1] = { > > const struct ti_bandgap_data omap4430_data = { > > .features = TI_BANDGAP_FEATURE_MODE_CONFIG | > > TI_BANDGAP_FEATURE_CLK_CTRL | > > - TI_BANDGAP_FEATURE_POWER_SWITCH, > > + TI_BANDGAP_FEATURE_POWER_SWITCH | > > + TI_BANDGAP_FEATURE_CONT_MODE_ONLY, > > Can we add a comment with the observations? Sure, and I also noticed that the timeout triggers also on dra7 too. I need to recheck what all are affected.. At least we now see warnings on the SoCs affected. > > @@ -605,8 +606,10 @@ ti_bandgap_force_single_read(struct ti_bandgap *bgp, int id) > > u32 counter = 1000; > > struct temp_sensor_registers *tsr; > > > > - /* Select single conversion mode */ > > - if (TI_BANDGAP_HAS(bgp, MODE_CONFIG)) > > + /* Select continuous or single conversion mode */ > > + if (TI_BANDGAP_HAS(bgp, CONT_MODE_ONLY)) > > + RMW_BITS(bgp, id, bgap_mode_ctrl, mode_ctrl_mask, 1); > > + else if (TI_BANDGAP_HAS(bgp, MODE_CONFIG)) > > RMW_BITS(bgp, id, bgap_mode_ctrl, mode_ctrl_mask, 0); > > Would not be better to: > if (TI_BANDGAP_HAS(bgp, MODE_CONFIG)) { > if (TI_BANDGAP_HAS(bgp, CONT_MODE_ONLY)) > RMW_BITS(bgp, id, bgap_mode_ctrl, mode_ctrl_mask, 1); > else > RMW_BITS(bgp, id, bgap_mode_ctrl, mode_ctrl_mask, 0); > } > > One can only switch to cont/single mode if the mode config is possible. Yup makes sense thanks for spotting that. Regards, Tony