From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ohad Ben-Cohen Subject: Re: [PATCH v2] sdio: skip initialization on powered resume Date: Tue, 25 Jan 2011 09:11:46 +0200 Message-ID: References: <1283391692-14150-1-git-send-email-bzhao@marvell.com> <477F20668A386D41ADCC57781B1F704307D2F41B27@SC-VEXCH1.marvell.com> <477F20668A386D41ADCC57781B1F704307D2FE4A0F@SC-VEXCH1.marvell.com> <477F20668A386D41ADCC57781B1F704307D2FE4A52@SC-VEXCH1.marvell.com> <1284459351.2359.17.camel@stummala-linux.in.qualcomm.com> <477F20668A386D41ADCC57781B1F704307D30738F5@SC-VEXCH1.marvell.com> <477F20668A386D41ADCC57781B1F704307F4EA2BA9@SC-VEXCH1.marvell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from mail-yx0-f174.google.com ([209.85.213.174]:42509 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751355Ab1AYHMH (ORCPT ); Tue, 25 Jan 2011 02:12:07 -0500 Received: by yxt3 with SMTP id 3so1590240yxt.19 for ; Mon, 24 Jan 2011 23:12:06 -0800 (PST) In-Reply-To: Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: zhangfei gao Cc: Bing Zhao , Nicolas Pitre , Sahitya Tummala , "linux-mmc@vger.kernel.org" , Michal Miroslaw , Chris Ball , Andrew Morton , Maxim Levitsky , Jun Nie Hello Zhangfei, On Tue, Jan 25, 2011 at 5:10 AM, zhangfei gao wrote: > Could we remove mmc_card_is_removable(host) condition, the skip is not > related with whether card is removable or not, do you think so? But, as Nicolas pointed out before, what if the card is removed (or replaced) while the system was suspended ? It seems that this won't be detected, and your driver, once resumed, will assume the card is still in place and will just fail. Are you ok with it ? Can you please explain what's required to wake up mrvl8787 from this deep sleep ? One thing we can do is letting drivers register a wake-up function within the SDIO core, just before suspending. Then, upon resume, if such a wake-up function was registered, SDIO core would invoke it just before it tries to read the CIS. This way your card stays in deep sleep while the system is suspended, and when the system wakes up, SDIO core has a chance to make sure the card was not removed/replaced. If the card is replaced, the wake-up function will probably just fail, and then SDIO core will have to reinitialize that new card. I'm not sure that's ideal, but those errors would happen anyway if we just skip the reinitialization and let the driver assume the card wasn't replaced. What do you think ? Would that work for you ? Btw we have the same thing with the wl1271. Since it's mostly nonremovable, we're ok with 3cfc33a, but that may change. Thanks, Ohad.