Hi, W dniu 20.05.2019 o 23:52, Yang, Fei pisze:
One question that comes to my mind is this: Does the USB
<snip>
One of the problems appears to be that req->num_mapped_sgs was left uninitialized. I made the following change and got a lot more requests completed. However this change is not sufficient to solve the adb issue, the usb requests would eventually get stuck without getting a matching ffs_epfile_async_io_complete. @@ -1067,6 +1067,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) req->buf = NULL; req->sg = io_data->sgt.sgl; req->num_sgs = io_data->sgt.nents; + req->num_mapped_sgs = req->num_sgs; } else { req->buf = data; } @@ -1110,6 +1111,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) req->buf = NULL; req->sg = io_data->sgt.sgl; req->num_sgs = io_data->sgt.nents; + req->num_mapped_sgs = req->num_sgs; } else { req->buf = data; }
Isn't num_mapped_sgs meant to be set by drivers/usb/gadget/udc/core.c? And the comment in include/linux/usb/gadget.h says "internal". One thing that becomes evident now is that adb uses async io. It seems that interaction of async io and s-g mode should be further investigated. Andrzej