From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5EA3CC3DA4A for ; Mon, 5 Aug 2024 08:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References: Subject:From:To:Cc:Message-Id:Date:Content-Type:Content-Transfer-Encoding: Mime-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hspDI21NExis9E21OLcVoQ7yINV4U0zlx252AwZl/ds=; b=mgcaSfcjmTd6i85wRViexmXkqY PoQNoKIh/3vYfnVzuPBqV2QITaeOhehMQwNaoKMTXq5xbkMTfmgeD5MVxE/tTwmG6woLUBon1RiZp XC1FDHWgmaeyunvABfNpN9WVwav5IJC7bvGdG/j+szY8na85EILH2ISdv5SI9DG6rFHODWKWtS2U1 YkeNOStuzzl3nKFYXHOBN4cabnv5q3CAqpFc2ySr6zjlq6oS7P4DF9ilAlz+GiKuKHee+fHV4FBDB hEMFthdZXE0fKFB66LolWvGZyqWSl40EwwsIPMY0j+ww0RADIp34+OHJ8tDkGHu5SozT3/tluIIly qJWvekxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1satYs-0000000FC0G-3iTx; Mon, 05 Aug 2024 08:59:26 +0000 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1satYL-0000000FBrB-1TiJ for linux-arm-kernel@lists.infradead.org; Mon, 05 Aug 2024 08:58:55 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 2735760002; Mon, 5 Aug 2024 08:58:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1722848327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hspDI21NExis9E21OLcVoQ7yINV4U0zlx252AwZl/ds=; b=cSCJWCq8tYxsmdlxVHyiNBZ+GW78Unsjq1KAV2o6qllCYFq1ZsIbJw/ll0QnOsnOdPeITg uwk+R5XRNl7PDCDM23eUe0t66sp44iMGQRhqPIiyLRKp7cFeDXYmP9efnkdUdf7UvAgI2m 4JJ2Fl/bG31ROCDk299GVV5RLs2jZSH19DXxtSlxL50eBMjgVReuSnMtlZNTsIuua31Gsq nxwyVKGAxpwAWCDfQ1idQV4Gvu0gBM5SxXvv38KD+OLFjfGYyr1WWcbasxTA9JutLJAT41 PjFMzraBLRaeNlL85UqtZngxq4G8OcFkvFBfJBiVKDC8vbKEhuJKLlEagr+nPA== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 05 Aug 2024 10:58:45 +0200 Message-Id: Cc: , , , , "Kevin Hilman" , =?utf-8?q?Gr=C3=A9gory_Clement?= , "Thomas Petazzoni" , "Conor Dooley" To: "Roger Quadros" , "Greg Kroah-Hartman" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Peter Chen" , "Pawel Laszczak" , "Mathias Nyman" , "Nishanth Menon" , "Vignesh Raghavendra" , "Tero Kristo" From: =?utf-8?q?Th=C3=A9o_Lebrun?= Subject: Re: [PATCH v5 00/12] Fix USB suspend on TI J7200 (cdns3-ti, cdns3, xhci) X-Mailer: aerc 0.18.1-0-gaa8319bc591f References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> <37760e53-4e0d-4275-8497-1b51dcf72d5a@kernel.org> In-Reply-To: <37760e53-4e0d-4275-8497-1b51dcf72d5a@kernel.org> X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240805_015853_675769_198033A1 X-CRM114-Status: GOOD ( 16.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Roger, On Sat Aug 3, 2024 at 5:14 PM CEST, Roger Quadros wrote: > On 26/07/2024 21:17, Th=C3=A9o Lebrun wrote: > > Currently, system-wide suspend is broken on J7200 because of a > > controller reset. The TI wrapper does not get re-initialised at resume > > and the first register access from cdns core fails. > >=20 > > We address that in a few ways: > > - In cdns3-ti, if a reset has occured at resume, we reconfigure the HW= . > > - We pass the XHCI_RESET_ON_RESUME quirk, meaning the XHCI core expect= s > > a resume. > > OK. > > - We add a xhci->lost_power flag. > > Why? > > >=20 > > The previous revision had one big issue: we had to know if > > reset-on-resume was true, at probe-time. This is where the main > > Don't we already know this at probe-time? why not just rely on the existi= ng > XHCI_RESET_ON_RESUME qurik, than add a new mechanism? Some TI platforms cannot tell, before going to suspend, if their USB controller will reset. Suspend behavior is defined by (at least) two features: - Power domains. See arch/arm64/boot/dts/ti/k3-j7200-main.dtsi: usbss0: cdns-usb@4104000 { compatible =3D "ti,j7200-usb", "ti,j721e-usb"; // ... power-domains =3D <&k3_pds 288 TI_SCI_PD_EXCLUSIVE>; // ... }; This `power-domains` property implies that even s2idle will reset the controller. - Deep suspend. The type of suspend defines what will happen to various controllers. Currently deep suspend is suspend-to-RAM, with the SoC being turned off. This might evolve over time with more complex rules: the chosen suspend behavior could depend on wakeup source and/or wakeup target latencies. That information might not be available to Linux, being decided upon by firmwares. We need to be able to resume successfully without being surprised by a reset. I am sorry the precise usecase wasn't clear from the get-go. Thanks, -- Th=C3=A9o Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com