1
0
Fork 0

Here's a trio of fixes:

- The runtime PM clk patches that landed this merge window forgot to
    runtime resume devices that may be off while recalculating and setting
    rates of child clks of whatever clk is changing rates.
 
  - We had a NULL pointer deref in an old clk tracepoint when clk_set_parent()
    is called with a NULL parent pointer. This shouldn't really happen, but
    it's best to avoid this regardless.
 
  - The sun9i-mmc clk driver didn't provide 'reset' support, just 'assert'
    and 'deassert' so the MMC driver stopped probing when the probe was changed
    to do a reset instead of assert/deassert pair. This implements the reset so
    things work again.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCAAGBQJaPDpGAAoJEK0CiJfG5JUlMvIP/AtbqPVztT+YvVEXZhs2bUqD
 oTxg6G0mH5kLe90D+HksXJDlorn7a2VEkEqlqTXEkHReEs8OLf5YgvKvf+YCD9Fp
 Ouvn8Hi9YMok81EYP+X/84dfHrhNiEpgnQLw4epR/8g0Q5odIHZVOpTPOUtFC7Hv
 EcEog3brXS4hcTABzbKVS2YC3eOchg3CxglGjTsogrT9IUN/R/SbXDIU2mzgVoXQ
 hJWkWC2YYIL1mREbnV9FS1jBOpMUkr6wrtFKIMB0ayy5d7bs9uXd0uw5Lh3fu5d0
 yrXstCqF5zdfnr/4garDVsp2G40ScJwepP6ixcfbf6czbT+wHNhKtahHwJCNSLh3
 t7taVnojSuBLAjgllufFq73OY8+UUGShnQz1zh37P2ndoeOra5ULUjKg6UdicS2w
 tkhgeKsZLLVmy8lNb83nqGNR/oU9zXcmvCRWW/3rvxE2RidvEqur/6GKQ1SnZuOP
 Ovp3HcLbn/pU7GcHI6ppn0RKYCyg/F67ES6UvU9/eizJRpnF+SzEOMkFH5IFn7TD
 rthPPNnpGaWiChXwzav6W+R/nS42iT9RwP+9mnDOGWtLAq7f5WBCV8ih7HSsDJzW
 4UhLswQQrW/7uPP6nezC25EQTtjPlLfiyJSwK5Suqd/6e/V4elzT3o4s3dBciLM9
 JTkXmwQCiefzwwifml58
 =kvSh
 -----END PGP SIGNATURE-----

Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux

Pull clk fixes from Stephen Boyd:
 "Here's a trio of fixes:

   - The runtime PM clk patches that landed this merge window forgot to
     runtime resume devices that may be off while recalculating and
     setting rates of child clks of whatever clk is changing rates.

   - We had a NULL pointer deref in an old clk tracepoint when
     clk_set_parent() is called with a NULL parent pointer. This
     shouldn't really happen, but it's best to avoid this regardless.

   - The sun9i-mmc clk driver didn't provide 'reset' support, just
     'assert' and 'deassert' so the MMC driver stopped probing when the
     probe was changed to do a reset instead of assert/deassert pair.
     This implements the reset so things work again"

* tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
  clk: sunxi: sun9i-mmc: Implement reset callback for reset controls
  clk: fix a panic error caused by accessing NULL pointer
  clk: Manage proper runtime PM state in clk_change_rate()
hifive-unleashed-5.1
Linus Torvalds 2017-12-22 11:48:36 -08:00
commit 7edc3f20ef
3 changed files with 19 additions and 2 deletions

View File

@ -1564,6 +1564,9 @@ static void clk_change_rate(struct clk_core *core)
best_parent_rate = core->parent->rate;
}
if (clk_pm_runtime_get(core))
return;
if (core->flags & CLK_SET_RATE_UNGATE) {
unsigned long flags;
@ -1634,6 +1637,8 @@ static void clk_change_rate(struct clk_core *core)
/* handle the new child who might not be in core->children yet */
if (core->new_child)
clk_change_rate(core->new_child);
clk_pm_runtime_put(core);
}
static int clk_core_set_rate_nolock(struct clk_core *core,

View File

@ -16,6 +16,7 @@
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/of.h>
#include <linux/of_device.h>
@ -83,9 +84,20 @@ static int sun9i_mmc_reset_deassert(struct reset_controller_dev *rcdev,
return 0;
}
static int sun9i_mmc_reset_reset(struct reset_controller_dev *rcdev,
unsigned long id)
{
sun9i_mmc_reset_assert(rcdev, id);
udelay(10);
sun9i_mmc_reset_deassert(rcdev, id);
return 0;
}
static const struct reset_control_ops sun9i_mmc_reset_ops = {
.assert = sun9i_mmc_reset_assert,
.deassert = sun9i_mmc_reset_deassert,
.reset = sun9i_mmc_reset_reset,
};
static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev)

View File

@ -134,12 +134,12 @@ DECLARE_EVENT_CLASS(clk_parent,
TP_STRUCT__entry(
__string( name, core->name )
__string( pname, parent->name )
__string( pname, parent ? parent->name : "none" )
),
TP_fast_assign(
__assign_str(name, core->name);
__assign_str(pname, parent->name);
__assign_str(pname, parent ? parent->name : "none");
),
TP_printk("%s %s", __get_str(name), __get_str(pname))