Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2124731pxb; Sat, 21 Nov 2020 09:36:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvDTP5W88HbrYzp9Bf6Ddf//6IfJOVTrb7Dz/bbFWaR4iuuElUFvWLkgsco7jdOsBKgUs4 X-Received: by 2002:aa7:d711:: with SMTP id t17mr40736940edq.83.1605980187800; Sat, 21 Nov 2020 09:36:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605980187; cv=none; d=google.com; s=arc-20160816; b=Tb6fw2nnlTTi+7zfzLH1oIvmrlMNLvP+xtpPDJl+eP0K5+gw6ViDup6Zp8yP5gXJaV 5FpMs6AJbTrSFwF5MeFmm4DdZBPwA5inh9mYQcSWxNmfs2WC+DFvUc4fmw1yitdRlqIP WWSPXsgoXSpRxylW0VBvWUzGPEYEc7wqfby7xB96pwFye8WKRA8ck7BVwKRpFu34gXHJ 2ug7wwcWX0eaEP8LEDZ7i1TLB3hTm4R+Lec9cXracVv6wDS7QHe3dTTpOeLS/0DE5lGW 09ueaSzW3B4Cd1vGDkVMrk+UnoiH18fr0H6aMx53SVrDCekyNgcY69/MlrF6RKPhkG7k SD4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=PkdusevkA9ZnqPaSfTOLWaf/KaLNv2ICnT1HtnfXbyk=; b=Sf7r+CIH3xSc6DQejW1jK9X48z4NCtj22FwuYZg/UW0QqCz3FEdy+ALl0RtRrPrBRQ YCvfTYxWllXWUZ2iFrLMao3keE57vHGJM4yW/wHwGoXUfIluNjYv9U+49zDxVicOAPCm k8wwVSisBrjDj4J6O23aIZgBV7u2F0LIq9dA2lg9crr9fmHSKcbJof+Xxjg+RkhB63Of xgYWuShYYrK/D1rrty60qtKLGXl3AHP6o3j9JMuzHWuHNlrUQAn+Ws7u975wN3mjfOed eKzNUAwaAj0X5LIoAohGyyLw0X4hGFHfN3E1+WyzfGZWbSzcVVZkg5wYzhfwqp/BIew7 OQzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qx23si3931266ejb.362.2020.11.21.09.36.01; Sat, 21 Nov 2020 09:36:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726672AbgKURcd (ORCPT + 99 others); Sat, 21 Nov 2020 12:32:33 -0500 Received: from netrider.rowland.org ([192.131.102.5]:57873 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726305AbgKURcd (ORCPT ); Sat, 21 Nov 2020 12:32:33 -0500 Received: (qmail 658838 invoked by uid 1000); 21 Nov 2020 12:32:31 -0500 Date: Sat, 21 Nov 2020 12:32:31 -0500 From: Alan Stern To: Bart Van Assche Cc: Can Guo , asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, ziqichen@codeaurora.org, rnayak@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, Stanley Chu , "James E.J. Bottomley" , "Martin K. Petersen" , Matthias Brugger , open list , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" Subject: Re: [PATCH RFC v2 1/1] scsi: pm: Leave runtime PM status alone during system resume/thaw/restore Message-ID: <20201121173231.GA657814@rowland.harvard.edu> References: <1605861443-11459-1-git-send-email-cang@codeaurora.org> <20201120163524.GB619708@rowland.harvard.edu> <9df460a7-c7fc-4999-bfaa-076229b8a752@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9df460a7-c7fc-4999-bfaa-076229b8a752@acm.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 21, 2020 at 09:00:02AM -0800, Bart Van Assche wrote: > On 11/20/20 8:35 AM, Alan Stern wrote: > > On Fri, Nov 20, 2020 at 12:37:22AM -0800, Can Guo wrote: > >> Runtime resume is handled by runtime PM framework, no need to forcibly > >> set runtime PM status to RPM_ACTIVE during system resume/thaw/restore. > > > > Sorry, I don't understand this explanation at all. > > > > Sure, runtime resume is handled by the runtime PM framework. But this > > patch changes the code for system resume, which is completely different. > > > > Following a system resume, the hardware will be at full power. We don't > > want the kernel to think that the device is still in runtime suspend; > > otherwise is would never put the device back into low-power mode. > > Hi Alan, > > Does this mean that every driver needs similar code for handling runtime > suspended devices upon system resume? If so, would it be possible to > move that code into the power management core (drivers/base/power)? That's a complicated story. In short, many drivers need to do this, but not all. There is a complex collection of settings available for subsystems or drivers that would like their devices to remain in runtime system across a system sleep. For the subsystems/drivers that don't care to deal with this complexity or don't have any special requirements -- yes, they all need to include code like this in their system-resume paths. I had a very long discussion with Rafael Wysocki about all this starting last March; you can find the relevant emails beginning roughly here: https://marc.info/?l=linux-pm&m=158516934924947&w=2 and continuing through a few different threads. Rafael ended up making a large number of changes to the PM core and API to simplify things, straighten them out, and improve the documentation. But we never did try to add this automatic set-runtime-active thing into the core. Probably we wanted all the other changes to settle down before trying to do it, and then just forgot about it. In fact, I'm not certain that it is possible now, but we should look into it. Alan Stern