Re: [PATCH v2 1/9] usb: gadget: add generic map/unmap request utilities

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

 



Hi,

On Tue, Dec 20, 2011 at 07:03:21PM +0100, Sebastian Andrzej Siewior wrote:
> * Felipe Balbi | 2011-12-20 18:37:05 [+0200]:
> 
> >diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
> >index 0b0d12c..f270c9d 100644
> >--- a/drivers/usb/gadget/udc-core.c
> >+++ b/drivers/usb/gadget/udc-core.c
> >@@ -49,6 +50,57 @@ static DEFINE_MUTEX(udc_lock);
> > 
> > /* ------------------------------------------------------------------------- */
> > 
> >+int usb_gadget_map_request(struct usb_gadget *gadget,
> >+		struct usb_request *req, int is_in)
> >+{
> >+	if (req->length == 0)
> >+		return 0;
> >+
> >+	if (req->num_sgs) {
> >+		int     mapped;
> >+
> >+		mapped = dma_map_sg(&gadget->dev, req->sg, req->num_sgs,
> 
> Sorry for not comming up with this earlier but I'm not sure if this the
> same as calling it with the _real_ device. After all the device may have
> dma_ops set and I'm not sure if this is copied here.

If it's not copied here, then it's a bug on the UDC driver. The gadget's
device isn't a _real_ device anyway. This will actually help catch those
errors, right ?

I just want people to actually test the patches I posted ;-)

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux