lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230321210521.2806486-1-Frank.Li@nxp.com>
Date:   Tue, 21 Mar 2023 17:05:21 -0400
From:   Frank Li <Frank.Li@....com>
To:     Peter Chen <peter.chen@...nel.org>,
        Pawel Laszczak <pawell@...ence.com>,
        Roger Quadros <rogerq@...nel.org>,
        Aswath Govindraju <a-govindraju@...com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org (open list:CADENCE USB3 DRD IP DRIVER),
        linux-kernel@...r.kernel.org (open list)
Cc:     imx@...ts.linux.dev
Subject: [PATCH 1/1] usb: cdns3: fix super speed mass storage gadget device failure at imx8qm

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@....com>
---

I hope cdns engineer, such as pawell@...ence.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;
 }
 
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