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.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 99A71C433E0 for ; Wed, 24 Jun 2020 07:23:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A5AF207DD for ; Wed, 24 Jun 2020 07:23:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389688AbgFXHXW (ORCPT ); Wed, 24 Jun 2020 03:23:22 -0400 Received: from comms.puri.sm ([159.203.221.185]:50860 "EHLO comms.puri.sm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389661AbgFXHXV (ORCPT ); Wed, 24 Jun 2020 03:23:21 -0400 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id DBD3CE04A4; Wed, 24 Jun 2020 00:22:50 -0700 (PDT) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tz9axVlavMTx; Wed, 24 Jun 2020 00:22:49 -0700 (PDT) Subject: Re: Microchip USB2642 Hub not resuming from USB autosuspend To: Alan Stern Cc: "mathias.nyman@intel.com" , "gregkh@linuxfoundation.org" , Felipe Balbi , "p.zabel@pengutronix.de" , nicolas.ferre@microchip.com, ludovic.desroches@microchip.com, cristian.birsan@microchip.com, iain.galloway@nxp.com, "linux-usb@vger.kernel.org" , "kernel@puri.sm" , "linux-arm-kernel@lists.infradead.org" References: <8738e4d3-62b1-0144-107d-ff42000ed6c6@puri.sm> <021b18e4-343d-76d2-5d35-817d576f503e@puri.sm> <20200623145453.GA178927@rowland.harvard.edu> From: Martin Kepplinger Autocrypt: addr=martin.kepplinger@puri.sm; keydata= mQINBFULfZABEADRxJqDOYAHfrp1w8Egcv88qoru37k1x0Ugy8S6qYtKLAAt7boZW+q5gPv3 Sj2KjfkWA7gotXpASN21OIfE/puKGwhDLAySY1DGNMQ0gIVakUO0ji5GJPjeB9JlmN5hbA87 Si9k3yKQQfv7Cf9Lr1iZaV4A4yjLP/JQMImaCVdC5KyqJ98Luwci1GbsLIGX3EEjfg1+MceO dnJTKZpBAKd1J7S2Ib3dRwvALdiD7zqMGqkw5xrtwasatS7pc6o/BFgA9GxbeIzKmvW/hc3Q amS/sB12BojyzdUJ3TnIoAqvwKTGcv5VYo2Z+3FV+/MJVXPo8cj2vmfxQx1WG4n6X0pK4X8A BkCKw2N/evMZblNqAzzGVtoJvqQYkzQ20Fm+d3wFl6lS1db4MB+kU13G8kEIE22Q3i6kx4NA N49FLlPeDabGfJUyDaZp5pmKdcd7/FIGH/HjShjx7g+LKSwWNMkDygr4WARAP4h8zYDZuNqe ofPvMLqJxHeexBPIGF/+OwMyTvM7otP5ODuFmq6OqjNPf1irJmkiFv3yEa+Ip0vZzwl4XvrZ U0IKjSy2rbRLg22NsJT0XVZJbutIXYSvIHGqSxzzfiOOLnRjR++fbeEoVlRJ4NZHDKCh3pJv LNd+j03jXr4Rm058YLgO7164yr7FhMZniBJw6z648rk8/8gGPQARAQABtC1NYXJ0aW4gS2Vw cGxpbmdlciA8bWFydGluLmtlcHBsaW5nZXJAcHVyaS5zbT6JAk4EEwEIADgWIQTyCCuID55C OTRobj9QA5jfWrOH0wUCXPSlkwIbAwULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRBQA5jf WrOH06/FEACC/GTz88DOdWR5JgghjtOhaW+EfpFMquJaZwhsaVips7ttkTKbf95rzunhkf2e 8YSalWfmyDzZlf/LKUTcmJZ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:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 In-Reply-To: <20200623145453.GA178927@rowland.harvard.edu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On 23.06.20 16:54, Alan Stern wrote: > On Tue, Jun 23, 2020 at 03:48:01PM +0200, Martin Kepplinger wrote: > >> We've resolved this issue too. When scsi (sd) runtime pm is not enabled >> by default, it needs to be enabled of course and events_dfl_poll_msecs >> for the block layer set to 0. > > Actually that last step isn't needed. But if you don't do it, the device > will wake up from runtime suspend every time the block layer polls it. So > you probably do want to either turn off polling or increase the polling > interval significantly. true, thanks for pointing that out. a long interval is totally an option too. > >> scsi sd has until now incomplete support for runtime pm and this >> addition makes it work, i.e. suspend when not mounted: >> https://lore.kernel.org/linux-scsi/20200623111018.31954-1-martin.kepplinger@puri.sm/T/ >> the whole USB path is suspended as a consequence - and woken up if opened. > > I don't understand this. As far as I know, runtime-PM support in the SCSI > and block layers has been complete for many years. If you have to do > anything extra (like applying the patch in the email you mentioned) then > something is broken. The device should be able to go into runtime suspend > just fine with the current code -- even when a file system is mounted. > The scsi and usb layers have good implementations for runtime pm for a long time indeed. The scsi drivers though vary: for example sr indeed suspends when unused, when mounted and open too. look at the sd driver in comparison though: From what I see, it "uses" autopm (runtime pm) as it would let the device suspend, but never resumes from it (except when removing and probing again). My suspicion is that it's not really used for that reason. I might be wrong of course - I usually don't look at scsi code and I'm so thankful for feedback. That's what I read though and also what my tests verify. Hence the patch to the sd driver that makes enabling runtime pm result in a usable device (granted, not yet saving as much power as it really could, but that can be added later). so thanks for your feedback again, martin > Alan Stern > 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.5 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 99182C433E0 for ; Wed, 24 Jun 2020 07:24:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 670BA2073E for ; Wed, 24 Jun 2020 07:24:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rhPMR8UV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 670BA2073E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=puri.sm Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:Date:Message-ID:From:References:To: Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2Ovz3pQp0GCp7W2mNHbVQxkRAQLC3PxcgjS3k98AJJg=; b=rhPMR8UVGNr6v2Q4NJHYscck2c O3V7fpczqbbKhhZM703dmA3Yp3aJf0VRvR6tOL44xJ/w/fVZkecmixqKVNF3m438L16R8lSJCkSTe HPTmLxHH+0cHxrTBKzGdw256Po++l7qtYsfKJka1G8DFZHvPfpOj6/9h2RbbXk6IcjLidSb+tx9rH p4xGEx5kPDDWWXolcICb4ConMzZQTzSSWWDEp1+8vWz2mWcL8r9SKudp4lavVttE/5ToDNfDm4Ndu V9psgzQie6+PWzshvltXz9nE1jsOLEV2aMIBBd4dfeYembSRv/oKB5cRC4gPYTcsqL432iLPLLVkL MTMb9kWA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnzkT-00032D-E3; Wed, 24 Jun 2020 07:23:09 +0000 Received: from comms.puri.sm ([159.203.221.185]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnzkR-000315-4x for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 07:23:08 +0000 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id DBD3CE04A4; Wed, 24 Jun 2020 00:22:50 -0700 (PDT) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tz9axVlavMTx; Wed, 24 Jun 2020 00:22:49 -0700 (PDT) Subject: Re: Microchip USB2642 Hub not resuming from USB autosuspend To: Alan Stern References: <8738e4d3-62b1-0144-107d-ff42000ed6c6@puri.sm> <021b18e4-343d-76d2-5d35-817d576f503e@puri.sm> <20200623145453.GA178927@rowland.harvard.edu> From: Martin Kepplinger Autocrypt: addr=martin.kepplinger@puri.sm; keydata= mQINBFULfZABEADRxJqDOYAHfrp1w8Egcv88qoru37k1x0Ugy8S6qYtKLAAt7boZW+q5gPv3 Sj2KjfkWA7gotXpASN21OIfE/puKGwhDLAySY1DGNMQ0gIVakUO0ji5GJPjeB9JlmN5hbA87 Si9k3yKQQfv7Cf9Lr1iZaV4A4yjLP/JQMImaCVdC5KyqJ98Luwci1GbsLIGX3EEjfg1+MceO dnJTKZpBAKd1J7S2Ib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AAsm4Z OwwzhG6iz+9mGakJBWjXEKxnAotuI2FCLWZV/Zs8tfhkbeqYFO8Vlz3o0sj+r63sWFkVTXOb X7jCQUwW7HXEdMaCaDfC6NUkkKT1PJIBC+kpcVPSq4v/Nsn+yg+K+OGUbHjemhjvS77ByZrN /IBZOm94DSYgZQJRTmTVYd96G++2dMPOaUtWjqmCzu3xOfpluL1dR19qCZjD1+mAx5elqLi7 BrZgJOUjmUb/XI/rDLBpoFQ/6xNJuDA4UTi1d+eEZecOEu7mY1xBQkvKNXL6esqx7ldieaLN Af4wUksA+TEUl2XPu84pjLMUbm0FA+sUnGvMkhCn8YdQtEbcgNYq4eIlOjHW+h7zU2G5/pm+ FmxNAJx7iiXaUY9KQ3snoEz3r37RxEDcvTY9KKahwxEzk2Mf58OPVaV4PEsRianrmErSUfmp l93agbtZK1r5LaxeItFOj+O2hWFLNDenJRlBYwXwlJCiHxM/O273hZZPoP8L5p54uXhaS5EJ uV2Xzgbi3VEbw3GZr+EnDC7XNE2wUrnlD/w2W6RzVYjVT6IX4SamNlV+MWX0/1fYCutfqZl8 6BSKmJjlWpfkPKzyzjhGQVZrTZYnKAu471hRv8/6Dx5JuZJgDCnYanNx3DDreRMu/nq6TfaO ekMtxgNYb/8oDry09UFHbGHLsWn6oBo= Message-ID: Date: Wed, 24 Jun 2020 09:22:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 In-Reply-To: <20200623145453.GA178927@rowland.harvard.edu> Content-Language: en-US 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: Felipe Balbi , "kernel@puri.sm" , "mathias.nyman@intel.com" , "gregkh@linuxfoundation.org" , "linux-usb@vger.kernel.org" , ludovic.desroches@microchip.com, "linux-arm-kernel@lists.infradead.org" , "p.zabel@pengutronix.de" , iain.galloway@nxp.com, cristian.birsan@microchip.com MIME-Version: 1.0 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 On 23.06.20 16:54, Alan Stern wrote: > On Tue, Jun 23, 2020 at 03:48:01PM +0200, Martin Kepplinger wrote: > >> We've resolved this issue too. When scsi (sd) runtime pm is not enabled >> by default, it needs to be enabled of course and events_dfl_poll_msecs >> for the block layer set to 0. > > Actually that last step isn't needed. But if you don't do it, the device > will wake up from runtime suspend every time the block layer polls it. So > you probably do want to either turn off polling or increase the polling > interval significantly. true, thanks for pointing that out. a long interval is totally an option too. > >> scsi sd has until now incomplete support for runtime pm and this >> addition makes it work, i.e. suspend when not mounted: >> https://lore.kernel.org/linux-scsi/20200623111018.31954-1-martin.kepplinger@puri.sm/T/ >> the whole USB path is suspended as a consequence - and woken up if opened. > > I don't understand this. As far as I know, runtime-PM support in the SCSI > and block layers has been complete for many years. If you have to do > anything extra (like applying the patch in the email you mentioned) then > something is broken. The device should be able to go into runtime suspend > just fine with the current code -- even when a file system is mounted. > The scsi and usb layers have good implementations for runtime pm for a long time indeed. The scsi drivers though vary: for example sr indeed suspends when unused, when mounted and open too. look at the sd driver in comparison though: From what I see, it "uses" autopm (runtime pm) as it would let the device suspend, but never resumes from it (except when removing and probing again). My suspicion is that it's not really used for that reason. I might be wrong of course - I usually don't look at scsi code and I'm so thankful for feedback. That's what I read though and also what my tests verify. Hence the patch to the sd driver that makes enabling runtime pm result in a usable device (granted, not yet saving as much power as it really could, but that can be added later). so thanks for your feedback again, martin > Alan Stern > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel