Re: [PATCH v5] drm: Use USB controller's DMA mask when importing dmabufs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!


> > +	struct device *dmadev;
> > +	struct drm_gem_object *obj;
> > +
> > +	if (!dev_is_usb(dev->dev))
> > +		return ERR_PTR(-ENODEV);
> > +
> > +	dmadev = usb_intf_get_dma_device(to_usb_interface(dev->dev));
> > +	if (drm_WARN_ONCE(dev, !dmadev, "buffer sharing not supported"))
> > +		return ERR_PTR(-ENODEV);
> > +
> > +	obj = drm_gem_prime_import_dev(dev, dma_buf, dmadev);
> > +
> > +	put_device(dmadev);
> 
> Just realized there's another can of worms here because dma_buf_attach
> does not refcount the struct device. But the dma_buf can easily outlive
> the underlying device, at least right now.
> 
> We should probably require that devices get rid of all their mappings in
> their hotunplug code.
> 
> Ofc now that we pick some random other device struct this gets kinda
> worse.
> 
> Anyway, also just another pre-existing condition that we should worry
> about here. It's all still a very bad hack.

This is actually regression fix if I understand this correctly. Bug
means udl is unusable, so that's kind of bad.

Should we revert the original commit causing this while this get
sorted out?

Best regards,
								Pavel
-- 
http://www.livejournal.com/~pavelmachek

Attachment: signature.asc
Description: PGP signature

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux