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

11 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
     
  • Put #ifdefs around the Open Firmware, xmon, interrupt dispatch,
    battery and suspend code. Add the necessary interrupt handling to
    support m68k PowerBooks.

    The pmu_kind value is available to userspace using the
    PMU_IOC_GET_MODEL ioctl. It is not clear yet what hardware classes
    are be needed to describe m68k PowerBook models, so pmu_kind is given
    the provisional value PMU_UNKNOWN.

    To find out about the hardware, user programs can use /proc/bootinfo
    or /proc/hardware, or send the PMU_GET_VERSION command using /dev/adb.

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

    Finn Thain
     
  • On most PowerPC Macs, the PMU driver uses the shift register and
    IO port B from a single VIA chip.

    On 68k and early PowerPC PowerBooks, the driver uses the shift register
    from one VIA chip together with IO port B from another.

    Replace via with via1 and via2 to accommodate this. For the
    CONFIG_PPC_PMAC case, set via1 = via2 so there is no change.

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

    Finn Thain
     
  • On 68k Macs, the via/vias pointer can't be used to determine whether
    the PMU driver has been initialized. For portability, add a new state
    to indicate that via_find_pmu() succeeded.

    After via_find_pmu() executes, testing vias == NULL is equivalent to
    testing via == NULL. Replace these tests with pmu_state == uninitialized
    which is simpler and more consistent. No functional change.

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

    Finn Thain
     
  • The shift register interrupt flag gets cleared in via_pmu_interrupt()
    and once again in pmu_sr_intr(). Fix this theoretical race condition.

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

    Finn Thain
     
  • Add missing in_8() accessors to init_pmu() and pmu_sr_intr().

    This fixes several sparse warnings:
    drivers/macintosh/via-pmu.c:536:29: warning: dereference of noderef expression
    drivers/macintosh/via-pmu.c:537:33: warning: dereference of noderef expression
    drivers/macintosh/via-pmu.c:1455:17: warning: dereference of noderef expression
    drivers/macintosh/via-pmu.c:1456:69: warning: dereference of noderef expression

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

    Finn Thain
     
  • The pmu_init() function has the __init qualifier, but the ops struct
    that holds a pointer to it does not. This causes a build warning.
    The driver works fine because the pointer is only dereferenced early.

    The function is so small that there's negligible benefit from using
    the __init qualifier. Remove it to fix the warning, consistent with
    the other ADB drivers.

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

    Finn Thain
     

08 Jun, 2018

1 commit

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

    - Support for split PMD page table lock on 64-bit Book3S (Power8/9).

    - Add support for HAVE_RELIABLE_STACKTRACE, so we properly support
    live patching again.

    - Add support for patching barrier_nospec in copy_from_user() and
    syscall entry.

    - A couple of fixes for our data breakpoints on Book3S.

    - A series from Nick optimising TLB/mm handling with the Radix MMU.

    - Numerous small cleanups to squash sparse/gcc warnings from Mathieu
    Malaterre.

    - Several series optimising various parts of the 32-bit code from
    Christophe Leroy.

    - Removal of support for two old machines, "SBC834xE" and "C2K"
    ("GEFanuc,C2K"), which is why the diffstat has so many deletions.

    And many other small improvements & fixes.

    There's a few out-of-area changes. Some minor ftrace changes OK'ed by
    Steve, and a fix to our powernv cpuidle driver. Then there's a series
    touching mm, x86 and fs/proc/task_mmu.c, which cleans up some details
    around pkey support. It was ack'ed/reviewed by Ingo & Dave and has
    been in next for several weeks.

    Thanks to: Akshay Adiga, Alastair D'Silva, Alexey Kardashevskiy, Al
    Viro, Andrew Donnellan, Aneesh Kumar K.V, Anju T Sudhakar, Arnd
    Bergmann, Balbir Singh, Cédric Le Goater, Christophe Leroy, Christophe
    Lombard, Colin Ian King, Dave Hansen, Fabio Estevam, Finn Thain,
    Frederic Barrat, Gautham R. Shenoy, Haren Myneni, Hari Bathini, Ingo
    Molnar, Jonathan Neuschäfer, Josh Poimboeuf, Kamalesh Babulal,
    Madhavan Srinivasan, Mahesh Salgaonkar, Mark Greer, Mathieu Malaterre,
    Matthew Wilcox, Michael Neuling, Michal Suchanek, Naveen N. Rao,
    Nicholas Piggin, Nicolai Stange, Olof Johansson, Paul Gortmaker, Paul
    Mackerras, Peter Rosin, Pridhiviraj Paidipeddi, Ram Pai, Rashmica
    Gupta, Ravi Bangoria, Russell Currey, Sam Bobroff, Samuel
    Mendoza-Jonas, Segher Boessenkool, Shilpasri G Bhat, Simon Guo,
    Souptick Joarder, Stewart Smith, Thiago Jung Bauermann, Torsten Duwe,
    Vaibhav Jain, Wei Yongjun, Wolfram Sang, Yisheng Xie, YueHaibing"

    * tag 'powerpc-4.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (251 commits)
    powerpc/64s/radix: Fix missing ptesync in flush_cache_vmap
    cpuidle: powernv: Fix promotion from snooze if next state disabled
    powerpc: fix build failure by disabling attribute-alias warning in pci_32
    ocxl: Fix missing unlock on error in afu_ioctl_enable_p9_wait()
    powerpc-opal: fix spelling mistake "Uniterrupted" -> "Uninterrupted"
    powerpc: fix spelling mistake: "Usupported" -> "Unsupported"
    powerpc/pkeys: Detach execute_only key on !PROT_EXEC
    powerpc/powernv: copy/paste - Mask SO bit in CR
    powerpc: Remove core support for Marvell mv64x60 hostbridges
    powerpc/boot: Remove core support for Marvell mv64x60 hostbridges
    powerpc/boot: Remove support for Marvell mv64x60 i2c controller
    powerpc/boot: Remove support for Marvell MPSC serial controller
    powerpc/embedded6xx: Remove C2K board support
    powerpc/lib: optimise PPC32 memcmp
    powerpc/lib: optimise 32 bits __clear_user()
    powerpc/time: inline arch_vtime_task_switch()
    powerpc/Makefile: set -mcpu=860 flag for the 8xx
    powerpc: Implement csum_ipv6_magic in assembly
    powerpc/32: Optimise __csum_partial()
    powerpc/lib: Adjust .balign inside string functions for PPC32
    ...

    Linus Torvalds
     

