05 Mar, 2020

1 commit

  • commit 38b17afb0ebb9ecd41418d3c08bcf9198af4349d upstream.

    Removing attach_adapter from this driver caused a regression for at
    least some machines. Those machines had the sensors described in their
    DT, too, so they didn't need manual creation of the sensor devices. The
    old code worked, though, because manual creation came first. Creation of
    DT devices then failed later and caused error logs, but the sensors
    worked nonetheless because of the manually created devices.

    When removing attach_adaper, manual creation now comes later and loses
    the race. The sensor devices were already registered via DT, yet with
    another binding, so the driver could not be bound to it.

    This fix refactors the code to remove the race and only manually creates
    devices if there are no DT nodes present. Also, the DT binding is updated
    to match both, the DT and manually created devices. Because we don't
    know which device creation will be used at runtime, the code to start
    the kthread is moved to do_probe() which will be called by both methods.

    Fixes: 3e7bed52719d ("macintosh: therm_windtunnel: drop using attach_adapter")
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=201723
    Reported-by: Erhard Furtner
    Tested-by: Erhard Furtner
    Acked-by: Michael Ellerman (powerpc)
    Signed-off-by: Wolfram Sang
    Cc: stable@kernel.org # v4.19+
    Signed-off-by: Greg Kroah-Hartman

    Wolfram Sang
     

21 Oct, 2019

1 commit

  • Replace the CPU device PM QoS used for the management of min and max
    frequency constraints in cpufreq (and its users) with per-policy
    frequency QoS to avoid problems with cpufreq policies covering
    more then one CPU.

    Namely, a cpufreq driver is registered with the subsys interface
    which calls cpufreq_add_dev() for each CPU, starting from CPU0, so
    currently the PM QoS notifiers are added to the first CPU in the
    policy (i.e. CPU0 in the majority of cases).

    In turn, when the cpufreq driver is unregistered, the subsys interface
    doing that calls cpufreq_remove_dev() for each CPU, starting from CPU0,
    and the PM QoS notifiers are only removed when cpufreq_remove_dev() is
    called for the last CPU in the policy, say CPUx, which as a rule is
    not CPU0 if the policy covers more than one CPU. Then, the PM QoS
    notifiers cannot be removed, because CPUx does not have them, and
    they are still there in the device PM QoS notifiers list of CPU0,
    which prevents new PM QoS notifiers from being registered for CPU0
    on the next attempt to register the cpufreq driver.

    The same issue occurs when the first CPU in the policy goes offline
    before unregistering the driver.

    After this change it does not matter which CPU is the policy CPU at
    the driver registration time and whether or not it is online all the
    time, because the frequency QoS is per policy and not per CPU.

    Fixes: 67d874c3b2c6 ("cpufreq: Register notifiers with the PM QoS framework")
    Reported-by: Dmitry Osipenko
    Tested-by: Dmitry Osipenko
    Reported-by: Sudeep Holla
    Tested-by: Sudeep Holla
    Diagnosed-by: Viresh Kumar
    Link: https://lore.kernel.org/linux-pm/5ad2624194baa2f53acc1f1e627eb7684c577a19.1562210705.git.viresh.kumar@linaro.org/T/#md2d89e95906b8c91c15f582146173dce2e86e99f
    Link: https://lore.kernel.org/linux-pm/20191017094612.6tbkwoq4harsjcqv@vireshk-i7/T/#m30d48cc23b9a80467fbaa16e30f90b3828a5a29b
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Viresh Kumar

    Rafael J. Wysocki
     

26 Aug, 2019

1 commit


31 Jul, 2019

1 commit

  • Mark switch cases where we are expecting to fall through.

    This patch fixes the following warning (Building: powerpc):

    drivers/macintosh/smu.c: In function 'smu_queue_i2c':
    drivers/macintosh/smu.c:854:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
    cmd->info.devaddr &= 0xfe;
    ~~~~~~~~~~~~~~~~~~^~~~~~~
    drivers/macintosh/smu.c:855:2: note: here
    case SMU_I2C_TRANSFER_STDSUB:
    ^~~~

    Fixes: 0365ba7fb1fa ("[PATCH] ppc64: SMU driver update & i2c support")
    Signed-off-by: Stephen Rothwell
    Reviewed-by: Kees Cook
    Signed-off-by: Michael Ellerman
    Link: https://lore.kernel.org/r/20190730143704.060a2606@canb.auug.org.au

    Stephen Rothwell
     

