Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3939802ybz; Mon, 20 Apr 2020 12:16:41 -0700 (PDT) X-Google-Smtp-Source: APiQypISJ+0e1kQ4vUSy54XSt/zQAKl5tTceECwb7fs5ToJfqcLkshpmbOR3tOAUrqYXNkTWd85t X-Received: by 2002:a17:906:809:: with SMTP id e9mr17070753ejd.81.1587410201287; Mon, 20 Apr 2020 12:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587410201; cv=none; d=google.com; s=arc-20160816; b=uCdgu8wA2dPYMnD91MzH6HByxzT6YYXTYPx4XoALOno+35f9wnxSa3nBYLq9bvA/1g xxuVDbm5xIs+9FasHlrmBWIK9cMDsJ5rgzrEAIcOxiQOQrBqak7TGJmmLkxUyXbz4ipr xUJDRt6QfJvqOSA6D5o2XNeSxku2skPzhiVqgIrJXRL+MjMFavwFpUoZIEAKRBC0llzy tr0hwd0fGuPjLm0hgaRObKHxXwpEAg2zn1LkOVxMsGuFwD/uR035uRS0eQuVV4hz3A/a i2KWPegb8V/iHzBiwPWtlLd91ZXCuCKqWQZwRRthAb92Zauvt/dtL8oWb4yx1Z7EYq7J gOLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=s4hrruIEfeHbnCer3L7xymo3BPcqZk1wOgCil6L4gXc=; b=dVCPcbIETajgCUex2tYa4UL/1IlYUDLnIgPRlUJkkzihIP0Sev0uaD3OkoDL/Yyem9 dXBsGtls5hKF/TQJAvh4ondwX56fWMmTrOe5JQUd3FaULYaA1FBjoVwStHdFyhGdT83u R9EqIXOxOC7bvcCgG1uodsXQs3IrIbrY2INq3n3QeEAieijn/GZdyJtetRziagxh/Cyb y8lafXtapVGt+6E14lCUEvbRKGoz0hZvqGMm3UR4kf9F06+PgJs6oAI21mZQYdcrYZOZ Fnf6H/5N9/bazwm2ZnQS4xzs/hLO2+Q2HPrs80nxr4FNKaXiMPcGMhGB3ZjV38IUPV4o RbXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jkUCF9b3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x30si224922edc.182.2020.04.20.12.16.18; Mon, 20 Apr 2020 12:16:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jkUCF9b3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728095AbgDTTPX (ORCPT + 99 others); Mon, 20 Apr 2020 15:15:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728072AbgDTTPW (ORCPT ); Mon, 20 Apr 2020 15:15:22 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5F07C061A0C for ; Mon, 20 Apr 2020 12:15:21 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id t11so5558015pgg.2 for ; Mon, 20 Apr 2020 12:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=s4hrruIEfeHbnCer3L7xymo3BPcqZk1wOgCil6L4gXc=; b=jkUCF9b3xkKwajGHRP14VA5YPuTR0uv9ThYOOWUiuSrrcX8fguG/qXV/ZrUEnsXGQ0 ve3D9RcEwHxcP8Rds85FUEIPAZPk/ZJ4MA3JL1eWCckkp9eUNXyoHxJAzOCLC0l7hJU4 tjDvPbpkU78tKvlJsgegIpmgqf0kxXn83VDBA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=s4hrruIEfeHbnCer3L7xymo3BPcqZk1wOgCil6L4gXc=; b=Etoi7EW+6ckBCK7OAc+0/LV8903pIdyDr1Td7jm9grESqhGrBqcwTJkZ1A5BrLCBN1 9jaUkccKl/2I7qIBC7WhCKcczGfRWvLDuACmm8T8yTfu5NiUWdq8rjW2gKuVsoQuHzIM HKb0EUna/VJAfQe8iWnWteJ3ssbXaEK/8UUqgVUv8wr9bi8IyS5D+dhYlbJIOQVSbUl6 aLT2qc3JDhdSi5hcVhLkrpEvd/OnHglUQKThIQFMKm5bYFE0hnv1UyFkjLYtAKnWHXaj 5c+19iSwj8YP00G+xozXvIR9umnjCASEfhWuf2Srwzasn7Y0yFksfTfoEKvi6XPfF2UB IYzQ== X-Gm-Message-State: AGi0PubQhfD7dHyhujqq9OZAwqpZbu4BQ+Y+tZxW98okseoTUkaFGgAA Thoy35erp8+aeLQADlLHL3gpXw== X-Received: by 2002:a63:d90c:: with SMTP id r12mr17745526pgg.158.1587410121447; Mon, 20 Apr 2020 12:15:21 -0700 (PDT) Received: from localhost ([2620:15c:202:1:4fff:7a6b:a335:8fde]) by smtp.gmail.com with ESMTPSA id l15sm96958pgk.59.2020.04.20.12.15.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Apr 2020 12:15:20 -0700 (PDT) Date: Mon, 20 Apr 2020 12:15:18 -0700 From: Matthias Kaehlcke To: Yong Mao Cc: Ulf Hansson , Chaotian Jing , Matthias Brugger , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, srv_heupstream@mediatek.com Subject: Re: [PATCH 1/3] mmc: core: need do mmc_power_cycle in mmc_sdio_resend_if_cond Message-ID: <20200420191518.GG199755@google.com> References: <1586835611-13857-1-git-send-email-yong.mao@mediatek.com> <1586835611-13857-2-git-send-email-yong.mao@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1586835611-13857-2-git-send-email-yong.mao@mediatek.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Apr 14, 2020 at 11:40:09AM +0800, Yong Mao wrote: > From: yong mao > > When mmc_sdio_resned_if_cond is invoked, it indicates the SDIO > device is not in the right state. In this condition, the previous > implementation of mmc_sdio_resend_if_cond can't make sure SDIO > device be back to idle state. mmc_power_cycle can reset the SDIO > device by HW and also make sure SDIO device enter to idle state > correctly. > > Signed-off-by: Yong Mao > --- > drivers/mmc/core/sdio.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c > index ebb387a..ada0a80 100644 > --- a/drivers/mmc/core/sdio.c > +++ b/drivers/mmc/core/sdio.c > @@ -546,6 +546,7 @@ static int mmc_sdio_init_uhs_card(struct mmc_card *card) > static void mmc_sdio_resend_if_cond(struct mmc_host *host, > struct mmc_card *card) > { > + mmc_power_cycle(host, host->card->ocr); My MMC/SDIO background is limited, but it seems this isn't needed for the vast majority of SDIO devices, otherwise it probably would have been added earlier. I wonder if it would make sense to make the power cycle conditional through a quirk, to limit it to the devices that need it. > sdio_reset(host); > mmc_go_idle(host); > mmc_send_if_cond(host, host->ocr_avail); > -- > 1.9.1