scsi: ufs-mediatek: Fix unbalanced clock on/off
authorStanley Chu <stanley.chu@mediatek.com>
Mon, 1 Jun 2020 10:46:45 +0000 (18:46 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 16 Jun 2020 03:06:41 +0000 (23:06 -0400)
commit561e3a8726b2dd94ce75cad6c9cab211551f368a
tree0914f11a4c662b380fe7b5096faea4faa180562f
parent488edafb1120f715bebd80b6fe4089f83fb082b2
scsi: ufs-mediatek: Fix unbalanced clock on/off

MediaTek UFS clocks are separated to two parts and controlled by different
modules: ufs-mediatek and phy-ufs-mediatek.

If both Auto-Hibern8 and clk-gating feature are enabled, mphy power control
is not balanced thus unbalanced control also happens to the clocks probed
by phy-ufs-mediatek module.

Fix this issue by:

 - Promise usage of phy_power_on/off balanced

 - Remove phy_power_on/off control in suspend/resume vops since both can be
   handled in setup_clock vops only

Link: https://lore.kernel.org/r/20200601104646.15436-5-stanley.chu@mediatek.com
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufs-mediatek.c
drivers/scsi/ufs/ufs-mediatek.h