14 Jul, 2019

1 commit

  • Pull powerpc updates from Michael Ellerman:
    "Notable changes:

    - Removal of the NPU DMA code, used by the out-of-tree Nvidia driver,
    as well as some other functions only used by drivers that haven't
    (yet?) made it upstream.

    - A fix for a bug in our handling of hardware watchpoints (eg. perf
    record -e mem: ...) which could lead to register corruption and
    kernel crashes.

    - Enable HAVE_ARCH_HUGE_VMAP, which allows us to use large pages for
    vmalloc when using the Radix MMU.

    - A large but incremental rewrite of our exception handling code to
    use gas macros rather than multiple levels of nested CPP macros.

    And the usual small fixes, cleanups and improvements.

    Thanks to: Alastair D'Silva, Alexey Kardashevskiy, Andreas Schwab,
    Aneesh Kumar K.V, Anju T Sudhakar, Anton Blanchard, Arnd Bergmann,
    Athira Rajeev, Cédric Le Goater, Christian Lamparter, Christophe
    Leroy, Christophe Lombard, Christoph Hellwig, Daniel Axtens, Denis
    Efremov, Enrico Weigelt, Frederic Barrat, Gautham R. Shenoy, Geert
    Uytterhoeven, Geliang Tang, Gen Zhang, Greg Kroah-Hartman, Greg Kurz,
    Gustavo Romero, Krzysztof Kozlowski, Madhavan Srinivasan, Masahiro
    Yamada, Mathieu Malaterre, Michael Neuling, Nathan Lynch, Naveen N.
    Rao, Nicholas Piggin, Nishad Kamdar, Oliver O'Halloran, Qian Cai, Ravi
    Bangoria, Sachin Sant, Sam Bobroff, Satheesh Rajendran, Segher
    Boessenkool, Shaokun Zhang, Shawn Anastasio, Stewart Smith, Suraj
    Jitindar Singh, Thiago Jung Bauermann, YueHaibing"

    * tag 'powerpc-5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (163 commits)
    powerpc/powernv/idle: Fix restore of SPRN_LDBAR for POWER9 stop state.
    powerpc/eeh: Handle hugepages in ioremap space
    ocxl: Update for AFU descriptor template version 1.1
    powerpc/boot: pass CONFIG options in a simpler and more robust way
    powerpc/boot: add {get, put}_unaligned_be32 to xz_config.h
    powerpc/irq: Don't WARN continuously in arch_local_irq_restore()
    powerpc/module64: Use symbolic instructions names.
    powerpc/module32: Use symbolic instructions names.
    powerpc: Move PPC_HA() PPC_HI() and PPC_LO() to ppc-opcode.h
    powerpc/module64: Fix comment in R_PPC64_ENTRY handling
    powerpc/boot: Add lzo support for uImage
    powerpc/boot: Add lzma support for uImage
    powerpc/boot: don't force gzipped uImage
    powerpc/8xx: Add microcode patch to move SMC parameter RAM.
    powerpc/8xx: Use IO accessors in microcode programming.
    powerpc/8xx: replace #ifdefs by IS_ENABLED() in microcode.c
    powerpc/8xx: refactor programming of microcode CPM params.
    powerpc/8xx: refactor printing of microcode patch name.
    powerpc/8xx: Refactor microcode write
    powerpc/8xx: refactor writing of CPM microcode arrays
    ...

    Linus Torvalds
     

04 Jul, 2019

