* Subject: [PATCH] usb: gadget:Fixed the problem of abnormal function of mobile phone as UVC camera.
@ 2024-07-25 6:40 胡连勤
2024-07-25 7:05 ` gregkh
0 siblings, 1 reply; 4+ messages in thread
From: 胡连勤 @ 2024-07-25 6:40 UTC (permalink / raw)
To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
gregkh@linuxfoundation.org
Cc: opensource.kernel
From b0058484e3fe7830c2092d5d19b46bf1bab73d83 Mon Sep 17 00:00:00 2001
From: Lianqin Hu <hulianqin@vivo.com>
Date: Wed, 24 Jul 2024 18:52:27 +0800
Subject: [PATCH] usb: gadget:Fixed the problem of abnormal function of mobile
phone as UVC camera.
Android 15 USB function option interface adds camera function.
after switching to camera function, USB enumeration is abnormal.
the reason is that bind_deactivated is set to true in f_uvc driver,
which causes gadget->deactivated to be set to true during
usb_add_function,and dwc3 controller cannot perform pullup operation.
Therefore, modify f_uvc driver and remove the setting operation
of func.bind_deactivated.
Signed-off-by: Lianqin Hu <hulianqin@vivo.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: Subject: [PATCH] usb: gadget:Fixed the problem of abnormal function of mobile phone as UVC camera.
2024-07-25 6:40 Subject: [PATCH] usb: gadget:Fixed the problem of abnormal function of mobile phone as UVC camera 胡连勤
@ 2024-07-25 7:05 ` gregkh
2024-07-26 1:49 ` 回复: " 胡连勤
0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2024-07-25 7:05 UTC (permalink / raw)
To: 胡连勤
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
opensource.kernel
On Thu, Jul 25, 2024 at 06:40:14AM +0000, 胡连勤 wrote:
> From b0058484e3fe7830c2092d5d19b46bf1bab73d83 Mon Sep 17 00:00:00 2001
> From: Lianqin Hu <hulianqin@vivo.com>
> Date: Wed, 24 Jul 2024 18:52:27 +0800
> Subject: [PATCH] usb: gadget:Fixed the problem of abnormal function of mobile
> phone as UVC camera.
For some reason this showed up in the body of the email, and your
subject line has "subject" in it :(
> Android 15 USB function option interface adds camera function.
> after switching to camera function, USB enumeration is abnormal.
What do you mean by "abnormal"?
> the reason is that bind_deactivated is set to true in f_uvc driver,
> which causes gadget->deactivated to be set to true during
> usb_add_function,and dwc3 controller cannot perform pullup operation.
Why does the dwc3 controller matter here? What about other controllers?
>
> Therefore, modify f_uvc driver and remove the setting operation
> of func.bind_deactivated.
>
> Signed-off-by: Lianqin Hu <hulianqin@vivo.com>
> ---
> 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;
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?
What user-visable changes does this patch cause? What used to work that
now will not as that was added for a reason, right?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* 回复: [PATCH] usb: gadget:Fixed the problem of abnormal function of mobile phone as UVC camera.
2024-07-25 7:05 ` gregkh
@ 2024-07-26 1:49 ` 胡连勤
[not found] ` <TYUPR06MB621755F6FD643E99DBD21D42D2B02@TYUPR06MB6217.apcprd06.prod.outlook.com>
0 siblings, 1 reply; 4+ messages in thread
From: 胡连勤 @ 2024-07-26 1:49 UTC (permalink / raw)
To: gregkh@linuxfoundation.org
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
opensource.kernel
1. Modify the email title
2.
> Android 15 USB function option interface adds camera function.
> after switching to camera function, USB enumeration is abnormal.
What do you mean by "abnormal"?
--------------
Select the "Camera" function in the USB function option interface, and the dwc3 controller cannot be enumerated under the sys.usb.config=uvc mode combination
3.
> the reason is that bind_deactivated is set to true in f_uvc driver,
> which causes gadget->deactivated to be set to true during
> usb_add_function,and dwc3 controller cannot perform pullup operation.
Why does the dwc3 controller matter here? What about other controllers?
--------------
Dwc3 & Mtu3 controller test normal.
>
> Therefore, modify f_uvc driver and remove the setting operation
> of func.bind_deactivated.
>
> Signed-off-by: Lianqin Hu <hulianqin@vivo.com>
> ---
> 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;
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 be true submit link:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f277bf27cf5cd56bcd1c4b95ae140f61680a6e83
I haven't seen what specific problem it solves yet, it looks like it makes the code logic more reasonable.
Should it be backported to older kernels, and if so, how far back?
--------------
It seems that the kernel versions used with Android 15 need to be synchronized
What user-visable changes does this patch cause? What used to work that
now will not as that was added for a reason, right?
--------------
The "Camera" function in the USB function options on the phone can be used normally.
Android 15 seems to be the first version to support the "camera" function.
________________________________________
发件人: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
发送时间: 2024年7月25日 15:05
收件人: 胡连勤 <hulianqin@vivo.com>
抄送: akpm@linux-foundation.org <akpm@linux-foundation.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>; opensource.kernel <opensource.kernel@vivo.com>
主题: Re: Subject: [PATCH] usb: gadget:Fixed the problem of abnormal function of mobile phone as UVC camera.
On Thu, Jul 25, 2024 at 06:40:14AM +0000, 胡连勤 wrote:
> From b0058484e3fe7830c2092d5d19b46bf1bab73d83 Mon Sep 17 00:00:00 2001
> From: Lianqin Hu <hulianqin@vivo.com>
> Date: Wed, 24 Jul 2024 18:52:27 +0800
> Subject: [PATCH] usb: gadget:Fixed the problem of abnormal function of mobile
> phone as UVC camera.
For some reason this showed up in the body of the email, and your
subject line has "subject" in it :(
> Android 15 USB function option interface adds camera function.
> after switching to camera function, USB enumeration is abnormal.
What do you mean by "abnormal"?
> the reason is that bind_deactivated is set to true in f_uvc driver,
> which causes gadget->deactivated to be set to true during
> usb_add_function,and dwc3 controller cannot perform pullup operation.
Why does the dwc3 controller matter here? What about other controllers?
>
> Therefore, modify f_uvc driver and remove the setting operation
> of func.bind_deactivated.
>
> Signed-off-by: Lianqin Hu <hulianqin@vivo.com>
> ---
> 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;
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?
What user-visable changes does this patch cause? What used to work that
now will not as that was added for a reason, right?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 回复: [PATCH] usb: gadget:Fixed the problem of abnormal function of mobile phone as UVC camera.
[not found] ` <TYUPR06MB621755F6FD643E99DBD21D42D2B02@TYUPR06MB6217.apcprd06.prod.outlook.com>
@ 2024-07-30 13:16 ` gregkh
0 siblings, 0 replies; 4+ messages in thread
From: gregkh @ 2024-07-30 13:16 UTC (permalink / raw)
To: 胡连勤
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
opensource.kernel
On Tue, Jul 30, 2024 at 12:14:33PM +0000, 胡连勤 wrote:
> Hello linux community expert:
>
> What other information do we need to provide for this patch to be uploaded?
Please answer the questions and redo the patch based on the review.
And please do not send HTML email, the mailing lists reject it.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-30 13:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-25 6:40 Subject: [PATCH] usb: gadget:Fixed the problem of abnormal function of mobile phone as UVC camera 胡连勤
2024-07-25 7:05 ` gregkh
2024-07-26 1:49 ` 回复: " 胡连勤
[not found] ` <TYUPR06MB621755F6FD643E99DBD21D42D2B02@TYUPR06MB6217.apcprd06.prod.outlook.com>
2024-07-30 13:16 ` gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox