lkml.org 
[lkml]   [2019]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v12 05/13] clk: ingenic: Add driver for the TCU clocks
Date
Quoting Paul Cercueil (2019-06-07 14:59:54)
> Hi Stephen, thanks for the review.
> > Quoting Paul Cercueil (2019-05-21 07:51:33)
> >> diff --git a/drivers/clk/ingenic/tcu.c b/drivers/clk/ingenic/tcu.c
> >> new file mode 100644
> >> index 000000000000..7249225a6994
> >> --- /dev/null
> >> +++ b/drivers/clk/ingenic/tcu.c
> >> @@ -0,0 +1,458 @@
> >> +// SPDX-License-Identifier: GPL-2.0
> >> +/*
> >> + * JZ47xx SoCs TCU clocks driver
> >> + * Copyright (C) 2019 Paul Cercueil <paul@crapouillou.net>
> >> + */
> >> +
> >> +#include <linux/clk.h>
> >> +#include <linux/clk-provider.h>
> >> +#include <linux/clkdev.h>
> >> +#include <linux/clockchips.h>
> >> +#include <linux/mfd/ingenic-tcu.h>
> >> +#include <linux/regmap.h>
> >> +
> >> +#include <dt-bindings/clock/ingenic,tcu.h>
> >> +
> >> +/* 8 channels max + watchdog + OST */
> >> +#define TCU_CLK_COUNT 10
> >> +
> >> +#define TCU_ERR(...) pr_crit("ingenic-tcu-clk: " __VA_ARGS__)
> >
> > Why is it pr_crit instead of pr_err()?
>
> If the TCU timer clocks are not provided for any reason, the system
> will have no timer, and the kernel will hang very early in the init
> process. That's why I chose pr_crit().

HMm. So maybe it should be TCU_CRIT() then? Or just drop the wrapper
macro and define a pr_fmt for this file that has ingenic-tcu-clk: for
it?

>
> Most of the code here works without a struct device, it wouldn't be
> easy to
> get it to work with runtime PM.
>
> I can enable the "tcu" clock in the probe and just gate/ungate it in the
> suspend/resume callbacks, that would work just fine. We don't need
> anything
> fancy here.

OK. That sounds like a better approach to gate and ungate in
suspend/resume.

\
 
 \ /
  Last update: 2019-06-08 00:50    [W:0.040 / U:1.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site