WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 03/15] [swiotlb] Add swiotlb_register_engine func

> > +EXPORT_SYMBOL(iommu_sw);
> 
> should be EXPORT_SYMBOL_GPL

Yup.
> 
> >  static int late_alloc;
> >  
> >  static int __init
> > @@ -126,6 +132,48 @@ static dma_addr_t swiotlb_virt_to_bus(struct device 
> > *hwdev,
> >     return phys_to_dma(hwdev, virt_to_phys(address));
> >  }
> >  
> > +/*
> > + * Register a software IO TLB engine.
> > + *
> > + * The registration allows the software IO TLB functions in the
> > + * swiotlb library to function properly.
> > + *
> > + * All the values in the iotlb structure must be set.
> > + *
> > + * If the registration fails, it is assumed that the caller will free
> > + * all of the resources allocated in the swiotlb_engine structure.
> > + */
> > +int swiotlb_register_engine(struct swiotlb_engine *iommu)
> > +{
> > +   if (!iommu || !iommu->name || !iommu->release) {
> > +           printk(KERN_ERR "DMA: Trying to register a SWIOTLB engine" \
> > +                           " improperly!");
> > +           return -EINVAL;
> > +   }
> > +
> > +   if (iommu_sw && iommu_sw->name) {
> 
> According to above, you can't have !iommu_sw->name.

Yup. Artificats of previous implementation.
> 
> > +           int retval = -EINVAL;
> > +
> > +           /* 'release' must check for out-standing DMAs and flush them
> > +            *  out or fail. */
> > +           if (iommu_sw->release)
> > +                   retval = iommu_sw->release(iommu_sw);
> 
> Same here, you can't have !iommu_sw->release, just call unconditionally.

Ok.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>