media: camss: vfe: Don't call hw_version() before its dependencies are met
authorRobert Foss <robert.foss@linaro.org>
Thu, 12 Aug 2021 09:21:52 +0000 (11:21 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 30 Sep 2021 08:07:56 +0000 (10:07 +0200)
vfe->ops->hw_version(vfe) is being called before vfe->base has been
assigned, and before the hardware has been powered up.

Fixes: b10b5334528a9 ("media: camss: vfe: Don't read hardware version needlessly")
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/qcom/camss/camss-vfe.c

index 6b2f33fc9be22ad008a1502f1c2208a5618b3a7d..71f78b40e7f55a2840f9cf3d529ad3c664c36f6a 100644 (file)
@@ -604,6 +604,8 @@ static int vfe_get(struct vfe_device *vfe)
                vfe_reset_output_maps(vfe);
 
                vfe_init_outputs(vfe);
+
+               vfe->ops->hw_version(vfe);
        } else {
                ret = vfe_check_clock_rates(vfe);
                if (ret < 0)
@@ -1299,7 +1301,6 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe,
                return -EINVAL;
        }
        vfe->ops->subdev_init(dev, vfe);
-       vfe->ops->hw_version(vfe);
 
        /* Memory */