mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/3] qe: run qe_init and qe_ic_init
@ 2014-10-10  6:48 Zhao Qiang
  2014-10-10 17:34 ` Scott Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Zhao Qiang @ 2014-10-10  6:48 UTC (permalink / raw)
  To: linuxppc-dev, linux-kernel, B07421; +Cc: R63061, Zhao Qiang

qe and qe_ic need to be initialized before the
qe app drivers, using subsys_initcall to run
qe_init and qe_ic_init

Signed-off-by: Zhao Qiang <B45475@freescale.com>
---
 drivers/soc/qe/qe.c    | 15 +++++++++++++++
 drivers/soc/qe/qe_ic.c | 15 +++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/drivers/soc/qe/qe.c b/drivers/soc/qe/qe.c
index 2aaa5b2..bfea0f8 100644
--- a/drivers/soc/qe/qe.c
+++ b/drivers/soc/qe/qe.c
@@ -683,6 +683,21 @@ unsigned int qe_get_num_of_snums(void)
 }
 EXPORT_SYMBOL(qe_get_num_of_snums);
 
+static int __init qe_init(void)
+{
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, NULL, "fsl,qe");
+	if (!np) {
+		pr_err("%s: Could not find Quicc Engine node\n", __func__);
+		return -ENODEV;
+	}
+	qe_reset();
+	of_node_put(np);
+	return 0;
+}
+subsys_initcall(qe_init);
+
 #if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC_85xx)
 static int qe_resume(struct platform_device *ofdev)
 {
diff --git a/drivers/soc/qe/qe_ic.c b/drivers/soc/qe/qe_ic.c
index cc1b8d5..11fe98c 100644
--- a/drivers/soc/qe/qe_ic.c
+++ b/drivers/soc/qe/qe_ic.c
@@ -34,6 +34,7 @@
 #include <linux/fsl/qe_ic.h>
 
 #include "qe_ic.h"
+#include "../../irqchip/irqchip.h"
 
 static DEFINE_RAW_SPINLOCK(qe_ic_lock);
 
@@ -501,4 +502,18 @@ static int __init init_qe_ic_sysfs(void)
 	return 0;
 }
 
+static int __init qeic_of_init(void)
+{
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+	if (np) {
+		qe_ic_init(np, 0, qe_ic_cascade_low_mpic,
+			   qe_ic_cascade_high_mpic);
+		of_node_put(np);
+	}
+	return 0;
+}
+subsys_initcall(qeic_of_init);
+
 subsys_initcall(init_qe_ic_sysfs);
-- 
2.1.0.27.g96db324


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/3] qe: run qe_init and qe_ic_init
  2014-10-10  6:48 [PATCH 2/3] qe: run qe_init and qe_ic_init Zhao Qiang
@ 2014-10-10 17:34 ` Scott Wood
  2014-10-11  6:22   ` qiang.zhao
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2014-10-10 17:34 UTC (permalink / raw)
  To: Zhao Qiang; +Cc: linuxppc-dev, linux-kernel, B07421, R63061

On Fri, 2014-10-10 at 14:48 +0800, Zhao Qiang wrote:
> qe and qe_ic need to be initialized before the
> qe app drivers, using subsys_initcall to run
> qe_init and qe_ic_init
> 
> Signed-off-by: Zhao Qiang <B45475@freescale.com>
> ---
>  drivers/soc/qe/qe.c    | 15 +++++++++++++++
>  drivers/soc/qe/qe_ic.c | 15 +++++++++++++++
>  2 files changed, 30 insertions(+)
> 
> diff --git a/drivers/soc/qe/qe.c b/drivers/soc/qe/qe.c
> index 2aaa5b2..bfea0f8 100644
> --- a/drivers/soc/qe/qe.c
> +++ b/drivers/soc/qe/qe.c
> @@ -683,6 +683,21 @@ unsigned int qe_get_num_of_snums(void)
>  }
>  EXPORT_SYMBOL(qe_get_num_of_snums);
>  
> +static int __init qe_init(void)
> +{
> +	struct device_node *np;
> +
> +	np = of_find_compatible_node(NULL, NULL, "fsl,qe");
> +	if (!np) {
> +		pr_err("%s: Could not find Quicc Engine node\n", __func__);
> +		return -ENODEV;
> +	}
> +	qe_reset();
> +	of_node_put(np);
> +	return 0;
> +}
> +subsys_initcall(qe_init);

It is not an error to enable QE support on hardware that doesn't have
QE.  Please remove the pr_err().

> +
>  #if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC_85xx)
>  static int qe_resume(struct platform_device *ofdev)
>  {
> diff --git a/drivers/soc/qe/qe_ic.c b/drivers/soc/qe/qe_ic.c
> index cc1b8d5..11fe98c 100644
> --- a/drivers/soc/qe/qe_ic.c
> +++ b/drivers/soc/qe/qe_ic.c
> @@ -34,6 +34,7 @@
>  #include <linux/fsl/qe_ic.h>
>  
>  #include "qe_ic.h"
> +#include "../../irqchip/irqchip.h"

What do you need from here, and can it be moved to include/linux/...?
 
The only thing I see defined in irqchip.h is IRQCHIP_DECLARE, and you
don't use that in this patch...

-Scott

>  static DEFINE_RAW_SPINLOCK(qe_ic_lock);
>  
> @@ -501,4 +502,18 @@ static int __init init_qe_ic_sysfs(void)
>  	return 0;
>  }
>  
> +static int __init qeic_of_init(void)
> +{
> +	struct device_node *np;
> +
> +	np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
> +	if (np) {
> +		qe_ic_init(np, 0, qe_ic_cascade_low_mpic,
> +			   qe_ic_cascade_high_mpic);
> +		of_node_put(np);
> +	}
> +	return 0;
> +}
> +subsys_initcall(qeic_of_init);
> +
>  subsys_initcall(init_qe_ic_sysfs);



^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH 2/3] qe: run qe_init and qe_ic_init
  2014-10-10 17:34 ` Scott Wood
