Bug 210777

Summary: pwc driver doesn't work anymore
Product: Drivers Reporter: Harald Jenny (harald)
Component: USBAssignee: Default virtual assignee for Drivers/USB (drivers_usb)
Status: RESOLVED CODE_FIX    
Severity: normal CC: Adrian.Bassett, mister.freeman
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 5.10.0 Subsystem:
Regression: No Bisected commit-id:
Attachments: kernel trace
patch for pwc courtesy of Matwey V. Kornilov

Description Harald Jenny 2020-12-18 17:22:31 UTC
Created attachment 294219 [details]
kernel trace

Hello,

in 5.9.11 the module works so the disrupting change must be somewhere in the 5.10 tree, attached is the kernel trace.

Kind regards
Harald Jenny
Comment 1 Harald Jenny 2020-12-18 17:55:08 UTC
Problem is present in 5.10.0-rc4 but not in 5.9.15.
Comment 2 Adrian Bassett 2020-12-23 20:59:36 UTC
I can confirm that the PWC webcam is no longer working with the 5.10 kernel series (tried both 5.10.0 and 5.10.2) but, similarly, continues to work OK with 5.9.16.

The app level diagnostic I'm seeing is:

'libv4l2: error turning on stream: Cannot allocate memory
error: v4l2-helpers: unable to start stream' (from OBS)

and from systemd:

'kernel: pwc: Failed to allocate urb buffer 0'
Comment 3 Harald Jenny 2021-01-03 18:56:42 UTC
The problem is presumably related to the changes in the DMA mapping in kernel 5.10 (commit 5a32c3413d3340f90c82c84b375ad4b335a59f28) as pwc uses noncoherent DMA buffers. Reverting commit 1161db6776bd1c35257e1e362e91bcb1b3fe4347 (which fixes performance issues) make pwc work again but opens up the orginial problem of transfer rates on armv7l.
Comment 4 Harald Jenny 2021-01-06 11:22:50 UTC
Patch by Matwey V. Kornilov from the 4th January fixes the problem in the correct way, please consider applying it to the 5.10 as well as the 5.11 tree.
Comment 5 Barto 2021-01-14 15:38:17 UTC
I will try this patch, because I have also the same error with my webcam "Creative Labs Webcam 5 (usb-0000:00:1d.0-2)" with kernel linux 5.10.7.
Comment 6 Barto 2021-01-14 15:39:37 UTC
@Harald Jenny: can you provide the link to this patch, or add it as attachment with the bugreport ?

Thanks
Comment 7 Harald Jenny 2021-01-14 17:06:42 UTC
Created attachment 294633 [details]
patch for pwc courtesy of Matwey V. Kornilov
Comment 8 Harald Jenny 2021-01-14 17:12:30 UTC
I attached the patch to this bug report hopefully it fixes your problem too.
Comment 9 Barto 2021-01-14 21:45:43 UTC
*** Bug 211195 has been marked as a duplicate of this bug. ***
Comment 10 Barto 2021-01-14 21:47:14 UTC
@Harald Jenny : I tested your patch, it works, my webcam works now with kernel 5.10.7,

I hope it will be applied to 5.10 and 5.11 tree.
Comment 11 Harald Jenny 2021-01-15 06:28:07 UTC
That is very good to hear thanks goes to Matwey V. Kornilov for the fast patch.
Comment 12 Greg Kroah-Hartman 2021-01-15 06:35:37 UTC
On Thu, Jan 14, 2021 at 09:47:14PM +0000, bugzilla-daemon@bugzilla.kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=210777
> 
> --- Comment #10 from Barto (mister.freeman@laposte.net) ---
> @Harald Jenny : I tested your patch, it works, my webcam works now with
> kernel
> 5.10.7,
> 
> I hope it will be applied to 5.10 and 5.11 tree.
> 

Please read Documentation/SubmittingPatches for how to properly get a
patch accepted to the kernel.  Attaching it in bugzilla does not work :)
Comment 13 Harald Jenny 2021-01-15 06:39:57 UTC
The patch was just uploaded here to allow people to fix already released kernels, patch submitter Matwey V. Kornilov took care of submitting it for kernel inclusion. But thanks for your hint anyway :-).
Comment 14 Adrian Bassett 2021-02-24 15:37:55 UTC
So, this patch has now landed in the 5.11.1, 5.10.18, and 5.4.100 kernel branches.

I have compiled and tested the former two versions and all seems good.
Comment 15 Harald Jenny 2021-02-24 17:25:02 UTC
Ok then I think we can close this bug.