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 X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF080C3F2D0 for ; Fri, 28 Feb 2020 07:49:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE2E3246A2 for ; Fri, 28 Feb 2020 07:49:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726740AbgB1HtB (ORCPT ); Fri, 28 Feb 2020 02:49:01 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:41369 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725870AbgB1HtA (ORCPT ); Fri, 28 Feb 2020 02:49:00 -0500 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j7aOI-0002VD-9t; Fri, 28 Feb 2020 08:48:58 +0100 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1j7aOG-0001nf-9z; Fri, 28 Feb 2020 08:48:56 +0100 Date: Fri, 28 Feb 2020 08:48:56 +0100 From: Marco Felsch To: Peter Chen Cc: "jun.li@freescale.com" , "gregkh@linuxfoundation.org" , "linux-usb@vger.kernel.org" , "stern@rowland.harvard.edu" , dl-linux-imx , "kernel@pengutronix.de" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH 0/3] USB IMX Chipidea fix gpio vbus control Message-ID: <20200228074856.gomzgtoxwzj4eele@pengutronix.de> References: <20200227104212.12562-1-m.felsch@pengutronix.de> <20200227111838.GA24071@b29397-desktop> <20200227113539.gcx3nfwm2fbm3ukv@pengutronix.de> <20200227122045.GB24071@b29397-desktop> <20200227124406.6kbgu3dbru4qmews@pengutronix.de> <20200227143914.mi3vsltrtyo5sqed@pengutronix.de> <20200228025129.GA31815@b29397-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200228025129.GA31815@b29397-desktop> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 08:18:19 up 104 days, 22:36, 122 users, load average: 0.23, 0.56, 0.38 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-usb@vger.kernel.org Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Hi Peter, On 20-02-28 02:51, Peter Chen wrote: ... > > > CI_HDRC_TURN_VBUS_EARLY_ON is introduced by fixing a bug that some i.mx USB > > > controllers PHY's power is sourced from VBUS, the PHY's power need to be on before > > > touch some ehci registers, otherwise, the USB signal will be wrong at some low speed > > > devices use case. So, this flag can't be deleted, it may cause regression. > > > > Pls check my archeological findings and again pls check my patches. I > > deleted the flag because isn't required anymore afterwards. > > I have already checked your patch, your patch deletes CI_HDRC_TURN_VBUS_EARLY_ON > quirk, and it may cause regression. Arg, sorry now I see what you mean. Thanks for your explanation :) Since the 'struct ehci_ci_priv' contains now an enabled state we can git rid of the flag. To get it right, the writing the ehci PORT_POWER must be done before or after we enabled the VBUS? I'm asking because we can drop the 1st patch of this series. > > > The solution I see is your may need to implement chipidea VBUS control flow by considering > > > pm_qos_no_power_off at suspend situation. You may add .suspend API for ci_role_driver, > > > and called by ci_controller_suspend/ci_controller_resume, of cos, better solution is welcome. > > > > I fixed it within the core [1] and here at the chipidea side. > > > > [1] https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flkml.org%2Flkml%2F2020%2F2%2F27%2F669&data=02%7C01%7Cpeter.chen%40nxp.com%7Cad9b3833ae2f433d93ef08d7bb92d4a0%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637184111614326500&sdata=SPwwBEGBco6IdP8ufmAnJeeRxuAXGLa0xzYlzFA%2FAvg%3D&reserved=0 > > > > You will never enter the ehci_ci_portpower() during suspend without [1] > > if you are using a vanilla kernel. So IMHO this case can't be tested, > > sorry. > > > > Through set pm_qos_no_power_off as 0, the VBUS will be off. You > never need to call .ehci_ci_portpower again. You may try my second > suggestion for fix chipidea issue. I will reply your RFC patch for > USB core. Many thanks for testing =) Regards, Marco > -- > > Thanks, > Peter Chen 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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4934C3F2D0 for ; Fri, 28 Feb 2020 07:49:25 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 95E14246A2 for ; Fri, 28 Feb 2020 07:49:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AE2unNlJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95E14246A2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Hlf/ofY1mveiZeTIwbckrsnTSMhEsJuB0N3P5/Sxkqg=; b=AE2unNlJWjP8Xr /AfbEvWvymhOWwOWSYNFQYlv1kURBVqq7foZrsktHojn8y9YumcTaTfMKAnOVc3xjoomCpmNgdJi8 9CmM0ZpF/IjxRjdLGHGsPB2RT5YVmK+aR6khcR2C9g+1y92vObW3A5plKMN5MrQXPLOQVW1YqC0f8 mV0zArD/HyVP8RAbUzGlxTOoUR4GUno2wwGD8MQEFTFjWs/SSLfxslFVvELuOgxpeaRE+B2Xg43qO nxWrRii/IAFbtP1rgIqHkGSTW+abEEDlCePbjrIT3LoEX9yCp/3BtGFdMXtvVmeM8PruCndSUdJJA u8xdM5PTyZXiN5a/9Bdw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7aOT-0000AG-Cz; Fri, 28 Feb 2020 07:49:09 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7aOP-00009X-CF for linux-arm-kernel@lists.infradead.org; Fri, 28 Feb 2020 07:49:07 +0000 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j7aOI-0002VD-9t; Fri, 28 Feb 2020 08:48:58 +0100 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1j7aOG-0001nf-9z; Fri, 28 Feb 2020 08:48:56 +0100 Date: Fri, 28 Feb 2020 08:48:56 +0100 From: Marco Felsch To: Peter Chen Subject: Re: [PATCH 0/3] USB IMX Chipidea fix gpio vbus control Message-ID: <20200228074856.gomzgtoxwzj4eele@pengutronix.de> References: <20200227104212.12562-1-m.felsch@pengutronix.de> <20200227111838.GA24071@b29397-desktop> <20200227113539.gcx3nfwm2fbm3ukv@pengutronix.de> <20200227122045.GB24071@b29397-desktop> <20200227124406.6kbgu3dbru4qmews@pengutronix.de> <20200227143914.mi3vsltrtyo5sqed@pengutronix.de> <20200228025129.GA31815@b29397-desktop> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200228025129.GA31815@b29397-desktop> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 08:18:19 up 104 days, 22:36, 122 users, load average: 0.23, 0.56, 0.38 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mfe@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-20200227_234905_418065_81AC2876 X-CRM114-Status: GOOD ( 16.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-usb@vger.kernel.org" , "gregkh@linuxfoundation.org" , "jun.li@freescale.com" , "stern@rowland.harvard.edu" , dl-linux-imx , "kernel@pengutronix.de" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Peter, On 20-02-28 02:51, Peter Chen wrote: ... > > > CI_HDRC_TURN_VBUS_EARLY_ON is introduced by fixing a bug that some i.mx USB > > > controllers PHY's power is sourced from VBUS, the PHY's power need to be on before > > > touch some ehci registers, otherwise, the USB signal will be wrong at some low speed > > > devices use case. So, this flag can't be deleted, it may cause regression. > > > > Pls check my archeological findings and again pls check my patches. I > > deleted the flag because isn't required anymore afterwards. > > I have already checked your patch, your patch deletes CI_HDRC_TURN_VBUS_EARLY_ON > quirk, and it may cause regression. Arg, sorry now I see what you mean. Thanks for your explanation :) Since the 'struct ehci_ci_priv' contains now an enabled state we can git rid of the flag. To get it right, the writing the ehci PORT_POWER must be done before or after we enabled the VBUS? I'm asking because we can drop the 1st patch of this series. > > > The solution I see is your may need to implement chipidea VBUS control flow by considering > > > pm_qos_no_power_off at suspend situation. You may add .suspend API for ci_role_driver, > > > and called by ci_controller_suspend/ci_controller_resume, of cos, better solution is welcome. > > > > I fixed it within the core [1] and here at the chipidea side. > > > > [1] https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flkml.org%2Flkml%2F2020%2F2%2F27%2F669&data=02%7C01%7Cpeter.chen%40nxp.com%7Cad9b3833ae2f433d93ef08d7bb92d4a0%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637184111614326500&sdata=SPwwBEGBco6IdP8ufmAnJeeRxuAXGLa0xzYlzFA%2FAvg%3D&reserved=0 > > > > You will never enter the ehci_ci_portpower() during suspend without [1] > > if you are using a vanilla kernel. So IMHO this case can't be tested, > > sorry. > > > > Through set pm_qos_no_power_off as 0, the VBUS will be off. You > never need to call .ehci_ci_portpower again. You may try my second > suggestion for fix chipidea issue. I will reply your RFC patch for > USB core. Many thanks for testing =) Regards, Marco > -- > > Thanks, > Peter Chen _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel