mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: gk20a: Control powergating on regops
Enable/disable powergating around regops so that the user need not call the powergating IOCTLs with the regops IOCTL. If the user does call the powergating IOCTL then the ref-counting will ensure the correct behavior. Bug 1451949 Change-Id: I1746f7d7cd1d2c0c497c213939df44a59d5d2834 Signed-off-by: Sandarbh Jain <sanjain@nvidia.com> Reviewed-on: http://git-master/r/395131 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
committed by
Dan Willemsen
parent
6107c44ecd
commit
ebe7f110a1
@@ -460,7 +460,9 @@ static bool gr_context_info_available(struct dbg_session_gk20a *dbg_s,
|
|||||||
static int nvhost_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s,
|
static int nvhost_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s,
|
||||||
struct nvhost_dbg_gpu_exec_reg_ops_args *args)
|
struct nvhost_dbg_gpu_exec_reg_ops_args *args)
|
||||||
{
|
{
|
||||||
int err;
|
int err = 0, powergate_err = 0;
|
||||||
|
bool is_pg_disabled = false;
|
||||||
|
|
||||||
struct device *dev = dbg_s->dev;
|
struct device *dev = dbg_s->dev;
|
||||||
struct gk20a *g = get_gk20a(dbg_s->pdev);
|
struct gk20a *g = get_gk20a(dbg_s->pdev);
|
||||||
struct nvhost_dbg_gpu_reg_op *ops;
|
struct nvhost_dbg_gpu_reg_op *ops;
|
||||||
@@ -503,10 +505,26 @@ static int nvhost_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s,
|
|||||||
* on other channels */
|
* on other channels */
|
||||||
mutex_lock(&g->dbg_sessions_lock);
|
mutex_lock(&g->dbg_sessions_lock);
|
||||||
|
|
||||||
err = dbg_s->ops->exec_reg_ops(dbg_s, ops, args->num_ops);
|
if (!dbg_s->is_pg_disabled) {
|
||||||
|
powergate_err = dbg_set_powergate(dbg_s,
|
||||||
|
NVHOST_DBG_GPU_POWERGATE_MODE_DISABLE);
|
||||||
|
is_pg_disabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!powergate_err) {
|
||||||
|
err = dbg_s->ops->exec_reg_ops(dbg_s, ops, args->num_ops);
|
||||||
|
/* enable powergate, if previously disabled */
|
||||||
|
if (is_pg_disabled) {
|
||||||
|
powergate_err = dbg_set_powergate(dbg_s,
|
||||||
|
NVHOST_DBG_GPU_POWERGATE_MODE_ENABLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mutex_unlock(&g->dbg_sessions_lock);
|
mutex_unlock(&g->dbg_sessions_lock);
|
||||||
|
|
||||||
|
if (!err && powergate_err)
|
||||||
|
err = powergate_err;
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
gk20a_err(dev, "dbg regops failed");
|
gk20a_err(dev, "dbg regops failed");
|
||||||
goto clean_up;
|
goto clean_up;
|
||||||
|
|||||||
Reference in New Issue
Block a user