linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Re: linux-next: Tree for Nov 28 (drivers/pci/controller/dwc/pcie-nxp-s32g.o)
       [not found] <20251128162928.36eec2d6@canb.auug.org.au>
@ 2025-11-30  3:00 ` Randy Dunlap
  2025-12-01 17:23   ` Bjorn Helgaas
  2025-12-02  4:24   ` Manivannan Sadhasivam
  0 siblings, 2 replies; 9+ messages in thread
From: Randy Dunlap @ 2025-11-30  3:00 UTC (permalink / raw)
  To: Stephen Rothwell, Linux Next Mailing List, linux-pci
  Cc: Linux Kernel Mailing List, Ghennadi Procopciuc,
	NXP S32 Linux Team, imx@lists.linux.dev, linux-arm-kernel



On 11/27/25 9:29 PM, Stephen Rothwell wrote:
> Hi all,
> 
> Changes since 20251127:
> 

on i386 (allmodconfig):

WARNING: modpost: vmlinux: section mismatch in reference: s32g_init_pcie_controller+0x2b (section: .text) -> memblock_start_of_DRAM (section: .init.text)


-- 
~Randy



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: Tree for Nov 28 (drivers/pci/controller/dwc/pcie-nxp-s32g.o)
  2025-11-30  3:00 ` linux-next: Tree for Nov 28 (drivers/pci/controller/dwc/pcie-nxp-s32g.o) Randy Dunlap
@ 2025-12-01 17:23   ` Bjorn Helgaas
  2025-12-02  4:24   ` Manivannan Sadhasivam
  1 sibling, 0 replies; 9+ messages in thread
From: Bjorn Helgaas @ 2025-12-01 17:23 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Stephen Rothwell, Linux Next Mailing List, linux-pci,
	Linux Kernel Mailing List, Ghennadi Procopciuc,
	NXP S32 Linux Team, imx@lists.linux.dev, linux-arm-kernel

On Sat, Nov 29, 2025 at 07:00:04PM -0800, Randy Dunlap wrote:
> On 11/27/25 9:29 PM, Stephen Rothwell wrote:
> > Hi all,
> > 
> > Changes since 20251127:
> > 
> 
> on i386 (allmodconfig):
> 
> WARNING: modpost: vmlinux: section mismatch in reference: s32g_init_pcie_controller+0x2b (section: .text) -> memblock_start_of_DRAM (section: .init.text)

Thanks, I'll drop the pci/controller/s32g branch until this is
resolved.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: Tree for Nov 28 (drivers/pci/controller/dwc/pcie-nxp-s32g.o)
  2025-11-30  3:00 ` linux-next: Tree for Nov 28 (drivers/pci/controller/dwc/pcie-nxp-s32g.o) Randy Dunlap
  2025-12-01 17:23   ` Bjorn Helgaas
@ 2025-12-02  4:24   ` Manivannan Sadhasivam
  2025-12-02  8:54     ` Vincent Guittot
  1 sibling, 1 reply; 9+ messages in thread
From: Manivannan Sadhasivam @ 2025-12-02  4:24 UTC (permalink / raw)
  To: Randy Dunlap, Vincent Guittot
  Cc: Stephen Rothwell, Linux Next Mailing List, linux-pci,
	Linux Kernel Mailing List, Ghennadi Procopciuc,
	NXP S32 Linux Team, imx@lists.linux.dev, linux-arm-kernel

+ Vincent

On Sat, Nov 29, 2025 at 07:00:04PM -0800, Randy Dunlap wrote:
> 
> 
> On 11/27/25 9:29 PM, Stephen Rothwell wrote:
> > Hi all,
> > 
> > Changes since 20251127:
> > 
> 
> on i386 (allmodconfig):
> 
> WARNING: modpost: vmlinux: section mismatch in reference: s32g_init_pcie_controller+0x2b (section: .text) -> memblock_start_of_DRAM (section: .init.text)
> 
> 
> -- 
> ~Randy
> 
> 

