* Problem when using SDIO interrupts on Nexus One
@ 2011-04-07 19:23 Johan
2011-04-11 12:08 ` Subhash Jadavani
0 siblings, 1 reply; 3+ messages in thread
From: Johan @ 2011-04-07 19:23 UTC (permalink / raw)
To: linux-mmc
I have a Nexus One Android phone and I am trying to use a SDIO device
connected to the memory slot available on the phone. This device uses
SDIO interrupts on SD_D1 to signal interrupts to the host.
I am using a 2.6-32 kernel from the android-msm-2.6.32 branch
available fromgit://android.git.kernel.org/kernel/msm.git and has
built the kernel with the mahimahi_defconfig.
I have modified drivers/mmc/host/msm_sdcc.c so that SDIO interrupts is
used -> msmsdcc_sdioirq = 1;
My device is working quite well with SDIO interrupts but sometime I
can miss a interrupt and will get this interrupt when I try to send a
command to my device. I can see this behaviour if my device tries to
signal a interrupt 1 second of the last command sent to the device.
The SDIO interrupt line goes low and the host does not signal the
interrupt at once. My assumption is that this is due to some kind of
power management of the SDIO controller. I will get this interrupt
when I activate the SDIO controller by sending a command to my device.
I have verified this with a logic analyzer attached to the bus and
can attach a screen shot if anyone wants to see this.
So my question is if anyone know how to get reliable SDIO interrupts
on this host, Qualcomm MSM? It seems like Qualcomm does not provide
documentation for this host.
Best Regards
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Problem when using SDIO interrupts on Nexus One
2011-04-07 19:23 Problem when using SDIO interrupts on Nexus One Johan
@ 2011-04-11 12:08 ` Subhash Jadavani
2011-04-13 10:07 ` Subhash Jadavani
0 siblings, 1 reply; 3+ messages in thread
From: Subhash Jadavani @ 2011-04-11 12:08 UTC (permalink / raw)
To: 'Johan', linux-mmc; +Cc: bryanh
[-- Attachment #1: Type: text/plain, Size: 2310 bytes --]
Hi Johan,
> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> owner@vger.kernel.org] On Behalf Of Johan
> Sent: Friday, April 08, 2011 12:53 AM
> To: linux-mmc@vger.kernel.org
> Subject: Problem when using SDIO interrupts on Nexus One
>
> I have a Nexus One Android phone and I am trying to use a SDIO device
> connected to the memory slot available on the phone. This device uses
> SDIO interrupts on SD_D1 to signal interrupts to the host.
>
> I am using a 2.6-32 kernel from the android-msm-2.6.32 branch
> available from git://android.git.kernel.org/kernel/msm.git and has
> built the kernel with the mahimahi_defconfig.
>
> I have modified drivers/mmc/host/msm_sdcc.c so that SDIO interrupts is
> used -> msmsdcc_sdioirq = 1;
>
> My device is working quite well with SDIO interrupts but sometime I
> can miss a interrupt and will get this interrupt when I try to send a
> command to my device. I can see this behaviour if my device tries to
> signal a interrupt 1 second of the last command sent to the device.
> The SDIO interrupt line goes low and the host does not signal the
> interrupt at once. My assumption is that this is due to some kind of
> power management of the SDIO controller. I will get this interrupt
> when I activate the SDIO controller by sending a command to my device.
> I have verified this with a logic analyzer attached to the bus and
> can attach a screen shot if anyone wants to see this.
>
> So my question is if anyone know how to get reliable SDIO interrupts
> on this host, Qualcomm MSM? It seems like Qualcomm does not provide
> documentation for this host.
I had a look at the msm_sdcc.c and it looks like all the SDCC interrupts are
masked when driver goes into
Suspend. So when you say interrupts are getting missed it might be the case
that system is in suspend state.
To fix this, you can keep the SDIO interrupts enabled while going into
suspend. I have made a patch (attached with this mail) with this change.
Please give a try and let me know if it works for you or not.
Regards,
Subhash
>
> Best Regards
> Johan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: 0001-msm-msm_sdcc-handle-SDIO-interrupts-during-suspend.patch --]
[-- Type: application/octet-stream, Size: 1153 bytes --]
>From 3a4f474d78e7735ac3115edc307ed083dcfaeb53 Mon Sep 17 00:00:00 2001
From: Subhash Jadavani <subhashj@codeaurora.org>
Date: Mon, 11 Apr 2011 17:29:19 +0530
Subject: [PATCH] msm: msm_sdcc: handle SDIO interrupts during suspend
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
---
drivers/mmc/host/msm_sdcc.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index fb56272..fa9332f 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1330,10 +1330,15 @@ msmsdcc_suspend(struct platform_device *dev, pm_message_t state)
if (mmc->card && mmc->card->type != MMC_TYPE_SDIO)
rc = mmc_suspend_host(mmc, state);
- if (!rc)
+
+ if (mmc->card && mmc->card->type == MMC_TYPE_SDIO) {
+ msmsdcc_writel(host, (MCI_SDIOINTOPERMASK |
+ MCI_SDIOINTMASK), MMCIMASK0);
+ } else if (!rc) {
msmsdcc_writel(host, 0, MMCIMASK0);
- if (host->clks_on)
- msmsdcc_disable_clocks(host, 0);
+ if (host->clks_on)
+ msmsdcc_disable_clocks(host, 0);
+ }
}
return rc;
}
--
1.7.1.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: Problem when using SDIO interrupts on Nexus One
2011-04-11 12:08 ` Subhash Jadavani
@ 2011-04-13 10:07 ` Subhash Jadavani
0 siblings, 0 replies; 3+ messages in thread
From: Subhash Jadavani @ 2011-04-13 10:07 UTC (permalink / raw)
To: 'Johan', linux-mmc; +Cc: bryanh
Hi Johan,
Did you get a chance to test my patch?
Regards,
Subhash
> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> owner@vger.kernel.org] On Behalf Of Subhash Jadavani
> Sent: Monday, April 11, 2011 5:38 PM
> To: 'Johan'; linux-mmc@vger.kernel.org
> Cc: bryanh@codeaurora.org
> Subject: RE: Problem when using SDIO interrupts on Nexus One
>
> Hi Johan,
>
> > -----Original Message-----
> > From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> > owner@vger.kernel.org] On Behalf Of Johan
> > Sent: Friday, April 08, 2011 12:53 AM
> > To: linux-mmc@vger.kernel.org
> > Subject: Problem when using SDIO interrupts on Nexus One
> >
> > I have a Nexus One Android phone and I am trying to use a SDIO device
> > connected to the memory slot available on the phone. This device uses
> > SDIO interrupts on SD_D1 to signal interrupts to the host.
> >
> > I am using a 2.6-32 kernel from the android-msm-2.6.32 branch
> > available from git://android.git.kernel.org/kernel/msm.git and has
> > built the kernel with the mahimahi_defconfig.
> >
> > I have modified drivers/mmc/host/msm_sdcc.c so that SDIO interrupts
> is
> > used -> msmsdcc_sdioirq = 1;
> >
> > My device is working quite well with SDIO interrupts but sometime I
> > can miss a interrupt and will get this interrupt when I try to send a
> > command to my device. I can see this behaviour if my device tries to
> > signal a interrupt 1 second of the last command sent to the device.
> > The SDIO interrupt line goes low and the host does not signal the
> > interrupt at once. My assumption is that this is due to some kind of
> > power management of the SDIO controller. I will get this interrupt
> > when I activate the SDIO controller by sending a command to my
> device.
> > I have verified this with a logic analyzer attached to the bus and
> > can attach a screen shot if anyone wants to see this.
> >
> > So my question is if anyone know how to get reliable SDIO interrupts
> > on this host, Qualcomm MSM? It seems like Qualcomm does not provide
> > documentation for this host.
>
> I had a look at the msm_sdcc.c and it looks like all the SDCC
> interrupts are masked when driver goes into Suspend. So when you say
> interrupts are getting missed it might be the case that system is in
> suspend state.
>
> To fix this, you can keep the SDIO interrupts enabled while going into
> suspend. I have made a patch (attached with this mail) with this
> change.
> Please give a try and let me know if it works for you or not.
>
> Regards,
> Subhash
>
> >
> > Best Regards
> > Johan
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-mmc"
> > in the body of a message to majordomo@vger.kernel.org More majordomo
> > info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-04-13 10:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-07 19:23 Problem when using SDIO interrupts on Nexus One Johan
2011-04-11 12:08 ` Subhash Jadavani
2011-04-13 10:07 ` Subhash Jadavani
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).