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
gecommit door Gerrit - the friendly Code Review server
bovenliggende 2c537f74d5
commit 2ebae4fabe
38 gewijzigde bestanden met toevoegingen van 867 en 178 verwijderingen

Bestand weergeven

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
*/
#include <linux/delay.h>
@@ -58,7 +58,7 @@ static int cam_custom_subdev_open(struct v4l2_subdev *sd,
return 0;
}
static int cam_custom_subdev_close(struct v4l2_subdev *sd,
int cam_custom_subdev_close_internal(struct v4l2_subdev *sd,
struct v4l2_subdev_fh *fh)
{
int rc = 0;
@@ -86,6 +86,19 @@ end:
return rc;
}
static int cam_custom_subdev_close(struct v4l2_subdev *sd,
struct v4l2_subdev_fh *fh)
{
bool crm_active = cam_req_mgr_is_open(CAM_CUSTOM);
if (crm_active) {
CAM_DBG(CAM_CUSTOM, "CRM is ACTIVE, close should be from CRM");
return 0;
}
return cam_custom_subdev_close_internal(sd, fh);
}
static const struct v4l2_subdev_internal_ops cam_custom_subdev_internal_ops = {
.close = cam_custom_subdev_close,
.open = cam_custom_subdev_open,
@@ -102,6 +115,7 @@ static int cam_custom_component_bind(struct device *dev,
struct platform_device *pdev = to_platform_device(dev);
g_custom_dev.sd.internal_ops = &cam_custom_subdev_internal_ops;
g_custom_dev.sd.close_seq_prior = CAM_SD_CLOSE_HIGH_PRIORITY;
rc = cam_subdev_probe(&g_custom_dev.sd, pdev, CAM_CUSTOM_DEV_NAME,
CAM_CUSTOM_DEVICE_TYPE);