From patchwork Thu Jul 21 20:27:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Rakity X-Patchwork-Id: 997112 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6LKXDCc021829 for ; Thu, 21 Jul 2011 20:33:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753333Ab1GUUdN (ORCPT ); Thu, 21 Jul 2011 16:33:13 -0400 Received: from na3sys009aog124.obsmtp.com ([74.125.149.151]:43235 "EHLO na3sys009aog124.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752991Ab1GUUdM convert rfc822-to-8bit (ORCPT ); Thu, 21 Jul 2011 16:33:12 -0400 Received: from sc-owa02.marvell.com ([65.219.4.130]) (using TLSv1) by na3sys009aob124.postini.com ([74.125.148.12]) with SMTP ID DSNKTiiNATzhBnfBjsu+MbtTnA8kI7peFZ0O@postini.com; Thu, 21 Jul 2011 13:33:12 PDT Received: from SC-vEXCH3.marvell.com ([10.93.76.133]) by sc-owa02.marvell.com ([10.93.76.22]) with mapi; Thu, 21 Jul 2011 13:27:13 -0700 From: Philip Rakity To: Aaron Lu CC: zhangfei gao , "Nath, Arindam" , "subhashj@codeaurora.org" , Chris Ball , "linux-mmc@vger.kernel.org" Date: Thu, 21 Jul 2011 13:27:11 -0700 Subject: Re: [PATCH] mmc: sdhci: fix retuning timer wrongly deleted in sdhci_tasklet_finish Thread-Topic: [PATCH] mmc: sdhci: fix retuning timer wrongly deleted in sdhci_tasklet_finish Thread-Index: AcxH5JLgr43rxLpESq6WjUHfl4MiYw== Message-ID: <086235A9-1100-4ABB-9D4D-B2757382BF0B@marvell.com> References: <1310362031-8186-1-git-send-email-Aaron.Lu@amd.com> <6C03668EAF45B747AF947A1603D1B300018F85B9E0@SAUSEXMBP01.amd.com> <20110721052358.GA31584@lovegaga> <20110721100351.GA31886@lovegaga> In-Reply-To: <20110721100351.GA31886@lovegaga> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 21 Jul 2011 20:33:14 +0000 (UTC) Aaron, Code is fine. Do you want to also fix the problem with suspend or should I do the patch ? When we are suspending we should kill the tuning timer. Philip On Jul 21, 2011, at 3:03 AM, Aaron Lu wrote: > On Thu, Jul 21, 2011 at 05:35:02PM +0800, zhangfei gao wrote: >> >> Does the execute_tuning is called again? >> del_timer is not delete timer really, but deactivate the timer, which >> could be re-activated by mod_timer. >> So if execute_tuning is called, the mod_timer will tigger the tuning >> timer again. >> > > Hi zhangfei, > > Thanks for the comment. > > The execute_tuning will be called at two places: > 1 In mmc_sd_init_uhs_card, when host is initializing an UHS card, > and the re-tuning timer will be activated for the first time; > 2 When re-tuning timer expired > > So if the re-tuning timer is deactivated in sdhci_tasklet_finish, > execute_tuning will have no chance of getting called again, and the > host will not be able to do the re-tuning anymore. > >>>>> >>>>> Signed-off-by: Aaron Lu >>>>> --- >>>>> drivers/mmc/host/sdhci.c | 3 --- >>>>> 1 files changed, 0 insertions(+), 3 deletions(-) >>>>> >>>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c >>>>> index 91d9892..6250bac 100644 >>>>> --- a/drivers/mmc/host/sdhci.c >>>>> +++ b/drivers/mmc/host/sdhci.c >>>>> @@ -1863,9 +1863,6 @@ static void sdhci_tasklet_finish(unsigned long >>>>> param) >>>>> >>>>> del_timer(&host->timer); >>>>> >>>>> - if (host->version >= SDHCI_SPEC_300) >>>>> - del_timer(&host->tuning_timer); >>>>> - >>>>> mrq = host->mrq; >>>>> >>>>> /* >>>>> -- >>>>> 1.7.1 >>>> >>>> >>> >>> >> > --- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 4da6a4d..88c25e8 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2289,18 +2289,14 @@ int sdhci_suspend_host(struct sdhci_host *host, pm_message_t state) sdhci_disable_card_detection(host); - /* Disable tuning since we are suspending */ - if (host->version >= SDHCI_SPEC_300 && host->tuning_count && - host->tuning_mode == SDHCI_TUNING_MODE_1) { - host->flags &= ~SDHCI_NEEDS_RETUNING; - mod_timer(&host->tuning_timer, jiffies + - host->tuning_count * HZ); - } - ret = mmc_suspend_host(host->mmc); if (ret) return ret; + /* Disable tuning since we are suspending */ + if (host->version >= SDHCI_SPEC_300) + del_timer_sync(&host->tuning_timer); + free_irq(host->irq, host); if (host->vmmc)