-- 
மணிவண்ணன் சதாசிவம்


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: Tree for Nov 28 (drivers/pci/controller/dwc/pcie-nxp-s32g.o)
  2025-12-02  4:24   ` Manivannan Sadhasivam
@ 2025-12-02  8:54     ` Vincent Guittot
  2025-12-02  9:53       ` Manivannan Sadhasivam
  0 siblings, 1 reply; 9+ messages in thread
From: Vincent Guittot @ 2025-12-02  8:54 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Randy Dunlap
  Cc: Stephen Rothwell, Linux Next Mailing List, linux-pci,
	Linux Kernel Mailing List, Ghennadi Procopciuc,
	NXP S32 Linux Team, imx@lists.linux.dev, linux-arm-kernel,
	Bjorn Helgaas

On Tue, 2 Dec 2025 at 05:24, Manivannan Sadhasivam <mani@kernel.org> wrote:
>
> + Vincent

Thanks for looping me in.
>
> On Sat, Nov 29, 2025 at 07:00:04PM -0800, Randy Dunlap wrote:
> >
> >
> > On 11/27/25 9:29 PM, Stephen Rothwell wrote:
> > > Hi all,
> > >
> > > Changes since 20251127:
> > >
> >
> > on i386 (allmodconfig):
> >
> > WARNING: modpost: vmlinux: section mismatch in reference: s32g_init_pcie_controller+0x2b (section: .text) -> memblock_start_of_DRAM (section: .init.text)

Are there details to reproduce the warning ? I don't have such warning
when compiling allmodconfig locally

s32 pcie can only be built in but I may have to use
builtin_platform_driver_probe() instead of builtin_platform_driver()

> >
> >
> > --
> > ~Randy
> >
> >
>
> --
> மணிவண்ணன் சதாசிவம்


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: Tree for Nov 28 (drivers/pci/controller/dwc/pcie-nxp-s32g.o)
  2025-12-02  8:54     ` Vincent Guittot
@ 2025-12-02  9:53       ` Manivannan Sadhasivam
  2025-12-02 10:03         ` Vincent Guittot
  0 siblings, 1 reply; 9+ messages in thread
From: Manivannan Sadhasivam @ 2025-12-02  9:53 UTC (permalink / raw)
  To: Vincent Guittot
  Cc: Randy Dunlap, Stephen Rothwell, Linux Next Mailing List,
	linux-pci, Linux Kernel Mailing List, Ghennadi Procopciuc,
	NXP S32 Linux Team, imx@lists.linux.dev, linux-arm-kernel,
	Bjorn Helgaas

On Tue, Dec 02, 2025 at 09:54:24AM +0100, Vincent Guittot wrote:
> On Tue, 2 Dec 2025 at 05:24, Manivannan Sadhasivam <mani@kernel.org> wrote:
> >
> > + Vincent
> 
> Thanks for looping me in.
> >
> > On Sat, Nov 29, 2025 at 07:00:04PM -0800, Randy Dunlap wrote:
> > >
> > >
> > > On 11/27/25 9:29 PM, Stephen Rothwell wrote:
> > > > Hi all,
> > > >
> > > > Changes since 20251127:
> > > >
> > >
> > > on i386 (allmodconfig):
> > >
> > > WARNING: modpost: vmlinux: section mismatch in reference: s32g_init_pcie_controller+0x2b (section: .text) -> memblock_start_of_DRAM (section: .init.text)
> 
> Are there details to reproduce the warning ? I don't have such warning
> when compiling allmodconfig locally
> 
> s32 pcie can only be built in but I may have to use
> builtin_platform_driver_probe() instead of builtin_platform_driver()
> 

The is due to calling a function belonging to the __init section from non-init
function. Ideally, functions prefixed with __init like memblock_start_of_DRAM()
should be called from the module init functions.

One way to fix would be to call memblock_start_of_DRAM() in probe(), and
annotate probe() with __init. Since there is no remove, you could use
builtin_platform_driver_probe().

This also makes me wonder if we really should be using memblock_start_of_DRAM()
in the driver. I know that this was suggested to you during reviews, but I would
prefer to avoid it, especially due to this being the __init function.

- Mani

