Re: usbrsa: dead lock usbrsa_write/usbrsa_write_room

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

 



Johan Hovold <jhovold@...> writes:


Hello Johan

> Well, you shouldn't reinvent the wheel unless you have to. The generic
> implementation is efficient and well-debugged. 
point taken.

> If you want (and need) to
> take the fill-level information into account you should investigate
> whether it's would be sufficient to hook into the generic implementation
> before implementing from scratch.
I thought a little bit about it:
The tty layer seems to always call write_room before write, and then hand over
as many bytes as can be consumed by the driver to the write function.

I could make write_room return the ACTUAL fill-level information of the device.
Now, the tty layer would potentially hand over more bytes to generic_write that
it can handle. This would result in only a part of the data been but to URBs and
sent off to the device.

I would a assume that the tty layer would just issue another write_room, learn
that there is still room available on the device, and then try to sent the
remaining bytes via  a another generic_write. As now at least some of the URBs
are already recycled, it can sent off more data to the device.
So it should work. I just wonder if this efficient? 

The approach I had in mind was to do this in write function by sending off and
recycling as many URBs as there are need to transfer everything. 

Which approach, do you think, is better ? 

Thanks
Tilman





--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux