linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: nguyenb@codeaurora.org
To: Bart Van Assche <bvanassche@acm.org>
Cc: cang@codeaurora.org, asutoshd@codeaurora.org,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	linux-arm-msm@vger.kernel.org,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Avri Altman <avri.altman@wdc.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Stanley Chu <stanley.chu@mediatek.com>,
	Nitin Rawat <nitirawa@codeaurora.org>,
	Bean Huo <beanhuo@micron.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 1/1] scsi: ufshcd: Allow zero value setting to Auto-Hibernate Timer
Date: Mon, 31 Aug 2020 10:38:54 -0700	[thread overview]
Message-ID: <0914db1a7aaa8b3b528f2298eb213b3c@codeaurora.org> (raw)
In-Reply-To: <56c8bde3-2457-402f-0ad2-94fc1fe12cd5@acm.org>

On 2020-08-28 20:13, Bart Van Assche wrote:
> On 2020-08-28 18:05, Bao D. Nguyen wrote:
>>  static ssize_t auto_hibern8_show(struct device *dev,
>>  				 struct device_attribute *attr, char *buf)
>>  {
>> +	u32 ahit;
>>  	struct ufs_hba *hba = dev_get_drvdata(dev);
> 
> Although not strictly required for SCSI code, how about following the 
> "reverse
> christmas tree" convention and adding "u32 ahit" below the "hba" 
> declaration?
Thanks for your comment. I will change it.
>>  	if (!ufshcd_is_auto_hibern8_supported(hba))
>>  		return -EOPNOTSUPP;
>> 
>> -	return snprintf(buf, PAGE_SIZE, "%d\n", 
>> ufshcd_ahit_to_us(hba->ahit));
>> +	pm_runtime_get_sync(hba->dev);
>> +	ufshcd_hold(hba, false);
>> +	ahit = ufshcd_readl(hba, REG_AUTO_HIBERNATE_IDLE_TIMER);
>> +	ufshcd_release(hba);
>> +	pm_runtime_put_sync(hba->dev);
>> +
>> +	return scnprintf(buf, PAGE_SIZE, "%d\n", ufshcd_ahit_to_us(ahit));
>>  }
> 
> Why the pm_runtime_get_sync()/pm_runtime_put_sync() and
> ufshcd_hold()/ufshcd_release() calls? I don't think these are necessary 
> here.
We may try to access the hardware register during runtime suspend or UFS 
clock is gated.
UFS clock gating can happen even during runtime resume. Here we are 
trying to prevent NoC error
due to unclocked access.
> Thanks,
> 
> Bart.

  reply	other threads:[~2020-08-31 17:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-29  1:05 [PATCH v1 1/1] scsi: ufshcd: Allow zero value setting to Auto-Hibernate Timer Bao D. Nguyen
2020-08-29  3:13 ` Bart Van Assche
2020-08-31 17:38   ` nguyenb [this message]
2020-08-29  7:32 ` Avri Altman
2020-08-31 18:07   ` nguyenb
2020-09-02  5:10     ` Avri Altman
2020-09-04  1:39       ` Stanley Chu
2020-09-09  2:03 ` Martin K. Petersen
2020-09-15 20:16 ` Martin K. Petersen

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=0914db1a7aaa8b3b528f2298eb213b3c@codeaurora.org \
    --to=nguyenb@codeaurora.org \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=nitirawa@codeaurora.org \
    --cc=stanley.chu@mediatek.com \
    /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).