Hi Frank, On 3/31/25 6:21 PM, Frank Li wrote: > On Mon, Mar 31, 2025 at 08:02:20AM +0000, John Ernberg wrote: >> Hi Frank, >> >> On 3/28/25 8:38 PM, Frank Li wrote: >>> On Fri, Mar 28, 2025 at 04:41:05PM +0000, John Ernberg wrote: >>>> On 6/12/23 5:31 PM, Catalin Marinas wrote: >>>>> Hi, >>>>> >>>>> That's v7 of the series reducing the kmalloc() minimum alignment on >>>>> arm64 to 8 (from 128). There's no new/different functionality, mostly >>>>> cosmetic changes and acks/tested-bys. >>>>> >>>>> Andrew, if there are no further comments or objections to this version, >>>>> are you ok to take the series through the mm tree? The arm64 changes are >>>>> fairly small. Alternatively, I can push it into linux-next now to give >>>>> it some wider exposure and decide whether to upstream it when the >>>>> merging window opens. Thanks. >>>>> >>>>> The updated patches are also available on this branch: >>>>> >>>>> git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux devel/kmalloc-minalign >>>>> >>>> >>>> (I trimmed the recipients and added linux-usb and imx mailing list, + >>>> cdns3 maintainers) >>>> >>>> Hi Catalin, lists, >>>> >>>> Seen on Linux 6.12.20, it is not trivial for us to test later kernels so >>>> if the issue is potentially fixed we are more than happy to cherry-pick >>>> the potential fixes and give them a go. >>>> >>>> Having an SMSC9512 (smsc95xx) USB Ethernet/Hub chip attached to the armv8 >>>> SoC iMX8QXP over the Cadence USB3 USB2 interface (cdns3-imx) will since >>>> the patch set at [0] cause random interrupt storms over the SMSC9512 INT >>>> EP. >>> >>> Do you know where buy SMSC9512 USB Ethernet/Hub? >> >> A quick google search didn't find my any dongles that are still >> available, however the SMSC 95xx series of chips used to be popular in >> USB to Ethernet dongles. >> >> Otherwise they are made by Microchip today, any variant of the SMSC 95xx >> should be able to trigger the problem. > > I worry about that xhci have similar issue with gadget dma. > > /* > * In versions preceding DEV_VER_V2, for example, iMX8QM, there exit the bugs > * in the DMA. These bugs occur when the trb_burst_size exceeds 16 and the > * address is not aligned to 128 Bytes (which is a product of the 64-bit AXI > * and AXI maximum burst length of 16 or 0xF+1, dma_axi_ctrl0[3:0]). This > * results in data corruption when it crosses the 4K border. The corruption > * specifically occurs from the position (4K - (address & 0x7F)) to 4K. > * > * So force trb_burst_size to 16 at such platform. > */ > > Let try reduce AXI burst len to help your case. > > diff --git a/drivers/usb/cdns3/host.c b/drivers/usb/cdns3/host.c > index f0df114c2b53b..200166395c09d 100644 > --- a/drivers/usb/cdns3/host.c > +++ b/drivers/usb/cdns3/host.c > @@ -24,6 +24,7 @@ > * with Cadence CDNSP dual-role controller. > */ > #define XECP_PORT_CAP_REG 0x8000 > +#define XECP_AXI_CTRL0 0x8034 > #define XECP_AUX_CTRL_REG1 0x8120 > > #define CFG_RXDET_P3_EN BIT(15) > @@ -121,7 +122,9 @@ static int __cdns_host_init(struct cdns *cdns) > if (hcd) > cdns->xhci_regs = hcd->regs; > > - return 0; > + writel(0x1, cdns->xhci_regs + XECP_AXI_CTRL0); > + > + return 0; > > Frank > I gave your patch a try and it didn't fix the issue. Since you mentioned trb I spent some time enabling xhci tracing and took some traces of each situation in case that shows something useful. Adding them as attachments since they are over 3500 lines each. The URB that may trigger the problem behavior is queued when xhci_queue_trb contains bRequest = 'a1' and wIndex = '0068' in these traces. * xhci-trace-bad was taken without the hack inlined in earlier mails nor your suggested patch, bug occurred * xhci-trace-hackfix was taken with the hack fix, bug did not occur * xhci-trace-frank was taken with your suggestion, bug occurred Best regards // John Ernberg