From patchwork Mon Nov 13 14:26:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13454051 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 ACED8C4167B for ; Mon, 13 Nov 2023 14:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=zPrl+Gvo173LMuOYwABcSQyCplVDJhVH/KJ/o/OV/Xs=; b=OSdPUVdIGAfwg9 Z78R1FXD0aJ2fZK6EChs9d6D60DAkdsGDkBrU5Kgmw+CKJQ6fZo/ovIQSiP+3PwFRqY0RTFh5l1nx CqRs184cE5Pdzdtc6StBU2D3wSOptlQ1wiUawU/FS5G5c8tTXoZEqsK+AYgmILfnk8cC0RQjMxZYK ege4t/1oYxs7+1qzYi732Mli4axo9bGWpCKQIbFQFeLva68ylOrVDSPkw7Cf2PLEkrOITZMTkJRBQ tpDO9ieIi3YPnRtWqRJUUhxAh2oC0/w9xxQB9BqqoVeYhPo4b+Wxbv+v/O14jeg1PA+QkP+CIoR8W 5/RjmUzmxM/+c+2goBBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2XuJ-00E8CA-2a; Mon, 13 Nov 2023 14:27:19 +0000 Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2Xu8-00E84K-1V for linux-arm-kernel@lists.infradead.org; Mon, 13 Nov 2023 14:27:12 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 266C41C0007; Mon, 13 Nov 2023 14:26:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1699885619; 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; bh=x/vcYfbmrCl2/iFXdAu/GqVZlYhoqhCpshthYgoXXWU=; b=nVdhVCULSDjsp9z6AP86jPhGmku9Exz1YuO7aUG5D3bxAV25trNO7UbUIbIKjLn6pO58XU Q015wDW7S3B0ZH3aBMk9IapaqSZlEXp1739X3DOxLDOz5gslxGoiYuaQUSVv3bWXIbmexe VtFWOO0LHDRhnZs9BgPdle3PY4YhpQiQWrLQNyGJx0Agj55WcsMkebHipDAZQBh63BlyoR /7cV2M/iPQVdaKK/4yLPqPdN48PV26RhPHUGeStoxTKY6ncKcF8Rpnu3n4SPzVtR+9lei4 fLfaKloIVo9coEMojXoaYv6oxwe7Zmji7dUYDUdeqAYGzxCoF/M4lhyOneahWA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Subject: [PATCH 0/6] usb: cdns: fix suspend on J7200 by assuming reset on resume Date: Mon, 13 Nov 2023 15:26:55 +0100 Message-Id: <20231113-j7200-usb-suspend-v1-0-ad1ee714835c@bootlin.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAC8yUmUC/x3MPQqAMAxA4atIZgNNLCheRRz8STUOVRoUQby7x fEb3nvAJKkYtMUDSS413WMGlQVM6xAXQZ2zgR1XRFThVrNzeNqIdtohcUYefB2YGxLnIXdHkqD 3/+z69/0Alpv3dmMAAAA= To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.12.3 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231113_062708_796026_7F08B04D X-CRM114-Status: GOOD ( 14.47 ) 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 Hi, Suspend on the TI J7200 platform is broken currently. There are two components that need to be patched so that they assume reset on resume: (1) the TI wrapper cdns3-ti & (2) the HOST role of the controller. Both only did their hardware configuration at probe time. We are talking about suspend-to-RAM but also suspend-to-idle; we have power-domains that turn off the controller in the second case which explains why s2idle doesn't work either. For cdns3-ti, we implement suspend & resume procedures only targeting our newly created compatible (ti,j7200-usb). The goal is to avoid breaking other platforms; it's unclear to me if power-domains are toggling at s2idle on those as well. About S2R I don't think it's targeted for those platforms. For the HOST role, we add a quirk flag which gets passed as auxiliary data by our wrapper TI driver. That avoids touching the behavior of other platforms; again I'm unsure what is expected and I wouldn't want to break stuff by re-initializing the role. Those patches have been tested on the TI J7200 EVM GP. No need to mention that other patches are required for S2R to work, but those will be sent later down the road. Those USB patches are rather standalone. Thanks, Théo --- Théo Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com Signed-off-by: Théo Lebrun --- Théo Lebrun (6): dt-bindings: usb: ti,j721e-usb: add ti,j7200-usb compatible usb: cdns3-ti: move reg writes from probe into an init_hw helper usb: cdns3-ti: add suspend/resume procedures for J7200 usb: cdns3: support power-off of controller when in host role usb: cdns3-ti: notify cdns core that hardware resets across suspend on J7200 arm64: dts: ti: k3-j7200: use J7200-specific USB compatible .../devicetree/bindings/usb/ti,j721e-usb.yaml | 1 + arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 2 +- drivers/usb/cdns3/cdns3-ti.c | 141 +++++++++++++++------ drivers/usb/cdns3/core.h | 1 + drivers/usb/cdns3/host.c | 20 +++ 5 files changed, 127 insertions(+), 38 deletions(-) --- base-commit: 1d42d5c8f1ca11106579dcaadef4161fee03419e change-id: 20231113-j7200-usb-suspend-2a47f2281e04 Best regards,