From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B05132E692 for ; Mon, 4 May 2026 23:33:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777937600; cv=none; b=VugGZccyN4Q6y0FetEkoBzLbohMSpg7wr7uupAzSseeFF40YuzR/TlNqDwnIrJto887PTz/TSfjcbF5V5YmUhOmuPj8izp3bnx/PEot50oKymkE2g53TOJGQHYHJfypOKJF/1Nh0w0hWtkPxLGkVEJkI4HfBE/HW4GbRF5TJtQ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777937600; c=relaxed/simple; bh=AioJGV7TX2w4sVAACa4CrG5P+lLY/aPz8hTWSVEtUaY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=OgMDImM1apuzKX43mGS7gPdSvrsmKFgRG70YsMDqKBRDcCO04MS3UreqF8qp7obuHXihxcfulYNd1LG/0XOQc/IhZHmY5g0VA8xmZ/lEl6twFtdKos/S/9NiZJtIdlSAT6QOz7maXZOKqUn0BmbUHIuuB603HW6b4xMpeHK2trg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YjQOt1RK; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YjQOt1RK" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-67c2b4809baso4033938a12.3 for ; Mon, 04 May 2026 16:33:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777937598; x=1778542398; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=4hnTA4iOvao+u5kOBZqTjREvzFNShYmOaT+yI41pmjU=; b=YjQOt1RKMvgXQJpmh/S0as0Q6V50Aditk2IKAi0/PhPMennogpPqYihwSzbNSagw2A 7ngrJbgveSyMASBLBnC9QGaDXC7Qt2B9QW46Vq/nRQpUuM+J3uNaQkn8tj8RR8hAiV3b N81FU9ls9tX14FyIrFgSXzha/8a0V/H+aMnGNrK1cLQRsCSpzaeVG/Kuz4e0cIcVMhjH 5emgxT+Rhuf79euG7VCYF1ToVcgyz4rKGSFKWszhXlRiNCzz+pEsz4zUGpjEQNsVmIq0 qwSNw7IAHSqvI2bIIrhGZazD2nu7JwG7HzHdDXrBEGaXiJTB0E+CoYAYQeO+pp7WAsAW UMLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777937598; x=1778542398; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4hnTA4iOvao+u5kOBZqTjREvzFNShYmOaT+yI41pmjU=; b=MKZw+UR9iTjbjucPIWFvufNvYV5T3ueM6oJnNtgx8rZrAw5bU2qypFchShif5IcEOQ MlInUBgWTCf1Njz9i7q4nI83bp3USOizBBOfEGlFaATgHh9cJcKpTteBkrCGGs8qk8nt tLhnqcHG+o4vETcXB+We/fE6t5ByYGeGGTMW/54D1EV+WQ9E0PR/orMOkTnyLb5HiYR1 +qpqS3dh00x3vvDK6Gq36uF9ft9PWM6w36twNo4nkc4kLXhG5riWr3lSpIUvNRq0xJpZ 94kk8V6loiaKqi6WzyvIqj03dmL32ZvFPH4sOeUZcjzsCnTaRuVUIr2AQvX7+HeGAD0F FaWA== X-Forwarded-Encrypted: i=1; AFNElJ/kBCfAp06PBdEjJ8zHjA6wG4j0wSW9nsmunpbg+g0zYsKvjMC5HTt3K7pH3RnFW4mB2Hu+DJclzvaCsLQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yw2bdlf7Mu70NXgMwb6EU6xkyraPVPY1cCIDHVRMr0P8OW3JROn F8JpHtzwgfh1klA0WVjL3IuAc1snwe6iKT9tlDHPVOoZFxiv/EC5nHRA X-Gm-Gg: AeBDievO3EbzCOX2RpgccTi+w2Fqxxq6ZkKLqgMToeruRLO0SDIGEd3ipv5fAoyiwzx cy1zdKSBBraMWy+pOIH+kxsMfU25pqz7KNxqBE9bdXKwJd/wXinIbjiIMU2tuMBt8YdXqGYwo9W dm1IEsECmkeNV6dxGvN7O86X0u0DtXjlo6NuFFdtpwKEWAnSI6yctN4G3Meu7Q4HRhZLWjBB+8D MET7V432uauiUke60qLzUoEnAeTZE3nMlI9NGdj4E4S6rpUm/QfV/YuyvGQFlEPje1Wuy1KTXLi 2DtMkxbjRZNmbT9pHbXKQcGXgVA4MQSjikFMyn88WIhLHqJPbTpHc6/NsDEqXuqSFGYQrQf+nrb fvbdjGtXKwuS81HgG/Vd5RLrTjKhFzDjQ95iOk9aVJ1mrX+dUyoIw8nOohRTYj6kHhZLq5A6npX jo2aC3WSiJiEpvC+ZN/77Ruz4tJj+3tDKFVUEj/zySL9PGdO6sSCNsmXdHWuZq2PchghqTomFmH NCy7b404JtPgyuA3xsD4qWagC2ludKI9zH2IQ6moWiOEd3UcdhfjZPyXV3ejG0dH9tTuLKMM8j3 IU4= X-Received: by 2002:a17:907:3ea1:b0:bc1:36dd:c6c9 with SMTP id a640c23a62f3a-bc136ed1858mr466108766b.33.1777937597490; Mon, 04 May 2026 16:33:17 -0700 (PDT) Received: from nick-GTR-Pro.arnhem.chello.nl (2001-1c00-3281-1680-7a55-36ff-fe02-cdba.cable.dynamic.v6.ziggo.nl. [2001:1c00:3281:1680:7a55:36ff:fe02:cdba]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bbe6aa4d524sm445224366b.26.2026.05.04.16.33.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2026 16:33:16 -0700 (PDT) From: Nicola Lunghi To: mathias.nyman@intel.com, michal.pecio@gmail.com, niklas.neronin@linux.intel.com, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Nicola Lunghi Subject: [PATCH 0/2] xhci: Fix isochronous scheduling gaps on CFC controllers Date: Tue, 5 May 2026 01:31:42 +0200 Message-ID: <20260504233143.10242-2-nick83ola@gmail.com> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This series addresses a long-standing issue where the xHCI driver introduces frame-aligned gaps in isochronous streams during timing fluctuations. While many USB devices handle these gaps with a minor glitch, professional interfaces like the MOTU 1248 lose internal channel synchronization when these gaps occur. I have identified two specific code paths in xhci-ring.c where these gaps are created: Silent Rescheduling: When a start frame is "late," the driver adds a +1 frame offset, creating an explicit hole in the stream. Ring Drain Race: On CFC-capable controllers, the driver falls back to ASAP scheduling if the ring is momentarily empty, resulting in a jump to a future frame instead of continuing sequentially. Impact on MOTU 1248: The MOTU 1248 is particularly sensitive to stream continuity. The two situations described above cause a shift in the output channels, where audio intended for one set of channels is routed to the wrong physical outputs until the device is reset. Proposed Solution: This series modifies the xHCI driver to prefer sequential scheduling on modern CFC-capable controllers: - Patch 1 removes the silent start_frame_id + 1 reschedule, returning -EINVAL to allow the use of the TRB_SIA (Schedule Immediate After) flag. - Patch 2 expands the CFC sequential condition to check if a periodic completion is in progress, covering the "ring drain" race where a new URB is submitted just as the previous one finishes. These changes build upon recent work by MichaƂ Pecio regarding missed TD handling. Link: https://bugzilla.kernel.org/show_bug.cgi?id=220748 Nicola Lunghi (2): usb: xhci: fix isoc silent reschedule creating stream gap on CFC controllers usb: xhci: fix CFC sequential scheduling lost on ring drain race drivers/usb/host/xhci-ring.c | 42 +++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 13 deletions(-) -- 2.51.0