Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752494AbdIVOJm (ORCPT ); Fri, 22 Sep 2017 10:09:42 -0400 Received: from mx0b-00010702.pphosted.com ([148.163.158.57]:58397 "EHLO mx0b-00010702.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751882AbdIVOJh (ORCPT ); Fri, 22 Sep 2017 10:09:37 -0400 X-Greylist: delayed 746 seconds by postgrey-1.27 at vger.kernel.org; Fri, 22 Sep 2017 10:09:37 EDT Date: Fri, 22 Sep 2017 08:57:04 -0500 From: Kyle Roeschley To: Ulf Hansson Cc: "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] mmc: core: Wait for Vdd to settle on card power off Message-ID: <20170922135704.4s7um4xflv634c3h@senary> References: <20170921174754.13648-1-kyle.roeschley@ni.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) X-Originating-IP: [130.164.62.227] X-ClientProxiedBy: DM5PR21CA0065.namprd21.prod.outlook.com (10.175.112.155) To CY1PR04MB2283.namprd04.prod.outlook.com (10.167.9.10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6020cbbe-e26c-4f85-bb22-08d501c1d0a1 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY1PR04MB2283; X-Microsoft-Exchange-Diagnostics: 1;CY1PR04MB2283;3:VTzmu2KexvkNt/5cHUFVedYjdBUA4Ae3/MxVdQc5EGf46HLk427U+MHm3DBp61SllmGR6Hjc47M+p4MtuCQ/zh82xWRMGarWfbXoOldoPB3HP/kKyX3K0YwH/oxf7Chdr1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Gv714IQgkGPu/rv/Ke7+addR0Ath3rQyLNoNqK7++cTbbVmijpr/t4LimwMExCBPlivmVb2xH652Akli2y7xtVrwhK0+mPqJYh4YG6gDeYPUpyUhDwt0V86zyR2suOIJlH8XOvameB16SK7PsxgBXObfnWbs1I6/NRR7G8Mo9PKLMoXVOnXGilUB0S6EVGJAz8L3qFY7Eenu7Hx4AN9ya9VkuMRPaJz0xZ8YdzBTW1c0inpqyKTOAU45b6YXjhIWxK7J8KIhM36pzKR1VfFRJP0CguU4aphL0rs1XPXcLVmkGQBun0=;4:D4PuNT6fYQBCwaK0yRVYfHomU6y3Qxwh7lbT+ujlQqnf8ZSc82zxgMxnYzIQQd+WkElDdb+ycPiPpmIixhni3agvpxHDsIDRVi6n31Svrebn6mzfK/cpGryZY4DHRG9zjkcw/POTYhvI2W/zIjCGkBv+FbcPmPO8Dd5QnVvxWM2AZq36051bqf89VB/g59KgjWOmtKPDBKQtnpAcpk/I49oASjh/dhTLq89Y3wGtElTRD1qSKGQt9LEwFIyyaXh4nDT+mFrPaXX0Ov+Rqvp1YEWhRG0kHBpBHSsXecSHPQk= X-Exchange-Antispam-Report-Test: UriScan:(145744241990776); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6041248)(20161123560025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR04MB2283;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR04MB2283; X-Forefront-PRVS: 0438F90F17 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(346002)(376002)(24454002)(199003)(189002)(55016002)(3846002)(1076002)(23726003)(9686003)(4326008)(6246003)(86362001)(2906002)(6116002)(6496005)(53936002)(6666003)(33646002)(66066001)(229853002)(25786009)(68736007)(47776003)(7736002)(305945005)(478600001)(97736004)(101416001)(54356999)(50986999)(76176999)(2950100002)(8936002)(33716001)(106356001)(105586002)(50466002)(81166006)(8676002)(53546010)(16526017)(316002)(58126008)(81156014)(189998001)(16586007)(83506001)(6916009)(54906003)(5660300001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR04MB2283;H:senary;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR04MB2283;23:9IZb6o+Yp57DEnqBl6+Qs7IkoFOewxSsf0lAfMEZr?= =?us-ascii?Q?lIkBb0rjSxiUe6gT4oW/tsDFTwfosAWIPb61sQ5Ky8V08mbmCK56oE2gO/KQ?= =?us-ascii?Q?NO+zuScPD9H/ly1Vuctxn9kR7uuKKPWlwAZsL7kR136AtCYBhyQVMDQgp7BW?= =?us-ascii?Q?mxna5gZ1KaphWovzwvbJLbNSv1o1L7VoXQ9oi0Dgwclm4qkj6VRC4YnWCxvQ?= =?us-ascii?Q?brGwAv9jnK+MtLPfsLxrZB24abyu3wIS6KBx6/Gu0f+lMooqhNKDe3nTc/qQ?= =?us-ascii?Q?/BjxN8OcRpJMDHpH8jKQbKwzjUldkrdzagGIrjzwEhw5LBywZL7O7R/oi7uW?= =?us-ascii?Q?UGDxNXACWAR9TwKX1QEbkuIr3YhINgi0tFqj03XphBaggKM8wEVPzKrr3mez?= =?us-ascii?Q?jwBJRKXPpkzhsE5OUsIuLCerPWqyxRvakQKXDe1upcz3We6+1UA1KPVPWO+I?= =?us-ascii?Q?eezndI24gc8gdOKz0uWLmJRBX8v6dhE3jug9h1m+gM/gvwgaEItGXu/4HdGd?= =?us-ascii?Q?+EE3mOHRCpmL915gRT5O0G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2vGr/RrsQIb+81mI0KMCdKofdJJ9UbMUFj7lGcl8nFLpVDWNpkf8DVt79ZkoEJhjUJPYEARjTkSMILdMDQjjC67SXD6++2ZirrgYZojyOOZC1C45VlJZzR0wV7e+EMg==;5:0NVucIr9mj6yfE0UTTeafpQNBKluEwz6i7slzKkqxrJ0d6Viln6otzCY/f7G9dCz2usb2f+dez/jHpZPsuqkN326bB00zxXyYZDrKuNELosP5XbEp05VVGyZlqI2hHqz2gPsqEtvBoqJQhA/6LUc7g==;24:EEY3C7ELmPl546ix54vrGvlpR3J/a4lqON3DCLTcTjqjspLkOeR+R9NUlpOG1W80j5WO2ycJOJ7RHa3rS/mWH653PQNWFaPSTCYlZ7dTfQY=;7:CxFBh1y3pSJ6v5QIbRma92UvQmP/TtLQ2nGUjeCVLKtrcs6S6KWgpvHjG/I7DCGgjIM/bTepnBjHcXorv9zCobpE06g/achS8YHfLPY3s+/5HkVL1mMNus+WUrXL3Bh2hIo/Dql/F4IiiL5p7ZGPzCQNEYIP+q3voyMdi/8qfECK9BdhIci1dDbrBNl79RmdZhAhrjP7mzHqNgAxL19G+57v9SoY3LAHH204Sf8jWRU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ni.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2017 13:57:08.1494 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 87ba1f9a-44cd-43a6-b008-6fdb45a5204e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR04MB2283 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-09-22_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_policy_notspam policy=outbound_policy score=30 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=30 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709220196 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1837 Lines: 44 On Fri, Sep 22, 2017 at 11:38:40AM +0200, Ulf Hansson wrote: > On 21 September 2017 at 19:47, Kyle Roeschley wrote: > > The SD spec version 6.0 section 6.4.1.5 requires that Vdd must be > > lowered to less than 0.5V for a minimum of 1 ms when powering off a > > card. Increase our wait to 10 ms so that voltage has time to drain down > > to 0.5V and cards can power off correctly. > > > > Signed-off-by: Kyle Roeschley > > --- > > drivers/mmc/core/core.c | 10 ++++------ > > 1 file changed, 4 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c > > index 66c9cf49ad2f..38630246de26 100644 > > --- a/drivers/mmc/core/core.c > > +++ b/drivers/mmc/core/core.c > > @@ -1679,18 +1679,16 @@ void mmc_power_off(struct mmc_host *host) > > mmc_set_initial_state(host); > > > > /* > > - * Some configurations, such as the 802.11 SDIO card in the OLPC > > - * XO-1.5, require a short delay after poweroff before the card > > - * can be successfully turned on again. > > + * The SD spec requires at least 1 ms with Vdd at less than 0.5 V > > + * before a card can be re-powered, but we need to wait longer so that > > + * the voltage has time to drain. > > */ > > - mmc_delay(1); > > + mmc_delay(10); > > No, this isn't the proper place of adding more "magic" delays. > > Instead, make sure the related ->set_ios() callback in the mmc host > driver deals with this instead. In case it uses an external regulator, > via the regulator API, then this is something that should be > controlled with the definition of the regulator. > Thanks for pointing me in the right direction, I'll reimplement the fix there. -- Kyle Roeschley Software Engineer National Instruments