Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5226360ybl; Tue, 27 Aug 2019 01:07:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqy42pYdb6jvQ2alXOLgLgid3dzHV1MXhXG80xWpuhBYj2nIrCNz2x0DMECzivdzXkDjEaCk X-Received: by 2002:a65:64c6:: with SMTP id t6mr20547795pgv.323.1566893237513; Tue, 27 Aug 2019 01:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566893237; cv=none; d=google.com; s=arc-20160816; b=e/kQNNOQbQLOuZo6NnQpyVHmLfIYFlkiivn6kXl6zJBBsLEdrDh7TMR/HTSfkPnlfw w6eyrFaDykFJV7FtRz9F1bLjIfKYNqYYLbroeOb5a4Ki6tz2VR29Fk1v/LLAiESfft9m n7Ws3YXbjoWPkElkuBquEiFsS/6MEfvnzrkzOf9tz8iMW/Ycj1KByRl+TGBUz5+rNjVP 9/AwaIz2ekmezokUirGIE/iNIP1k65OfkJiekHF99ZkkJaXOgM0PKg7nkxvoxyVFEH2I vq2Sdi28/BIJUoodJHS9FYwNERekmfOGW4/9F5zrgwIcOoe8rCYFr02BvNWMbfUaaVEM BbxQ== 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=aNnc8bxH3IwogO3hUG8c9+r/v/8rGKoBBk/eC3y3gRs=; b=hoJHdGhX0iTFwf6K9T8+yG4z6/R8yipr6IqBnlXQ3KJ9LFVhiXAEcRpQGQVi8Y2TSl bxiMIakEBPb+ifkdHnMgdRxPKy2zJKJ6htCf6bIv2kjCfLWaduhYnRF4WC9pX25Q0RDU xisHO0RjL9e+rnR0Wpvpy33ddc9nv2+5OIZZede2Fp1psfxIygaOd4D+JXnADZSNPDz5 Nq37jC13vf/HwG7IyxW/85sZQjHfl2LmRoTeKP8ltmA7PD8hpntzZKZUqZomRJxuZ72V 6V/RvGA9K/AMVPq8ycJ+auZU8tAdYzgbY1ItCDC0ntVhOAPIffZIJecVsuhMlV9kU+x5 oflA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ySNqxDXG; 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 s3si11268567pgn.467.2019.08.27.01.07.02; Tue, 27 Aug 2019 01:07:17 -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=ySNqxDXG; 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 S1731061AbfH0IEr (ORCPT + 99 others); Tue, 27 Aug 2019 04:04:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:34268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732614AbfH0IEn (ORCPT ); Tue, 27 Aug 2019 04:04:43 -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 B9D30206BA; Tue, 27 Aug 2019 08:04:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566893082; bh=zV8X+i0yft+xSL7KfefChcO/vKkxgbS1/CmVBOebe9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ySNqxDXGPZR4DwXvCxz/rgcnzZLerGmyspTOZNvDo4n+T3Gt/DSa4Cpwjj82F54cT a9zP00CPSFWRX4RIoaI4oBZLj06CUeZ7wJB2eilejYScBzyOBPmdf93UQMiYAh1g1m 8d8iQmdqfpDScTm3CN6H8UqsSMTmwJluPMbFPXLc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinh Nguyen , Stephen Boyd Subject: [PATCH 5.2 115/162] clk: socfpga: stratix10: fix rate caclulationg for cnt_clks Date: Tue, 27 Aug 2019 09:50:43 +0200 Message-Id: <20190827072742.411754638@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190827072738.093683223@linuxfoundation.org> References: <20190827072738.093683223@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: Dinh Nguyen commit c7ec75ea4d5316518adc87224e3cff47192579e7 upstream. Checking bypass_reg is incorrect for calculating the cnt_clk rates. Instead we should be checking that there is a proper hardware register that holds the clock divider. Cc: stable@vger.kernel.org Signed-off-by: Dinh Nguyen Link: https://lkml.kernel.org/r/20190814153014.12962-1-dinguyen@kernel.org Signed-off-by: Stephen Boyd Signed-off-by: Greg Kroah-Hartman --- drivers/clk/socfpga/clk-periph-s10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/clk/socfpga/clk-periph-s10.c +++ b/drivers/clk/socfpga/clk-periph-s10.c @@ -38,7 +38,7 @@ static unsigned long clk_peri_cnt_clk_re if (socfpgaclk->fixed_div) { div = socfpgaclk->fixed_div; } else { - if (!socfpgaclk->bypass_reg) + if (socfpgaclk->hw.reg) div = ((readl(socfpgaclk->hw.reg) & 0x7ff) + 1); }