1. 04 5月, 2019 1 次提交
  2. 13 4月, 2019 2 次提交
  3. 11 4月, 2019 1 次提交
  4. 29 3月, 2019 1 次提交
  5. 25 3月, 2019 1 次提交
  6. 20 3月, 2019 3 次提交
  7. 19 3月, 2019 1 次提交
  8. 13 3月, 2019 1 次提交
    • M
      treewide: add checks for the return value of memblock_alloc*() · 8a7f97b9
      Mike Rapoport 提交于
      Add check for the return value of memblock_alloc*() functions and call
      panic() in case of error.  The panic message repeats the one used by
      panicing memblock allocators with adjustment of parameters to include
      only relevant ones.
      
      The replacement was mostly automated with semantic patches like the one
      below with manual massaging of format strings.
      
        @@
        expression ptr, size, align;
        @@
        ptr = memblock_alloc(size, align);
        + if (!ptr)
        + 	panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__, size, align);
      
      [anders.roxell@linaro.org: use '%pa' with 'phys_addr_t' type]
        Link: http://lkml.kernel.org/r/20190131161046.21886-1-anders.roxell@linaro.org
      [rppt@linux.ibm.com: fix format strings for panics after memblock_alloc]
        Link: http://lkml.kernel.org/r/1548950940-15145-1-git-send-email-rppt@linux.ibm.com
      [rppt@linux.ibm.com: don't panic if the allocation in sparse_buffer_init fails]
        Link: http://lkml.kernel.org/r/20190131074018.GD28876@rapoport-lnx
      [akpm@linux-foundation.org: fix xtensa printk warning]
      Link: http://lkml.kernel.org/r/1548057848-15136-20-git-send-email-rppt@linux.ibm.comSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: NAnders Roxell <anders.roxell@linaro.org>
      Reviewed-by: Guo Ren <ren_guo@c-sky.com>		[c-sky]
      Acked-by: Paul Burton <paul.burton@mips.com>		[MIPS]
      Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>	[s390]
      Reviewed-by: Juergen Gross <jgross@suse.com>		[Xen]
      Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>	[m68k]
      Acked-by: Max Filippov <jcmvbkbc@gmail.com>		[xtensa]
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dennis Zhou <dennis@kernel.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8a7f97b9
  9. 09 3月, 2019 2 次提交
    • T
      clk: ti: clkctrl: Fix clkdm_name regression for TI_CLK_CLKCTRL_COMPAT · d17a718d
      Tony Lindgren 提交于
      Commit a72d7850 ("clk: ti: Prepare for remove of OF node name")
      changed the code to use kasprintf() for provider->clkdm_name but also
      changed the offset used later on by three. We don't need to change the
      offset as we already have the extra three characters in the format for
      kasprintf with "%pOFnxxx".
      
      This caused the clocks with TI_CLK_CLKCTRL_COMPAT to have NULL
      clk->clkdm_name for omap4 and 5. And null clkdm_name can cause module
      reset, enable, and idle to fail.
      
      The issue can also be seen also when enabling DEBUG for clkctrl.c
      and then we start seeing "clock: could not associate" messages for
      omap4 and 5 as the generated name is something like "l4_wkclkdm" instead
      of "l4_wkup_clkdm" that's needed.
      
      Let's fix the issue with a partial revert of commit a72d7850 ("clk:
      ti: Prepare for remove of OF node name").
      
      ALso note that in general code should not depend on the dts node names.
      And the node names should be generic types like clock-domain in this case.
      This could be fixed later by using separate compatible properties for the
      clockdomains, or by adding soc_device_match() table with reg offsets
      to the driver. But let's fix the regression first.
      
      Fixes: a72d7850 ("clk: ti: Prepare for remove of OF node name")
      Cc: Tero Kristo <t-kristo@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NStephen Boyd <sboyd@kernel.org>
      d17a718d
    • K
      clk: fixup default index for of_clk_get_by_name() · 65cf20ad
      Kuninori Morimoto 提交于
      of_clk_get_by_name() is using -1 for __of_clk_get() index.  It will go
      to of_parse_clkspec(), and be used for of_parse_phandle_with_args().
      Here, if user doesn't specify clock name (= of_clk_get_by_name(np,
      NULL)), this index is still -1, and of_parse_phandle_with_args() will
      return -EINVAL (This index will be updated if if it had clock name).
      clk_get_by_name(np, NULL) should work, then, default index should be 0
      instead of -1. This patch fixes it.
      
      Fixes: 4472287a ("clk: Introduce of_clk_get_hw_from_clkspec()")
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NStephen Boyd <sboyd@kernel.org>
      65cf20ad
  10. 02 3月, 2019 5 次提交
    • S
      clk: Move of_clk_*() APIs into clk.c from clkdev.c · cf13f289
      Stephen Boyd 提交于
      The API between clk.c and clkdev.c is purely getting the clk_hw
      structure (or the struct clk if it's not CCF) and then turning that
      struct clk_hw pointer into a struct clk pointer via clk_hw_create_clk().
      There's no need to complicate clkdev.c with these DT parsing details
      that are only relevant to the common clk framework. Move the DT parsing
      logic into the core framework and just expose the APIs to get a clk_hw
      pointer and convert it.
      
      Cc: Miquel Raynal <miquel.raynal@bootlin.com>
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Jeffrey Hugo <jhugo@codeaurora.org>
      Cc: Chen-Yu Tsai <wens@csie.org>
      Signed-off-by: NStephen Boyd <sboyd@kernel.org>
      cf13f289
    • S
      clk: Inform the core about consumer devices · efa85048
      Stephen Boyd 提交于
      We'd like to have a pointer to the device that's consuming a particular
      clk in the clk framework so we can link the consumer to the clk provider
      with a PM device link. Add a device argument to clk_hw_create_clk() for
      this so it can be used in subsequent patches to add and remove the link.
      
      Cc: Miquel Raynal <miquel.raynal@bootlin.com>
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Jeffrey Hugo <jhugo@codeaurora.org>
      Cc: Chen-Yu Tsai <wens@csie.org>
      Signed-off-by: NStephen Boyd <sboyd@kernel.org>
      efa85048
    • S
      clk: Introduce of_clk_get_hw_from_clkspec() · 4472287a
      Stephen Boyd 提交于
      We want to get struct clk_hw pointers from a DT clk specifier (i.e. a
      clocks property) so that we can find parent clks without searching for
      globally unique clk names. This should save time by avoiding the global
      string search for clks that are external to the clock controller
      providing the clk and let us move away from string comparisons in
      general.
      
      Introduce of_clk_get_hw_from_clkspec() which is largely the DT parsing
      part of finding clks implemented in clkdev.c and have that return a
      clk_hw pointer instead of converting that into a clk pointer. This lets
      us push up the clk pointer creation to the caller in clk_get() and
      avoids the need to push the dev_id and con_id throughout the DT parsing
      code.
      
      Cc: Miquel Raynal <miquel.raynal@bootlin.com>
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Jeffrey Hugo <jhugo@codeaurora.org>
      Cc: Chen-Yu Tsai <wens@csie.org>
      Signed-off-by: NStephen Boyd <sboyd@kernel.org>
      4472287a
    • M
      clk: core: clarify the check for runtime PM · 24478839
      Miquel Raynal 提交于
      Currently, the core->dev entry is populated only if runtime PM is
      enabled. Doing so prevents accessing the device structure in any
      case.
      
      Keep the same logic but instead of using the presence of core->dev as
      the only condition, also check the status of
      pm_runtime_enabled(). Then, we can set the core->dev pointer at any
      time as long as a device structure is available.
      
      This change will help supporting device links in the clock subsystem.
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Jeffrey Hugo <jhugo@codeaurora.org>
      Cc: Chen-Yu Tsai <wens@csie.org>
      [sboyd@kernel.org: Change to a boolean flag]
      Signed-off-by: NStephen Boyd <sboyd@kernel.org>
      24478839
    • S
      clk: Combine __clk_get() and __clk_create_clk() · 1df4046a
      Stephen Boyd 提交于
      The __clk_get() function is practically a private clk implementation
      detail now. No architecture defines it, and given that new code should
      be using the common clk framework there isn't a need for it to keep
      existing just to serve clkdev purposes. Let's fold it into the
      __clk_create_clk() function and make that a little more generic by
      renaming it to clk_hw_create_clk(). This will allow the framework to
      create a struct clk handle to a particular clk_hw pointer and link it up
      as a consumer wherever that's needed.
      
      Doing this also lets us get rid of the __clk_free_clk() API that had to
      be kept in sync with __clk_put(). Splitting that API up into the "link
      and unlink from consumer list" phase and "free the clk pointer" phase
      allows us to reuse that logic in a couple places, simplifying the code.
      
      Cc: Miquel Raynal <miquel.raynal@bootlin.com>
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Jeffrey Hugo <jhugo@codeaurora.org>
      Cc: Chen-Yu Tsai <wens@csie.org>
      Signed-off-by: NStephen Boyd <sboyd@kernel.org>
      1df4046a
  11. 01 3月, 2019 1 次提交
  12. 27 2月, 2019 8 次提交
  13. 26 2月, 2019 4 次提交
  14. 23 2月, 2019 6 次提交
  15. 22 2月, 2019 3 次提交
    • A
      clk: x86: Move clk-lpss.h to platform_data/x86 · a9443a63
      Andy Shevchenko 提交于
      clk-lpss.h is solely x86 related header. Move it to correct folder.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NStephen Boyd <sboyd@kernel.org>
      a9443a63
    • K
      clk: fractional-divider: check parent rate only if flag is set · d13501a2
      Katsuhiro Suzuki 提交于
      Custom approximation of fractional-divider may not need parent clock
      rate checking. For example Rockchip SoCs work fine using grand parent
      clock rate even if target rate is greater than parent.
      
      This patch checks parent clock rate only if CLK_SET_RATE_PARENT flag
      is set.
      
      For detailed example, clock tree of Rockchip I2S audio hardware.
        - Clock rate of CPLL is 1.2GHz, GPLL is 491.52MHz.
        - i2s1_div is integer divider can divide N (N is 1~128).
          Input clock is CPLL or GPLL. Initial divider value is N = 1.
          Ex) PLL = CPLL, N = 10, i2s1_div output rate is
            CPLL / 10 = 1.2GHz / 10 = 120MHz
        - i2s1_frac is fractional divider can divide input to x/y, x and
          y are 16bit integer.
      
      CPLL --> | selector | ---> i2s1_div -+--> | selector | --> I2S1 MCLK
      GPLL --> |          | ,--------------'    |          |
                            `--> i2s1_frac ---> |          |
      
      Clock mux system try to choose suitable one from i2s1_div and
      i2s1_frac for master clock (MCLK) of I2S1.
      
      Bad scenario as follows:
        - Try to set MCLK to 8.192MHz (32kHz audio replay)
          Candidate setting is
          - i2s1_div: GPLL / 60 = 8.192MHz
          i2s1_div candidate is exactly same as target clock rate, so mux
          choose this clock source. i2s1_div output rate is changed
          491.52MHz -> 8.192MHz
      
        - After that try to set to 11.2896MHz (44.1kHz audio replay)
          Candidate settings are
          - i2s1_div : CPLL / 107 = 11.214945MHz
          - i2s1_frac: i2s1_div   = 8.192MHz
            This is because clk_fd_round_rate() thinks target rate
            (11.2896MHz) is higher than parent rate (i2s1_div = 8.192MHz)
            and returns parent clock rate.
      
      Above is current upstreamed behavior. Clock mux system choose
      i2s1_div, but this clock rate is not acceptable for I2S driver, so
      users cannot replay audio.
      
      Expected behavior is:
        - Try to set master clock to 11.2896MHz (44.1kHz audio replay)
          Candidate settings are
          - i2s1_div : CPLL / 107          = 11.214945MHz
          - i2s1_frac: i2s1_div * 147/6400 = 11.2896MHz
                       Change i2s1_div to GPLL / 1 = 491.52MHz at same
                       time.
      
      If apply this commit, clk_fd_round_rate() calls custom approximate
      function of Rockchip even if target rate is higher than parent.
      Custom function changes both grand parent (i2s1_div) and parent
      (i2s_frac) settings at same time. Clock mux system can choose
      i2s1_frac and audio works fine.
      Signed-off-by: NKatsuhiro Suzuki <katsuhiro@katsuster.net>
      Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
      [sboyd@kernel.org: Make function into a macro instead]
      Signed-off-by: NStephen Boyd <sboyd@kernel.org>
      d13501a2
    • J
      clk: qcom: Make common clk_hw registrations · 760be658
      Jeffrey Hugo 提交于
      Several clock controller drivers define a list of clk_hw devices, and then
      register those devices in probe() before using common code to process the
      rest of initialization.  Extend the common code to accept a list of clk_hw
      devices to process, thus eliminating many duplicate implementations.
      Signed-off-by: NJeffrey Hugo <jhugo@codeaurora.org>
      Suggested-by: NStephen Boyd <sboyd@kernel.org>
      Reviewed-by: NVinod Koul <vkoul@kernel.org>
      Tested-by: NVinod Koul <vkoul@kernel.org>
      Signed-off-by: NStephen Boyd <sboyd@kernel.org>
      760be658