From: Adrien Thierry <athierry@redhat.com>
To: Bean Huo <huobean@gmail.com>
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
Bart Van Assche <bvanassche@acm.org>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi: ufs: initialize devfreq synchronously
Date: Fri, 10 Feb 2023 15:23:08 -0500 [thread overview]
Message-ID: <Y+anrOnSoCuwg3Ab@fedora> (raw)
In-Reply-To: <3bd48609-c194-61a6-7a2e-90b9e0d76fc6@gmail.com>
Hi Bean,
> On 09.02.23 10:14 PM, Adrien Thierry wrote:
> > - /* Initialize devfreq after UFS device is detected */
> > - if (ufshcd_is_clkscaling_supported(hba)) {
> > - memcpy(&hba->clk_scaling.saved_pwr_info.info,
> > - &hba->pwr_info,
> > - sizeof(struct ufs_pa_layer_attr));
> > - hba->clk_scaling.saved_pwr_info.is_valid = true;
> > - hba->clk_scaling.is_allowed = true;
> > -
> > - ret = ufshcd_devfreq_init(hba);
> > - if (ret)
> > - goto out;
> > -
> > - hba->clk_scaling.is_enabled = true;
> > - ufshcd_init_clk_scaling_sysfs(hba);
> > - }
> > -
> > ufs_bsg_probe(hba);
> > ufshpb_init(hba);
> > scsi_scan_host(hba->host);
> > @@ -8290,7 +8277,8 @@ static void ufshcd_async_scan(void *data, async_cookie_t cookie)
> > if (ret) {
> > pm_runtime_put_sync(hba->dev);
> > ufshcd_hba_exit(hba);
> > - }
> > + } else
> > + hba->is_initialized = true;
>
> after moving devfreq initialization out of the async routine, still has deadlock issue?
>
No more deadlock after moving devfreq initialization out of the async
routine. The reason I added the hba->is_initialized variable is to prevent
devfreq_monitor to update the ufs frequency until the async routine had a
chance to run and the ufs is initialized. Otherwise I would sometimes get
"dvfs failed with (-16) error" on boot.
Best,
Adrien
next prev parent reply other threads:[~2023-02-10 20:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-09 21:14 [PATCH] scsi: ufs: initialize devfreq synchronously Adrien Thierry
2023-02-10 17:51 ` Bean Huo
2023-02-10 20:23 ` Adrien Thierry [this message]
2023-02-15 18:50 ` Bart Van Assche
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=Y+anrOnSoCuwg3Ab@fedora \
--to=athierry@redhat.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=bvanassche@acm.org \
--cc=huobean@gmail.com \
--cc=jejb@linux.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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