Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752446AbaKKIwv (ORCPT ); Tue, 11 Nov 2014 03:52:51 -0500 Received: from mail-qc0-f181.google.com ([209.85.216.181]:46760 "EHLO mail-qc0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752124AbaKKIws (ORCPT ); Tue, 11 Nov 2014 03:52:48 -0500 MIME-Version: 1.0 In-Reply-To: <1415678573-6093-1-git-send-email-addy.ke@rock-chips.com> References: <1415109789-7046-1-git-send-email-addy.ke@rock-chips.com> <1415678573-6093-1-git-send-email-addy.ke@rock-chips.com> Date: Tue, 11 Nov 2014 09:52:47 +0100 Message-ID: Subject: Re: [PATCH] mmc: dw_mmc: try pick the exact same voltage as vmmc for vqmmc From: Ulf Hansson To: Addy Ke Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Randy Dunlap , "tgih.jun@samsung.com" , Jaehoon Chung , Chris Ball , Dinh Nguyen , =?UTF-8?Q?Heiko_St=C3=BCbner?= , Olof Johansson , Doug Anderson , Sonny Rao , amstan@chromium.org, "devicetree@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linux-mmc , "linux-arm-kernel@lists.infradead.org" , linux-rockchip@lists.infradead.org, "zhenfu.fang" , Eddie Cai , lintao , chenfen , zyf , Jianqun Xu , Tao Huang , Chris Zhong , =?UTF-8?B?5aea5pm65oOF?= , han jiang , Kever Yang , zhangqing , Lin Huang Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11 November 2014 05:02, Addy Ke wrote: > SD2.0 cards need vqmmc and vmmc to be the same. No, that's not correct. If I remember the spec correctly, the bus signal threshold is 0.75 * VDD. > But vqmmc call regulator_set_voltage to set min_uv(2.7v) as far as possible. I guess you want to do that to save as much power as possible. > So if we set vmmc 3.3V in dt table, we will get error information as follows: > > [ 17.785398] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req > 50000000Hz, actual 50000000HZ div = 0) > [ 17.795175] mmc1: new high speed SDHC card at address e624 > [ 17.801283] mmcblk1: mmc1:e624 SU08G 7.40 GiB > [ 17.816033] mmcblk1: p1 > [ 17.839318] mmcblk1: error -110 sending status command, retrying > [ 17.845363] mmcblk1: error -115 sending stop command, original cmd > response 0x900, card status 0x800b00 > [ 17.854758] mmcblk1: error -84 transferring data, sector 32, nr 24, > cmd response 0x900, card status 0xb00 > [ 17.864328] mmcblk1: retrying using single block read > [ 17.873647] mmcblk1: error -110 sending status command, retrying > [ 17.879660] mmcblk1: error -84 transferring data, sector 44, nr 12, > cmd response 0x900, card status 0x0 > [ 17.889051] end_request: I/O error, dev mmcblk1, sector 44 > [ 17.895594] Buffer I/O error on device mmcblk1, logical block 5 > [ 17.902484] mmcblk1: error -110 sending status command, retrying > [ 17.908498] mmcblk1: error -84 transferring data, sector 50, nr 6, > cmd response 0x900, card status 0x0 > [ 17.917802] end_request: I/O error, dev mmcblk1, sector 50 > [ 17.924984] Buffer I/O error on device mmcblk1, logical block 6 > [ 18.431258] mmc_host mmc1: Timeout sending command (cmd 0x200000 arg > 0x0 status 0x80200000) > > Signed-off-by: Addy Ke > --- > drivers/mmc/host/dw_mmc.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c > index b4c3044..a8b70b5 100644 > --- a/drivers/mmc/host/dw_mmc.c > +++ b/drivers/mmc/host/dw_mmc.c > @@ -1163,8 +1163,14 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios) > */ > uhs = mci_readl(host, UHS_REG); > if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330) { > - min_uv = 2700000; > - max_uv = 3600000; > + /* try pick the exact same voltage as vmmc for vqmmc */ This seems like a generic SD protocol issue. Should we maybe provide some helper function from the mmc core, which in principle take the negotiated card->ocr into account while calculating the signal voltage level. Typically min_uv should be 0.75 x (card->ocr), for these cases. Comments? > + if (!IS_ERR(mmc->supply.vmmc)) { > + min_uv = regulator_get_voltage(mmc->supply.vmmc); > + max_uv = min_uv; > + } else { > + min_uv = 2700000; > + max_uv = 3600000; > + } > uhs &= ~v18; > } else { > min_uv = 1700000; > -- > 1.8.3.2 > > Kind regards Uffe -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/