1 commit

  • On most arches having function flush_dcache_range(), including PPC32,
    this function does a writeback and invalidation of the cache bloc.

    On PPC64, flush_dcache_range() only does a writeback while
    flush_inval_dcache_range() does the invalidation in addition.

    In addition it looks like within arch/powerpc/, there are no PPC64
    platforms using flush_dcache_range()

    This patch drops the existing 64 bits version of flush_dcache_range()
    and renames flush_inval_dcache_range() into flush_dcache_range().

    Signed-off-by: Christophe Leroy
    Signed-off-by: Michael Ellerman

    Christophe Leroy
     

19 Jun, 2019

2 commits

  • Based on 1 normalized pattern(s):

    gnu gpl v2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 5 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Alexios Zavras
    Reviewed-by: Enrico Weigelt
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190602204655.013483115@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    released under the term of the gnu gpl v2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 16 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190602204654.922331175@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    released under the terms of the gnu gpl v2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 1 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Reviewed-by: Armijn Hemel
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531081036.708437866@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

24 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 or at your option any
    later version this program is distributed in the hope that it will
    be useful but without any warranty without even the implied warranty
    of merchantability or fitness for a particular purpose see the gnu
    general public license for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 44 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Richard Fontana
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190523091651.032047323@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

3 commits

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details you
    should have received a copy of the gnu general public license along
    with this program if not write to the free software foundation inc
    51 franklin street fifth floor boston ma 02110 1301 usa

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option [no]_[pad]_[ctrl] any later version this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation inc 51 franklin street fifth floor boston ma
    02110 1301 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 176 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Jilayne Lovejoy
    Reviewed-by: Steve Winslow
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190519154040.652910950@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Add SPDX license identifiers to all Make/Kconfig files which:

    - Have no license information of any form

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have MODULE_LICENCE("GPL*") inside which was used in the initial
    scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

13 Mar, 2019

2 commits

  • 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.com
    Signed-off-by: Mike Rapoport
    Signed-off-by: Anders Roxell
    Reviewed-by: Guo Ren [c-sky]
    Acked-by: Paul Burton [MIPS]
    Acked-by: Heiko Carstens [s390]
    Reviewed-by: Juergen Gross [Xen]
    Reviewed-by: Geert Uytterhoeven [m68k]
    Acked-by: Max Filippov [xtensa]
    Cc: Catalin Marinas
    Cc: Christophe Leroy
    Cc: Christoph Hellwig
    Cc: "David S. Miller"
    Cc: Dennis Zhou
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Guo Ren
    Cc: Mark Salter
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Petr Mladek
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Rob Herring
    Cc: Rob Herring
    Cc: Russell King
    Cc: Stafford Horne
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • The memblock_alloc_base() function tries to allocate a memory up to the
    limit specified by its max_addr parameter and panics if the allocation
    fails. Replace its usage with memblock_phys_alloc_range() and make the
    callers check the return value and panic in case of error.

    Link: http://lkml.kernel.org/r/1548057848-15136-10-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Michael Ellerman [powerpc]
    Cc: Catalin Marinas
    Cc: Christophe Leroy
    Cc: Christoph Hellwig
    Cc: "David S. Miller"
    Cc: Dennis Zhou
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Guo Ren
    Cc: Guo Ren [c-sky]
    Cc: Heiko Carstens
    Cc: Juergen Gross [Xen]
    Cc: Mark Salter
    Cc: Matt Turner
    Cc: Max Filippov
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Paul Burton
    Cc: Petr Mladek
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Rob Herring
    Cc: Rob Herring
    Cc: Russell King
    Cc: Stafford Horne
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

22 Jan, 2019

1 commit

  • Certain Cuda transfers have to be ended by the driver. According
    to Apple's open source Cuda driver, as found in mkLinux and XNU, this
    applies to any "open ended request such as PRAM read". This fixes an
    infinite polling loop in cuda_pram_read_byte().

    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Signed-off-by: Greg Kroah-Hartman

    Finn Thain
     

04 Jan, 2019

