msm: camera: req_mgr: Enhance camera v4l2 subdev shutdown sequence

when provider crash occurred, there was a CSID lane overflow
observed due to shutdown sequence from CRM(sensor, csid, csiphy).
To fix the issue need to change the shutdown sequence
(csid, sensor, csiphy).

This change will update the devices sequence in order while registering
and close the sequence accordingly.

CRs-Fixed: 2852076
Change-Id: Ia6d8022e995823bf031400c33528eb8544dc2e29
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
This commit is contained in:
Alok Chauhan
2020-10-15 20:32:53 +05:30
committed by Gerrit - the friendly Code Review server
parent 2c537f74d5
commit 2ebae4fabe
38 changed files with 867 additions and 178 deletions

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
*/
#include <linux/delay.h>
@@ -56,13 +56,12 @@ static int cam_jpeg_subdev_open(struct v4l2_subdev *sd,
return 0;
}
static int cam_jpeg_subdev_close(struct v4l2_subdev *sd,
int cam_jpeg_subdev_close_internal(struct v4l2_subdev *sd,
struct v4l2_subdev_fh *fh)
{
int rc = 0;
struct cam_node *node = v4l2_get_subdevdata(sd);
mutex_lock(&g_jpeg_dev.jpeg_mutex);
if (g_jpeg_dev.open_cnt <= 0) {
CAM_DBG(CAM_JPEG, "JPEG subdev is already closed");
@@ -86,6 +85,18 @@ end:
return rc;
}
static int cam_jpeg_subdev_close(struct v4l2_subdev *sd,
struct v4l2_subdev_fh *fh)
{
bool crm_active = cam_req_mgr_is_open(CAM_JPEG);
if (crm_active) {
CAM_DBG(CAM_JPEG, "CRM is ACTIVE, close should be from CRM");
return 0;
}
return cam_jpeg_subdev_close_internal(sd, fh);
}
static const struct v4l2_subdev_internal_ops cam_jpeg_subdev_internal_ops = {
.close = cam_jpeg_subdev_close,
.open = cam_jpeg_subdev_open,
@@ -102,6 +113,7 @@ static int cam_jpeg_dev_component_bind(struct device *dev,
struct platform_device *pdev = to_platform_device(dev);
g_jpeg_dev.sd.internal_ops = &cam_jpeg_subdev_internal_ops;
g_jpeg_dev.sd.close_seq_prior = CAM_SD_CLOSE_MEDIUM_PRIORITY;
rc = cam_subdev_probe(&g_jpeg_dev.sd, pdev, CAM_JPEG_DEV_NAME,
CAM_JPEG_DEVICE_TYPE);
if (rc) {