[PATCH v2 0/4] firmware: arm_scmi: Enable building SCMI as module

Cristian Marussi cristian.marussi at arm.com
Tue Sep 8 07:53:05 EDT 2020


On Tue, Sep 08, 2020 at 12:11:14PM +0100, Sudeep Holla wrote:
> On Tue, Sep 08, 2020 at 10:08:44AM +0100, Cristian Marussi wrote:
> > Hi Sudeep
> >
> > On Mon, Sep 07, 2020 at 08:50:42PM +0100, Sudeep Holla wrote:
> > > Hi,
> > >
> > > Though it was initially developed as module, so some reason(I can't
> > > recollect why apart from some structuring arounf the way bus and
> > > protocols were initialised), it was merged as a built-in only driver.
> > >
> > > Now, there is a need to build this as modules. This is mainly needed
> > > by virtio transport. This also aligns well with GKI modularisation
> > > efforts.
> > >
> > > Regards,
> > > Sudeep
> > >
> >
> > I re-tested this v2 (also regarding some interactions with notifications) and
> > works generally fine for me, both builtin or modularized, BUT I've seen an
> > issue on core module load/unload/load.
> > Basically doing this:
> >
> > (debian-arm64)root at debarm64:~# insmod ./scmi-module.ko
> > (debian-arm64)root at debarm64:~# insmod ./scmi-cpufreq.ko
> >
> > (debian-arm64)root at debarm64:~# rmmod ./scmi-cpufreq.ko
> > (debian-arm64)root at debarm64:~# rmmod ./scmi-module.ko
> > (debian-arm64)root at debarm64:~# lsmod
> > Module                  Size  Used by
> > (debian-arm64)root at debarm64:~# insmod ./scmi-module.ko
> >
> > I've got this:
> >
> >
> > [  146.982413] mhu 2b1f0000.mhu: Channel in use
> > [  146.982433] arm-scmi firmware:scmi: failed to request SCMI Tx mailbox
> > [  146.982472] arm-scmi: probe of firmware:scmi failed with error -16
> >
> > and SCMI is broken then after reloading.
> >
> > Now this is an issue I've seen already in my ongoing WIP on full SCMI Protocols
> > modularization for custom protocols, and it is related to the fact the the
> > underlying transport init is bound to the SCMI device creation and not the
> > protocol initialization, and we are not destroying and re-creating such
> > devices properly. (things that I'm going to address in that WIP)
> >
> > Given that the solution to this is not so simple as of now, and given that
> > unloading of the core as a whole module does not make so much sense anyway
> > (while it will be needed for single custom protocols modules), couldn't we
> > just make scmi-module a permanent by droppping module_exit() ?
> 
> Now I remember why I had bus_exit before unregistering the driver. I think
> that should fix the issue. Let me know.
> 

Yes that works for me, both as builtin or as a module now.

Cristian

> --
> Regards,
> Sudeep



More information about the linux-arm-kernel mailing list