On 13-08-16 01:30 PM, Mike Turquette wrote:
Quoting Zhangfei Gao (2013-08-15 21:03:28)
MUX could choose parent accordingly when set_rate. Add clk_rate_fops to debug whether mux choose correct parent
Example: cat clk_summary clock enable_cnt prepare_cnt rate
osc24mhz 3 3 24000000 bpll 1 1 4294967295 bpll_fout3 0 0 200000000 sfc_mux 0 0 200000000 sfc 0 0 200000000
cat osc24mhz/bpll/bpll_fout3/sfc_mux/sfc/clk_rate 200000000
echo 24000000 > osc24mhz/bpll/bpll_fout3/sfc_mux/sfc/clk_rate cat clk_summary clock enable_cnt prepare_cnt rate
osc24mhz 3 3 24000000 sfc_mux 0 0 24000000 sfc 0 0 24000000 bpll 1 1 4294967295 bpll_fout3 0 0 200000000
cat osc24mhz/sfc_mux/sfc/clk_rate 24000000
Signed-off-by: Zhangfei Gao zhangfei.gao@linaro.org
NACK. This patch just makes it possible to call clk_set_rate on every clock from userspace. I don't support that operation, it just leads to tons of horrible hacks where closed userspace crapplications manage hardware directly.
Also I'm not sure what this patch has to do with the description in the changelog. How does setting the rate of every clock help debug mux clocks? You can already see a mux clocks parent and rate from the existing debugs info.
Regards, Mike
Thanks Mike for the education.
We use this to debug whether mux is really choose correct parent. And even dump the register to see whether config correct or not.
For example, By default, sfc is 200M, with mux's parent is 200M output bpll_fout3. Then we change sfc clock to 24M, and to see whether mux parent change to 24M output osc24mhz.
Otherwise, we have to debug mux choose correct parent from specific driver. There may other method.
Yes, your concern is right, it opens hacking.
Thanks.