|  |  | 
  
    |  |  | 
 
  |   |  | 
  
    |  |  | 
  
    |  |  | 
  
    |   xen-devel
[Xen-devel] Re: [PATCH 03/15] [swiotlb] Add swiotlb_register_engine	func 
| To: | Chris Wright <chrisw@xxxxxxxxxxxx> |  
| Subject: | [Xen-devel] Re: [PATCH 03/15] [swiotlb] Add swiotlb_register_engine	function. |  
| From: | Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> |  
| Date: | Tue, 19 Jan 2010 12:25:14 -0500 |  
| Cc: | Ian.Campbell@xxxxxxxxxxxxx, jeremy@xxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx,	joerg.roedel@xxxxxxx, fujita.tomonori@xxxxxxxxxxxxx,	iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx, dwmw2@xxxxxxxxxxxxx,	alex.williamson@xxxxxx |  
| Delivery-date: | Tue, 19 Jan 2010 09:30:59 -0800 |  
| Envelope-to: | www-data@xxxxxxxxxxxxxxxxxxx |  
| In-reply-to: | <20100115014129.GC6021@xxxxxxxxxxxxxxxxxxxx> |  
| List-help: | <mailto:xen-devel-request@lists.xensource.com?subject=help> |  
| List-id: | Xen developer discussion <xen-devel.lists.xensource.com> |  
| List-post: | <mailto:xen-devel@lists.xensource.com> |  
| List-subscribe: | <http://lists.xensource.com/mailman/listinfo/xen-devel>,	<mailto:xen-devel-request@lists.xensource.com?subject=subscribe> |  
| List-unsubscribe: | <http://lists.xensource.com/mailman/listinfo/xen-devel>,	<mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> |  
| References: | <1263510064-16788-1-git-send-email-konrad.wilk@xxxxxxxxxx>	<1263510064-16788-2-git-send-email-konrad.wilk@xxxxxxxxxx>	<1263510064-16788-3-git-send-email-konrad.wilk@xxxxxxxxxx>	<1263510064-16788-4-git-send-email-konrad.wilk@xxxxxxxxxx>	<20100115014129.GC6021@xxxxxxxxxxxxxxxxxxxx> |  
| Sender: | xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |  
| User-agent: | Mutt/1.5.19 (2009-01-05) |  
| > > +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> |  | 
[Xen-devel] Re: [PATCH 01/15] [swiotlb] fix: Update	'setup_io_tlb_npages' to accept both arguments in either order., Chris Wright
[Xen-devel] Re: [RFC SWIOTLB-0.2], Chris Wright[Xen-devel] Re: [PATCH 14/15] [swiotlb] Move initialization	(swiotlb_init) and its friends in swiotlb-default.c, (continued)
[Xen-devel] Re: [PATCH 06/15] [swiotlb] In 'swiotlb_init' take	advantage of the default swiotlb_engine support., Chris Wright
[Xen-devel] Re: [PATCH 06/15] [swiotlb] In 'swiotlb_init' take	advantage of the default swiotlb_engine support., Konrad Rzeszutek Wilk
[Xen-devel] Re: [PATCH 05/15] [swiotlb] Respect the io_tlb_nslabs	argument value., Chris Wright
[Xen-devel] Re: [PATCH 04/15] [swiotlb] Search and replace	s/io_tlb/iommu_sw->/, Chris Wright
[Xen-devel] Re: [PATCH 04/15] [swiotlb] Search and replace	s/io_tlb/iommu_sw->/, Konrad Rzeszutek Wilk
[Xen-devel] Re: [PATCH 03/15] [swiotlb] Add swiotlb_register_engine	function., Chris Wright
[Xen-devel] Re: [PATCH 03/15] [swiotlb] Add swiotlb_register_engine	function.,
Konrad Rzeszutek Wilk <=
[Xen-devel] Re: [PATCH 02/15] [swiotlb] Add swiotlb_engine	structure for tracking multiple software IO TLBs., Chris Wright
[Xen-devel] Re: [PATCH 02/15] [swiotlb] Add swiotlb_engine	structure for tracking multiple software IO TLBs., Konrad Rzeszutek Wilk
[Xen-devel] Re: [PATCH 02/15] [swiotlb] Add swiotlb_engine	structure for tracking multiple software IO TLBs., Chris Wright
[Xen-devel] Re: [PATCH 02/15] [swiotlb] Add swiotlb_engine structure for tracking	multiple software IO TLBs., FUJITA Tomonori
[Xen-devel] Re: [PATCH 02/15] [swiotlb] Add swiotlb_engine	structure for tracking multiple software IO TLBs., Konrad Rzeszutek Wilk
 |  |  | 
  
    |  |  |