From patchwork Thu Jul 25 20:45:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814410 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567740wrn; Thu, 25 Jul 2024 13:51:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXIW7K6cXB2df44s+EUlloU38yFgjfwB8HK63Z0GrBM6SBZtUmiD8Xz8Z/tMw7eSxrbqWK/rvUEvnsOgvy/VbSu X-Google-Smtp-Source: AGHT+IEvm/MPHCz7XWnyOyxaOYgeh7Wszyrz3CURCwjOqyBp1FMn8M4PZrIpbRQCbY/fMtZZyB9m X-Received: by 2002:a2e:bc25:0:b0:2ef:2638:48cd with SMTP id 38308e7fff4ca-2f039dbab7fmr32850281fa.30.1721940675850; Thu, 25 Jul 2024 13:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940675; cv=none; d=google.com; s=arc-20160816; b=uV1/iAe6xsCd4A1ij69vbpnrvd9pIoUZT5UWuhqqSRgbnRzZT4Q1IDiJOsvFMoN1Hl Axf08Di0uEVdHeobxmjFquy16gW3Lt4ltdFEzWtRycd3pEYBoiEH7pzmeTEKyhUNgh9q 4EYL6EFFOPfpPIpPIATy+P+IJT1+ZtdBWpoQR7qnEO715ALFVQvD2VhIvdWT87H5BgAx 8LiVPraBAxR5zvdXxPMQHa37z3L/6XUWAKvxWbQH7XcP1k3Lh5F0ub4hW42VA1UfmTZo eMcDqhuDQHShjqMA0kOk8AgneQugNu3zbWJNhHNaAXnGX1c22x6aRzMmN0TrghC4AIQr Wd5Q== 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=+XUQL7vLaVVGvE2U+OSGmb2jWwlqvKIeMENURlbclfE=; fh=Glaeo6dkD4kxCDpm0MiIA8BqF1Lm8ZD6EYKrbuWnPt4=; b=YIe1eJl/NQY/UZXIU/wECiZyxg1iXs+H5RzxVgU0V5zCNVzJBCmdkM4CYVzH35vQLz A4grVqIemRuHr3jDRxuo3tS3XxFTn0FontNRnFLaCp6ICqq87EzbmF/ISMdhUgYoJgih sjJ3wWyi1nda6LkqbpjvzbOMOK7sIjYT3UwMH36iDFWt4f2NTZYyftLfj1hKb8DKqn7j Vt+L15TaxQzYiE3AXzCKcWD4cqh3UszGGga1Tdu7j404EGjhZx6ieFS+rG7D6tqvoX2q jes7u0yTDylng8H5wCSlNYzq5FDIbvaOPrilELGrkwo8I4mBFTVoLg16nN7B4bBrEYHk TR0g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o45cOfVQ; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d0bbdcasi6319351fa.151.2024.07.25.13.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:51:15 -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=o45cOfVQ; 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; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1492F887F5; Thu, 25 Jul 2024 22:45:57 +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="o45cOfVQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4D16188585; Thu, 25 Jul 2024 22:45:49 +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-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) (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 A3E5D8875B for ; Thu, 25 Jul 2024 22:45:46 +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-x331.google.com with SMTP id 46e09a7af769-7037c464792so175957a34.2 for ; Thu, 25 Jul 2024 13:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940345; x=1722545145; 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=+XUQL7vLaVVGvE2U+OSGmb2jWwlqvKIeMENURlbclfE=; b=o45cOfVQ4aQmmZ+soFaSMDqI84b61948X/dmAnmzIAqJjzSHaLZ8NEW58Boyssw2kS bjt9sOxpki7+EbcIP5qOBT0klcxnyGyT3xpVoJhafrTDfBeQ+iFClG5UQiFbOML3aw00 edFHCc3WZ0UfjfMCPrQpociZjQn1oi5Y9S4q9RaprqSuomCS2i0JdMl9/d8lT9afYda8 2X7XvX3FvyiEGS2WxVwBY+gHE2WEylH7RMrwJXXiLrLZWQ28TTAQwvAfFrXaHePIZuQR i8seN6Z7OD0a+THI1sBq75rVFtOh2biEQQbtDGqL0KL/VoNaVtAr27vKpdFE0GwlT/Y6 mM6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940345; x=1722545145; 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=+XUQL7vLaVVGvE2U+OSGmb2jWwlqvKIeMENURlbclfE=; b=JvAKU736FdYmSbfGWDbMFhGGgkL/zivmrbN7na2bXHjTb6ZcZKcY+WmTUa7th3fb/i wvg9DXsNlWYrBcXZpARynrkPuhr/JuvY5sWOkwz6myLXCwEV5Y/yXVlUZ0bZO4W5azNM Z5TG3DQMGgRfsjuDgFACqKEZMRxPTG3mzAvcmjtC/E7zQvrrmt2ZKW1dPKlrRZeJoaPF 1hYH+dMcuOPUhRF3qQ27e1R0jztoayJWeRvyj8+boaUUp16Y/xnD6SQ9/UXHjLArX45Z iUucWnBcn9aZIs6qoCMVb/mA5e+fUroBSOgXWdhd8aQY2c9x3rwamsJpfgaetV2dZI3O TAAw== X-Forwarded-Encrypted: i=1; AJvYcCWj+rAaHlZbYLO9U8Xo3NhOuKiIo9/2iAmY6W2Zb2fcnxAPfhOPqX4YFYrswPExJobP2mVq2SHtAim8iZOe94x3WODKbg== X-Gm-Message-State: AOJu0YxtEkweo63xiYm072MYSpZqsr8Y3rEfrsdNlnGgotbd/Ubufz2G SsHnlpdtmz/HUFvcplmM9G0uX6eT6k8r9OFe00mhr37yfaZqQD5RL/e5MK3zrWQ= X-Received: by 2002:a05:6830:6119:b0:703:6d44:41a5 with SMTP id 46e09a7af769-7093210e9aamr3676879a34.6.1721940345488; Thu, 25 Jul 2024 13:45:45 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7093071e976sm448354a34.34.2024.07.25.13.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:45 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , 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 v4 33/38] mmc: exynos_dw_mmc: Don't call dwmci_setup_cfg() after add_dwmci() Date: Thu, 25 Jul 2024 15:45:15 -0500 Message-Id: <20240725204520.18134-34-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-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 v4: - (none) Changes in v3: - (none) 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); }