From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0F2044C505 for ; Fri, 31 Jul 2026 16:33:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785515599; cv=none; b=CfTv328alzeS07JO4Uq+mUdpIhcjhTJAUwoSTkhemWW2SViDyAGvFcBTemdca+5Vbn7O0znjT8dS5oq9TZU81gzqXUuzGYycDwgjvznxdfuVfi46goGSDqcB7JLZBy3KVfWAq9oQFbVuzYs9V9KJ3bMJFJ2+nlVjk20/gjt62l0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785515599; c=relaxed/simple; bh=1C+ocOW5FpqGfsaiQLOekMhGCYygPjlwWCpjbuJlF50=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jjhY4cF0QP6MT6DVo3TaHdxxgx8Earh/PfbWQXDlygdto1P/xYbnuSiRqG3qYyUujyDNawufOSSjNho0T/Y60cXxlTfR6INfI5T/uUeAp/gVdl57AUPRsM8Yy2jW50AWR+KVmZq8hwkhBEAoYo4fofYjLwmNiHVbTA0RUu6lID0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Kg0a8RDD; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Kg0a8RDD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD9501F00ADE; Fri, 31 Jul 2026 16:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785515597; bh=/c2xE4Q1GHJ/mqVHkaThC+7dYDFsHbOzMkNSJtNffwA=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=Kg0a8RDD7QfMtew/PR4BdIHIDRZGAzCtHMIATEiiGxTA5E2k/gTNJN1MY+evfPqbp YdQKX0ioNHBk5WY6n2vSo9ajrzKXbgjd1vkBnAJAaNVH6sSRr7nCpxNtorDamvn3ut eIFa6Vp6hR3eBUMSvyqsKEDarD/3rUUkuewYKBAlcodItXgYdbeLIF3vKtw5fLkiAQ lKtfauTNg1lKtN4Ir8toqOh3T8Qcs9cnIdCHwXCNBFTa1ZRDPsSWFI5NaOIQa7Srth pQQigad18myCthmgRlII3SytOSo+OGux0VgAtKhG4r1Z4rVJfsL/IX4i/o9KOel9wh pn+FsaN+OPrWQ== Message-ID: <53f0b244-9461-4402-a5e7-b54d7ec3e09d@kernel.org> Date: Fri, 31 Jul 2026 18:33:11 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Connecting the SB600's i8259 controller rather in pasemi's pci.c than in pasemi's setup.c. To: Christian Zigotzky , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Krzysztof Kozlowski , "open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)" , open list Cc: "R.T.Dickinson" , mad skateman , Damien Stewart , Darren Stevens , Christian Zigotzky References: <20260701125941.906-2-chzigotzky@xenosoft.de> <656742f7-ff8f-43f5-829d-5b5f0f6c8c95@kernel.org> Content-Language: fr-FR From: "Christophe Leroy (CS GROUP)" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 28/07/2026 à 14:50, Christian Zigotzky a écrit : > On 27/07/26 15:43, Christophe Leroy (CS GROUP) wrote: > > > > Should be better in arch/powerpc/platforms/pasemi/pasemi.h > > > > Hello Christophe, > > Thank you for your answer. I modified the patch today. The Nemo board > boots without any problems if I compile the RC5 of kernel 7.2 with this > patch. > > Could you please check the following modified patch? b4 doesn't see it as a patch. Can you resend as a regular patch ? $ b4 shazam --single-message f5ed5a79-4235-31b6-5bd9-c68d1a6b50cf@xenosoft.de Single-message mode, ignoring any follow-ups Grabbing thread from lore.kernel.org/all/f5ed5a79-4235-31b6-5bd9-c68d1a6b50cf@xenosoft.de/t.mbox.gz Analyzing 1 messages in the thread No patches found. Thanks Christophe > > Thanks, > Christian > > --- > > powerpc/pasemi: Move Nemo i8259 initialization to pci.c > > The Nemo board requires the PCIe ports to be initialized before the > SB600 ISA bridge can be accessed. > > Since pas_pci_init() is now called later during boot, the i8259 > initialization in pas_init_IRQ() happens too early and accesses > registers that are not yet mapped, preventing the board from booting. > > Move the Nemo-specific i8259 initialization to pas_add_bridge(), > after the ISA bridge has been discovered. > > Suggested-by: Darren Stevens > Tested-by: Christian Zigotzky > Signed-off-by: Christian Zigotzky > > --- > v2: > - Move Nemo i8259 initialization out of pas_init_IRQ() and into >   pas_add_bridge() after the ISA bridge has been discovered. > - Change nemo_init_IRQ() to no longer depend on the MPIC instance passed >   from the IRQ setup path. > - Move the nemo_init_IRQ() declaration to pasemi.h and add a no-op stub >   for non-Nemo builds. > - Fix missing prototype warning reported by Christophe Leroy. > - Fix indentation and clean up the commit message. > > diff -rupN a/arch/powerpc/platforms/pasemi/pasemi.h b/arch/powerpc/ > platforms/pasemi/pasemi.h > --- a/arch/powerpc/platforms/pasemi/pasemi.h    2026-07-26 > 23:45:48.000000000 +0200 > +++ b/arch/powerpc/platforms/pasemi/pasemi.h    2026-07-28 > 07:44:31.924168227 +0200 > @@ -7,6 +7,12 @@ extern void pas_pci_init(void); >  struct pci_dev; >  extern void pas_pci_dma_dev_setup(struct pci_dev *dev); > > +#ifdef CONFIG_PPC_PASEMI_NEMO > +extern void __init nemo_init_IRQ(void); > +#else > +static inline void __init nemo_init_IRQ(void) { } > +#endif > + >  void __iomem *__init pasemi_pci_getcfgaddr(struct pci_dev *dev, int > offset); > >  extern void __init pasemi_map_registers(void); > diff -rupN a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/ > platforms/pasemi/pci.c > --- a/arch/powerpc/platforms/pasemi/pci.c    2026-07-26 > 23:45:48.000000000 +0200 > +++ b/arch/powerpc/platforms/pasemi/pci.c    2026-07-28 > 07:34:37.036634023 +0200 > @@ -265,6 +265,11 @@ static int __init pas_add_bridge(struct >       */ >      isa_bridge_find_early(hose); > > +    /* > +     * ISA bridge is now active, add the i8259 cascade (if needed) > +     */ > +    nemo_init_IRQ(); > + >      return 0; >  } > > diff -rupN a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/ > platforms/pasemi/setup.c > --- a/arch/powerpc/platforms/pasemi/setup.c    2026-07-26 > 23:45:48.000000000 +0200 > +++ b/arch/powerpc/platforms/pasemi/setup.c    2026-07-28 > 07:54:54.147863161 +0200 > @@ -214,10 +214,12 @@ static void sb600_8259_cascade(struct ir >      chip->irq_eoi(&desc->irq_data); >  } > > -static void __init nemo_init_IRQ(struct mpic *mpic) > +void __init nemo_init_IRQ(void) >  { >      struct device_node *np; >      int gpio_virq; > +    struct mpic *mpic; > + >      /* Connect the SB600's legacy i8259 controller */ >      np = of_find_node_by_path("/pxp@0,e0000000"); >      i8259_init(np, 0); > @@ -228,14 +230,10 @@ static void __init nemo_init_IRQ(struct >      irq_set_chained_handler(gpio_virq, sb600_8259_cascade); >      mpic_unmask_irq(irq_get_irq_data(gpio_virq)); > > +    mpic = irq_get_chip_data(gpio_virq); >      irq_set_default_domain(mpic->irqhost); >  } > > -#else > - > -static inline void nemo_init_IRQ(struct mpic *mpic) > -{ > -} >  #endif > >  static __init void pas_init_IRQ(void) > @@ -297,9 +295,7 @@ static __init void pas_init_IRQ(void) >          irq_set_irq_type(nmi_virq, IRQ_TYPE_EDGE_RISING); >          mpic_unmask_irq(irq_get_irq_data(nmi_virq)); >      } > - > -    nemo_init_IRQ(mpic); > - > + >      of_node_put(mpic_node); >      of_node_put(root); >  } > > >