public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: Jaehoon Chung <jh80.chung@samsung.com>
Cc: <linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Seungwon Jeon <tgih.jun@samsung.com>, Chris Ball <cjb@laptop.org>
Subject: Re: [PATCH] mmc: dw_mmc: setpower on MMC_POWER_{UP,OFF}
Date: Tue, 12 Mar 2013 16:31:32 +0000	[thread overview]
Message-ID: <513F5864.6090006@imgtec.com> (raw)
In-Reply-To: <513F10D9.9060402@samsung.com>

On 12/03/13 11:26, Jaehoon Chung wrote:
> Looks good to me.
> 
> Acked-by: Jaehoon Chung <jh80.chung@samsung.com>

Thanks Jaehoon

Cheers
James

> 
> Best Regards,
> Jaehoon Chung
> 
> On 03/12/2013 07:43 PM, James Hogan wrote:
>> Call the setpower platform callback in response to set_ios with
>> ios->power_mode == MMC_POWER_UP or MMC_POWER_OFF, instead of from the
>> card detect work function.
>>
>> This appears to fix a problem I have where a card stuck in a funny state
>> doesn't get properly cleared by the power being turned off, presumably
>> due to lack of power sequencing. This resulted in the following log
>> messages after boot:
>>
>> mmc0: error -110 whilst initialising SD card
>> mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 300000Hz, actual 298922HZ div = 167)
>> mmc0: error -110 whilst initialising SD card
>> mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 200000Hz, actual 199680HZ div = 250)
>> mmc0: error -110 whilst initialising SD card
>> mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 195765Hz, actual 195764HZ div = 255)
>> mmc0: error -110 whilst initialising SD card
>> mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 400000Hz, actual 399360HZ div = 125)
>> mmc0: error -110 whilst initialising SD card
>> mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 300000Hz, actual 298922HZ div = 167)
>>
>> Signed-off-by: James Hogan <james.hogan@imgtec.com>
>> Cc: Seungwon Jeon <tgih.jun@samsung.com>
>> Cc: Jaehoon Chung <jh80.chung@samsung.com>
>> Cc: Chris Ball <cjb@laptop.org>
>> ---
>>  drivers/mmc/host/dw_mmc.c | 16 ++++++++--------
>>  1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> index 60063cc..1a42c7c 100644
>> --- a/drivers/mmc/host/dw_mmc.c
>> +++ b/drivers/mmc/host/dw_mmc.c
>> @@ -818,6 +818,14 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>>  	switch (ios->power_mode) {
>>  	case MMC_POWER_UP:
>>  		set_bit(DW_MMC_CARD_NEED_INIT, &slot->flags);
>> +		/* Power up slot */
>> +		if (slot->host->pdata->setpower)
>> +			slot->host->pdata->setpower(slot->id, mmc->ocr_avail);
>> +		break;
>> +	case MMC_POWER_OFF:
>> +		/* Power down slot */
>> +		if (slot->host->pdata->setpower)
>> +			slot->host->pdata->setpower(slot->id, 0);
>>  		break;
>>  	default:
>>  		break;
>> @@ -1674,10 +1682,6 @@ static void dw_mci_work_routine_card(struct work_struct *work)
>>  			dev_dbg(&slot->mmc->class_dev, "card %s\n",
>>  				present ? "inserted" : "removed");
>>  
>> -			/* Power up slot (before spin_lock, may sleep) */
>> -			if (present != 0 && host->pdata->setpower)
>> -				host->pdata->setpower(slot->id, mmc->ocr_avail);
>> -
>>  			spin_lock_bh(&host->lock);
>>  
>>  			/* Card change detected */
>> @@ -1760,10 +1764,6 @@ static void dw_mci_work_routine_card(struct work_struct *work)
>>  
>>  			spin_unlock_bh(&host->lock);
>>  
>> -			/* Power down slot (after spin_unlock, may sleep) */
>> -			if (present == 0 && host->pdata->setpower)
>> -				host->pdata->setpower(slot->id, 0);
>> -
>>  			present = dw_mci_get_cd(mmc);
>>  		}
>>  
>>
> 


  reply	other threads:[~2013-03-12 16:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12 10:43 [PATCH] mmc: dw_mmc: setpower on MMC_POWER_{UP,OFF} James Hogan
2013-03-12 11:26 ` Jaehoon Chung
2013-03-12 16:31   ` James Hogan [this message]
2013-03-13 14:20 ` Seungwon Jeon
2013-03-13 14:37   ` James Hogan
2013-03-14 10:34     ` Seungwon Jeon
2013-03-22 16:42 ` Chris Ball

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=513F5864.6090006@imgtec.com \
    --to=james.hogan@imgtec.com \
    --cc=cjb@laptop.org \
    --cc=jh80.chung@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=tgih.jun@samsung.com \
    /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