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

yanteng si siyanteng01 at gmail.com
Wed Oct 27 18:58:32 PDT 2021


Sergio Paracuellos <sergio.paracuellos at gmail.com> 于2021年10月27日周三 下午7:45写道:
>
> Hi,
>
> On Wed, Oct 27, 2021 at 1:32 PM Yanteng Si <siyanteng01 at gmail.com> 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 at loongson.cn>
> > ---
> >  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"
OK,Thanks!
> or something similar. I am not the best with words :).
Me too. >_<
>
> >
> > 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?
OK. Thanks!
>
> > +
> >  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.
OK. Thanks!
>
> >
> >  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.
OK. Thanks!
>
> >
> >  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.
OK. Thanks!

Thanks,
yanteng
>
> >
> >  static DEFINE_PER_CPU_ALIGNED(spinlock_t, cpc_core_lock);
> >
> > --
> > 2.27.0
> >
>
> Thanks,
>     Sergio Paracuellos



More information about the linux-arm-kernel mailing list