Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10430778ybi; Wed, 24 Jul 2019 23:05:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgZsyawTQdrIUBONZBF8UGk+dZYLqBZYJSEYtSPzS/DPqMebd8FTce/7wNx3tolC5gHBc9 X-Received: by 2002:a17:902:e011:: with SMTP id ca17mr91114390plb.328.1564034719062; Wed, 24 Jul 2019 23:05:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034719; cv=none; d=google.com; s=arc-20160816; b=Mg6Nqtuq2qfYs8Q5ObCBjlznU1ylDXjJNZK2b7SlEUmCu8Yal8S1Ixrkl1tpOfcAGr /iqup0ro2wCHxJsptO5smaT8+P3FReEwuZ9T0A3kLJrVnogsv8dLmyo+p/rF4C7Uq/Ib J//4Y8vpcCwmtcTcL8MkqjPzC0DaKdif8KiMf8a7qnCTO2CyMxkjvxNe8sSpc48ig+Kv 7kCGeS5fPNk/MVtXjIw6q8lQuW/nuNfuvUvcyLCqTrpIysPl9OwO5MD1AveUheY9GOu4 IuHLKcOrlDc+xhd7qq4hUV9DxzKEQNVoMerNT1azCr34uUJZuI5zKv9yAt8r0D2v3Iff V11A== 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=7FEIjxLsonkDGUEnOWJyr6o80UBaHfel/kIvXaV6MBo=; b=kaJ5RD9sE5VFkqxcOx5i4VEWsWtFa8XTRRMs6ysDMkfj06Cpu7iyuykU1EQESsNSMK hV4+iaLZajBVuOI+nu86wqHdMujPMxBaZGP+f9Ayu4xxElA8B6Pn9FDskHovhZWxOud1 96TonLsmmDNOyDzQSw88zUlnPdNjMLtSs8wtK/LAugWedRxcggdGlRz6olhDLxZCJ+SZ NNXkRj+2XM11TTbv1MKK90cxvderHPNJvS8j+0Lyf22IcCYu2XEqTwkOlfJAWcF4Iat7 W5bXj3Vjib/bRAmPn4d8QicbBBpfllwz85v7MA9naWXyl5oBypXK538xNqrLRdqa+6+J Ujgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ex5yMJoP; 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 w18si14033322pll.132.2019.07.24.23.05.04; Wed, 24 Jul 2019 23:05:19 -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=Ex5yMJoP; 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 S2391536AbfGYFrR (ORCPT + 99 others); Thu, 25 Jul 2019 01:47:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:35186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387418AbfGYFrO (ORCPT ); Thu, 25 Jul 2019 01:47:14 -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 5E1C62075C; Thu, 25 Jul 2019 05:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033633; bh=CRk2HNBwf8Mi7dbxwlf+qzdPfG7rOllCSitcokskcfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ex5yMJoPuRthf/Ij/oNnMVcTZisVKDOsSyVYGI5RfgW+kvqRDmzuBKntZmnqsDjpL q9FdTtjD5Dx4X9/8BtJyBUr8sMycErR0rZpt5JdPCkBFsu7FnoEnLzz82RbTZk6kMs JZCEPcrauLvqjLE/bbBbmBPIfjI9jkgbOrZWjupA= 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 4.19 259/271] mmc: sdhci-msm: fix mutex while in spinlock Date: Wed, 24 Jul 2019 21:22:08 +0200 Message-Id: <20190724191717.395301959@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@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 @@ -582,11 +582,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); /* @@ -634,10 +637,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);