devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: majianpeng <majianpeng@gmail.com>
To: balajitk <balajitk@ti.com>
Cc: cjb <cjb@laptop.org>, linux-mmc <linux-mmc@vger.kernel.org>,
	linux-omap <linux-omap@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	devicetree-discuss <devicetree-discuss@lists.ozlabs.org>
Subject: About omap2 mmc host  close too long irq in irqaction.
Date: Thu, 18 Jul 2013 10:53:01 +0800	[thread overview]
Message-ID: <201307181052572266628@gmail.com> (raw)

Hi all,
	Now i worked on omp2 and met a probelm which someplace close_irq for 3.6second. 
The kernel version is 2.6.37. I used trace to find in irq_action:omap_hsmmc_irq.
This problem occured by removed the sdcard when there are io operations.

I found the read problem is in omap_hsmmc_reset_controller_fsm.
In omap_hsmmc_reset_controller_fsm:
>static inline void omap_hsmmc_reset_controller_fsm(struct omap_hsmmc_host *host,
>                                                   unsigned long bit)
>{
>        unsigned long i = 0; 
>        unsigned long limit = (loops_per_jiffy *
>                                msecs_to_jiffies(MMC_TIMEOUT_MS));

>        OMAP_HSMMC_WRITE(host->base, SYSCTL,
>                         OMAP_HSMMC_READ(host->base, SYSCTL) | bit);

>        /*   
>         * OMAP4 ES2 and greater has an updated reset logic.
>         * Monitor a 0->1 transition first
>         */
>        if (mmc_slot(host).features & HSMMC_HAS_UPDATED_RESET) {
>                while ((!(OMAP_HSMMC_READ(host->base, SYSCTL) & bit))
>                                       && (i++ < limit))
>                        cpu_relax();
        }    
 In func, it used loops_per_jiffy  in order to avoid do many time exceed MMC_TIMEOUT_MS.
In face oops_per_jiify is like:
while(i++ < loops_per_jiffy)
	cpu_relax();
But actually, it used as follow:
>while ((!(OMAP_HSMMC_READ(host->base, SYSCTL) & bit))
>                                      && (i++ < limit))
it add some operations like: read regisger, &, &&.
So the time may exceed MMC_TIMEOUT_MS.
I used those code to test and found it's ok:
for (i = 0 ; i < 10; i++){
	if (!(OMAP_HSMMC_READ(host->base, SYSCTL) & bit))
		  break;
	j = limit/10;
	while(j--)
		cpu_relax();
}

Using this the problom can't occur.
Am i missing something?

Thanks!
Jianpeng Ma

             reply	other threads:[~2013-07-18  2:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18  2:53 majianpeng [this message]
     [not found] ` <2013071816435162919513@gmail.com>
     [not found]   ` <2013071816435162919513-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-18 14:44     ` 回复: About omap2 mmc host close too long irq in irqaction Balaji T K

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=201307181052572266628@gmail.com \
    --to=majianpeng@gmail.com \
    --cc=balajitk@ti.com \
    --cc=cjb@laptop.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@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).