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: 8920261 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F3785BF29F for ; Sun, 24 Apr 2016 10:50:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A870201ED for ; Sun, 24 Apr 2016 10:50:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5754120122 for ; Sun, 24 Apr 2016 10:50:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1auHaN-0002hB-Py; Sun, 24 Apr 2016 10:48:19 +0000 Received: from mail-qg0-x243.google.com ([2607:f8b0:400d:c04::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1auHaH-0002HJ-8P for linux-arm-kernel@lists.infradead.org; Sun, 24 Apr 2016 10:48:17 +0000 Received: by mail-qg0-x243.google.com with SMTP id f74so11552127qge.3 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=hkbUN029caGzFJ6GgUgZgOYHZdW1CyjsPIpMn0wbyidgpktg8jSXbyHTrdMZtMlfVq NsmTOIsONfp+WB2V3s1kamlSYXAm+1Z5XRKFHcPCfOHxX9u1yAjWd4wSLN9ImqENV8Q8 zuRLYwKPddD2YdrOqCE5UBKMUGoKHgxTJqzMFfuxQCn9P8w7NAelbtGz9u1s++WCQ0Ch 996BnS2mriBqloQHWdZvkkEppcGAs4ljPY2a6+E1XascuQcXjyCMBS4Znlbz/jG8TXL5 DTgEz11WB/ZlXBjlGIcK7j7bGNFqfsM/OOMGTHLJ0NVXpQPUrRDrLfghzY2tElND31rI fMFg== X-Gm-Message-State: AOPr4FXWdANnIWIumbhO8apv8GWPyr38gxoS0jueJD9s0kuBWNJpRQu/E3mRcOMFjneTCPjwftan+uYKnS6rOA== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160424_034813_409156_A3A14275 X-CRM114-Status: GOOD ( 18.61 ) X-Spam-Score: -2.5 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , Ulf Hansson , "linux-mmc@vger.kernel.org" , Chris Ball , haibo.chen@nxp.com, Shawn Guo , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, 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); >> } >> >> > 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; }