public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrien Thierry <athierry@redhat.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
	Avri Altman <avri.altman@wdc.com>,
	"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: probe hba and add lus synchronously
Date: Tue, 7 Feb 2023 17:54:03 -0500	[thread overview]
Message-ID: <Y+LWi3MrLQV/se/j@fedora> (raw)
In-Reply-To: <Y914yu4rSqvpSoRZ@fedora>

Hi Bart,

> Another solution could be to change the kernel Kconfigs to force
> DEVFREQ_GOV_SIMPLE_ONDEMAND (and possibly other devfreq-related options as
> well) to be builtin when SCSI_UFSHCD is enabled (builtin or module). Is
> that what you meant?

After diving more into this, I could not find a way in the Kconfig 
language to force a module to be builtin, so I'm not sure if the idea is 
implementable.

I had another idea. Instead of running the whole ufshcd_async_scan()
function synchronously (and potentially slow down boot time on Android
devices as you mentioned), we could only move devfreq initialization out
of the async routine, ie. this chunk of code:

drivers/ufs/core/ufshcd.c:8140

        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);
        }

I tested this idea on the Qualcomm sa8540p-ride, and UFS clock scaling
seems to be working without issue. No error on boot and the
/sys/kernel/tracing/events/ufs/ufshcd_clk_scaling traces are similar with
and without the change when running fio to put UFS under load.

Do you think this could be an acceptable compromise for boot time? It
should not slow things down too much since the really time-consuming parts
(ie. UFS initialization) would still be in the async routine.

Best,

Adrien


  reply	other threads:[~2023-02-07 22:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 18:21 [PATCH] scsi: ufs: probe hba and add lus synchronously Adrien Thierry
2023-02-02 18:27 ` Bart Van Assche
2023-02-03 20:40   ` Adrien Thierry
2023-02-03 20:53     ` Bart Van Assche
2023-02-03 21:12       ` Adrien Thierry
2023-02-07 22:54         ` Adrien Thierry [this message]
2023-02-07 23:11           ` Bart Van Assche
2023-02-15 13:52             ` Adrien Thierry

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+LWi3MrLQV/se/j@fedora \
    --to=athierry@redhat.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=bvanassche@acm.org \
    --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