1 commit

  • Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument
    of the user address range verification function since we got rid of the
    old racy i386-only code to walk page tables by hand.

    It existed because the original 80386 would not honor the write protect
    bit when in kernel mode, so you had to do COW by hand before doing any
    user access. But we haven't supported that in a long time, and these
    days the 'type' argument is a purely historical artifact.

    A discussion about extending 'user_access_begin()' to do the range
    checking resulted this patch, because there is no way we're going to
    move the old VERIFY_xyz interface to that model. And it's best done at
    the end of the merge window when I've done most of my merges, so let's
    just get this done once and for all.

    This patch was mostly done with a sed-script, with manual fix-ups for
    the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form.

    There were a couple of notable cases:

    - csky still had the old "verify_area()" name as an alias.

    - the iter_iov code had magical hardcoded knowledge of the actual
    values of VERIFY_{READ,WRITE} (not that they mattered, since nothing
    really used it)

    - microblaze used the type argument for a debug printout

    but other than those oddities this should be a total no-op patch.

    I tried to fix up all architectures, did fairly extensive grepping for
    access_ok() uses, and the changes are trivial, but I may have missed
    something. Any missed conversion should be trivially fixable, though.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

22 Dec, 2018

1 commit

  • Convert string compares of DT node names to use of_node_name_{eq,prefix}
    helpers instead. This removes direct access to the node name pointer.

    This changes a single case insensitive node name comparison to case
    sensitive for "ata4". This is the only instance of a case insensitive
    comparison for all the open coded node name comparisons on powerpc.
    Searching the commit history, there doesn't appear to be any reason for
    it to be case insensitive.

    A couple of open coded iterating thru the child node names are converted
    to use for_each_child_of_node() instead.

    Signed-off-by: Rob Herring
    Signed-off-by: Michael Ellerman

    Rob Herring
     

26 Nov, 2018

2 commits


31 Oct, 2018

