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 D7788C3DA4A for ; Mon, 5 Aug 2024 14:02:02 +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:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JM1mXMureyT9CB3kPN5oJ8EDwvAKnz/lBL8BhkqGrP4=; b=H2/ZLfO1V0uZrwkBUGiqbIVcg2 v2NdaflJi10gCzrjdN0SZGf6i+fDhAOf9oi1j0juMHy8dikotbCUzaKvVc5FrB8urHm7wi/cOzscE /ggxSqMmfliJ+rtJMFlm0zP8adPWduZt+Ght+WrdHQ1mckQNB8lB8+eNdu90ro/WanTa0jeoPFo7m QmZ3dq5pYMTVRTzwinmHFaShU/JDHbBh8xxw4BCstgsGKnGXZc6iRUTUOOODSBOM5evmHf/jV5Wty SPRJbB6FlSn0aZv4PzSx0BkFrZjSFgCwzUPm70OApnxtRkk1Kck+dtc4b0Pwmwzg/XWOXHBuDa/wf /wb7d8JQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sayHX-0000000G3Qj-01k2; Mon, 05 Aug 2024 14:01:51 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sayGz-0000000G35K-3HV5 for linux-arm-kernel@lists.infradead.org; Mon, 05 Aug 2024 14:01:19 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id B977D60C7E; Mon, 5 Aug 2024 14:01:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC1C1C32782; Mon, 5 Aug 2024 14:01:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722866476; bh=xeW3BFg1rRXSSiFrEPt3V/qUAtk3sB6WPkxk77Ds2VU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=nOCjf571dA5qd+ea4EQBuw9Z3KxslRDSOi+6l1QKD4BPPTsrqhbPtbOa/Tw/brAr/ Ray+f3MFmZrFNo0T26yT/FNnB027HjfuiuxRl3tpfMcveGI6F6iK+iUmJaHT0rcPy8 3ZR0wIkDTi0J4pfy9GtjHsM5Ymi0rd6heAIDjcU2kUf8VKGkjexjqvnX7XsaSgKfV5 I+FZKHyD9Vu86GnmTtOzgQ9PcRwoQv0Jh4m5TuLZSUyun6yCPI8a4Ie+z2L8l4EY9E mZwNXxicKzHtsBSoUz2t/k6TXwJsq3TL1CZvwLp1lyj/iK1wJ8UxAGGoVEZJJ7tQa5 7kVnYMTb7I6CQ== Message-ID: <2bf38b29-6aac-4c08-837f-a43683a54b56@kernel.org> Date: Mon, 5 Aug 2024 17:01:09 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 00/12] Fix USB suspend on TI J7200 (cdns3-ti, cdns3, xhci) To: =?UTF-8?Q?Th=C3=A9o_Lebrun?= , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Peter Chen , Pawel Laszczak , Mathias Nyman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , "Vardhan, Vibhore" , Vishal Mahaveer Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , =?UTF-8?Q?Gr=C3=A9gory_Clement?= , Thomas Petazzoni , Conor Dooley References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> <37760e53-4e0d-4275-8497-1b51dcf72d5a@kernel.org> Content-Language: en-US From: Roger Quadros In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240805_070117_948640_29273D54 X-CRM114-Status: GOOD ( 19.31 ) 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 +Vibhore & Vishal On 05/08/2024 11:58, Théo Lebrun wrote: > Hello Roger, > > On Sat Aug 3, 2024 at 5:14 PM CEST, Roger Quadros wrote: >> On 26/07/2024 21:17, Théo 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. >>> >>> 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 expects >>> a resume. >> >> OK. >>> - We add a xhci->lost_power flag. >> >> Why? >> >>> >>> 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 existing >> 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 = "ti,j7200-usb", "ti,j721e-usb"; > // ... > power-domains = <&k3_pds 288 TI_SCI_PD_EXCLUSIVE>; > // ... > }; > > This `power-domains` property implies that even s2idle will reset > the controller. I'm not so sure. All K3 platforms have the power-domains property for the USB wrapper nodes. > > - 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. > Got it. Might be worth to mention this in the patch description. > I am sorry the precise usecase wasn't clear from the get-go. > > Thanks, > > -- > Théo Lebrun, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com > -- cheers, -roger