From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Lu Subject: Re: [PATCH] scsi: sr: use block layer runtime PM Date: Fri, 06 Sep 2013 09:36:03 +0800 Message-ID: <52293183.3050400@intel.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-scsi-owner@vger.kernel.org To: Alan Stern Cc: James Bottomley , "Rafael J. Wysocki" , Linux-pm mailing list , SCSI development list List-Id: linux-pm@vger.kernel.org On 09/05/2013 10:25 PM, Alan Stern wrote: > On Thu, 5 Sep 2013, Aaron Lu wrote: > >> Migrate SCSI Optical Disk Drive(ODD) driver sr to make use of block >> layer runtime PM. Accordingly, the SCSI bus layer runtime PM callback is >> simplified as all SCSI devices that implement runtime PM are now request >> based. >> >> Signed-off-by: Aaron Lu >> --- >> Note that due to ODD will be polled every 2 seconds, for suspend to >> actually happen, the autosuspend_delay can not be set to more than 2 >> seconds. > > Or the polling delay must be increased. > >> Also, make sure to use the util-linux utility of version 2.23.2 or later, >> as there is a bug fix for eject command to correctly update the ODD's >> locked state. If the fix is not applied, after the ODD is ejected with the >> eject command, it will not be able to enter runtime suspend state any >> more due to SCSI EH code will submit a lock door command for the ODD >> right after its parent ATA port is runtime suspended. >> https://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/?id=12272030e563201e0b06732d8a87d8cea7157a04 > > I think this patch will cause a compile warning if you have > CONFIG_PM_RUNTIME set and CONFIG_PM_SLEEP disabled. The > scsi_dev_type_suspend and scsi_dev_type_resume routines will be defined > but not used. Oh, right, thanks for the remind. I'll move CONFIG_PM_SLEEP up to cover scsi_dev_type_suspend/resume in v2. > > Otherwise it seems okay. > Thanks, Aaron