Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3383566ybp; Sun, 6 Oct 2019 10:43:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQjGjEv+b5r0VVC7N3k20KsKlwHzVMd+ZOJgwY+eVVki4NZMStf6FovwbSIPg3SWGeecfv X-Received: by 2002:a17:906:828c:: with SMTP id h12mr20226417ejx.155.1570383837796; Sun, 06 Oct 2019 10:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570383837; cv=none; d=google.com; s=arc-20160816; b=elUyPcUmYabKRcIwaRLz1rOrBinabCSvmsdKz2I9LJAiqjyOtiG9X/BShzaa4R8ZF/ CxUU8PketKttrLvlleEkQCj/C9mm84PLccaG3Ff20d/xGRHnm+QiC+OMgZVJERYc9R1K 0ZcT9JqdlSRS6fxedjvOwtQKNZgu4Z1qemjMihwZ8Ah47epwm7qs1kv2mmrIBvOt1dak 2f865IjTicTczb7OzwZaq6MCzWK9Be1ZTYLqXKzDnd6NNiU5jqvIVn+M5IrArum+L5M+ 7fz5SUbP91GjS/Ic6P3lOA+LlRjM6Ph06I4S5jLmrX6PAZd+b6+GvNI0uVOFiyYgB9VM iIHg== 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=7/lWB0MBxhN2VKMpe1/VZKFl+cdgU2mcycnrslEPj5c=; b=R3rIw1Lt9NQ/MUzmEu54Yoa8Gwey+n8LbJomhjem0QXm98rHsIjBYR7gbeLtARugq/ X5jI+iA+41bfMoT9vG5I4G4rDPluN2bmOXnikjMeah7F84tfecUxH7T7VhNMai/6wL1+ Cngwb1i+DXcRZxVbSNhll314PqUqhN5FZsYMY0LqV2CHgSK5MzXJIJNgi4Ol/5U/42ax 77h/YJsirtocYeELuvWmioH0vdmrAM35VscVgKaeWwY9NT1yIZHwkM0RXCoXVAlod9pC Mi+QrWkpA0BfPvAeRh645scvvj+NydRg4kirBP7UlblBRPKxFaeFlkb92mt5YT/pSzDP yVwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cG+Re7Ql; 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 y8si7682315edd.355.2019.10.06.10.43.34; Sun, 06 Oct 2019 10:43:57 -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=cG+Re7Ql; 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 S1730975AbfJFRkC (ORCPT + 99 others); Sun, 6 Oct 2019 13:40:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:39526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730967AbfJFRkB (ORCPT ); Sun, 6 Oct 2019 13:40: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 DC9B92087E; Sun, 6 Oct 2019 17:39:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383600; bh=UAfTYj9dSSWlNwqhJHR1m9xmDES6sax0XfOL7/szap8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cG+Re7QleUuPwYWPTGjOlV+Mt4LswALube3/NKTmJ0KekTWKj89k3Ya/OU5UbUGiZ S2xgvZZcLyE0e/A7NVaTHiZjeQIw5eULn8Ko1ZWYTxOePmAC3STuocqvxI1MqBDGQh upfH4rBNQuN+gmsMDIZZhzzueB4ODoCiVMc1uTyc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Cercueil , Stephen Boyd , Sasha Levin Subject: [PATCH 5.3 026/166] clk: ingenic/jz4740: Fix "pll half" divider not read/written properly Date: Sun, 6 Oct 2019 19:19:52 +0200 Message-Id: <20191006171215.318003328@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171212.850660298@linuxfoundation.org> References: <20191006171212.850660298@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: Paul Cercueil [ Upstream commit 568b9de48d80bcf1a92e2c4fa67651abbb8ebfe2 ] The code was setting the bit 21 of the CPCCR register to use a divider of 2 for the "pll half" clock, and clearing the bit to use a divider of 1. This is the opposite of how this register field works: a cleared bit means that the /2 divider is used, and a set bit means that the divider is 1. Restore the correct behaviour using the newly introduced .div_table field. Signed-off-by: Paul Cercueil Link: https://lkml.kernel.org/r/20190701113606.4130-1-paul@crapouillou.net Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/ingenic/jz4740-cgu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/clk/ingenic/jz4740-cgu.c b/drivers/clk/ingenic/jz4740-cgu.c index 4c0a20949c2c2..9b27d75d9485c 100644 --- a/drivers/clk/ingenic/jz4740-cgu.c +++ b/drivers/clk/ingenic/jz4740-cgu.c @@ -53,6 +53,10 @@ static const u8 jz4740_cgu_cpccr_div_table[] = { 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, }; +static const u8 jz4740_cgu_pll_half_div_table[] = { + 2, 1, +}; + static const struct ingenic_cgu_clk_info jz4740_cgu_clocks[] = { /* External clocks */ @@ -86,7 +90,10 @@ static const struct ingenic_cgu_clk_info jz4740_cgu_clocks[] = { [JZ4740_CLK_PLL_HALF] = { "pll half", CGU_CLK_DIV, .parents = { JZ4740_CLK_PLL, -1, -1, -1 }, - .div = { CGU_REG_CPCCR, 21, 1, 1, -1, -1, -1 }, + .div = { + CGU_REG_CPCCR, 21, 1, 1, -1, -1, -1, + jz4740_cgu_pll_half_div_table, + }, }, [JZ4740_CLK_CCLK] = { -- 2.20.1