All of lore.kernel.org
 help / color / mirror / Atom feed
From: eric@eukrea.com (Eric Bénard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] mxc_nand: fix PM
Date: Fri, 21 May 2010 14:32:01 +0200	[thread overview]
Message-ID: <4BF67D41.1020204@eukrea.com> (raw)
In-Reply-To: <19446.29016.956006.230105@ipc1.ka-ro>

Hi Lothar,

Le 21/05/2010 13:41, Lothar Wa?mann a ?crit :
>> -	if (mtd) {
>> -		/* Enable the NFC clock */
>> +	if (!host->clk_act) {
>>   		clk_enable(host->clk);
>> -		mtd->resume(mtd);
>> +		host->clk_act = 1;
>>   	}
>>
> Since you are clearing host->clk_act during suspend, this will
> unconditionally enable the clock no matter what state it had before
> suspend (in case that's intended, the check for !host->clk_act is
> useless, since it will always yield true).

Yes, you're right.
In fact, the clock is turned on & off by mxc_nand_select_chip so when 
clk_enable & clk_disable are called in suspend & resume without checking 
it the clock is already active, I had log complaining for the clock 
already being off as mxc_nand_select_chip hard already turned it off, so 
I put the checks in both functions.

 > I think it's more sensible to leave host->clk_act alone, and reenable
 > the clock only if host->clk_act is set, so that the clock is left in
 > the same state after resume in which it was before suspend.
 >
OK I'll try this. In fact, I think the clock is always off when we reach 
suspend & resume as nand_base has already deselected the chip and thus 
the NFC's clock is turned off.

While we're at this : is there a good reason to select/deselect the chip 
at every access and turn on/off the clock at the same time ?

Eric

  reply	other threads:[~2010-05-21 12:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-21 11:12 [PATCH 1/5] i.MX27: add suspend to RAM support Eric Bénard
2010-05-21 11:12 ` [PATCH 2/5] mxc_nand: fix PM Eric Bénard
2010-05-21 11:12   ` [PATCH 3/5] imx_keypad: add PM support Eric Bénard
2010-05-21 11:12     ` [PATCH 4/5] eukrea_mbimx27: update keyboard platform data Eric Bénard
2010-05-21 11:12       ` [PATCH 5/5] serial/imx.c: fix suspend/resume Eric Bénard
2010-05-21 19:22     ` [PATCH 3/5] imx_keypad: add PM support Russell King - ARM Linux
2010-05-21 11:41   ` [PATCH 2/5] mxc_nand: fix PM Lothar Waßmann
2010-05-21 12:32     ` Eric Bénard [this message]
2010-05-21 13:10   ` Wolfram Sang
2010-05-21 13:22     ` Eric Bénard
2010-05-24 21:10   ` Uwe Kleine-König
2010-05-24 21:16     ` Eric Bénard
2010-05-21 12:02 ` [PATCH 1/5] i.MX27: add suspend to RAM support Lothar Waßmann
2010-05-21 19:19 ` Russell King - ARM Linux

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=4BF67D41.1020204@eukrea.com \
    --to=eric@eukrea.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.