Message ID | 20230321210521.2806486-1-Frank.Li@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2018553wrt; Tue, 21 Mar 2023 14:26:44 -0700 (PDT) X-Google-Smtp-Source: AK7set/OwF/3FTCBSHT+UtTDosxTN/2/O5OCJI1fjfU2zQvqhKkpkju2e70TWbg+2bW8M7zhfV1r X-Received: by 2002:a05:6a20:8c16:b0:d9:7d22:71b6 with SMTP id j22-20020a056a208c1600b000d97d2271b6mr3819742pzh.8.1679434003914; Tue, 21 Mar 2023 14:26:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679434003; cv=pass; d=google.com; s=arc-20160816; b=sPizgn+rf28K7THhZ5Qeunk+ZJL5EYNtt5+xajUf4rrdXg0K22bdy8Al2oe6zJ0CZf 9jBip9DxmPbHxNMxAuMpkFODx4PUjUZ4h4X48HbuQB6oyduy9pSxamG8H/EujaTS5+bz ZvLcTRE5ToZulQz5lG1fIsPaqnHTxuf158Bah0qVodCpFKvrBWmBy5qeBD/xTdYVPUz4 MiyPBR4kTYhmsJNWE3a5b2ijRV9YRRiKVXXCuOMZUQCxboSi5S4YZymYjC7HJg13r/YZ N8lDrqO2xMOT30NFA4ZZB6Zn54oseJOjV47fN9rxMQzzAa9d8qZ1qYl9bQsCD1WhX9sE K1lg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=dfIMH94uN9Yr+x0ZqWlvL4rgxXRC9kwoBBw0cYLyNPs=; b=RLkgF9SsB6b7xOJeI0uJ/C9dJWWcFCFq5XDcewcvd3BrQc9c1Y9y2V46vw85YUX8e9 xhDotysF3fVNl3wGyI4kGZPcwxNZboaXeIUc+RnEMgHWm4VEDK2bF84YOQhJP1u/I1+q tMqUbw9j1Cm5u2q3RIhPvMZ5+UQqGy8XdamAtrupv/WamQEHx8gN0YMpEUVl9xOdcwan NykZCDLKDyu3QKjGQ3eL8FuLf8hCggOfrGY6tCqr8gvdA15Tjfj9VIgVM6V4/uxz+vyX 4Ck6LvLt59dKNmHwuYjEwFskS5up/Ivjuql9V64BqUf7jDkabJykRVtlWrqhQxIFaNbw G51g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=srBtuZBr; 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-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k2-20020a056a000d0200b005a8b3c6b5besi3132818pfv.254.2023.03.21.14.26.30; Tue, 21 Mar 2023 14:26:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=srBtuZBr; 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-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230115AbjCUVFt (ORCPT <rfc822;ezelljr.billy@gmail.com> + 99 others); Tue, 21 Mar 2023 17:05:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229663AbjCUVFs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 21 Mar 2023 17:05:48 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2089.outbound.protection.outlook.com [40.107.105.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A88457D2A; Tue, 21 Mar 2023 14:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HCJy9smisJkxPHR1NEoSdPHKj2d9kWQ+E/tGlI1NNMzMs3icnLkhb8takRfWHuIxkrb00Dseq0Ka7dOlul89/4/nEA6tVptuTMIMgOpnKE6oLdC34KY+fiCbsHLV0HXIJHUzmKn28Yd8efVXlUMfTzu1FgsU7syna3LAvhDQ9b/kn1hNSquMsRcjpSblVTQ/os0xUPqHR8fq3YayvZmifcORgyH6XCc5uSPT8P4jasnfDrCd8b9E2Stjv9rq/xLMcUYiP+vpstacWD4zEafEOE1/JW5N0mqw2lQ1WC2Z0mWoAcJ1TxEFfpi2VeQzxRd4Rr/H84WjtYL73gTnOowdcw== 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=dfIMH94uN9Yr+x0ZqWlvL4rgxXRC9kwoBBw0cYLyNPs=; b=ccwzsOaselWp0h6cto3+/yeGiJaGydfkZhv+i6vbxeWon0GCWAtyctK/oFSb7Ruv/E2kSNEHIaE+XE6Pb7y4Zvq6zwt7SCHW8sZwFEG0dae2+gXNkPAM7ZqPM7uE7mNSo2S+Z+ZTMDwjzDXMiz87JhOIqD+HZ7h0tKDbiKtPYdb3+Wd2YsmbHQf1NFODpdS1E1D2nTS5qVaVQZh1ykGECsmM2vBdgH5PZpuDeTd9ksUSE/TJHmaKUAdq/qq1T4y/UB3r4/mReC7bix9vgSLp8KtDH5M+K2vW3AVcC2z2zwLgegSWFlh0aIqMQDX+EJGEKEOxYksNUvonE5Aaxw3AHg== 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=dfIMH94uN9Yr+x0ZqWlvL4rgxXRC9kwoBBw0cYLyNPs=; b=srBtuZBr1jY4eUEaGg1YIxLiUl++6C2/kryJA0CmCZolW0XOZnYVEx7RdysppKiH90zP+cW6O4BBmUSmnWfoGJQyajvM9x7RNkirmYN9YD7uINipJRg89F7OAQayME9oa+KLMfibWxthyaR6ny9Y7nd3FZcxiNGZ6KlS6exP9t4= 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 AM0PR04MB7092.eurprd04.prod.outlook.com (2603:10a6:208:19c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Tue, 21 Mar 2023 21:05:42 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::fb2a:a683:b78e:b9b5]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::fb2a:a683:b78e:b9b5%4]) with mapi id 15.20.6178.037; Tue, 21 Mar 2023 21:05:42 +0000 From: Frank Li <Frank.Li@nxp.com> To: Peter Chen <peter.chen@kernel.org>, Pawel Laszczak <pawell@cadence.com>, Roger Quadros <rogerq@kernel.org>, Aswath Govindraju <a-govindraju@ti.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, linux-usb@vger.kernel.org (open list:CADENCE USB3 DRD IP DRIVER), linux-kernel@vger.kernel.org (open list) Cc: imx@lists.linux.dev Subject: [PATCH 1/1] usb: cdns3: fix super speed mass storage gadget device failure at imx8qm Date: Tue, 21 Mar 2023 17:05:21 -0400 Message-Id: <20230321210521.2806486-1-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BY5PR03CA0018.namprd03.prod.outlook.com (2603:10b6:a03:1e0::28) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AM0PR04MB7092:EE_ X-MS-Office365-Filtering-Correlation-Id: 919b5af9-94d2-46f7-65f2-08db2a5007c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hmMQI6nuDuEzdki+86rbaflg6DeKYsyiSKZj94rBGyqxqYP1QKSy6t38jE+yO1tAZFATmjKl9J8YcNH9mKI54Q1Aaj0dm/2Fyjxqa9Jb9rfnCUdq0J/dCJN75JpAfPIxT6iy3HX0MpeHXcjVOWT1c8dT8+yBcFO5NLqV7vUrtVm2i8h7aikUpN9Yv0EqW+jcGpFtmU0s3oebUDOZ3tLkRYlr0ocwO1da3pUAlWrXeHquNEVCZlsvYD/Ja2OfH0TCzEpGT2VKHJioMXd9Qn6RNiUCXy8lrfGkpXmlxgEwj8cyrdbysA6URoMU//PY91lR9iYwh+RWbuWkZcUmAHU9e3qaMwyxfyeLbXQGuxtaXoSuOpEM5MCf0CPSpiecwynU17u1nD83CXkGAYxAfvQZHfRMIngEoTLpkJcg6VUBFi6HhN59i/GNzUSP4o8usCRswj41Zu3LW3L2IrURCN/nFzXHUVn9Dl52Qe0KbgaNJsDC6YswMsxKVLoFImZ4H424DZ+Z+BBxCjaSEvw34VSyQ132dPUuUooIMOD8JZtoqf/IEVc9FmUKEyJEGJ9+joQjMERQZCTKfuYbFUtNymO/eYNZC8clx+wJe8rOKMfBin0QnNKi3mKoMsCL6ZH2AGkQw/Uuv8RsR8VrIvELaKQ6nbxEenbABT1KRL9MTE5nBLT79Nr92kIYzE0tn8/9Qe3wjpYyAMd/VH00Zr6FEgBDe2KWthPeC/oEoZfaVOkjM6k= 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:(13230025)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199018)(6486002)(41300700001)(66556008)(66476007)(110136005)(478600001)(66946007)(5660300002)(316002)(8936002)(8676002)(4326008)(36756003)(86362001)(52116002)(6512007)(6506007)(1076003)(186003)(26005)(6666004)(2616005)(2906002)(38350700002)(38100700002)(83380400001)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6jhIuWoQCzCTcKfJOPRbyzbTNPxIKFRgwUCeflW16jdfGoVV2dzp1B6AHKrtqKvqCfAKrwRW39CGWdIeVkalTqhy/VXuz9B6JRyjX/XkU6Xy2ybbs6La55CDu5ciEByQHxD9GGUR1/XSq4SdAzfp1RDq+UjIfbqCsaHpfu6+EWfeUccbjSyN2ToIgT8p/X4mcYeFAfGoJZZ4ir79pFvXmkBbnKRyot4GYYHZFaHhVpK1y6ILFogolmSPHzLg9ysUUxv6pXmucQQ/Xw+/xuOK12sIgd+DaDEE2onN7ujNjjOkXQSISc1wcIluiVIplNxCWV3D2J1m60hVNwIUraO1jl9GdwDY2JHYcjLwD15ja6NIqu4ZI1+4X8FjD/gEZg6d09nIS0f/KyLSTvCppRFPTIWhqdTcgXW3g/TWzGaSjOrRi7rXB3mQyo+cAT2nuMnmbRoLpNcgsaqTlyQ98QAsAXovcH4fJnMYFLEQPulldX5Bkfs2eim4ou2JaEOl9VWKTXKQljKci+EBd9ED1ffl96VAXt0SDp0LzAtwjIl8/f3dD/W6WYzyoxqJzdq/9ONqGqgR8RV/qgf+qgQdj3vWmGBxrYH4NlMV+XvGBIAqUfEIf+3JXUdSike4ZuP2mcHpghe+YxmnxTeJMHg1WyU4vX4Yy+13EaQsD+6r3zrgwAK/V0WovaZbRmmuTD2n1T8KvF9XTqDhY3UKuB9dZN+Hzx9O2sQewplE35+JSUj4qh8z3cZg+uxwJg3+wbZ2surnayJhDa+DbpGR+jwCq4DgNdw4AvKlNF8zSQzmHI/PdhRZ+8P+dzHPgGZTpUKErdIE/0or/YMDn2hw/xfvhELpYnQNOYt1oPyiP+zuzEsYjjTupkHNMpzzf8AsxI5/qGzpS+Y4VGTKff3G4tqZBmq2KoBvRhSbWoxPgNdNbmoVn846xjg3Q5LmMaM9eaflyZ1x85JhG6nEBbtfD6q/J/rQ2XGXx3cN+uxoDGbeN1smpPFbRWkhEOGA/B0P8e17pV+Zi0CUNOObP8k9nRfpC/5i9PrGec3zSIKcwLSk7ZwkqrpZ8Bt9Q6Dm9zKI0OIzR16aiIotIp6lMHavlCOMXBqTp5SlC1PrsLOfoI6cU/BLbLmigfzR+7YEo7Bdro+6fCVAtW5a5IYfQ7krIvw81uAHUNQuN/JGAU005acTiinlqVWx9msL6ANGUPqSSDZQUc3Nvoa0ASmrnS1VfiEFfUtsYQA7wsmhrqvSPQa6N4J+/0DE/6MaOkaJcIGmKnOXAPaRQAgfRJjQdQ2SYKdA/JUDn9K1jMTdAFgwzTgQVHVY5uf5cX9RfEum2x2kBScHK199gEO5wk/Aj+6roXVCIH+0UOAVilv9FTl5ChUbIOOm41+X6wn7bpmIZajEPncdlfuxY4bbuy7D5ST/ASCIBIQ0gbpy73LE1rwwJtaWQ85e2O2O/LF0XoeuuRVkj8B5/MyDnxkgNvbx/HG8GzdMMS2aVQLfMiHEdrFj0fO4x8zrzM+e554cL7KuPa0XsVPyeWk4+9EeNg6Rhj7unAfMY2elI0sFYzNjIeSlVjRuJLOfTrM0odUHzbxJBxeqIzmmtWrP X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 919b5af9-94d2-46f7-65f2-08db2a5007c9 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2023 21:05:42.1165 (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: 6k4U/JDJn1MYS4I7mInQsK/xNjxK0LsepiHgZZsKR/9ZFNvUfDeeWKDHTpYxbMddm23lryLWzfFI0syQpDijZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7092 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761014190046741223?= X-GMAIL-MSGID: =?utf-8?q?1761014190046741223?= |
Series |
[1/1] usb: cdns3: fix super speed mass storage gadget device failure at imx8qm
|
|
Commit Message
Frank Li
March 21, 2023, 9:05 p.m. UTC
The mass storage gadget has one IN and one OUT endpoint. The below (Fixes)
commit aimed to utilize all hardware FIFO to support composited gadget
devices. This resulted in an ep_buf_size of 15 when a single gadget was
enabled, such as the mass storage gadget.
However, it was found that there are unknown limitations on the imx8qm and
imx8qxp B0 platforms. The device would fail to work if ep_buf_size
exceeded 9.
To resolve this issue, this patch reverts to the old settings used before
the below commit for the imx8qm and imx8qxp B0 platforms.
Fixes: dce49449e04f ("usb: cdns3: allocate TX FIFO size according to composite EP number")
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
I hope cdns engineer, such as pawell@cadence.com help identfy the root cause.
Look like old version ip use more memory then what ep_cfg show.
drivers/usb/cdns3/cdns3-gadget.c | 11 +++++++++++
1 file changed, 11 insertions(+)
Comments
> >The mass storage gadget has one IN and one OUT endpoint. The below (Fixes) >commit aimed to utilize all hardware FIFO to support composited gadget >devices. This resulted in an ep_buf_size of 15 when a single gadget was >enabled, such as the mass storage gadget. > >However, it was found that there are unknown limitations on the imx8qm and >imx8qxp B0 platforms. The device would fail to work if ep_buf_size exceeded >9. > >To resolve this issue, this patch reverts to the old settings used before the >below commit for the imx8qm and imx8qxp B0 platforms. > >Fixes: dce49449e04f ("usb: cdns3: allocate TX FIFO size according to >composite EP number") > >Signed-off-by: Frank Li <Frank.Li@nxp.com> >--- > >I hope cdns engineer, such as pawell@cadence.com help identfy the root >cause. >Look like old version ip use more memory then what ep_cfg show. > > drivers/usb/cdns3/cdns3-gadget.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > >diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3- >gadget.c >index 5adcb349718c..497c8e87dabf 100644 >--- a/drivers/usb/cdns3/cdns3-gadget.c >+++ b/drivers/usb/cdns3/cdns3-gadget.c >@@ -3005,6 +3005,17 @@ static int cdns3_gadget_check_config(struct >usb_gadget *gadget) > priv_dev->ep_buf_size = priv_dev->ep_iso_burst = > (priv_dev->onchip_buffers - 2) / (n_in + 1); > >+ /* >+ * There are unknown hardware limition: when work at super speed >mode, >+ * ep_buffer_size can't bigger than 9 for one IN and OUT case at >i.MX8QM >+ * and i.MX8QXP B0, which report there are 32k memory. >+ * Rollback to original settings for the these chipes. >+ */ >+ if (priv_dev->dev_ver < DEV_VER_V2) { >+ priv_dev->ep_buf_size = min_t(u8, priv_dev->ep_buf_size, 4); >+ priv_dev->ep_iso_burst = min_t(u8, priv_dev->ep_iso_burst, >3); >+ } >+ > return 0; > } I'm not sure whether you have 32KB. I remember that you had a Soc which have only 18KB on-chip memory and value in usb_cap2 was incorrect. It was the reason why the on-chip-buff-size property has been added to driver. Please confirm that you have 32KB, then I will recreate such test on my testing board. Regards, Pawel > >-- >2.34.1
>>The mass storage gadget has one IN and one OUT endpoint. The below >>(Fixes) commit aimed to utilize all hardware FIFO to support composited >>gadget devices. This resulted in an ep_buf_size of 15 when a single >>gadget was enabled, such as the mass storage gadget. >> >>However, it was found that there are unknown limitations on the imx8qm >>and imx8qxp B0 platforms. The device would fail to work if ep_buf_size >>exceeded 9. >> >>To resolve this issue, this patch reverts to the old settings used >>before the below commit for the imx8qm and imx8qxp B0 platforms. >> >>Fixes: dce49449e04f ("usb: cdns3: allocate TX FIFO size according to >>composite EP number") >> >>Signed-off-by: Frank Li <Frank.Li@nxp.com> >>--- >> >>I hope cdns engineer, such as pawell@cadence.com help identfy the root >>cause. >>Look like old version ip use more memory then what ep_cfg show. >> >> drivers/usb/cdns3/cdns3-gadget.c | 11 +++++++++++ >> 1 file changed, 11 insertions(+) >> >>diff --git a/drivers/usb/cdns3/cdns3-gadget.c >>b/drivers/usb/cdns3/cdns3- gadget.c index 5adcb349718c..497c8e87dabf >>100644 >>--- a/drivers/usb/cdns3/cdns3-gadget.c >>+++ b/drivers/usb/cdns3/cdns3-gadget.c >>@@ -3005,6 +3005,17 @@ static int cdns3_gadget_check_config(struct >>usb_gadget *gadget) >> priv_dev->ep_buf_size = priv_dev->ep_iso_burst = >> (priv_dev->onchip_buffers - 2) / (n_in + 1); >> >>+ /* >>+ * There are unknown hardware limition: when work at super speed >>mode, >>+ * ep_buffer_size can't bigger than 9 for one IN and OUT case at >>i.MX8QM >>+ * and i.MX8QXP B0, which report there are 32k memory. >>+ * Rollback to original settings for the these chipes. >>+ */ >>+ if (priv_dev->dev_ver < DEV_VER_V2) { >>+ priv_dev->ep_buf_size = min_t(u8, priv_dev->ep_buf_size, 4); >>+ priv_dev->ep_iso_burst = min_t(u8, priv_dev->ep_iso_burst, >>3); >>+ } >>+ >> return 0; >> } > >I'm not sure whether you have 32KB. I remember that you had a Soc which >have only 18KB on-chip memory and value in usb_cap2 was incorrect. >It was the reason why the on-chip-buff-size property has been added to >driver. > >Please confirm that you have 32KB, then I will recreate such test on my testing >board. > I've made the MSC test with the following endpoint configuration; [ 6732.999537] cdns-usb3 cdns-usb3.1: Configure ep1in: with val 74000e05 [ 6732.999565] cdns-usb3 cdns-usb3.1: Configure ep1out: with val 74000e15 So, I used the 14 buffers per endpoint and run bonnie++ as tester. I didn't find any issue. Regards, Pawel >> >>-- >>2.34.1
> -----Original Message----- > From: Pawel Laszczak <pawell@cadence.com> > Sent: Wednesday, March 22, 2023 5:56 AM > To: Frank Li <frank.li@nxp.com>; Peter Chen <peter.chen@kernel.org>; > Roger Quadros <rogerq@kernel.org>; Aswath Govindraju <a- > govindraju@ti.com>; Greg Kroah-Hartman <gregkh@linuxfoundation.org>; > open list:CADENCE USB3 DRD IP DRIVER <linux-usb@vger.kernel.org>; open > list <linux-kernel@vger.kernel.org> > Cc: imx@lists.linux.dev > Subject: [EXT] RE: [PATCH 1/1] usb: cdns3: fix super speed mass storage > gadget device failure at imx8qm > > Caution: EXT Email > > >>The mass storage gadget has one IN and one OUT endpoint. The below > >>(Fixes) commit aimed to utilize all hardware FIFO to support composited > >>gadget devices. This resulted in an ep_buf_size of 15 when a single > >>gadget was enabled, such as the mass storage gadget. > >> > >>However, it was found that there are unknown limitations on the imx8qm > >>and imx8qxp B0 platforms. The device would fail to work if ep_buf_size > >>exceeded 9. > >> > >>To resolve this issue, this patch reverts to the old settings used > >>before the below commit for the imx8qm and imx8qxp B0 platforms. > >> > >>Fixes: dce49449e04f ("usb: cdns3: allocate TX FIFO size according to > >>composite EP number") > >> > >>Signed-off-by: Frank Li <Frank.Li@nxp.com> > >>--- > >> > >>I hope cdns engineer, such as pawell@cadence.com help identfy the root > >>cause. > >>Look like old version ip use more memory then what ep_cfg show. > >> > >> drivers/usb/cdns3/cdns3-gadget.c | 11 +++++++++++ > >> 1 file changed, 11 insertions(+) > >> > >>diff --git a/drivers/usb/cdns3/cdns3-gadget.c > >>b/drivers/usb/cdns3/cdns3- gadget.c index 5adcb349718c..497c8e87dabf > >>100644 > >>--- a/drivers/usb/cdns3/cdns3-gadget.c > >>+++ b/drivers/usb/cdns3/cdns3-gadget.c > >>@@ -3005,6 +3005,17 @@ static int cdns3_gadget_check_config(struct > >>usb_gadget *gadget) > >> priv_dev->ep_buf_size = priv_dev->ep_iso_burst = > >> (priv_dev->onchip_buffers - 2) / (n_in + 1); > >> > >>+ /* > >>+ * There are unknown hardware limition: when work at super speed > >>mode, > >>+ * ep_buffer_size can't bigger than 9 for one IN and OUT case at > >>i.MX8QM > >>+ * and i.MX8QXP B0, which report there are 32k memory. > >>+ * Rollback to original settings for the these chipes. > >>+ */ > >>+ if (priv_dev->dev_ver < DEV_VER_V2) { > >>+ priv_dev->ep_buf_size = min_t(u8, priv_dev->ep_buf_size, 4); > >>+ priv_dev->ep_iso_burst = min_t(u8, priv_dev->ep_iso_burst, > >>3); > >>+ } > >>+ > >> return 0; > >> } > > > >I'm not sure whether you have 32KB. I remember that you had a Soc which > >have only 18KB on-chip memory and value in usb_cap2 was incorrect. > >It was the reason why the on-chip-buff-size property has been added to > >driver. > > > >Please confirm that you have 32KB, then I will recreate such test on my > testing > >board. > > > > I've made the MSC test with the following endpoint configuration; > [ 6732.999537] cdns-usb3 cdns-usb3.1: Configure ep1in: with val 74000e05 > [ 6732.999565] cdns-usb3 cdns-usb3.1: Configure ep1out: with val 74000e15 > > So, I used the 14 buffers per endpoint and run bonnie++ as tester. > I didn't find any issue. Problem only happen at QM and QXP B0 and need work at *super speed* mode. Enumerate will be fail and continues reset. Highspeed mode work. I suspect 32KB problem because QXP C0 report is 18K. It doesn't make sense to reduce to 18K from 32k at QXP C0. But it work when IN/OUT is 9K. 9+9+2k(EP0) should bigger than 18K. Let me try Check IC design what's exact number in QM and QXPB0. > > Regards, > Pawel > >> > >>-- > >>2.34.1
diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c index 5adcb349718c..497c8e87dabf 100644 --- a/drivers/usb/cdns3/cdns3-gadget.c +++ b/drivers/usb/cdns3/cdns3-gadget.c @@ -3005,6 +3005,17 @@ static int cdns3_gadget_check_config(struct usb_gadget *gadget) priv_dev->ep_buf_size = priv_dev->ep_iso_burst = (priv_dev->onchip_buffers - 2) / (n_in + 1); + /* + * There are unknown hardware limition: when work at super speed mode, + * ep_buffer_size can't bigger than 9 for one IN and OUT case at i.MX8QM + * and i.MX8QXP B0, which report there are 32k memory. + * Rollback to original settings for the these chipes. + */ + if (priv_dev->dev_ver < DEV_VER_V2) { + priv_dev->ep_buf_size = min_t(u8, priv_dev->ep_buf_size, 4); + priv_dev->ep_iso_burst = min_t(u8, priv_dev->ep_iso_burst, 3); + } + return 0; }