Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9978379ybi; Wed, 24 Jul 2019 13:25:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3ZZd3rGGSWCk3SvTVomJIB83gbTlhZ2HMuqMYG1LrMNNcuvW/b6s03XUVDrcXjQDNcIhy X-Received: by 2002:a62:1616:: with SMTP id 22mr13290771pfw.120.1563999927322; Wed, 24 Jul 2019 13:25:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563999927; cv=none; d=google.com; s=arc-20160816; b=WUn3RzepI7hmQuiL6LHI3mGq2oDqnuTjYm9ZiAFreMAvyYaiSiIExERgxp1T/SjGI2 PgSwSJUVXZxae1eU1PzQ1UhIwkZIHGNM6OjqVAguS33iIaXFq87tF1j+5bOzOcFxGkNj bJa1MWSzKjQ4PSvOqFudA+HBy3XDnmOl1D4oWzs4CCF67rj3zpJVR+YzLMnuj1x6PvNR ify+i6tBV+3U4vXQh5XB1oQmO1zVZ5op8D5FoipNeS70GxCyLaZMEgNPlAFtlDT9C6gg Y6jRX14dSr4efiatlz1zNLF/7nEFJsrOQiNlSGJG+e5MxlJJKR+gXeeFIyI7HFNhG8M0 aJBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ppXW+Co0Fqx1dG/WgNZVPsQg9c3jCdGNpd/K0tcohcc=; b=p1XVjjGo+LWAAHEA0/SZkzIHX9r/yBtSiSDrNWSB0xqp8U9gbgfqwnIoECE7yq6gsf w09QQlZG9FjCwBFBKm092H2qYN42EOuuf94p34+lSViCYpj95u10mJBUp7wvpZTOc60o UNdBrdhdqgPOpzjJkjONmh+swPnEuzpEb/Mbzb55G5qAOClRMfiMaIBQ5K5rdQ3GPNIn 4YLnsG2Fv0kKASDbYnyMbkiQK/v//RJNwrokySm458WyF6ETETC74t8K8S5b0//ikTdr V4/LWCdw0RwKew7Gh9wBGhoqjYkgJmyZkn5y6GkDRWxtlh9HxnKQjQZe536EK6tnKd6w m+9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FQZNcEuY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n21si17334837pgf.339.2019.07.24.13.25.12; Wed, 24 Jul 2019 13:25:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FQZNcEuY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390302AbfGXTmA (ORCPT + 99 others); Wed, 24 Jul 2019 15:42:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:43476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390281AbfGXTl5 (ORCPT ); Wed, 24 Jul 2019 15:41:57 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2BF5121873; Wed, 24 Jul 2019 19:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997316; bh=J9HdMSmkiQUZ4Qu2ZXSJWgTueX7RlrcvLmJnS4/xEEc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FQZNcEuYRXWryVVMJFHB5kF7H7DOalrlIYH4d5GYPynxF1VcCWeqhH8ZRJn1mpjDK gRMVfrLzM0hx+2ODe2IAdSR4SsTb0cEawxYtaEcjvOKL1rtkSC3qN4K31uvmzSDNWo KjxzQOlQjoknijkqtvtzfUFZCsruetrCwZVcP7VQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jorge Ramirez-Ortiz , Bjorn Andersson , Vinod Koul , Adrian Hunter , Ulf Hansson Subject: [PATCH 5.2 395/413] mmc: sdhci-msm: fix mutex while in spinlock Date: Wed, 24 Jul 2019 21:21:26 +0200 Message-Id: <20190724191803.257024943@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jorge Ramirez-Ortiz commit 5e6b6651d22de109ebf48ca00d0373bc2c0cc080 upstream. mutexes can sleep and therefore should not be taken while holding a spinlock. move clk_get_rate (can sleep) outside the spinlock protected region. Fixes: 83736352e0ca ("mmc: sdhci-msm: Update DLL reset sequence") Cc: stable@vger.kernel.org Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Bjorn Andersson Reviewed-by: Vinod Koul Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-msm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -575,11 +575,14 @@ static int msm_init_cm_dll(struct sdhci_ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); int wait_cnt = 50; - unsigned long flags; + unsigned long flags, xo_clk = 0; u32 config; const struct sdhci_msm_offset *msm_offset = msm_host->offset; + if (msm_host->use_14lpp_dll_reset && !IS_ERR_OR_NULL(msm_host->xo_clk)) + xo_clk = clk_get_rate(msm_host->xo_clk); + spin_lock_irqsave(&host->lock, flags); /* @@ -627,10 +630,10 @@ static int msm_init_cm_dll(struct sdhci_ config &= CORE_FLL_CYCLE_CNT; if (config) mclk_freq = DIV_ROUND_CLOSEST_ULL((host->clock * 8), - clk_get_rate(msm_host->xo_clk)); + xo_clk); else mclk_freq = DIV_ROUND_CLOSEST_ULL((host->clock * 4), - clk_get_rate(msm_host->xo_clk)); + xo_clk); config = readl_relaxed(host->ioaddr + msm_offset->core_dll_config_2);