25 May, 2018

1 commit

  • Trivial fix to remove the following sparse warnings:

    arch/powerpc/kernel/module_32.c:112:74: warning: Using plain integer as NULL pointer
    arch/powerpc/kernel/module_32.c:117:74: warning: Using plain integer as NULL pointer
    drivers/macintosh/via-pmu.c:1155:28: warning: Using plain integer as NULL pointer
    drivers/macintosh/via-pmu.c:1230:20: warning: Using plain integer as NULL pointer
    drivers/macintosh/via-pmu.c:1385:36: warning: Using plain integer as NULL pointer
    drivers/macintosh/via-pmu.c:1752:23: warning: Using plain integer as NULL pointer
    drivers/macintosh/via-pmu.c:2084:19: warning: Using plain integer as NULL pointer
    drivers/macintosh/via-pmu.c:2110:32: warning: Using plain integer as NULL pointer
    drivers/macintosh/via-pmu.c:2167:19: warning: Using plain integer as NULL pointer
    drivers/macintosh/via-pmu.c:2183:19: warning: Using plain integer as NULL pointer
    drivers/macintosh/via-pmu.c:277:20: warning: Using plain integer as NULL pointer
    arch/powerpc/platforms/powermac/setup.c:155:67: warning: Using plain integer as NULL pointer
    arch/powerpc/platforms/powermac/setup.c:247:27: warning: Using plain integer as NULL pointer
    arch/powerpc/platforms/powermac/setup.c:249:27: warning: Using plain integer as NULL pointer
    arch/powerpc/platforms/powermac/setup.c:252:37: warning: Using plain integer as NULL pointer
    arch/powerpc/mm/tlb_hash32.c:127:21: warning: Using plain integer as NULL pointer
    arch/powerpc/mm/tlb_hash32.c:148:21: warning: Using plain integer as NULL pointer
    arch/powerpc/mm/tlb_hash32.c:44:21: warning: Using plain integer as NULL pointer
    arch/powerpc/mm/tlb_hash32.c:57:21: warning: Using plain integer as NULL pointer
    arch/powerpc/mm/tlb_hash32.c:87:21: warning: Using plain integer as NULL pointer
    arch/powerpc/kernel/btext.c:160:31: warning: Using plain integer as NULL pointer
    arch/powerpc/kernel/btext.c:167:22: warning: Using plain integer as NULL pointer
    arch/powerpc/kernel/btext.c:274:21: warning: Using plain integer as NULL pointer
    arch/powerpc/kernel/btext.c:285:31: warning: Using plain integer as NULL pointer
    arch/powerpc/include/asm/hugetlb.h:204:16: warning: Using plain integer as NULL pointer
    arch/powerpc/mm/ppc_mmu_32.c:170:21: warning: Using plain integer as NULL pointer
    arch/powerpc/platforms/powermac/pci.c:1227:23: warning: Using plain integer as NULL pointer
    arch/powerpc/platforms/powermac/pci.c:65:24: warning: Using plain integer as NULL pointer

    Also use `--fix` command line option from `script/checkpatch --strict` to
    remove the following:

    CHECK: Comparison to NULL could be written "!dispDeviceBase"
    #72: FILE: arch/powerpc/kernel/btext.c:160:
    + if (dispDeviceBase == NULL)

    CHECK: Comparison to NULL could be written "!vbase"
    #80: FILE: arch/powerpc/kernel/btext.c:167:
    + if (vbase == NULL)

    CHECK: Comparison to NULL could be written "!base"
    #89: FILE: arch/powerpc/kernel/btext.c:274:
    + if (base == NULL)

    CHECK: Comparison to NULL could be written "!dispDeviceBase"
    #98: FILE: arch/powerpc/kernel/btext.c:285:
    + if (dispDeviceBase == NULL)

    CHECK: Comparison to NULL could be written "strstr"
    #117: FILE: arch/powerpc/kernel/module_32.c:117:
    + if (strstr(secstrings + sechdrs[i].sh_name, ".debug") != NULL)

    CHECK: Comparison to NULL could be written "!Hash"
    #130: FILE: arch/powerpc/mm/ppc_mmu_32.c:170:
    + if (Hash == NULL)

    CHECK: Comparison to NULL could be written "Hash"
    #143: FILE: arch/powerpc/mm/tlb_hash32.c:44:
    + if (Hash != NULL) {

    CHECK: Comparison to NULL could be written "!Hash"
    #152: FILE: arch/powerpc/mm/tlb_hash32.c:57:
    + if (Hash == NULL) {

    CHECK: Comparison to NULL could be written "!Hash"
    #161: FILE: arch/powerpc/mm/tlb_hash32.c:87:
    + if (Hash == NULL) {

    CHECK: Comparison to NULL could be written "!Hash"
    #170: FILE: arch/powerpc/mm/tlb_hash32.c:127:
    + if (Hash == NULL) {

    CHECK: Comparison to NULL could be written "!Hash"
    #179: FILE: arch/powerpc/mm/tlb_hash32.c:148:
    + if (Hash == NULL) {

    ERROR: space required after that ';' (ctx:VxV)
    #192: FILE: arch/powerpc/platforms/powermac/pci.c:65:
    + for (; node != NULL;node = node->sibling) {

    CHECK: Comparison to NULL could be written "node"
    #192: FILE: arch/powerpc/platforms/powermac/pci.c:65:
    + for (; node != NULL;node = node->sibling) {

    CHECK: Comparison to NULL could be written "!region"
    #201: FILE: arch/powerpc/platforms/powermac/pci.c:1227:
    + if (region == NULL)

    CHECK: Comparison to NULL could be written "of_get_property"
    #214: FILE: arch/powerpc/platforms/powermac/setup.c:155:
    + if (of_get_property(np, "cache-unified", NULL) != NULL && dc) {

    CHECK: Comparison to NULL could be written "!np"
    #223: FILE: arch/powerpc/platforms/powermac/setup.c:247:
    + if (np == NULL)

    CHECK: Comparison to NULL could be written "np"
    #226: FILE: arch/powerpc/platforms/powermac/setup.c:249:
    + if (np != NULL) {

    CHECK: Comparison to NULL could be written "l2cr"
    #230: FILE: arch/powerpc/platforms/powermac/setup.c:252:
    + if (l2cr != NULL) {

    CHECK: Comparison to NULL could be written "via"
    #243: FILE: drivers/macintosh/via-pmu.c:277:
    + if (via != NULL)

    CHECK: Comparison to NULL could be written "current_req"
    #252: FILE: drivers/macintosh/via-pmu.c:1155:
    + if (current_req != NULL) {

    CHECK: Comparison to NULL could be written "!req"
    #261: FILE: drivers/macintosh/via-pmu.c:1230:
    + if (req == NULL || pmu_state != idle

    CHECK: Comparison to NULL could be written "!req"
    #270: FILE: drivers/macintosh/via-pmu.c:1385:
    + if (req == NULL) {

    CHECK: Comparison to NULL could be written "!pp"
    #288: FILE: drivers/macintosh/via-pmu.c:2084:
    + if (pp == NULL)

    CHECK: Comparison to NULL could be written "!pp"
    #297: FILE: drivers/macintosh/via-pmu.c:2110:
    + if (count < 1 || pp == NULL)

    CHECK: Comparison to NULL could be written "!pp"
    #306: FILE: drivers/macintosh/via-pmu.c:2167:
    + if (pp == NULL)

    CHECK: Comparison to NULL could be written "pp"
    #315: FILE: drivers/macintosh/via-pmu.c:2183:
    + if (pp != NULL) {

    Link: https://github.com/linuxppc/linux/issues/37
    Signed-off-by: Mathieu Malaterre
    Signed-off-by: Michael Ellerman

    Mathieu Malaterre
     

16 May, 2018

1 commit


14 May, 2018

1 commit


08 Apr, 2018

1 commit

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

    - Support for 4PB user address space on 64-bit, opt-in via mmap().

    - Removal of POWER4 support, which was accidentally broken in 2016
    and no one noticed, and blocked use of some modern instructions.

    - Workarounds so that the hypervisor can enable Transactional Memory
    on Power9.

    - A series to disable the DAWR (Data Address Watchpoint Register) on
    Power9.

    - More information displayed in the meltdown/spectre_v1/v2 sysfs
    files.

    - A vpermxor (Power8 Altivec) implementation for the raid6 Q
    Syndrome.

    - A big series to make the allocation of our pacas (per cpu area),
    kernel page tables, and per-cpu stacks NUMA aware when using the
    Radix MMU on Power9.

    And as usual many fixes, reworks and cleanups.

    Thanks to: Aaro Koskinen, Alexandre Belloni, Alexey Kardashevskiy,
    Alistair Popple, Andy Shevchenko, Aneesh Kumar K.V, Anshuman Khandual,
    Balbir Singh, Benjamin Herrenschmidt, Christophe Leroy, Christophe
    Lombard, Cyril Bur, Daniel Axtens, Dave Young, Finn Thain, Frederic
    Barrat, Gustavo Romero, Horia Geantă, Jonathan Neuschäfer, Kees Cook,
    Larry Finger, Laurent Dufour, Laurent Vivier, Logan Gunthorpe,
    Madhavan Srinivasan, Mark Greer, Mark Hairgrove, Markus Elfring,
    Mathieu Malaterre, Matt Brown, Matt Evans, Mauricio Faria de Oliveira,
    Michael Neuling, Naveen N. Rao, Nicholas Piggin, Paul Mackerras,
    Philippe Bergheaud, Ram Pai, Rob Herring, Sam Bobroff, Segher
    Boessenkool, Simon Guo, Simon Horman, Stewart Smith, Sukadev
    Bhattiprolu, Suraj Jitindar Singh, Thiago Jung Bauermann, Vaibhav
    Jain, Vaidyanathan Srinivasan, Vasant Hegde, Wei Yongjun"

    * tag 'powerpc-4.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (207 commits)
    powerpc/64s/idle: Fix restore of AMOR on POWER9 after deep sleep
    powerpc/64s: Fix POWER9 DD2.2 and above in cputable features
    powerpc/64s: Fix pkey support in dt_cpu_ftrs, add CPU_FTR_PKEY bit
    powerpc/64s: Fix dt_cpu_ftrs to have restore_cpu clear unwanted LPCR bits
    Revert "powerpc/64s/idle: POWER9 ESL=0 stop avoid save/restore overhead"
    powerpc: iomap.c: introduce io{read|write}64_{lo_hi|hi_lo}
    powerpc: io.h: move iomap.h include so that it can use readq/writeq defs
    cxl: Fix possible deadlock when processing page faults from cxllib
    powerpc/hw_breakpoint: Only disable hw breakpoint if cpu supports it
    powerpc/mm/radix: Update command line parsing for disable_radix
    powerpc/mm/radix: Parse disable_radix commandline correctly.
    powerpc/mm/hugetlb: initialize the pagetable cache correctly for hugetlb
    powerpc/mm/radix: Update pte fragment count from 16 to 256 on radix
    powerpc/mm/keys: Update documentation and remove unnecessary check
    powerpc/64s/idle: POWER9 ESL=0 stop avoid save/restore overhead
    powerpc/64s/idle: Consolidate power9_offline_stop()/power9_idle_stop()
    powerpc/powernv: Always stop secondaries before reboot/shutdown
    powerpc: hard disable irqs in smp_send_stop loop
    powerpc: use NMI IPI for smp_send_stop
    powerpc/powernv: Fix SMT4 forcing idle code
    ...

    Linus Torvalds
     

30 Mar, 2018

2 commits

  • We should zero an array using sizeof instead of number of elements.

    Fixes the following compiler (GCC 7.3.0) warnings:

    drivers/macintosh/rack-meter.c: In function 'rackmeter_do_pause':
    drivers/macintosh/rack-meter.c:157:2: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
    drivers/macintosh/rack-meter.c:158:2: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]

    Fixes: 4f7bef7a9f69 ("drivers: macintosh: rack-meter: fix bogus memsets")
    Reported-by: Stephen Rothwell
    Signed-off-by: Aaro Koskinen
    Signed-off-by: Michael Ellerman

    Aaro Koskinen
     
  • No change to object files.

    Cc: Benjamin Herrenschmidt
    Signed-off-by: Finn Thain
    Signed-off-by: Michael Ellerman

    Finn Thain
     

20 Mar, 2018

1 commit