From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.9 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796111352; b=kqAVnxSfxX07J1ewCxx6lLZjOulKKDlMvFsmy0hJWcK2O0SfL1VdoxdKoTePPK89eNQe FG526hZaLmoV9Kns+BUnY85yQersD6ZCKxlgTgKNtM6TlltayRvD+f3UlWfPmTlymm1N6 WnsfLkvKXsFgBbnHIQWk31jR13k8MQY0qJKweumDLjJbrFYvi4quwmNKLgKDpczLB8MI/ kQ/I/Vomuacjsiq7o4+DX2XZxUfH3C2aA7hBJpXQZOKPLyJLhQVdHf+dEZnbUNGTsayW8 Z19VSFqj13YChELfQHrzg/hLii0IzgQA4cXp1zKS06O7eRtG1XPFmTsYoKRdddGbA6Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796111352; 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:Received:Date:From:To: Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=5A5CuIIyzcQBiL8hUM2so+5AbLwwx1PfCcPL8D/bn1U=; b=dVRWkHF6n31riZzDzwoLeNFMsjs3b5u4PAdwL9CWXDdzxIrefm3jnp8f3vLfVp68AAao nw/tHoVEELSHMnTEjeNaoT0LAo9cvztpp8wIKolP7oNCfW5EvgMZCfA/f8c9jstwtFKLC AgllciX33K42NwcI3sCI0YyGcliONQryuYGeGGbmu6OE6YE//5GyvG98hwoPgqdWsGne9 0uJEFXVD990FDMBMZOK+eIaTFsDxhgFd9ebgAE91yi70NKH3lWsmsK8dCSLET/HfR2Ae3 oLYHyBmqj+EKp9PHNgn9iF3bjGpYzyMwgjoaIW2d9sMk6B8guKBLBjIu4G+Q/MDc3GQ== 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=TqTXXJjD; arc=none smtp.remote-ip=198.175.65.9 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 1FD09606A33B; Tue, 1 Dec 2026 07:49:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1FD09606A33B 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=TqTXXJjD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796111350; x=1827647350; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=5A5CuIIyzcQBiL8hUM2so+5AbLwwx1PfCcPL8D/bn1U=; b=TqTXXJjDdYQ6ZXUU99KUG7nMhVANjyrEtaCklr8WbyJ52XUh8ODBViym UHSjTdhLAEYpueygyN9OSRDRhsTQl9Uzk8yeJY2iGw0eJtRvhNyT73vDf PTjaBXMG7xBcXgaf39kiJ6RCf5upizhtonXFbossRfWNbDWKlQuve4us+ Gxie72gTfKdsUBu0jWx8cNSpOZ2s9+MvMFpZJKG+pTZ4hnFi92mgXpDpj /WUgN5r9GV4TzAHeoppLJKKtPEr84jNEN7eJv9N4MT/10YIWmPn6UD/++ cR2OXEc2YSt3ujRbPzAeFn4qwwPaW46vq8qrYkkR8PtzRYy9gMs1mo9ev Q==; X-CSE-ConnectionGUID: oif1MVijShasyN9OGkoS6w== X-CSE-MsgGUID: QLMu8I27RxSbWbFTFfXbQA== X-IronPort-AV: E=McAfee;i="6800,10657,11982"; a="4879636" X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="4879636" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 23:49:09 -0800 X-CSE-ConnectionGUID: EnBNjnDZRFyNWbN6ZZ1l0w== X-CSE-MsgGUID: DKHezaKcQe+mQ8V7PcH6Xg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="13464167" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa008.fm.intel.com with ESMTP; 30 Nov 2026 23:49:04 -0800 Received: by black.igk.intel.com (Postfix, from userid 1001) id 9B5A898; Tue, 01 Dec 2026 08:49:02 +0100 (CET) Date: Tue, 1 Dec 2026 08:49:02 +0100 From: Mika Westerberg To: Konrad Dybcio Cc: Vinod Koul , Neil Armstrong , Manivannan Sadhasivam , Bjorn Andersson , Konrad Dybcio , Abel Vesa , Stephen Boyd , Brian Masney , Jerome Brunet , Andreas Noever , Mika Westerberg , Yehezkel Bernat , Mario Limonciello , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, usb4-upstream@oss.qualcomm.com Subject: Re: [PATCH RFC DNM 10/15] thunderbolt: nhi: Resume a runtime suspended NHI for system suspend Message-ID: <20261201074902.GU953667@black.igk.intel.com> References: <20261124-topic-next-20261116-fsm-mvp-v1-0-a9b45c69cd38@oss.qualcomm.com> <20261124-topic-next-20261116-fsm-mvp-v1-10-a9b45c69cd38@oss.qualcomm.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20261124-topic-next-20261116-fsm-mvp-v1-10-a9b45c69cd38@oss.qualcomm.com> Hi, On Tue, Nov 24, 2026 at 09:01:39PM +0100, Konrad Dybcio wrote: > The PCI core resumes a runtime suspended device in pci_pm_suspend() > before calling the driver's suspend callback, so nhi_suspend_noirq() > always finds the NHI active. Platform devices get no such treatment, so > these runtime suspended NHIs gets suspended a second time in the > noirq phase and resumed in nhi_resume_noirq(). nhi_complete() then still > sees it as runtime suspended and resumes it once more, which corrupts > the control channel (RX checksum mismatches, config space timeouts). > > Resume the NHI at the beginning of nhi_suspend(), like the PCI core > does as a workaround. Okay but I would rather keep it suspended over the system sleep. There is no difference from USB4 perspective so there is really no point waking it up. IIRC we do that now because USB stack needs to re-configure wakes for S3 but for s2idle (which is what the modern Intel systems at least do) that should not be necessary - it should wake the same way as runtime suspended. > Signed-off-by: Konrad Dybcio > --- > drivers/thunderbolt/nhi.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c > index e2578740d569a7ee1d5ab22e8effc153cb7d4632..56bc5748b6515b9d4799aa87ce0f72e1d673d634 100644 > --- a/drivers/thunderbolt/nhi.c > +++ b/drivers/thunderbolt/nhi.c > @@ -1258,6 +1258,13 @@ static int nhi_suspend(struct device *dev) > { > struct tb *tb = dev_get_drvdata(dev); > > + /* > + * The noirq callbacks expect the NHI to be active. The PCI core > + * resumes a runtime suspended device before calling this, do the > + * same for the NHIs that are not PCI devices. > + */ > + pm_runtime_resume(dev); > + > return tb_domain_suspend(tb); > } > > > -- > 2.55.0