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 C3BF03399F; Tue, 15 Oct 2024 13:19:53 +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=1728998393; cv=none; b=cQ40Pxo8Zv2YEOwf0jKH3+f9eYrHnigEAtZkquwrz36tKybbuwohrJhgc4latEnsy71j4oL3Q+2K99tEd/DBNGkErJuOsBfiDSvTAHZRVpYOki85Euh78UNjhvo87z7yPB1roroQEOjt31yTdwoeZ8RLoKqltVHB+SZ1DpuSPF0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998393; c=relaxed/simple; bh=AoC/dAi8wDadXTWN1P2xb/LYB6fwMuHnk9W8pDeMIUU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IsOvhs0elVefnJ2wuINCBHKG9eX2RySxRz9cZ09TPdFHP1DZvqjQn1Ke4LTe0F6NzEWJBmplyG1+ELX9cu+/i2CqQGwEBSyXoJ331njMTKDHQUoV1YqPJZLi7AAJ8y8FTaPMo74bi020lN+/Wb6TSM9qIpHg1UGztet8PFQU7Kg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ysnaWQ2c; 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="ysnaWQ2c" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 100E6C4CED7; Tue, 15 Oct 2024 13:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728998393; bh=AoC/dAi8wDadXTWN1P2xb/LYB6fwMuHnk9W8pDeMIUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ysnaWQ2cbA7m3vdRD5wUU8d4CoCXYFjMe4/GPmkmvy5F7ukF6qo2tayNuYmZMnbWn zANpaQ93SDmNJYbNFkHfhYg3G/0/yPpeNXIc9hb5a0MrPxmBEAckJ8gyligjjrHhmw yw0lw0WU6m8MIxx4ObNVegDeYQ8AMGqUYEcNJLhA= 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 5.10 464/518] usb: chipidea: udc: enable suspend interrupt after usb reset Date: Tue, 15 Oct 2024 14:46:08 +0200 Message-ID: <20241015123934.914870182@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015123916.821186887@linuxfoundation.org> References: <20241015123916.821186887@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 5.10-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 67d8da04848ec..5cdf03534c0c7 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -83,7 +83,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); } @@ -862,6 +862,7 @@ __releases(ci->lock) __acquires(ci->lock) { int retval; + u32 intr; spin_unlock(&ci->lock); if (ci->gadget.speed != USB_SPEED_UNKNOWN) @@ -875,6 +876,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