From patchwork Thu Aug 8 03:14:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 817696 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp675966wrt; Wed, 7 Aug 2024 20:20:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX7fKTkvnGxzT+5FCcTHcfOXWAtb7yMRxsxBLaLqR3N6oIN5TKUgthNSfeubAOX8Qf/cqyI+rPb2lWdpT82QUMJ X-Google-Smtp-Source: AGHT+IE7BdXZu1ZCCDQhTBUzzad5q7eLCzBxexMccaYdTkoPnFZXT/IoxBnwRFGn6qGtvWyP7o32 X-Received: by 2002:a17:907:86a4:b0:a7d:d08f:95ac with SMTP id a640c23a62f3a-a8090e3ccfcmr24538166b.47.1723087241778; Wed, 07 Aug 2024 20:20:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723087241; cv=none; d=google.com; s=arc-20160816; b=yDcI8otAgqsvos00RmIwBpCZOvXv6lKnPVCozvq7VMFFdYTwPNoc0UNNePn/IZnUhC UlfhqHLZ0i1TZYeBrDYcTkfG6v9FUhkf9y5vfzC6i2swDTMAXiwLZxThkKENPnTKXnxp f8ghAGRbsPNGzgZA3nF/tb0D+VTaDLopvVboVllR95eSbj8bLTXrEsNRTLgw0yta6K2V Ord6vgsOVwRrJmmdsR54tTClyCcIeHEJwSJLKkxzw6fqM03KiHpvTEvEFsE39KdoR6DQ WQQVb9LHWgHr7jcadExG944QogmcCZ+4FoTYGcNFJJosNFbe2ojTAjtQnAKhC+Ao8MLB yhew== 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=m4DMU5JktK+PKeTe51YJVJuuv8p8NLdnwCctV/VHPMo=; fh=cSnUVk/wugLNjHrir0P5w+O/CJdWMh5Uc82MJyvrY/4=; b=LORttIsAAIScjMISCA9Xl8W9BoCS4pDaVJiDwVuU2jWX9NsBQNqVGxMsg8Cfqbl06A RqUmDfsjmeDuqNN5SHFpu+EjBVhtj02W/STRi7vzw/siScltLBk39YQRFmjAIF8Nl6ub HfeDKN/uyc5hy1gp+hw+sEK1zvUF06jHv3p8Qrz4E6TDYrWPRqCy2oS+om881iVY0vwi 8tyy1JalpQurHFvTm2MnAO9PTuwRFZ1cJ6EgfdTpdrmjux/n5D0duO5cwlVOyCZRUc/y UWJV17n2ckjIgtxO/UcFvMOEDSFR3gpc9IqmTK6N40FgPhsfMExqw8xdFtMxL2RknSmD KzUg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JLLYAjm4; 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 a640c23a62f3a-a7dc9f6a4cbsi742500166b.1037.2024.08.07.20.20.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 20:20:41 -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=JLLYAjm4; 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 6825088B99; Thu, 8 Aug 2024 05:15:21 +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="JLLYAjm4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A83E88C06; Thu, 8 Aug 2024 05:15:20 +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-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) (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 5CA8388C15 for ; Thu, 8 Aug 2024 05:15: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=semen.protsenko@linaro.org Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-70943713472so208175a34.2 for ; Wed, 07 Aug 2024 20:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723086909; x=1723691709; 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=m4DMU5JktK+PKeTe51YJVJuuv8p8NLdnwCctV/VHPMo=; b=JLLYAjm44UrhvVj+S8skfR0o671Mad+ySLPF09H/zwyAiqZKOzy23u8I8C+XNWhf4t iANtnewzoHzZduubZH6NuUaU4+oAXJkZaqqEugWUrWirY1pHOE/9X8Wz1b5TR82BqYUE tNia6FmMxT/wEoqdXV+HJFQWcYg+5+wvtxmaRvpSTXmD8KddW6ye2RgwCY6A4kY5JCvb nk9crbfsFYoh93j+59L3hEPp79PjvBWQ+E4gWV0271Tjl4DsncWnhyLpHBRbWmKW0kCL 8StE68v7QATUXV77UWRkPUJDHOF0dfT46wdVnVkeTFeEP7gz1kKjO1QphE6hfTpX/jqf Z0pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723086909; x=1723691709; 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=m4DMU5JktK+PKeTe51YJVJuuv8p8NLdnwCctV/VHPMo=; b=ei3gkmx/JD/831LtbCC+4m636bGF5v0ycAo/RcWPTLg/geckyIq6o5RX5H3Y7upfZH vKIkxbuyibYXwya3ZqzjV25L58hCTe+6HmfA82N7XM6Lxz23LVRmxvEYNtnRGCdPxB0d kMPPnLpBWyuRSLQmOQ+rvI4TH7syvYi9Zn2GDwbyEorCZtK13b/IBvwqlz1lPurPsTQI 5FaGaJihT51ZAwk/lf4SnsxRGjIfKG8u81hoqaTASbzZJLShFT5kog/m3Oyb/nFhvLuC N6nRvAYVTpM3D9VtbCR29aECHNwt0jNrvCPJPv+a0wH+YqsFMrJWbJ7uxyhVQDSlwZna pnUg== X-Forwarded-Encrypted: i=1; AJvYcCXDiD9rTLkqWC/tg+2yM6m8IeIvT++sY3l6NrCE1+3z/zUSMXx0Fg+WBeoarucST67dPwX54Ye2evoniqPaBpBh3UoD+Q== X-Gm-Message-State: AOJu0YxOEk7TZ04lbfcb2rhsUhS/gwEJ0+j3JSYKgHGznanOBhZ3gJJh xAG1ymfPNqdGDm0+W76sUjC5gwClSnxILDQ5iCEsbyT1CujCRFKCBoKQOsJW5s8= X-Received: by 2002:a05:6830:6301:b0:703:6ca6:27 with SMTP id 46e09a7af769-70b4fc493cdmr996833a34.16.1723086909437; Wed, 07 Aug 2024 20:15:09 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70a31eaf6d6sm5127661a34.30.2024.08.07.20.15.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 20:15:09 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang , Jaehoon Chung Cc: Tom Rini , Henrik Grimler , 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 v5 33/38] mmc: exynos_dw_mmc: Don't call dwmci_setup_cfg() after add_dwmci() Date: Wed, 7 Aug 2024 22:14:39 -0500 Message-Id: <20240808031444.9619-34-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240808031444.9619-1-semen.protsenko@linaro.org> References: <20240808031444.9619-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 v5: - (none) 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); }