Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1403383pxb; Fri, 20 Nov 2020 08:39:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfcaAbtK+5QVobX5ofPock6ftxWiLZkyL1loxPHKKnksz4qqvAC6d96n/4IyYHOB6stKwZ X-Received: by 2002:aa7:c704:: with SMTP id i4mr35781117edq.51.1605890392423; Fri, 20 Nov 2020 08:39:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605890392; cv=none; d=google.com; s=arc-20160816; b=p20U7w/Lz+YqwL1bGRz8l+niEXW46FKngBVgNO8YNXd/tf5d3hd392gvr4V7iADloI cZDoYJ4LOjDJc+SW8Szx30YuAu7jspI0CFpb3GCS4m4l/ulUBuiDfCsLqTWdz0+ENzmN zkrorA+YAobNSiweWAaQhsDo1cuu4uigLBSpcOMIAYaRrWZ1yqabU9GYw0p+RPwHz4JQ QdYFAAqSe5ozS2byCMJsshCuetP/9QIKt6wlk0T3F0YcANtB6aYsAs9Okf+VsWDGbO07 db9IQhKlxr0OfhrcirKVw8XcrJpvONiBDTpcq46QHRqlmMWnr5MdFCEAysj6ADuM7ciF 50tw== 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=Pb+mBZWJyeminiLRpYsYwQx5KCWMP9B8Vlr8y2EDvgc=; b=tEeAj4jZ5vlpFEtXWnu/8C3AM/m2ab3BMeKK9dTKMq4XDGyPfIVND+3fMfFT94zxlR 6q3cZZJYCIZFpUn7hboXopK4qtekcQkaK8gmHBIwpq2hAzOLQFoPomIeeOoKKApMa3HY +zxxaV252rjhhtAyHuNv+MQnEdrhhjjAa1gP5eE/on15RgyTTG2E4nVlzivdoDHOeeQw GDgwhghgQIRIa5+yAI3lkYV5WlJhZD80MkxWlarsvrnhqJHBskAwYVyNv9qlNMYgG339 ylcQRnlEyWKPuU0jKWKEhrOLU83hd/gBS+jEk0DOqB2628kpqqZn/o9dpu9NtE8zhGGC HD+g== 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 g26si2058612edy.14.2020.11.20.08.39.27; Fri, 20 Nov 2020 08:39:52 -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 S1728220AbgKTQfZ (ORCPT + 99 others); Fri, 20 Nov 2020 11:35:25 -0500 Received: from netrider.rowland.org ([192.131.102.5]:60601 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728673AbgKTQfZ (ORCPT ); Fri, 20 Nov 2020 11:35:25 -0500 Received: (qmail 620760 invoked by uid 1000); 20 Nov 2020 11:35:24 -0500 Date: Fri, 20 Nov 2020 11:35:24 -0500 From: Alan Stern To: Can Guo Cc: 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 , Bart Van Assche , "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: <20201120163524.GB619708@rowland.harvard.edu> References: <1605861443-11459-1-git-send-email-cang@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1605861443-11459-1-git-send-email-cang@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Alan Stern > Cc: Stanley Chu > Cc: Bart Van Assche > Cc: Alan Stern > Signed-off-by: Can Guo > --- > > Changes since v1: > - Incorporated Bart's comments > > --- > drivers/scsi/scsi_pm.c | 24 +----------------------- > 1 file changed, 1 insertion(+), 23 deletions(-) > > diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c > index 3717eea..908f27f 100644 > --- a/drivers/scsi/scsi_pm.c > +++ b/drivers/scsi/scsi_pm.c > @@ -79,25 +79,6 @@ static int scsi_dev_type_resume(struct device *dev, > scsi_device_resume(to_scsi_device(dev)); > dev_dbg(dev, "scsi resume: %d\n", err); > > - if (err == 0) { > - pm_runtime_disable(dev); > - err = pm_runtime_set_active(dev); > - pm_runtime_enable(dev); > - > - /* > - * Forcibly set runtime PM status of request queue to "active" > - * to make sure we can again get requests from the queue > - * (see also blk_pm_peek_request()). > - * > - * The resume hook will correct runtime PM status of the disk. > - */ > - if (!err && scsi_is_sdev_device(dev)) { > - struct scsi_device *sdev = to_scsi_device(dev); > - > - blk_set_runtime_active(sdev->request_queue); > - } > - } > - > return err; > } > > @@ -165,11 +146,8 @@ static int scsi_bus_resume_common(struct device *dev, > */ > if (strncmp(scsi_scan_type, "async", 5) != 0) > async_synchronize_full_domain(&scsi_sd_pm_domain); > - } else { > - pm_runtime_disable(dev); > - pm_runtime_set_active(dev); > - pm_runtime_enable(dev); > } > + > return 0; > } > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project. >