linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 7/7] arm: msm: smd: fix SMD modem processor sync condition
@ 2010-03-26 23:55 Daniel Walker
  2010-03-27  6:23 ` Pavel Machek
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Walker @ 2010-03-26 23:55 UTC (permalink / raw)
  To: linux-arm-msm; +Cc: Daniel Walker

From: Daniel Walker <c_dwalke@quicinc.com>

When booting up we need to wait for the modem processor to
partially boot. This is because the modem processor does
resource allocation for us. If we don't wait the modem won't
honor our requests and we end up crashing or in an unknown
state. This change just formalizes the waiting process.

Signed-off-by: Daniel Walker <c_dwalke@quicinc.com>
---
 arch/arm/mach-msm/proc_comm.c |   15 ++++++++++++++-
 arch/arm/mach-msm/proc_comm.h |    3 +++
 arch/arm/mach-msm/smd.c       |    7 +++++++
 3 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-msm/proc_comm.c b/arch/arm/mach-msm/proc_comm.c
index 1cbdebf..67e701c 100644
--- a/arch/arm/mach-msm/proc_comm.c
+++ b/arch/arm/mach-msm/proc_comm.c
@@ -114,4 +114,17 @@ int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2)
 	return ret;
 }
 
-
+/*
+ * We need to wait for the ARM9 to at least partially boot
+ * up before we can continue. Since the ARM9 does resource
+ * allocation, if we dont' wait we could end up crashing or in
+ * and unknown state. This function should be called early to
+ * wait on the ARM9.
+ */
+void __init proc_comm_boot_wait(void)
+{
+	void __iomem *base = MSM_SHARED_RAM_BASE;
+ 
+	proc_comm_wait_for(base + MDM_STATUS, PCOM_READY);
+ 
+}
diff --git a/arch/arm/mach-msm/proc_comm.h b/arch/arm/mach-msm/proc_comm.h
index 0f5cdd3..12da4ca 100644
--- a/arch/arm/mach-msm/proc_comm.h
+++ b/arch/arm/mach-msm/proc_comm.h
@@ -16,6 +16,8 @@
 #ifndef _ARCH_ARM_MACH_MSM_PROC_COMM_H_
 #define _ARCH_ARM_MACH_MSM_PROC_COMM_H_
 
+#include <linux/init.h>
+
 enum {
 	PCOM_CMD_IDLE = 0x0,
 	PCOM_CMD_DONE,
@@ -251,5 +253,6 @@ enum {
 		(((drvstr) & 0xF) << 17))
 
 int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2);
+void __init proc_comm_boot_wait(void);
 
 #endif
diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index de9343e..cf11d41 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -1001,6 +1001,13 @@ static int __init msm_smd_probe(struct platform_device *pdev)
 {
 	pr_info("smd_init()\n");
 
+	/*
+	 * If we haven't waited for the ARM9 to boot up till now,
+	 * then we need to wait here. Otherwise this should just
+	 * return immediately.
+	 */
+	proc_comm_boot_wait();
+
 	INIT_WORK(&probe_work, smd_channel_probe_worker);
 
 	if (smd_core_init()) {
-- 
1.6.2.3


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

* Re: [PATCH 7/7] arm: msm: smd: fix SMD modem processor sync condition
  2010-03-26 23:55 [PATCH 7/7] arm: msm: smd: fix SMD modem processor sync condition Daniel Walker
@ 2010-03-27  6:23 ` Pavel Machek
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2010-03-27  6:23 UTC (permalink / raw)
  To: Daniel Walker; +Cc: linux-arm-msm, Daniel Walker

On Fri 2010-03-26 16:55:25, Daniel Walker wrote:
> From: Daniel Walker <c_dwalke@quicinc.com>
> 
> When booting up we need to wait for the modem processor to
> partially boot. This is because the modem processor does
> resource allocation for us. If we don't wait the modem won't
> honor our requests and we end up crashing or in an unknown
> state. This change just formalizes the waiting process.
> 
> Signed-off-by: Daniel Walker <c_dwalke@quicinc.com>

ACK.

> ---
>  arch/arm/mach-msm/proc_comm.c |   15 ++++++++++++++-
>  arch/arm/mach-msm/proc_comm.h |    3 +++
>  arch/arm/mach-msm/smd.c       |    7 +++++++
>  3 files changed, 24 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-msm/proc_comm.c b/arch/arm/mach-msm/proc_comm.c
> index 1cbdebf..67e701c 100644
> --- a/arch/arm/mach-msm/proc_comm.c
> +++ b/arch/arm/mach-msm/proc_comm.c
> @@ -114,4 +114,17 @@ int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2)
>  	return ret;
>  }
>  
> -
> +/*
> + * We need to wait for the ARM9 to at least partially boot
> + * up before we can continue. Since the ARM9 does resource
> + * allocation, if we dont' wait we could end up crashing or in
> + * and unknown state. This function should be called early to
> + * wait on the ARM9.
> + */
> +void __init proc_comm_boot_wait(void)
> +{
> +	void __iomem *base = MSM_SHARED_RAM_BASE;
> + 
> +	proc_comm_wait_for(base + MDM_STATUS, PCOM_READY);
> + 
> +}
> diff --git a/arch/arm/mach-msm/proc_comm.h b/arch/arm/mach-msm/proc_comm.h
> index 0f5cdd3..12da4ca 100644
> --- a/arch/arm/mach-msm/proc_comm.h
> +++ b/arch/arm/mach-msm/proc_comm.h
> @@ -16,6 +16,8 @@
>  #ifndef _ARCH_ARM_MACH_MSM_PROC_COMM_H_
>  #define _ARCH_ARM_MACH_MSM_PROC_COMM_H_
>  
> +#include <linux/init.h>
> +
>  enum {
>  	PCOM_CMD_IDLE = 0x0,
>  	PCOM_CMD_DONE,
> @@ -251,5 +253,6 @@ enum {
>  		(((drvstr) & 0xF) << 17))
>  
>  int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2);
> +void __init proc_comm_boot_wait(void);
>  
>  #endif
> diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
> index de9343e..cf11d41 100644
> --- a/arch/arm/mach-msm/smd.c
> +++ b/arch/arm/mach-msm/smd.c
> @@ -1001,6 +1001,13 @@ static int __init msm_smd_probe(struct platform_device *pdev)
>  {
>  	pr_info("smd_init()\n");
>  
> +	/*
> +	 * If we haven't waited for the ARM9 to boot up till now,
> +	 * then we need to wait here. Otherwise this should just
> +	 * return immediately.
> +	 */
> +	proc_comm_boot_wait();
> +
>  	INIT_WORK(&probe_work, smd_channel_probe_worker);
>  
>  	if (smd_core_init()) {

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

end of thread, other threads:[~2010-03-27  6:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-26 23:55 [PATCH 7/7] arm: msm: smd: fix SMD modem processor sync condition Daniel Walker
2010-03-27  6:23 ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).