[PATCH v3] drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode.

2022-07-02 Thread Darren Stevens
In patch a1a2b7125e10 (Drop static setup of IRQ resource from DT
core) we stopped platform_get_resource() from returning the IRQ, as all
drivers were supposed to have switched to platform_get_irq()
Unfortunately the Freescale EHCI driver in host mode got missed. Fix
it.

Fixes: a1a2b7125e10 (Drop static setup of IRQ resource from DT core)
Reported-by: Christian Zigotzky 
Suggested-by: Rob Herring 
Signed-off-by: Darren Stevens 
---
 v3 - Corrected resource allocation in fsl-mph-dr-of.c

 v2 - Fixed coding style, removed a couple of unneeded initializations,
  cc'd Layerscape maintainers.

Tested on AmigaOne X5000/20 and X5000/40 Contains code by Rob Herring 
(in fsl-mph-dr-of.c)

diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 385be30..896c0d1 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -76,14 +76,9 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev)
return -ENODEV;
}
 
-   res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-   if (!res) {
-   dev_err(>dev,
-   "Found HC with no IRQ. Check %s setup!\n",
-   dev_name(>dev));
-   return -ENODEV;
-   }
-   irq = res->start;
+   irq = platform_get_irq(pdev, 0);
+   if (irq < 0)
+   return irq;
 
hcd = __usb_create_hcd(_ehci_hc_driver, pdev->dev.parent,
   >dev, dev_name(>dev), NULL);
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index 44a7e58..e5df175 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -112,6 +112,9 @@ static struct platform_device *fsl_usb2_device_register(
goto error;
}
 
+   pdev->dev.of_node = ofdev->dev.of_node;
+   pdev->dev.of_node_reused = true;
+
retval = platform_device_add(pdev);
if (retval)
goto error;


Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.19-4 tag

2022-07-02 Thread pr-tracker-bot
The pull request you sent on Sat, 02 Jul 2022 20:42:04 +1000:

> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git 
> tags/powerpc-5.19-4

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/5411de073362300d99bb35d46d77d656760e4606

Thank you!

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


Re: [PATCH v4 0/2] powerpc rng cleanups

2022-07-02 Thread Jason A. Donenfeld
On Sat, Jul 02, 2022 at 04:00:03PM +0530, Sachin Sant wrote:
> > On 01-Jul-2022, at 2:19 PM, Jason A. Donenfeld  wrote:
> > 
> > These are two small cleanups for -next.
> > 
> > This is meant to be atop
> > https://lore.kernel.org/all/20220630121654.1939181-1-ja...@zx2c4.com/
> > which is expected to land first.
> > 
> > v4 fixes up an inversion of thr DR flag.
> > 
> > Jason A. Donenfeld (2):
> >  powerpc/powernv: rename remaining rng powernv_ functions to pnv_
> >  powerpc/kvm: don't crash on missing rng, and use darn
> > 
> 
> Boot tested this series and can successfully boot a Power8 server.
> 
> fwiw Tested-by: Sachin Sant 

Oh good. 4th time's a charm then. I had assumed this would be for 5.20,
but maybe it'll hit 5.19-rcx instead.

Jason


Re: [PATCH] powerpc/powernv: delay rng of node creation until later in boot

2022-07-02 Thread Jason A. Donenfeld
Hi Benjamin, Paul,

On Thu, Jun 30, 2022 at 07:24:05PM +0530, Sachin Sant wrote:
> > On 30-Jun-2022, at 5:46 PM, Jason A. Donenfeld  wrote:
> > 
> > The of node for the rng must be created much later in boot. Otherwise it
> > tries to connect to a parent that doesn't yet exist, resulting on this
> > splat:
> > 
> > [0.000478] kobject: '(null)' ((ptrval)): is not initialized, 
> > yet kobject_get() is being called.
> > [0.002925] [c2a0fb30] [c073b0bc] kobject_get+0x8c/0x100 
> > (unreliable)
> > [0.003071] [c2a0fba0] [c087e464] device_add+0xf4/0xb00
> > [0.003194] [c2a0fc80] [c0a7f6e4] of_device_add+0x64/0x80
> > [0.003321] [c2a0fcb0] [c0a800d0] 
> > of_platform_device_create_pdata+0xd0/0x1b0
> > [0.003476] [c2a0fd00] [c201fa44] 
> > pnv_get_random_long_early+0x240/0x2e4
> > [0.003623] [c2a0fe20] [c2060c38] random_init+0xc0/0x214
> > 
> > This patch fixes the issue by doing the of node creation inside of
> > machine_subsys_initcall.
> > 
> > Fixes: f3eac426657d ("powerpc/powernv: wire up rng during setup_arch")
> > Cc: sta...@vger.kernel.org
> > Cc: Michael Ellerman 
> > Reported-by: Sachin Sant 
> > Signed-off-by: Jason A. Donenfeld 
> > ---
> 
> Thanks Jason for the patch. This fixes the reported problem for me.
> 
> Tested-by: Sachin Sant 
> 
> - Sachin

