diff --git a/drivers/gpu/nvgpu/common/fifo/tsg.c b/drivers/gpu/nvgpu/common/fifo/tsg.c index 938642980..15ecba6a1 100644 --- a/drivers/gpu/nvgpu/common/fifo/tsg.c +++ b/drivers/gpu/nvgpu/common/fifo/tsg.c @@ -167,23 +167,23 @@ int nvgpu_tsg_bind_channel(struct nvgpu_tsg *tsg, struct nvgpu_channel *ch) int nvgpu_tsg_bind_domain(struct nvgpu_tsg *tsg, struct nvgpu_nvs_domain *nnvs_domain) { struct nvgpu_runlist_domain *rl_domain; - struct nvs_domain *nvs_domain; struct gk20a *g = tsg->g; + const char *name; /* Hopping channels from one domain to another is not allowed */ if (tsg->num_active_channels != 0U) { return -EINVAL; } - nvs_domain = nnvs_domain->parent; + name = nvgpu_nvs_domain_get_name(nnvs_domain); /* * The domain ptr will get updated with the right id once the runlist * gets specified based on the first channel. */ - rl_domain = nvgpu_rl_domain_get(g, 0, nvs_domain->name); + rl_domain = nvgpu_rl_domain_get(g, 0, name); if (rl_domain == NULL) { - nvgpu_err(g, "rl domain not found (%s)", nvs_domain->name); + nvgpu_err(g, "rl domain not found (%s)", name); /* * This shouldn't happen because the nvs domain guarantees RL domains. * diff --git a/drivers/gpu/nvgpu/common/nvs/nvs_sched.c b/drivers/gpu/nvgpu/common/nvs/nvs_sched.c index a54e6f785..5066b9e80 100644 --- a/drivers/gpu/nvgpu/common/nvs/nvs_sched.c +++ b/drivers/gpu/nvgpu/common/nvs/nvs_sched.c @@ -490,6 +490,13 @@ u32 nvgpu_nvs_domain_count(struct gk20a *g) return count; } +const char *nvgpu_nvs_domain_get_name(struct nvgpu_nvs_domain *dom) +{ + struct nvs_domain *nvs_dom = dom->parent; + + return nvs_dom->name; +} + void nvgpu_nvs_get_log(struct gk20a *g, s64 *timestamp, const char **msg) { struct nvs_log_event ev; diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvs.h b/drivers/gpu/nvgpu/include/nvgpu/nvs.h index d44c9f106..7210bbc18 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/nvs.h +++ b/drivers/gpu/nvgpu/include/nvgpu/nvs.h @@ -103,6 +103,7 @@ struct nvgpu_nvs_domain * nvgpu_nvs_domain_by_name(struct gk20a *g, const char *name); void nvgpu_nvs_domain_get(struct gk20a *g, struct nvgpu_nvs_domain *dom); void nvgpu_nvs_domain_put(struct gk20a *g, struct nvgpu_nvs_domain *dom); +const char *nvgpu_nvs_domain_get_name(struct nvgpu_nvs_domain *dom); /* * Debug wrapper for NVS code. */ @@ -134,6 +135,12 @@ static inline void nvgpu_nvs_domain_put(struct gk20a *g, struct nvgpu_nvs_domain (void)g; (void)dom; } + +static inline const char *nvgpu_nvs_domain_get_name(struct nvgpu_nvs_domain *dom) +{ + (void)dom; + return NULL; +} #endif #endif