Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031572AbbKECPZ (ORCPT ); Wed, 4 Nov 2015 21:15:25 -0500 Received: from mail-bl2on0130.outbound.protection.outlook.com ([65.55.169.130]:32438 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030822AbbKECPX (ORCPT ); Wed, 4 Nov 2015 21:15:23 -0500 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=freescale.com; Date: Thu, 5 Nov 2015 10:13:20 +0800 From: Peter Chen To: Felipe Balbi CC: Nathan Sullivan , , , Subject: Re: [PATCH V4] usb: remove unnecessary CONFIG_PM dependency from USB_OTG Message-ID: <20151105021319.GA16142@shlinux2> References: <1446126743-31892-1-git-send-email-nathan.sullivan@ni.com> <8737wnnq3c.fsf@saruman.tx.rr.com> <20151104030056.GA20460@shlinux2> <87r3k6mngw.fsf@saruman.tx.rr.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <87r3k6mngw.fsf@saruman.tx.rr.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD041;1:J2stcwl2BJf9zjv2NFp8XaQIcEulBiVuesNgPV+aEpfzsVdrpjp0MFKQ2cR0AKZ6ZajHGPxGCvs8l13bB917j/ZsxSxV+eQhAEbyhEwFTanG2B+IAvaMYs31gmvGrT+8HyuoivUKOBO7zzC/Tle6GegnLTdvuKL4ZUK3sXyOIdavy5uNVn1NXi6QYIg5NPKjJlKW3IQsWwt5RHT6z1tO2mFB/mQr9YKyFt9plwPzZf9dT4rv9GQn3LkWVohIqO+mdpA8f7AHQwZJaJ1H5nZ9j+Otyz4S/KXU3CpGVt1JpOws1VEKVFeufn8uATVuWQ/w6JSH15hk0Z57gH6GVRBau74VfwMV/CT11YvQSDRYyf8Ssa8PBfYpXwxtn1sB76wC X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1109001)(1110001)(339900001)(189002)(24454002)(199003)(110136002)(97736004)(50466002)(81156007)(4001350100001)(5001960100002)(92566002)(33716001)(77096005)(5008740100001)(189998001)(33656002)(85426001)(2950100001)(87936001)(6806005)(19580405001)(105606002)(104016004)(83506001)(106466001)(5007970100001)(19580395003)(11100500001)(47776003)(50986999)(86362001)(93886004)(76176999)(23726002)(54356999)(46406003)(97756001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0301MB2009;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB2009;2:aZy7RIqyS/2F+5cBIsCtdnixb9sWBAeI64maV/lnuhn7+C/I6gn1lnqgnYdIYlpYf1aHh3Pm3ZErYoyuWFK2vL+y6jyW7cyXgaBw4xqN02nu+mk2uSkceWB08K5/icd8/Y0tz9T1Q5DjQiVAA4+eg1Vvg63Cqx8EheQLFM2oANE=;3:z3YgdbRovGZ6G6K1PjSMxrECUkcBr3fIWYQ7QAjVtuSgZyeNgXFTTns1fbhaRaW7BW5zVJE8pcBHWUt31cE2Xg4wM0TYSiO236DShSg4qQVrryqvDx9JKPkXU0YdZjlZWmxDSuAgSk9ncjxbmCECh0Yfz/A8IlNcVN07N05PomZqOr8epxb68lbMtfB9OrRywVf3KqIAhP50N2OGqiNRx3P1GJLIyr4KprGqGjj4Aoc=;25:VzRVjuXRigXPsUwvgFldZed2a8s5DR9NHzU/2fNw2cUKW5vopguFG2qefKHJFwupKLeOsGZMZ5tev9fT4Nd2m2j6FN6HIhDJv3rttpweEtApO2fA+j6vJt/bDUKjgYjvWey/axcCIG08R6ICdrATWHAkQmuKz4Nhti3nfs4pB0pFHN5OUCdXzz2vLbYlRMuwR+qqcLa+/wJTP4NhCqjxhrA6PM/jeNUVC9yLSJMDih1rPGvIROKlMWxsuKkBbftoS8Xlc8pi1IKuNj219jePUQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB2009; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB2009;20:v+eH70VDoSWh9Fg6C0/JfosZmzqtW6JfRawuubFkZRScBKlFReLyQxHTacpFKIQXfCTRRvIAL3QCOyEmQpp+dfXE3yo4d1Y6vdYzBmg4mCCBVYubslpyhUJ2wfHKQ95s8ihzu7pkKEFv9blHfLKKR6SctR5z2+7Xmph+xZCuYeSaqoqCG8OlHBA4ingyq9rcOY4BOxjZDHpPFNVZ7waNDSoxPtK2PWwR4f9911yUaIbi6J5jo3/mH3a6DEdfrraOPx1fbdmRswtvPd1rz4N1spNIq9Kfk6S6dbc/QCfimikOkeY+mXeFiXBC8LnlaDjf1lr6ixK1tXWwhV9oHIDuNYvd5UPQK0Y41Dm01lMx7EU=;4:SzX9O2BZCTwlgpnqc6kLbiYOaP2MGUyfWbTRNgp1JYgPhLZNCjXeniFIkV7qbx5cYUiTi8vRcUM7tTi4ZtY/x1RRz/8cxhNJMObVNXX8jPfSkouk6tLU/Gxp3gTjeVPrm7HmymEXxF1r44AS7rgTmJmNuc5yX8L0nPSbExIXL5YgPtaF+uvIj1FYeJdkpEQlhzUjhYxttfvQ48jDkx6agHtluS685hFG3AB7gVdWq9KHziKeFSQdb1U5GZDk/iFElLAudKAoYJuavWMmRSYc9IC1AYmdTyBwqzB4UJxIwXWCWz0oavQ7OplO+7PdZuenKTFuLUo+VDq0A0OF469kXTTM+/iEaDSoFkPAghYJ8eJUr+9+jSC5PeDhyuHeZSUV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(145744241990776)(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(520078)(10201501046)(3002001);SRVR:CY1PR0301MB2009;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB2009; X-Forefront-PRVS: 0751474A44 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0301MB2009;23:YvTMspbMRUVXJNaCvIH1Bopk+FFQ4yLluQ81TCx?= =?us-ascii?Q?CFd6gC8IzUpL8LJL/l9yyNCqgWuZnPDYvDijXXrTIdGZtshRLspyoyDaySXT?= =?us-ascii?Q?TlEXK+jLwE6FjImkHHNeNmQZ7xZeKvqr35v8WDvaFufL82k3oX1FBSqlm5h/?= =?us-ascii?Q?fUXOWILWdOYoNxYwyRrYoP7src+D43Z9CtBx9+aKnOLXekv3hcDP8dcosKu8?= =?us-ascii?Q?Qb04YgXMTOwJw5zbTRU8HODcuboNRCLNja+Ncs1JJgWBAAS7LtFvTFFdu9OO?= =?us-ascii?Q?+dMkmsdiH7b/t487/DmqtzS/XPnCuQcjd0ZdgAPj0qfzGHtDPH4HGxeP6xfo?= =?us-ascii?Q?kxhBqKsHuqzKAj5Hk40dYEfXX828OFrJRs5mLLnSMbrgsZvKh/VBiK0Td3Jo?= =?us-ascii?Q?ozIX3F+UdpWxqzcPFmXtAdCJaXJYu/orulwYwDTuILYyZGe7iYYRTzybkVBN?= =?us-ascii?Q?3AvgunHw8RkzAhMVMSUbfgP4syfS2oxoGJqvLkDS/wKs2fPJS10BZ0gQOEOE?= =?us-ascii?Q?znxkBvgVjlKuv31L4FT6czFuZWzV9B/sXpWUuimngzrLcwVhks+I7Td/+urg?= =?us-ascii?Q?t6dNPTc61J2nGOKwXXQStOBqzAT3FbTfqQcHeokI+M9pFWj41phCP0pNOkDC?= =?us-ascii?Q?tvwv74PyXHblBfLSxQIbFZDydQHqD8j2HHB8+01TPhZnqRcpN5AXb2dVYJQM?= =?us-ascii?Q?N3sYyuMBYTm/ydvGrdWKMut7xgepy1EwRhR4us6ruOkeJknsZgjtd2pyepeD?= =?us-ascii?Q?6wxc7WU0y2CuP8TIHUv6pgLoi3+cE0Jma/j98lIyww6K56mv58zclsjL7WkL?= =?us-ascii?Q?zYPbkSGk/R6PDSsYHwP3xhBKaeLT7vKyzJmjePB5ZKEw3JgsYnqZ2ZIVAP89?= =?us-ascii?Q?/XppqMazl46syx2Q5fG1/bFtPfk8js8tG6iLbJhEGs72aLMRn7N9ppIQHxHC?= =?us-ascii?Q?Zcd2w0dpciJCgdr9sKu2p5mogmAXrTqS6a2RqnNY/33p371LoLql0nPbktQ0?= =?us-ascii?Q?w1sfRi+vyahTcvkzeaV6Jdri1A1v0u+y2BLft3N2bmUnZuQ0Uw7VuzRK02Ot?= =?us-ascii?Q?hbwp4QtI8SYNV558DWDa6lOWPDDVQJWgkHM0GP972f5BkKFdxRw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB2009;5:g02S0kiA9Zo005k+eqHIaEdnXFpgJ1hi+sb8JV3XHcWb9FpXMaSWetD1TZb0dyl30IRDSQkYQ51HidRRxlNIhYSYiB//LnddJ1WPSp1dqhT3Vwk3kTnhUfc849784KD0b6ZK7scgQ115bj1aK4OxyA==;24:/UoqGdXAQ3UOOZjcRgVIYinYXEGgEVT3WGJvL4bRcIKl7l1UCqGvueaR41wk4kLT3jsOC33LRxUsp5EtEiYjXT+I96sSH/Qq4j0NqmEDB9g=;20:hJMXbFjcgz9yOedJXGkKV8xD6a0GyE8Q5tCe0LGk7FNQaNEAbQaKcp0vC8dBgt5zBrisGlrTPoiAXcv12yehEw== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2015 02:15:19.8707 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB2009 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3453 Lines: 92 On Tue, Nov 03, 2015 at 09:51:11PM -0600, Felipe Balbi wrote: > > Hi, > > Peter Chen writes: > > On Tue, Nov 03, 2015 at 07:56:55AM -0600, Felipe Balbi wrote: > >> > >> Hi, > >> > >> Nathan Sullivan writes: > >> > The USB OTG support currently depends on power management > >> > (CONFIG_PM) being enabled, but does not actually need it enabled. > >> > Remove this dependency. > >> > > >> > Tested on Bay Trail hardware with dwc3 USB. > >> > > >> > Signed-off-by: Nathan Sullivan > >> > --- > >> > drivers/usb/core/Kconfig | 1 - > >> > 1 file changed, 1 deletion(-) > >> > > >> > diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig > >> > index a99c89e..9c5cdf3 100644 > >> > --- a/drivers/usb/core/Kconfig > >> > +++ b/drivers/usb/core/Kconfig > >> > @@ -43,7 +43,6 @@ config USB_DYNAMIC_MINORS > >> > > >> > config USB_OTG > >> > bool "OTG support" > >> > - depends on PM > >> > >> I don't think this is correct. OTG depends on USB bus suspend, which is > >> only available on PM builds. Care to further detail why you think PM is > >> not needed on OTG ? > >> > > > > OTG depends on USB bus suspend is not a must, the hardware controlled OTG > > design do HNP when the bus goes to suspend; but if the software > > implements OTG FSM, it is the user option whether do HNP, and bus > > suspend is controlled by OTG FSM software (stop SOF), but not by host > > stack (eg, ehci). > > > > I am sorry I did not consider the legacy OTG design, this patch should > > be dropped. > > there is no "legacy" OTG design. OTG requires a bus suspend to enter > HNP, and that's achieved by stopping all transfers and avoid new URB > submission so usbcore can put the bus in suspend (by means of USB > autosuspend). If you're bypassing that in the OTG FSM thing, that needs > to be fixed ASAP as that makes it a lot harder for any generic changes > in usbcore to be validated. Specially when you consider not many will > have whatever special HW which, likely, doesn't even work with mainline > to validate a change. > Felipe, thanks for your comments. But you may need to consider the user option ~a_bus_req (for A) and b_bus_req (for B) when do HNP, we can't do HNP without user option. - Eg, if the bus enters suspend, but the A does not want role switch, we can't try to do HNP, the same for B device. - The A device may want to support auto-suspend but without role switch. You are absolutely right, the SAFE HNP needs to do auto-suspend first, we need to add this in documentation. But it does not mean OTG FSM design is incorrect, there are two things, eg, if we want to do HNP safely, we need to do below things: /* B requests HNP */ echo 1 > /sys/bus/../otg_fsm//inputs/b_bus_req /* Put the A to suspend */ echo auto > /sys/bus/usb/devices/1-1/power/control /* A goes to try HNP */ echo 0 > /sys/bus/../otg_fsm/inputs/a_bus_req > Please, make sure to fix that design so that HNP *always* goes through > the proper code path. If you have devices which would prevent HNP > because their class driver (host side driver) would never autosuspend, > fix that as well. > -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/