Skip to contentSkip to conversation

Patch "clk: qcom: fix RCG M/N counter configuration" has been added to the 3.14-stable tree

PATCH [email protected] 1 participant 1 message May 2, 2015

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

clk: qcom: fix RCG M/N counter configuration

to the 3.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
clk-qcom-fix-rcg-m-n-counter-configuration.patch
and it can be found in the queue-3.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 0b21503dbbfa669dbd847b33578d4041513cddb2 Mon Sep 17 00:00:00 2001

From: Archit Taneja <[email protected]>
Date: Wed, 4 Mar 2015 15:19:35 +0530
Subject: clk: qcom: fix RCG M/N counter configuration

From: Archit Taneja <[email protected]>

commit 0b21503dbbfa669dbd847b33578d4041513cddb2 upstream.

Currently, a RCG's M/N counter (used for fraction division) is set to either 'bypass' (counter disabled) or 'dual edge' (counter enabled) based on whether the corresponding rcg struct has a mnd field specified and a non-zero N.

In the case where M and N are the same value, the M/N counter is still enabled by code even though no division takes place. Leaving the RCG in such a state can result in improper behavior. This was observed with the DSI pixel clock RCG when M and N were both set to 1.

Add an additional check (M != N) to enable the M/N counter only when it's needed for fraction division.

Fixes bcd61c0f535a (clk: qcom: Add support for root clock

generators (RCGs))

---
 drivers/clk/qcom/clk-rcg2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/qcom/clk-rcg2.c +1 -1
@@ -257,7 +257,7 @@ static int __clk_rcg2_set_rate(struct cl
 	mask |= CFG_SRC_SEL_MASK | CFG_MODE_MASK;
 	cfg = f->pre_div << CFG_SRC_DIV_SHIFT;
 	cfg |= rcg->parent_map[f->src] << CFG_SRC_SEL_SHIFT;
-	if (rcg->mnd_width && f->n)
+	if (rcg->mnd_width && f->n && (f->m != f->n))
 		cfg |= CFG_MODE_DUAL_EDGE;
 	ret = regmap_update_bits(rcg->clkr.regmap, rcg->cmd_rcgr + CFG_REG, mask,
 			cfg);

Patches currently in stable-queue which might be from [email protected] are

queue-3.14/clk-qcom-fix-rcg-m-n-counter-configuration.patch