From patchwork Fri Oct 27 18:39:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13439044 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 56AF83D3A1 for ; Fri, 27 Oct 2023 18:39:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="JW+j65J6" Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2040.outbound.protection.outlook.com [40.107.8.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4689712A; Fri, 27 Oct 2023 11:39:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jYY7sE0sVKrf3YsPB1FPW3f9Ch1aUCpcDtA8+icdz3CYGaIq+X9xGS9PKjgBRGnXzQ49LUK1kqbsvNTzOip4IrtgeYthyzIr1SnqC9RTgd4zEcxsS1UVro6WqTlECCz6AxfBLi+xTZSk6iWT6LdNomrmvtTct7DQIwxva6M8Z1XMfKgBX/td3Wkb5lNuBYGFcdavOlqxIQH+RuyHeVlXTZNY097yhaHbOTwNMrINScPIkcH02BYlMt5N+r9QXCegCzahN7sSSlKinlI9+3KMf3I45xqaTY0WrPFZKGqt/e2Jq0bP0SZKDACfUREjctQW55PPkWhh6Pm0oVjJV3Sx/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=a1ZQ1XvEkrhkMMzc+DSUrXBJnED9qfMmknHmI9nD9MM=; b=WaSQl8QAfgr86Q0TR2W+/a6s6mCtIY0hgDINT1dTMPB52s4M5vv3meQ2tvqXu4lgV1u8/+lEVxFxdx1QExA9OPneP4MgbIUIhGafCxyfRz2orZJiIGZ4vEedU7fESCT3341oEFIuuUXfQVXNJL1jhmNBJBsqITicZ8qVxULSr6C//TMVcCs3bRGY0Qy+xCSQoC2TlOjTLoxI/HyToZUUzzdJZ0TLoyqK9U4PUiBK8ELAoIofq18kEWLEgCUxrNFByFgVGbyv1j9MHnHN37yYS7Nh1GEzk+ZaTimRwHN+F74bSVOFyIDjxMuqDPbABir66lUm0q9as1kBAu9Me5NNbw== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a1ZQ1XvEkrhkMMzc+DSUrXBJnED9qfMmknHmI9nD9MM=; b=JW+j65J6WAR/v9MU3JVspXn+C49l7iL5YWE/NR79k3301X5HwEtwse33l5Oi3UM1oVtf8qXBR4GGzpMSroulJHzFTMyQmg87EDl54MVtpDEsBEdPQHl6JcZiWwx0XLqAQ3CR0w5pEhHUdG/VpL+LUbv6uOnkFodwqfFjjqsNJrs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DU2PR04MB9196.eurprd04.prod.outlook.com (2603:10a6:10:2fb::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.11; Fri, 27 Oct 2023 18:39:32 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::97ca:a905:8e64:c098]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::97ca:a905:8e64:c098%6]) with mapi id 15.20.6933.011; Fri, 27 Oct 2023 18:39:31 +0000 From: Frank Li To: imx@lists.linux.dev, Peter Chen , Pawel Laszczak , Roger Quadros , Aswath Govindraju , Greg Kroah-Hartman , linux-usb@vger.kernel.org (open list:CADENCE USB3 DRD IP DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/1] usb: cdns3: skip set TRB_IOC when usb_request: no_interrupt is true Date: Fri, 27 Oct 2023 14:39:19 -0400 Message-Id: <20231027183919.664271-1-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: BYAPR21CA0030.namprd21.prod.outlook.com (2603:10b6:a03:114::40) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB9196:EE_ X-MS-Office365-Filtering-Correlation-Id: 68056964-25c0-4e95-1166-08dbd71c0f10 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uh0fNC6eVvdI46Dc3fAwey3TsNbhduWDUtyLrdJDmzgomAoECMK0mXElI2AJU08CYOXXKIR2Wytb9iPGANLo91Mtx8Z2wpcX0wrf3PtIKwhI01XYxmuVPJEr+oxep9+rF3k/PFmBWbgyXF/cOeqUsqaEC///Bgrgulrc/pVmcA9Mv39LUwMdt8Huv5lnzPyF+AiHjsDyDCIY3Vvvw+81UQ/1CN3/h9wTTfWOgHcZZehuV/gaeuH5mv8zJf9Sc2fsVUQkUeY+Bbk+3CehnfAPC1K3Zo8T7wGT5TyUAN2utExioR9ydyDQzBH2PRDstYKMCKzkQeQdd+4CwUeED4OO+eYwmvkELxJ0FpztUXtO+yq822sLElwPPXDE0l5HBSaUtaZ3dMn/lC0heeDd0fsOz9O0jKRT13XdOy3uDfM+CpOQJOHPnAMdmLhznIkiZlVos5PJKkgOSq0TWcNPFeOH+ybtKJLfn69AWHIb3upMczFtfMUGxbrXbOS0IjvlVuvVqtLUx04OmNkHPhiVt6n+E0yrDYIb8dmgvVRrixrSO+mWiQB5IUwlg0jAsZGWLV73pDjGg6fnBJhoZyx9ga+8tjQptyhMNEzyHiM0ECgCPAOgqVc7oq/6QNkPLciJLTjUhejs1cN8geX9iDfACDKuRKmsfmbum8XuT84iAQAHZ2I= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(396003)(346002)(39860400002)(136003)(366004)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(1076003)(26005)(52116002)(2616005)(6512007)(38350700005)(86362001)(36756003)(38100700002)(83380400001)(6506007)(478600001)(6486002)(6666004)(2906002)(8676002)(8936002)(41300700001)(316002)(110136005)(66476007)(5660300002)(66556008)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TQuUYNF+QwDTojnCqVsBeZmDUrJS7t8Cx7Qbz2E3fLBf0enZWR2liSh4oJ7Xqptgfz00uZ2s04oKJ9mpEuSGmWBTbwvXAlsO8R9vIjxsYnHk9thxNNbB714OnBD8JfWOLk8MHpOQzGP4/ErVaG/nItRdrpXTe1OM1AuQLRU2iAetsz1mR7eiqAkNkoBHNDScZvtovhvOXnM6VleaACB6lF1lxhGP2kQyj+WeberiirQKQi+95Y9XLiT3kFtE8qCg+gYA7+N4aUwsjK3aQc1ZEZtMWb25ywNeqSHfk2P9ZNaK09+m8hTHX//wF3WYiAFVhkuDhrX58u81bKmGhPcz3vk8lvf9ih5fqcakV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bxG/kMT0BqIlAhDO4ZOVDdAVtJRGLHK/+qoIQSSiIJj+hwwMJkWsvC/wBedn21nVrF1G7T9N/B+17BUqd7DaVWzZTmDXpatrkykhR5DT8K7uP3cGO/zu76lpGwJgQVLqz+1l7wp+nE1P4339b4yKbeBfWjtR1a X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68056964-25c0-4e95-1166-08dbd71c0f10 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2023 18:39:31.8586 (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: Czg2pLSrutwGmDMzA5u7SiCTWDfPwrfUwGivTUPVsdfEFVYeqSLBmppACtDJlwnL7OkIBcQ9RxSMLGmgkt1pWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9196 No completion irq is needed if no_interrupt is true. Needn't set TRB_IOC at this case. Check usb_request: no_interrupt and set/skip TRB_IOC in cdns3_ep_run_transfer(). Signed-off-by: Frank Li Acked-by: Peter Chen --- drivers/usb/cdns3/cdns3-gadget.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c index 69a44bd7e5d02..cd08897f8da8b 100644 --- a/drivers/usb/cdns3/cdns3-gadget.c +++ b/drivers/usb/cdns3/cdns3-gadget.c @@ -1124,6 +1124,7 @@ static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep, u16 total_tdl = 0; struct scatterlist *s = NULL; bool sg_supported = !!(request->num_mapped_sgs); + u32 ioc = request->no_interrupt ? 0 : TRB_IOC; if (priv_ep->type == USB_ENDPOINT_XFER_ISOC) num_trb = priv_ep->interval; @@ -1233,11 +1234,11 @@ static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep, control |= pcs; if (priv_ep->type == USB_ENDPOINT_XFER_ISOC && !priv_ep->dir) { - control |= TRB_IOC | TRB_ISP; + control |= ioc | TRB_ISP; } else { /* for last element in TD or in SG list */ if (sg_iter == (num_trb - 1) && sg_iter != 0) - control |= pcs | TRB_IOC | TRB_ISP; + control |= pcs | ioc | TRB_ISP; } if (sg_iter) @@ -1268,7 +1269,7 @@ static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep, priv_req->num_of_trb = num_trb; if (sg_iter == 1) - trb->control |= cpu_to_le32(TRB_IOC | TRB_ISP); + trb->control |= cpu_to_le32(ioc | TRB_ISP); if (priv_dev->dev_ver < DEV_VER_V2 && (priv_ep->flags & EP_TDLCHK_EN)) {