From patchwork Mon Jun 10 01:12:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 802966 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1735477wro; Sun, 9 Jun 2024 18:18:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUETr9ir+b0dmI5lAvtxhB0lzcBAZhU5xoRj5X8VCerMr5K5c+lxhHF3Zynjh43IQWKYrEaU77JeTNdY+gvfq63 X-Google-Smtp-Source: AGHT+IFDVYlpnUvMfjhls/6ICuodvgeDLxOtgUXJMxed2+lv8QtrcUqzCIzmibtwkVj6aRLklBS1 X-Received: by 2002:a50:ccc8:0:b0:57c:7413:a6e0 with SMTP id 4fb4d7f45d1cf-57c7413a7f4mr1981933a12.2.1717982309958; Sun, 09 Jun 2024 18:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717982309; cv=none; d=google.com; s=arc-20160816; b=aGp5kWy3Od2GejH4ke5p0F771U07RDbamWwLKFFYr/wHHBrLW2YoHVPIm2r5r/jGQY +vyy9C3vRs/ceX4zymQuCPqc8VzHr0zyfuhYF1wgwbL5/lPnLKBb0yj5eKS1UDIppmI1 BgVEwPJp+G8IhdjVacVZlO7+XCWL11fKz1lqW3bw+cJzz8b81ajAzmzhAEwtWINNEBFI OWaJ4NHDIoODuxMIC7WsqCHDa6y3D5v9xYWGFaHCw5xly46RlAzlQZh8FutfZ9duokkJ GET7PoqsZOClEZaf86dE687v9r6ilGynaltfT8R+nOTXT9h2MuyD/KIdbkf/3RmHwbvJ pmNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=I61V32c8HMJSoXG/mwzY2zs9W+T36XeIqY6DmpufeGw=; fh=wMMH+/TT9zXjv52LLidicK+n0NZXKF8nIdCsIDqpChU=; b=WFlltiQmk5/OcaHFVK9dYLetaxdcL8YBLXCb1OLXsOawFCp60wVge2a0fi335gzUXN uIgZJMAllqVq/BQ2wnryUQ+3wsHpv/idZ2y3fTURuVNDo7g3xZzWLIcgGPcFidiiMYvl qQBAE2GUxT/bOhPPtmrXIxdhzenNkJFxHP4LXCEAdnlcfORMpOykAgrEQ6SgN5T+ltu3 ELcx7ggp2fg6BoDKKjHGmXUZI6gZgENaqNJs131Ho88TuKRGNFajVhpd6eTclW4jkagV cBnRBGvplrl4ScK3oEFYRE29akTXfWA/2vZVd5mcNyy1ypSTcIwEOZhm2uAzbSYMb55d Mt+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LIXHxZY+; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c75a842efsi1232295a12.560.2024.06.09.18.18.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 18:18:29 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LIXHxZY+; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2EB8788578; Mon, 10 Jun 2024 03:12:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="LIXHxZY+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5CEDA88589; Mon, 10 Jun 2024 03:12:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oo1-xc2c.google.com (mail-oo1-xc2c.google.com [IPv6:2607:f8b0:4864:20::c2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6F31588545 for ; Mon, 10 Jun 2024 03:12:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-5b53bb4bebaso2077353eaf.0 for ; Sun, 09 Jun 2024 18:12:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717981972; x=1718586772; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I61V32c8HMJSoXG/mwzY2zs9W+T36XeIqY6DmpufeGw=; b=LIXHxZY+QlWeQU7Z+WFWGLT1+2OlsKc+iGLy9ZKKOS0yEOoVZsLz/DA5h8Twgqt2LF sfLP/bOf8CRbVIVne4qk0hBZkVnLKrn4n8T7iBtoQ2WDiS+zidTNtVoZsDuQENTqtZPf zM93VV83mMOwSwLP0uTpo7NTFHUziKgwvH1EGDyER05sxYfxN4+amj7IGWYD5LcnGqid vXvXgt9QRFufmGf1KTFrVDx5SRTLI/53DPoWgz95grkubbs9vQQnmAH3Yfh/MlWCjF+v ufpUypVUPTMN74UD/Kvasy2mJCTHaTNEE5ZzhFiWGqWd+FqzdvPfG3/BpqJlSh1bZsMk upmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717981972; x=1718586772; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I61V32c8HMJSoXG/mwzY2zs9W+T36XeIqY6DmpufeGw=; b=au76mq2KRaZttdF961QQHOG9PoMLVm+redIHLTzDwOH2HfMDzi/77UWM8j72GpF5qY KcdcJchRuB2zD1+uvqZpK7y7C9mx/A41L5CHuThOg+EI1bodA4uuvsWZ21CeRTQkPrhk vSIEZM2yQsClFBUf0LcOxW6ukqKaQ394G7bJo6kukgRsrovfrH8gFNe7wvf8SAaaA8I9 MrezRs9S5n218X+wDyEVYi0OTYceu27q1ZxZht+RrMjHiqL+kYPs+SwBNDLTk2q8jVat 6jurmO1dC7jIUmcvjxyk8zOdAHAPR+7vcB6QaRNmsTCei5Nw7iMrVbAA3UFkFgK3fUUi gzCg== X-Forwarded-Encrypted: i=1; AJvYcCUJBd1E3lXYreOyKAmxmKs3lKO70j0OZdeHOXekSmVxQ0hVCq+WbWn6Sr9q+8MXqFPSdiLE4poXvCJIMzdF4Zi/dbcHWw== X-Gm-Message-State: AOJu0Ywo1S9AKOwpqFpDAJCu0oqrNXvAsSJyJv6aYJIAYiTIuVkUuDCY EJpLtPULSLL4YPUwHq0ZG21QmPrWVcKXMdxukqtrtjkL/l80VsX/692HzzAVzes= X-Received: by 2002:a05:6820:2220:b0:5bb:672:4067 with SMTP id 006d021491bc7-5bb06724307mr960400eaf.7.1717981972160; Sun, 09 Jun 2024 18:12:52 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5bb079d205fsm117081eaf.18.2024.06.09.18.12.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 18:12:51 -0700 (PDT) From: Sam Protsenko To: Tom Rini , Minkyu Kang , Peng Fan , Jaehoon Chung , Simon Glass Cc: Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v2 35/40] mmc: exynos_dw_mmc: Don't call dwmci_setup_cfg() after add_dwmci() Date: Sun, 9 Jun 2024 20:12:21 -0500 Message-Id: <20240610011226.4050-36-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240610011226.4050-1-semen.protsenko@linaro.org> References: <20240610011226.4050-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean add_dwmci() is already calling dwmci_setup_cfg() internally, there is no needed to call dwmci_setup_cfg() again in case when add_dwmci() is used (for non-DM cases). Fix it by calling dwmci_setup_cfg() only in DM cases, when add_dwmci() wasn't called. Also, this assignment: host->mmc = &plat->mmc; is wrong in non-DM case when add_dwmci() was called, as it's creating mmc object internally. Fix that by pulling that assignment into DM case, when add_dwmci() isn't called. While at it, add also this missing assignment: host->mmc->dev = dev; Fixes: 3537ee879e04 ("mmc: exynos_dw_mmc: support the Driver mode for Exynos") Signed-off-by: Sam Protsenko --- Changes in v2: - Replaced CONFIG_IS_ENABLED() with #ifdef drivers/mmc/exynos_dw_mmc.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 41fb32c579ef..43111b749a6b 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -333,19 +333,21 @@ static int exynos_dwmmc_probe(struct udevice *dev) host->clksel = exynos_dwmci_clksel; host->get_mmc_clk = exynos_dwmci_get_clk; -#ifndef CONFIG_DM_MMC - /* Add the mmc channel to be registered with mmc core */ - if (add_dwmci(host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ)) { +#ifdef CONFIG_BLK + dwmci_setup_cfg(&plat->cfg, host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ); + host->mmc = &plat->mmc; +#else + err = add_dwmci(host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ); + if (err) { printf("DWMMC%d registration failed\n", host->dev_index); - return -1; + return err; } #endif - dwmci_setup_cfg(&plat->cfg, host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ); - host->mmc = &plat->mmc; host->mmc->priv = &priv->host; - host->priv = dev; upriv->mmc = host->mmc; + host->mmc->dev = dev; + host->priv = dev; return dwmci_probe(dev); }