1. 03 Dec, 2018 3 commits
  2. 21 Nov, 2018 1 commit
    • Stephen Boyd's avatar
      clk: qcom: Support 'protected-clocks' property · b181b3b8
      Stephen Boyd authored
      Certain firmware configurations "protect" clks and cause the entire
      system to reboot when a non-secure OS such as Linux tries to read or
      write protected clk registers. But other firmware configurations allow
      reading or writing the same registers, and they may actually require
      that the OS use the otherwise locked down clks. Support the
      'protected-clocks' property by never registering these protected clks
      with the common clk framework. This way, when firmware is protecting
      these clks we won't have the chance to ever read or write these
      registers and take down the entire system.
      
      Cc: Taniya Das <tdas@codeaurora.org>
      Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
      Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      b181b3b8
  3. 14 Nov, 2018 1 commit
  4. 09 Nov, 2018 1 commit
  5. 08 Nov, 2018 2 commits
    • Jerome Brunet's avatar
      clk: meson: axg: mark fdiv2 and fdiv3 as critical · d6ee1e7e
      Jerome Brunet authored
      Similar to gxbb and gxl platforms, axg SCPI Cortex-M co-processor
      uses the fdiv2 and fdiv3 to, among other things, provide the cpu
      clock.
      
      Until clock hand-off mechanism makes its way to CCF and the generic
      SCPI claims platform specific clocks, these clocks must be marked as
      critical to make sure they are never disabled when needed by the
      co-processor.
      
      Fixes: 05f81440 ("clk: meson: add fdiv clock gates")
      Signed-off-by: default avatarJerome Brunet <jbrunet@baylibre.com>
      Acked-by: Neil Armstrong's avatarNeil Armstrong <narmstrong@baylibre.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      d6ee1e7e
    • Christian Hewitt's avatar
      clk: meson-gxbb: set fclk_div3 as CLK_IS_CRITICAL · e2576c8b
      Christian Hewitt authored
      On the Khadas VIM2 (GXM) and LePotato (GXL) board there are problems
      with reboot; e.g. a ~60 second delay between issuing reboot and the
      board power cycling (and in some OS configurations reboot will fail
      and require manual power cycling).
      
      Similar to 'commit c987ac6f ("clk:
      meson-gxbb: set fclk_div2 as CLK_IS_CRITICAL")' the SCPI Cortex-M4
      Co-Processor seems to depend on FCLK_DIV3 being operational.
      
      Until commit 05f81440 ("clk:
      meson: add fdiv clock gates"), this clock was modeled and left on by
      the bootloader.
      
      We don't have precise documentation about the SCPI Co-Processor and
      its clock requirement so we are learning things the hard way.
      
      Marking this clock as critical solves the problem but it should not
      be viewed as final solution. Ideally, the SCPI driver should claim
      these clocks. We also depends on some clock hand-off mechanism
      making its way to CCF, to make sure the clock stays on between its
      registration and the SCPI driver probe.
      
      Fixes: 05f81440 ("clk: meson: add fdiv clock gates")
      Signed-off-by: Christian Hewitt's avatarChristian Hewitt <christianshewitt@gmail.com>
      Signed-off-by: default avatarJerome Brunet <jbrunet@baylibre.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      e2576c8b
  6. 06 Nov, 2018 1 commit
  7. 31 Oct, 2018 3 commits
    • Mike Rapoport's avatar
      memblock: stop using implicit alignment to SMP_CACHE_BYTES · 7e1c4e27
      Mike Rapoport authored
      When a memblock allocation APIs are called with align = 0, the alignment
      is implicitly set to SMP_CACHE_BYTES.
      
      Implicit alignment is done deep in the memblock allocator and it can
      come as a surprise.  Not that such an alignment would be wrong even
      when used incorrectly but it is better to be explicit for the sake of
      clarity and the prinicple of the least surprise.
      
      Replace all such uses of memblock APIs with the 'align' parameter
      explicitly set to SMP_CACHE_BYTES and stop implicit alignment assignment
      in the memblock internal allocation functions.
      
      For the case when memblock APIs are used via helper functions, e.g.  like
      iommu_arena_new_node() in Alpha, the helper functions were detected with
      Coccinelle's help and then manually examined and updated where
      appropriate.
      
      The direct memblock APIs users were updated using the semantic patch below:
      
      @@
      expression size, min_addr, max_addr, nid;
      @@
      (
      |
      - memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid)
      + memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr,
      nid)
      |
      - memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid)
      + memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr,
      nid)
      |
      - memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid)
      + memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid)
      |
      - memblock_alloc(size, 0)
      + memblock_alloc(size, SMP_CACHE_BYTES)
      |
      - memblock_alloc_raw(size, 0)
      + memblock_alloc_raw(size, SMP_CACHE_BYTES)
      |
      - memblock_alloc_from(size, 0, min_addr)
      + memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr)
      |
      - memblock_alloc_nopanic(size, 0)
      + memblock_alloc_nopanic(size, SMP_CACHE_BYTES)
      |
      - memblock_alloc_low(size, 0)
      + memblock_alloc_low(size, SMP_CACHE_BYTES)
      |
      - memblock_alloc_low_nopanic(size, 0)
      + memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES)
      |
      - memblock_alloc_from_nopanic(size, 0, min_addr)
      + memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr)
      |
      - memblock_alloc_node(size, 0, nid)
      + memblock_alloc_node(size, SMP_CACHE_BYTES, nid)
      )
      
      [mhocko@suse.com: changelog update]
      [akpm@linux-foundation.org: coding-style fixes]
      [rppt@linux.ibm.com: fix missed uses of implicit alignment]
        Link: http://lkml.kernel.org/r/20181016133656.GA10925@rapoport-lnx
      Link: http://lkml.kernel.org/r/1538687224-17535-1-git-send-email-rppt@linux.vnet.ibm.comSigned-off-by: default avatarMike Rapoport <rppt@linux.vnet.ibm.com>
      Suggested-by: default avatarMichal Hocko <mhocko@suse.com>
      Acked-by: Paul Burton <paul.burton@mips.com>	[MIPS]
      Acked-by: Michael Ellerman <mpe@ellerman.id.au>	[powerpc]
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7e1c4e27
    • Mike Rapoport's avatar
      mm: remove include/linux/bootmem.h · 57c8a661
      Mike Rapoport authored
      Move remaining definitions and declarations from include/linux/bootmem.h
      into include/linux/memblock.h and remove the redundant header.
      
      The includes were replaced with the semantic patch below and then
      semi-automated removal of duplicated '#include <linux/memblock.h>
      
      @@
      @@
      - #include <linux/bootmem.h>
      + #include <linux/memblock.h>
      
      [sfr@canb.auug.org.au: dma-direct: fix up for the removal of linux/bootmem.h]
        Link: http://lkml.kernel.org/r/20181002185342.133d1680@canb.auug.org.au
      [sfr@canb.auug.org.au: powerpc: fix up for removal of linux/bootmem.h]
        Link: http://lkml.kernel.org/r/20181005161406.73ef8727@canb.auug.org.au
      [sfr@canb.auug.org.au: x86/kaslr, ACPI/NUMA: fix for linux/bootmem.h removal]
        Link: http://lkml.kernel.org/r/20181008190341.5e396491@canb.auug.org.au
      Link: http://lkml.kernel.org/r/1536927045-23536-30-git-send-email-rppt@linux.vnet.ibm.comSigned-off-by: default avatarMike Rapoport <rppt@linux.vnet.ibm.com>
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Serge Semin <fancer.lancer@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      57c8a661
    • Mike Rapoport's avatar
      memblock: remove _virt from APIs returning virtual address · eb31d559
      Mike Rapoport authored
      The conversion is done using
      
      sed -i 's@memblock_virt_alloc@memblock_alloc@g' \
      	$(git grep -l memblock_virt_alloc)
      
      Link: http://lkml.kernel.org/r/1536927045-23536-8-git-send-email-rppt@linux.vnet.ibm.comSigned-off-by: default avatarMike Rapoport <rppt@linux.vnet.ibm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Serge Semin <fancer.lancer@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      eb31d559
  8. 18 Oct, 2018 4 commits
    • Evan Green's avatar
      clk: qcom: Remove unused arrays in SDM845 GCC · 82a4de6f
      Evan Green authored
      This change removes a parent map and parent name array that
      appear to be completely unreferenced.
      Signed-off-by: default avatarEvan Green <evgreen@chromium.org>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      82a4de6f
    • Alan Tull's avatar
      clk: fixed-rate: fix of_node_get-put imbalance · 52091c25
      Alan Tull authored
      When the fixed rate clock is created by devicetree,
      of_clk_add_provider is called.  Add a call to
      of_clk_del_provider in the remove function to balance
      it out.
      Signed-off-by: default avatarAlan Tull <atull@kernel.org>
      Fixes: 435779fe ("clk: fixed-rate: Convert into a module platform driver")
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      52091c25
    • Nathan Chancellor's avatar
      clk: s2mps11: Add used attribute to s2mps11_dt_match · 9c940bbe
      Nathan Chancellor authored
      Clang warns after commit 8985167e ("clk: s2mps11: Fix matching when
      built as module and DT node contains compatible"):
      
      drivers/clk/clk-s2mps11.c:242:34: warning: variable 's2mps11_dt_match'
      is not needed and will not be emitted [-Wunneeded-internal-declaration]
      static const struct of_device_id s2mps11_dt_match[] = {
                                       ^
      1 warning generated.
      
      This warning happens when a variable is used in some construct that
      doesn't require a reference to that variable to be emitted in the symbol
      table; in this case, it's MODULE_DEVICE_TABLE, which only needs to hold
      the data of the variable, not the variable itself.
      
      $ nm -S drivers/clk/clk-s2mps11.o | rg s2mps11_dt_match
      00000078 000003d4 R __mod_of__s2mps11_dt_match_device_table
      
      Normally, with device ID table variables, it means that the variable
      just needs to be tied to the device declaration at the bottom of the
      file, like s2mps11_clk_id:
      
      $ nm -S drivers/clk/clk-s2mps11.o | rg s2mps11_clk_id
      00000000 00000078 R __mod_platform__s2mps11_clk_id_device_table
      00000000 00000078 r s2mps11_clk_id
      
      However, because the comment above this deliberately doesn't want this
      variable added to .of_match_table, we need to mark s2mps11_dt_match as
      __used to silence this warning. This makes it clear to Clang that the
      variable is used for something, even if a reference to it isn't being
      emitted.
      Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Fixes: 8985167e ("clk: s2mps11: Fix matching when built as module and DT node contains compatible")
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      9c940bbe
    • Stephen Boyd's avatar
      clk: qcom: gcc-sdm660: Add MODULE_LICENSE · 2725991e
      Stephen Boyd authored
      Add a module license to match the license at the top of this file and
      silence a build warning.
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      2725991e
  9. 17 Oct, 2018 24 commits