From patchwork Wed May 22 23:31:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 798216 Delivered-To: patch@linaro.org Received: by 2002:ab3:6414:0:b0:267:d849:ee76 with SMTP id j20csp919493lte; Wed, 22 May 2024 16:38:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWDnlPU0hIYee4HJiswYbUVPM9DRsqFPFHr7YCBGUUwTFrOfW7rgIx3woRVnUGPifGXzCP2C1WSfE80mEIfb7/u X-Google-Smtp-Source: AGHT+IGP3mWf3jzmpmnwuaZ9zxutGBX/CnzL9Xvjhmqitx+8Tgu3t3DWcqfhoeSKg5ztkm5W1pXj X-Received: by 2002:a17:906:6d85:b0:a5a:84f9:df73 with SMTP id a640c23a62f3a-a62280a12e6mr208184766b.38.1716421110550; Wed, 22 May 2024 16:38:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716421110; cv=none; d=google.com; s=arc-20160816; b=dt2qxAk48tc5N6VstLza4MrwP7A5WAXLAZa95JneV6upWFZ/sksHrF2MzX1jp7pDTT nIFYIE38oFeDya3EJBPq2Ayz2pCvQrDhJlt4w/0amIc+4kJvpEBLtRf+BfqHzNHsE94k wUtJ9Crqd8n6zJqr8ho2SXgAkzKrLQxv+fwKYf9B2+/XkJehO93171VpHsgefdjVYTif W32VBD2udgj1o2HOVTWtgMCe07zFoqReDAnoQV1GkG7JqmbVnewjMvLWK6p4yQnJEcu7 OJXzQmXwOOIoT/cvejqNWSC6WvlMu+NVT6t/rWgOuIohZC76MEu+wEu13GNtqjVboz5P +lVQ== 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=BAbT09mQMrVOW56Q4+Gpj2H/+bzDkARKpMavwrkd33w=; fh=J7jrBMz3BDkeZSKMZJRLQLipOOrM02H0ckApFIv1PS8=; b=nIKei86H9jDA5vBodZKq6S1KNw7weNPQqvwFrqvj5qo3B3Dslz+POjmE27CYUNTo6l 46iaZAKKmIsV+PlB8UTc3ic2r4aMVPYikP/W+goidM0x5eFkCjsrTAIaUzal+pb0ZleJ SVpU2bzMC/wGI4BZdY+VzEnTxcQSz/mX9I6hXB4oOKAdX16fwnufftJKsrePAxVyLX7v yz3+hxt0aZ0NQB3413ostbphhIYD91QDzwe+boks9pEza2o2u0Zm3bTQ32t2ZuueSxUw wkUYneHcmEvx1LbuxVBD11cMClM4wTZbh1zKdKwaAuXU2i5yxUc+3E/WT4Nk6hA4fOg7 Zn1w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SIthj08h; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17c2be48si1554149766b.924.2024.05.22.16.38.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 16:38:30 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SIthj08h; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 E781E888BB; Thu, 23 May 2024 01:32:17 +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="SIthj08h"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 696DF8858F; Thu, 23 May 2024 01:32:13 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) (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 9123D8858B for ; Thu, 23 May 2024 01:32:08 +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-ot1-x334.google.com with SMTP id 46e09a7af769-6f7c661d597so158222a34.0 for ; Wed, 22 May 2024 16:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716420727; x=1717025527; 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=BAbT09mQMrVOW56Q4+Gpj2H/+bzDkARKpMavwrkd33w=; b=SIthj08hXdgnOBm2w85/w2TGS+iLznHXKMUC9nYdnew1dERWvT5z3ZVolkbF1Wyu+B QpW+zkGlkOxMbeUhpqydOInf7KTV3iQtHYlsbXPPoLHBnCg/gh6PwHSgNsOek1V4VitZ 5oVdGMaVcf6o6JjR7mlJZeO2bVlJTpn/z9EET44Cb5WhBFzwMpkOXpUvin+yd0Ync8pl tBypYoJrJOr95rmMoWZBTJ704LsgTtdaK2vBSvc0/jlASbfK9i9yPQep6YCOI03dYEKE I0LuMAYC0l6ZHFwB/DO2TiP6vV47N1no9+bnvQYJ+lmpC2PiSFnmrF9dIK+G4jWsGPxv 48XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716420727; x=1717025527; 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=BAbT09mQMrVOW56Q4+Gpj2H/+bzDkARKpMavwrkd33w=; b=c5tLwU6LjeiBA1C4tDQcZA6aDhL6EHsnhKCMupmoSWwvaF/P+T4Os0o0qSjZp9n7h/ q7mTwq+TPcndCV75UeKNqTFb53vBbs4mUdioXzUJ2kUBEcu61ACIKAuVujIfiS24LAq3 GzrRZxZhz4U8tEcwYuCFWGiIgOVtcynFaLS0E9fK92R2tvjCeaeRYU36jRiJIPaHIlqM v492z9RX5PXA+QF+UqulfPxvrl6lOKtuh/ur8VhR49t7UeJL9zEQmhCqqTUb9UgnfNf/ X3qDIECEdEke9/nALh8QOPfHQZ7UZfRDQwVLQ2Xg4jTp23fP9xwcKt6aAldaBu+LJ3lc xRKA== X-Forwarded-Encrypted: i=1; AJvYcCVpBhr7nfifVWcrZy0iMM1boeD8phmMj9B1c2Nfcbj49LCumo6C3vUPjtJkM6zI/v71CaDXy8MU42w3fcXWN8y8Y5+qYw== X-Gm-Message-State: AOJu0YyClFBUjK1IcsNtHR/sI+klIjVed/P+JXW1TxUHZO7JzoJ2EO4D t5GyHQEN5O3Rgr/jfKZEz+tcg58uCV7J/tmOK/CMKVpvOughpm0mHOdhzEGoyl8= X-Received: by 2002:a05:6808:2183:b0:3c8:42ea:ec52 with SMTP id 5614622812f47-3d045932848mr301136b6e.16.1716420727218; Wed, 22 May 2024 16:32:07 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5b2783be1f1sm6123481eaf.35.2024.05.22.16.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 16:32:06 -0700 (PDT) From: Sam Protsenko To: Tom Rini , Minkyu Kang , Peng Fan , Jaehoon Chung , Simon Glass Cc: 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 37/42] mmc: exynos_dw_mmc: Don't call dwmci_setup_cfg() after add_dwmci() Date: Wed, 22 May 2024 18:31:30 -0500 Message-Id: <20240522233135.26835-38-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240522233135.26835-1-semen.protsenko@linaro.org> References: <20240522233135.26835-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 --- 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 19793e7ad460..373dd2df206e 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; -#if !CONFIG_IS_ENABLED(DM_MMC) - /* Add the mmc channel to be registered with mmc core */ - if (add_dwmci(host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ)) { +#if CONFIG_IS_ENABLED(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); }