Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2038302ybt; Sun, 28 Jun 2020 06:11:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlegUlG9/jJrpacppkclZYOr6HaAFMpqicLzZ4nbLENt+NnxDMSd/2Zq+f4c89GVYsR05j X-Received: by 2002:a50:eb06:: with SMTP id y6mr12505070edp.143.1593349895837; Sun, 28 Jun 2020 06:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593349895; cv=none; d=google.com; s=arc-20160816; b=A8rhqyPsbKy+nq76HAddtM3bULDDUREbz3TS+2CUJbqFq0j+V/pXdZMky2eDRlUvn2 u5hxh3RaT0vRcjLu0jiAVS2NpGK5FTwnj4kyiL6Ev2CMri4fF76QUB6FWvEqyGifmYnT ZlqrvUXZJoTNMBn8hH4Nw1VbES+n0ObpoA0W/MF1I5Mykysf39RtlGs9E6V8dU33Cvuc DomRS851xpglOhhfLtYHiB5Mmyb8zFWsH10N3nhPFacp+0XTzRsduQiq//KWMvh7qU+O OKCq9NeVOIvYuAH7NK+XaTKma7uwra2Z2YGaRnTx/VNOMXuRjA3sZ1PG//q9c4REVua2 Dstw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=toMjgodirjLSQRSa2uAYk5LdMG4FrOodxiaT9/o/NV4=; b=HRAjrEjtYobHMqrHZAlKiQ1xhPHTPxfpoTBTlKil17TPJwkaql32SLi3syyjFj/gyg UOgfzI7v4ZOwQpfXb47LKWqRs/O57jRiidFUAJWbWLe589sxIuxQ50kZtYoo2TbEOJXu NY3cWXVFzQxQdzQpB+D0z20aeIFFAcR+WqlmlXFEae0mwZMSClDPPalPW85mhI7l7o5n va7Ru10xlRqeFsdciqLaiVn04wBhOiIn9xilvqxPdqLtCkTOjqiI3TWC/MtAno0jHTH0 at2GCJdyuPh1qQxdLdNVU8E64rom9I7Desu9ex89vhEdal5VXeitMMCY0q0sS1XtYv3z E1WQ== 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 e9si15079822edn.579.2020.06.28.06.11.10; Sun, 28 Jun 2020 06:11:35 -0700 (PDT) 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 S1726395AbgF1NK6 (ORCPT + 99 others); Sun, 28 Jun 2020 09:10:58 -0400 Received: from netrider.rowland.org ([192.131.102.5]:51411 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726342AbgF1NK6 (ORCPT ); Sun, 28 Jun 2020 09:10:58 -0400 Received: (qmail 367302 invoked by uid 1000); 28 Jun 2020 09:10:56 -0400 Date: Sun, 28 Jun 2020 09:10:56 -0400 From: Alan Stern To: Bart Van Assche Cc: Martin Kepplinger , jejb@linux.ibm.com, Can Guo , martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@puri.sm Subject: Re: [PATCH] scsi: sd: add runtime pm to open / release Message-ID: <20200628131056.GA366822@rowland.harvard.edu> References: <20200623111018.31954-1-martin.kepplinger@puri.sm> <1379e21d-c51a-3710-e185-c2d7a9681fb7@acm.org> <20200626154441.GA296771@rowland.harvard.edu> <5c10d65c-14ba-d2d5-ee7f-c4579432823e@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5c10d65c-14ba-d2d5-ee7f-c4579432823e@acm.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 27, 2020 at 07:37:54PM -0700, Bart Van Assche wrote: > On 2020-06-26 08:44, Alan Stern wrote: > > On Fri, Jun 26, 2020 at 08:07:51AM -0700, Bart Van Assche wrote: > >> As far as I know runtime power management support in the sd driver is working > >> fine and is being used intensively by the UFS driver. The following commit was > >> submitted to fix a bug encountered by an UFS developer: 05d18ae1cc8a ("scsi: > >> pm: Balance pm_only counter of request queue during system resume") # v5.7. > > > > I just looked at that commit for the first time. > > > > Instead of making the SCSI driver do the work of deciding what routine to > > call, why not redefine blk_set_runtime_active(q) to simply call > > blk_post_runtime_resume(q, 0)? Or vice versa: if err == 0 have > > blk_post_runtime_resume call blk_set_runtime_active? > > > > After all, the two routines do almost the same thing -- and the bug > > addressed by this commit was caused by the difference in their behaviors. > > > > If the device was already runtime-active during the system suspend, doing > > an extra clear of the pm_only counter won't hurt anything. > > Hi Alan, > > Do you want to submit a patch that implements this change or do you > perhaps expect me to do that? I'll submit a patch in a few days. I just wanted to check first that the idea was sound. Alan Stern