linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Vikash Garodia <quic_vgarodia@quicinc.com>,
	Dikshita Agarwal <quic_dikshita@quicinc.com>,
	Bryan O'Donoghue <pure.logic@nexus-software.ie>,
	Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	Stanimir Varbanov <stanimir.k.varbanov@gmail.com>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Jonathan Marek <jonathan@marek.ca>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/18] media: venus: hfi_venus: Set venus_sys_idle_indicator to false on V6
Date: Tue, 4 Apr 2023 19:52:08 +0200	[thread overview]
Message-ID: <955cd520-3881-0c22-d818-13fe9a47e124@linaro.org> (raw)
In-Reply-To: <bf5e30fa-5014-5585-3b8e-b1a8d2f95549@quicinc.com>



On 30.03.2023 12:44, Vikash Garodia wrote:
> On 3/24/2023 2:46 PM, Dikshita Agarwal wrote:
>>
>>
>> On 3/20/2023 8:24 PM, Konrad Dybcio wrote:
>>> On 2.03.2023 07:39, Dikshita Agarwal wrote:
>>>> On 2/28/2023 10:23 PM, Bryan O'Donoghue wrote:
>>>>> On 28/02/2023 15:41, Konrad Dybcio wrote:
>>>>>>> Can you test it and make sure ?
>>>>>> As I mentioned in the cover letter, 8250 still seems to work with this
>>>>>> patchset. I have no idea how one would go about validating the
>>>>>> functionality enabled through this call.
>>>>> We offlined about this.
>>>>>
>>>>> I think it is correct to say you don't have access to a display to test this on sm8250.
>>>>>
>>>>> I do so, I will try this out for you, though I'll wait for your V2 for this series.
>>>>>
>>>>> ---
>>>>> bod
>>>> Hi Konrad,
>>>>
>>>> I understand from your commit text, setting this indicator for AR50L is causing issue with suspend.
>>>>
>>>> Ideally it shouldn't cause any such issue. I checked with FW team and got to know that this property is not supported on AR50LT so if you set it there should be some property not supported error.
>>>>
>>>> In my opinion it would be good to replace these versions checks with VPU version check you have introduced in your other patch and keep this setting for current targets and not set wherever not needed eg AR50LT.
>>> So.. I did *something* and I'm no longer getting a jump to EDL.
>>>
>>> The *something* being knocking off hfi_core_suspend().
>>>
>>> If I send a sys_idle_indicator = true, I get (reformatted for
>>> better legibility):
>>>
>>>
>>> [    0.576543] qcom-venus 5a00000.video-codec: VenusFW  :
>>> <VFW_H:HostDr:unkn:--------:-> IMAGE_VARIANT_STRING=PROD
>>>
>>> [    0.603818] qcom-venus 5a00000.video-codec: VenusFW  :
>>> <VFW_H:HostDr:unkn:--------:-> OEM_IMAGE_VERSION_STRING=CRM
>>>
>>> [    0.608633] qcom-venus 5a00000.video-codec: VenusFW  :
>>> <VFW_H:HostDr:unkn:--------:-> BUILD_TIME: Mar 15 2021 04:24:58
>>>
>>> [    0.608644] qcom-venus 5a00000.video-codec: VenusFW  :
>>> <VFW_L:HostDr:unkn:--------:-> Host cmd 0x10005
>>>
>>> [    0.608655] qcom-venus 5a00000.video-codec: VenusFW  :
>>> <VFW_E:HostDr:unkn:--------:-> VenusHostDriver_SetSysProperty(1019): HostDriver:  VenusHostDriver_SetSysProperty unsupport property!
>>>
>>> [    0.608667] qcom-venus 5a00000.video-codec: VenusFW  :
>>> <VFW_E:HostDr:unkn:--------:-> WaitForHWidle(408): VENUS is idle, no HW is running
>>>
>>> [    0.650759] qcom-venus 5a00000.video-codec: VenusFW  :
>>> <VFW_E:HostDr:unkn:--------:-> assert_loop(433):
>>> FW Assertion - Z:/b/venus_proc/venus/drivers/src/VenusHostDriver.c:1020:5ab9a
>>
>> this "unsupported property" error and then the assert from FW is expected on AR50LT if driver sets HFI_PROPERTY_SYS_IDLE_INDICATOR to FW.
>>
>> As I mentioned in my other reply, this property doesn't need to be set by driver now, FW internally always enables it.
>>
>>> Which then crashes Venus for good (perhaps we're missing a
>>> handler for such errors that would hard reset the hw), meaning
>>> trying to access it through ffmpeg will result in it never firing
>>> any IRQs, so no submitted commands ever complete.
>>>
>>> With this information, after uncommenting the hfi_core_suspend
>>> call and changing:
>>>
>>> [1]
>>> --- hfi_venus.c : venus_suspend_3xx() --
>>>
>>> - venus_prepare_power_collapse(hdev, true);
>>> + venus_prepare_power_collapse(hdev, false);
>>>
>>> ----------------------------------------
>>>
>>> I was able to test further. Turning the ARM9 core off messes
>>> with the sys_idle things. Perhaps some power sequencing is
>>> wrong. The diff I just mentioned comes from the fact that
>>> AR50L will never ever ever send a PC_PREP_DONE ack, or at
>>> least downstream never expects it (or any other HFI6XX
>>> target FWIW) to do so.
>>>
>>>
>>> Now, I also realized the adjacent set_power_control doesn't seem to be used at
>>> all on msm-4.19 techpack/video. Testing all the possible combinations, I get
>>> (to make it extra clear, with all the powerdown stuff in place and only diff
>>> [1] in place atop what I already had before):
>>>
>>>
>>> [set_idle_message] [set_power_control] [result]
>>> 0 0 - no crash at boot, venus doesn't work ->
>>>     "Too many packets buffered for output stream 0:1."
>>>
>>> 0 1 - no crash at boot, ffmpeg hangs near vdec session init ->
>>>     jump to EDL shortly after
>>>
>>> 1 0 - hang at boot, even before display subsys initializes ->
>>>     platform totally hangs
>>>
>>> 1 1 - same as (1, 0), probably due to sys_idle_indicator being on ->
>>>     platform totally hangs as well
>>>
>>> Perhaps (0, 0) is "good" and things can be worked up from there?
>>> Can you recheck with the firmware team if this is expected?
>>
>> I will check regarding set_power_control(HFI_PROPERTY_SYS_CODEC_POWER_PLANE_CTRL) with FW team and get back.
>>
> HFI_PROPERTY_SYS_IDLE_INDICATOR is not supported beyond 8916 (which is versioned as V1 in video driver). This can be dropped.
> 
> Since the property is not functionally active, it is upto firmware when they might decide to start error out as unsupported property.
> 
> SYS_CODEC_POWER_PLANE_CTRL is supported for AR50/AR50L/IRIS1/2. It is a mandatory HFI to get the required power benefits.
> 
> vcodec0 GDSC should be also configured as HW_CTRL while setting POWER_PLANE_CTRL to firmware.
> 
Okay that's very good to know. To sum it up, the outcome you would
expect is (more or less):

