From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vikash Garodia Subject: Re: [PATCH v2 2/5] media: venus: add a routine to set venus state Date: Wed, 04 Jul 2018 15:11:49 +0530 Message-ID: <5560573ed426b03ad7676ac14a291e70@codeaurora.org> References: <1527884768-22392-1-git-send-email-vgarodia@codeaurora.org> <1527884768-22392-3-git-send-email-vgarodia@codeaurora.org> <20180601212117.GD11565@jcrouse-lnx.qualcomm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Tomasz Figa Cc: Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Andy Gross , bjorn.andersson@linaro.org, Stanimir Varbanov , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , linux-soc@vger.kernel.org, devicetree@vger.kernel.org, Alexandre Courbot , linux-media-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org On 2018-07-04 14:30, Tomasz Figa wrote: > On Wed, Jul 4, 2018 at 4:59 PM Vikash Garodia > wrote: >> On 2018-06-04 18:24, Tomasz Figa wrote: >> > On Sat, Jun 2, 2018 at 6:21 AM Jordan Crouse >> > wrote: >> >> On Sat, Jun 02, 2018 at 01:56:05AM +0530, Vikash Garodia wrote: >> > Given that this function is supposed to substitute existing calls into >> > qcom_scm_set_remote_state(), why not just do something like this: >> > >> > if (qcom_scm_is_available()) >> > return qcom_scm_set_remote_state(state, 0); >> > >> > switch (state) { >> > case TZBSP_VIDEO_SUSPEND: >> > writel_relaxed(1, reg_base + WRAPPER_A9SS_SW_RESET); >> > break; >> > case TZBSP_VIDEO_RESUME: >> > venus_reset_hw(core); >> > break; >> > } >> > >> > return 0; >> This will not work as driver will write on the register irrespective >> of >> scm >> availability. > > I'm sorry, where would it do so? The second line returns from the > function inf SCM is available, so the rest of the function wouldn't be > executed. Ah!! you are right. That would work as well. I am ok with either way, but would recommend to keep it the existing way as it makes it little more readable. > Best regards, > Tomasz