linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanley Chu <stanley.chu@mediatek.com>
To: Avri Altman <Avri.Altman@wdc.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"pedrom.sousa@synopsys.com" <pedrom.sousa@synopsys.com>,
	"sthumma@codeaurora.org" <sthumma@codeaurora.org>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"evgreen@chromium.org" <evgreen@chromium.org>,
	"beanhuo@micron.com" <beanhuo@micron.com>,
	"marc.w.gonzalez@free.fr" <marc.w.gonzalez@free.fr>,
	"subhashj@codeaurora.org" <subhashj@codeaurora.org>,
	"vivek.gautam@codeaurora.org" <vivek.gautam@codeaurora.org>,
	"Kuohong Wang (王國鴻)" <kuohong.wang@mediatek.com>,
	"Peter Wang (王信友)" <peter.wang@mediatek.com>,
	"Chun-Hung Wu (巫駿宏)" <Chun-hung.Wu@mediatek.com>,
	"Andy Teng ( ^[$B{}G!9(^[(B)" <Andy.Teng@mediatek.com>
Subject: RE: [PATCH v1 1/3] scsi: core: allow auto suspend override by low-level driver
Date: Thu, 12 Sep 2019 10:24:54 +0800	[thread overview]
Message-ID: <1568255094.16730.10.camel@mtkswgap22> (raw)
In-Reply-To: <MN2PR04MB6991142450EEF05E2AF2D8DFFCB10@MN2PR04MB6991.namprd04.prod.outlook.com>

Hi Avri,

> > diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index
> > 149d406aacc9..2218d57c4c0c 100644
> > --- a/drivers/scsi/sd.c
> > +++ b/drivers/scsi/sd.c
> > @@ -3371,6 +3371,9 @@ static int sd_probe(struct device *dev)
> >         }
> > 
> >         blk_pm_runtime_init(sdp->request_queue, dev);
> > +       if (sdp->rpm_autosuspend_delay > 0)
> > +               pm_runtime_set_autosuspend_delay(dev, 
> > +
> Redundant line ?

checkpatch reported "WARNING:LONG_LINE:line over 80 characters" when I
made this as oneline : (

> > + sdp->rpm_autosuspend_delay);
> Don't you need to call now pm_runtime_use_autosuspend() ?

dev->power.user_autosuspend was set by blk_pm_runtime_init() above, thus
pm_runtime_use_autosuspend() is not necessary here.

> 
> >         device_add_disk(dev, gd, NULL);
> >         if (sdkp->capacity)
> >                 sd_dif_config_host(sdkp); diff --git a/include/scsi/scsi_device.h
> > b/include/scsi/scsi_device.h index 202f4d6a4342..133b282fae5a 100644
> > --- a/include/scsi/scsi_device.h
> > +++ b/include/scsi/scsi_device.h
> > @@ -199,7 +199,7 @@ struct scsi_device {
> >         unsigned broken_fua:1;          /* Don't set FUA bit */
> >         unsigned lun_in_cdb:1;          /* Store LUN bits in CDB[1] */
> >         unsigned unmap_limit_for_ws:1;  /* Use the UNMAP limit for WRITE
> > SAME */
> > -
> > +       int rpm_autosuspend_delay;
> Can suspend be negative?

Yes, however negative delay value will block rpm.

Here we just use the same type as parameter "delay" of
pm_runtime_set_autosuspend() even though we do not set it as negative
value in this version.

But thank you so much to remind me that
pm_runtime_set_autosuspend_delay() can accept "zero" delay so we shall
allow "zero" sdev->rpm_autosuspend_delay as well.

I will fix it in v2.

> 
> >         atomic_t disk_events_disable_depth; /* disable depth for disk events */
> > 
> >         DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /*
> > supported events */
> > --
> > 2.18.0
> 

Thanks,
Stanley



  reply	other threads:[~2019-09-12  2:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11  9:41 [PATCH v1] scsi: allow auto suspend override by low-level driver Stanley Chu
2019-09-11  9:41 ` [PATCH v1 1/3] scsi: core: " Stanley Chu
2019-09-11 10:54   ` Avri Altman
2019-09-12  2:24     ` Stanley Chu [this message]
2019-09-11  9:41 ` [PATCH v1 2/3] scsi: ufs: override auto suspend tunables for ufs Stanley Chu
2019-09-11 10:56   ` Avri Altman
2019-09-12  5:37     ` Stanley Chu
2019-09-11  9:41 ` [PATCH v1 3/3] scsi: ufs-mediatek: enable auto suspend capability Stanley Chu
2019-09-11 10:58   ` Avri Altman
2019-09-12  5:39     ` Stanley Chu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1568255094.16730.10.camel@mtkswgap22 \
    --to=stanley.chu@mediatek.com \
    --cc=Andy.Teng@mediatek.com \
    --cc=Avri.Altman@wdc.com \
    --cc=Chun-hung.Wu@mediatek.com \
    --cc=alim.akhtar@samsung.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=evgreen@chromium.org \
    --cc=jejb@linux.ibm.com \
    --cc=kuohong.wang@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=marc.w.gonzalez@free.fr \
    --cc=martin.petersen@oracle.com \
    --cc=matthias.bgg@gmail.com \
    --cc=pedrom.sousa@synopsys.com \
    --cc=peter.wang@mediatek.com \
    --cc=sthumma@codeaurora.org \
    --cc=subhashj@codeaurora.org \
    --cc=vivek.gautam@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).