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

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

The net2272 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/20210520202206.GF1216852@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/net2272.c
drivers/usb/gadget/udc/net2272.h