Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
Merge "msm: camera: icp: use mutex to avoid sleep in spin_lock"
Browse files Browse the repository at this point in the history
  • Loading branch information
qctecmdr authored and Gerrit - the friendly Code Review server committed Oct 1, 2020
2 parents 76fa7cf + b063647 commit 31981e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ int cam_bps_process_cmd(void *device_priv, uint32_t cmd_type,
struct cam_bps_device_core_info *core_info = NULL;
struct cam_bps_device_hw_info *hw_info = NULL;
int rc = 0;
unsigned long flags;

if (!device_priv) {
CAM_ERR(CAM_ICP, "Invalid arguments");
Expand Down Expand Up @@ -394,16 +393,16 @@ int cam_bps_process_cmd(void *device_priv, uint32_t cmd_type,
}
break;
case CAM_ICP_BPS_CMD_DISABLE_CLK:
spin_lock_irqsave(&bps_dev->hw_lock, flags);
mutex_lock(&bps_dev->hw_mutex);
if (core_info->clk_enable == true)
cam_bps_toggle_clk(soc_info, false);
core_info->clk_enable = false;
spin_unlock_irqrestore(&bps_dev->hw_lock, flags);
mutex_unlock(&bps_dev->hw_mutex);
break;
case CAM_ICP_BPS_CMD_RESET:
spin_lock_irqsave(&bps_dev->hw_lock, flags);
mutex_lock(&bps_dev->hw_mutex);
rc = cam_bps_cmd_reset(soc_info, core_info);
spin_unlock_irqrestore(&bps_dev->hw_lock, flags);
mutex_unlock(&bps_dev->hw_mutex);
break;
default:
CAM_ERR(CAM_ICP, "Invalid Cmd Type:%u", cmd_type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ int cam_ipe_process_cmd(void *device_priv, uint32_t cmd_type,
struct cam_ipe_device_core_info *core_info = NULL;
struct cam_ipe_device_hw_info *hw_info = NULL;
int rc = 0;
unsigned long flags;

if (!device_priv) {
CAM_ERR(CAM_ICP, "Invalid arguments");
Expand Down Expand Up @@ -389,16 +388,16 @@ int cam_ipe_process_cmd(void *device_priv, uint32_t cmd_type,
}
break;
case CAM_ICP_IPE_CMD_DISABLE_CLK:
spin_lock_irqsave(&ipe_dev->hw_lock, flags);
mutex_lock(&ipe_dev->hw_mutex);
if (core_info->clk_enable == true)
cam_ipe_toggle_clk(soc_info, false);
core_info->clk_enable = false;
spin_unlock_irqrestore(&ipe_dev->hw_lock, flags);
mutex_unlock(&ipe_dev->hw_mutex);
break;
case CAM_ICP_IPE_CMD_RESET:
spin_lock_irqsave(&ipe_dev->hw_lock, flags);
mutex_lock(&ipe_dev->hw_mutex);
rc = cam_ipe_cmd_reset(soc_info, core_info);
spin_unlock_irqrestore(&ipe_dev->hw_lock, flags);
mutex_unlock(&ipe_dev->hw_mutex);
break;
default:
CAM_ERR(CAM_ICP, "Invalid Cmd Type:%u", cmd_type);
Expand Down

0 comments on commit 31981e9

Please sign in to comment.