lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <TYUPR06MB62176C90FAD82DB165866B19D2B12@TYUPR06MB6217.apcprd06.prod.outlook.com>
Date: Wed, 31 Jul 2024 09:39:16 +0000
From: 胡连勤 <hulianqin@...o.com>
To: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC: "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	opensource.kernel <opensource.kernel@...o.com>
Subject:
 答复: 答复: [PATCH v2] usb: gadget: uvc: Fixed the abnormal enumeration problem of mobile phone as UVC camera.

When the phone is connected to the computer to use the webcam function,
the phone needs to be enumerated as a uvc camera function.

Because uvc->func.bind_deactivated is configured as true in the f_uvc
driver uvc_alloc function, the usb_gadget_deactivate function is called
during the execution of the configfs_composite_bind function to
set gadget->deactivated to true, which in turn causes the
usb_gadget_connect_locked function to fail to call the corresponding
controller pullup operation (such as: dwc3_gadget_pullup,
mtu3_gadget_pullup), and the USB cannot be enumerated
normally under the uvc function combination.

After applying this patch, we measured that under the uvc function,
the dwc3 controller and the mtu3 controller can be enumerated normally,
and the webcam function is normal.

Therefore, modify the f_uvc driver to remove the operation of setting
uvc->func.bind_deactivated to true.

Signed-off-by: Lianqin Hu <hulianqin@...o.com>
---
v2:
  - Modify "Fixes:" tag on the commit
  - Modify description information.
---
 drivers/usb/gadget/function/f_uvc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index 40187b7112e7..6d63bea14211 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -1107,7 +1107,6 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi)
 	uvc->func.disable = uvc_function_disable;
 	uvc->func.setup = uvc_function_setup;
 	uvc->func.free_func = uvc_free;
-	uvc->func.bind_deactivated = true;
 
 	return &uvc->func;
 
-- 
2.39.0

-------------------------------
Questions and Answers:
So this has never worked at all?  How is that possible?  Others have used this properly, are you sure nothing is wrong somewhere else?
----  The current analysis has not found any other problems. Perhaps the problem can be solved by changing uvc->func.bind_deactivated in the f_uvc driver to false in other ways.

-----邮件原件-----
发件人: gregkh@...uxfoundation.org <gregkh@...uxfoundation.org> 
发送时间: 2024年7月31日 17:15
收件人: 胡连勤 <hulianqin@...o.com>
抄送: akpm@...ux-foundation.org; linux-kernel@...r.kernel.org; opensource.kernel <opensource.kernel@...o.com>
主题: Re: 答复: [PATCH v1] usb: gadget: uvc: Fixed the abnormal enumeration problem of mobile phone as UVC camera.

On Wed, Jul 31, 2024 at 08:46:25AM +0000, 胡连勤 wrote:
> Hello linux community expert:
> 
> The following are answers to several questions about this patch:
> 
> 1.Why does the dwc3 controller matter here?  What about other controllers?
>  We have tested that both the dwc3 controller and the mtu3 controller  
> have such problems under the uvc function combination.
> 
> 2.Why was this set to be true to start with?  What commit id does this 
> fix?  Should it be backported to older kernels, and if so, how far back?
>  Set to true for commit records:
>  
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.
> kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%2
> Fcommit%2F%3Fid%3Df277bf27cf5cd56bcd1c4b95ae140f61680a6e83&data=05%7C0
> 2%7Chulianqin%40vivo.com%7C3188084c19cf4d44bc9608dcb141502c%7C923e42dc
> 48d54cbeb5821a797a6412ed%7C0%7C0%7C638580141318843466%7CUnknown%7CTWFp
> bGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn
> 0%3D%7C0%7C%7C%7C&sdata=Eb7wxxPIEdE6Gci%2FZjp8ZzUt3b6v9IgcCPp3m18JTn4%
> 3D&reserved=0
>  
>  It seems that the f_uvc driver logic is optimized, and the code logic is more reasonable.

Please use the proper "Fixes:" tag on the commit.

>  
>  kernel5.10, kernel 5.15, kernel6.1, and kernel6.6 versions all need 
> to be synchronized,  From the current point of view, these kernel versions will be compatible with Android 14 and newer versions.

So this has never worked at all?  How is that possible?  Others have used this properly, are you sure nothing is wrong somewhere else?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