4 commits

  • 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.com
    Signed-off-by: Mike Rapoport
    Suggested-by: Michal Hocko
    Acked-by: Paul Burton [MIPS]
    Acked-by: Michael Ellerman [powerpc]
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: Geert Uytterhoeven
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: Matt Turner
    Cc: Michal Simek
    Cc: Richard Weinberger
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • 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

    @@
    @@
    - #include
    + #include

    [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.com
    Signed-off-by: Mike Rapoport
    Signed-off-by: Stephen Rothwell
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • The free_bootmem and free_bootmem_node are merely wrappers for
    memblock_free. Replace their usage with a call to memblock_free using the
    following semantic patch:

    @@
    expression e1, e2, e3;
    @@
    (
    - free_bootmem(e1, e2)
    + memblock_free(e1, e2)
    |
    - free_bootmem_node(e1, e2, e3)
    + memblock_free(e2, e3)
    )

    Link: http://lkml.kernel.org/r/1536927045-23536-24-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • The alloc_bootmem(size) is a shortcut for allocation of SMP_CACHE_BYTES
    aligned memory. When the align parameter of memblock_alloc() is 0, the
    alignment is implicitly set to SMP_CACHE_BYTES and thus alloc_bootmem(size)
    and memblock_alloc(size, 0) are equivalent.

    The conversion is done using the following semantic patch:

    @@
    expression size;
    @@
    - alloc_bootmem(size)
    + memblock_alloc(size, 0)

    Link: http://lkml.kernel.org/r/1536927045-23536-22-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Hocko
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

18 Oct, 2018

1 commit


08 Oct, 2018

7 commits

  • Signed-off-by: Finn Thain
    Signed-off-by: Michael Ellerman

    Finn Thain
     
  • Add missing severity level to log messages.

    Signed-off-by: Finn Thain
    Signed-off-by: Michael Ellerman

    Finn Thain
     
  • Modifying the request queue or changing the current state requires
    mutual exclusion. Use local_irq_disable() consistently for this
    rather than disabling the ADB interrupt. This simplifies the locking
    scheme and brings via-macii into line with the other ADB drivers.

    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Signed-off-by: Michael Ellerman

    Finn Thain
     
  • The BUG_ON assertions I added to the via-macii driver over a decade ago
    haven't fired AFAIK. Some can never fire (by inspection). One assertion
    checks for a NULL pointer, but that would merely substitute a BUG crash
    for an Oops crash. Remove the pointless BUG_ON assertions and replace
    the others with a WARN_ON and an array bounds check.

    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Signed-off-by: Michael Ellerman

    Finn Thain
     
  • Make the reset operation synchronous, like the other ADB drivers.
    The reset request is static data but callers may not know that.
    This way the struct is not in use when the reset method returns.

    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Signed-off-by: Michael Ellerman

    Finn Thain
     
  • Avoid the KERN_CONT problem by avoiding message fragments. The problem
    arises during async ADB bus probing, when ADB messages may get mixed up
    with other messages. See also, commit 4bcc595ccd80 ("printk: reinstate
    KERN_CONT for printing continuation lines").

    Remove a number of printk() continuation lines by logging handler
    changes in adb_try_handler_change() instead.

    This patch addresses the problematic use of "\n" at the beginning of
    pr_cont() messages, which got overlooked in commit f2be6295684b
    ("macintosh/adb: Properly mark continued kernel messages").

    That commit also changed printk(KERN_DEBUG ...) to pr_debug(...), which
    hinders work on low-level ADB driver bugs. Revert that change.

    Cc: Andreas Schwab
    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Signed-off-by: Michael Ellerman

    Finn Thain
     
  • Now that the 68k Mac port has adopted the via-pmu driver, the same RTC
    code can be shared between m68k and powerpc. Replace duplicated code in
    arch/powerpc and arch/m68k with common RTC accessors for Cuda and PMU.

    Drop the problematic WARN_ON which was introduced in commit 22db552b50fa
    ("powerpc/powermac: Fix rtc read/write functions").

    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Cc: Geert Uytterhoeven
    Cc: Arnd Bergmann
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Michael Ellerman

    Finn Thain
     

03 Oct, 2018

1 commit


24 Aug, 2018

1 commit


31 Jul, 2018

5 commits

  • Some of the event counters are overloaded which makes it very
    difficult to interpret their values.

    Counter 0 is supposed to report CB1 interrupts but it can also count
    PMU_INT_WAITING_CHARGER events.

    Counter 1 is supposed to report GPIO interrupts but it can also count
    other events (depending upon the value of the PMU_INT_ADB bit).

    Disambiguate these statistics with dedicated counters for GPIO and
    CB1 interrupts.

    Comments in the MkLinux source code say that the type 0 and type 1
    interrupts are model-specific. Label them as "unknown".

    This change to the contents of /proc/pmu/interrupts is by necessity
    visible in userland. However, packages which interact with the PMU
    (that is, pbbuttonsd, pmac-utils and pmud) don't open this file.
    AFAIK, user software has no need to poll these counters.

    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Signed-off-by: Michael Ellerman

    Finn Thain
     
  • Replace an open-coded ffs() with the function call.
    Simplify an if-else cascade using a switch statement.
    Correct a typo and an indentation issue.

    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Reviewed-by: Geert Uytterhoeven
    Signed-off-by: Michael Ellerman

    Finn Thain
     
  • Now that the PowerMac via-pmu driver supports m68k PowerBooks,
    switch over to that driver and remove the via-pmu68k driver.

    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Reviewed-by: Geert Uytterhoeven
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Michael Ellerman

    Finn Thain
     
  • Don't load the via-pmu68k driver on early PowerBooks. The M50753 PMU
    device found in those models was never supported by this driver.
    Attempting to load the driver usually causes a boot hang.

    Signed-off-by: Finn Thain
    Reviewed-by: Michael Schmitz
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Michael Ellerman

    Finn Thain
     
  • At present, CONFIG_ADB_PMU depends on CONFIG_PPC_PMAC. When this gets
    relaxed to CONFIG_PPC_PMAC || CONFIG_MAC, those Kconfig symbols with
    implicit deps on PPC_PMAC will need explicit deps. Add them now.
    No functional change.

    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Signed-off-by: Michael Ellerman

    Finn Thain