-- 
மணிவண்ணன் சதாசிவம்


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: Tree for Nov 28 (drivers/pci/controller/dwc/pcie-nxp-s32g.o)
  2025-12-02  9:53       ` Manivannan Sadhasivam
@ 2025-12-02 10:03         ` Vincent Guittot
  2025-12-02 10:12           ` Manivannan Sadhasivam
  0 siblings, 1 reply; 9+ messages in thread
From: Vincent Guittot @ 2025-12-02 10:03 UTC (permalink / raw)
  To: Manivannan Sadhasivam
  Cc: Randy Dunlap, Stephen Rothwell, Linux Next Mailing List,
	linux-pci, Linux Kernel Mailing List, Ghennadi Procopciuc,
	NXP S32 Linux Team, imx@lists.linux.dev, linux-arm-kernel,
	Bjorn Helgaas

On Tue, 2 Dec 2025 at 10:53, Manivannan Sadhasivam <mani@kernel.org> wrote:
>
> On Tue, Dec 02, 2025 at 09:54:24AM +0100, Vincent Guittot wrote:
> > On Tue, 2 Dec 2025 at 05:24, Manivannan Sadhasivam <mani@kernel.org> wrote:
> > >
> > > + Vincent
> >
> > Thanks for looping me in.
> > >
> > > On Sat, Nov 29, 2025 at 07:00:04PM -0800, Randy Dunlap wrote:
> > > >
> > > >
> > > > On 11/27/25 9:29 PM, Stephen Rothwell wrote:
> > > > > Hi all,
> > > > >
> > > > > Changes since 20251127:
> > > > >
> > > >
> > > > on i386 (allmodconfig):
> > > >
> > > > WARNING: modpost: vmlinux: section mismatch in reference: s32g_init_pcie_controller+0x2b (section: .text) -> memblock_start_of_DRAM (section: .init.text)
> >
> > Are there details to reproduce the warning ? I don't have such warning
> > when compiling allmodconfig locally
> >
> > s32 pcie can only be built in but I may have to use
> > builtin_platform_driver_probe() instead of builtin_platform_driver()
> >
>
> The is due to calling a function belonging to the __init section from non-init
> function. Ideally, functions prefixed with __init like memblock_start_of_DRAM()
> should be called from the module init functions.
>
> One way to fix would be to call memblock_start_of_DRAM() in probe(), and
> annotate probe() with __init. Since there is no remove, you could use
> builtin_platform_driver_probe().
>
> This also makes me wonder if we really should be using memblock_start_of_DRAM()
> in the driver. I know that this was suggested to you during reviews, but I would
> prefer to avoid it, especially due to this being the __init function.

yeah, I suppose I can directly define the value in the driver has
there is only one memory config for now anyway

/* Boundary between peripheral space and physical memory space */
#define S32G_MEMORY_BOUNDARY_ADDR 0x80000000

>
> - Mani
>
> --
> மணிவண்ணன் சதாசிவம்


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: Tree for Nov 28 (drivers/pci/controller/dwc/pcie-nxp-s32g.o)
  2025-12-02 10:03         ` Vincent Guittot
