Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e402c0a authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "scsi: ufs: fix race between shutdown and rls handler"

parents 2eee137a f43c3715
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1212,8 +1212,8 @@ static int ufsdbg_config_pwr_mode(struct ufs_hba *hba,
	/* let's not get into low power until clock scaling is completed */
	hba->ufs_stats.clk_hold.ctx = DBGFS_CFG_PWR_MODE;
	ufshcd_hold(hba, false);
	ufshcd_scsi_block_requests(hba);
	down_write(&hba->lock);
	ufshcd_scsi_block_requests(hba);
	if (ufshcd_wait_for_doorbell_clr(hba, DOORBELL_CLR_TOUT_US)) {
		ret = -EBUSY;
		goto out;
+5 −3
Original line number Diff line number Diff line
@@ -1746,8 +1746,8 @@ static int ufshcd_clock_scaling_prepare(struct ufs_hba *hba)
	 * make sure that there are no outstanding requests when
	 * clock scaling is in progress
	 */
	ufshcd_scsi_block_requests(hba);
	down_write(&hba->lock);
	ufshcd_scsi_block_requests(hba);
	if (ufshcd_wait_for_doorbell_clr(hba, DOORBELL_CLR_TOUT_US)) {
		ret = -EBUSY;
		up_write(&hba->lock);
@@ -2766,8 +2766,8 @@ static void __ufshcd_set_auto_hibern8_timer(struct ufs_hba *hba,
{
	pm_runtime_get_sync(hba->dev);
	ufshcd_hold_all(hba);
	ufshcd_scsi_block_requests(hba);
	down_write(&hba->lock);
	ufshcd_scsi_block_requests(hba);
	/* wait for all the outstanding requests to finish */
	ufshcd_wait_for_doorbell_clr(hba, U64_MAX);
	ufshcd_set_auto_hibern8_timer(hba, delay_ms);
@@ -7157,8 +7157,10 @@ static void ufshcd_rls_handler(struct work_struct *work)

	hba = container_of(work, struct ufs_hba, rls_work);
	pm_runtime_get_sync(hba->dev);
	ufshcd_scsi_block_requests(hba);
	down_write(&hba->lock);
	ufshcd_scsi_block_requests(hba);
	if (ufshcd_is_shutdown_ongoing(hba))
		goto out;
	ret = ufshcd_wait_for_doorbell_clr(hba, U64_MAX);
	if (ret) {
		dev_err(hba->dev,