mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
gpu: host1x: Add plausibility check on Host1x calibration data
When syncpoint and channel property are read from device-tree, add plausibility check to validate against reference data. Jira HOSTX-5843 Change-Id: I66dd9a5f18200aa8baaeecd36499dfb0ca24ba01 Signed-off-by: Mainak Sen <msen@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3293524 GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
@@ -930,6 +930,10 @@ static int host1x_get_assigned_resources(struct host1x *host)
|
|||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
host->channel_base = vals[0];
|
host->channel_base = vals[0];
|
||||||
host->num_channels = vals[1];
|
host->num_channels = vals[1];
|
||||||
|
if (host->channel_base + host->num_channels > host->info->nb_channels) {
|
||||||
|
dev_err(host->dev, "invalid value for nvidia,channels property");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
} else if (err == -EINVAL) {
|
} else if (err == -EINVAL) {
|
||||||
host->channel_base = 0;
|
host->channel_base = 0;
|
||||||
host->num_channels = host->info->nb_channels;
|
host->num_channels = host->info->nb_channels;
|
||||||
@@ -942,6 +946,10 @@ static int host1x_get_assigned_resources(struct host1x *host)
|
|||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
host->syncpt_base = vals[0];
|
host->syncpt_base = vals[0];
|
||||||
host->syncpt_end = vals[0] + vals[1];
|
host->syncpt_end = vals[0] + vals[1];
|
||||||
|
if (host->syncpt_end > host->info->nb_pts) {
|
||||||
|
dev_err(host->dev, "invalid value for nvidia,syncpoints property");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
} else if (err == -EINVAL) {
|
} else if (err == -EINVAL) {
|
||||||
host->syncpt_base = 0;
|
host->syncpt_base = 0;
|
||||||
host->syncpt_end = host->info->nb_pts;
|
host->syncpt_end = host->info->nb_pts;
|
||||||
|
|||||||
Reference in New Issue
Block a user