@ 2025-12-02 10:12           ` Manivannan Sadhasivam
  2025-12-02 10:24             ` Vincent Guittot
  2025-12-02 22:37             ` Randy Dunlap
  0 siblings, 2 replies; 9+ messages in thread
From: Manivannan Sadhasivam @ 2025-12-02 10:12 UTC (permalink / raw)
  To: Vincent Guittot
  Cc: Randy Dunlap, Stephen Rothwell, Linux Next Mailing List,
	linux-pci, Linux Kernel Mailing List, Ghennadi Procopciuc,
	NXP S32 Linux Team, imx@lists.linux.dev, linux-arm-kernel,
	Bjorn Helgaas

On Tue, Dec 02, 2025 at 11:03:07AM +0100, Vincent Guittot wrote:
> On Tue, 2 Dec 2025 at 10:53, Manivannan Sadhasivam <mani@kernel.org> wrote:
> >
> > On Tue, Dec 02, 2025 at 09:54:24AM +0100, Vincent Guittot wrote:
> > > On Tue, 2 Dec 2025 at 05:24, Manivannan Sadhasivam <mani@kernel.org> wrote:
> > > >
> > > > + Vincent
> > >
> > > Thanks for looping me in.
> > > >
> > > > On Sat, Nov 29, 2025 at 07:00:04PM -0800, Randy Dunlap wrote:
> > > > >
> > > > >
> > > > > On 11/27/25 9:29 PM, Stephen Rothwell wrote:
> > > > > > Hi all,
> > > > > >
> > > > > > Changes since 20251127:
> > > > > >
> > > > >
> > > > > on i386 (allmodconfig):
> > > > >
> > > > > WARNING: modpost: vmlinux: section mismatch in reference: s32g_init_pcie_controller+0x2b (section: .text) -> memblock_start_of_DRAM (section: .init.text)
> > >
> > > Are there details to reproduce the warning ? I don't have such warning
> > > when compiling allmodconfig locally
> > >
> > > s32 pcie can only be built in but I may have to use
> > > builtin_platform_driver_probe() instead of builtin_platform_driver()
> > >
> >
> > The is due to calling a function belonging to the __init section from non-init
> > function. Ideally, functions prefixed with __init like memblock_start_of_DRAM()
> > should be called from the module init functions.
> >
> > One way to fix would be to call memblock_start_of_DRAM() in probe(), and
> > annotate probe() with __init. Since there is no remove, you could use
> > builtin_platform_driver_probe().
> >
> > This also makes me wonder if we really should be using memblock_start_of_DRAM()
> > in the driver. I know that this was suggested to you during reviews, but I would
> > prefer to avoid it, especially due to this being the __init function.
> 
> yeah, I suppose I can directly define the value in the driver has
> there is only one memory config for now anyway
> 
> /* Boundary between peripheral space and physical memory space */
> #define S32G_MEMORY_BOUNDARY_ADDR 0x80000000
> 

Ok. I fixed it up myself with below diff:

diff --git a/drivers/pci/controller/dwc/pcie-nxp-s32g.c b/drivers/pci/controller/dwc/pcie-nxp-s32g.c
index eacf0229762c..70b1dc404bbe 100644
--- a/drivers/pci/controller/dwc/pcie-nxp-s32g.c
+++ b/drivers/pci/controller/dwc/pcie-nxp-s32g.c
@@ -7,7 +7,6 @@
 
 #include <linux/interrupt.h>
 #include <linux/io.h>
-#include <linux/memblock.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/of_address.h>
@@ -35,6 +34,9 @@
 #define PCIE_S32G_PE0_INT_STS                  0xE8
 #define HP_INT_STS                             BIT(6)
 
+/* Boundary between peripheral space and physical memory space */
+#define S32G_MEMORY_BOUNDARY_ADDR              0x80000000
+
 struct s32g_pcie_port {
        struct list_head list;
        struct phy *phy;
@@ -99,10 +101,10 @@ static struct dw_pcie_ops s32g_pcie_ops = {
 };
 
 /* Configure the AMBA AXI Coherency Extensions (ACE) interface */
-static void s32g_pcie_reset_mstr_ace(struct dw_pcie *pci, u64 ddr_base_addr)
+static void s32g_pcie_reset_mstr_ace(struct dw_pcie *pci)
 {
-       u32 ddr_base_low = lower_32_bits(ddr_base_addr);
-       u32 ddr_base_high = upper_32_bits(ddr_base_addr);
+       u32 ddr_base_low = lower_32_bits(S32G_MEMORY_BOUNDARY_ADDR);
+       u32 ddr_base_high = upper_32_bits(S32G_MEMORY_BOUNDARY_ADDR);
 
        dw_pcie_dbi_ro_wr_en(pci);
        dw_pcie_writel_dbi(pci, COHERENCY_CONTROL_3_OFF, 0x0);
@@ -149,7 +151,7 @@ static int s32g_init_pcie_controller(struct dw_pcie_rp *pp)
         * Make sure we use the coherency defaults (just in case the settings
         * have been changed from their reset values)
         */
-       s32g_pcie_reset_mstr_ace(pci, memblock_start_of_DRAM());
+       s32g_pcie_reset_mstr_ace(pci);
 
        dw_pcie_dbi_ro_wr_en(pci);

- Mani

-- 
மணிவண்ணன் சதாசிவம்


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: linux-next: Tree for Nov 28 (drivers/pci/controller/dwc/pcie-nxp-s32g.o)
  2025-12-02 10:12           ` Manivannan Sadhasivam
