Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp57139lqf; Thu, 25 Apr 2024 22:08:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXNJzTpZ3qGhG32PRu9dVcuJGTaoT2q3ACW7yg6digLg/5Vq6QnNuz/SzkolZ/4SLC23rFOMgSXFo/vANhYVTA4R4RMBSASpolQlAfdNA== X-Google-Smtp-Source: AGHT+IFcRjxAH3dVGSP2jIkiDcMh2AWUWsxZViANrGM6xC4uPARVExjcAns5pgPPrppb2DBgrSXt X-Received: by 2002:a05:6214:23ca:b0:6a0:54da:b7ca with SMTP id hr10-20020a05621423ca00b006a054dab7camr1745181qvb.36.1714108137305; Thu, 25 Apr 2024 22:08:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714108137; cv=pass; d=google.com; s=arc-20160816; b=0ybTHvfyf0Q88prktoO+hgRNaQTqd2kBadPYHTmvUhG+pQqRCT2SDNPuAD9uM4rAMM W4pufFJsA/gSAUn9EICgkb8D+k5zCizMv0/+iTGgQc1JRN7S/nxsR97pnPRejesf/GeQ oKHJmPgitF+tMqPSUA7YXmh8Q0yYlF8HFws9YO8bSt0zRCdNXN4RfIisFYzy58Vi0rcz MjIJ0hnnDVWSv3d7JH154d3IY0cCVEam/O7VlcNnFX39MnUQ0eujZmiJkH9oJD3Vj7jf Hd/z8jb0adUAfEhnxicfcCR7neGWTzR/aNfnZz08i3rF/k0i340LSoDe2VgdQ7VwcMj0 Q7Vg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=q9qYK6scXFU3hWFQO57QP2e7QzwrtzpT92BwSQPl/Ws=; fh=MkQ95DG34M+fM3YtQNWl/Lo8BaDUNdLPsuBW3/0oUv8=; b=LB3KS4ZmMzE6382PAtWjQDvqTJ1GIlam3hP2XVh4wtfiy4UMTSqQ408dkgmq+OWxxo Kysg3d75entKxm9V+qv5ozdhLZ35sCbY9H50HxVDgLFLNJ7PMYjL/L2GMMqYF9KcETet 4K72NERyVLD94UTc6i468sMe65AFVZ8vwF1zl8QYGzmNpNq2f+Esj6iLsjWRNRBjZhe+ XK+DL4PbjxNIzT1cD5h3WLJ0HxVUXXQVuz4apdKl5fvMsu8oph4S6sWibn+90+x88qFo RiNMBWXITl18QglUSRAAeBXdnQRJFnPgLCrez24VcWAIU8T18pMDCLqi8XNZ+zYZLxqI 5FVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=chK9Rx4C; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-159519-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159519-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ey1-20020a0562140b6100b0069b2c78a82asi19232093qvb.355.2024.04.25.22.08.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 22:08:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159519-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=chK9Rx4C; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-159519-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159519-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 103FB1C22CE3 for ; Fri, 26 Apr 2024 05:08:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97A9A13A268; Fri, 26 Apr 2024 05:08:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="chK9Rx4C" Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A2E2139D18 for ; Fri, 26 Apr 2024 05:08:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714108129; cv=none; b=OTIwDYBSIRLNtbk3f6tJG3eIEtSYOjsZnDNDwcQNEUiKFr8gSzA0I5qQbmOguMu1oBG1iPwurBUTrvuobdFvghhP1zrMRJ7oLP1yFkkNQ+Dn3vZkj/AOB+klWz2U32Y6jVU3Wi5Q56YV0g4BM53p3z1YLeYAEcyyu5g/OrS4jRo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714108129; c=relaxed/simple; bh=1LBhiAAzsix5kBJ7XstPViIgPB3xqpoWGEuihbF6h80=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ZwA9nAYVUKIOvbOL8HiMxK5foKn5Cisc+lTAcEH2pAFeCZWJssl+1c2zIFI14Eph5h13qx0HCnToGte5kyNrKzT/oxblSZzufbIS+8ODSMdDwDuzS5uxnisyJktCMDBLTNtHW5bwaSnhFsPb7O97fBPzF8RLkgwUTT/WS5F5fs8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=chK9Rx4C; arc=none smtp.client-ip=209.85.219.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f173.google.com with SMTP id 3f1490d57ef6-de54b28c3b7so1975295276.1 for ; Thu, 25 Apr 2024 22:08:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714108127; x=1714712927; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=q9qYK6scXFU3hWFQO57QP2e7QzwrtzpT92BwSQPl/Ws=; b=chK9Rx4CmSO4WB1nmYQwDfCdxOIaxwLzFuaC+HA1lYR2aNZiNMdp4Ql+tYUEsBfs8V 2GpH4pe3envr6cD9PuDnQJAJtDwhaENtuWpkhm6bEXxX3mTVuLi/o2H0x7mlEDooJK4A BzAyd4EcMbS5/bZpiAQavopDUc/AXHqM/S4lisFU/thGEEg9ZDTSLpOC1L2WXEh2dz8v 17D+CtssRtq8hR8Y7QfWuLKuJlws9I6bW0rYGTpr+8AnD9LhBq+isyU6MxrGgEX8Ze7A 82iIrWnQIWCCh+DAGuSNlJBRT7tldnwPc1gC+MLjDxm7kfAg+s1StF0Lb/BzwozCMBQX 5Oeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714108127; x=1714712927; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=q9qYK6scXFU3hWFQO57QP2e7QzwrtzpT92BwSQPl/Ws=; b=u1i5tDsd1K2njHTx3iTewu++tG9fuphHbjnH+RA/ZwE8Sr1Ss9gdX67JiVKKPM1I+v m6zT/4j/gxo+BsFEORKkYA3JpCbu+qwVdgZlRPO1d1FZnElUWomBqzmSMyY+JNj6wcVV WohVX9/nNxpqOpEV+SC7k7h7M4Aclj34gJKcjxqJuRQhAiqzs3VD47veA/sFt80IaOgQ UtRsRCGZKvTs2U6eFYa2ICxNz7oZdHjA1APKczK8aEqFQ8IYK0pd2KfwXk6QVUW7f1Hy T5UgLHJrpxMmrMQME5fvTeNx5JP9N0oS9/IEJ4NexUA1e43Sewp5bZmwFpkuh0hjMPSl kSBg== X-Forwarded-Encrypted: i=1; AJvYcCVHyAy+l9RDYVwzXyp6prhYXYFl/ScttIn67r3KaAg0+GryOFl7EuV9OpdQVGSXzUdVD3yYw0RsOk3CPDtMtpUq+RgyNsqywe8WBbMP X-Gm-Message-State: AOJu0YyIhceM6KFtwfx2QSJXklh7cReJ+SuA3x3a0sBcQh7to4Vgp/aR W/YgEvpgdsPctJ4Yy+P2ngnQFTYsp83+Dmt5/N4JC7onytBKp7MTLf7HckT1d356OjTYfNmXPUs Kzn5O4+ClkFgszIeoabjjIgi6X1f5x2uM/n4zIQ== X-Received: by 2002:a05:6902:2303:b0:dda:c5ca:c21b with SMTP id do3-20020a056902230300b00ddac5cac21bmr1953339ybb.37.1714108127133; Thu, 25 Apr 2024 22:08:47 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240410135416.2139173-1-claudiu.beznea.uj@bp.renesas.com> In-Reply-To: <20240410135416.2139173-1-claudiu.beznea.uj@bp.renesas.com> From: Ulf Hansson Date: Fri, 26 Apr 2024 07:08:10 +0200 Message-ID: Subject: Re: [PATCH v2] mmc: renesas_sdhi: Set the SDBUF after reset To: wsa+renesas@sang-engineering.com Cc: Claudiu Beznea , linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Claudiu Beznea , Hien Huynh Content-Type: text/plain; charset="UTF-8" On Wed, 10 Apr 2024 at 15:54, Claudiu Beznea wrote: > > For development purpose, renesas_sdhi_probe() could be called w/ > dma_ops = NULL to force the usage of PIO mode. In this case the > renesas_sdhi_enable_dma() will not be called before transferring data. > > If renesas_sdhi_enable_dma() is not called, renesas_sdhi_clk_enable() > call from renesas_sdhi_probe() will configure SDBUF by calling the > renesas_sdhi_sdbuf_width() function, but then SDBUF will be reset in > tmio_mmc_host_probe() when calling tmio_mmc_reset() though host->reset(). > If SDBUF is zero the data transfer will not work in PIO mode for RZ/G3S. > > To fix this call again the renesas_sdhi_sdbuf_width(host, 16) in > renesas_sdhi_reset(). The call of renesas_sdhi_sdbuf_width() was not > removed from renesas_sdhi_clk_enable() as the host->reset() is optional. > > Co-developed-by: Hien Huynh > Signed-off-by: Hien Huynh > Signed-off-by: Claudiu Beznea Wolfram, when you have the time, can we get your opinion on this one? Kind regards Uffe > --- > > Changes in v2: > - fixed typos in commit description > - limit the comment lines to 80 chars > > drivers/mmc/host/renesas_sdhi_core.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c > index f84f60139bcf..5233731a94c4 100644 > --- a/drivers/mmc/host/renesas_sdhi_core.c > +++ b/drivers/mmc/host/renesas_sdhi_core.c > @@ -589,6 +589,12 @@ static void renesas_sdhi_reset(struct tmio_mmc_host *host, bool preserve) > sd_ctrl_write16(host, CTL_RESET_SD, 0x0001); > priv->needs_adjust_hs400 = false; > renesas_sdhi_set_clock(host, host->clk_cache); > + > + /* > + * In case the controller works in PIO mode the SDBUF > + * needs to be set as its reset value is zero. > + */ > + renesas_sdhi_sdbuf_width(host, 16); > } else if (priv->scc_ctl) { > renesas_sdhi_scc_reset(host, priv); > } > -- > 2.39.2 >