[PATCH 1/2] fixup! usb: gadget: dfu: Wrap fs operation in workqueue

Jules Maselbas jmaselbas at kalray.eu
Mon Mar 1 04:30:39 EST 2021


When not in mode "safe", do_close was never called.

Signed-off-by: Jules Maselbas <jmaselbas at kalray.eu>
---
 drivers/usb/gadget/dfu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c
index 82c9dc030..3234f25b3 100644
--- a/drivers/usb/gadget/dfu.c
+++ b/drivers/usb/gadget/dfu.c
@@ -359,7 +359,6 @@ static void dfu_do_copy(struct dfu_work *dw)
 	}
 
 	dfu->dfu_state = DFU_STATE_dfuIDLE;
-	dfu_do_close(dw);
 }
 
 static int
@@ -557,6 +556,11 @@ static int handle_manifest(struct usb_function *f, const struct usb_ctrlrequest
 		wq_queue_work(&dfu->wq, &dw->work);
 	}
 
+	dw = xzalloc(sizeof(*dw));
+	dw->dfu = dfu;
+	dw->task = dfu_do_close;
+	wq_queue_work(&dfu->wq, &dw->work);
+
 	return 0;
 }
 
-- 
2.17.1





More information about the barebox mailing list