Skip to contentSkip to conversation

Failure to stop CAMSS stream (sc8280xp)

DISCUSSION Johan Hovold 3 participants 4 messages Jul 3, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I've been testing Bryan's work that enables the camera on the Lenovo ThinkPad X13s and keep triggering the below warnings when stopping a stream (e.g. closing qcam) which indicate that this is a driver bug.

After this happens qcam fails to start again (something returns -EBUSY).

Is this a known issue with CAMSS or is something missing in the sc8280xp integration?

I'm using the following (squashed) devicetree patch from Bryan to enable the camera (everything else is upstream):

	https://github.com/jhovold/linux/commit/85b41b8d0efd418509df548592f95b43b9663409

The issue was there with 6.9 as well so it's not a (recent) regression.

Probing the camera sometimes, but infrequently, also fails with:

qcom-camss ac5a000.camss: Failed to power up pipeline: -13

and I'm seeing the following warning on every boot:

	i2c-qcom-cci ac4c000.cci: Found 19200000 cci clk rate while 37500000 was expected

Johan

[ 1265.509677] ------------[ cut here ]------------
[ 1265.509831] WARNING: CPU: 5 PID: 919 at drivers/media/common/videobuf2/videobuf2-core.c:2183 __vb2_queue_cancel+0x230/0x2c8 [videobuf2_common]
...
[ 1265.510417] CPU: 5 PID: 919 Comm: qcam Not tainted 6.10.0-rc5 #124
[ 1265.510428] Hardware name: LENOVO 21BYZ9SRUS/21BYZ9SRUS, BIOS N3HET87W (1.59 ) 12/05/2023
...
[ 1265.510630] Call trace:
[ 1265.510636]  __vb2_queue_cancel+0x230/0x2c8 [videobuf2_common]
[ 1265.510648]  vb2_core_streamoff+0x24/0xcc [videobuf2_common]
[ 1265.510660]  vb2_ioctl_streamoff+0x5c/0xa8 [videobuf2_v4l2]
[ 1265.510673]  v4l_streamoff+0x24/0x30 [videodev]
[ 1265.510707]  __video_do_ioctl+0x190/0x3f4 [videodev]
[ 1265.510732]  video_usercopy+0x304/0x8c4 [videodev]
[ 1265.510757]  video_ioctl2+0x18/0x34 [videodev]
[ 1265.510782]  v4l2_ioctl+0x40/0x60 [videodev]
[ 1265.510807]  __arm64_sys_ioctl+0xa8/0xec
[ 1265.510820]  invoke_syscall+0x48/0x118
[ 1265.510834]  el0_svc_common.constprop.0+0x40/0xe0
[ 1265.510845]  do_el0_svc+0x1c/0x28
[ 1265.510856]  el0_svc+0x48/0x114
[ 1265.510867]  el0t_64_sync_handler+0xc0/0xc4
[ 1265.510876]  el0t_64_sync+0x190/0x194
[ 1265.510885] irq event stamp: 279668
[ 1265.510892] hardirqs last  enabled at (279667): [<ffffa0c6a09d7754>] _raw_spin_unlock_irqrestore+0x74/0x78
[ 1265.510904] hardirqs last disabled at (279668): [<ffffa0c6a09c8860>] el1_dbg+0x24/0x8c
[ 1265.510913] softirqs last  enabled at (279636): [<ffffa0c69ffe76e4>] fpsimd_restore_current_state+0x34/0xc4
[ 1265.510924] softirqs last disabled at (279634): [<ffffa0c69ffe76b4>] fpsimd_restore_current_state+0x4/0xc4
[ 1265.510935] ---[ end trace 0000000000000000 ]---
[ 1265.510944] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 0 in active state
[ 1265.511175] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 1 in active state
[ 1265.511398] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 2 in active state
#1 lore raw
Quoted 2 lines · Johan Hovold

Is this a known issue with CAMSS or is something missing in the sc8280xp integration?

A known issue on my end, I also want to root cause intermittent sensor startup failure, before switching on the sensor upstream for more common use.

Quoted 10 lines

I'm using the following (squashed) devicetree patch from Bryan to enable the camera (everything else is upstream):

	https://github.com/jhovold/linux/commit/85b41b8d0efd418509df548592f95b43b9663409

