USB: UDC: Implement udc_async_callbacks in net2280
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 20 May 2021 20:22:00 +0000 (16:22 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Jun 2021 11:52:06 +0000 (13:52 +0200)
commitb42e8090ba93526d6063108b25e5fc0f11f58770
tree407007f6ed3fe26688820f9b55acb72841f965b2
parent04145a03db9d78469e0817ab3a767c76c0fb0947
USB: UDC: Implement udc_async_callbacks in net2280

This patch adds a udc_async_callbacks handler to the net2280 UDC
driver, which will prevent a theoretical race during gadget unbinding.

The net2280 driver is sufficiently complicated that I didn't want to
mess around with IRQ settings.  Instead, the patch simply adds a new
flag to control async callbacks, and checks the flag before issuing
any of them.

Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20210520202200.GE1216852@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/net2280.c
drivers/usb/gadget/udc/net2280.h