Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3379207ybp; Sun, 6 Oct 2019 10:38:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0/W0jcbUxPY2GWtK9Klz2y/YxarjQiw80MkxbCaux7Bl81X6xp5ibwbcicaaCy6A4Xh/E X-Received: by 2002:a05:6402:1202:: with SMTP id c2mr24513587edw.190.1570383491117; Sun, 06 Oct 2019 10:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570383491; cv=none; d=google.com; s=arc-20160816; b=PY0VkzwPdMdLkUunAtOm72JWQ9VB2BmnvUs4x7DkC4mY2oK/tiFcHsmzx0/GanzG0o zMkZMDRSbFc+vLWAvrHx5RW5GsHBqAS1V1TMryqCQOHckyG4TIzXJUQYH7pv4x7ZSvCy XxF9w76oGLFxAsp3uSBiTIi21YbopdaWzmGS0aaNYjQiwkEEz6LSjAfUENaiNReIioxc 2fTKcQ8d9DLiiRIRJmtArgcBieERFU0h/BQSqO7pQXoVxFVNYHl1257pbWQB6mbwcf7+ QHR+H48VtCJS/bQb/sA2F2fssEw1YmaPrMszvzMrs6uFKmJ496J6kzq/LSenFsaTrxfO 2RIQ== 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=blMgvXD2udYO/6XOMUBPaGpws48iIsjYyviuixhotvA=; b=OJCu40OtkG8qyTnL1aAhkYD82CvUTMjcgbOdMPgY0BI2uLLoeJ5qwpsLNQWnDxnEeb mggXjHa9gT3NwUsdprihiMo2UJcp4WA6cbJuoOHctSidlClIQxZvCFOba9qF2kUdhxMk mF+sxG7HeFZP6so4wfFALCeBw4cgdD13DmFJyltfTul1yaZ4X6jCVSLUXgJUT4/2Z2Qh j8TTvkGMpOoHQFefo1YiQ/RhEIxCASJ3Lg6tDgv6PH/ckLuePKpKk50LDdy+yxScq2iE sSpmtPZjGCF0l1Tiv1B9AGETbet156Px7DDKs07+Tg3Yfy4ZbaSetXhKJLbe/WtE2uzQ TFNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qJAoh8P4; 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 e13si6892198edr.429.2019.10.06.10.37.47; Sun, 06 Oct 2019 10:38:11 -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=qJAoh8P4; 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 S1728195AbfJFRgG (ORCPT + 99 others); Sun, 6 Oct 2019 13:36:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:34778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730231AbfJFRgB (ORCPT ); Sun, 6 Oct 2019 13:36:01 -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 6066E20700; Sun, 6 Oct 2019 17:35:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383359; bh=ufQvx7ZNex7e9L1n3iz0qxl2DPV4jX3rgvJ6+P7qKWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qJAoh8P4MWFfwNeYFXUtTt5o+WhTBUgVm5PqJ1e0jx5x/WjmszafyZK01Ji7BLPju WlEt9r3a1uWlQ3PK9I+LA1U9r2/pgdQYIPalnRXHpkwgvSDb7Ia+J3F0hlSW8xcI+h 2nOemzjQhWioGA0xA6E0/9RVjx9EArWe9Ido3HTI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Douglas Anderson , Taniya Das , Stephen Boyd , Stephen Boyd , Sasha Levin Subject: [PATCH 5.2 074/137] clk: qcom: gcc-sdm845: Use floor ops for sdcc clks Date: Sun, 6 Oct 2019 19:20:58 +0200 Message-Id: <20191006171215.232413868@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171209.403038733@linuxfoundation.org> References: <20191006171209.403038733@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: Stephen Boyd [ Upstream commit 5e4b7e82d497580bc430576c4c9bce157dd72512 ] Some MMC cards fail to enumerate properly when inserted into an MMC slot on sdm845 devices. This is because the clk ops for qcom clks round the frequency up to the nearest rate instead of down to the nearest rate. For example, the MMC driver requests a frequency of 52MHz from clk_set_rate() but the qcom implementation for these clks rounds 52MHz up to the next supported frequency of 100MHz. The MMC driver could be modified to request clk rate ranges but for now we can fix this in the clk driver by changing the rounding policy for this clk to be round down instead of round up. Fixes: 06391eddb60a ("clk: qcom: Add Global Clock controller (GCC) driver for SDM845") Reported-by: Douglas Anderson Cc: Taniya Das Signed-off-by: Stephen Boyd Link: https://lkml.kernel.org/r/20190830195142.103564-1-swboyd@chromium.org Reviewed-by: Douglas Anderson Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/qcom/gcc-sdm845.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/gcc-sdm845.c b/drivers/clk/qcom/gcc-sdm845.c index 7131dcf9b0603..95be125c3bddf 100644 --- a/drivers/clk/qcom/gcc-sdm845.c +++ b/drivers/clk/qcom/gcc-sdm845.c @@ -685,7 +685,7 @@ static struct clk_rcg2 gcc_sdcc2_apps_clk_src = { .name = "gcc_sdcc2_apps_clk_src", .parent_names = gcc_parent_names_10, .num_parents = 5, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_floor_ops, }, }; @@ -709,7 +709,7 @@ static struct clk_rcg2 gcc_sdcc4_apps_clk_src = { .name = "gcc_sdcc4_apps_clk_src", .parent_names = gcc_parent_names_0, .num_parents = 4, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_floor_ops, }, }; -- 2.20.1