The issue was there with 6.9 as well so it's not a (recent) regression.

Probing the camera sometimes, but infrequently, also fails with:

qcom-camss ac5a000.camss: Failed to power up pipeline: -13

Yes this. If you recall on the pm8010 I had mentioned to you about a wait-time to startup the regulator - thinking it was the regulator causing this error.

More likely the GPIO reset polarity or delay needs to be tweaked in the sensor driver.

Quoted 3 lines

and I'm seeing the following warning on every boot:

	i2c-qcom-cci ac4c000.cci: Found 19200000 cci clk rate while 37500000 was expected

That's hanging around for quite a long time 19.2 MHz is a perfectly valid clock, useless error message.

---
bod

#2 lore raw
Quoted 5 lines · Bryan O'Donoghue
Quoted 2 lines · Johan Hovold

Is this a known issue with CAMSS or is something missing in the sc8280xp integration?

A known issue on my end,

Ok, good. Do you know already if this is a generic CAMSS issue or something with the sc8280xp integration? I believe I heard someone saying that they had seen something similar on other Qualcomm platforms.

Quoted 8 lines

I also want to root cause intermittent sensor
startup failure, before switching on the sensor upstream for more common use.

Quoted 4 lines

The issue was there with 6.9 as well so it's not a (recent) regression.

Probing the camera sometimes, but infrequently, also fails with:

Quoted 8 lines
Quoted 1 line

qcom-camss ac5a000.camss: Failed to power up pipeline: -13

Yes this. If you recall on the pm8010 I had mentioned to you about a wait-time to startup the regulator - thinking it was the regulator causing this error.

More likely the GPIO reset polarity or delay needs to be tweaked in the sensor driver.

Ok. Seems to happen quite rarely here. I have also seen a probe deferral warning (which should be suppressed if it's legit) that may or may not be related:

	ov5675 24-0010: failed to get HW configuration: -517
Quoted 6 lines
Quoted 3 lines

and I'm seeing the following warning on every boot:

	i2c-qcom-cci ac4c000.cci: Found 19200000 cci clk rate while 37500000 was expected

That's hanging around for quite a long time 19.2 MHz is a perfectly valid clock, useless error message.

Ok, but please do something to get rid of this warning as well. With too much noise in the logs, people may fail to notice real issues.

Johan

#3 lore raw
Quoted 10 lines · Johan Hovold
Quoted 5 lines · Bryan O'Donoghue
Quoted 2 lines · Johan Hovold

Is this a known issue with CAMSS or is something missing in the sc8280xp integration?

A known issue on my end,

Ok, good. Do you know already if this is a generic CAMSS issue or something with the sc8280xp integration? I believe I heard someone saying that they had seen something similar on other Qualcomm platforms.

It seems generic but, I only really started to see it on x13s, then again I use x13s as a semi-daily driver...

Quoted 15 lines
Quoted 15 lines

I also want to root cause intermittent sensor
startup failure, before switching on the sensor upstream for more common use.

Quoted 5 lines

The issue was there with 6.9 as well so it's not a (recent) regression.

Probing the camera sometimes, but infrequently, also fails with:

qcom-camss ac5a000.camss: Failed to power up pipeline: -13

Yes this. If you recall on the pm8010 I had mentioned to you about a wait-time to startup the regulator - thinking it was the regulator causing this error.

Quoted 8 lines
Quoted 2 lines

More likely the GPIO reset polarity or delay needs to be tweaked in the sensor driver.

Ok. Seems to happen quite rarely here. I have also seen a probe deferral warning (which should be suppressed if it's legit) that may or may not be related:

	ov5675 24-0010: failed to get HW configuration: -517

Hah odd, I haven't seen probe deferral myself - perhaps not in the intrd for my laptop.

Quoted 10 lines
Quoted 7 lines
Quoted 4 lines

and I'm seeing the following warning on every boot:

	i2c-qcom-cci ac4c000.cci: Found 19200000 cci clk rate while 37500000 was expected

That's hanging around for quite a long time 19.2 MHz is a perfectly valid clock, useless error message.

Ok, but please do something to get rid of this warning as well. With too much noise in the logs, people may fail to notice real issues.

ack

---
bod