Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp436123pxa; Tue, 11 Aug 2020 06:50:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzokOQHoaBZc54/HhW3et3IED754vhxMNk/S7xKQIEubOnDTLS9Yqfaonk8awddt/1YTerR X-Received: by 2002:aa7:d585:: with SMTP id r5mr25677311edq.30.1597153829215; Tue, 11 Aug 2020 06:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597153829; cv=none; d=google.com; s=arc-20160816; b=cPrsNGRMaOZnUHnoGHgAUQBn4S9ivJlPFhJD/7mp2AavhSW+x1vP1vuqVcN8YRJXZJ euXXJpHfqOmxeyvaUh+mZ0tJDycBKzoaAntFCm9L3OLU3FmDb9J47B3g37MyfzLU5NzJ U9amPnSA/MJlSwUSwL82gmrCqjVkNY5j8hpDAgRXyR3ptTuSvEiLNOIzyoLDdMBHLcPt 1/6zR7rLejWVmBdS1RDDb2Ri/GnNax1yoKSH4WrRnzQ6FSr409L9dI5PhvVfcOy2IdaQ s+9vwOS85mHbw16POkQq8iV+X/MPhD/fuBWvCLfTwhXcwcPY/jA6vXjyC6YD/Nog4RnQ oVBw== 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=rPzXb3JKI6+zMIeZ4FLUPBIOUQ5gXS5LTTQbMWWQ3U0=; b=axOONMLL8+BnVqmX0iRjM2XMLMsTFga2M2vH785RhFvK1PulYMSOOMiNx4yTbSH1sb UvkVMV01Y/1tLvC4ZxfRrwxsio88P+M1eJCuYtqdo45p+yOdZLvkG60wBh4HuG9+FFhz fCwTS7wtVpiT80NnMAY+2r7sunorLbnZIxeG9daASmqgXXGyKEbO4IWt8Uozc079WoyB kCzCO9gElghyF1bO+c63RKmx5jruoFdhncPWgniG8BO3bw2gWGxoYhZ4zUd8hQq8uZSU rH6WEfwGeHYYGeog02BKXubg5x20GrlaNo51CMh2nhH0GWfTb62r/uV8BfuWu+k8uCXq JgjQ== 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 a9si11748897ejb.116.2020.08.11.06.50.06; Tue, 11 Aug 2020 06:50:29 -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 S1728750AbgHKNsy (ORCPT + 99 others); Tue, 11 Aug 2020 09:48:54 -0400 Received: from netrider.rowland.org ([192.131.102.5]:39677 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728738AbgHKNsw (ORCPT ); Tue, 11 Aug 2020 09:48:52 -0400 Received: (qmail 332045 invoked by uid 1000); 11 Aug 2020 09:48:51 -0400 Date: Tue, 11 Aug 2020 09:48:51 -0400 From: Alan Stern To: Martin Kepplinger Cc: James Bottomley , Bart Van Assche , 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: <20200811134851.GB331864@rowland.harvard.edu> References: <9b80ca7c-39f8-e52d-2535-8b0baf93c7d1@puri.sm> <425990b3-4b0b-4dcf-24dc-4e7e60d5869d@puri.sm> <20200807143002.GE226516@rowland.harvard.edu> <20200808150542.GB256751@rowland.harvard.edu> <20200809152643.GA277165@rowland.harvard.edu> <60150284-be13-d373-5448-651b72a7c4c9@puri.sm> <20200810141343.GA299045@rowland.harvard.edu> <6f0c530f-4309-ab1e-393b-83bf8367f59e@puri.sm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6f0c530f-4309-ab1e-393b-83bf8367f59e@puri.sm> 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 Tue, Aug 11, 2020 at 09:55:54AM +0200, Martin Kepplinger wrote: > On 10.08.20 16:13, Alan Stern wrote: > > This may not matter... but it's worth pointing out that > > expecting_media_change doesn't get cleared if ++scmd->retries > > > scmd->allowed. > > absolutely worth pointing out and I'm not yet sure about that one. > > > > > It also doesn't get cleared in cases where the device _doesn't_ > > report a Unit Attention. > > true. but don't we set the flag for a future UA we don't yet know of? If > we would want to clear it outside of a UA, I think we'd need to keep > track of a suspend/resume cycle and if we see that we *had* successfully > "done requests" after resuming, we could clear it... The point is that expecting_media_change should apply only to the _next_ command. It should be cleared after _every_ command. You do not want to leave it hanging around -- if you do then you will miss real media changes. There's a potential issue when a bunch of commands get sent and completed all at once, but hopefully it won't matter here. Alan Stern