diff options
| author | Raviv Shvili <rshvili@codeaurora.org> | 2014-01-09 10:22:16 +0200 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 10:56:28 -0700 |
| commit | b270f7f8cf0b52c2020be00ba42da2abc0cd104b (patch) | |
| tree | 56a59cdc32a8122bfe785006a37497d203de068e | |
| parent | c61706e06562e35c8f8e4664253031223b5035d1 (diff) | |
scsi: ufs: fix crash upon reading host_regs debugfs entry
While reading host_regs debugfs entry, UFS controller
might be in low power mode. While in UFS runtime suspend mode the host
controller is being unclocked.
Reading the unclocked host controller registers, may cause a system crash.
In order to avoid that, UFS runtime suspend should be
held and released when done.
CRs-fixed: 594618
Change-Id: I4b850806352b59192340bc5b0bb480b4dd6553f1
Signed-off-by: Raviv Shvili <rshvili@codeaurora.org>
[subhashj@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| -rw-r--r-- | drivers/scsi/ufs/debugfs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/ufs/debugfs.c b/drivers/scsi/ufs/debugfs.c index 57110039eaff..bdafdc85405a 100644 --- a/drivers/scsi/ufs/debugfs.c +++ b/drivers/scsi/ufs/debugfs.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -303,8 +303,10 @@ static int ufsdbg_host_regs_show(struct seq_file *file, void *data) struct ufs_hba *hba = (struct ufs_hba *)file->private; ufshcd_hold(hba, false); + pm_runtime_get_sync(hba->dev); ufsdbg_pr_buf_to_std(file, hba->mmio_base, UFSHCI_REG_SPACE_SIZE, - "host regs"); + "host regs"); + pm_runtime_put_sync(hba->dev); ufshcd_release(hba); return 0; } |
