15 Aug, 2020

2 commits

  • Patch series "iomap: Constify ioreadX() iomem argument", v3.

    The ioread8/16/32() and others have inconsistent interface among the
    architectures: some taking address as const, some not.

    It seems there is nothing really stopping all of them to take pointer to
    const.

    This patch (of 4):

    The ioreadX() and ioreadX_rep() helpers have inconsistent interface. On
    some architectures void *__iomem address argument is a pointer to const,
    on some not.

    Implementations of ioreadX() do not modify the memory under the address so
    they can be converted to a "const" version for const-safety and
    consistency among architectures.

    [krzk@kernel.org: sh: clk: fix assignment from incompatible pointer type for ioreadX()]
    Link: http://lkml.kernel.org/r/20200723082017.24053-1-krzk@kernel.org
    [akpm@linux-foundation.org: fix drivers/mailbox/bcm-pdc-mailbox.c]
    Link: http://lkml.kernel.org/r/202007132209.Rxmv4QyS%25lkp@intel.com

    Suggested-by: Geert Uytterhoeven
    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Andrew Morton
    Reviewed-by: Geert Uytterhoeven
    Reviewed-by: Arnd Bergmann
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: "James E.J. Bottomley"
    Cc: Helge Deller
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Yoshinori Sato
    Cc: Rich Felker
    Cc: Kalle Valo
    Cc: "David S. Miller"
    Cc: Jakub Kicinski
    Cc: Dave Jiang
    Cc: Jon Mason
    Cc: Allen Hubbe
    Cc: "Michael S. Tsirkin"
    Cc: Jason Wang
    Link: http://lkml.kernel.org/r/20200709072837.5869-1-krzk@kernel.org
    Link: http://lkml.kernel.org/r/20200709072837.5869-2-krzk@kernel.org
    Signed-off-by: Linus Torvalds

    Krzysztof Kozlowski
     
  • SH will get below warning

    ${LINUX}/drivers/sh/clk/cpg.c: In function 'r8':
    ${LINUX}/drivers/sh/clk/cpg.c:41:17: warning: passing argument 1 of 'ioread8'
    discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    return ioread8(addr);
    ^~~~
    In file included from ${LINUX}/arch/sh/include/asm/io.h:21,
    from ${LINUX}/include/linux/io.h:13,
    from ${LINUX}/drivers/sh/clk/cpg.c:14:
    ${LINUX}/include/asm-generic/iomap.h:29:29: note: expected 'void *' but
    argument is of type 'const void *'
    extern unsigned int ioread8(void __iomem *);
    ^~~~~~~~~~~~~~

    We don't need "const" for r8/r16/r32. And we don't need r8/r16/r32
    themselvs. This patch cleanup these.

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Andrew Morton
    Cc: Alan Modra
    Cc: Bin Meng
    Cc: Chen Zhou
    Cc: Geert Uytterhoeven
    Cc: John Paul Adrian Glaubitz
    Cc: Krzysztof Kozlowski
    Cc: Rich Felker
    Cc: Romain Naour
    Cc: Sam Ravnborg
    Cc: Yoshinori Sato
    X-MARC-Message: https://marc.info/?l=linux-renesas-soc&m=157852973916903
    Signed-off-by: Linus Torvalds

    Kuninori Morimoto
     

06 Jan, 2020

1 commit


18 Oct, 2019

1 commit

  • As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
    pr_warning"), removing pr_warning so all logging messages use a
    consistent _warn style. Let's do it.

    Link: http://lkml.kernel.org/r/20191018031850.48498-22-wangkefeng.wang@huawei.com
    To: linux-kernel@vger.kernel.org
    Cc: Yoshinori Sato
    Cc: Rich Felker
    Signed-off-by: Kefeng Wang
    Reviewed-by: Sergey Senozhatsky
    Signed-off-by: Petr Mladek

    Kefeng Wang
     

21 May, 2019

1 commit


15 May, 2019

1 commit


02 Aug, 2018

1 commit


13 Jun, 2018

