public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: "Péter Ujfalusi" <peter.ujfalusi@gmail.com>
Cc: Amit Kucheria <amitk@kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Eduardo Valentin <edubezval@gmail.com>,
	Keerthy <j-keerthy@ti.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-omap@vger.kernel.org, Adam Ford <aford173@gmail.com>,
	Carl Philipp Klemm <philipp@uvos.xyz>,
	Merlijn Wajer <merlijn@wizzup.org>, Pavel Machek <pavel@ucw.cz>,
	Sebastian Reichel <sre@kernel.org>
Subject: Re: [PATCH 1/3] thermal: ti-soc-thermal: Fix stuck sensor with continuous mode for 4430
Date: Fri, 8 Jan 2021 09:19:02 +0200	[thread overview]
Message-ID: <X/gHZp9BtXF1N0mT@atomide.com> (raw)
In-Reply-To: <f108ac41-b38f-2d19-97ee-aaa5a7fdd1cc@gmail.com>

* Péter Ujfalusi <peter.ujfalusi@gmail.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

      reply	other threads:[~2021-01-08  7:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30  8:43 [PATCH 1/3] thermal: ti-soc-thermal: Fix stuck sensor with continuous mode for 4430 Tony Lindgren
2020-12-30  8:43 ` [PATCH 2/3] thermal: ti-soc-thermal: Simplify polling with iopoll Tony Lindgren
2020-12-30  8:43 ` [PATCH 3/3] thermal: ti-soc-thermal: Use non-inverted define for omap4 Tony Lindgren
2020-12-30 12:55 ` [PATCH 1/3] thermal: ti-soc-thermal: Fix stuck sensor with continuous mode for 4430 Adam Ford
2020-12-30 13:26   ` H. Nikolaus Schaller
2021-01-08  7:22     ` Tony Lindgren
2021-01-08 13:45       ` Adam Ford
2021-01-08 18:31         ` Adam Ford
2021-01-08 19:41           ` Adam Ford
2020-12-31 12:55 ` Péter Ujfalusi
2021-01-08  7:19   ` Tony Lindgren [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X/gHZp9BtXF1N0mT@atomide.com \
    --to=tony@atomide.com \
    --cc=aford173@gmail.com \
    --cc=amitk@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=edubezval@gmail.com \
    --cc=j-keerthy@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=merlijn@wizzup.org \
    --cc=pavel@ucw.cz \
    --cc=peter.ujfalusi@gmail.com \
    --cc=philipp@uvos.xyz \
    --cc=rui.zhang@intel.com \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox