scsi: ufshcd: Fix possible unclocked register access
authorSubhash Jadavani <subhashj@codeaurora.org>
Fri, 7 Oct 2016 04:48:22 +0000 (21:48 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 8 Nov 2016 22:29:47 +0000 (17:29 -0500)
commit1e879e8fa9f62e18d79bfc339050bf8fed7a81e4
tree4655d5b8aae72d3904c09ded4cfe5ead326ec051
parentfd37f66eb6801b6188155ce276d346754ac1799e
scsi: ufshcd: Fix possible unclocked register access

Vendor specific setup_clocks callback may require the clocks managed by
ufshcd driver to be ON. So if the vendor specific setup_clocks callback
is called while the required clocks are turned off, it could result into
unclocked register access.

To prevent possible unclock register access, this change adds one more
argument to setup_clocks callback to let it know whether it is called
pre/post the clock changes by core driver.

Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Reviewed-by: Kiwoong Kim <kwmad.kim@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufs-qcom.c
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h