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 F1221C433EF for ; Wed, 13 Apr 2022 15:04:10 +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:MIME-Version:References:In-Reply-To: Date:Cc:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=u0F3vUUGhZBM4feL5B3QzESDrsqO/YlZw1otyjh/6yw=; b=RGJyD/0Qo3/w3O Ug/spp39YVsE2qQtll6+wcjdvJMXSEs7Ole+NnBMQU128Vd5SPznnZW7hqF4vlnKeNJa5FaHp3zp2 Mz6SEX0szpzKzpJfDVbgW8n6h0ULOnHAoOskGHoOMJpGa1SfSS+SGPuOVh7M1KTNKdn6EtwIJ/lzB fRPOPU5ntPbChYwxD/RrlnZtivUxJ5oEJ5a/7dDIeOdqhq/2eSt8pHNonLuEJ1qFppiIjtku3kHI5 1abb8/MgicHa1WFtk5Ibr7FhlS2UoeR2GNr2HegGJo+nwEU52MBkSSish7hniExb4OdAEmfhRawy/ ys8RXbUTlKMFmZ+yZqXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1neeWW-001WSI-B8; Wed, 13 Apr 2022 15:03:12 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1neeWS-001WQ4-CD for linux-arm-kernel@lists.infradead.org; Wed, 13 Apr 2022 15:03:09 +0000 Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neeWK-0002hN-GY; Wed, 13 Apr 2022 17:03:00 +0200 Message-ID: <09fd0c60b87f68f54baa01fcf612725eda342d71.camel@pengutronix.de> Subject: Re: i.MX8MM USB autosuspend broken with power domain support From: Lucas Stach To: Fabio Estevam , Frieder Schrempf , Li Jun Cc: Peter Chen , Peng Fan , "linux-arm-kernel@lists.infradead.org" , NXP Linux Team , "marek.vasut@gmail.com" , Tim Harvey , Adam Ford , Breno Lima Date: Wed, 13 Apr 2022 17:02:59 +0200 In-Reply-To: References: User-Agent: Evolution 3.40.4 (3.40.4-1.fc34) MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220413_080308_462412_CF5EFF08 X-CRM114-Status: GOOD ( 22.78 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Am Mittwoch, dem 13.04.2022 um 11:40 -0300 schrieb Fabio Estevam: > [Adding Jun Li] > > On Wed, Apr 13, 2022 at 11:35 AM Frieder Schrempf > wrote: > > > > Hi, > > > > when power domain support was added for i.MX8MM, it seems like this > > broke the USB autosuspend feature. > > > > I reported this previously when testing the gpcv2 patches before they > > were merged [1] and the issue can also be reproduced on v5.18-rc2. > > > > Did anyone else encounter such a problem? Can anyone help with debugging > > or proposing a fix? > > > > Do the USB power domains need to stay enabled for autosuspend to work? > > If yes how can this be achieved? > > > > Below is some more information on how to reproduce the issue including > > some debug output. > > > > Thanks a lot and best regards > > Frieder > > > > 1. Plug in USB device on host port, device is not enumerated, no debug > > output > > > > 2. Disable autosuspend, device gets enumerated > > > > ~# echo on > /sys/bus/usb/devices/usb1/power/control > > [ 2986.582786] imx_usb 32e40000.usb: genpd_runtime_resume() > > [ 2986.588155] imx-pgc imx-pgc-domain.2: genpd_runtime_resume() > > [ 2986.593876] imx-pgc imx-pgc-domain.2: resume latency exceeded, 1125 ns > > [ 2986.600446] PM: usb-otg1: Power-on latency exceeded, new value > > 12295000 ns > > [ 2986.607342] imx_usb 32e40000.usb: at imx_controller_resume > > [ 2986.612850] ci_hdrc ci_hdrc.0: genpd_runtime_resume() > > [ 2986.617919] ci_hdrc ci_hdrc.0: at ci_controller_resume > > [ 2986.858565] usb 1-1: new full-speed USB device number 10 using ci_hdrc > > > > [1] https://lkml.org/lkml/2021/5/19/883 Now that I think about it again, it seems putting the USB controllers into the OTG1/2 power domains is wrong. I guess the controllers are actually located in the HSIOMIX domain, which probably needs to stay enabled even if there is no device connected, so that the wakeup logic works properly. It's the USB PHYs that should be placed in the OTG domains and which I expect can be powered down as long as no device is connected. The i.MX8MM support currently handles the PHYs via usb-nop-xceiv, which AFAICS doesn't properly handle runtime PM. :/ Regards, Lucas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel