From patchwork Fri Sep 20 09:40:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13808428 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2051.outbound.protection.outlook.com [40.107.22.51]) (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 66DDC22066 for ; Fri, 20 Sep 2024 09:40:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726825208; cv=fail; b=u+uqQ8YxKpQV77+ryqcLgD0EQX3era6dbIrFeyKszUO8vOmJFz0SZ0u3ImBStbWR6kDgI4B866AF6wkiXFPX+2wfkk7Xmtx5cj2gUUStXwd2s79m0UXJpeIMo5RIZ8fZdHgt12L4k3COnV+SvfVhqyGZfhAbt4MrhvU1AUG6r+4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726825208; c=relaxed/simple; bh=PsBpL2Z9SNYKc6A6j3pwtjZbyiOr9JcoEyybyqCXJ/Y=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=t+Y4/eZJnB4JvedH41eQDObbQ9yuQfyH+JaJVzEeyBt/JlqHBfXptARPdlMLrAubhOlWKptt379msp3MFJoLPPVstkC7cXTd6dVt26YbAldlXw2rNy2oegkL8hWkLi3HBx3b88kdGToydDjUHrMQ4PPEL9WOFM0xgW9/y4xI2JE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=fGgbxZBC; arc=fail smtp.client-ip=40.107.22.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="fGgbxZBC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nkXYQ0rxY58jSdmBW/Ks4fzQE8100pNPwqqlxAyrUmYUZP+xoVtSatTHXyHq0oL77IO6BYMue1vyPwA53hXVCcioKMlKsY5k8PFP0vvw/xUWgxpC/yfeIn4FBl2CIQNjAc6Mt6b6IlgY47/58pN08RP2Cr5sMzpQPbYeEzkfOtGdXua9aGeWoLpu22Jrf1T2AuPYE4LUi/xEYin8qAd3yDkXjT3mm8/QyyCF5c8KnN2XPT5PTSokEaE+K2oFV+oRGqsRn3Lgj6mZVDnKCgv5tXEgfrgHa8llXL6YnUrh1RC2i+bsUdgDqfQ1ZYLdckojGllhIIrzaITjw80TuRhTxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=n+VYpPTFjrsseXDgLUaFxm908ISxu2crss8cOzXTEdg=; b=yv6boroh6VNU5FJYX/NDZdVY9xj1C0yOVb3EIW8R6F/KPaUUdN6oW17aV2xYfrJFsF5io7qehbLlYFtJ9687gBuS5Hh4SBGGnfkA13f1WW7ljymqAEFViMyG171YE6hMj7jUf3mrf5JHUDAJugDHXpNF/vB1YsIsoX+ecr7RaguJq0NFgNIn136C41Hh+l//feRV95QMP59/p1OajrftmC9aoOAlFGcSHYPI3f72AJ2KaKQHXH0nhV5geGkhjreedl/js/MvrJDwSfs0B51eJl+GmXFN4yVtGAoQMSOPpbQyWITI1N9iDRn1RHCncUOSd6l+1kPugGdsHlx45uhavA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n+VYpPTFjrsseXDgLUaFxm908ISxu2crss8cOzXTEdg=; b=fGgbxZBC01TDel7g6+MNCiT4fiIqporoweVkdfS1Lkt1DBz13SGj2EtyJvxueWUrqgyMwriwbQJ6beIMI6slwEfPkAZe/OaHSR4khupNm+Lo/zY/zOVWcjnYWexW+lAMR+FC7fGzTc0YBEXGcKtzt8Cks/uTWwykLRIyDyazV3cNPR8IrSbWTvw9z7Eu5aQvlYFiZmYdvQzsecI5AsrpfWF/3atFLMMAp3hUy06OnJR0gkUVaGpNucKMjAlZKsmMbEQa0FTkvcj94TKN0HpONs3qsZ2MymVM2J6LumTPqVBH8k0iFyTP1SGKmnbb4Sz7/dWvq/drT9JxfTlS+t0D2g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by VI1PR04MB7072.eurprd04.prod.outlook.com (2603:10a6:800:12c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.22; Fri, 20 Sep 2024 09:40:03 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7%4]) with mapi id 15.20.7918.024; Fri, 20 Sep 2024 09:40:03 +0000 From: Xu Yang To: peter.chen@kernel.org, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, imx@lists.linux.dev, jun.li@nxp.com Subject: [PATCH v2 1/3] usb: chipidea: udc: handle USB Error Interrupt if IOC not set Date: Fri, 20 Sep 2024 17:40:54 +0800 Message-Id: <20240920094056.2680590-1-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SI2PR01CA0011.apcprd01.prod.exchangelabs.com (2603:1096:4:191::6) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|VI1PR04MB7072:EE_ X-MS-Office365-Filtering-Correlation-Id: 8034cc37-15d7-40be-dd97-08dcd95833a5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: XCUVDl3Y0KPy6gTZK1e4BbHsMkNXvXLmCAl335qEafkLyNt4t2PX98FslG+SixwIZ9WpIOaPnGfR5+4v8n+9z4Kx6QX4lXqGS9BZ3s4uTcr78XjnBaorDCsoufMBB8QfnbRHo7RafTDsxpsS5ZxC+CGiCGj7KV5Rwn7tdWNaTnASBWSsN2pdFA8JCtP3n0wStdBAtGcGJXgYk2ZsIGZ6bpsee6YlxOihKc18qmnLEmfh2WtbRlsPv+kOuuAqCYLDHJvd6PMpQr+ObXIq5erp4awOVLkxssykyDT4bD2OPy4Srmd+E1otgX4VvVp/gtJkgOAIJJjQ7M6o/0m8uV4uWdcxuKy9T+MixTcxLBQrCLk8arYnYfNpWscoVVc8Qf4i3WhlOhSF4kkqVyGYWXCco7DQu+j5mk+vCPJPIY2g23MI074D4Qr9v55n7blaUN5yGHpnUqsvsxeuaI18ikJyIc2gdRJEHstNyFf9r+t6Xnb2DgzaZzSK38jxs0/3rQk6d68l9p66Cvft2bhduX7fpQZWd0vo0xV78169oOuG7dB3D5XK2G8FmduDr/9m9ytnhGMp/nxI8OYmFEKOgzq6kDL8dYtM/w/K9vf4P2tBYj92hgy7PtYin+byfRhm9c2XUyFGnX4nGekOobRLNhMGL79xNP19kRYVO6UUrPhvYb1rRdjJmM6dUlU33R0WXLQfsL8G65tvlzpbNdXToE4+tcXswKFtqgGmlp+CcJ756hD2aBAOWYqly0CFZlYXmhucw7/cJMvBxqJiQpGQiB6LqDJ6XNTnhv3jsslUSjRII1PUIREJ0bcS5lpXD5hbEzL86wA5EHDt6fL66uwM0zxmJ+vPl6LsobJ/0SGBu/oeqPR4o5S4K5du0YUSF+JZt27DBlD3VpRpiNwCmj0uA9AzIuA7TGJgFdH46rbvpCLtR4WuVIMxJBkYMSOZBRWV39B2div/0r8fAVQE693HqbsY434DHSH1zuikwW8tZ+tRZtWUnP7vPqdF/aZuXRKIc3XNTfnCc8OoHC2W9lEqONk9USc176eqb+zaoIvfyI/kBtqaTqF5Om+hvYubhAx1VK+GpRXRwNE4OZNVeUrhAU+SdaXQSvdDcaQt1f+gdSE2W/fCTDsUxcFAEcri91w0XErDXFK6PukzANlHBd298P95axDS09zRRes27Coc31NVaLHRNFj4qbV3qhh3wJ2l9+qK4QBbiffei79XxTNOpI1trU0qqeBbYM7IeoGSbgDoyQkjriy497wFJYvFVuSsakg2F8Xih2nG2hoDjmBWt7nWaMSqNM5B3cKT0PPfPO/g3OovuFhNW93406rr6NJ46Xi5zDBOHSeE22O+D+akgKFEN0e/lk8Q9LJ688BUHC1qTK5cEPDf+Vkn2+FtMekgowFxPY4lNnq7lZpVm7Sonl1drQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange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IEit8IW+ijrIeoopspK5TNEUkQp5L0Du11swSWs8KxinvpTKbRdubFOEVkMier/aNpkVcvWMKOfGZBTvXDX0iNBe7K4A69AhisJUmPzbgHS/k1V4tB6j/0iVGUwvoo2uSgrdKzmGSZ/4U4rWZC8ctLH1QUc+y2Y5vvBButt1eAM8Yb7zbKsWIp5p6BbV3+NavUCuTNXgWiOq/ijjBi1xUJWgyhlAmS3ZWOu0RqtkauqAHMG9yUe30+y3xlMp46ma0brc3mOVSe16ywrFp5Z4GArGl2fHoX8inZ6FgEMmQ/ezOTGuTiM07SMmtwxfCzZla/fa+qpmp9Nk7qW/zrIO6k9a42jTmNoE9ctg7Xdik7BmF7rbbd2/b0VII7b2IYuOFNOax1W63s3OlylxLuO27NxxAE+5u3SsAplFIY1yqM0D+IgSFWygHTWK4B4rqxhRuI3rDVhav4zI4QrZ7xe6zoYqOB520aTR2KErJ8no+Z1W1WB388iB6wPzzTYv0KivzPH948SbX+nsXnPUxj X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8034cc37-15d7-40be-dd97-08dcd95833a5 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2024 09:40:03.2218 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: big8yi1XP/Njvnq541znMQJHMHMvuO+mJ2MbC6Afoj5Myys9RZVLdyvUHkIL0ihYVjFZbW3OeM1IDsNBydBR8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7072 As per USBSTS register description about UEI: When completion of a USB transaction results in an error condition, this bit is set by the Host/Device Controller. This bit is set along with the USBINT bit, if the TD on which the error interrupt occurred also had its interrupt on complete (IOC) bit set. UI is set only when IOC set. Add checking UEI to fix miss call isr_tr_complete_handler() when IOC have not set and transfer error happen. Fixes: 26c696c678c4 ("USB: Chipidea: rename struct ci13xxx variables from udc to ci") Cc: stable@vger.kernel.org Acked-by: Peter Chen Signed-off-by: Xu Yang --- Changes in v2: - modify part commit message - add Ack-by tag - add fix tag and cc stable --- drivers/usb/chipidea/udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 95b697f08a76..e0092c735a75 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -2215,7 +2215,7 @@ static irqreturn_t udc_irq(struct ci_hdrc *ci) } } - if (USBi_UI & intr) + if ((USBi_UI | USBi_UEI) & intr) isr_tr_complete_handler(ci); if ((USBi_SLI & intr) && !(ci->suspended)) {