Re: [PATCH] Suspend and Resume Support for Intel IOMMU

From: Ingo Molnar
Date: Wed Feb 18 2009 - 12:20:08 EST



* Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> On Wed, 18 Feb 2009, Fenghua Yu wrote:
> >
> > +static int vtd_enabled;
> ..
> > +static int iommu_resume(struct sys_device *dev)
> > +{
> ..
> > + if (!vtd_enabled)
> > + return 0;
>
> Hmm. Why do this?
>
> Wouldn't it be much more logical to only register the
> iommu_sysdev if the thing is enabled, rather than having an
> odd flag that gets tested at runtime?

The sysdev_class_register() could be done straight in
intel_iommu_init(), because that gets called by pci_iommu_init()
which is an fs_initcall() - so all the sysdev facilities should
be up and running already.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/