Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1676655lql; Wed, 13 Mar 2024 05:24:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW5NTcrMZPv4aFLfnYXBTETl+gmkbsJtyPjLRVjp00EOpgvOE2Q5hAwFolF4RLMROIR2de2PiwMVDtH2PelaojBGi+ogT9cKRVN08cQtg== X-Google-Smtp-Source: AGHT+IGBwXkW2yRrStt124NT0+KVET1ga4cIVfj5MmeIQywX4bKBuHfDaSVzE4YLR54sw4zkSUmQ X-Received: by 2002:a67:ce86:0:b0:474:d24c:4e50 with SMTP id c6-20020a67ce86000000b00474d24c4e50mr1201975vse.31.1710332664512; Wed, 13 Mar 2024 05:24:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710332664; cv=pass; d=google.com; s=arc-20160816; b=HyFjGE7QcUtzb3IZusdA0r40j5JIy4yfx3g/JmraVWsJ3lE0v4eKWBkiJYUFG/UqhQ fL7ZhuYNicW9gAbQnGqR0UNor9ln/+kXMzI23oRI4ZDVjniTzC9hpUZf46BG5v0b+f6J LhM7BXPm0JE0QPTwsjCObi9OcWPE077vauINUoVsk3h2fECQDSn1RsbNI2LYylY65jPK Es0j1RaSBqhlalc+V9N7D1UdTeyLZSq5gwCtxjhO63de/Po2pXCtn4IqlBxABEWbEg0W FKcrYPEUHjrhZnuTO3ZgKCqU72yaMJEFKGg0qHo5J4DQp5lc3J2gX43Z5ErkRPxNHKUe Jq+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=PGLOejyxEY5x8VBjBv/FeyGdyoVBLAvP2ekG/zEobxU=; fh=cx6BjC/vx4Pz8y1/nDQxSL7WD0/Goy3FtzpGOqby8lM=; b=iBLxzyeHeMZY61ClhXpqBsNNU/txYOwx4WzgC+zS++eQskelIfDHpyEeHGvcwe7pd7 vPmEZwtc+64YBya7kOPBdiHOM4vCa1GpU4uhbCGu7hCn1cfy2p86tUk6ImBSa1er76iA y1xJJI8eG6fihyS8aT/324TuZgVVB9wQK+6GsTgzo7Y4QpowcPTPQHSZvWsICej0Hers wPLnOsghHW9gGgf9+y+2lJ9kduWqXFMyPAJtmu/zYQJ6U6NSqL1XHz9GUwLQ6DBHx+hq FumzeD8R9DEq+sOjr5LVPTWg8j8eRfyZUHPYC0jYYIlHkRsUaOXn2PKeuhjS4IPTJlSW 1Zdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=omp.ru); spf=pass (google.com: domain of linux-kernel+bounces-101469-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101469-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q14-20020ad45cae000000b0068f08ce8109si1846647qvh.505.2024.03.13.05.24.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 05:24:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101469-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=omp.ru); spf=pass (google.com: domain of linux-kernel+bounces-101469-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101469-linux.lists.archive=gmail.com@vger.kernel.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 3FAE41C22D74 for ; Wed, 13 Mar 2024 12:24:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DCE640876; Wed, 13 Mar 2024 12:24:17 +0000 (UTC) Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41D41405C7; Wed, 13 Mar 2024 12:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.154.21.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710332656; cv=none; b=shvrWTKUnyujsDod9/rC68odFcmFpStNGuZ7IdUBG+MKUhGU63tM2jYitlBdxUFAxKneEz09eYppTL5YHVExKPeIMtyycAg8S3kpjpMMCB2YVitMAkpuzrxt6Oc2/oqWJ+A77fzwaeKWdnlYrLLinkbRdYlHBih1qHd9jyFgmCk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710332656; c=relaxed/simple; bh=UB194HPAOJmXMdgVrMLFtgZP0VnC6jdQpYcJ0atxqNo=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=Iq9H36tfK4QxDwbCXepjnMIxOWaHX6DXSth8OPeW7rzbyCy06ZF9lp7yavGxeyx4hbAcUGBtRMl57ZGw8SjdFKS5Ol9ZPk2lYxI0/lr/iVeNbpF0NyHsW3QpBMjSO1XIOroEbtb3XskRCz+R3bLs8Nh6WKd5zOS/tkT1kAkumbQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru; spf=pass smtp.mailfrom=omp.ru; arc=none smtp.client-ip=90.154.21.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=omp.ru Received: from [192.168.1.105] (178.176.75.2) by msexch01.omp.ru (10.188.4.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1258.12; Wed, 13 Mar 2024 15:23:54 +0300 Subject: Re: [PATCH] mmc: renesas_sdhi: Set the SDBUF after reset To: Claudiu , , CC: , , , Claudiu Beznea , Hien Huynh References: <20240313093031.3507979-1-claudiu.beznea.uj@bp.renesas.com> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: <53b9d9f7-921d-3a0a-5a1c-e18e6fd1dcf6@omp.ru> Date: Wed, 13 Mar 2024 15:23:54 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20240313093031.3507979-1-claudiu.beznea.uj@bp.renesas.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: msexch01.omp.ru (10.188.4.12) To msexch01.omp.ru (10.188.4.12) X-KSE-ServerInfo: msexch01.omp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 6.1.0, Database issued on: 03/13/2024 12:08:02 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 59 X-KSE-AntiSpam-Info: Lua profiles 184133 [Mar 13 2024] X-KSE-AntiSpam-Info: Version: 6.1.0.4 X-KSE-AntiSpam-Info: Envelope from: s.shtylyov@omp.ru X-KSE-AntiSpam-Info: LuaCore: 10 0.3.10 53c821b925e16276b831986eabc71d60ab82ee60 X-KSE-AntiSpam-Info: {rep_avail} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: {relay has no DNS name} X-KSE-AntiSpam-Info: {SMTP from is not routable} X-KSE-AntiSpam-Info: {Found in DNSBL: 178.176.75.2 in (user) b.barracudacentral.org} X-KSE-AntiSpam-Info: omp.ru:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;178.176.75.2:7.1.2 X-KSE-AntiSpam-Info: ApMailHostAddress: 178.176.75.2 X-KSE-AntiSpam-Info: {DNS response errors} X-KSE-AntiSpam-Info: Rate: 59 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror smtp.mailfrom=omp.ru;dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 03/13/2024 12:12:00 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 3/13/2024 9:16:00 AM X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit On 3/13/24 12:30 PM, Claudiu wrote: > From: Claudiu Beznea > > 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 reseted in s/reseted/reset/. > 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 Semicolon clearly doesn't fit here... > 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 [...] > diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c > index c675dec587ef..b51e04fa5445 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 Well, it won't hurt wrapping the comment at 80 columns here... > + * reset value is zero. > + */ > + renesas_sdhi_sdbuf_width(host, 16); > } else if (priv->scc_ctl) { > renesas_sdhi_scc_reset(host, priv); > } MBR, Sergey