- static bool venus_sys_idle_indicator = true;

[...]

- if(IS_V4(hdev->core) || IS_V6(hdev->core))
-	venus_sys_idle_indicator = true;

+ venus_sys_idle_indicator = IS_V1(hdev->core);


?

Konrad
>> Thanks,
>>
>> Dikshita
>>
>>> Konrad
>>>> Thanks,
>>>>
>>>> Dikshita
>>>>

  parent reply	other threads:[~2023-04-04 17:52 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28 15:24 [PATCH 00/18] Venus QoL / maintainability fixes Konrad Dybcio
2023-02-28 15:24 ` [PATCH 01/18] media: venus: hfi_venus: Set venus_sys_idle_indicator to false on V6 Konrad Dybcio
2023-02-28 15:26   ` Bryan O'Donoghue
2023-02-28 15:31     ` Bryan O'Donoghue
2023-02-28 15:37       ` Konrad Dybcio
2023-02-28 15:38         ` Bryan O'Donoghue
2023-02-28 15:41           ` Konrad Dybcio
2023-02-28 16:53             ` Bryan O'Donoghue
2023-03-02  6:39               ` Dikshita Agarwal
2023-03-02 11:33                 ` Konrad Dybcio
2023-03-02 11:54                   ` Dikshita Agarwal
2023-03-20 14:54                 ` Konrad Dybcio
     [not found]                   ` <e93ba74a-ccde-c6bd-4302-8884144d615d@quicinc.com>
     [not found]                     ` <bf5e30fa-5014-5585-3b8e-b1a8d2f95549@quicinc.com>
2023-04-04 17:52                       ` Konrad Dybcio [this message]
2023-02-28 15:24 ` [PATCH 02/18] media: venus: Introduce VPU version distinction Konrad Dybcio
2023-03-02  7:12   ` Dikshita Agarwal
2023-03-02 11:37     ` Konrad Dybcio
2023-03-30 11:02       ` Vikash Garodia
2023-03-30 11:15         ` Konrad Dybcio
2023-02-28 15:24 ` [PATCH 03/18] media: venus: Add vpu_version to most SoCs Konrad Dybcio
2023-02-28 15:24 ` [PATCH 04/18] media: venus: firmware: Leave a clue for homegrown porters Konrad Dybcio
2023-03-02  8:18   ` Dikshita Agarwal
2023-02-28 15:24 ` [PATCH 05/18] media: venus: hfi_venus: Sanitize venus_boot_core() per-VPU-version Konrad Dybcio
2023-03-02 11:00   ` Dikshita Agarwal
2023-03-02 11:10     ` Konrad Dybcio
2023-03-02 11:58       ` Dikshita Agarwal
2023-02-28 15:24 ` [PATCH 06/18] media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts Konrad Dybcio
2023-02-28 15:33   ` Bryan O'Donoghue
2023-02-28 15:59     ` Konrad Dybcio
2023-03-02 12:27       ` Dikshita Agarwal
2023-02-28 15:24 ` [PATCH 07/18] media: venus: core: Assign registers based on VPU version Konrad Dybcio
2023-03-07  4:57   ` Dikshita Agarwal
2023-03-07 11:18     ` Konrad Dybcio
2023-02-28 15:24 ` [PATCH 08/18] media: venus: hfi_venus: Fix version checks in venus_halt_axi() Konrad Dybcio
2023-02-28 15:36   ` Bryan O'Donoghue
2023-02-28 16:01     ` Konrad Dybcio
2023-03-02 12:35       ` Dikshita Agarwal
2023-02-28 15:24 ` [PATCH 09/18] media: venus: hfi_venus: Fix version checks in venus_isr() Konrad Dybcio
2023-03-07  6:12   ` Dikshita Agarwal
2023-03-07  6:14     ` Dikshita Agarwal
2023-02-28 15:24 ` [PATCH 10/18] media: venus: hfi_venus: Fix version check in venus_cpu_and_video_core_idle() Konrad Dybcio
2023-02-28 15:40   ` Bryan O'Donoghue
2023-02-28 15:24 ` [PATCH 11/18] media: venus: hfi_venus: Fix version check in venus_cpu_idle_and_pc_ready() Konrad Dybcio
2023-02-28 15:24 ` [PATCH 12/18] media: venus: firmware: Correct IS_V6() checks Konrad Dybcio
2023-02-28 15:48   ` Bryan O'Donoghue
2023-02-28 16:08     ` Konrad Dybcio
2023-02-28 15:24 ` [PATCH 13/18] media: venus: hfi_platform: Check vpu_version instead of device compatible Konrad Dybcio
2023-02-28 15:49   ` Bryan O'Donoghue
2023-02-28 15:24 ` [PATCH 14/18] media: venus: vdec: Fix version check in vdec_set_work_route() Konrad Dybcio
2023-02-28 15:50   ` Bryan O'Donoghue
2023-02-28 15:24 ` [PATCH 15/18] media: venus: Remap bufreq fields on HFI6XX Konrad Dybcio
2023-02-28 15:51   ` Bryan O'Donoghue
2023-02-28 16:05     ` Konrad Dybcio
2023-02-28 15:24 ` [PATCH 16/18] media: venus: Introduce accessors for remapped hfi_buffer_reqs members Konrad Dybcio
2023-02-28 15:54   ` Bryan O'Donoghue
2023-02-28 15:24 ` [PATCH 17/18] media: venus: Use newly-introduced hfi_buffer_requirements accessors Konrad Dybcio
2023-02-28 15:56   ` Bryan O'Donoghue
2023-02-28 16:09     ` Konrad Dybcio
2023-02-28 15:24 ` [PATCH 18/18] media: venus: hfi_venus: Restrict writing SCIACMDARG3 to Venus V1/V2 Konrad Dybcio
2023-02-28 15:57   ` Bryan O'Donoghue
2023-02-28 16:09     ` Konrad Dybcio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=955cd520-3881-0c22-d818-13fe9a47e124@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=jonathan@marek.ca \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=pure.logic@nexus-software.ie \
    --cc=quic_dikshita@quicinc.com \
    --cc=quic_vgarodia@quicinc.com \
    --cc=stanimir.k.varbanov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).