Loading drivers/media/platform/msm/npu/npu_dev.c +9 −2 Original line number Original line Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * * * This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -501,6 +501,7 @@ int npu_enable_core_power(struct npu_device *npu_dev) struct npu_pwrctrl *pwr = &npu_dev->pwrctrl; struct npu_pwrctrl *pwr = &npu_dev->pwrctrl; int ret = 0; int ret = 0; mutex_lock(&npu_dev->dev_lock); if (!pwr->pwr_vote_num) { if (!pwr->pwr_vote_num) { ret = npu_enable_regulators(npu_dev); ret = npu_enable_regulators(npu_dev); if (ret) if (ret) Loading @@ -515,6 +516,7 @@ int npu_enable_core_power(struct npu_device *npu_dev) npu_resume_devbw(npu_dev); npu_resume_devbw(npu_dev); } } pwr->pwr_vote_num++; pwr->pwr_vote_num++; mutex_unlock(&npu_dev->dev_lock); return ret; return ret; } } Loading @@ -524,8 +526,12 @@ void npu_disable_core_power(struct npu_device *npu_dev) struct npu_pwrctrl *pwr = &npu_dev->pwrctrl; struct npu_pwrctrl *pwr = &npu_dev->pwrctrl; struct npu_thermalctrl *thermalctrl = &npu_dev->thermalctrl; struct npu_thermalctrl *thermalctrl = &npu_dev->thermalctrl; if (!pwr->pwr_vote_num) mutex_lock(&npu_dev->dev_lock); if (!pwr->pwr_vote_num) { mutex_unlock(&npu_dev->dev_lock); return; return; } pwr->pwr_vote_num--; pwr->pwr_vote_num--; if (!pwr->pwr_vote_num) { if (!pwr->pwr_vote_num) { npu_suspend_devbw(npu_dev); npu_suspend_devbw(npu_dev); Loading @@ -537,6 +543,7 @@ void npu_disable_core_power(struct npu_device *npu_dev) pr_debug("setting back to power level=%d\n", pr_debug("setting back to power level=%d\n", pwr->active_pwrlevel); pwr->active_pwrlevel); } } mutex_unlock(&npu_dev->dev_lock); } } static int npu_enable_core_clocks(struct npu_device *npu_dev) static int npu_enable_core_clocks(struct npu_device *npu_dev) Loading Loading
drivers/media/platform/msm/npu/npu_dev.c +9 −2 Original line number Original line Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * * * This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -501,6 +501,7 @@ int npu_enable_core_power(struct npu_device *npu_dev) struct npu_pwrctrl *pwr = &npu_dev->pwrctrl; struct npu_pwrctrl *pwr = &npu_dev->pwrctrl; int ret = 0; int ret = 0; mutex_lock(&npu_dev->dev_lock); if (!pwr->pwr_vote_num) { if (!pwr->pwr_vote_num) { ret = npu_enable_regulators(npu_dev); ret = npu_enable_regulators(npu_dev); if (ret) if (ret) Loading @@ -515,6 +516,7 @@ int npu_enable_core_power(struct npu_device *npu_dev) npu_resume_devbw(npu_dev); npu_resume_devbw(npu_dev); } } pwr->pwr_vote_num++; pwr->pwr_vote_num++; mutex_unlock(&npu_dev->dev_lock); return ret; return ret; } } Loading @@ -524,8 +526,12 @@ void npu_disable_core_power(struct npu_device *npu_dev) struct npu_pwrctrl *pwr = &npu_dev->pwrctrl; struct npu_pwrctrl *pwr = &npu_dev->pwrctrl; struct npu_thermalctrl *thermalctrl = &npu_dev->thermalctrl; struct npu_thermalctrl *thermalctrl = &npu_dev->thermalctrl; if (!pwr->pwr_vote_num) mutex_lock(&npu_dev->dev_lock); if (!pwr->pwr_vote_num) { mutex_unlock(&npu_dev->dev_lock); return; return; } pwr->pwr_vote_num--; pwr->pwr_vote_num--; if (!pwr->pwr_vote_num) { if (!pwr->pwr_vote_num) { npu_suspend_devbw(npu_dev); npu_suspend_devbw(npu_dev); Loading @@ -537,6 +543,7 @@ void npu_disable_core_power(struct npu_device *npu_dev) pr_debug("setting back to power level=%d\n", pr_debug("setting back to power level=%d\n", pwr->active_pwrlevel); pwr->active_pwrlevel); } } mutex_unlock(&npu_dev->dev_lock); } } static int npu_enable_core_clocks(struct npu_device *npu_dev) static int npu_enable_core_clocks(struct npu_device *npu_dev) Loading