1. 03 Jun, 2018 10 commits
    • Nicholas Piggin's avatar
      powerpc/pseries: put cede MSR[EE] check under IRQ_SOFT_MASK_DEBUG · 9f4b61b2
      Nicholas Piggin authored
      This check does not catch IRQ soft mask bugs, but this option is
      slightly more suitable than TRACE_IRQFLAGS.
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      9f4b61b2
    • Nicholas Piggin's avatar
      powerpc/64: irq_work avoid interrupt when called with hardware irqs enabled · ebb37cf3
      Nicholas Piggin authored
      irq_work_raise should not cause a decrementer exception unless it is
      called from NMI context. Doing so often just results in an immediate
      masked decrementer interrupt:
      
         <...>-550    90d...    4us : update_curr_rt <-dequeue_task_rt
         <...>-550    90d...    5us : dbs_update_util_handler <-update_curr_rt
         <...>-550    90d...    6us : arch_irq_work_raise <-irq_work_queue
         <...>-550    90d...    7us : soft_nmi_interrupt <-soft_nmi_common
         <...>-550    90d...    7us : printk_nmi_enter <-soft_nmi_interrupt
         <...>-550    90d.Z.    8us : rcu_nmi_enter <-soft_nmi_interrupt
         <...>-550    90d.Z.    9us : rcu_nmi_exit <-soft_nmi_interrupt
         <...>-550    90d...    9us : printk_nmi_exit <-soft_nmi_interrupt
         <...>-550    90d...   10us : cpuacct_charge <-update_curr_rt
      
      The soft_nmi_interrupt here is the call into the watchdog, due to the
      decrementer interrupt firing with irqs soft-disabled. This is
      harmless, but sub-optimal.
      
      When it's not called from NMI context or with interrupts enabled, mark
      the decrementer pending in the irq_happened mask directly, rather than
      having the masked decrementer interupt handler do it. This will be
      replayed at the next local_irq_enable. See the comment for details.
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      ebb37cf3
    • Alexey Kardashevskiy's avatar
      powerpc/powernv/ioda2: Remove redundant free of TCE pages · 98fd72fe
      Alexey Kardashevskiy authored
      When IODA2 creates a PE, it creates an IOMMU table with it_ops::free
      set to pnv_ioda2_table_free() which calls pnv_pci_ioda2_table_free_pages().
      
      Since iommu_tce_table_put() calls it_ops::free when the last reference
      to the table is released, explicit call to pnv_pci_ioda2_table_free_pages()
      is not needed so let's remove it.
      
      This should fix double free in the case of PCI hotuplug as
      pnv_pci_ioda2_table_free_pages() does not reset neither
      iommu_table::it_base nor ::it_size.
      
      This was not exposed by SRIOV as it uses different code path via
      pnv_pcibios_sriov_disable().
      
      IODA1 does not inialize it_ops::free so it does not have this issue.
      
      Fixes: c5f7700b ("powerpc/powernv: Dynamically release PE")
      Cc: stable@vger.kernel.org # v4.8+
      Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      98fd72fe
    • Yisheng Xie's avatar
      powerpc/xmon: use match_string() helper · 0abbf2bf
      Yisheng Xie authored
      match_string() returns the index of an array for a matching string,
      which can be used instead of open coded variant.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: default avatarYisheng Xie <xieyisheng1@huawei.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      0abbf2bf
    • Christophe Leroy's avatar
      powerpc: Fix build by disabling attribute-alias warning for SYSCALL_DEFINEx · 2479bfc9
      Christophe Leroy authored
      GCC 8.1 emits warnings such as the following. As arch/powerpc code is
      built with -Werror, this breaks the build with GCC 8.1.
      
        In file included from arch/powerpc/kernel/pci_64.c:23:
        ./include/linux/syscalls.h:233:18: error: 'sys_pciconfig_iobase' alias
        between functions of incompatible types 'long int(long int, long
        unsigned int, long unsigned int)' and 'long int(long int, long int,
        long int)' [-Werror=attribute-alias]
          asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
                          ^~~
        ./include/linux/syscalls.h:222:2: note: in expansion of macro '__SYSCALL_DEFINEx'
          __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
      
      This patch inhibits those warnings.
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      [mpe: Trim change log]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      2479bfc9
    • Christophe Leroy's avatar
      powerpc/64: Fix strncpy() related build failures with GCC 8.1 · c9599881
      Christophe Leroy authored
      GCC 8.1 warns about possible string truncation:
      
        arch/powerpc/kernel/nvram_64.c:1042:2: error: 'strncpy' specified
        bound 12 equals destination size [-Werror=stringop-truncation]
          strncpy(new_part->header.name, name, 12);
      
        arch/powerpc/platforms/ps3/repository.c:106:2: error: 'strncpy'
        output truncated before terminating nul copying 8 bytes from a
        string of the same length [-Werror=stringop-truncation]
          strncpy((char *)&n, text, 8);
      
      Fix it by using memcpy(). To make that safe we need to ensure the
      destination is pre-zeroed. Use kzalloc() in the nvram code and
      initialise the u64 to zero in the ps3 code.
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      [mpe: Use kzalloc() in the nvram code, flesh out change log]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      c9599881
    • Michael Ellerman's avatar
      Merge branch 'topic/pkey' into next · 2135a6ec
      Michael Ellerman authored
      This is a branch with a mixture of mm, x86 and powerpc commits all
      relating to some minor cross-arch pkeys consolidation. The x86/mm
      changes have been reviewed by Ingo & Dave Hansen and the tree has been
      in linux-next for some weeks without issue.
      2135a6ec
    • Michael Ellerman's avatar
      Merge branch 'fixes' into next · f1079d3a
      Michael Ellerman authored
      We ended up with an ugly conflict between fixes and next in ftrace.h
      involving multiple nested ifdefs, and the automatic resolution is
      wrong. So merge fixes into next so we can fix it up.
      f1079d3a
    • Michael Ellerman's avatar
      Merge branch 'topic/kbuild' into next · b5240b14
      Michael Ellerman authored
      Merge in some commits we're sharing with the kbuild tree.
      b5240b14
    • Michael Ellerman's avatar
      Merge branch 'topic/ppc-kvm' into next · 481c63ac
      Michael Ellerman authored
      Merge in some commits we're sharing with the kvm-ppc tree.
      481c63ac
  2. 01 Jun, 2018 7 commits
    • Aneesh Kumar K.V's avatar
      powerpc/mm: Fix kernel crash on page table free · 667416f3
      Aneesh Kumar K.V authored
      Fix the below crash on Book3E 64. pgtable_page_dtor expects struct
      page *arg.
      
      Also call the destructor on non book3s platforms correctly. This frees
      up the split PTL locks correctly if we had allocated them before.
      
      Call Trace:
        .kmem_cache_free+0x9c/0x44c (unreliable)
        .ptlock_free+0x1c/0x30
        .tlb_remove_table+0xdc/0x224
        .free_pgd_range+0x298/0x500
        .shift_arg_pages+0x10c/0x1e0
        .setup_arg_pages+0x200/0x25c
        .load_elf_binary+0x450/0x16c8
        .search_binary_handler.part.11+0x9c/0x248
        .do_execveat_common.isra.13+0x868/0xc18
        .run_init_process+0x34/0x4c
        .try_to_run_init_process+0x1c/0x68
        .kernel_init+0xdc/0x130
        .ret_from_kernel_thread+0x58/0x7c
      
      Fixes: 70234676 ("powerpc/mm/nohash: Remove pte fragment dependency from nohash")
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      667416f3
    • Mathieu Malaterre's avatar
      powerpc/prom: Fix %u/%llx usage since prom_printf() change · 8af1da40
      Mathieu Malaterre authored
      In commit eae5f709 ("powerpc: Add __printf verification to
      prom_printf") __printf attribute was added to prom_printf(), which
      means GCC started warning about type/format mismatches. As part of
      that commit we changed some "%lx" formats to "%llx" where the type is
      actually unsigned long long.
      
      Unfortunately prom_printf() doesn't know how to print "%llx", it just
      prints a literal "lx", eg:
      
        reserved memory map:
          lx - lx
          lx - lx
      
      prom_printf() also doesn't know how to print "%u" (only "%lu"), it
      just prints a literal "u", eg:
      
        Max number of cores passed to firmware: u (NR_CPUS = 2048)
      
      Instead of:
      
        Max number of cores passed to firmware: 2048 (NR_CPUS = 2048)
      
      This commit adds support for the missing formatters.
      
      Fixes: eae5f709 ("powerpc: Add __printf verification to prom_printf")
      Reported-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Tested-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      8af1da40
    • Vaibhav Jain's avatar
      cxl: Configure PSL to not use APC virtual machines · 9a6d2022
      Vaibhav Jain authored
      APC virtual machines arent used on POWER-9 chips and are already
      disabled in on-chip CAPP. They also need to be disabled on the PSL via
      'PSL Data Send Control Register' by setting bit(47). This forces the
      PSL to send commands to CAPP with queue.id == 0.
      
      Fixes: 56328743 ("cxl: Add support for POWER9 DD2")
      Cc: stable@vger.kernel.org # v4.15+
      Signed-off-by: default avatarVaibhav Jain <vaibhav@linux.vnet.ibm.com>
      Acked-by: default avatarAndrew Donnellan <andrew.donnellan@au1.ibm.com>
      Reviewed-by: default avatarAlastair D'Silva <alastair@d-silva.org>
      Reviewed-by: default avatarChristophe Lombard <clombard@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      9a6d2022
    • Vaibhav Jain's avatar
      cxl: Disable prefault_mode in Radix mode · b6c84ba2
      Vaibhav Jain authored
      Currently we see a kernel-oops reported on Power-9 while attaching a
      context to an AFU, with radix-mode and sysfs attr 'prefault_mode' set
      to anything other than 'none'. The backtrace of the oops is of this
      form:
      
        Unable to handle kernel paging request for data at address 0x00000080
        Faulting instruction address: 0xc00800000bcf3b20
        cpu 0x1: Vector: 300 (Data Access) at [c00000037f003800]
            pc: c00800000bcf3b20: cxl_load_segment+0x178/0x290 [cxl]
            lr: c00800000bcf39f0: cxl_load_segment+0x48/0x290 [cxl]
            sp: c00000037f003a80
           msr: 9000000000009033
           dar: 80
         dsisr: 40000000
          current = 0xc00000037f280000
          paca    = 0xc0000003ffffe600   softe: 3        irq_happened: 0x01
            pid   = 3529, comm = afp_no_int
        <snip>
        cxl_prefault+0xfc/0x248 [cxl]
        process_element_entry_psl9+0xd8/0x1a0 [cxl]
        cxl_attach_dedicated_process_psl9+0x44/0x130 [cxl]
        native_attach_process+0xc0/0x130 [cxl]
        afu_ioctl+0x3f4/0x5e0 [cxl]
        do_vfs_ioctl+0xdc/0x890
        ksys_ioctl+0x68/0xf0
        sys_ioctl+0x40/0xa0
        system_call+0x58/0x6c
      
      The issue is caused as on Power-8 the AFU attr 'prefault_mode' was
      used to improve initial storage fault performance by prefaulting
      process segments. However on Power-9 with radix mode we don't have
      Storage-Segments that we can prefault. Also prefaulting process Pages
      will be too costly and fine-grained.
      
      Hence, since the prefaulting mechanism doesn't makes sense of
      radix-mode, this patch updates prefault_mode_store() to not allow any
      other value apart from CXL_PREFAULT_NONE when radix mode is enabled.
      
      Fixes: f24be42a ("cxl: Add psl9 specific code")
      Cc: stable@vger.kernel.org # v4.12+
      Signed-off-by: default avatarVaibhav Jain <vaibhav@linux.ibm.com>
      Acked-by: default avatarFrederic Barrat <fbarrat@linux.vnet.ibm.com>
      Acked-by: default avatarAndrew Donnellan <andrew.donnellan@au1.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      b6c84ba2
    • Nicholas Piggin's avatar
      powerpc/kbuild: Use flags variables rather than overriding LD/CC/AS · 1421dc6d
      Nicholas Piggin authored
      The powerpc toolchain can compile combinations of 32/64 bit and
      big/little endian, so it's convenient to consider, e.g.,
      
        `CC -m64 -mbig-endian`
      
      To be the C compiler for the purpose of invoking it to build target
      artifacts. So overriding the CC variable to include these flags works
      for this purpose.
      
      Unfortunately that is not compatible with the way the proposed new
      Kconfig macro language will work.
      
      After previous patches in this series, these flags can be carefully
      passed in using flags instead.
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      1421dc6d
    • Nicholas Piggin's avatar
      powerpc/kbuild: Remove CROSS32 defines from top level powerpc Makefile · af3901cb
      Nicholas Piggin authored
      Switch VDSO32 build over to use CROSS32_COMPILE directly, and have
      it pass in -m32 after the standard c_flags. This allows endianness
      overrides to be removed and the endian and bitness flags moved into
      standard flags variables.
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      af3901cb
    • Nicholas Piggin's avatar
      powerpc/kbuild: Set default generic machine type for 32-bit compile · 4bf4f42a
      Nicholas Piggin authored
      Some 64-bit toolchains uses the wrong ISA variant for compiling 32-bit
      kernels, even with -m32. Debian's powerpc64le is one such case, and
      that is because it is built with --with-cpu=power8.
      
      So when cross compiling a 32-bit kernel with a 64-bit toolchain, set
      -mcpu=powerpc initially, which is the generic 32-bit powerpc machine
      type and scheduling model. CPU and platform code can override this
      with subsequent -mcpu flags if necessary.
      
      This is not done for 32-bit toolchains otherwise it would override
      their defaults, which are presumably set appropriately for the
      environment (moreso than a 64-bit cross compiler).
      
      This fixes a lot of build failures due to incompatible assembly when
      compiling 32-bit kernel with the Debian powerpc64le 64-bit toolchain.
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      4bf4f42a
  3. 29 May, 2018 1 commit
  4. 28 May, 2018 4 commits
  5. 25 May, 2018 18 commits
    • Madhavan Srinivasan's avatar
      powerpc/perf: Update raw-event code encoding comment for power8 · 458c7017
      Madhavan Srinivasan authored
      Comment explanning the raw event code encoding for Power8 was
      moved to isa207_common.h file when re-factoring the code to
      support power9. But then Power9 pmu branched out due to changes
      specific to power9. So move the encoding comment back to power8-pmu.c
      Just comment movement and no logic change.
      
      Fixes: 4d3576b2 ('powerpc/perf: factor out power8 pmu macros and defines')
      Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      458c7017
    • Mathieu Malaterre's avatar
      powerpc: Add a missing include header · d647b210
      Mathieu Malaterre authored
      The header file <asm/switch_to.h> was missing from the includes. Fix the
      following warning, treated as error with W=1:
      
        arch/powerpc/kernel/vecemu.c:260:5: error: no previous prototype for ‘emulate_altivec’ [-Werror=missing-prototypes]
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      d647b210
    • Mathieu Malaterre's avatar
      powerpc/32: Add a missing include header · c89ca593
      Mathieu Malaterre authored
      The header file <linux/syscalls.h> was missing from the includes. Fix the
      following warning, treated as error with W=1:
      
        arch/powerpc/kernel/pci_32.c:286:6: error: no previous prototype for ‘sys_pciconfig_iobase’ [-Werror=missing-prototypes]
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      c89ca593
    • Mathieu Malaterre's avatar
      powerpc/chrp/time: Make some functions static, add missing header include · b87a358b
      Mathieu Malaterre authored
      Add a missing include <platforms/chrp/chrp.h>.
      
      These functions can all be static, make it so. Fix warnings treated as
      errors with W=1:
      
        arch/powerpc/platforms/chrp/time.c:41:13: error: no previous prototype for ‘chrp_time_init’ [-Werror=missing-prototypes]
        arch/powerpc/platforms/chrp/time.c:66:5: error: no previous prototype for ‘chrp_cmos_clock_read’ [-Werror=missing-prototypes]
        arch/powerpc/platforms/chrp/time.c:74:6: error: no previous prototype for ‘chrp_cmos_clock_write’ [-Werror=missing-prototypes]
        arch/powerpc/platforms/chrp/time.c:86:5: error: no previous prototype for ‘chrp_set_rtc_time’ [-Werror=missing-prototypes]
        arch/powerpc/platforms/chrp/time.c:130:6: error: no previous prototype for ‘chrp_get_rtc_time’ [-Werror=missing-prototypes]
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      b87a358b
    • Mathieu Malaterre's avatar
      powerpc/tau: Make some function static · 9e0d86cd
      Mathieu Malaterre authored
      These functions can all be static, make it so. Fix warnings treated as
      errors with W=1:
      
        arch/powerpc/kernel/tau_6xx.c:53:6: error: no previous prototype for ‘set_thresholds’ [-Werror=missing-prototypes]
        arch/powerpc/kernel/tau_6xx.c:73:6: error: no previous prototype for ‘TAUupdate’ [-Werror=missing-prototypes]
        arch/powerpc/kernel/tau_6xx.c:208:13: error: no previous prototype for ‘TAU_init_smp’ [-Werror=missing-prototypes]
        arch/powerpc/kernel/tau_6xx.c:220:12: error: no previous prototype for ‘TAU_init’ [-Werror=missing-prototypes]
        arch/powerpc/kernel/tau_6xx.c:126:6: error: no previous prototype for ‘TAUException’ [-Werror=missing-prototypes]
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      9e0d86cd
    • Mathieu Malaterre's avatar
      powerpc: Make function btext_initialize static · 86e11b6e
      Mathieu Malaterre authored
      This function can be static, make it so, this fix a warning treated as
      error with W=1:
      
        arch/powerpc/kernel/btext.c:173:5: error: no previous prototype for ‘btext_initialize’ [-Werror=missing-prototypes]
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      86e11b6e
    • Mathieu Malaterre's avatar
      powerpc/tau: Synchronize function prototypes and body · bd13ac95
      Mathieu Malaterre authored
      Some function prototypes and body for Thermal Assist Units were not in
      sync. Update the function definition to match the existing function
      declaration found in `setup-common.c`, changing an `int` return type to a
      `u32` return type. Move the prototypes to a header file. Fix the following
      warnings, treated as error with W=1:
      
        arch/powerpc/kernel/tau_6xx.c:257:5: error: no previous prototype for ‘cpu_temp_both’ [-Werror=missing-prototypes]
        arch/powerpc/kernel/tau_6xx.c:262:5: error: no previous prototype for ‘cpu_temp’ [-Werror=missing-prototypes]
        arch/powerpc/kernel/tau_6xx.c:267:5: error: no previous prototype for ‘tau_interrupts’ [-Werror=missing-prototypes]
      
      Compile tested with CONFIG_TAU_INT.
      Suggested-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      bd13ac95
    • Mathieu Malaterre's avatar
      powerpc: Add missing prototype · 3fc5ee9b
      Mathieu Malaterre authored
      Add one missing prototype for function rh_dump_blk. Fix warning treated as
      error in W=1:
      
        arch/powerpc/lib/rheap.c:740:6: error: no previous prototype for ‘rh_dump_blk’ [-Werror=missing-prototypes]
      Suggested-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      3fc5ee9b
    • Mathieu Malaterre's avatar
      powerpc/52xx: Add missing functions prototypes · c3f0515e
      Mathieu Malaterre authored
      The function prototypes were declared within a `#ifdef CONFIG_PPC_LITE5200`
      block which would prevent them from being visible when compiling
      `mpc52xx_pm.c`. Move the prototypes outside of the `#ifdef` block to fix
      the following warnings treated as errors with W=1:
      
        arch/powerpc/platforms/52xx/mpc52xx_pm.c:58:5: error: no previous prototype for ‘mpc52xx_pm_prepare’ [-Werror=missing-prototypes]
        arch/powerpc/platforms/52xx/mpc52xx_pm.c:113:5: error: no previous prototype for ‘mpc52xx_pm_enter’ [-Werror=missing-prototypes]
        arch/powerpc/platforms/52xx/mpc52xx_pm.c:181:6: error: no previous prototype for ‘mpc52xx_pm_finish’ [-Werror=missing-prototypes]
      Suggested-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      c3f0515e
    • Mathieu Malaterre's avatar
      powerpc/powermac: Add missing prototype for note_bootable_part() · f72cf3f1
      Mathieu Malaterre authored
      Add a missing prototype for function `note_bootable_part` to silence a
      warning treated as error with W=1:
      
        arch/powerpc/platforms/powermac/setup.c:361:12: error: no previous prototype for ‘note_bootable_part’ [-Werror=missing-prototypes]
      Suggested-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      f72cf3f1
    • Mathieu Malaterre's avatar
      powerpc/powermac: Move pmac_pfunc_base_install prototype to header file · f91d5998
      Mathieu Malaterre authored
      The pmac_pfunc_base_install prototype was declared in powermac/smp.c since
      function was used there, move it to pmac_pfunc.h header to be visible in
      pfunc_base.c. Fix a warning treated as error with W=1:
      
        arch/powerpc/platforms/powermac/pfunc_base.c:330:12: error: no previous prototype for ‘pmac_pfunc_base_install’ [-Werror=missing-prototypes]
      Suggested-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      f91d5998
    • Mathieu Malaterre's avatar
      powerpc/chrp/pci: Make some functions static · 910be6be
      Mathieu Malaterre authored
      These functions can all be static, make it so. Fix warnings treated as
      errors with W=1:
      
        arch/powerpc/platforms/chrp/pci.c:34:5: error: no previous prototype for ‘gg2_read_config’ [-Werror=missing-prototypes]
        arch/powerpc/platforms/chrp/pci.c:61:5: error: no previous prototype for ‘gg2_write_config’ [-Werror=missing-prototypes]
        arch/powerpc/platforms/chrp/pci.c:97:5: error: no previous prototype for ‘rtas_read_config’ [-Werror=missing-prototypes]
        arch/powerpc/platforms/chrp/pci.c:112:5: error: no previous prototype for ‘rtas_write_config’ [-Werror=missing-prototypes]
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      910be6be
    • Mathieu Malaterre's avatar
      powerpc/powermac: Mark variable x as unused · 5a4b475c
      Mathieu Malaterre authored
      Since the value of x is never intended to be read, declare it with gcc
      attribute as unused. Fix warning treated as error with W=1:
      
        arch/powerpc/platforms/powermac/bootx_init.c:471:21: error: variable ‘x’ set but not used [-Werror=unused-but-set-variable]
      Suggested-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      5a4b475c
    • Mathieu Malaterre's avatar
      powerpc/chrp/setup: Remove idu_size variable and make some functions static · f0e0b866
      Mathieu Malaterre authored
      Remove variable declaration idu_size and associated code since not used.
      
      These functions can all be static, make it so. Fix warnings treated as
      errors with W=1:
      
        arch/powerpc/platforms/chrp/setup.c:97:6: error: no previous prototype for ‘chrp_show_cpuinfo’ [-Werror=missing-prototypes]
        arch/powerpc/platforms/chrp/setup.c:302:13: error: no previous prototype for ‘chrp_setup_arch’ [-Werror=missing-prototypes]
        arch/powerpc/platforms/chrp/setup.c:385:16: error: variable ‘idu_size’ set but not used [-Werror=unused-but-set-variable]
        arch/powerpc/platforms/chrp/setup.c:526:13: error: no previous prototype for ‘chrp_init_IRQ’ [-Werror=missing-prototypes]
        arch/powerpc/platforms/chrp/setup.c:559:1: error: no previous prototype for ‘chrp_init2’ [-Werror=missing-prototypes]
      Suggested-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      f0e0b866
    • Mathieu Malaterre's avatar
      powerpc/wii: Make hlwd_pic_init function static · eed6964b
      Mathieu Malaterre authored
      The function hlwd_pic_init can be made static, so do it. Fix the following
      warning treated as error (W=1):
      
      ../arch/powerpc/platforms/embedded6xx/hlwd-pic.c:158:20: error: no previous prototype for ‘hlwd_pic_init’ [-Werror=missing-prototypes]
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      eed6964b
    • Mathieu Malaterre's avatar
      powerpc/mm/radix: Use do/while(0) trick for single statement block · 85aa4b98
      Mathieu Malaterre authored
      In commit 7a22d632 ("powerpc/mm/radix: Update command line parsing for
      disable_radix") an `if` statement was added for a possible empty body
      (prom_debug).
      
      Fix the following warning, treated as error with W=1:
      
        arch/powerpc/kernel/prom_init.c:656:46: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body]
      Suggested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      85aa4b98
    • Mathieu Malaterre's avatar
      powerpc/sparse: Fix plain integer as NULL pointer warning · d8731527
      Mathieu Malaterre authored
      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/37Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      d8731527
    • Mathieu Malaterre's avatar
      powerpc/altivec: Add missing prototypes for altivec · 7cf76a68
      Mathieu Malaterre authored
      Some functions prototypes were missing for the non-altivec code. Add the
      missing prototypes in a new header file, fix warnings treated as errors
      with W=1:
      
        arch/powerpc/lib/xor_vmx_glue.c:18:6: error: no previous prototype for ‘xor_altivec_2’ [-Werror=missing-prototypes]
        arch/powerpc/lib/xor_vmx_glue.c:29:6: error: no previous prototype for ‘xor_altivec_3’ [-Werror=missing-prototypes]
        arch/powerpc/lib/xor_vmx_glue.c:40:6: error: no previous prototype for ‘xor_altivec_4’ [-Werror=missing-prototypes]
        arch/powerpc/lib/xor_vmx_glue.c:52:6: error: no previous prototype for ‘xor_altivec_5’ [-Werror=missing-prototypes]
      
      The prototypes were already present in <asm/xor.h> but this header file is
      meant to be included after <include/linux/raid/xor.h>. Trying to re-use
      <asm/xor.h> directly would lead to warnings such as:
      
        arch/powerpc/include/asm/xor.h:39:15: error: variable ‘xor_block_altivec’ has initializer but incomplete type
      
      Trying to re-use <asm/xor.h> after <include/linux/raid/xor.h> in
      xor_vmx_glue.c would in turn trigger the following warnings:
      
        include/asm-generic/xor.h:688:34: error: ‘xor_block_32regs’ defined but not used [-Werror=unused-variable]
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      7cf76a68