Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix camera issues in 6.7.x on SGo2 #146

Merged
merged 4 commits into from Mar 9, 2024

Conversation

mojyack
Copy link
Contributor

@mojyack mojyack commented Feb 3, 2024

After linux-6.7(or 6.6?), ipu3-imgu and dw9719 are broken. See linux-surface/linux-surface#1323.
This patches fix those issues.
Tested on Surface Go 2.

HidenoriKobayashi and others added 4 commits February 3, 2024 12:45
The imgu driver fails to probe with the following message because it
does not set the pad's flags before calling media_entity_pads_init().

[   14.596315] ipu3-imgu 0000:00:05.0: failed initialize subdev media entity (-22)
[   14.596322] ipu3-imgu 0000:00:05.0: failed to register subdev0 ret (-22)
[   14.596327] ipu3-imgu 0000:00:05.0: failed to register pipes (-22)
[   14.596331] ipu3-imgu 0000:00:05.0: failed to create V4L2 devices (-22)

Fix the initialization order so that the driver probe succeeds. The ops
initialization is also moved together for readability.

Fixes: a0ca162 ("media: staging/intel-ipu3: Add v4l2 driver based on media framework")
Cc: <stable@vger.kernel.org> # 6.7
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Hidenori Kobayashi <hidenorik@chromium.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Use v4l2_create_fwnode_links_to_pad() to create links from async
sub-devices to the CSI-2 receiver subdevs.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Adapt to 009905e "media: v4l2-subdev: Document and enforce .s_stream() requirements"
@StollD
Copy link
Member

StollD commented Mar 9, 2024

First of all sorry for not taking care of this earlier.

I haven't taken a closer look at this, because I am still kinda busy, and the cameras are not my area of expertise. But since upstream seems to ignore this problem as well, I am just going to merge this and trust you that it will fix the cameras.

Do you happen to know what change exactly broke the DW9719 driver? That might be useful to figure out, since reverting entire drivers usually results in a mega-patch that is terribly annoying to rebase.

@StollD StollD merged commit 530f557 into linux-surface:v6.7-surface-devel Mar 9, 2024
StollD added a commit to linux-surface/linux-surface that referenced this pull request Mar 9, 2024
Changes:
 - Add driver for changing the fan profile (Surface Pro 9)
 - Added fixes for IPU3 cameras
 - Reverted DW9719 driver to previous version (Surface Go 2)

Links:
 - kernel: linux-surface/kernel@530f557
 - fan profile driver: linux-surface/kernel#145
 - camera fixes: linux-surface/kernel#146
@kbingham
Copy link
Contributor

kbingham commented Mar 9, 2024

"upstream ignores this" have you reported this upstream? Anything I can follow up on or chase?

@StollD
Copy link
Member

StollD commented Mar 9, 2024

Admittedly, that came across more snarky than I intended it to be, so my apologies for that.

The patch that fixes IPU3 was sent to LKML in january: https://lore.kernel.org/lkml/20240109080910.2859780-1-hidenorik@chromium.org/

When this first came up I hoped it would trickle down to -stable pretty quickly, so I didn't want to go through the hassle of adding it now and removing it later. But so far it seems like it's not even in 6.8.

@kbingham
Copy link
Contributor

kbingham commented Mar 9, 2024

Thanks for the reference. Did that patch fix the issue for you? What are the additional patches you've merged? Are they required for upstream?

Unfortunately if patches are ignored upstream it's because there are more patches than people. Nothing intentional ...

You're well positioned if you have a device or even just sight of the issue to reply and say "this fixes issue X" or " this still breaks" to help get it merged or fixed.

@StollD
Copy link
Member

StollD commented Mar 9, 2024

Did that patch fix the issue for you?

Yes, cameras are working again with the latest builds.

What are the additional patches you've merged?

To be completely honest, I have no idea.

The error message that was produced on earlier 6.7 builds is part of the description of the patch I linked. So I assume that media: ipu3-cio2: Further clean up async subdev link creation is not actually required. The DW9719 revert is apparently required because the newer version doesn't work on Surface Go 2.

Like I said, its not my area of expertise, but I wanted this fixed in our builds at least, since more and more people are reporting it.

@kbingham
Copy link
Contributor

Breaking this series down:

@mojyack
Copy link
Contributor Author

mojyack commented Mar 11, 2024

media: staging: ipu3-imgu: Fix multiple calls of s_stream on stream stop
The camera works without this, but annoying backtraces occur when stopping a stream.
This is written by me for this PR.

@hydrandt
Copy link

I can report that the cameras work out of the box on Surface Go with 6.7.9-surface-1. Tested in Cheese (front camera ok; back camera has focus problem and kinda flashing; also the image should be mirrored).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants