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
     

09 Sep, 2014

1 commit


22 Aug, 2014

1 commit

  • Currently the sh-intc driver is compiled on all SuperH and
    non-multiplatform SH-Mobile platforms, while it's only used on a limited
    number of platforms:
    - SuperH: SH2(A), SH3(A), SH4(A)(L) (all but SH5)
    - ARM: sh7372, sh73a0

    Drop the "default y" on SH_INTC, make all CPU platforms that use it
    select it, and protect all sub-options by "if SH_INTC" to fix this.

    Signed-off-by: Geert Uytterhoeven
    Acked-by: Magnus Damm
    Signed-off-by: Simon Horman

    Geert Uytterhoeven
     

07 Jun, 2014

1 commit

  • …ernel/git/horms/renesas into next

    Pull SH driver update from Simon Horman:

    - PM Runtime enhancements targeted for use with ARM-based Renesas R-Car
    Gen2 SoCs

    - Restrict INTC_USERIMASK to SH4A as it is only used there

    * tag 'renesas-sh-drivers-for-v3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
    drivers: sh: Enable PM runtime for new R-Car Gen2 SoCs
    drivers: sh: pm_runtime implementation needs to suspend and resume devices
    drivers: sh: Restrict INTC_USERIMASK to SH4A
    drivers: sh: pm_runtime does not need idle callback

    Linus Torvalds
     

05 Jun, 2014

2 commits

  • The PM runtime code should also be enabled for:
    - r8a7792 (R-Car V2H)
    - r8a7793 (R-Car M2-N)
    - r8a7794 (R-Car E2)

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

    Geert Uytterhoeven
     
  • Pull core irq updates from Thomas Gleixner:
    "The irq department delivers:

    - Another tree wide update to get rid of the horrible create_irq
    interface along with its even more horrible variants. That also
    gets rid of the last leftovers of the initial sparse irq hackery.
    arch/driver specific changes have been either acked or ignored.

    - A fix for the spurious interrupt detection logic with threaded
    interrupts.

    - A new ARM SoC interrupt controller

    - The usual pile of fixes and improvements all over the place"

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (40 commits)
    Documentation: brcmstb-l2: Add Broadcom STB Level-2 interrupt controller binding
    irqchip: brcmstb-l2: Add Broadcom Set Top Box Level-2 interrupt controller
    genirq: Improve documentation to match current implementation
    ARM: iop13xx: fix msi support with sparse IRQ
    genirq: Provide !SMP stub for irq_set_affinity_notifier()
    irqchip: armada-370-xp: Move the devicetree binding documentation
    irqchip: gic: Use mask field in GICC_IAR
    genirq: Remove dynamic_irq mess
    ia64: Use irq_init_desc
    genirq: Replace dynamic_irq_init/cleanup
    genirq: Remove irq_reserve_irq[s]
    genirq: Replace reserve_irqs in core code
    s390: Avoid call to irq_reserve_irqs()
    s390: Remove pointless arch_show_interrupts()
    s390: pci: Check return value of alloc_irq_desc() proper
    sh: intc: Remove pointless irq_reserve_irqs() invocation
    x86, irq: Remove pointless irq_reserve_irqs() call
    genirq: Make create/destroy_irq() ia64 private
    tile: Use SPARSE_IRQ
    tile: pci: Use irq_alloc/free_hwirq()
    ...

    Linus Torvalds
     

03 Jun, 2014

1 commit


26 May, 2014

3 commits

  • If we override the platform bus calls for pm_runtime then we end up
    with the calls to the devices' suspend and resume methods ignored
    in favour of the bus ones.

    Change to calling the pm_runtime calls to suspend and resume the
    devices specifically in the drivers/sh/pm_runtime.c implementation
    to allow any device that may want to run power management to do so.

    Note, all the current sh driver implementations do not use their
    own power management code so this is not a major implementation
    issues.

    This also brings the implementation into line with the versions
    used by the Davinci and Keystone PM domain code, so once fully
    tested these implementations could be merged together.

    Signed-off-by: Ben Dooks
    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Laurent Pinchart
    Signed-off-by: Simon Horman

    Ben Dooks
     
  • register_intc_userimask() is called from sh4a code only.

    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Laurent Pinchart
    Tested-by: Laurent Pinchart [r8a7779 legacy]
    Signed-off-by: Simon Horman

    Geert Uytterhoeven
     
  • In the runtime_pm idle callback the code assumes that a NULL .runtime_idle
    entry is the same as a .runtime_idle entry that returns 0 as a result. This
    means the entry in drivers/sh/pm_runtime can be removed in favour of just
    leaving the entry NULL.

    Signed-off-by: Ben Dooks
    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Laurent Pinchart
    Tested-by: Laurent Pinchart [r8a7779 legacy]
    Signed-off-by: Simon Horman

    Ben Dooks
     

16 May, 2014

1 commit

  • The preceding call to irq_create_identity_mapping() marks the
    interrupt as allocated already. Remove the leftover.

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Grant Likely
    Cc: Tony Luck
    Cc: Peter Zijlstra
    Acked-by: Simon Horman
    Cc: linux-sh@vger.kernel.org
    Link: http://lkml.kernel.org/r/20140507154339.189047829@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

12 May, 2014

1 commit

  • If the kernel is built to support multi-ARM configuration with shmobile
    support built in, then drivers/sh is not built. This contains the PM
    runtime code in drivers/sh/pm_runtime.c, which implicitly enables the
    module clocks for all devices, and thus is quite essential.
    Without this, the state of clocks depends on implicit reset state, or on
    the bootloader.

    If ARCH_SHMOBILE_MULTI then build the drivers/sh directory, but ensure that
    bits that may conflict (drivers/sh/clk if the common clock framework is
    enabled) or are not used (drivers/sh/intc), are not built.
    Also, only enable the PM runtime code when actually running on a shmobile
    SoCs that needs it.

    ARCH_SHMOBILE_MULTI was added a while ago by commit
    efacfce5f8a523457e9419a25d52fe39db00b26a ("ARM: shmobile: Introduce
    ARCH_SHMOBILE_MULTI"), but drivers/sh was compiled for both
    ARCH_SHMOBILE_LEGACY and ARCH_SHMOBILE_MULTI until commit
    bf98c1eac1d4a6bcf00532e4fa41d8126cd6c187 ("ARM: Rename ARCH_SHMOBILE to
    ARCH_SHMOBILE_LEGACY").

    Inspired by a patch from Ben Dooks .

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

    Geert Uytterhoeven
     

30 Apr, 2014

1 commit


06 Apr, 2014

1 commit

  • Pull ARM SoC sh driver change from Arnd Bergmann:
    "The drivers/sh subdirectory used to get merged through the SH
    architecture tree, but things are in flux there and some of the
    drivers are shared with ARM shmobile, we have picked it up for the
    time being.

    There is only one trivial patch from Laurent Pinchart this time"

    * tag 'sh-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    sh: intc: Enable driver compilation with COMPILE_TEST

    Linus Torvalds
     

18 Feb, 2014

1 commit


04 Feb, 2014

1 commit