1. 07 Feb, 2022 14 commits
  2. 03 Feb, 2022 12 commits
  3. 02 Feb, 2022 5 commits
    • Michael Ellerman's avatar
      powerpc/ptdump: Fix sparse warning in hashpagetable.c · 961f649f
      Michael Ellerman authored
      As reported by sparse:
      
        arch/powerpc/mm/ptdump/hashpagetable.c:264:29: warning: restricted __be64 degrades to integer
        arch/powerpc/mm/ptdump/hashpagetable.c:265:49: warning: restricted __be64 degrades to integer
        arch/powerpc/mm/ptdump/hashpagetable.c:267:36: warning: incorrect type in assignment (different base types)
        arch/powerpc/mm/ptdump/hashpagetable.c:267:36:    expected unsigned long long [usertype]
        arch/powerpc/mm/ptdump/hashpagetable.c:267:36:    got restricted __be64 [usertype] v
        arch/powerpc/mm/ptdump/hashpagetable.c:268:36: warning: incorrect type in assignment (different base types)
        arch/powerpc/mm/ptdump/hashpagetable.c:268:36:    expected unsigned long long [usertype]
        arch/powerpc/mm/ptdump/hashpagetable.c:268:36:    got restricted __be64 [usertype] r
      
      The values returned by plpar_pte_read_4() are CPU endian, not __be64, so
      assigning them to struct hash_pte confuses sparse. As a minimal fix open
      code a struct to hold the values with CPU endian types.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Reported-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20220202053039.691917-1-mpe@ellerman.id.au
      961f649f
    • Corentin Labbe's avatar
      macintosh: macio_asic: remove useless cast for driver.name · ccafe7c2
      Corentin Labbe authored
      pci_driver name is const char pointer, so the cast it not necessary.
      Signed-off-by: default avatarCorentin Labbe <clabbe@baylibre.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20220125135421.4081740-1-clabbe@baylibre.com
      ccafe7c2
    • Michael Ellerman's avatar
      powerpc/64: Move paca allocation later in boot · 2e7f1e2b
      Michael Ellerman authored
      Mahesh & Sourabh identified two problems[1][2] with ppc64_bolted_size()
      and paca allocation.
      
      The first is that on a Radix capable machine but with "disable_radix" on
      the command line, there is a window during early boot where
      early_radix_enabled() is true, even though it will later become false.
      
        early_init_devtree:                       <- early_radix_enabled() = false
          early_init_dt_scan_cpus:                <- early_radix_enabled() = false
              ...
              check_cpu_pa_features:              <- early_radix_enabled() = false
              ...                               ^ <- early_radix_enabled() = TRUE
              allocate_paca:                    | <- early_radix_enabled() = TRUE
                  ...                           |
                  ppc64_bolted_size:            | <- early_radix_enabled() = TRUE
                      if (early_radix_enabled())| <- early_radix_enabled() = TRUE
                          return ULONG_MAX;     |
              ...                               |
          ...                                   | <- early_radix_enabled() = TRUE
          ...                                   | <- early_radix_enabled() = TRUE
          mmu_early_init_devtree()              V
          ...                                     <- early_radix_enabled() = false
      
      This causes ppc64_bolted_size() to return ULONG_MAX for the boot CPU's
      paca allocation, even though later it will return a different value.
      This is not currently a bug because the paca allocation is also limited
      by the RMA size, but that is very fragile.
      
      The second issue is that when using the Hash MMU, when we call
      ppc64_bolted_size() for the boot CPU's paca allocation, we have not yet
      detected whether 1T segments are available. That causes
      ppc64_bolted_size() to return 256MB, even if the machine can actually
      support up to 1T. This is usually OK, we generally have space below
      256MB for one paca, but for a kdump kernel placed above 256MB it causes
      the boot to fail.
      
      At boot we cannot discover all the features of the machine
      instantaneously, so there will always be some periods where we have
      incomplete knowledge of the system. However both the above problems stem
      from the fact that we allocate the boot CPU's paca (and paca pointers
      array) before we decide which MMU we are using, or discover its exact
      features.
      
      Moving the paca allocation slightly later still can solve both the
      issues described above, and means for a normal boot we don't do any
      permanent allocations until after we've discovered the MMU.
      
      Note that although we move the boot CPU's paca allocation later, we
      still have a temporary paca (boot_paca) accessible via r13, so code that
      does read only access to paca fields is safe. The only risk is that some
      code writes to the boot_paca, and that write will then be lost when we
      switch away from the boot_paca later in early_setup().
      
      The additional code that runs before the paca allocation is primarily
      mmu_early_init_devtree(), which is scanning the device tree and
      populating globals and cur_cpu_spec with MMU related flags. I do not see
      any additional code that writes to paca fields.
      
      [1]: https://lore.kernel.org/r/20211018084434.217772-2-sourabhjain@linux.ibm.com
      [2]: https://lore.kernel.org/r/20211018084434.217772-3-sourabhjain@linux.ibm.comSigned-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20220124130544.408675-1-mpe@ellerman.id.au
      2e7f1e2b
    • Maxim Kiselev's avatar
      powerpc: dts: t1040rdb: fix ports names for Seville Ethernet switch · 5ebb7474
      Maxim Kiselev authored
      On board rev A, the network interface labels for the switch ports
      written on the front panel are different than on rev B and later.
      
      This patch fixes network interface names for the switch ports according
      to labels that are written on the front panel of the board rev B.
      They start from ETH3 and end at ETH10.
      
      This patch also introduces a separate device tree for rev A.
      The main device tree is supposed to cover rev B and later.
      
      Fixes: e69eb082 ("powerpc: dts: t1040rdb: add ports for Seville Ethernet switch")
      Signed-off-by: default avatarMaxim Kiselev <bigunclemax@gmail.com>
      Reviewed-by: default avatarMaxim Kochetkov <fido_max@inbox.ru>
      Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20220121091447.3412907-1-bigunclemax@gmail.com
      5ebb7474
    • Laurent Dufour's avatar
      powerpc/pseries: read the lpar name from the firmware · eddaa9a4
      Laurent Dufour authored
      The LPAR name may be changed after the LPAR has been started in the HMC.
      In that case lparstat command is not reporting the updated value because
      it reads it from the device tree which is read at boot time.
      
      However this value could be read from RTAS.
      
      Adding this value in the /proc/powerpc/lparcfg output allows to read the
      updated value.
      
      However the hypervisor, like Qemu/KVM, may not support this RTAS
      parameter. In that case the value reported in lparcfg is read from the
      device tree and so is not updated accordingly.
      Signed-off-by: default avatarLaurent Dufour <ldufour@linux.ibm.com>
      Reviewed-by: default avatarTyrel Datwyler <tyreld@linux.ibm.com>
      Reviewed-by: default avatarNathan Lynch <nathanl@linux.ibm.com>
      [mpe: Drop doc-comment syntax, change RTAS/DT to lower case, use of_root
            to fix missing of_node_put(), use of_property_read_string()]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20220106161339.74656-1-ldufour@linux.ibm.com
      eddaa9a4
  4. 31 Jan, 2022 5 commits
  5. 30 Jan, 2022 4 commits