Re: [PATCH] scsi: ufs: initialize devfreq synchronously

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux