[PATCH -next?] powerpc/fsl_uli1575: fix kconfig warnings and build errors

2023-04-28 Thread Randy Dunlap
Neither FSL_SOC_BOOKE nor PPC_86xx enables CONFIG_PCI by
default, so it may be unset in some randconfigs.
When that happens, FSL_ULI1575 may be set when it should not be
since it is a PCI driver. When it is set, there are 3 kconfig
warnings and a slew of build errors

WARNING: unmet direct dependencies detected for PCI_QUIRKS
  Depends on [n]: PCI [=n]
  Selected by [y]:
  - FSL_PCI [=y]

WARNING: unmet direct dependencies detected for GENERIC_ISA_DMA
  Depends on [n]: ISA_DMA_API [=n]
  Selected by [y]:
  - FSL_ULI1575 [=y] && (FSL_SOC_BOOKE [=n] || PPC_86xx [=y])

WARNING: unmet direct dependencies detected for PPC_INDIRECT_PCI
  Depends on [n]: PCI [=n]
  Selected by [y]:
  - FSL_PCI [=y]

and 30+ build errors.

Fixes: 22fdf79171e8 ("powerpc/fsl_uli1575: Allow to disable FSL_ULI1575 
support")
Signed-off-by: Randy Dunlap 
Cc: Pali Rohár 
Cc: Michael Ellerman 
Cc: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/platforms/Kconfig |1 +
 1 file changed, 1 insertion(+)

diff -- a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -265,6 +265,7 @@ config CPM2
 config FSL_ULI1575
bool "ULI1575 PCIe south bridge support"
depends on FSL_SOC_BOOKE || PPC_86xx
+   depends on PCI
select FSL_PCI
select GENERIC_ISA_DMA
help


[PATCH] powerpc: delete empty config entry for PPC_86xx

2023-04-28 Thread Randy Dunlap
Drop an unused and empty "config" entry for PPC_86xx.
It has no keyword entries under it and the following line's
"menuconfig" for the same Kconfig symbol is what kconfig uses.

Fixes: d8267c1a3686 ("powerpc: Add 82xx/83xx/86xx to 6xx Multiplatform")
Signed-off-by: Randy Dunlap 
Cc: Kumar Gala 
Cc: Michael Ellerman 
Cc: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/platforms/86xx/Kconfig |1 -
 1 file changed, 1 deletion(-)

diff -- a/arch/powerpc/platforms/86xx/Kconfig 
b/arch/powerpc/platforms/86xx/Kconfig
--- a/arch/powerpc/platforms/86xx/Kconfig
+++ b/arch/powerpc/platforms/86xx/Kconfig
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-config PPC_86xx
 menuconfig PPC_86xx
bool "86xx-based boards"
depends on PPC_BOOK3S_32


Re: [GIT PULL] Please pull powerpc/linux.git powerpc-6.4-1 tag

2023-04-28 Thread Michael Ellerman
Linus Torvalds  writes:
> On Fri, Apr 28, 2023 at 2:44 AM Michael Ellerman  wrote:
>>
>>   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git 
>> tags/powerpc-6.4-1
>
> Odd. Your shortlog has this:
>
>> Michael Ellerman (46):
>>   powerpc/configs: Make pseries_defconfig an alias for ppc64le_guest
>
> that removed the 'pseries_defconfig' file, but then your diffstat
>
>>  arch/powerpc/configs/pq2fads_defconfig  
>>  |  80 
>>  arch/powerpc/include/asm/atomic.h   
>>  |  53 +-
>
> doesn't have it, resulting in the summary not matching what I get:
>
>> 278 files changed, 2672 insertions(+), 9188 deletions(-)
>
> versus my
>
>  279 files changed, 2690 insertions(+), 9528 deletions(-)
>
> and I see no obvious reason for it.
>
> I wonder if your test-merge just didn't remove the file (it did have a
> conflict due to the IXGB driver removal), and that's why.

Yeah my fault, looks like I edited the conflict in powernv_defconfig and
then did 'git add arch/powerpc/configs/*' which added back the pseries
one.

> Anyway, I'm not entirely sure about the mismatch of the end result,
> but it seems to be due to that one defconfig file, and I think my
> merge is fine. But please double-check.