@ 2014-10-11  6:22   ` qiang.zhao
  0 siblings, 0 replies; 3+ messages in thread
From: qiang.zhao @ 2014-10-11  6:22 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, linux-kernel, Xiaobo Xie

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2833 bytes --]

On Sat, 2014-10-11 at 01:35AM, Wood Scott wrote:
> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Saturday, October 11, 2014 1:35 AM
> To: Zhao Qiang-B45475
> Cc: linuxppc-dev@lists.ozlabs.org; linux-kernel@vger.kernel.org; Wood
> Scott-B07421; Xie Xiaobo-R63061
> Subject: Re: [PATCH 2/3] qe: run qe_init and qe_ic_init
> 
> On Fri, 2014-10-10 at 14:48 +0800, Zhao Qiang wrote:
> > qe and qe_ic need to be initialized before the qe app drivers, using
> > subsys_initcall to run qe_init and qe_ic_init
> >
> > Signed-off-by: Zhao Qiang <B45475@freescale.com>
> > ---
> >  drivers/soc/qe/qe.c    | 15 +++++++++++++++
> >  drivers/soc/qe/qe_ic.c | 15 +++++++++++++++
> >  2 files changed, 30 insertions(+)
> >
> > diff --git a/drivers/soc/qe/qe.c b/drivers/soc/qe/qe.c index
> > 2aaa5b2..bfea0f8 100644
> > --- a/drivers/soc/qe/qe.c
> > +++ b/drivers/soc/qe/qe.c
> > @@ -683,6 +683,21 @@ unsigned int qe_get_num_of_snums(void)  }
> > EXPORT_SYMBOL(qe_get_num_of_snums);
> >
> > +static int __init qe_init(void)
> > +{
> > +	struct device_node *np;
> > +
> > +	np = of_find_compatible_node(NULL, NULL, "fsl,qe");
> > +	if (!np) {
> > +		pr_err("%s: Could not find Quicc Engine node\n", __func__);
> > +		return -ENODEV;
> > +	}
> > +	qe_reset();
> > +	of_node_put(np);
> > +	return 0;
> > +}
> > +subsys_initcall(qe_init);
> 
> It is not an error to enable QE support on hardware that doesn't have QE.
> Please remove the pr_err().
OK, will be modified on V2.
> 
> > +
> >  #if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC_85xx)  static int
> > qe_resume(struct platform_device *ofdev)  { diff --git
> > a/drivers/soc/qe/qe_ic.c b/drivers/soc/qe/qe_ic.c index
> > cc1b8d5..11fe98c 100644
> > --- a/drivers/soc/qe/qe_ic.c
> > +++ b/drivers/soc/qe/qe_ic.c
> > @@ -34,6 +34,7 @@
> >  #include <linux/fsl/qe_ic.h>
> >
> >  #include "qe_ic.h"
> > +#include "../../irqchip/irqchip.h"
> 
> What do you need from here, and can it be moved to include/linux/...?
> 
> The only thing I see defined in irqchip.h is IRQCHIP_DECLARE, and you
> don't use that in this patch...
OK, will be modified on V2.
> 
> -Scott
> 
> >  static DEFINE_RAW_SPINLOCK(qe_ic_lock);
> >
> > @@ -501,4 +502,18 @@ static int __init init_qe_ic_sysfs(void)
> >  	return 0;
> >  }
> >
> > +static int __init qeic_of_init(void)
> > +{
> > +	struct device_node *np;
> > +
> > +	np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
> > +	if (np) {
> > +		qe_ic_init(np, 0, qe_ic_cascade_low_mpic,
> > +			   qe_ic_cascade_high_mpic);
> > +		of_node_put(np);
> > +	}
> > +	return 0;
> > +}
> > +subsys_initcall(qeic_of_init);
> > +
> >  subsys_initcall(init_qe_ic_sysfs);
> 


Best Regards
Zhao Qiang
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-11  6:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-10  6:48 [PATCH 2/3] qe: run qe_init and qe_ic_init Zhao Qiang
2014-10-10 17:34 ` Scott Wood
2014-10-11  6:22   ` qiang.zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®