You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
scsi: ufs: rockchip: Remove ufshcd_*_suspend/resume call
Because we can't gate the clock when using ufs, so we remove
UFSHCD_CAP_CLK_GATING support. However, ufshcd_runtime_suspend still
be called which can still call ufshcd_suspend->ufshcd_setup_clocks,
then ufshcd_setup_clocks() still tries to gate the clock which we
don't actually allow. Except for gating clock, ufshcd_suspend also send
H8 to the device. This rule is applied to system PM as well.
So the problem looks like:
[ T217] ueventd: restorecon_recursive: /sys/devices/platform/regulatory.0
[ T146] ufshcd-rockchip 2a2d0000.ufs: uic cmd 0x14 with arg3 0x0 completion timeout
[ T146] ufshcd-rockchip 2a2d0000.ufs: dme-reset: error code -110
Remove them together with UFSHCD_CAP_CLK_GATING.
BTW, no matter whether we call ufshcd_*_suspend/resume or not, wlun RPM
make sure all status come back:
[ 29.213545][ T146] Workqueue: pm pm_runtime_work
[ 29.213567][ T146] Call trace:
[ 29.213578][ T146] dump_backtrace+0xec/0x10c
[ 29.213598][ T146] show_stack+0x14/0x1c
[ 29.213616][ T146] dump_stack_lvl+0x68/0x88
[ 29.213631][ T146] dump_stack+0x14/0x34
[ 29.213644][ T146] ufshcd_hba_enable+0x32c/0x3b4
[ 29.213659][ T146] ufshcd_host_reset_and_restore+0x54/0x12c
[ 29.213674][ T146] ufshcd_reset_and_restore+0x60/0x1f8
[ 29.213693][ T146] __ufshcd_wl_resume+0xa0/0x4a8
[ 29.213710][ T146] ufshcd_wl_runtime_resume+0x38/0x154
[ 29.213726][ T146] scsi_runtime_resume+0x58/0x80
[ 29.213746][ T146] __rpm_callback+0x78/0x3bc
[ 29.213765][ T146] rpm_resume+0x434/0x670
[ 29.213782][ T146] __rpm_callback+0x1ac/0x3bc
[ 29.213799][ T146] rpm_resume+0x458/0x670
[ 29.213816][ T146] pm_runtime_work+0x9c/0xa0
[ 29.213833][ T146] process_one_work+0x1a4/0x3b0
[ 29.213847][ T146] worker_thread+0x258/0x428
[ 29.213861][ T146] kthread+0xe8/0x1b4
[ 29.213878][ T146] ret_from_fork+0x10/0x20
Fixes: 83dbc34b20 (“scsi: ufs: rockchip: Fix stability issues and add WB support”)
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I30fcdf35575a882b1095c5f991d82e429eccd1ce
This commit is contained in:
@@ -561,16 +561,9 @@ static int ufs_rockchip_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct ufs_hba *hba = dev_get_drvdata(dev);
|
||||
struct ufs_rockchip_host *host = ufshcd_get_variant(hba);
|
||||
int ret = 0;
|
||||
|
||||
ret = ufshcd_runtime_suspend(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
clk_disable_unprepare(host->ref_out_clk);
|
||||
ufs_rockchip_restore_link(hba, true);
|
||||
|
||||
return 0;
|
||||
return ufs_rockchip_restore_link(hba, true);
|
||||
}
|
||||
|
||||
static int ufs_rockchip_runtime_resume(struct device *dev)
|
||||
@@ -589,9 +582,7 @@ static int ufs_rockchip_runtime_resume(struct device *dev)
|
||||
udelay(1);
|
||||
reset_control_deassert(host->rst);
|
||||
|
||||
ufs_rockchip_restore_link(hba, false);
|
||||
|
||||
return ufshcd_runtime_resume(dev);
|
||||
return ufs_rockchip_restore_link(hba, false);
|
||||
}
|
||||
|
||||
static int ufs_rockchip_suspend(struct device *dev)
|
||||
@@ -603,7 +594,7 @@ static int ufs_rockchip_suspend(struct device *dev)
|
||||
|
||||
ufs_rockchip_restore_link(hba, true);
|
||||
|
||||
return ufshcd_system_suspend(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ufs_rockchip_resume(struct device *dev)
|
||||
@@ -617,7 +608,7 @@ static int ufs_rockchip_resume(struct device *dev)
|
||||
ufs_rockchip_device_reset(hba);
|
||||
ufs_rockchip_restore_link(hba, false);
|
||||
|
||||
return ufshcd_system_resume(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops ufs_rockchip_pm_ops = {
|
||||
|
||||
Reference in New Issue
Block a user