1 commit

  • The kzalloc() function has a 2-factor argument form, kcalloc(). This
    patch replaces cases of:

    kzalloc(a * b, gfp)

    with:
    kcalloc(a * b, gfp)

    as well as handling cases of:

    kzalloc(a * b * c, gfp)

    with:

    kzalloc(array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    kzalloc_array(array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    kzalloc(4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    kzalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    kzalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    kzalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    - kzalloc
    + kcalloc
    (
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    kzalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    kzalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    kzalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    kzalloc(sizeof(THING) * C2, ...)
    |
    kzalloc(sizeof(TYPE) * C2, ...)
    |
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(C1 * C2, ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

08 Feb, 2018

1 commit

  • Pointer subtraction is slow and tedious. Therefore, replace all instances
    where cpufreq_for_each_{valid_,}entry loops contained such substractions
    with an iteration macro providing an index to the frequency_table entry.

    Suggested-by: Al Viro
    Link: http://lkml.kernel.org/r/20180120020237.GM13338@ZenIV.linux.org.uk
    Acked-by: Viresh Kumar
    Signed-off-by: Dominik Brodowski
    Signed-off-by: Rafael J. Wysocki

    Dominik Brodowski
     

15 Nov, 2017

1 commit

  • Pull dma-mapping updates from Christoph Hellwig:

    - turn dma_cache_sync into a dma_map_ops instance and remove
    implementation that purely are dead because the architecture doesn't
    support noncoherent allocations

    - add a flag for busses that need DMA configuration (Robin Murphy)

    * tag 'dma-mapping-4.15' of git://git.infradead.org/users/hch/dma-mapping:
    dma-mapping: turn dma_cache_sync into a dma_map_ops method
    sh: make dma_cache_sync a no-op
    xtensa: make dma_cache_sync a no-op
    unicore32: make dma_cache_sync a no-op
    powerpc: make dma_cache_sync a no-op
    mn10300: make dma_cache_sync a no-op
    microblaze: make dma_cache_sync a no-op
    ia64: make dma_cache_sync a no-op
    frv: make dma_cache_sync a no-op
    x86: make dma_cache_sync a no-op
    floppy: consolidate the dummy fd_cacheflush definition
    drivers: flag buses which demand DMA configuration

    Linus Torvalds
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

19 Oct, 2017

1 commit

  • sh does not implement DMA_ATTR_NON_CONSISTENT allocations, so it doesn't
    make any sense to do any work in dma_cache_sync given that it
    must be a no-op when dma_alloc_attrs returns coherent memory.

    On the other hand sh uses dma_cache_sync internally in the dma_ops
    implementation and for the maple bus that does not use the DMA API,
    so a the old functionality for dma_cache_sync is still provided under
    the name sh_sync_dma_for_device, and without the redundant dev
    argument. While at it two of the syncing dma_ops also go the proper
    _for_device postfix.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Robin Murphy

    Christoph Hellwig
     

07 Jul, 2017

1 commit


09 Jun, 2017

1 commit


13 Dec, 2016

1 commit

  • The bug in khugepaged fixed earlier in this series shows that radix tree
    slot replacement is fragile; and it will become more so when not only
    NULL!NULL transitions need to be caught but transitions from and to
    exceptional entries as well. We need checks.

    Re-implement radix_tree_replace_slot() on top of the sanity-checked
    __radix_tree_replace(). This requires existing callers to also pass the
    radix tree root, but it'll warn us when somebody replaces slots with
    contents that need proper accounting (transitions between NULL entries,
    real entries, exceptional entries) and where a replacement through the
    slot pointer would corrupt the radix tree node counts.

    Link: http://lkml.kernel.org/r/20161117193021.GB23430@cmpxchg.org
    Signed-off-by: Johannes Weiner
    Suggested-by: Jan Kara
    Reviewed-by: Jan Kara
    Cc: Kirill A. Shutemov
    Cc: Hugh Dickins
    Cc: Matthew Wilcox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     

30 May, 2016

1 commit

  • Since commits 71d076ceb245f0d9 ("ARM: shmobile: Enable PM and
    PM_GENERIC_DOMAINS for SoCs with PM Domains") and 2ee98234b88174f2
    ("arm64: renesas: Enable PM and PM_GENERIC_DOMAINS for SoCs with PM
    Domains"), CONFIG_PM and CONFIG_PM_GENERIC_DOMAINS are enabled
    unconditionally for Renesas ARM-based SoCs. Hence the legacy clock
    domain is no longer used on these SoCs.

    Remove the related support code, and stop entering drivers/sh/ on ARM.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Simon Horman

    Geert Uytterhoeven
     

04 Mar, 2016

1 commit


25 Feb, 2016

1 commit

  • CONFIG_ARCH_SHMOBILE is not only enabled for Renesas ARM platforms
    (which are DT based and multi-platform), but also on a select set of
    Renesas SuperH platforms (SH7722/SH7723/SH7724/SH7343/SH7366). Hence
    since commit 0ba58de231066e47 ("drivers: sh: Get rid of
    CONFIG_ARCH_SHMOBILE_MULTI"), the legacy clock domain is no longer
    installed on these SuperH platforms, and module clocks may not be
    enabled when needed, leading to driver failures.

    To fix this, add an additional check for CONFIG_OF.

    Fixes: 0ba58de231066e47 ("drivers: sh: Get rid of CONFIG_ARCH_SHMOBILE_MULTI").
    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Simon Horman

    Geert Uytterhoeven
     

30 Jan, 2016

1 commit

  • I/O resource descriptor, 'desc' in struct resource, needs to be
    initialized to zero by default. Some drivers call kmalloc() to
    allocate a resource entry, but do not initialize it to zero by
    memset(). Change these drivers to call kzalloc(), instead.

    Signed-off-by: Toshi Kani
    Signed-off-by: Borislav Petkov
    Acked-by: Alexandre Bounine
    Acked-by: Helge Deller
    Acked-by: Rafael J. Wysocki
    Acked-by: Simon Horman
    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Luis R. Rodriguez
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Toshi Kani
    Cc: linux-acpi@vger.kernel.org
    Cc: linux-arch@vger.kernel.org
    Cc: linux-mm
    Cc: linux-parisc@vger.kernel.org
    Cc: linux-renesas-soc@vger.kernel.org
    Cc: linux-sh@vger.kernel.org
    Link: http://lkml.kernel.org/r/1453841853-11383-10-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar

    Toshi Kani
     

24 Nov, 2015

2 commits


17 Nov, 2015

1 commit


22 Sep, 2015

1 commit

  • …rnel/git/horms/renesas

    Pull SH drivers updates from Simon Horman:
    "I am sending this change after v4.3-rc1 has been released as it
    depends on SoC changes which are present in that rc release.

    Summary:

    - disable PM runtime for multi-platform ARM with genpd

    - disable legacy default PM Domain on emev2"

    * tag 'renesas-sh-drivers-for-v4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
    drivers: sh: Disable PM runtime for multi-platform ARM with genpd
    drivers: sh: Disable legacy default PM Domain on emev2

    Linus Torvalds
     

16 Sep, 2015

2 commits

  • set_irq_flags is ARM specific with custom flags which have genirq
    equivalents. Convert drivers to use the genirq interfaces directly, so we
    can kill off set_irq_flags. The translation of flags is as follows:

    IRQF_VALID -> !IRQ_NOREQUEST
    IRQF_PROBE -> !IRQ_NOPROBE
    IRQF_NOAUTOEN -> IRQ_NOAUTOEN

    For IRQs managed by an irqdomain, the irqdomain core code handles clearing
    and setting IRQ_NOREQUEST already, so there is no need to do this in
    .map() functions and we can simply remove the set_irq_flags calls. Some
    users also modify IRQ_NOPROBE and this has been maintained although it
    is not clear that is really needed. There appears to be a great deal of
    blind copy and paste of this code.

    Signed-off-by: Rob Herring
    Acked-by: Simon Horman
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-sh@vger.kernel.org
    Cc: Russell King
    Cc: Magnus Damm
    Link: http://lkml.kernel.org/r/1440889285-5637-4-git-send-email-robh@kernel.org
    Signed-off-by: Thomas Gleixner

    Rob Herring
     
  • Most interrupt flow handlers do not use the irq argument. Those few
    which use it can retrieve the irq number from the irq descriptor.

    Remove the argument.

    Search and replace was done with coccinelle and some extra helper
    scripts around it. Thanks to Julia for her help!

    Signed-off-by: Thomas Gleixner
    Cc: Julia Lawall
    Cc: Jiang Liu

    Thomas Gleixner
     

14 Sep, 2015

2 commits

  • If the default PM Domain using PM_CLK is used for PM runtime, the real
    Clock Domain cannot be registered from DT later.

    Hence do not enable it when running a multi-platform kernel with genpd
    support on R-Car or RZ. The CPG/MSTP Clock Domain driver will take care
    of PM runtime management of the module clocks.

    Now most multi-platform ARM shmobile platforms (SH-Mobile, R-Mobile,
    R-Car, RZ) use DT-based PM Domains to take care of PM runtime management
    of the module clocks, simplify the platform logic by replacing the
    explicit SoC checks by a single check for the presence of MSTP clocks in
    DT.

    Backwards-compatiblity with old DTs (mainly for R-Car Gen2) is provided
    by checking for the presence of a "#power-domain-cells" property in DT.

    The default PM Domain is still needed for:
    - backwards-compatibility with old DTs that lack PM Domain properties,
    - the CONFIG_PM=n case,
    - legacy (non-DT) ARM/shmobile platforms without genpd support
    (r8a7778, r8a7779),
    - legacy SuperH.

    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Ulf Hansson
    Signed-off-by: Simon Horman

    Geert Uytterhoeven
     
  • EMMA Mobile EV2 doesn't have MSTP clocks. All its device drivers manage
    clocks explicitly, without relying on Runtime PM, so it doesn't need the
    legacy default PM Domain.

    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Ulf Hansson
    Signed-off-by: Simon Horman

    Geert Uytterhoeven
     

29 Jul, 2015

4 commits

  • The irq argument of most interrupt flow handlers is unused or merily
    used instead of a local variable. The handlers which need the irq
    argument can retrieve the irq number from the irq descriptor.

    Search and update was done with coccinelle and the invaluable help of
    Julia Lawall.

    Signed-off-by: Thomas Gleixner
    Cc: Jiang Liu
    Cc: Simon Horman
    Cc: Magnus Damm
    Cc: Julia Lawall
    Link: http://lkml.kernel.org/r/20150713151626.872605327@linutronix.de
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc while we
    already have a pointer to corresponding irq_desc.

    Also replace generic_handle_irq with generic_handle_irq_desc() to avoid
    looking up irq_desc again.

    Signed-off-by: Jiang Liu
    Cc: Simon Horman
    Cc: Magnus Damm
    Link: http://lkml.kernel.org/r/20150713151626.792845830@linutronix.de
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Jiang Liu
     
  • This is a preparatory patch for moving irq_data struct members.

    Signed-off-by: Jiang Liu
    Cc: Simon Horman
    Cc: Magnus Damm
    Link: http://lkml.kernel.org/r/20150713151626.713278346@linutronix.de
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • This is a preparatory patch for refactoring the internals if irq_data.

    Signed-off-by: Jiang Liu
    Cc: Simon Horman
    Cc: Magnus Damm
    Link: http://lkml.kernel.org/r/20150713151626.616384365@linutronix.de
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Jiang Liu
     

02 Jul, 2015

1 commit

  • Pull irq fixes from Thomas Gleixner:
    "This contains:

    - a series of fixes for interrupt drivers to prevent a potential race
    when installing a chained interrupt handler

    - a fix for cpumask pointer misuse

    - a fix for using the wrong interrupt number from struct irq_data

    - removal of unused code and outdated comments

    - a few new helper functions which allow us to cleanup the interrupt
    handling code further in 4.3

    I decided against doing the cleanup at the end of this merge window
    and rather do the preparatory steps for 4.3, so we can run the final
    ABI change at the end of the 4.3 merge window with less risk"

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (26 commits)
    ARM/LPC32xx: Use irq not hwirq for __irq_set_handler_locked()
    genirq: Implement irq_set_handler_locked()/irq_set_chip_handler_name_locked()
    genirq: Introduce helper irq_desc_get_irq()
    genirq: Remove irq_node()
    genirq: Clean up outdated comments related to include/linux/irqdesc.h
    mn10300: Fix incorrect use of irq_data->affinity
    MIPS/ralink: Fix race in installing chained IRQ handler
    MIPS/pci: Fix race in installing chained IRQ handler
    MIPS/ath25: Fix race in installing chained IRQ handler
    MIPS/ath25: Fix race in installing chained IRQ handler
    m68k/psc: Fix race in installing chained IRQ handler
    avr32/at32ap: Fix race in installing chained IRQ handler
    sh/intc: Fix race in installing chained IRQ handler
    sh/intc: Fix potential race in installing chained IRQ handler
    pinctrl/sun4i: Fix race in installing chained IRQ handler
    pinctrl/samsung: Fix race in installing chained IRQ handler
    pinctrl/samsung: Fix race in installing chained IRQ handler
    pinctrl/exynos: Fix race in installing chained IRQ handler
    pinctrl/st: Fix race in installing chained IRQ handler
    pinctrl/adi2: Fix race in installing chained IRQ handler
    ...

    Linus Torvalds
     

25 Jun, 2015

2 commits

  • Fix a race where a pending interrupt could be received and the handler
    called before the handler's data has been setup, by converting to
    irq_set_chained_handler_and_data().

    Search and conversion was done with coccinelle:

    @@
    expression E1, E2, E3;
    @@
    (
    -if (irq_set_chained_handler(E1, E3) != 0)
    - BUG();
    |
    -irq_set_chained_handler(E1, E3);
    )
    -irq_set_handler_data(E1, E2);
    +irq_set_chained_handler_and_data(E1, E3, E2);

    @@
    expression E1, E2, E3;
    @@
    (
    -if (irq_set_chained_handler(E1, E3) != 0)
    - BUG();
    ...
    |
    -irq_set_chained_handler(E1, E3);
    ...
    )
    -irq_set_handler_data(E1, E2);
    +irq_set_chained_handler_and_data(E1, E3, E2);

    Reported-by: Russell King
    Signed-off-by: Thomas Gleixner
    Cc: Julia Lawall
    Cc: Simon Horman
    Cc: Magnus Damm
    Cc: linux-sh@vger.kernel.org

    Thomas Gleixner
     
  • Fix a race where a pending interrupt could be received and the handler
    called before the handler's data has been setup, by moving the call to
    irq_set_chained_handler() after the function which sets up the handler
    data.

    Found by code inspection.

    Reported-by: Russell King
    Signed-off-by: Thomas Gleixner
    Cc: Simon Horman
    Cc: Magnus Damm
    Cc: linux-sh@vger.kernel.org

    Thomas Gleixner
     

13 May, 2015

1 commit


27 Apr, 2015

3 commits

  • Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Simon Horman

    Geert Uytterhoeven
     
  • If the default PM domain using PM_CLK is used for PM runtime, the real PM
    domain(s) cannot be registered from DT later.

    Hence do not enable it when running a multi-platform kernel with genpd
    support on an r8a73a4. The R-Mobile PM domain driver will take care of
    PM runtime management of the module clocks.

    The default PM domain is still needed for:
    - platforms without genpd support,
    - the legacy (non-DT) case, where genpd may take over later, except
    for the C5 "always on" PM domain.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Simon Horman

    Geert Uytterhoeven
     
  • If the default PM domain using PM_CLK is used for PM runtime, the real PM
    domain(s) cannot be registered from DT later.

    Hence do not enable it when running a multi-platform kernel with genpd
    support on an sh73a0. The R-Mobile PM domain driver will take care of
    PM runtime management of the module clocks.

    The default PM domain is still needed for:
    - platforms without genpd support,
    - the legacy (non-DT) case, where genpd may take over later, except
    for the C5 "always on" PM domain.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Simon Horman

    Geert Uytterhoeven
     

24 Feb, 2015

1 commit

  • If the default PM domain using PM_CLK is used for PM runtime, the real PM
    domain(s) cannot be registered from DT later.

    Hence do not enable it when running a multi-platform kernel with genpd
    support on an r8a7740. The R-Mobile PM domain driver will take care of
    PM runtime management of the module clocks.

    The default PM domain is still needed for:
    - platforms without genpd support,
    - the legacy (non-DT) case, where genpd may take over later, except
    for the C5 "always on" PM domain.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Simon Horman

    Geert Uytterhoeven
     

05 Dec, 2014

1 commit

  • After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
    selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
    depending on CONFIG_PM_RUNTIME may now be changed to depend on
    CONFIG_PM.

    Replace CONFIG_PM_RUNTIME with CONFIG_PM in drivers/sh/pm_runtime.c.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Simon Horman
    Acked-by: Geert Uytterhoeven

    Rafael J. Wysocki