Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp390608lqp; Thu, 21 Mar 2024 04:47:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWsBvPf0njeHnG/kxxXxrQ1q4VbIILu53FwboZJjUGiqur6ZFyQFQYrQe6u0WvobGsuSnxAlMKNZnxxRairpOTsenUJFQPb695vdTc1eg== X-Google-Smtp-Source: AGHT+IEXvtQqw8haIhqE66w/52q6M+oQoHZMETlVz1kz2oJa7gKwCz/oC85kaEy8C8M9ca2PPWYh X-Received: by 2002:a05:6820:98d:b0:5a4:91c1:9680 with SMTP id cg13-20020a056820098d00b005a491c19680mr1918498oob.1.1711021628013; Thu, 21 Mar 2024 04:47:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711021627; cv=pass; d=google.com; s=arc-20160816; b=BDDSRZlhnohi8te5YjD6sTY743jAliZ1je16fCFad9GeAb04JLPvUg0fjZdymTl2Na D7lumTeTRq25JLTCDQ3o/gXbfBkdlGiE6Hk3FejAMco75s/TwJGNQD2naRkWWMhNHEBx B7NatWOOSzXMW6iMqfYX7ELEwz202TeMXR42IbBFMcG9aHxm1gjWtDxm+p9DAkfR+4ac 06/J2YVJsSG6OQRC348Tod3ebKci5MTuyfR8QN/wvNb9KOHNP3CDb52Bvt09TVJpi0m4 uMlOLR/q9ZPHypPmjKBaLpFMQM1j7t716CiFsGUbXs3Uwcz3ovHhJ2gpY/6Wjb6yigjD 5oJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=4IEMhf9mtJEYPbsoEa76/VveJJ7Y46vKsagmXKCHesU=; fh=DQMBjSR54ENJDXiVd5OVuSP2frqDD13SDuNnm2/sdGw=; b=ApZUSB7ptiyY/mQ1AtHohxHhfNzbx6METGuM+EfDQJRMo6LiLjEYA+erLayGisyKSx jEF2w7RkUDab1NMF4NjsFQ7/6A7JG9GVz9KG/Ue7W/FXkxJDOiGOsYAaQqaGAVj7sk3E r0mhnoSfyX21ssKgLNf0esbc4DD1vUL3y66Ko1Vla16nWJdoX0pSxXaJWHnCcNJJk8bv L0EVU8wa46PJuFmbkEeDJbT27AxrfPSFlRFZCJa8qcMJziHoANfgAASbn6IWuKmhXTld JgL+EpcJAI0jkgmwkm2Kt0ZQl7lkyHsYJoeytl1pQd3uYAS9hT7YFJwrKj3SZVNtQ+IE J5tQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LI1sRIDd; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-109982-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id g16-20020a631110000000b005d8d56cd646si14183851pgl.130.2024.03.21.04.47.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 04:47:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109982-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LI1sRIDd; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-109982-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9F003B2209B for ; Thu, 21 Mar 2024 11:46:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1862059162; Thu, 21 Mar 2024 11:46:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LI1sRIDd" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6610D58ACE; Thu, 21 Mar 2024 11:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711021595; cv=none; b=OmI1MapN4MyZ3Wv9+5qsBcG1rM57F2aeai0Tn9K8Un8PP/54vQKDAX/WAgfagfPOFr45UtnMTQHT/x5M9VPybTzIawRSDIhuitA7IWzK3QbDR7XsWWM910FLzTHNb0gNbxoi4MijQa0+jpO01ppSGciStAgJjM5DL4NoadWQX80= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711021595; c=relaxed/simple; bh=888lv1hY5WL63q1oVRC74LdaqPXZGJQmkKsdDuD3JPU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LLw8gKM1BcLsme4dIuiE3IEGTpTPnZ5A0u1p/JF5WIlr5aQgQvSIzWoTh9bPSZg6PixuyW3Vm22qJOZLj1PeBQph5tUuMGFPH0JOsjG1yvvjuZpGH4efP913lJ5pVarwOxgs4JITb+V20qXskLU0bgBvFZWvhTOuGm6WlSLZp/c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LI1sRIDd; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711021594; x=1742557594; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=888lv1hY5WL63q1oVRC74LdaqPXZGJQmkKsdDuD3JPU=; b=LI1sRIDdvROE6EMnbWTEQKyk1DRHcjz+Q+ZAgF07I77khAOf2+448+ol KLAwBZ3Rup+A9QEiUv3F7o+LSUmiUh3xzSqFb6TVPiOD0uj2e0OJ1xpZD wPeyfpU0zO8DuN31yfNDRSZGX1lDzriZm0/J1hgJ80Uf8BAIx+1Tl7rEw F03JTHfIQVJh4U9Zb5EbDBBCU91L5TRKFVa+SRf2lbGF3HV4UBFaQJw28 +r5fH9O+tBgiryd90FyUznwAnDN3CB5gwA//kEfXvH11Sr5g63j6gycnM KIPZIc3Cbzh9ZoJ6bb9EQUunya3UPQwXNKTcLteRUkgvd6Q0ntyksKU/Q Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11019"; a="6128614" X-IronPort-AV: E=Sophos;i="6.07,142,1708416000"; d="scan'208";a="6128614" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2024 04:46:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,142,1708416000"; d="scan'208";a="19055468" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.251.210.179]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2024 04:46:31 -0700 Message-ID: <22e6ab4c-be8d-44d5-b430-e7282bae34ab@intel.com> Date: Thu, 21 Mar 2024 13:46:21 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/1] sdhci-of-dwcmshc: disable PM runtime in dwcmshc_remove() To: Liming Sun , Ulf Hansson , David Thompson , Shawn Lin Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org References: Content-Language: en-US From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 19/03/24 18:16, Liming Sun wrote: > This commit disables PM runtime in dwcmshc_remove() to avoid the > error message below when reloading the sdhci-of-dwcmshc.ko > > sdhci-dwcmshc MLNXBF30:00: Unbalanced pm_runtime_enable! > > Fixes: 48fe8fadbe5e ("mmc: sdhci-of-dwcmshc: Add runtime PM operations") > Reviewed-by: David Thompson > Signed-off-by: Liming Sun Acked-by: Adrian Hunter > --- > drivers/mmc/host/sdhci-of-dwcmshc.c | 28 +++++++++++++++++----------- > 1 file changed, 17 insertions(+), 11 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c > index ab4b964d4058..1d8f5a76096a 100644 > --- a/drivers/mmc/host/sdhci-of-dwcmshc.c > +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c > @@ -999,6 +999,17 @@ static int dwcmshc_probe(struct platform_device *pdev) > return err; > } > > +static void dwcmshc_disable_card_clk(struct sdhci_host *host) > +{ > + u16 ctrl; > + > + ctrl = sdhci_readw(host, SDHCI_CLOCK_CONTROL); > + if (ctrl & SDHCI_CLOCK_CARD_EN) { > + ctrl &= ~SDHCI_CLOCK_CARD_EN; > + sdhci_writew(host, ctrl, SDHCI_CLOCK_CONTROL); > + } > +} > + > static void dwcmshc_remove(struct platform_device *pdev) > { > struct sdhci_host *host = platform_get_drvdata(pdev); > @@ -1006,8 +1017,14 @@ static void dwcmshc_remove(struct platform_device *pdev) > struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host); > struct rk35xx_priv *rk_priv = priv->priv; > > + pm_runtime_get_sync(&pdev->dev); > + pm_runtime_disable(&pdev->dev); > + pm_runtime_put_noidle(&pdev->dev); > + > sdhci_remove_host(host, 0); > > + dwcmshc_disable_card_clk(host); > + > clk_disable_unprepare(pltfm_host->clk); > clk_disable_unprepare(priv->bus_clk); > if (rk_priv) > @@ -1099,17 +1116,6 @@ static void dwcmshc_enable_card_clk(struct sdhci_host *host) > } > } > > -static void dwcmshc_disable_card_clk(struct sdhci_host *host) > -{ > - u16 ctrl; > - > - ctrl = sdhci_readw(host, SDHCI_CLOCK_CONTROL); > - if (ctrl & SDHCI_CLOCK_CARD_EN) { > - ctrl &= ~SDHCI_CLOCK_CARD_EN; > - sdhci_writew(host, ctrl, SDHCI_CLOCK_CONTROL); > - } > -} > - > static int dwcmshc_runtime_suspend(struct device *dev) > { > struct sdhci_host *host = dev_get_drvdata(dev);