Yep looks fine, thanks.

cheers


Re: [GIT PULL] Please pull powerpc/linux.git powerpc-6.4-1 tag

2023-04-28 Thread pr-tracker-bot
The pull request you sent on Fri, 28 Apr 2023 19:44:02 +1000:

> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git 
> tags/powerpc-6.4-1

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/70cc1b5307e8ee3076fdf2ecbeb89eb973aa0ff7

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html


Re: [GIT PULL] Please pull powerpc/linux.git powerpc-6.4-1 tag

2023-04-28 Thread Linus Torvalds
On Fri, Apr 28, 2023 at 2:44 AM Michael Ellerman  wrote:
>
>   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git 
> tags/powerpc-6.4-1

Odd. Your shortlog has this:

> Michael Ellerman (46):
>   powerpc/configs: Make pseries_defconfig an alias for ppc64le_guest

that removed the 'pseries_defconfig' file, but then your diffstat

>  arch/powerpc/configs/pq2fads_defconfig   
> |  80 
>  arch/powerpc/include/asm/atomic.h
> |  53 +-

doesn't have it, resulting in the summary not matching what I get:

> 278 files changed, 2672 insertions(+), 9188 deletions(-)

versus my

 279 files changed, 2690 insertions(+), 9528 deletions(-)

and I see no obvious reason for it.

I wonder if your test-merge just didn't remove the file (it did have a
conflict due to the IXGB driver removal), and that's why.

Anyway, I'm not entirely sure about the mismatch of the end result,
but it seems to be due to that one defconfig file, and I think my
merge is fine. But please double-check.

   Linus


[PATCH] powerpc: remove unneeded if-checks

2023-04-28 Thread Tom Rix
For ppc64, gcc with W=1 reports
arch/powerpc/platforms/cell/spu_base.c:330:17: error:
  suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  330 | ;
  | ^
arch/powerpc/platforms/cell/spu_base.c:333:17: error:
  suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  333 | ;
  | ^

These if-checks do not do anything so remove them.

Signed-off-by: Tom Rix 
---
 arch/powerpc/platforms/cell/spu_base.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spu_base.c 
b/arch/powerpc/platforms/cell/spu_base.c
index 7bd0b563e163..dea6f0f25897 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -326,12 +326,6 @@ spu_irq_class_1(int irq, void *data)
if (stat & CLASS1_STORAGE_FAULT_INTR)
__spu_trap_data_map(spu, dar, dsisr);
 
-   if (stat & CLASS1_LS_COMPARE_SUSPEND_ON_GET_INTR)
-   ;
-
-   if (stat & CLASS1_LS_COMPARE_SUSPEND_ON_PUT_INTR)
-   ;
-
spu->class_1_dsisr = 0;
spu->class_1_dar = 0;
 
-- 
2.27.0



Re: [PATCH 1/1] PCI: layerscape: Add the endpoint linkup notifier support

2023-04-28 Thread Bjorn Helgaas
On Thu, Apr 20, 2023 at 06:11:17PM -0400, Frank Li wrote:
> Layerscape has PME interrupt, which can be use as linkup notifer.
> Set CFG_READY bit when linkup detected.

s/use/used/
s/notifer/notifier/

> +/* PEX PFa PCIE pme and message interrupt registers*/

s/pme/PME/ to match other usage and spec.

