[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200811134851.GB331864@rowland.harvard.edu>
Date: Tue, 11 Aug 2020 09:48:51 -0400
From: Alan Stern <stern@...land.harvard.edu>
To: Martin Kepplinger <martin.kepplinger@...i.sm>
Cc: James Bottomley <James.Bottomley@...senpartnership.com>,
Bart Van Assche <bvanassche@....org>,
Can Guo <cang@...eaurora.org>, martin.petersen@...cle.com,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel@...i.sm
Subject: Re: [PATCH] scsi: sd: add runtime pm to open / release
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
Powered by blists - more mailing lists