From patchwork Sun Apr 24 10:47:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 8920251 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 507389F441 for ; Sun, 24 Apr 2016 10:48:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C346D20219 for ; Sun, 24 Apr 2016 10:47:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 072E4201ED for ; Sun, 24 Apr 2016 10:47:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752529AbcDXKry (ORCPT ); Sun, 24 Apr 2016 06:47:54 -0400 Received: from mail-qg0-f68.google.com ([209.85.192.68]:34737 "EHLO mail-qg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752462AbcDXKrx (ORCPT ); Sun, 24 Apr 2016 06:47:53 -0400 Received: by mail-qg0-f68.google.com with SMTP id d90so3531366qgd.1 for ; Sun, 24 Apr 2016 03:47:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=leG68X0hnTnnbGCgPST+uhSkbLB3/7foJkHxaSisI7k=; b=b+NR0lb72jZu0faPmGgv+RCgkn/j6mF6HlaY85W3C7/leYEqTNdXiOiH9oNrH8BUX8 eH1vgz3Z0jhl4qiz2xhixgw5D4P0sqqyhxvDWIzMq3BtLDxkPRY00/GGPWNSFlaEr4S1 CQsziq8Z2B109CDaAHcLooDj5hPjG2HkljP/Wx9wiWj7fKwRMXy5mMTDbSw4WekKweDp nmCveFam7/+thLNltUznSqvO3OTFGFLOdaLh9x/jw6Fz/kIXKIpjLeWdtqr+ijEMv8wK iJD8yatY2cOHjlmlU7GL0vSrLt4bK2giCRW8vP6p2wMwoyjAP3rH0+pAttDTbAfMbDrB dahg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=leG68X0hnTnnbGCgPST+uhSkbLB3/7foJkHxaSisI7k=; b=XsaRdtDJneuQX3UyUQR7GP1CVgftg9ESbVStY6BzxISGEtQ471igoN0MQp6S17SBC7 FZ3Z33K++qsy0zGFpkXQ5SvyrzeluDxbY5B4aqIRTM9+4eUI0Crg5kZ5CtjufGJ2g2id 5mrIA+Nxr1x7fSTJlvSJs6MLiw9mzrSYr4yj3gfGXm+YvbzdJnMNbVo1ZczKa7jOJvnA i+n9l/kg1TAa8huoZiZ8JQ34ResOvvnsQTHfbdpHxzkjALdj0A9ooJnuXzvqZMi0Hg63 SQ5/SOVuZgme0lhDerC1LBPhEiO0cHFc0X4JfQNkBznNZ1QH5K6ww4jvtuKwtfTPlJYn qe9w== X-Gm-Message-State: AOPr4FVMRihxUY1QxsDSs1UvqUoXTCfWjc6l0ROwqSO3THG8GB0CbI3828W1xJOvgnNxVoADvQZFKfv+TWed7Q== MIME-Version: 1.0 X-Received: by 10.140.98.175 with SMTP id o44mr29609997qge.46.1461494872178; Sun, 24 Apr 2016 03:47:52 -0700 (PDT) Received: by 10.140.105.245 with HTTP; Sun, 24 Apr 2016 03:47:52 -0700 (PDT) In-Reply-To: <571A1D85.3020200@intel.com> References: <1460741387-23815-1-git-send-email-aisheng.dong@nxp.com> <1460741387-23815-11-git-send-email-aisheng.dong@nxp.com> <571A1D85.3020200@intel.com> Date: Sun, 24 Apr 2016 18:47:52 +0800 Message-ID: Subject: Re: [PATCH 10/23] mmc: core: disable auto retune during card detection process From: Dong Aisheng To: Adrian Hunter Cc: Dong Aisheng , "linux-mmc@vger.kernel.org" , Ulf Hansson , Chris Ball , Shawn Guo , "linux-arm-kernel@lists.infradead.org" , haibo.chen@nxp.com Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Apr 22, 2016 at 8:48 PM, Adrian Hunter wrote: > On 15/04/16 20:29, Dong Aisheng wrote: >> During card detection process, mmc core may sends commands >> to detect if card is still exist in mmc_rescan for removable >> card which may trigger mmc retuning process after a bit time >> of runtime pm suspend. >> Obviously this retuning process is meaningless for card remove >> case, so we disable mmc_retune in mmc_detect_change() for it. >> For card insert case, the mmc_retune will be enabled normally >> in its card initialization process later in mmc_execute_tuning(). >> So disable it at first has no side effection. > > We don't assume that the card has been removed, which is why we send > commands to find out if it is still there. If it is still there, this > change will have incorrectly disabled re-tuning. > Do you mean the 'fake' card remove interrupt like caused by glitch? Yes, if that the card is still exist and re-tuning is wrongly disabled. So we could re-enable re-tuning for this special case? Something like: > Do you have an actual problem with the way it works now? > No actual problems now. I just observe a lot tuning commands keep sending although the card is already removed which seems a bit meaningless. And most tuning execution process is executed with sin_lock_irqsave, i'm not sure if the mass tuning commands may affect the system when CPU is busy. What do you think? Regards Dong Aisheng >> >> CC: stable >> Signed-off-by: Dong Aisheng >> --- >> drivers/mmc/core/core.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c >> index 52bfaf0..76d0802 100644 >> --- a/drivers/mmc/core/core.c >> +++ b/drivers/mmc/core/core.c >> @@ -1888,6 +1888,7 @@ static void _mmc_detect_change(struct mmc_host *host, unsigned long delay, >> pm_wakeup_event(mmc_dev(host), 5000); >> >> host->detect_change = 1; >> + mmc_retune_disable(host); >> mmc_schedule_delayed_work(&host->detect, delay); >> } >> >> > --- 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/core/core.c b/drivers/mmc/core/core.c index 41b1e76..e1990a8 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2607,6 +2607,8 @@ void mmc_rescan(struct work_struct *work) /* if there still is a card present, stop here */ if (host->bus_ops != NULL) { + if (tuning_is_enabled_before()) + mmc_retune_enable(host); mmc_bus_put(host); goto out; }