diff mbox

thermal: rcar: set up I/O base before requesting IRQ

Message ID 1370311753-6463-1-git-send-email-horms+renesas@verge.net.au (mailing list archive)
State Changes Requested
Delegated to: Zhang Rui
Headers show

Commit Message

Simon Horman June 4, 2013, 2:09 a.m. UTC
From: Ulrich Hecht <ulrich.hecht@gmail.com>

It is used by the interrupt handler. Fixes crash when booting via kexec
on APE6 board.

This problem was introduced by e0a5172e9eec7f0d3c476e013c51dab62f3fc666
("thermal: rcar: add interrupt support") which was introduced in v3.8-rc3.

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[horms+renesas@verge.net.au: enhanced changelog to include commit
  that cuases the problem ]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 drivers/thermal/rcar_thermal.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Hi Zhang,

could you consider this fix for v3.10?

Comments

Eduardo Valentin June 4, 2013, 12:53 p.m. UTC | #1
Simon, Ulrich,

On 03-06-2013 22:09, Simon Horman wrote:
> From: Ulrich Hecht <ulrich.hecht@gmail.com>
> 
> It is used by the interrupt handler. Fixes crash when booting via kexec
> on APE6 board.
> 
> This problem was introduced by e0a5172e9eec7f0d3c476e013c51dab62f3fc666
> ("thermal: rcar: add interrupt support") which was introduced in v3.8-rc3.
> 
> Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> [horms+renesas@verge.net.au: enhanced changelog to include commit
>   that cuases the problem ]
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>

> ---
>  drivers/thermal/rcar_thermal.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> Hi Zhang,
> 
> could you consider this fix for v3.10?
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 8d7edd4..7641dcc 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -395,13 +395,6 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  			return -ENODEV;
>  		}
>  
> -		ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
> -				       dev_name(dev), common);
> -		if (ret) {
> -			dev_err(dev, "irq request failed\n ");
> -			return ret;
> -		}
> -


Should this IRQ be disabled while this driver gets initialized? Reset
state is enabled?

>  		/*
>  		 * rcar_has_irq_support() will be enabled
>  		 */
> @@ -409,6 +402,13 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  		if (IS_ERR(common->base))
>  			return PTR_ERR(common->base);
>  
> +		ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
> +				       dev_name(dev), common);
> +		if (ret) {
> +			dev_err(dev, "irq request failed\n ");
> +			return ret;
> +		}
> +
>  		/* enable temperature comparation */
>  		rcar_thermal_common_write(common, ENR, 0x00030303);
>  
>
Zhang Rui June 13, 2013, 2:56 a.m. UTC | #2
On Tue, 2013-06-04 at 08:53 -0400, Eduardo Valentin wrote:
> Simon, Ulrich,
> 
> On 03-06-2013 22:09, Simon Horman wrote:
> > From: Ulrich Hecht <ulrich.hecht@gmail.com>
> > 
> > It is used by the interrupt handler. Fixes crash when booting via kexec
> > on APE6 board.
> > 
> > This problem was introduced by e0a5172e9eec7f0d3c476e013c51dab62f3fc666
> > ("thermal: rcar: add interrupt support") which was introduced in v3.8-rc3.
> > 
> > Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
> > Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > [horms+renesas@verge.net.au: enhanced changelog to include commit
> >   that cuases the problem ]
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> 
> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
> 
> > ---
> >  drivers/thermal/rcar_thermal.c | 14 +++++++-------
> >  1 file changed, 7 insertions(+), 7 deletions(-)
> > 
> > Hi Zhang,
> > 
> > could you consider this fix for v3.10?
> > 
> > diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> > index 8d7edd4..7641dcc 100644
> > --- a/drivers/thermal/rcar_thermal.c
> > +++ b/drivers/thermal/rcar_thermal.c
> > @@ -395,13 +395,6 @@ static int rcar_thermal_probe(struct platform_device *pdev)
> >  			return -ENODEV;
> >  		}
> >  
> > -		ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
> > -				       dev_name(dev), common);
> > -		if (ret) {
> > -			dev_err(dev, "irq request failed\n ");
> > -			return ret;
> > -		}
> > -
> 
> 
> Should this IRQ be disabled while this driver gets initialized? Reset
> state is enabled?
> 
the same question here.

even with this patch, I'm not sure what the irq handler can do as the
common->head for priv list is empty at this time.

thanks,
rui

> >  		/*
> >  		 * rcar_has_irq_support() will be enabled
> >  		 */
> > @@ -409,6 +402,13 @@ static int rcar_thermal_probe(struct platform_device *pdev)
> >  		if (IS_ERR(common->base))
> >  			return PTR_ERR(common->base);
> >  
> > +		ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
> > +				       dev_name(dev), common);
> > +		if (ret) {
> > +			dev_err(dev, "irq request failed\n ");
> > +			return ret;
> > +		}
> > +
> >  		/* enable temperature comparation */
> >  		rcar_thermal_common_write(common, ENR, 0x00030303);
> >  
> > 
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 8d7edd4..7641dcc 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -395,13 +395,6 @@  static int rcar_thermal_probe(struct platform_device *pdev)
 			return -ENODEV;
 		}
 
-		ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
-				       dev_name(dev), common);
-		if (ret) {
-			dev_err(dev, "irq request failed\n ");
-			return ret;
-		}
-
 		/*
 		 * rcar_has_irq_support() will be enabled
 		 */
@@ -409,6 +402,13 @@  static int rcar_thermal_probe(struct platform_device *pdev)
 		if (IS_ERR(common->base))
 			return PTR_ERR(common->base);
 
+		ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
+				       dev_name(dev), common);
+		if (ret) {
+			dev_err(dev, "irq request failed\n ");
+			return ret;
+		}
+
 		/* enable temperature comparation */
 		rcar_thermal_common_write(common, ENR, 0x00030303);