> + dev_info(pci->dev, "Detect the link up state !\n");
> + } else if (val & PEX_PF0_PME_MES_DR_LDD) {
> + dev_info(pci->dev, "Detect the link down state !\n");
> + } else if (val & PEX_PF0_PME_MES_DR_HRD) {
> + dev_info(pci->dev, "Detect the hot reset state !\n");

No spaces before "!".  Omit the "!" completely unless these are
unexpected situations.  They seem ordinary to me.

Would probably be better as just "Link up", "Link down", "Hot reset".
Or "Link up state detected" if you want.

> + dev_err(>dev, "Can't get 'pme' irq.\n");
> + dev_err(>dev, "Can't register PCIe IRQ.\n");

Capitalize "IRQ" in both the above message and this one.  No "."
needed at the end.

Bjorn


Re: [PATCH] selftests/powerpc: Replace obsolete memalign() with posix_memalign()

2023-04-28 Thread Muhammad Usama Anjum
On 4/13/23 6:02 AM, Deming Wang wrote:
> memalign() is obsolete according to its manpage.
> 
> Replace memalign() with posix_memalign() and remove malloc.h include
> that was there for memalign().
Thanks for the patch.

> 
> As a pointer is passed into posix_memalign(), initialize *s to NULL
I'm unable to find this initialization below. Did you really mean to add
the initialization?

> to silence a warning about the function's return value being used as
> uninitialized (which is not valid anyway because the error is properly
> checked before s is returned).
> 
> Signed-off-by: Deming Wang 
> ---
>  tools/testing/selftests/powerpc/stringloops/strlen.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/testing/selftests/powerpc/stringloops/strlen.c 
> b/tools/testing/selftests/powerpc/stringloops/strlen.c
> index 9055ebc484d0..f9c1f9cc2d32 100644
> --- a/tools/testing/selftests/powerpc/stringloops/strlen.c
> +++ b/tools/testing/selftests/powerpc/stringloops/strlen.c
> @@ -1,5 +1,4 @@
>  // SPDX-License-Identifier: GPL-2.0
> -#include 
>  #include 
>  #include 
>  #include 
> @@ -51,10 +50,11 @@ static void bench_test(char *s)
>  static int testcase(void)
>  {
>   char *s;
> + int ret;
>   unsigned long i;
>  
> - s = memalign(128, SIZE);
> - if (!s) {
> + ret = posix_memalign((void **), 128, SIZE);
> + if (ret < 0) {
Can we do if (!ret) instead? The page says:
posix_memalign()  returns zero on success.
>   perror("memalign");
>   exit(1);
>   }

-- 
BR,
Muhammad Usama Anjum


[PATCH 6/7] powerpc: asm/io.h: Expect immutable pointer in virt_to_phys prototype

2023-04-28 Thread Stanislav Kinsburskii
From: Stanislav Kinsburskii 

These helper function - virt_to_phys - doesn't need the address pointer to
be mutable.

In the same time expecting it to be mutable leads to the following build
warning for constant pointers:

  warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from 
pointer target type

Signed-off-by: Stanislav Kinsburskii 
CC: Michael Ellerman 
CC: Nicholas Piggin 
CC: Christophe Leroy 
CC: Geert Uytterhoeven 
CC: Bjorn Helgaas 
CC: Stanislav Kinsburskii 
CC: Arnd Bergmann 
CC: linuxppc-dev@lists.ozlabs.org
CC: linux-ker...@vger.kernel.org
---
 arch/powerpc/include/asm/io.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index f1e657c9bbe8..c287eeb9536f 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -959,7 +959,7 @@ extern void __iomem *__ioremap_caller(phys_addr_t, unsigned 
long size,
  * almost all conceivable cases a device driver should not be using
  * this function
  */
-static inline unsigned long virt_to_phys(volatile void * address)
+static inline unsigned long virt_to_phys(const volatile void * address)
 {
WARN_ON(IS_ENABLED(CONFIG_DEBUG_VIRTUAL) && !virt_addr_valid(address));
 




[PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes

2023-04-28 Thread Stanislav Kinsburskii
This series is aimed to address compilation warnings when a constant pointer
is passed to virt_to_phys and isa_virt_to_bus functions:

  warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from 
pointer target type
  warning: passing argument 1 of ‘isa_virt_to_bus’ discards ‘const’ qualifier 
from pointer target type

The change(s) is the same for all architectures, but it's split into a series on
per-arch basis to simplify applying and testing on the maintainers side.

The following series implements...

---

Stanislav Kinsburskii (7):
  x86: asm/io.h: Expect immutable pointer in virt_to_phys/isa_virt_to_bus 
prototypes
  alpha: asm/io.h: Expect immutable pointer in virt_to_phys/isa_virt_to_bus 
prototypes
  mips: asm/io.h: Expect immutable pointer in isa_virt_to_bus prototype
  hexagon: asm/io.h: Expect immutable pointer in virt_to_phys prototype
  ia64: asm/io.h: Expect immutable pointer in virt_to_phys prototype
  powerpc: asm/io.h: Expect immutable pointer in virt_to_phys prototype
  asm-generic/io.h: Expect immutable pointer in virt_to_phys


 arch/alpha/include/asm/io.h   |6 +++---
 arch/hexagon/include/asm/io.h |2 +-
 arch/ia64/include/asm/io.h|2 +-
 arch/mips/include/asm/io.h|2 +-
 arch/powerpc/include/asm/io.h |2 +-
 arch/x86/include/asm/io.h |4 ++--
 include/asm-generic/io.h  |2 +-
 7 files changed, 10 insertions(+), 10 deletions(-)




Re: BUG : PowerPC RCU: torture test failed with __stack_chk_fail

2023-04-28 Thread Christophe Leroy


Le 26/04/2023 à 14:29, Michael Ellerman a écrit :
> Joel Fernandes  writes:
>> On Tue, Apr 25, 2023 at 6:58 AM Zhouyi Zhou  wrote:
> ...
>>
>> Out of curiosity for PPC folks, why cannot 64-bit PPC use per-task
>> canary? Michael, is this an optimization? Adding Christophe as well
>> since it came in a few years ago via the following commit:
> 
> I think Christophe also answered these in his reply.
> 
> We do use a per-task canary, but because we don't have "current" in a
> register, we can't use the value in current for GCC.
> 
> In one of my replies I said a possible solution would be to keep current
> in a register on 64-bit, but we'd need to do that in addition to the
> paca, so that would consume another GPR which we'd need to think hard
> about.

An analysis was done here https://github.com/linuxppc/issues/issues/45 
showing that r14 is very little used.

> 
> There's another reason to have it in the paca, which is that the paca is
> always accessible, even when the MMU is off, whereas current isn't (in
> some situations).

Even now that powerpc is converted to CONFIG_THREAD_INFO_IN_TASK ?

Christophe


[GIT PULL] Please pull powerpc/linux.git powerpc-6.4-1 tag

2023-04-28 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi Linus,

Please pull powerpc updates for 6.4.

A pretty small batch, but a couple of conflicts. 

The first is in drivers/gpu/drm/amd/display/Kconfig. The correct resolution is:

  select DRM_AMD_DC_FP if (X86 || (PPC64 && ALTIVEC) || (ARM64 && 
KERNEL_MODE_NEON && !CC_IS_CLANG))

The second is in our defconfigs, where e485f3a6eae0 ("ixgb: Remove ixgb
driver") removed CONFIG_IXGB which conflicts with our updates, in particular in
powernv_defconfig where we added CONFIG_IGB=y.

cheers

Notable out of area changes:
  drivers/cpuidle/cpuidle-pseries.c   # 88990745c934 cpuidle: pseries: Mark 
->enter() functions as __cpuidle
  drivers/gpu/drm/amd/display/Kconfig # 78f0929884d4 powerpc/64: Always 
build with 128-bit long double
  drivers/vfio/vfio_iommu_spapr_tce.c # a940904443e4 powerpc/iommu: Add 
iommu_ops to report capabilities and allow blocking domains

The following changes since commit eeac8ede17557680855031c6f305ece2378af326:

  Linux 6.3-rc2 (2023-03-12 16:36:44 -0700)

are available in the git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git 
tags/powerpc-6.4-1

for you to fetch changes up to 169f8997968ab620d750d9a45e15c5288d498356:

  powerpc/64s: Disable pcrel code model on Clang (2023-04-26 16:21:33 +1000)

- - --
powerpc updates for 6.4

 - Add support for building the kernel using PC-relative addressing on Power10.

 - Allow HV KVM guests on Power10 to use prefixed instructions.

 - Unify support for the P2020 CPU (85xx) into a single machine description.

 - Always build the 64-bit kernel with 128-bit long double.

 - Drop support for several obsolete 2000's era development boards as
   identified by Paul Gortmaker.

 - A series fixing VFIO on Power since some generic changes.

 - Various other small features and fixes.

Thanks to: Alexey Kardashevskiy, Andrew Donnellan, Benjamin Gray, Bo Liu,
Christophe Leroy, Dan Carpenter, David Binderman, Ira Weiny, Joel Stanley,
Kajol Jain, Kautuk Consul, Liang He, Luis Chamberlain, Masahiro Yamada, Michael
Neuling, Nathan Chancellor, Nathan Lynch, Nicholas Miehlbradt, Nicholas Piggin,
Nick Desaulniers, Nysal Jan K.A, Pali Rohár, Paul Gortmaker, Paul Mackerras,
Petr Vaněk, Randy Dunlap, Rob Herring, Sachin Sant, Sean Christopherson, Segher
Boessenkool, Timothy Pearson.

- - --
Alexey Kardashevskiy (3):
  powerpc/iommu: Add "borrowing" iommu_table_group_ops
  powerpc/pci_64: Init pcibios subsys a bit later
  powerpc/iommu: Add iommu_ops to report capabilities and allow blocking 
domains

Andrew Donnellan (1):
  powerpc/pseries: Add FW_FEATURE_PLPKS feature flag

Benjamin Gray (10):
  selftests/powerpc: Use CLEAN macro to fix make warning
  selftests/powerpc: Pass make context to children
  selftests/powerpc: Make dd output quiet
  selftests/powerpc/dscr: Correct typos
  selftests/powerpc: Move bind_to_cpu() to utils.h
  selftests/powerpc: Allow bind_to_cpu() to automatically pick CPU
  selftests/powerpc/dscr: Add lockstep test cases to DSCR explicit tests
  selftests/powerpc/dscr: Improve DSCR explicit random test case
  selftests/powerpc/dscr: Speed up DSCR sysfs tests
  selftests/powerpc/dscr: Restore timeout to DSCR selftests

Bo Liu (1):
  powerpc: Fix a kernel-doc warning

Christophe Leroy (15):
  powerpc/machdep: Make machine name const
  powerpc/machdep: Define 'compatible' property in ppc_md and use it
  powerpc/platforms: Use 'compatible' property for simple cases
  powerpc/47x: Split ppc47x machine in two
  powerpc/gamecube|wii : Use machine_device_initcall()
  powerpc/85xx: Fix function naming for p1023_rdb platform
  powerpc: Make generic_calibrate_decr() the default
  powerpc/perf: Properly detect mpc7450 family
  powerpc/fsl_uli1575: Misc cleanup
  powerpc/85xx: Remove DBG() macro
  powerpc/85xx: mpc85xx_{ds/rdb} compact the call to mpic_alloc()
  powerpc/85xx: mpc85xx_{ds/rdb} replace BUG_ON() by WARN_ON()
  powerpc/85xx: mpc85xx_{ds/rdb} replace prink by pr_xxx macro
  powerpc/85xx: Remove #ifdefs CONFIG_PPC_I8259 in mpc85xx_ds
  powerpc/85xx: Remove #ifdef CONFIG_QUICC_ENGINE in mpc85xx_rdb

Ira Weiny (1):
  powerpc: Remove memcpy_page_flushcache()

Joel Stanley (1):
  powerpc: Remove duplicate SPRN_HSRR definitions

Kajol Jain (1):
  selftests/powerpc/pmu: Fix sample field check in the 
mmcra_thresh_marked_sample_test

Kautuk Consul (1):
  KVM: PPC: Book3S HV: kvmppc_hv_entry: remove .global scope

Liang He (1):
  macintosh/windfarm_smu_sat: Add missing of_node_put()

Luis Chamberlain (2):
  powerpc: Simplify sysctl registration for powersave_nap_ctl_table
  powerpc: Simplify sysctl registration for nmi_wd_lpm_factor_ctl_table

Michael Ellerman (46):
  KVM: PPC: 

Re: [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes

2023-04-28 Thread Arnd Bergmann
On Sat, Apr 15, 2023, at 12:17, Stanislav Kinsburskii wrote:
> This series is aimed to address compilation warnings when a constant pointer
> is passed to virt_to_phys and isa_virt_to_bus functions:
>
>   warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ 
> qualifier from pointer target type
>   warning: passing argument 1 of ‘isa_virt_to_bus’ discards ‘const’ 
> qualifier from pointer target type
>
> The change(s) is the same for all architectures, but it's split into a series 
> on
> per-arch basis to simplify applying and testing on the maintainers side.
>

Looks all good to me. If everyone is happy with it, I'll queue it up
after in the asm-generic tree for 6.5, once rc1 is out.

 Arnd