[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <X/gHZp9BtXF1N0mT@atomide.com>
Date: Fri, 8 Jan 2021 09:19:02 +0200
From: Tony Lindgren <tony@...mide.com>
To: Péter Ujfalusi <peter.ujfalusi@...il.com>
Cc: Amit Kucheria <amitk@...nel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Zhang Rui <rui.zhang@...el.com>,
Eduardo Valentin <edubezval@...il.com>,
Keerthy <j-keerthy@...com>, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-omap@...r.kernel.org,
Adam Ford <aford173@...il.com>,
Carl Philipp Klemm <philipp@...s.xyz>,
Merlijn Wajer <merlijn@...zup.org>,
Pavel Machek <pavel@....cz>, Sebastian Reichel <sre@...nel.org>
Subject: Re: [PATCH 1/3] thermal: ti-soc-thermal: Fix stuck sensor with
continuous mode for 4430
* Péter Ujfalusi <peter.ujfalusi@...il.com> [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
Powered by blists - more mailing lists