From patchwork Tue Mar 12 11:00:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tretter X-Patchwork-Id: 10849077 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 24B556C2 for ; Tue, 12 Mar 2019 11:00:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1229D2950D for ; Tue, 12 Mar 2019 11:00:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 067BA293EC; Tue, 12 Mar 2019 11:00:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D56829531 for ; Tue, 12 Mar 2019 11:00:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726487AbfCLLAX (ORCPT ); Tue, 12 Mar 2019 07:00:23 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:59197 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbfCLLAU (ORCPT ); Tue, 12 Mar 2019 07:00:20 -0400 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.lab.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1h3f8s-0005nU-Bx; Tue, 12 Mar 2019 12:00:18 +0100 Received: from mtr by dude02.lab.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1h3f8r-0007bP-Hs; Tue, 12 Mar 2019 12:00:17 +0100 From: Michael Tretter To: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: kernel@pengutronix.de, Michael Turquette , Stephen Boyd , Michal Simek , Jolly Shah , Michael Tretter Subject: [PATCH 1/5] clk: zynqmp: fix check for fractional clock Date: Tue, 12 Mar 2019 12:00:12 +0100 Message-Id: <20190312110016.29174-2-m.tretter@pengutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190312110016.29174-1-m.tretter@pengutronix.de> References: <20190312110016.29174-1-m.tretter@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: mtr@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-clk@vger.kernel.org Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP CLK_FRAC is not set in the divider->flags, but in the hw->flags. The firmware sets CLK_FRAC for fractional clocks in the clkflag field. When registering the devider, these clkflags are copied to hw->flags. Moreover, divider->flags field is a u8 type, but CLK_FRAG is BIT(13). So this check would never work. Signed-off-by: Michael Tretter --- drivers/clk/zynqmp/divider.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c index a371c66e72ef..fc70950c1e24 100644 --- a/drivers/clk/zynqmp/divider.c +++ b/drivers/clk/zynqmp/divider.c @@ -117,7 +117,7 @@ static long zynqmp_clk_divider_round_rate(struct clk_hw *hw, bestdiv = zynqmp_divider_get_val(*prate, rate); if ((clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) && - (divider->flags & CLK_FRAC)) + (clk_hw_get_flags(hw) & CLK_FRAC)) bestdiv = rate % *prate ? 1 : bestdiv; *prate = rate * bestdiv;