Linux-PM Archive on lore.kernel.org
 help / color / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Pascal Paillet <p.paillet@st.com>,
	rui.zhang@intel.com, edubezval@gmail.com,
	amit.kucheria@verdurent.com, mcoquelin.stm32@gmail.com,
	alexandre.torgue@st.com, david.hernandezsanchez@st.com,
	horms+renesas@verge.net.au, wsa+renesas@sang-engineering.com,
	linux-pm@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/5] thermal: stm32: remove hardware irq handler
Date: Wed, 4 Dec 2019 22:05:22 +0100
Message-ID: <3b1b690b-71f1-95e7-704b-b3d0073c68de@linaro.org> (raw)
In-Reply-To: <20191104133020.8820-2-p.paillet@st.com>

On 04/11/2019 14:30, Pascal Paillet wrote:
> Remove hardware irq handler because it is not needed to disable the
> interrupt before the threaded handler. The goal is to simplify
> the code.

Please elaborate the explanation here. I guess all the code removed is
because of:

	/* read IT reason in SR and clear flags */
	value = readl_relaxed(sensor->base + DTS_SR_OFFSET);

Right?

> Change-Id: Ida967e8543c8dafc6a24508000f64f6405add31d

Remove Change-Id.

Missing SoB.

> ---
>  drivers/thermal/st/stm_thermal.c | 25 +------------------------
>  1 file changed, 1 insertion(+), 24 deletions(-)
> 
> diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c
> index cf9ddc52f30e..31aa63fb3db1 100644
> --- a/drivers/thermal/st/stm_thermal.c
> +++ b/drivers/thermal/st/stm_thermal.c
> @@ -98,21 +98,10 @@ struct stm_thermal_sensor {
>  	unsigned int low_temp_enabled;
>  	int num_trips;
>  	int irq;
> -	unsigned int irq_enabled;
>  	void __iomem *base;
>  	int t0, fmt0, ramp_coeff;
>  };
>  
> -static irqreturn_t stm_thermal_alarm_irq(int irq, void *sdata)
> -{
> -	struct stm_thermal_sensor *sensor = sdata;
> -
> -	disable_irq_nosync(irq);
> -	sensor->irq_enabled = false;
> -
> -	return IRQ_WAKE_THREAD;
> -}
> -
>  static irqreturn_t stm_thermal_alarm_irq_thread(int irq, void *sdata)
>  {
>  	u32 value;
> @@ -464,16 +453,6 @@ static int stm_thermal_get_temp(void *data, int *temp)
>  			if (ret)
>  				return ret;
>  		}
> -
> -		/*
> -		 * Re-enable alarm IRQ if temperature below critical
> -		 * temperature
> -		 */
> -		if (!sensor->irq_enabled &&
> -		    (celsius(*temp) < sensor->temp_critical)) {
> -			sensor->irq_enabled = true;
> -			enable_irq(sensor->irq);
> -		}
>  	}
>  
>  	return 0;
> @@ -493,7 +472,7 @@ static int stm_register_irq(struct stm_thermal_sensor *sensor)
>  	}
>  
>  	ret = devm_request_threaded_irq(dev, sensor->irq,
> -					stm_thermal_alarm_irq,
> +					NULL,
>  					stm_thermal_alarm_irq_thread,
>  					IRQF_ONESHOT,
>  					dev->driver->name, sensor);
> @@ -503,8 +482,6 @@ static int stm_register_irq(struct stm_thermal_sensor *sensor)
>  		return ret;
>  	}
>  
> -	sensor->irq_enabled = true;
> -
>  	dev_dbg(dev, "%s: thermal IRQ registered", __func__);
>  
>  	return 0;
> 


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


  reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 13:30 [PATCH v2 0/5] thermal: stm32: driver improvements Pascal Paillet
2019-11-04 13:30 ` [PATCH v2 1/5] thermal: stm32: remove hardware irq handler Pascal Paillet
2019-12-04 21:05   ` Daniel Lezcano [this message]
2019-11-04 13:30 ` [PATCH v2 2/5] thermal: stm32: fix icifr register name Pascal Paillet
2019-11-04 13:30 ` [PATCH v2 3/5] thermal: stm32: handle multiple trip points Pascal Paillet
2019-12-05 10:50   ` Daniel Lezcano
2019-11-04 13:30 ` [PATCH v2 4/5] thermal: stm32: improve temperature resolution Pascal Paillet
2019-12-05 11:03   ` Daniel Lezcano
2019-11-04 13:30 ` [PATCH v2 5/5] thermal: stm32: fix low threshold interrupt flood Pascal Paillet
2019-11-21 15:42 ` [PATCH v2 0/5] thermal: stm32: driver improvements Pascal PAILLET-LME

Reply instructions:

You may reply publically 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=3b1b690b-71f1-95e7-704b-b3d0073c68de@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=alexandre.torgue@st.com \
    --cc=amit.kucheria@verdurent.com \
    --cc=david.hernandezsanchez@st.com \
    --cc=edubezval@gmail.com \
    --cc=horms+renesas@verge.net.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=p.paillet@st.com \
    --cc=rui.zhang@intel.com \
    --cc=wsa+renesas@sang-engineering.com \
    /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

Linux-PM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-pm/0 linux-pm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pm linux-pm/ https://lore.kernel.org/linux-pm \
		linux-pm@vger.kernel.org
	public-inbox-index linux-pm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-pm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git