From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oliver Neukum Subject: Re: [PATCH v3 2/7] scsi: pm: use autosuspend if device supports it Date: Thu, 26 Jul 2012 15:01:15 +0200 Message-ID: <4732005.Un0exgRK6O@linux-lqwf.site> References: <1343297129-28174-1-git-send-email-aaron.lu@amd.com> <1476441.ovA4GKBza3@linux-lqwf.site> <20120726124326.GA2022@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: In-Reply-To: <20120726124326.GA2022@localhost.localdomain> Sender: linux-ide-owner@vger.kernel.org To: Aaron Lu Cc: James Bottomley , Alan Stern , Jeff Garzik , Lin Ming , Jeff Wu , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org, Aaron Lu List-Id: linux-scsi@vger.kernel.org On Thursday 26 July 2012 20:43:32 Aaron Lu wrote: > > What is the purpose of this approach? > > The purpose is to let scsi layer driver(sd, sr, etc.) use the same pm > api(scsi_autopm_put_device) to put the device to runtime suspended > state. > When the device is ready to be suspended, if it does not make use of > autosuspend, call pm_runtime_put_sync for it; if it makes use of > autosuspend, call the autosuspend runtime pm apis for it. > > > You need a very good reason to have an API do two different things > > based on this. > > If you see the above reason not good, I'll prepare an updated version > to create a new api to cover the autosuspend case, something like: > void scsi_autopm_put_device_autosuspend(struct scsi_device *sdev) > { > pm_runtime_mark_last_busy(&sdev->sdev_gendev); > pm_runtime_put_autosuspend(&sdev->sdev_gendev); > } > Does this look right? Much better :-) Regards Oliver