public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* USB: f_fs: Use Functionfs with kernel AIO
@ 2021-12-01 17:04 Shang Shi
  2021-12-02 14:46 ` John Keeping
  0 siblings, 1 reply; 2+ messages in thread
From: Shang Shi @ 2021-12-01 17:04 UTC (permalink / raw)
  To: linux-usb; +Cc: Gabriel Beddingfield

Hi,

This is Shang Shi from Google. As we are examining the Andorid adb
daemon implementation in AOSP, we found that there's a concern on
functionfs that an io_submit syscall on IN/OUT endpoint after endpoint
becomes disabled could end up blocking [1]. AOSP kills a thread to
avoid it blocking on io_submit, which is not an elegant way to exist.

Is it true that io_submit syscall could end up blocking after endpoint
is disabled? Would opening  endpoint file with O_NONBLOCK resolve the
issue?

From the ffs-aio-example "aio_simple.c", it seems that as long as we
read and process control events before any read/write (with
io_submit), we are not worried about any race condition between
endpoint becoming disabled and io_submit. Is this true?

Really appreciate it for taking time helping us on these questions!

Thanks!
Shang Shi

Reference [1]:
https://cs.android.com/android/platform/superproject/+/master:packages/modules/adb/daemon/usb.cpp;drc=bbfaaac52f1321d3b9b67e89ab23303510cd2593;l=247

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-02 14:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-01 17:04 USB: f_fs: Use Functionfs with kernel AIO Shang Shi
2021-12-02 14:46 ` John Keeping

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox