linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dolev Raviv" <draviv@codeaurora.org>
To: "Dong, Chuanxiao" <chuanxiao.dong@intel.com>
Cc: Dolev Raviv <draviv@codeaurora.org>,
	"James.Bottomley@HansenPartnership.com"
	<james.bottomley@hansenpartnership.com>,
	"hch@infradead.org" <hch@infradead.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-scsi-owner@vger.kernel.org"
	<linux-scsi-owner@vger.kernel.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"santoshsy@gmail.com" <santoshsy@gmail.com>,
	Subhash Jadavani <subhashj@codeaurora.org>,
	Sujit Reddy Thumma <sthumma@codeaurora.org>
Subject: RE: [PATCH/RFC V2 10/16] scsi: ufs: add UFS power management support
Date: Wed, 3 Sep 2014 13:04:20 -0000	[thread overview]
Message-ID: <7b5925f81c3e6a344fd50251405a0789.squirrel@www.codeaurora.org> (raw)
In-Reply-To: <17296D9F8FF2234F831FC3DF505A87A911B25A0C@shsmsx102.ccr.corp.intel.com>

Hi all,
Thanks for reviewing the patches, I'm sorry for the late replay. I was
waiting for some comments before I address all at once and re-send the
series.

>> > +/**
>> > + * ufshcd_resume - helper function for resume operations
>> > + * @hba: per adapter instance
>> > + * @pm_op: runtime PM or system PM
>> > + *
>> > + * This function basically brings the UFS device, UniPro link and
>> > +controller
>> > + * to active state.
>> > + *
>> > + * Returns 0 for success and non-zero for failure  */ static int
>> > +ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
>> >  {
>> > -	if (!hba)
>> > -		return 0;
>> > +	int ret;
>> > +	enum uic_link_state old_link_state;
>> > +
>> > +	hba->pm_op_in_progress = 1;
>> > +	old_link_state = hba->uic_link_state;
>> > +	/* Make sure clocks are enabled before accessing controller */
>> > +	ret = ufshcd_setup_clocks(hba, true);
>> > +	if (ret)
>> > +		goto out;
>> > +
>> > +	if (hba->vops && hba->vops->setup_clocks) {
>> > +		ret = hba->vops->setup_clocks(hba, true);
>> > +		if (ret)
>> > +			goto disable_clks;
>> > +	}
>> > +
>> > +	/* enable the host irq as host controller would be active soon */
>> > +	ufshcd_enable_irq(hba);
>> > +
>> > +	ret = ufshcd_vreg_set_hpm(hba);
>> > +	if (ret)
>> > +		goto disable_irq_and_vops_clks;
>> >
>> >  	/*
>> > -	 * The device is idle with no requests in the queue,
>> > -	 * allow background operations.
>> > +	 * Call vendor specific resume callback. As these callbacks may
>> access
>> > +	 * vendor specific host controller register space call them when the
>> > +	 * host clocks are ON.
>> >  	 */
>> > -	return ufshcd_enable_auto_bkops(hba);
>> > +	if (hba->vops && hba->vops->resume) {
>> > +		ret = hba->vops->resume(hba, pm_op);
>> > +		if (ret)
>> > +			goto disable_vreg;
>> > +	}
>> > +
>> > +	if (ufshcd_is_link_hibern8(hba)) {
>> > +		ret = ufshcd_uic_hibern8_exit(hba);
>> > +		if (!ret)
>> > +			ufshcd_set_link_active(hba);
>> > +		else
>> > +			goto vendor_suspend;
>> > +	} else if (ufshcd_is_link_off(hba)) {
>> > +		ret = ufshcd_host_reset_and_restore(hba);
>> > +		/*
>> > +		 * ufshcd_host_reset_and_restore() should have already
>> > +		 * set the link state as active
>> > +		 */
>> > +		if (ret || !ufshcd_is_link_active(hba))
>> > +			goto vendor_suspend;
>> > +	}
>> > +
>> > +	if (!ufshcd_is_ufs_dev_active(hba)) {
>> > +		ret = ufshcd_set_dev_pwr_mode(hba, UFS_ACTIVE_PWR_MODE);
>> > +		if (ret)
>> > +			goto set_old_link_state;
>> > +	}
>> > +
>> > +	ufshcd_disable_auto_bkops(hba);
>
> Should be auto background operation enabled again in ufshcd_resume()? It
> is disabled during ufshcd_suspend().
>
> Thanks
> Chuanxiao

Chuanxiao,
If the system is going for runtime suspend, the bkops are enabled if
necessary, and in any case disabled before the suspend. On resume we make
sure, bkops are disabled.

Thanks,
Dolev

>> > --
>> > To unsubscribe from this list: send the line "unsubscribe linux-scsi"
>> in the body
>> > of a message to majordomo@vger.kernel.org More majordomo info at
>> > http://vger.kernel.org/majordomo-info.html
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


-- 
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


  parent reply	other threads:[~2014-09-03 13:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-14 13:30 [PATCH/RFC V2 00/16] UFS: Power managment support Dolev Raviv
2014-08-14 13:30 ` [PATCH/RFC V2 01/16] scsi: ufs: Allow vendor specific initialization Dolev Raviv
2014-08-14 13:30 ` [PATCH/RFC V2 02/16] scsi: ufs: Add regulator enable support Dolev Raviv
2014-08-14 13:30 ` [PATCH/RFC V2 03/16] scsi: ufs: Add clock initialization support Dolev Raviv
2014-08-14 13:30 ` [PATCH/RFC V2 04/16] scsi: ufs: refactor query descriptor API support Dolev Raviv
2014-08-14 13:30 ` [PATCH/RFC V2 05/16] scsi: ufs: improve init sequence Dolev Raviv
2014-08-14 13:30 ` [PATCH/RFC V2 06/16] scsi: ufs: Active Power Mode - configuring bActiveICCLevel Dolev Raviv
2014-08-14 13:30 ` [PATCH/RFC V2 07/16] scsi: support well known logical units Dolev Raviv
2014-08-19 17:22   ` Christoph Hellwig
2014-08-21 21:18     ` Martin K. Petersen
2014-08-14 13:30 ` [PATCH/RFC V2 08/16] scsi: ufs: introduce well known logical unit in ufs Dolev Raviv
2014-08-14 13:31 ` [PATCH/RFC V2 09/16] scsi: sd: Avoid sending medium write commands if device is write protected Dolev Raviv
2014-08-14 13:31 ` [PATCH/RFC V2 10/16] scsi: ufs: add UFS power management support Dolev Raviv
2014-08-20  7:20   ` Dong, Chuanxiao
2014-08-21  8:59     ` Dong, Chuanxiao
2014-08-21 13:01       ` hch
2014-09-03 13:04       ` Dolev Raviv [this message]
2014-09-03 11:43     ` Dolev Raviv
2014-08-14 13:31 ` [PATCH/RFC V2 11/16] scsi: ufs: refactor configuring power mode Dolev Raviv
2014-08-14 13:31 ` [PATCH/RFC V2 12/16] scsi: ufs: Add support for clock gating Dolev Raviv
2014-08-14 13:31 ` [PATCH/RFC V2 13/16] scsi: ufs: Add freq-table-hz property for UFS device Dolev Raviv
2014-08-14 13:31 ` [PATCH/RFC V2 14/16] scsi: ufs: Add support for clock scaling using devfreq framework Dolev Raviv
2014-08-14 13:31 ` [PATCH/RFC V2 15/16] scsi: ufs: add capability to control the auto bkops during suspend Dolev Raviv
2014-08-14 13:31 ` [PATCH/RFC V2 16/16] scsi: ufs: definitions for phy interface Dolev Raviv

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=7b5925f81c3e6a344fd50251405a0789.squirrel@www.codeaurora.org \
    --to=draviv@codeaurora.org \
    --cc=chuanxiao.dong@intel.com \
    --cc=hch@infradead.org \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-scsi-owner@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=santoshsy@gmail.com \
    --cc=sthumma@codeaurora.org \
    --cc=subhashj@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).