@ 2025-12-02 10:24             ` Vincent Guittot
  2025-12-02 22:37             ` Randy Dunlap
  1 sibling, 0 replies; 9+ messages in thread
From: Vincent Guittot @ 2025-12-02 10:24 UTC (permalink / raw)
  To: Manivannan Sadhasivam
  Cc: Randy Dunlap, Stephen Rothwell, Linux Next Mailing List,
	linux-pci, Linux Kernel Mailing List, Ghennadi Procopciuc,
	NXP S32 Linux Team, imx@lists.linux.dev, linux-arm-kernel,
	Bjorn Helgaas

On Tue, 2 Dec 2025 at 11:12, Manivannan Sadhasivam <mani@kernel.org> wrote:
>
> On Tue, Dec 02, 2025 at 11:03:07AM +0100, Vincent Guittot wrote:
> > On Tue, 2 Dec 2025 at 10:53, Manivannan Sadhasivam <mani@kernel.org> wrote:
> > >
> > > On Tue, Dec 02, 2025 at 09:54:24AM +0100, Vincent Guittot wrote:
> > > > On Tue, 2 Dec 2025 at 05:24, Manivannan Sadhasivam <mani@kernel.org> wrote:
> > > > >
> > > > > + Vincent
> > > >
> > > > Thanks for looping me in.
> > > > >
> > > > > On Sat, Nov 29, 2025 at 07:00:04PM -0800, Randy Dunlap wrote:
> > > > > >
> > > > > >
> > > > > > On 11/27/25 9:29 PM, Stephen Rothwell wrote:
> > > > > > > Hi all,
> > > > > > >
> > > > > > > Changes since 20251127:
> > > > > > >
> > > > > >
> > > > > > on i386 (allmodconfig):
> > > > > >
> > > > > > WARNING: modpost: vmlinux: section mismatch in reference: s32g_init_pcie_controller+0x2b (section: .text) -> memblock_start_of_DRAM (section: .init.text)
> > > >
> > > > Are there details to reproduce the warning ? I don't have such warning
> > > > when compiling allmodconfig locally
> > > >
> > > > s32 pcie can only be built in but I may have to use
> > > > builtin_platform_driver_probe() instead of builtin_platform_driver()
> > > >
> > >
> > > The is due to calling a function belonging to the __init section from non-init
> > > function. Ideally, functions prefixed with __init like memblock_start_of_DRAM()
> > > should be called from the module init functions.
> > >
> > > One way to fix would be to call memblock_start_of_DRAM() in probe(), and
> > > annotate probe() with __init. Since there is no remove, you could use
> > > builtin_platform_driver_probe().
> > >
> > > This also makes me wonder if we really should be using memblock_start_of_DRAM()
> > > in the driver. I know that this was suggested to you during reviews, but I would
> > > prefer to avoid it, especially due to this being the __init function.
> >
> > yeah, I suppose I can directly define the value in the driver has
> > there is only one memory config for now anyway
> >
> > /* Boundary between peripheral space and physical memory space */
> > #define S32G_MEMORY_BOUNDARY_ADDR 0x80000000
> >
>
> Ok. I fixed it up myself with below diff:

Thanks !

The change looks good to me

