From: Dima Zavin <dima@android.com>
To: Daniel Walker <dwalker@codeaurora.org>
Cc: linux-arm-msm@vger.kernel.org, Daniel Walker <c_dwalke@quicinc.com>
Subject: Re: [PATCH 5/5] arm: msm: smd: fix SMD modem processor sync condition
Date: Mon, 19 Apr 2010 11:34:27 -0700 [thread overview]
Message-ID: <w2y404ea8001004191134p804a8c3an134456d3af6ba29d@mail.gmail.com> (raw)
In-Reply-To: <1271700189-8376-5-git-send-email-dwalker@codeaurora.org>
Do we really need a formalized blocking point here? The apps processor
can do other useful initialization work while the modem is booting.
The first time you do a proc_comm call, it checks the PCOM_READY
state, and will block anyway. Preventing the apps processor from
continuing until then is suboptimal. If there are bugs in the modem
code where it incorrectly stomps on shared resources, then those
should be fixed. This patch looks like a hack to me.
--Dima
On Mon, Apr 19, 2010 at 11:03 AM, Daniel Walker <dwalker@codeaurora.org> 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>
> ---
> 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 915ee70..f001281 100644
> --- a/arch/arm/mach-msm/proc_comm.c
> +++ b/arch/arm/mach-msm/proc_comm.c
> @@ -107,4 +107,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 2fa567e..4fec6df 100644
> --- a/arch/arm/mach-msm/smd.c
> +++ b/arch/arm/mach-msm/smd.c
> @@ -1006,6 +1006,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
>
>
next prev parent reply other threads:[~2010-04-19 18:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-19 18:03 [PATCH 5/5] arm: msm: smd: fix SMD modem processor sync condition Daniel Walker
2010-04-19 18:34 ` Dima Zavin [this message]
2010-04-19 19:01 ` Daniel Walker
2010-04-19 19:06 ` Dima Zavin
2010-04-19 19:11 ` Daniel Walker
2010-04-19 19:23 ` Dima Zavin
2010-04-19 19:42 ` Daniel Walker
2010-04-20 13:37 ` Pavel Machek
2010-04-20 15:44 ` [PATCH] " Daniel Walker
Reply instructions:
You may reply publicly 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=w2y404ea8001004191134p804a8c3an134456d3af6ba29d@mail.gmail.com \
--to=dima@android.com \
--cc=c_dwalke@quicinc.com \
--cc=dwalker@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).