[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1301311010200.1876-100000@iolanthe.rowland.org>
Date: Thu, 31 Jan 2013 10:13:05 -0500 (EST)
From: Alan Stern <stern@...land.harvard.edu>
To: Aaron Lu <aaron.lu@...el.com>
cc: Jens Axboe <axboe@...nel.dk>, "Rafael J. Wysocki" <rjw@...k.pl>,
James Bottomley <James.Bottomley@...senpartnership.com>,
<linux-pm@...r.kernel.org>, <linux-scsi@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, Aaron Lu <aaron.lwe@...il.com>,
Shane Huang <shane.huang@....com>
Subject: Re: [PATCH v8 4/4] sd: change to auto suspend mode
On Thu, 31 Jan 2013, Aaron Lu wrote:
> > > +static int scsi_blk_runtime_suspend(struct device *dev)
> > > +{
> > > + struct scsi_device *sdev = to_scsi_device(dev);
> >
> > For this routine and the other new ones, it may be slightly more
> > efficient to pass both dev and sdev as arguments (this depends on how
> > smart the compiler's optimizer is). The caller already knows both of
> > them, after all.
>
> What about passing only scsi_device? When device is needed, I can use
> &sdev->sdev_gendev. Is this equally efficient?
I don't know... The difference is very small in any case. The
routines will probably be inlined automatically.
> > > + if (sdev->request_queue->dev) {
> > > + pm_runtime_mark_last_busy(dev);
> > > + err = pm_runtime_autosuspend(dev);
> > > + } else {
> > > + err = pm_schedule_suspend(dev, 100);
> > > + }
> > > + } else {
> > > err = pm_runtime_suspend(dev);
> > > + }
> > > return err;
>
> Shall we ignore the return value for these pm_xxx_suspend functions?
> I mean we do not need to record the return value for them and return it,
> since pm core doesn't care the return value of idle callback.
Maybe it will care in a future kernel version. You might as well store
the return code and pass it back.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists