From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.12 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796300618; b=pz0lfjRN7+lWsMQ/jJI9k3yOD6yKOtgdad+A4ywH4TgMdFXtJqJ0f6yDG6zUuxW2m1oE nKnjklTtCCvIWMfy0KJugJVEbBpnIVSGDRuVh/l1rNOICp+zxvnqVv/9SY5U5JZCG9Lqj yXOp+ooie7cGgZBSISJ5uR09dDLuGVFu9PuR197ZiMfbG6Gx4uqWZfirljAGX8VzvWQPH gsMBJqRbT7pnLClb+HhO1dEQ1u2SQgKORDSEYgLvFYCWitDxzihjqCKiVABYtsddBlWxN xWBGSmfa37AVwWqpdz//6D9x8Kdp0nhMIKxQzwa5dEyJt3crqlsnaJGDxk7gjqnw2Rg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796300618; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language: From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=VLExobosV0+jnPDr5KR4qnJ2ArOnILvdfxUnpMEGFpg=; b=rKCkZ/k3Dpvw48BN5t4gSINZjz6C0zYjd8UkmsuAgrmD3pS/re4dvFpaYJJHZHdhsNdF 2l+Oeih4zIRSYK92k1DjUG6nZbYVDUkX2+6Lks+oFfiSFfY7eg2g3UiUY/zW1E6ap8389 mYgrIFkAIoqxntpb+yXnljzvSTJ1zmp4xsnMfkg8Mq20HMP3Ze9mnF7mhokP514cY2h9D UuhyLSJ+d6YnlZKj0qgzw/ucc0HP9G9lcAjOBBSP61jCB6+mdXBGAOeqvzaGj7MJJLRqr qgm/KRl9dAjFJYEqZ1hk2xAUgOc2vCRjIZRj/GuBBSacByYIcb0Du8Fem9FXL4Ce6SQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=eXwWmsZf; arc=none smtp.remote-ip=192.198.163.12 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 542C5606A32D for ; Thu, 3 Dec 2026 12:23:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 542C5606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=eXwWmsZf DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796300618; x=1827836618; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=VLExobosV0+jnPDr5KR4qnJ2ArOnILvdfxUnpMEGFpg=; b=eXwWmsZfP/CWLDaLZd5TKuC/XyJqESaN09FBN+PhXWnHo9pXpw/krVFm vLVm9JB9HHvIrLc/35l5qkEzfufJm23J/44NmIgFAtZJ591y2kPypkeTf kKMzmnl5kz9FEvtsZTRpOQVBYtvYAfQWrREdsAbsdz37D0qZ4Gn+k7IIT 8/xmEpjAaySKpETiS4Wt872nby+n39bS1wnbRufaCxfQbl2/TOHJEDQHn Qj+o6N92+IuRnlypxmJQZdissXP8t/5DBpHPSlby2p490t6Eb6uOG1Dkg 9U4Ywu2WhxfRgFEAdbh/ry4jhLihFyA1OFtnDXCi7p/p4XJJuU7YOAjxv w==; X-CSE-ConnectionGUID: LRCqVZ3nQfy6oDCwuqy/3g== X-CSE-MsgGUID: HHtRYBkfQ1SHkZhAJQUmSg== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5161628" X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="5161628" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 04:23:05 -0800 X-CSE-ConnectionGUID: eLDctTGcQn2tISru6gpwXQ== X-CSE-MsgGUID: +HFjEheLRF2paBOBVaEujw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="14306721" Received: from klitkey1-mobl1.ger.corp.intel.com (HELO [10.245.244.95]) ([10.245.244.95]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 04:23:03 -0800 Message-ID: Date: Thu, 3 Dec 2026 14:23:00 +0200 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] usb: xhci: Work around the ASM3142 bulk UVC bug To: Michal Pecio , Mathias Nyman , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org References: <20261202101200.726fc9e3.michal.pecio@gmail.com> <20261202113051.7587a314.michal.pecio@gmail.com> Content-Language: en-US From: Mathias Nyman In-Reply-To: <20261202113051.7587a314.michal.pecio@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/2/26 12:30, Michal Pecio wrote: > ASM3142 occasionally generates no event for a single-TRB bulk TD which > is directly followed by a Link TRB. This affects USB3 UVC devices and > makes them stop streaming within a few seconds with logs like: > > Event dma 0xffe5e000 for ep 6 comp_code 1 not part of TD at ffd0cfe0 - ffd0cfe0 > Event dma 0xffe5e010 for ep 6 comp_code 1 not part of TD at ffd0cfe0 - ffd0cfe0 > Event dma 0xffe5e020 for ep 6 comp_code 1 not part of TD at ffd0cfe0 - ffd0cfe0 > Event dma 0xffe5e030 for ep 6 comp_code 1 not part of TD at ffd0cfe0 - ffd0cfe0 > > Only one line appears if the Link TRB toggles cycle; it seems that the > HC fails to toggle its cycle state and stops processing queued TDs, but > it ignores cycle of the first TRB in the segment and produces an event. > If subsequent TRBs are stale and match the wrong cycle state, the whole > ring is executed again - reliably triggered by keeping 2 URBs queued. > > Regardless of cycle issues, the first event is always bogus - a canary > pattern written to the transfer buffer survives, while canary of the TD > which was passed silently is fully overwritten (short transfers appear > to mitigate this bug). The link target seems treated as chained to the > completed prior TD, although no chain bits exist anywhere on the ring. Could there have a been old chain bit set from previous cycle due to splitting last TD over the link? Does giving the Link TRB to HW immediately after the last TRB help? i.e. always call inc_enq_past_link() . I noticed that the buffer in that last TRB ended at exactly 64k boundary, and was also max packet aligned. Was this true for all those cases where event is lost? > > The bug doesn't affect drivers that only keep one URB queued at a time, > even if xhci-hcd is patched to call inc_enq_past_link() after queuing. > It seems to be triggered by fetching a TRB with current cycle from the > next segment. Keeping 800 URBs queued in advance and skipping ringing > the doorbell doesn't help, it looks like an internal race. > > Multi-TRB TDs are also affected if they end before a link, but chained > links in multi-TRB TDs are handled correctly, including cycle toggle. > > It seems this can be avoided by ensuring that no TD ends before a link. > If that's about to happen, insert a No-Op TRB to shift the TD one slot > forward so that it ends in the next segment. No solution exists yet for > cases when TD fragment alignment shortens the TD. If we fail to stop > the bug, prevent execution of stale URBs by adding a No-Op before the > next TD so that 2nd TRB of the segment can't be stale. Would force-splitting a TD over the link TRB then be an option? Requires original 'last' TRB buffer size to be over a max packet. Thanks Mathias