1. 27 Feb, 2019 2 commits
  2. 12 Feb, 2019 8 commits
  3. 31 Jan, 2019 3 commits
  4. 26 Jan, 2019 4 commits
    • Lucas Stach's avatar
      clk: imx6q: reset exclusive gates on init · cc3620b8
      Lucas Stach authored
      [ Upstream commit f7542d81 ]
      
      The exclusive gates may be set up in the wrong way by software running
      before the clock driver comes up. In that case the exclusive setup is
      locked in its initial state, as the complementary function can't be
      activated without disabling the initial setup first.
      
      To avoid this lock situation, reset the exclusive gates to the off
      state and allow the kernel to provide the proper setup.
      Signed-off-by: 's avatarLucas Stach <l.stach@pengutronix.de>
      Reviewed-by: 's avatarDong Aisheng <Aisheng.dong@nxp.com>
      Signed-off-by: 's avatarStephen Boyd <sboyd@kernel.org>
      Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
      cc3620b8
    • A.s. Dong's avatar
      clk: imx: make mux parent strings const · 6029666f
      A.s. Dong authored
      [ Upstream commit 9e5ef7a5 ]
      
      As the commit 2893c379 ("clk: make strings in parent name arrays
      const"), let's make the parent strings const, otherwise we may meet
      the following warning when compiling:
      
      drivers/clk/imx/clk-imx7ulp.c: In function 'imx7ulp_clocks_init':
      drivers/clk/imx/clk-imx7ulp.c:73:35: warning: passing argument 5 of
      	'imx_clk_mux_flags' discards 'const' qualifier from pointer target type
      
        clks[IMX7ULP_CLK_APLL_PRE_SEL] = imx_clk_mux_flags("apll_pre_sel", base + 0x508, 0,
      	1, pll_pre_sels, ARRAY_SIZE(pll_pre_sels), CLK_SET_PARENT_GATE);
                                         ^
      In file included from drivers/clk/imx/clk-imx7ulp.c:23:0:
      drivers/clk/imx/clk.h:200:27: note: expected 'const char **' but argument is
       of type 'const char * const*'
      ...
      
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Signed-off-by: 's avatarDong Aisheng <aisheng.dong@nxp.com>
      Signed-off-by: 's avatarStephen Boyd <sboyd@kernel.org>
      Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
      6029666f
    • Martin Blumenstingl's avatar
      clk: meson: meson8b: fix incorrect divider mapping in cpu_scale_table · 857420d3
      Martin Blumenstingl authored
      [ Upstream commit ad9b2b8e ]
      
      The public S805 datasheet only mentions that
      HHI_SYS_CPU_CLK_CNTL1[20:29] contains a divider called "cpu_scale_div".
      Unfortunately it does not mention how to use the register contents.
      
      The Amlogic 3.10 GPL kernel sources are using the following code to
      calculate the CPU clock based on that register (taken from
      arch/arm/mach-meson8/clock.c in the 3.10 Amlogic kernel, shortened to
      make it easier to read):
      N = (aml_read_reg32(P_HHI_SYS_CPU_CLK_CNTL1) >> 20) & 0x3FF;
      if (sel == 3) /* use cpu_scale_div */
        div = 2 * N;
      else
        div = ... /* not relevant for this example */
      cpu_clk = parent_clk / div;
      
      This suggests that the formula is: parent_rate / 2 * register_value
      However, running perf (which can measure the CPU clock rate thanks to
      the ARM PMU) shows that this formula is not correct.
      This can be reproduced with the following steps:
      1. boot into u-boot
      2. let the CPU clock run off the XTAL clock:
         mw.l 0xC110419C 0x30 1
      3. set the cpu_scale_div register:
         to value 0x1: mw.l 0xC110415C 0x801016A2 1
         to value 0x2: mw.l 0xC110415C 0x802016A2 1
         to value 0x5: mw.l 0xC110415C 0x805016A2 1
      4. let the CPU clock run off cpu_scale_div:
         mw.l 0xC110419C 0xbd 1
      5. boot Linux
      6. run: perf stat -aB stress --cpu 4 --timeout 10
      7. check the "cycles" value
      
      I get the following results depending on the cpu_scale_div value:
      - (cpu_in_sel - this is the input clock for cpu_scale_div - runs at
         1.2GHz)
      - 0x1 = 300MHz
      - 0x2 = 200MHz
      - 0x5 = 100MHz
      
      This means that the actual formula to calculate the output of the
      cpu_scale_div clock is: parent_rate / 2 * (register value + 1).
      
      The register value 0x0 is reserved. When letting the CPU clock run off
      the cpu_scale_div while the value is 0x0 the whole board hangs (even in
      u-boot).
      
      I also verified this with the TWD timer: when adding this to the .dts
      without specifying it's clock it will auto-detect the PERIPH (which is
      the input clock of the TWD) clock rate (and the result is shown in the
      kernel log). On Meson8, Meson8b and Meson8m2 the PERIPH clock is CPUCLK
      divided by 4. This also matched for all three test-cases from above (in
      all cases the TWD timer clock rate was approx. one fourth of the CPU
      clock rate).
      
      A small note regarding the "fixes" tag: the original issue seems to
      exist virtually since forever. Even commit 28b9fcd0 ("clk:
      meson8b: Add support for Meson8b clocks") seems to handle this wrong. I
      still decided to use commit 251b6fd3 ("clk: meson: rework meson8b
      cpu clock") because this is the first commit which gets the CPU hiearchy
      correct and thus it's the first commit where the cpu_scale_div register
      is used correctly (apart from the bug in the cpu_scale_table).
      
      Fixes: 251b6fd3 ("clk: meson: rework meson8b cpu clock")
      Signed-off-by: 's avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Signed-off-by: Neil Armstrong's avatarNeil Armstrong <narmstrong@baylibre.com>
      Link: https://lkml.kernel.org/r/20180927085921.24627-2-martin.blumenstingl@googlemail.comSigned-off-by: 's avatarSasha Levin <sashal@kernel.org>
      857420d3
    • Martin Blumenstingl's avatar
      clk: meson: meson8b: add support for more M/N values in sys_pll · 92941af1
      Martin Blumenstingl authored
      [ Upstream commit e36c7e98 ]
      
      The sys_pll on the EC-100 board is configured to 1584MHz at boot
      (either by u-boot, firmware or chip defaults). This is achieved by using
      M = 66, N = 1 (24MHz * 66 / 1).
      At boot the CPU clock is running off sys_pll divided by 2 which results
      in 792MHz. Thus M = 66 is considered to be a "safe" value for Meson8b.
      
      To achieve 1608MHz (one of the CPU OPPs on Meson8 and Meson8m2) we need
      M = 67, N = 1. I ran "stress --cpu 4" while infinitely cycling through
      all available frequencies on my Meson8m2 board and could not spot any
      issues with this setting (after ~12 hours of running this).
      
      On Meson8, Meson8b and Meson8m2 we also want to be able to use 408MHz
      and 816MHz CPU frequencies. These can be achieved by dividing sys_pll by
      4 (for 408MHz) or 2 (for 816MHz). That means that sys_pll has to run at
      1632MHz which can be generated using M = 68, N = 1.
      Similarily we also want to be able to use 1008MHz as CPU frequency. This
      means that sys_pll has to run either at 1008MHz or 2016MHz. The former
      would result in an M value of 42, which is lower than the smallest value
      used by the 3.10 GPL kernel sources from Amlogic (50 is the lower limit
      there). Thus we need to run sys_pll at 2016MHz which can ge generated
      using M = 84, N = 1.
      I tested M = 68 and M = 84 on my Meson8b Odroid-C1 and my Meson8m2 board
      by running "stress --cpu 4" while infinitely cycling thorugh all
      available frequencies. I could not spot any issues after ~12 hours of
      running this.
      
      Amlogic's 3.10 GPL kernel sources have more M/N combinations. I did not
      add them yet because M = 74 (to achieve close to 1800MHz on Meson8) and
      M = 82 (to achieve close to 1992MHz on Meson8 as well) caused my
      Meson8m2 board to hang randomly. It's not clear why this is (for example
      because the board's voltage regulator design is bad, some missing bits
      for these values in our clk-pll driver, etc.). Thus the following M
      values from the Amlogic 3.10 GPL kernel sources are skipped as of now:
      69, 70, 71, 72, 73, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98
      Signed-off-by: 's avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Acked-by: Jerome Brunet's avatarJerome Brunet <jbrunet@baylibre.com>
      Signed-off-by: Neil Armstrong's avatarNeil Armstrong <narmstrong@baylibre.com>
      Link: https://lkml.kernel.org/r/20181115224048.13511-5-martin.blumenstingl@googlemail.comSigned-off-by: 's avatarSasha Levin <sashal@kernel.org>
      92941af1
  5. 09 Jan, 2019 2 commits
  6. 10 Dec, 2018 1 commit
  7. 03 Dec, 2018 3 commits
  8. 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: 's avatarStephen Boyd <swboyd@chromium.org>
      Reviewed-by: 's avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: 's avatarStephen Boyd <sboyd@kernel.org>
      b181b3b8
  9. 14 Nov, 2018 1 commit
  10. 09 Nov, 2018 1 commit
  11. 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: Jerome Brunet's avatarJerome Brunet <jbrunet@baylibre.com>
      Acked-by: Neil Armstrong's avatarNeil Armstrong <narmstrong@baylibre.com>
      Signed-off-by: 's avatarStephen Boyd <sboyd@kernel.org>
      d6ee1e7e
    • Chris Hewitt's avatar
      clk: meson-gxbb: set fclk_div3 as CLK_IS_CRITICAL · e2576c8b
      Chris 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: Chris Hewitt's avatarChristian Hewitt <christianshewitt@gmail.com>
      Signed-off-by: Jerome Brunet's avatarJerome Brunet <jbrunet@baylibre.com>
      Signed-off-by: 's avatarStephen Boyd <sboyd@kernel.org>
      e2576c8b
  12. 06 Nov, 2018 1 commit
  13. 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: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
      Suggested-by: 's 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: 's 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: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's 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: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
      Signed-off-by: 's avatarStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: 's 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: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's 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: 's 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: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
      eb31d559
  14. 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: 's avatarEvan Green <evgreen@chromium.org>
      Signed-off-by: 's 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: 's avatarAlan Tull <atull@kernel.org>
      Fixes: 435779fe ("clk: fixed-rate: Convert into a module platform driver")
      Signed-off-by: 's 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: Nathan Chancellor's avatarNathan Chancellor <natechancellor@gmail.com>
      Fixes: 8985167e ("clk: s2mps11: Fix matching when built as module and DT node contains compatible")
      Signed-off-by: 's 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: 's avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: 's avatarStephen Boyd <sboyd@kernel.org>
      2725991e
  15. 17 Oct, 2018 4 commits