Message ID | 20231224153816.1664687-1-Frank.Li@nxp.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-10733-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp8433dyb; Sun, 24 Dec 2023 07:39:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMpjZu+O2MbKEbKdbAgVGLbe11Qb8ZJ3Xh+kvVaQt4X3dZqMKTtHS1+G9GuiClez35xG76 X-Received: by 2002:a50:99d0:0:b0:551:e53b:f0fd with SMTP id n16-20020a5099d0000000b00551e53bf0fdmr2877543edb.53.1703432343942; Sun, 24 Dec 2023 07:39:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703432343; cv=pass; d=google.com; s=arc-20160816; b=WAvO9dQ0fTDSWDKDvZcCipuJV+haSZHTXcvinqmewDFHxgBiQZb2yMY66F2CTmqCcl 4HiZOjC3cpKlGYdT/X4JEICsGDDLY3XPWZkpPEHOcFTMAWWJ9YzUUaW91sGqzXtzsboK erbIh1GewJKz1kAkJCzUhCkQxcpCY6kdZvqt5nnds5EwywMN0xBYweB1kjJztdwHU0fE VKVhO7HhUANzERw4XxsWskUpy79trrld3hLdwEwLZ2bLrjjen0OzHIocD/WHIZ3hhV84 vpkAyrx/cqZzjNeKRmOAsf4PdtTeOzhyKADZgu1iu+AJJwow+DcJ23B+e8H9zVoOqwQX GNkA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:message-id:date:subject:cc:to:from :dkim-signature; bh=Zn656wf7jWRtMbaJ0yciWoaFHp398qLzkH39Y1NJk/4=; fh=K3H65qk/rvbT+8X03yi288eW/JaOO1Vv11n/dIWnYFs=; b=OgO0TsQdcRzOmU6Op0bKb1ZiC7/e/d6bJXaUIhnAH74iN5Jn8IsrxiW4ti68w9qQ4G gnG1aIZvH64KSCKtkStTAeSUXRQFPD4LEFjRZFMkjgjJZZ8wWtXKIJ9YDDR6tLkBsRaf e2utuuWnkdLocHMXIKnlRf0cQ36TEIgeUvF1gDqT5wWxOHtxQWlqnRtUc+M8MDzFjbqX z4vELZQaZdzGZEmfZ2fh+CL0zAlQgE9j6q2m0qjXl1MtcCZ4tL31Na6rvy9Cvj/gQdii Hv8Ufj9sio6NNCeqquGMF7IVOgm2hJ/tc8QDbkE8Hgtry5aINWF8DLUyk5aa2R15SOC+ 0KwA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Kwg0wfts; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-10733-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10733-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d17-20020a056402401100b005547c1890d8si1898730eda.90.2023.12.24.07.39.03 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:39:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10733-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Kwg0wfts; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-10733-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10733-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 39F511F21234 for <ouuuleilei@gmail.com>; Sun, 24 Dec 2023 15:39:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBA2ECA7D; Sun, 24 Dec 2023 15:38:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Kwg0wfts" X-Original-To: linux-kernel@vger.kernel.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2084.outbound.protection.outlook.com [40.107.20.84]) (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 27B81610D; Sun, 24 Dec 2023 15:38:36 +0000 (UTC) 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SRXFw9IPx3a4wJxvGwD1oliOcrgf8dlUBehwU9r1sUjLZZYh0krg/ZRjAcbfM8wCv6dQGJZCS/nn49YZlqvgk7TItNt+B7EcSdHLajVRCdhtTil2Emp+y6DNlAeUtzWyvRQ3OhdhvqAUFBTY/voXVSrgFjmg4qoMA+W+S0OU4wcMUZl2QDoaBb+vjBbGESle81ZUOdCnfwazebJixz6RNliw/EX5kgA4jdRaUgRnrb3aYh1Lt62sHq8q4Vaf5DRCmWgdjqQSM77gyeu7KV0cGHBhrTYyC7d2glOwOD6FzuoGoh/L+SPml70i1B3E2O5+d2UTK91qy2A93UW2fIMtrA== 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=Zn656wf7jWRtMbaJ0yciWoaFHp398qLzkH39Y1NJk/4=; b=DTM5DGEV2tkKHlRqB7yjlfAvUCBTf5mFyq6/4GmdeLMokcCX/n/fsXOJzGxdvEoWfdE8mBJOtG5i+Z7CTrIYsHTW6XzJGY0CS8r3ZRPDDa2K6RzsNsxGRsUmzh2kEr4XTIB3jtOo9NMG5JmXrBz4OYKtYIQ0WVT/Wk+i0AZLVnjKUtp4YvlA83O6stfmy6iZqjD4IkqyfxH/yH0CGb0cXRXqExgg7q+ZXkNcytC/iUFdIqhgQ/QZv+Em+e1AZeUmx1AbosuNzGm8Fewm79dkd/2s8sIHNqAHtxYmxrpRSl6JC9cArtTZAt/jWU/ftGTtEJ8UGN0KH8PemtpcpRUk+A== 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=Zn656wf7jWRtMbaJ0yciWoaFHp398qLzkH39Y1NJk/4=; b=Kwg0wftscqtc71b/AGuLNbaSUwg7WKUnYpdvvPIFYwRKvAePwcyhBiLURCCPiYHucnlFxA08h1xBMKWrYM9bHl6QhE09/BTPMllmZiJg3FzW2SVnajCxHNPHvPJzL7vBZIRRtJCkn/J6YLBulGCrYXyh88IFDZkBzIk3cVwuBf8= 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 DBAPR04MB7285.eurprd04.prod.outlook.com (2603:10a6:10:1ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.24; Sun, 24 Dec 2023 15:38:34 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40%7]) with mapi id 15.20.7113.026; Sun, 24 Dec 2023 15:38:33 +0000 From: Frank Li <Frank.Li@nxp.com> To: cugyly@163.com Cc: Frank.Li@nxp.com, a-govindraju@ti.com, gregkh@linuxfoundation.org, imx@lists.linux.dev, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, pawell@cadence.com, peter.chen@kernel.org, rogerq@kernel.org Subject: [PATCH v2 0/4] usb: cdns3: usb uvc iso transfer fix Date: Sun, 24 Dec 2023 10:38:12 -0500 Message-Id: <20231224153816.1664687-1-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR11CA0058.namprd11.prod.outlook.com (2603:10b6:a03:80::35) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DBAPR04MB7285:EE_ X-MS-Office365-Filtering-Correlation-Id: 00ddd024-24ef-4122-b2af-08dc04966336 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LwSF1GBeYwVHRlEmGazblcWv42DrtLXl9839kpDnM27Fhvxs0AeuZH3pmGKevCAN75o2pFHzD+bSQVusJipj31w/VOS6QJCnAvqat49OcDIlGSOAoLTMYwrifkxEIDfDtP63ewCMHlAJqYbUfLiPt0JLmyL0hh/vFPV8FqJfIlPItE99GXKOezq7fAQTtGIcjap4/GC6sJ7ZY78XRbTOJQA5LOcUOeVSZPVbJmc71qzXIY1WeXMKw4P/zZJIRXI2SCMYA67yUpaWLT4Oc7UCQrIhZIfMRBlAL7+5YJcse3qJCvclOqrq50TgcqGsoFK4oJbnaKojFMdXAp6KhJTTeBZd4ogbO8aNRtnB1GxFK8hqpe8OPRkFFrRPnZX1oriXo9ybakPn0t/M39tY4tReL+b30ze1yeHEksCydPeLJzkQXTBOeXovNjHUNF8GuchGOSid6FIh7BqRfd9rotd58uZHcoPsfaOvmm55dooGuOPO2RhSw34TPCVQAJODdrWxim7FBVTnKXY7nRUrIl8NrjMVClKS85s0jr295yrmqeHJpPxkSmrznd6TY7oFocOM0B9eaaorTCkq0/nTRLnWF2HYhawZxqCss1olTQRmoncLUrEMlNAzE3CTR4qKC7FZNZoOqwQ6OBfCYP01dUVp8g== 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)(346002)(396003)(136003)(376002)(366004)(39850400004)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(66556008)(66476007)(66946007)(38100700002)(6916009)(316002)(2616005)(1076003)(26005)(4326008)(8936002)(8676002)(478600001)(6486002)(83380400001)(41300700001)(52116002)(2906002)(6506007)(6666004)(6512007)(36756003)(86362001)(38350700005)(5660300002)(1491003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-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F/KKwuW1rjbJjBXCkcyy/90d0iqUP+C9RGgwvM4Q4P59rmKukQedj0AWa3CZKIGoFzu0XkpDrUoPoTWuVM8138rfNbHbDsLNiJkjKNgqKDEXvd0JGYZ6aRGOE8qq9+TMrbzFMkuzV0bcbdYMuRwPIdWQrTjJnmJ9RAtQAqHJuB8zbsWENZTM3hy69l71OkSK+IPDGsP+ljY6ZqjtncIpBx+O9LawCaVQNJ4Fe4MJuDjd/NCB2bKwBsd9qg+XkPKYMYvWsx0Shz70yTnhvD4Rwc7Wy3TulmyJ7cC50FRW31OO9dCNcOydI1vRClD1VohOvEd2jJnaMp///c+ArYxaVjWm8HOJSR2X9QKvDX+aBNOE5MraopuFBLWPjUUKwLTaQYxoHLy9E+LicF8F6qvihjk38+AwIgv6EfT76/BQlss38kQr3Kg7Yzi+H6dDml6/9cbW67l7n2wMTCScT0mDWh7+4w3BLVyf+ivx98F6h/dmPcZ8dA0D8SISmXAAZ4DGio16X4Muj0hxuOw= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00ddd024-24ef-4122-b2af-08dc04966336 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Dec 2023 15:38:33.8507 (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: xI/OnEkr2WndQJdZ8g3lWq5T/J+GjBTKikiftf5dIfxQRUUy8snRcP3MSEjw3TZlffaLYow7Gbbo1A2b+uSe0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7285 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178273278420108 X-GMAIL-MSGID: 1786178273278420108 |
Series |
usb: cdns3: usb uvc iso transfer fix
|
|
Message
Frank Li
Dec. 24, 2023, 3:38 p.m. UTC
Fix UVC ISO transfer since enable sg. The basic there are 4 major problems. Problem 1: Previous code have not conside sg enable case at all for ISO transfer. A typcial UVC package is UVC Header: 8bytes UVC DATA: P(1K,2K... 3K) - 8 So need prepare two TRB for this TD transfer. CHAIN TRB DATA TRB. Hardware will fetch it when get every SOF regardless IN token. So driver have to dupicate it to interval. for example, if interval is 4. driver need duplcate 4 times [CHIAN TRB] [DATA TRB] [CHIAN TRB] [DATA TRB] [CHIAN TRB] [DATA TRB] [CHIAN TRB] [DATA TRB] Hardware have limitation, LINK have to be first one when ISO transfer. another words, the below pattern is *invalidate* [CHIAN TRB] [LINK TRB] [DATA TRB] So need insert some DUMMY LINK TRB when close to end of TRB list. Problem 2: When mult and wMaxburst is not zero, EP hardware config need match EP descriptor, otherwise some data will be lost. for example: if mult is 2 at EP descipor, but hardware EP_CFG is 0, only 1 package will be transfer. If 2k data lost every 3k data. Problem 3: Look like hardware have not fixed cross 4k bound problem at 8QXP for ISO transfer. If dma buffer + length cross 4k bound, DMA will fetch wrong data Problem 4: Latest f_uvc.c pass full speed descriptor, so missed mult and wMaxBurst information, so cdns3 check_config() have not reserve enough internal FIFO memory to ISO endponit. Linux and ardroid UVC test passed. NCM/masstorage test passed. Change from v1 to v2. -Add comment at f_uvc.c Please more detail for each patches. Frank Li (4): usb: cdns3: fix uvc failure work since sg support enabled usb: cdns3: fix iso transfer error when mult is not zero usb: cdns3: Fix uvc fail when DMA cross 4k boundery since sg enabled Revert "usb: gadget: f_uvc: change endpoint allocation in uvc_function_bind()" drivers/usb/cdns3/cdns3-gadget.c | 142 +++++++++++++++++++++------- drivers/usb/cdns3/cdns3-gadget.h | 3 + drivers/usb/gadget/function/f_uvc.c | 18 +++- 3 files changed, 127 insertions(+), 36 deletions(-)