diff --git a/patches.suse/fotg210-udc-Add-missing-completion-handler.patch b/patches.suse/fotg210-udc-Add-missing-completion-handler.patch new file mode 100644 index 0000000..891e90a --- /dev/null +++ b/patches.suse/fotg210-udc-Add-missing-completion-handler.patch @@ -0,0 +1,58 @@ +From e55f67391fa986f7357edba0ca59e668d99c3a5f Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Mon, 23 Jan 2023 08:35:06 +0100 +Subject: [PATCH] fotg210-udc: Add missing completion handler +Git-commit: e55f67391fa986f7357edba0ca59e668d99c3a5f +References: git-fixes +Patch-mainline: v6.3-rc1 + +This is used when responding to GET_STATUS requests. Without this, it +crashes on completion. + +Fixes: b84a8dee23fd ("usb: gadget: add Faraday fotg210_udc driver") +Signed-off-by: Fabian Vogt +Signed-off-by: Linus Walleij +Link: https://lore.kernel.org/r/20230123073508.2350402-2-linus.walleij@linaro.org +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/fotg210/fotg210-udc.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/drivers/usb/fotg210/fotg210-udc.c b/drivers/usb/fotg210/fotg210-udc.c +index 4334504fccc8..53b7d078a54d 100644 +--- a/drivers/usb/gadget/udc/fotg210-udc.c ++++ b/drivers/usb/gadget/udc/fotg210-udc.c +@@ -709,6 +709,20 @@ static int fotg210_is_epnstall(struct fotg210_ep *ep) + return value & INOUTEPMPSR_STL_EP ? 1 : 0; + } + ++/* For EP0 requests triggered by this driver (currently GET_STATUS response) */ ++static void fotg210_ep0_complete(struct usb_ep *_ep, struct usb_request *req) ++{ ++ struct fotg210_ep *ep; ++ struct fotg210_udc *fotg210; ++ ++ ep = container_of(_ep, struct fotg210_ep, ep); ++ fotg210 = ep->fotg210; ++ ++ if (req->status || req->actual != req->length) { ++ dev_warn(&fotg210->gadget.dev, "EP0 request failed: %d\n", req->status); ++ } ++} ++ + static void fotg210_get_status(struct fotg210_udc *fotg210, + struct usb_ctrlrequest *ctrl) + { +@@ -1253,6 +1267,8 @@ int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg) + if (fotg210->ep0_req == NULL) + goto err_map; + ++ fotg210->ep0_req->complete = fotg210_ep0_complete; ++ + fotg210_init(fotg210); + + fotg210_disable_unplug(fotg210); +-- +2.40.1 + diff --git a/series.conf b/series.conf index ce73e36..e81a719 100644 --- a/series.conf +++ b/series.conf @@ -63236,6 +63236,7 @@ patches.suse/scsi-qla2xxx-remove-the-unused-variable-wwn.patch patches.suse/nfsd-fix-race-to-check-ls_layouts.patch patches.suse/tracing-Add-NULL-checks-for-buffer-in-ring_buffer_free_read_page.patch + patches.suse/fotg210-udc-Add-missing-completion-handler.patch patches.suse/applicom-Fix-PCI-device-refcount-leak-in-applicom_in.patch patches.suse/powerpc-powernv-ioda-Skip-unallocated-resources-when.patch patches.suse/powerpc-pseries-lpar-add-missing-RTAS-retry-status-h.patch