[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <518397C60809E147AF5323E0420B992E3EA7491C@DBDE01.ent.ti.com>
Date: Wed, 13 Feb 2013 11:42:01 +0000
From: "Philip, Avinash" <avinashphilip@...com>
To: Russell King - ARM Linux <linux@....linux.org.uk>
CC: "Hilman, Kevin" <khilman@...com>,
"tony@...mide.com" <tony@...mide.com>,
"dwmw2@...radead.org" <dwmw2@...radead.org>,
"artem.bityutskiy@...ux.intel.com" <artem.bityutskiy@...ux.intel.com>,
"Mohammed, Afzal" <afzal@...com>,
"linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
"Nori, Sekhar" <nsekhar@...com>,
"Hebbar, Gururaja" <gururaja.hebbar@...com>,
"Hiremath, Vaibhav" <hvaibhav@...com>
Subject: RE: [PATCH v2 3/4] mtd: devices: elm: Low power transition support
On Sat, Feb 09, 2013 at 15:52:44, Russell King - ARM Linux wrote:
> On Thu, Feb 07, 2013 at 06:06:57PM +0530, Philip Avinash wrote:
> > +static int elm_suspend(struct device *dev)
> > +{
> > + struct elm_info *info = dev_get_drvdata(dev);
> > + wait_queue_head_t wq;
> > + DECLARE_WAITQUEUE(wait, current);
> > +
> > + init_waitqueue_head(&wq);
> > + while (1) {
> > + /* Make sure that ELM not running */
> > + if (info->idle) {
> > + add_wait_queue(&wq, &wait);
> > + schedule();
> > + remove_wait_queue(&wq, &wait);
> > + } else {
> > + break;
> > + }
> > + }
>
> The above code looks really wrong - it will just spin endlessly with the
> waitqueues doing nothing useful. What are you trying to do here?
The intention of waitqeue is to make the suspend process really wait till
the ELM module finishes current activity. Although this type of protection
already achieved in mtd layer using nand_suspend(), this one is particularly
required for ELM module to really make sure that *any pending* corrections to
finish really before gone to suspend.
If suspend activity initiated and NAND driver requested service of ELM
module for error correction, then suspend activity has to wait till
(info->idle == false), so that ELM module finishes activity.
I can think of adding different states to ELM module and take action.
I will add following states.
RUNNING
SUSPEND
Thanks
Avinash
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists