Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2133757lqe; Tue, 9 Apr 2024 10:21:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVDUKAk38MYXF6rOuWldmERxH9naDj+t5Q8CV8V8XVuy32Vep6hHmIEPQGMkkI4yJKeAPXHRUib4uqGjhDMSZmp+szRvFXQZeEngthOXw== X-Google-Smtp-Source: AGHT+IGL6ODeoeH+n72RdmMi/KVQ6i+zNNmpkQZkyTHV++xOPja/+cHTeNSBknYC2Wa02kiTaUCD X-Received: by 2002:a05:6a20:9747:b0:1a7:a4d2:4516 with SMTP id hs7-20020a056a20974700b001a7a4d24516mr443829pzc.40.1712683303234; Tue, 09 Apr 2024 10:21:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712683303; cv=pass; d=google.com; s=arc-20160816; b=gKHil1lezUYM8PykuPUCznOl0isc2mqFQFdkxAYgpOSLMAFNV0QvY/l6o3Qvk5WioB 22hY7qTBAUJmFthhz6b6xaIl7hJbtoXJS09J+Cg0MuBYNtHTU++4FlUBnlGor3vozjuA OEI2/5NccJaVrm06LzUqhhFj73xy+BYnuyFgIqn6q7vV8DYj/qfX7W8laDCcEqyuBRPc I1glVUTuUYM2BEbWaKhFhuOXLuh2r/YehmDtuO4YuCi66APyjyqRCYau+8+FwvpPJMRR ecTmxyabvN74Q8bsrVacy87bqgq7/hm8rh8YQg1Di1aXaL81kbQaf+c2LLzTFCb4lf2m LzrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=LFynST4Kxu442NbbgjKJTWDj6sjt/7t7zPRqrBXoTDE=; fh=ePzUoGbaKKtrcvjbNivjVRsqN6ymqXvCPTIMGl4mKyo=; b=KfldFqjJzyAy1kiOd9QqH+xRhz8I2+p1+hAlm4njwyfbU9UHOzrFPoSi0RBigayZo7 e74+e9A1snQAUp6RmzBSwUrzE5IY1VZcZJrZF6giXVA4x4+OTh4WmI/ObgHmTUBsLQVi GdNhw5aRT2WDktCOQt5DmcxsFUcWc9DhlCBcDwdHoQoNA1RX9SssmH8y6hsiKfoovTtd rVAiTYa0UFDLHLk2PzUTFkij1faMtXY9FI+aVOKGPoGo0jk825yaxfmGpnlEpVMxUmPR nGQZqOWY9FZsF/cUhGb7QcdhMpgLBCnqDN+G4iBlb6roBzBWaQ0pPcFg0hC2DN/oyhp9 26iw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZUOi5ZuL; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-136737-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136737-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id f17-20020a635551000000b005e46720db84si8759469pgm.117.2024.04.09.10.21.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 10:21:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136737-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZUOi5ZuL; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-136737-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136737-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 15A51B22B5F for ; Tue, 9 Apr 2024 11:20:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0F3686643; Tue, 9 Apr 2024 11:20:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZUOi5ZuL" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 263D18563F; Tue, 9 Apr 2024 11:20:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712661626; cv=none; b=athfG+dH3wg1bli2Z60zKT9OvbgMTatjzcQkFp66JddfEw12AxFQwoh7PrztwbIQFtvJRYegXPG3776izvdx7DEmODS8UDdmBqnOztWwc385njzx+5EivzWvJEKE6DTKz9UCgtyRZJgqGLMaPz436TXN5arZacHMNKon0zwooTw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712661626; c=relaxed/simple; bh=91UpDteffSdyg8FH2DDrKcFH4H9dq42CgEub79FQGEY=; h=Message-ID:Date:MIME-Version:To:Cc:References:From:Subject: In-Reply-To:Content-Type; b=Mmauo0KfPCTiHZ/WWWqDtGPWwBcObEEZYxs64LtgRS1uK1OXhWbXr0JluvHXZbDlf61/wXFT3p9CTBvQ4GF9EX/S/DikV4I2Xi/z+obZq+g7HQQUnSVOXBtnrEcrbQ7ifOXvXTLN/X2qiYK0hD54/H4e21TxVLTikeCTOWINUrw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ZUOi5ZuL; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712661624; x=1744197624; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=91UpDteffSdyg8FH2DDrKcFH4H9dq42CgEub79FQGEY=; b=ZUOi5ZuL7V0m+96U0jJxW5EoFdSD4A0zSN8bIcK+uAwnjpTmCPp3Fyit FxCq3wxoWMC9prDfz22/gZIOFciCyzwQQbsf2dHkT0+5m1HNnSjbDuL8t qza8zhx01+mzLY/LxNwmcathOmfDw5Hzb7/GBqOkxodOEyou7fM562vRw ESMiFDWyRBHvshh9LRaohHiMiVAL5JaL1P6+ICX+E39sy4CwFB4cBetu4 SWYrtHUITIFyOjU8uqJNHVGiB2C/LhIxRrGG9lxA4uztq4Ytl4fdatU4U xMHjtZ6kgJ48dfNqAYqoW6a/sGs8VTTe6d05BXqbok+iwucnIyILJU83L Q==; X-CSE-ConnectionGUID: 9UELNt9pTj+mzcWUP0U9tA== X-CSE-MsgGUID: rcuY2B98THaNTR3YGD6EWQ== X-IronPort-AV: E=McAfee;i="6600,9927,11038"; a="8127095" X-IronPort-AV: E=Sophos;i="6.07,189,1708416000"; d="scan'208";a="8127095" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2024 04:20:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11038"; a="937093297" X-IronPort-AV: E=Sophos;i="6.07,189,1708416000"; d="scan'208";a="937093297" Received: from mattu-haswell.fi.intel.com (HELO [10.237.72.199]) ([10.237.72.199]) by fmsmga001.fm.intel.com with ESMTP; 09 Apr 2024 04:20:21 -0700 Message-ID: <82113c7d-0405-ba11-94d9-5673593cec50@linux.intel.com> Date: Tue, 9 Apr 2024 14:22:10 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.13.0 Content-Language: en-US To: =?UTF-8?Q?Micha=c5=82_Pecio?= Cc: Paul Menzel , Mathias Nyman , LKML , linux-usb@vger.kernel.org, Niklas Neronin References: <58bca6f2-797a-4e20-a476-2294309afdd5@molgen.mpg.de> <20240405113247.743e34b2@foxbook> <7090d3af-18ce-40e1-8ac2-bf18152e5c4a@molgen.mpg.de> <20240406183659.3daf4fa0@foxbook> <20240407142542.036fb02f@foxbook> <1f64af9a-0618-a7da-4acc-f043b6580308@linux.intel.com> <20240408210541.771253ff@foxbook> From: Mathias Nyman Subject: Re: xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 1 comp_code 1 In-Reply-To: <20240408210541.771253ff@foxbook> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 8.4.2024 22.05, MichaƂ Pecio wrote: >> It's also possible this TD/TRB was cancelled due to the disconnect. >> Could be that even if driver removes the TD from the list and cleans >> out the TRB from the ring buffer (turns TRB to no-op) hardware may >> have read ahead and cached the TRB, and process it anyway. > > I thought about it, but my debug patch says that the missing TD was > freed by finish_td(), which is called on TDs considered completed by > hardware. A cancelled TD would show giveback_invalidated_tds(). > > > Anyway, we now have new information from the reporter. My v2 patch > keeps a log of the last five events processed on each transfer ring > and dumps the log on TRB mismatch errors. > > Unfortunately, it looks like the host controller is broken and signals > completion of those transfers twice. The log below shows two distinct > events for TRB 32959a1c0 and that the coresponding TD has just been > freed by finish_td(). The trace confirms this, we get double completion events for several Isoc TRBs. These double completions are seen after a transaction error on the same device (different endpoint). Transfer events for TRB ..a1c0 twice, with a transaction error in between: -0 [000] d.h2. 33819.709897: xhci_handle_event: EVENT: TRB 000000032959a1c0 status 'Success' len 0 slot 6 ep 2 type 'Transfer Event' flags e:c -0 [000] d.h2. 33819.709904: xhci_handle_event: EVENT: TRB 000000041547d010 status 'USB Transaction Error' len 4 slot 6 ep 15 type 'Transfer Event' flags e:c systemd-journal-395 [000] d.H1. 33819.711886: xhci_handle_event: EVENT: TRB 000000032959a1c0 status 'Success' len 0 slot 6 ep 2 type 'Transfer Event' flags e:c Transfer events for TRB ..a1d0 twice (the next TRB) systemd-journal-395 [000] d.H1. 33819.712001: xhci_handle_event: EVENT: TRB 000000032959a1d0 status 'Success' len 0 slot 6 ep 2 type 'Transfer Event' flags e:c systemd-journal-395 [000] d.H1. 33819.712059: xhci_handle_event: EVENT: TRB 000000032959a1d0 status 'Success' len 0 slot 6 ep 2 type 'Transfer Event' flags e:c Transfer events for TRB ..a1e0 twice systemd-journal-395 [000] d.H1. 33819.712139: xhci_handle_event: EVENT: TRB 000000032959a1e0 status 'Success' len 0 slot 6 ep 2 type 'Transfer Event' flags e:c systemd-journal-395 [000] d.h1. 33819.712871: xhci_handle_event: EVENT: TRB 000000032959a1e0 status 'Success' len 0 slot 6 ep 2 type 'Transfer Event' flags e:c etc.. Driver can cope with these extra events, but if this is common we should probably handle it silently and not concern users with that ERROR message. We are actually at the moment looking at improving handle_tx_event() with Niklas (cc), and will take this into consideration. Thanks Mathias