Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1202670ybz; Wed, 22 Apr 2020 15:48:05 -0700 (PDT) X-Google-Smtp-Source: APiQypJ6Co1wLBEsUBXTHCL8S4zjCtyPKPjYA+wmZyj4LjnDRze9DX6Dm2SmsPa/ry14vlKwI+SP X-Received: by 2002:a17:906:edb5:: with SMTP id sa21mr481705ejb.270.1587595685427; Wed, 22 Apr 2020 15:48:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587595685; cv=none; d=google.com; s=arc-20160816; b=sStAFPhclKbbjlaP1QBdk/9prPYBeQduJkOqYEnFt5Yh3vxQGljHlW7ztQ+T7wizc+ /86WkRy158LgzyjfLr+y4Efyc8L5b1ZcB7JgJq0YNgqLH0sa4spyw3jmXA7J8rbWMeCK cr5qq5vXn+wWTDJIv+VMOLhFHWGyRhwtgHydnvpZsFmZPR0aWBxbB4Mgzdp1R3iinHLN CBZg1Wn/t0unjR2WVMCMf+plQe9se8jcjlbjzVyqDTBP977OvfIF1aVYFbZj7hU+nGSp 3vq3IFJf1vT/UaEYrgE1SI88nYeGoMQWjoa73Ik8R+QaqnBHZqnMyempTuM1CDq8lnf3 5sFg== 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=pLTuQArcwiFXcG9uc7P3/tOH2806IqFHASRaBcIcsEY=; b=UTqAhs8S0ERFm+a8UaIEHf51mhrSDNgOyImmHS0RKWvH6EWQwljL+5RYxINqy6CZf0 oBsZAv/YOoc7ZBNb92zdcnujajCt7IiTkIjSnVi/yaBmmxhD4Mi8o8Iwg+xJLqnJtz4P 1ezBfRB6a4D1rH6z1wOVYArHyi6fCW0YKtA9A3EgQUjW+DnshclU3ybdJaew4DZ0hBtn rhUzGB1npz0z5LHtsuzonWT2DKZE4GhmqdXg4qghScZLjAPxdqL0z7psFujZ6AeJai0B xr9LV+3HLYMXsVFy0mdTlgtAxsmMp9z1ZosooQdhyE45XcfKVHEQSgFybpF9nRWkggcy jJWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BSbkpzms; 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 d10si255246edx.13.2020.04.22.15.47.41; Wed, 22 Apr 2020 15:48:05 -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=BSbkpzms; 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 S1726158AbgDVWqr (ORCPT + 99 others); Wed, 22 Apr 2020 18:46:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725779AbgDVWqq (ORCPT ); Wed, 22 Apr 2020 18:46:46 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ED0EC03C1A9 for ; Wed, 22 Apr 2020 15:46:46 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id a5so1572829pjh.2 for ; Wed, 22 Apr 2020 15:46:46 -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=pLTuQArcwiFXcG9uc7P3/tOH2806IqFHASRaBcIcsEY=; b=BSbkpzmsMrB61iVPWzBuW/+ZEnOUMyG61Cjfz/vz3GFTkoJosnfewYwwNytlJSg/r5 7urIvRN84RRm0goUbfxHHzHPdDP8mVksMX8xC3NIi85jZ0dxMD54ig+wXJWmGJ+PTddQ Y/1YKuKZgP6vEwWbBfuWIfhMmf8ZfOiwR0UJs= 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=pLTuQArcwiFXcG9uc7P3/tOH2806IqFHASRaBcIcsEY=; b=QBJJ0H2PRqys7PFgk/jozAQ1QuLxUK6wz7nxnGWtXiuEC6V30Zc44UcHQZRoOCiton 8/vPW6N1/ISxIRCghrShCJXO9nuUP24QyqFBgCHQVthcJOt8grO3OWmqMxohdTnLyMmm Zw28fnQ+qQ2x34RdOX/khxj+Fgz30dwq1AI2cjtvykJbGcNTijyhtosTpq5qUuPY9wyn TQ3shu/XJ5Xw4L6/f/zwtuM0/OFHjB1R4QBk8rvjPcNaOIRTJ03OpitKsbhtOn974KzJ W0J95vXjU3jIZx22hoijOOUA+a5f7kF0RQkDUPBifjMId/CGQYfC2264rEBu45Qgbm8v LkCQ== X-Gm-Message-State: AGi0PuYb/vEHwN8z2EyPa54DHFErzH9IwJV+10nLwpJS4Lu8oPTHWX0U H4vfn+VIP8TwlFhXiW8wwJwYvA== X-Received: by 2002:a17:90a:5aa7:: with SMTP id n36mr1056873pji.45.1587595606121; Wed, 22 Apr 2020 15:46:46 -0700 (PDT) Received: from localhost ([2620:15c:202:1:4fff:7a6b:a335:8fde]) by smtp.gmail.com with ESMTPSA id h11sm539650pfo.120.2020.04.22.15.46.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Apr 2020 15:46:45 -0700 (PDT) Date: Wed, 22 Apr 2020 15:46:43 -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 3/3] mmc: core: fix mmc_sdio_reinit_card fail issue Message-ID: <20200422224643.GI199755@google.com> References: <1586835611-13857-1-git-send-email-yong.mao@mediatek.com> <1586835611-13857-4-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-4-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 Yong, On Tue, Apr 14, 2020 at 11:40:11AM +0800, Yong Mao wrote: > From: yong mao > > If SDIO device is initialized by UHS mode, it will run with 1.8v power. > In this mode, mmc_go_idle may not make SDIO device go idle successfully > in some special SDIO device. And then it can't be re-initialized > successfully. > According to the logic in sdio_reset_comm and mmc_sdio_sw_reset, > invoking mmc_set_clock(host, host->f_min) before mmc_send_io_op_cond > can make this SDIO device back to right state. > The commit message isn't very concise. Suggestion for a better structure: mmc: core: reset clock to minimum speed during card reinit Some buggy (?) SDIO devices don't (consistently?) enter idle mode through mmc_go_idle() when running in UHS mode. [add rationale why setting the clock to minimum speed fixes this] Also the function sdio_reset_comm() mentioned in the commit message doesn't exist in recent kernels. And mmc_sdio_sw_reset() does not invoke mmc_send_io_op_cond(), as the commit message appears to claim. > 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 f173cad..dc4dc63 100644 > --- a/drivers/mmc/core/sdio.c > +++ b/drivers/mmc/core/sdio.c > @@ -850,6 +850,7 @@ static int mmc_sdio_reinit_card(struct mmc_host *host) > > sdio_reset(host); > mmc_go_idle(host); > + mmc_set_clock(host, host->f_min); mmc_sdio_sw_reset() - which is mentioned as reference in the commit message - sets the clock speed before sdio_reset(). Should this order be followed here too?