From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 565491DF252; Wed, 6 Nov 2024 12:18:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730895520; cv=none; b=XUFFu4MnAIOb8FmGkzSIahx0gUJvNYPNDIh8lRnML8oCJI/8rcrMVfwio552/l6rxoyXRu7EM5Fs0JooaHDG6vUwA8f9nQrmopfwUQlPjViJEkV6QlRq4Malj8weRzkt8dtYQUMntmhSBwELO6jvKmh6bhapxbYNw55//Nf75rM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730895520; c=relaxed/simple; bh=FlnCQIWeZjufZDG7AyQqAjIuajUmeIEFR5/kpPyrjiE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pG4Rn8pfmU7A/0wK2VC+d39O1T+x3E5zGOkrQGMeCZP+rIuuJTua6kBiWpwjTCClOxrJMtG/s/gS5KMPQkNvZDXkAM8gYXgwz5hkJW/hzLptCo1vJ5CUCmHMRra5v6l78AdGbPpoi2FPkHWy/5M9lvUXAInqZ5wbTarp39rlYP4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=h5SWMZe5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="h5SWMZe5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4661C4CECD; Wed, 6 Nov 2024 12:18:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730895520; bh=FlnCQIWeZjufZDG7AyQqAjIuajUmeIEFR5/kpPyrjiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h5SWMZe5EyHDYsVUp3XaJGAVrEv/OeXI4E9E94w6ircG5xYBRHIH1eFly0poMozAk +c+eAXuQ8RbGhixXtyZ5g0muqX8iwqUsf/r2nY3V8R60Lnge7LA/KAMBdtALKzjcnE AHYNcpgGPgOPSSZ7eDoIfFcpZuP+WRYQ9Snh0Wwg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xu Yang , Peter Chen , Sasha Levin Subject: [PATCH 4.19 244/350] usb: chipidea: udc: enable suspend interrupt after usb reset Date: Wed, 6 Nov 2024 13:02:52 +0100 Message-ID: <20241106120326.964236100@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241106120320.865793091@linuxfoundation.org> References: <20241106120320.865793091@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xu Yang [ Upstream commit e4fdcc10092fb244218013bfe8ff01c55d54e8e4 ] Currently, suspend interrupt is enabled before pullup enable operation. This will cause a suspend interrupt assert right after pullup DP. This suspend interrupt is meaningless, so this will ignore such interrupt by enable it after usb reset completed. Signed-off-by: Xu Yang Acked-by: Peter Chen Link: https://lore.kernel.org/r/20240823073832.1702135-1-xu.yang_2@nxp.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/chipidea/udc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 3bda856ff2cab..6a626f41cded1 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -81,7 +81,7 @@ static int hw_device_state(struct ci_hdrc *ci, u32 dma) hw_write(ci, OP_ENDPTLISTADDR, ~0, dma); /* interrupt, error, port change, reset, sleep/suspend */ hw_write(ci, OP_USBINTR, ~0, - USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI); + USBi_UI|USBi_UEI|USBi_PCI|USBi_URI); } else { hw_write(ci, OP_USBINTR, ~0, 0); } @@ -748,6 +748,7 @@ __releases(ci->lock) __acquires(ci->lock) { int retval; + u32 intr; spin_unlock(&ci->lock); if (ci->gadget.speed != USB_SPEED_UNKNOWN) @@ -761,6 +762,11 @@ __acquires(ci->lock) if (retval) goto done; + /* clear SLI */ + hw_write(ci, OP_USBSTS, USBi_SLI, USBi_SLI); + intr = hw_read(ci, OP_USBINTR, ~0); + hw_write(ci, OP_USBINTR, ~0, intr | USBi_SLI); + ci->status = usb_ep_alloc_request(&ci->ep0in->ep, GFP_ATOMIC); if (ci->status == NULL) retval = -ENOMEM; -- 2.43.0