Re: [PATCH 2/2] PCI: mt7621: Export mips_cm/cpc/gcr_* to modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, Oct 27, 2021 at 1:32 PM Yanteng Si <siyanteng01@xxxxxxxxx> wrote:
>
> modpost complains once these drivers become modules.
>
> ERROR: modpost: "mips_cm_unlock_other" [drivers/pci/controller/pcie-mt7621.ko] undefined!
> ERROR: modpost: "mips_cpc_base" [drivers/pci/controller/pcie-mt7621.ko] undefined!
> ERROR: modpost: "mips_cm_lock_other" [drivers/pci/controller/pcie-mt7621.ko] undefined!
> ERROR: modpost: "mips_cm_is64" [drivers/pci/controller/pcie-mt7621.ko] undefined!
> ERROR: modpost: "mips_gcr_base" [drivers/pci/controller/pcie-mt7621.ko] undefined!
>
> Let's just export them.
>
> Signed-off-by: Yanteng Si <siyanteng@xxxxxxxxxxx>
> ---
>  arch/mips/kernel/mips-cm.c  | 5 +++++
>  arch/mips/kernel/mips-cpc.c | 1 +
>  2 files changed, 6 insertions(+)

This PATCH has the prefix "PCI: mt7621: " but the changes here are all
mips kernel things. So I guess it is better to have "MIPS: cm/cpc:
export some missing symbols to be able to use them from driver code"
or something similar. I am not the best with words :).

>
> diff --git a/arch/mips/kernel/mips-cm.c b/arch/mips/kernel/mips-cm.c
> index 90f1c3df1f0e..b07f20323132 100644
> --- a/arch/mips/kernel/mips-cm.c
> +++ b/arch/mips/kernel/mips-cm.c
> @@ -12,8 +12,11 @@
>  #include <asm/mipsregs.h>
>
>  void __iomem *mips_gcr_base;
> +EXPORT_SYMBOL(mips_gcr_base);

EXPORT_SYMBOL_GPL?

> +
>  void __iomem *mips_cm_l2sync_base;
>  int mips_cm_is64;
> +EXPORT_SYMBOL(mips_cm_is64);
>
>  static char *cm2_tr[8] = {
>         "mem",  "gcr",  "gic",  "mmio",
> @@ -353,6 +356,7 @@ void mips_cm_lock_other(unsigned int cluster, unsigned int core,
>          */
>         mb();
>  }
> +EXPORT_SYMBOL(mips_cm_lock_other);

ditto.

>
>  void mips_cm_unlock_other(void)
>  {
> @@ -369,6 +373,7 @@ void mips_cm_unlock_other(void)
>
>         preempt_enable();
>  }
> +EXPORT_SYMBOL(mips_cm_unlock_other);

ditto.

>
>  void mips_cm_error_report(void)
>  {
> diff --git a/arch/mips/kernel/mips-cpc.c b/arch/mips/kernel/mips-cpc.c
> index 8d2535123f11..dfd3d58fd412 100644
> --- a/arch/mips/kernel/mips-cpc.c
> +++ b/arch/mips/kernel/mips-cpc.c
> @@ -13,6 +13,7 @@
>  #include <asm/mips-cps.h>
>
>  void __iomem *mips_cpc_base;
> +EXPORT_SYMBOL(mips_cpc_base);

ditto.

>
>  static DEFINE_PER_CPU_ALIGNED(spinlock_t, cpc_core_lock);
>
> --
> 2.27.0
>

Thanks,
    Sergio Paracuellos



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux