Re: [PATCH 6/7] Revert "iommu/arm-smmu: Make arm-smmu explicitly non-modular"

From: Will Deacon
Date: Thu Oct 31 2019 - 08:03:35 EST


On Wed, Oct 30, 2019 at 05:09:41PM -0600, Jordan Crouse wrote:
> On Wed, Oct 30, 2019 at 02:51:11PM +0000, Will Deacon wrote:
> > @@ -2235,12 +2237,16 @@ static const struct dev_pm_ops arm_smmu_pm_ops = {
> >
> > static struct platform_driver arm_smmu_driver = {
> > .driver = {
> > - .name = "arm-smmu",
> > - .of_match_table = of_match_ptr(arm_smmu_of_match),
> > - .pm = &arm_smmu_pm_ops,
> > - .suppress_bind_attrs = true,
> > + .name = "arm-smmu",
> > + .of_match_table = of_match_ptr(arm_smmu_of_match),
> > + .pm = &arm_smmu_pm_ops,
> > },
> > .probe = arm_smmu_device_probe,
> > + .remove = arm_smmu_device_remove,
> > .shutdown = arm_smmu_device_shutdown,
> > };
> > -builtin_platform_driver(arm_smmu_driver);
> > +module_platform_driver(arm_smmu_driver);
>
> I know this is a revert, but wouldn't you still want to be at device_init()
> level for built in drivers? It always preferable to not defer if given the
> choice to do so and device_init() is the right level for this driver IMO.

Hmm, not sure I'm following you completely here. With this change,
module_init() is used to invoke platform_driver_register(). For builtin
drivers, module_initx() expands to __initcall(x), which itself expands
to device_initcall(x). Or are you referrring to something else?

Will