1. 11 Feb, 2021 3 commits
    • Michael Ellerman's avatar
      powerpc/83xx: Fix build error when CONFIG_PCI=n · 5c47c44f
      Michael Ellerman authored
      As reported by lkp:
      
        arch/powerpc/platforms/83xx/km83xx.c:183:19: error: 'mpc83xx_setup_pci' undeclared here (not in a function)
           183 |  .discover_phbs = mpc83xx_setup_pci,
      	 |                   ^~~~~~~~~~~~~~~~~
      	 |                   mpc83xx_setup_arch
      
      There is a stub defined for the CONFIG_PCI=n case, but now that
      mpc83xx_setup_pci() is being assigned to discover_phbs the correct
      empty value is NULL.
      
      Fixes: 83f84041 ("powerpc/83xx: Move PHB discovery")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20210210130804.3190952-1-mpe@ellerman.id.au
      5c47c44f
    • Nicholas Piggin's avatar
      powerpc: remove interrupt handler functions from the noinstr section · e4bb64c7
      Nicholas Piggin authored
      The allyesconfig ppc64 kernel fails to link with relocations unable to
      fit after commit 3a96570f ("powerpc: convert interrupt handlers to
      use wrappers"), which is due to the interrupt handler functions being
      put into the .noinstr.text section, which the linker script places on
      the opposite side of the main .text section from the interrupt entry
      asm code which calls the handlers.
      
      This results in a lot of linker stubs that overwhelm the 252-byte sized
      space we allow for them, or in the case of BE a .opd relocation link
      error for some reason.
      
      It's not required to put interrupt handlers in the .noinstr section,
      previously they used NOKPROBE_SYMBOL, so take them out and replace
      with a NOKPROBE_SYMBOL in the wrapper macro. Remove the explicit
      NOKPROBE_SYMBOL macros in the interrupt handler functions. This makes
      a number of interrupt handlers nokprobe that were not prior to the
      interrupt wrappers commit, but since that commit they were made
      nokprobe due to being in .noinstr.text, so this fix does not change
      that.
      
      The fixes tag is different to the commit that first exposes the problem
      because it is where the wrapper macros were introduced.
      
      Fixes: 8d41fc61 ("powerpc: interrupt handler wrapper functions")
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      [mpe: Slightly fix up comment wording]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20210211063636.236420-1-npiggin@gmail.com
      e4bb64c7
    • Michael Ellerman's avatar
      powerpc/powernv/pci: Use kzalloc() for phb related allocations · dea6f4c6
      Michael Ellerman authored
      As part of commit fbbefb32 ("powerpc/pci: Move PHB discovery for
      PCI_DN using platforms"), I switched some allocations from
      memblock_alloc() to kmalloc(), otherwise memblock would warn that it
      was being called after slab init.
      
      However I missed that the code relied on the allocations being zeroed,
      without which we could end up crashing:
      
        pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to ff
        BUG: Unable to handle kernel data access on read at 0x6b6b6b6b6b6b6af7
        Faulting instruction address: 0xc0000000000dbc90
        Oops: Kernel access of bad area, sig: 11 [#1]
        LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA PowerNV
        ...
        NIP  pnv_ioda_get_pe_state+0xe0/0x1d0
        LR   pnv_ioda_get_pe_state+0xb4/0x1d0
        Call Trace:
          pnv_ioda_get_pe_state+0xb4/0x1d0 (unreliable)
          pnv_pci_config_check_eeh.isra.9+0x78/0x270
          pnv_pci_read_config+0xf8/0x160
          pci_bus_read_config_dword+0xa4/0x120
          pci_bus_generic_read_dev_vendor_id+0x54/0x270
          pci_scan_single_device+0xb8/0x140
          pci_scan_slot+0x80/0x1b0
          pci_scan_child_bus_extend+0x94/0x490
          pcibios_scan_phb+0x1f8/0x3c0
          pcibios_init+0x8c/0x12c
          do_one_initcall+0x94/0x510
          kernel_init_freeable+0x35c/0x3fc
          kernel_init+0x2c/0x168
          ret_from_kernel_thread+0x5c/0x70
      
      Switch them to kzalloc().
      
      Fixes: fbbefb32 ("powerpc/pci: Move PHB discovery for PCI_DN using platforms")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20210211112749.3410771-1-mpe@ellerman.id.au
      dea6f4c6
  2. 08 Feb, 2021 37 commits