[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f15280a5-deba-89b0-5a0f-f4e3adb562c3@quicinc.com>
Date: Tue, 6 May 2025 15:33:28 +0530
From: Dikshita Agarwal <quic_dikshita@...cinc.com>
To: Konrad Dybcio <konrad.dybcio@....qualcomm.com>,
Bryan O'Donoghue
<bryan.odonoghue@...aro.org>,
Vikash Garodia <quic_vgarodia@...cinc.com>,
Abhinav Kumar <quic_abhinavk@...cinc.com>,
Mauro Carvalho Chehab
<mchehab@...nel.org>,
Stefan Schmidt <stefan.schmidt@...aro.org>,
"Hans
Verkuil" <hverkuil@...all.nl>,
Bjorn Andersson <andersson@...nel.org>,
"Konrad Dybcio" <konradybcio@...nel.org>,
Rob Herring <robh@...nel.org>,
"Krzysztof Kozlowski" <krzk+dt@...nel.org>,
Conor Dooley
<conor+dt@...nel.org>
CC: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>,
Neil Armstrong
<neil.armstrong@...aro.org>,
Nicolas Dufresne
<nicolas.dufresne@...labora.com>,
<linux-media@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
<20250417-topic-sm8x50-iris-v10-v7-0-f020cb1d0e98@...aro.org>,
<20250424-qcs8300_iris-v5-0-f118f505c300@...cinc.com>,
<stable@...r.kernel.org>
Subject: Re: [PATCH v3 05/23] media: iris: Prevent HFI queue writes when core
is in deinit state
On 5/2/2025 7:24 PM, Konrad Dybcio wrote:
> On 5/2/25 2:22 PM, Bryan O'Donoghue wrote:
>> On 01/05/2025 20:13, Dikshita Agarwal wrote:
>>> - if (core->state == IRIS_CORE_ERROR)
>>> + if (core->state == IRIS_CORE_ERROR || core->state == IRIS_CORE_DEINIT)
>>> return -EINVAL;
>>
>> Instead of checking for 2/3 of the states why not just check for the 1/3 ?
>>
>> enum iris_core_state {
>> IRIS_CORE_DEINIT,
>> IRIS_CORE_INIT,
>> IRIS_CORE_ERROR,
>> };
>>
>> if (core->state != IRIS_CORE_INIT)
>> return -EINVAL;
>>
>> Cleaner and more explicit - declaring the state you must be in, as opposed to a list of states you should not be in.
>
> Being explicit in state machines helps maintainability - if we get
> e.g. IRIS_CORE_LIGHT_SLEEP down the line, this could easily fail
>
Agree, would prefer to keep the check as is
if (core->state == IRIS_CORE_ERROR || core->state == IRIS_CORE_DEINIT)
Thanks,
Dikshita
> Konrad
Powered by blists - more mailing lists