Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1218672 > unrolled thread

[PATCH] soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq.

Started byHenry Chen <henryc.chen@mediatek.com>
First post2015-09-04 06:10 +0200
Last post2015-09-09 16:10 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq. Henry Chen <henryc.chen@mediatek.com> - 2015-09-04 06:10 +0200
    Re: [PATCH] soc: mediatek: Move the initial setting of pmic wrap  interrupt before requesting irq. Sascha Hauer <s.hauer@pengutronix.de> - 2015-09-07 07:40 +0200
      Re: [PATCH] soc: mediatek: Move the initial setting of pmic wrap  interrupt before requesting irq. Henry Chen <HenryC.Chen@mediatek.com> - 2015-09-09 16:10 +0200

#1218672 — [PATCH] soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq.

FromHenry Chen <henryc.chen@mediatek.com>
Date2015-09-04 06:10 +0200
Subject[PATCH] soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq.
Message-ID<q4Qu5-7Hg-9@gated-at.bofh.it>
Seperate the initialization of pmic wrap interrupt from pmic wrap init to make sure setting is correct before requesting irq.

Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
---
 drivers/soc/mediatek/mtk-pmic-wrap.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
index f432291..c91d629 100644
--- a/drivers/soc/mediatek/mtk-pmic-wrap.c
+++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
@@ -725,10 +725,6 @@ static int pwrap_init(struct pmic_wrapper *wrp)
 	pwrap_writel(wrp, 0x1, PWRAP_WACS2_EN);
 	pwrap_writel(wrp, 0x5, PWRAP_STAUPD_PRD);
 	pwrap_writel(wrp, 0xff, PWRAP_STAUPD_GRPEN);
-	pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
-	pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
-	pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
-	pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
 
 	if (pwrap_is_mt8135(wrp)) {
 		/* enable pwrap events and pwrap bridge in AP side */
@@ -896,6 +892,16 @@ static int pwrap_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	/*
+	 * watch dog@pwrap,
+	 * The bootloader may not initial the wdt/interrupt setting of pwrap,
+	 * set it before reguesting the irq.
+	 */
+	pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
+	pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
+	pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
+	pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
+
 	irq = platform_get_irq(pdev, 0);
 	ret = devm_request_irq(wrp->dev, irq, pwrap_interrupt, IRQF_TRIGGER_HIGH,
 			"mt-pmic-pwrap", wrp);
-- 
1.8.1.1.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1219936 — Re: [PATCH] soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq.

FromSascha Hauer <s.hauer@pengutronix.de>
Date2015-09-07 07:40 +0200
SubjectRe: [PATCH] soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq.
Message-ID<q5XjR-4JR-17@gated-at.bofh.it>
In reply to#1218672
On Fri, Sep 04, 2015 at 12:05:12PM +0800, Henry Chen wrote:
> Seperate the initialization of pmic wrap interrupt from pmic wrap init to make sure setting is correct before requesting irq.

It seems the problem this patch solves is the missing watchdog
initialization when the pwrap is already initialized but the watchdog is
not, so how about a commit log like:

"The watchdog may not be initialized by the bootloader, even if the rest
of the pwrap is. Move the watchdog initialization out of pwrap_init()
to make sure the watchdog is always initialized and not only when the
pwrap is uninitialized."

Also please add linebreaks to the commit log.

> 
> Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
> ---
>  drivers/soc/mediatek/mtk-pmic-wrap.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
> index f432291..c91d629 100644
> --- a/drivers/soc/mediatek/mtk-pmic-wrap.c
> +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
> @@ -725,10 +725,6 @@ static int pwrap_init(struct pmic_wrapper *wrp)
>  	pwrap_writel(wrp, 0x1, PWRAP_WACS2_EN);
>  	pwrap_writel(wrp, 0x5, PWRAP_STAUPD_PRD);
>  	pwrap_writel(wrp, 0xff, PWRAP_STAUPD_GRPEN);
> -	pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
> -	pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
> -	pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
> -	pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
>  
>  	if (pwrap_is_mt8135(wrp)) {
>  		/* enable pwrap events and pwrap bridge in AP side */
> @@ -896,6 +892,16 @@ static int pwrap_probe(struct platform_device *pdev)
>  		return -ENODEV;
>  	}
>  
> +	/*
> +	 * watch dog@pwrap,
> +	 * The bootloader may not initial the wdt/interrupt setting of pwrap,
> +	 * set it before reguesting the irq.
> +	 */

/* initialize watchdog, may not be done by the bootloader */

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1221488 — Re: [PATCH] soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq.

FromHenry Chen <HenryC.Chen@mediatek.com>
Date2015-09-09 16:10 +0200
SubjectRe: [PATCH] soc: mediatek: Move the initial setting of pmic wrap interrupt before requesting irq.
Message-ID<q6Oeu-5iY-41@gated-at.bofh.it>
In reply to#1219936
Hi Sascha,

On Mon, 2015-09-07 at 07:39 +0200, Sascha Hauer wrote:
> On Fri, Sep 04, 2015 at 12:05:12PM +0800, Henry Chen wrote:
> > Seperate the initialization of pmic wrap interrupt from pmic wrap init to make sure setting is correct before requesting irq.
> 
> It seems the problem this patch solves is the missing watchdog
> initialization when the pwrap is already initialized but the watchdog is
> not, so how about a commit log like:
> 
> "The watchdog may not be initialized by the bootloader, even if the rest
> of the pwrap is. Move the watchdog initialization out of pwrap_init()
> to make sure the watchdog is always initialized and not only when the
> pwrap is uninitialized."
> 
> Also please add linebreaks to the commit log.
> 

Yes, thanks for explanation, I will add this on commit log make it more
clearly to understand.

Henry

> > 
> > Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
> > ---
> >  drivers/soc/mediatek/mtk-pmic-wrap.c | 14 ++++++++++----
> >  1 file changed, 10 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
> > index f432291..c91d629 100644
> > --- a/drivers/soc/mediatek/mtk-pmic-wrap.c
> > +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
> > @@ -725,10 +725,6 @@ static int pwrap_init(struct pmic_wrapper *wrp)
> >  	pwrap_writel(wrp, 0x1, PWRAP_WACS2_EN);
> >  	pwrap_writel(wrp, 0x5, PWRAP_STAUPD_PRD);
> >  	pwrap_writel(wrp, 0xff, PWRAP_STAUPD_GRPEN);
> > -	pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
> > -	pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
> > -	pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
> > -	pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
> >  
> >  	if (pwrap_is_mt8135(wrp)) {
> >  		/* enable pwrap events and pwrap bridge in AP side */
> > @@ -896,6 +892,16 @@ static int pwrap_probe(struct platform_device *pdev)
> >  		return -ENODEV;
> >  	}
> >  
> > +	/*
> > +	 * watch dog@pwrap,
> > +	 * The bootloader may not initial the wdt/interrupt setting of pwrap,
> > +	 * set it before reguesting the irq.
> > +	 */
> 
> /* initialize watchdog, may not be done by the bootloader */
> 
> Sascha
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web