It sounds like Michael is on vacation for a few weeks. Think you could
queue this up so we can get POWER8 booting again?

Sorry I broke things before :-(

Jason


[GIT PULL] Please pull powerpc/linux.git powerpc-5.19-4 tag

2022-07-02 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi Linus,

Please pull some more powerpc fixes for 5.19:

The following changes since commit f3eac426657d985b97c92fa5f7ae1d43f04721f3:

  powerpc/powernv: wire up rng during setup_arch (2022-06-22 19:47:22 +1000)

are available in the git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git 
tags/powerpc-5.19-4

for you to fetch changes up to ac790d09885d36143076e7e02825c541e8eee899:

  powerpc/memhotplug: Add add_pages override for PPC (2022-06-29 20:43:16 +1000)

- --
powerpc fixes for 5.19 #4

 - Fix BPF uapi confusion about the correct type of bpf_user_pt_regs_t.

 - Fix virt_addr_valid() when memory is hotplugged above the boot-time 
high_memory value.

 - Fix a bug in 64-bit Book3E map_kernel_page() which would incorrectly 
allocate a PMD
   page at PUD level.

 - Fix a couple of minor issues found since we enabled KASAN for 64-bit Book3S.

Thanks to: Aneesh Kumar K.V, Cédric Le Goater, Christophe Leroy, Kefeng Wang, 
Liam
Howlett, Nathan Lynch, Naveen N. Rao.

- --
Aneesh Kumar K.V (1):
  powerpc/memhotplug: Add add_pages override for PPC

Christophe Leroy (1):
  powerpc/book3e: Fix PUD allocation size in map_kernel_page()

Liam Howlett (1):
  powerpc/prom_init: Fix kernel config grep

Nathan Lynch (1):
  powerpc/xive/spapr: correct bitmap allocation size

Naveen N. Rao (1):
  powerpc/bpf: Fix use of user_pt_regs in uapi


 arch/powerpc/Kconfig   |  4 +++
 arch/powerpc/include/asm/bpf_perf_event.h  |  9 ++
 arch/powerpc/include/uapi/asm/bpf_perf_event.h |  9 --
 arch/powerpc/kernel/prom_init_check.sh |  2 +-
 arch/powerpc/mm/mem.c  | 33 +++-
 arch/powerpc/mm/nohash/book3e_pgtable.c|  6 ++--
 arch/powerpc/sysdev/xive/spapr.c   |  5 +--
 7 files changed, 52 insertions(+), 16 deletions(-)
 create mode 100644 arch/powerpc/include/asm/bpf_perf_event.h
 delete mode 100644 arch/powerpc/include/uapi/asm/bpf_perf_event.h
-BEGIN PGP SIGNATURE-

iQIzBAEBCAAdFiEEJFGtCPCthwEv2Y/bUevqPMjhpYAFAmLAIMMACgkQUevqPMjh
pYBFzxAAt/LfbgVSWPGNv+JvqomiuokgbTd2zKP8PBsRiQg5Jh5i8ANNtIu3UGMt
Nl1/ht6FOZ6Eb76KnmfQni7I5JrIdfVa5zEMDe8GtA5fXPxnEg+lME56SSR6w6ed
2b31BuIB+1wzP6ZDjEV7fHmG4liQSVbTgWKsTjpWdPSuIqpYj5jPlgoimh4l7a2r
YY4Bz7PRFevrbiG5ME10+ZckjG7b13SnROg4JOjZO3leJCqGLHhT9SjHUZvYmot5
MjeObrZ7p4xO3MtBMWi2rDGXhLrHJAqYI+jrC1Z4P2jFAVVKm4l2cFjPQ5MHCqYy
9Di93hT1QrhCKxGr+FzDQSVCSENxPxktheqWz5IyBexwxvkH0tUkSwugmOhyHwq6
69uFxi9CLAtnv+8YXvqsLSwg8+n5DeYQ7mEVXsCyPIXKbZe+ZJE2r6XoYb0a3ags
nTwkiSnaBLvHBQtjBLh4Bd3dI5STL9LZsz1cUXFBlriCs3rP5enPF/vWOcc8tEix
F2iZPiXldpiep1g3zHDRuAAcACGWHrqxfVOPJfC/pLrqpzbmtFPJejmeE3WVC3uy
dkjjkXGBfrTAlFjVfdJgJVv+vyr9ShIrFrpsMjlFcsoktoDXUd2zkcJj+zdwIqrG
sRLRcHtNGQs6X0CltPs22qjtj66tLZja+Kj1eRDrFk896sJNsaA=
=YeKn
-END PGP SIGNATURE-


Re: [PATCH v4 0/2] powerpc rng cleanups

2022-07-02 Thread Sachin Sant



> On 01-Jul-2022, at 2:19 PM, Jason A. Donenfeld  wrote:
> 
> These are two small cleanups for -next.
> 
> This is meant to be atop
> https://lore.kernel.org/all/20220630121654.1939181-1-ja...@zx2c4.com/
> which is expected to land first.
> 
> v4 fixes up an inversion of thr DR flag.
> 
> Jason A. Donenfeld (2):
>  powerpc/powernv: rename remaining rng powernv_ functions to pnv_
>  powerpc/kvm: don't crash on missing rng, and use darn
> 

Boot tested this series and can successfully boot a Power8 server.

fwiw Tested-by: Sachin Sant 

- Sachin


Re: [PATCH] powerpc: e500: Fix compilation with gcc e500 compiler

2022-07-02 Thread Pali Rohár
On Tuesday 24 May 2022 11:39:39 Pali Rohár wrote:
> gcc e500 compiler does not support -mcpu=powerpc option. When it is
> specified then gcc throws compile error:
> 
>   gcc: error: unrecognized argument in option ‘-mcpu=powerpc’
>   gcc: note: valid arguments to ‘-mcpu=’ are: 8540 8548 native
> 
> So do not set -mcpu=powerpc option when CONFIG_E500 is set. Correct option
> -mcpu=8540 for CONFIG_E500 is set few lines below in that Makefile.
> 
> Signed-off-by: Pali Rohár 
> Cc: sta...@vger.kernel.org

Michael, do you have any objections about this patch?

> ---
>  arch/powerpc/Makefile | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> index eb541e730d3c..87f9f29ac9d2 100644
> --- a/arch/powerpc/Makefile
> +++ b/arch/powerpc/Makefile
> @@ -22,11 +22,16 @@ ifdef CONFIG_PPC32
>  # or platform code sets later on the command line, but they are needed
>  # to set a sane 32-bit cpu target for the 64-bit cross compiler which
>  # may default to the wrong ISA.
> +# Never set -mcpu=powerpc option for gcc e500 compiler because this
> +# option is unsupported and throws error. The correct option for
> +# CONFIG_E500 is -mcpu=8540 and it is set few lines below.
> +ifndef CONFIG_E500
>  KBUILD_CFLAGS+= -mcpu=powerpc
>  KBUILD_AFLAGS+= -mcpu=powerpc
>  endif
>  endif
>  endif
> +endif
>  
>  ifdef CONFIG_PPC_BOOK3S_32
>  KBUILD_CFLAGS+= -mcpu=powerpc
> -- 
> 2.20.1
> 


Re: [PATCH] powerpc: e500: Fix compilation with gcc e500 compiler

2022-07-02 Thread Pali Rohár
On Tuesday 24 May 2022 14:52:16 Segher Boessenkool wrote:
> On Tue, May 24, 2022 at 09:16:10PM +0200, Pali Rohár wrote:
> > On Tuesday 24 May 2022 13:52:47 Segher Boessenkool wrote:
> > > Aha.  Right, because this config forces -mspe it requires one of these
> > > CPUs.
> > > 
> > > You can use a powerpc-linux compiler instead, and everything will just
> > > work.  These CPUs are still supported, in all of GCC 9 .. GCC 12 :-)
> > 
> > Ok. I can use different "generic" powerpc compiler (It should work fine
> > as you said, as it has also -mcpu=8540 option). But I think that
> > compilation of kernel should be supported also by that gcc 8.5.0 e500
> > compiler.
> 
> That linuxspe compiler you mean.  Sure, why not, the more the merrier,
> as long as it doesn't get in the way of other stuff, I won't protest.
> 
> But please don't confuse people: you are talking about a
> powerpc-linuxspe compiler, not e500, which is supported just fine by
> current GCC trunk still, and does not have such limitations :-)
> 
> 
> Segher

I think the confusion is the calling "generic" or "stripped" compiler
without SPE support as e500 compiler.

The "true" e500 compiler has support for both both integer and floating
point ISA and not just subset or just one type.