>
> diff --git a/drivers/pci/controller/dwc/pcie-nxp-s32g.c b/drivers/pci/controller/dwc/pcie-nxp-s32g.c
> index eacf0229762c..70b1dc404bbe 100644
> --- a/drivers/pci/controller/dwc/pcie-nxp-s32g.c
> +++ b/drivers/pci/controller/dwc/pcie-nxp-s32g.c
> @@ -7,7 +7,6 @@
>
>  #include <linux/interrupt.h>
>  #include <linux/io.h>
> -#include <linux/memblock.h>
>  #include <linux/module.h>
>  #include <linux/of_device.h>
>  #include <linux/of_address.h>
> @@ -35,6 +34,9 @@
>  #define PCIE_S32G_PE0_INT_STS                  0xE8
>  #define HP_INT_STS                             BIT(6)
>
> +/* Boundary between peripheral space and physical memory space */
> +#define S32G_MEMORY_BOUNDARY_ADDR              0x80000000
> +
>  struct s32g_pcie_port {
>         struct list_head list;
>         struct phy *phy;
> @@ -99,10 +101,10 @@ static struct dw_pcie_ops s32g_pcie_ops = {
>  };
>
>  /* Configure the AMBA AXI Coherency Extensions (ACE) interface */
> -static void s32g_pcie_reset_mstr_ace(struct dw_pcie *pci, u64 ddr_base_addr)
> +static void s32g_pcie_reset_mstr_ace(struct dw_pcie *pci)
>  {
> -       u32 ddr_base_low = lower_32_bits(ddr_base_addr);
> -       u32 ddr_base_high = upper_32_bits(ddr_base_addr);
> +       u32 ddr_base_low = lower_32_bits(S32G_MEMORY_BOUNDARY_ADDR);
> +       u32 ddr_base_high = upper_32_bits(S32G_MEMORY_BOUNDARY_ADDR);
>
>         dw_pcie_dbi_ro_wr_en(pci);
>         dw_pcie_writel_dbi(pci, COHERENCY_CONTROL_3_OFF, 0x0);
> @@ -149,7 +151,7 @@ static int s32g_init_pcie_controller(struct dw_pcie_rp *pp)
>          * Make sure we use the coherency defaults (just in case the settings
>          * have been changed from their reset values)
>          */
> -       s32g_pcie_reset_mstr_ace(pci, memblock_start_of_DRAM());
> +       s32g_pcie_reset_mstr_ace(pci);
>
>         dw_pcie_dbi_ro_wr_en(pci);
>
> - Mani
>
> --
> மணிவண்ணன் சதாசிவம்


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: Tree for Nov 28 (drivers/pci/controller/dwc/pcie-nxp-s32g.o)
  2025-12-02 10:12           ` Manivannan Sadhasivam
  2025-12-02 10:24             ` Vincent Guittot
@ 2025-12-02 22:37             ` Randy Dunlap
  1 sibling, 0 replies; 9+ messages in thread
From: Randy Dunlap @ 2025-12-02 22:37 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Vincent Guittot
  Cc: Stephen Rothwell, Linux Next Mailing List, linux-pci,
	Linux Kernel Mailing List, Ghennadi Procopciuc,
	NXP S32 Linux Team, imx@lists.linux.dev, linux-arm-kernel,
	Bjorn Helgaas



On 12/2/25 2:12 AM, Manivannan Sadhasivam wrote:
> On Tue, Dec 02, 2025 at 11:03:07AM +0100, Vincent Guittot wrote:
>> On Tue, 2 Dec 2025 at 10:53, Manivannan Sadhasivam <mani@kernel.org> wrote:
>>>
>>> On Tue, Dec 02, 2025 at 09:54:24AM +0100, Vincent Guittot wrote:
>>>> On Tue, 2 Dec 2025 at 05:24, Manivannan Sadhasivam <mani@kernel.org> wrote:
>>>>>
>>>>> + Vincent
>>>>
>>>> Thanks for looping me in.
>>>>>
>>>>> On Sat, Nov 29, 2025 at 07:00:04PM -0800, Randy Dunlap wrote:
>>>>>>
>>>>>>
>>>>>> On 11/27/25 9:29 PM, Stephen Rothwell wrote:
>>>>>>> Hi all,
>>>>>>>
>>>>>>> Changes since 20251127:
>>>>>>>
>>>>>>
>>>>>> on i386 (allmodconfig):
>>>>>>
>>>>>> WARNING: modpost: vmlinux: section mismatch in reference: s32g_init_pcie_controller+0x2b (section: .text) -> memblock_start_of_DRAM (section: .init.text)
>>>>
>>>> Are there details to reproduce the warning ? I don't have such warning
>>>> when compiling allmodconfig locally
>>>>
>>>> s32 pcie can only be built in but I may have to use
>>>> builtin_platform_driver_probe() instead of builtin_platform_driver()
>>>>
>>>
>>> The is due to calling a function belonging to the __init section from non-init
>>> function. Ideally, functions prefixed with __init like memblock_start_of_DRAM()
>>> should be called from the module init functions.
>>>
>>> One way to fix would be to call memblock_start_of_DRAM() in probe(), and
>>> annotate probe() with __init. Since there is no remove, you could use
>>> builtin_platform_driver_probe().
>>>
>>> This also makes me wonder if we really should be using memblock_start_of_DRAM()
>>> in the driver. I know that this was suggested to you during reviews, but I would
>>> prefer to avoid it, especially due to this being the __init function.
>>
>> yeah, I suppose I can directly define the value in the driver has
>> there is only one memory config for now anyway
>>
>> /* Boundary between peripheral space and physical memory space */
>> #define S32G_MEMORY_BOUNDARY_ADDR 0x80000000
>>
> 
> Ok. I fixed it up myself with below diff:

Thanks.
Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

> diff --git a/drivers/pci/controller/dwc/pcie-nxp-s32g.c b/drivers/pci/controller/dwc/pcie-nxp-s32g.c
> index eacf0229762c..70b1dc404bbe 100644
> --- a/drivers/pci/controller/dwc/pcie-nxp-s32g.c
> +++ b/drivers/pci/controller/dwc/pcie-nxp-s32g.c
> @@ -7,7 +7,6 @@
>  
>  #include <linux/interrupt.h>
>  #include <linux/io.h>
> -#include <linux/memblock.h>
>  #include <linux/module.h>
>  #include <linux/of_device.h>
>  #include <linux/of_address.h>
> @@ -35,6 +34,9 @@
>  #define PCIE_S32G_PE0_INT_STS                  0xE8
>  #define HP_INT_STS                             BIT(6)
>  
> +/* Boundary between peripheral space and physical memory space */
> +#define S32G_MEMORY_BOUNDARY_ADDR              0x80000000
> +
>  struct s32g_pcie_port {
>         struct list_head list;
>         struct phy *phy;
> @@ -99,10 +101,10 @@ static struct dw_pcie_ops s32g_pcie_ops = {
>  };
>  
>  /* Configure the AMBA AXI Coherency Extensions (ACE) interface */
> -static void s32g_pcie_reset_mstr_ace(struct dw_pcie *pci, u64 ddr_base_addr)
> +static void s32g_pcie_reset_mstr_ace(struct dw_pcie *pci)
>  {
> -       u32 ddr_base_low = lower_32_bits(ddr_base_addr);
> -       u32 ddr_base_high = upper_32_bits(ddr_base_addr);
> +       u32 ddr_base_low = lower_32_bits(S32G_MEMORY_BOUNDARY_ADDR);
> +       u32 ddr_base_high = upper_32_bits(S32G_MEMORY_BOUNDARY_ADDR);
>  
>         dw_pcie_dbi_ro_wr_en(pci);
>         dw_pcie_writel_dbi(pci, COHERENCY_CONTROL_3_OFF, 0x0);
> @@ -149,7 +151,7 @@ static int s32g_init_pcie_controller(struct dw_pcie_rp *pp)
>          * Make sure we use the coherency defaults (just in case the settings
>          * have been changed from their reset values)
>          */
> -       s32g_pcie_reset_mstr_ace(pci, memblock_start_of_DRAM());
> +       s32g_pcie_reset_mstr_ace(pci);
>  
>         dw_pcie_dbi_ro_wr_en(pci);
> 
> - Mani
> 

-- 
~Randy


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-12-02 22:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20251128162928.36eec2d6@canb.auug.org.au>
2025-11-30  3:00 ` linux-next: Tree for Nov 28 (drivers/pci/controller/dwc/pcie-nxp-s32g.o) Randy Dunlap
2025-12-01 17:23   ` Bjorn Helgaas
2025-12-02  4:24   ` Manivannan Sadhasivam
2025-12-02  8:54     ` Vincent Guittot
2025-12-02  9:53       ` Manivannan Sadhasivam
2025-12-02 10:03         ` Vincent Guittot
2025-12-02 10:12           ` Manivannan Sadhasivam
2025-12-02 10:24             ` Vincent Guittot
2025-12-02 22:37             ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).