[SRU][Eoan][linux-raspi2][PATCH 0/1] set USB_DWC2_DUAL_ROLE=y

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU][Eoan][linux-raspi2][PATCH 0/1] set USB_DWC2_DUAL_ROLE=y

Hui Wang
BugLink: https://bugs.launchpad.net/bugs/1861070

[Impact]
On the RPI4B board, the usb-c power port could also work as a USB
OTG mode, but we set the dwc2 driver to the host mode
unconditionally, now set it to dual_role mode, then it could work
in host/otg/peripheal mode.

[Fix]
Set USB_DWC2_DUAL_ROLE=y, USB_DWC2_HOST=n


[Test Case]
set the dtoverlay=dwc2,dr_mode=[otg|peripheral] in the config.txt,
and isnmod the g_ether or g_cdc, on the host machine, we could see
RPI4B work as a usb device.

Because physical port limitation, could test dr_mode=host.

[Regression Risk]
Low, our eoan kernel choose dwc_otg driver for this port by default,
very very few users will choose dwc2 driver, and the dwc2 driver is
not enabled by default in our kernel.

And bug reporter and I already tested that the peripheral mode works
after this change.


Hui Wang (1):
  UBUNTU: [Config] raspi2: USB_DWC2_DUAL_ROLE=y

 debian.raspi2/config/annotations          | 7 +++++--
 debian.raspi2/config/config.common.ubuntu | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][Eoan][linux-raspi2][PATCH 1/1] UBUNTU: [Config] raspi2: USB_DWC2_DUAL_ROLE=y

Hui Wang
BugLink: https://bugs.launchpad.net/bugs/1861070

On the rpi4B board, the USB-C power supply port also works as an OTG
port. And the driver dwc_otg is for this port by default, this driver
can only work in the host mode, if users want to use the peripheral
or OTG mode, users could add the line below in the config.txt:
dtoverlay=dwc2,dr_mode=[host|otg|peripheral]

Then the driver dwc2 will drive that port, but our original config
set the dwc2 to host unconditionally in the kernel driver, now
changing this setting, let dwc2 work in dual_role mode, after this
change, that port could work in host|otg|peripheral mode according to
the setting in the config.txt.

BTW, so far in the RPI series boards, only PiZero and RPI4B boards
have OTG port.

Signed-off-by: Hui Wang <[hidden email]>
---
 debian.raspi2/config/annotations          | 7 +++++--
 debian.raspi2/config/config.common.ubuntu | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/debian.raspi2/config/annotations b/debian.raspi2/config/annotations
index 5ef21cd41dfd..83095d85417a 100644
--- a/debian.raspi2/config/annotations
+++ b/debian.raspi2/config/annotations
@@ -7308,9 +7308,12 @@ CONFIG_USB_DWC2_DEBUG                           policy<{'amd64': 'n', 'arm64': '
 CONFIG_USB_DWC2_TRACK_MISSED_SOFS               policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'i386': 'n', 'ppc64el': 'n'}>
 
 # Menu: Device Drivers >> USB support >> Support for Host-side USB >> DesignWare USB2 DRD Core Support >> DWC2 Mode Selection
-CONFIG_USB_DWC2_HOST                            policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'i386': 'y', 'ppc64el': 'y'}>
+CONFIG_USB_DWC2_HOST                            policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'i386': 'n', 'ppc64el': 'n'}>
 CONFIG_USB_DWC2_PERIPHERAL                      policy<{'armhf': 'n'}>
-CONFIG_USB_DWC2_DUAL_ROLE                       policy<{'armhf': 'n'}>
+CONFIG_USB_DWC2_DUAL_ROLE                       policy<{'arm64': 'y', 'armhf': 'y'}>
+
+#
+CONFIG_USB_DWC2_DUAL_ROLE                       note<LP:1861070>
 
 # Menu: Device Drivers >> USB support >> Support for Host-side USB >> DesignWare USB3 DRD Core Support
 CONFIG_USB_DWC3                                 policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'i386': 'm', 'ppc64el': 'm'}>
diff --git a/debian.raspi2/config/config.common.ubuntu b/debian.raspi2/config/config.common.ubuntu
index ec0807021ad8..1a175bff319d 100644
--- a/debian.raspi2/config/config.common.ubuntu
+++ b/debian.raspi2/config/config.common.ubuntu
@@ -7221,8 +7221,8 @@ CONFIG_USB_DSBR=m
 # CONFIG_USB_DUMMY_HCD is not set
 CONFIG_USB_DWC2=m
 # CONFIG_USB_DWC2_DEBUG is not set
-# CONFIG_USB_DWC2_DUAL_ROLE is not set
-CONFIG_USB_DWC2_HOST=y
+CONFIG_USB_DWC2_DUAL_ROLE=y
+# CONFIG_USB_DWC2_HOST is not set
 # CONFIG_USB_DWC2_PCI is not set
 # CONFIG_USB_DWC2_PERIPHERAL is not set
 # CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][Eoan][linux-raspi2][PATCH 0/1] set USB_DWC2_DUAL_ROLE=y

Sultan Alsawaf
In reply to this post by Hui Wang
On Mon, Feb 10, 2020 at 10:36:57AM +0800, Hui Wang wrote:

> BugLink: https://bugs.launchpad.net/bugs/1861070
>
> [Impact]
> On the RPI4B board, the usb-c power port could also work as a USB
> OTG mode, but we set the dwc2 driver to the host mode
> unconditionally, now set it to dual_role mode, then it could work
> in host/otg/peripheal mode.
>
> [Fix]
> Set USB_DWC2_DUAL_ROLE=y, USB_DWC2_HOST=n
>
>
> [Test Case]
> set the dtoverlay=dwc2,dr_mode=[otg|peripheral] in the config.txt,
> and isnmod the g_ether or g_cdc, on the host machine, we could see
> RPI4B work as a usb device.
>
> Because physical port limitation, could test dr_mode=host.
>
> [Regression Risk]
> Low, our eoan kernel choose dwc_otg driver for this port by default,
> very very few users will choose dwc2 driver, and the dwc2 driver is
> not enabled by default in our kernel.
>
> And bug reporter and I already tested that the peripheral mode works
> after this change.
>
>
> Hui Wang (1):
>   UBUNTU: [Config] raspi2: USB_DWC2_DUAL_ROLE=y
>
>  debian.raspi2/config/annotations          | 7 +++++--
>  debian.raspi2/config/config.common.ubuntu | 4 ++--
>  2 files changed, 7 insertions(+), 4 deletions(-)
>
> --
> 2.17.1
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Acked-by: Sultan Alsawaf <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][Eoan][linux-raspi2][PATCH 1/1] UBUNTU: [Config] raspi2: USB_DWC2_DUAL_ROLE=y

Stefan Bader-2
In reply to this post by Hui Wang
On 10.02.20 03:36, Hui Wang wrote:

> BugLink: https://bugs.launchpad.net/bugs/1861070
>
> On the rpi4B board, the USB-C power supply port also works as an OTG
> port. And the driver dwc_otg is for this port by default, this driver
> can only work in the host mode, if users want to use the peripheral
> or OTG mode, users could add the line below in the config.txt:
> dtoverlay=dwc2,dr_mode=[host|otg|peripheral]
>
> Then the driver dwc2 will drive that port, but our original config
> set the dwc2 to host unconditionally in the kernel driver, now
> changing this setting, let dwc2 work in dual_role mode, after this
> change, that port could work in host|otg|peripheral mode according to
> the setting in the config.txt.
>
> BTW, so far in the RPI series boards, only PiZero and RPI4B boards
> have OTG port.
>
> Signed-off-by: Hui Wang <[hidden email]>
Acked-by: Stefan Bader <[hidden email]>

> ---
>  debian.raspi2/config/annotations          | 7 +++++--
>  debian.raspi2/config/config.common.ubuntu | 4 ++--
>  2 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/debian.raspi2/config/annotations b/debian.raspi2/config/annotations
> index 5ef21cd41dfd..83095d85417a 100644
> --- a/debian.raspi2/config/annotations
> +++ b/debian.raspi2/config/annotations
> @@ -7308,9 +7308,12 @@ CONFIG_USB_DWC2_DEBUG                           policy<{'amd64': 'n', 'arm64': '
>  CONFIG_USB_DWC2_TRACK_MISSED_SOFS               policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'i386': 'n', 'ppc64el': 'n'}>
>  
>  # Menu: Device Drivers >> USB support >> Support for Host-side USB >> DesignWare USB2 DRD Core Support >> DWC2 Mode Selection
> -CONFIG_USB_DWC2_HOST                            policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'i386': 'y', 'ppc64el': 'y'}>
> +CONFIG_USB_DWC2_HOST                            policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'i386': 'n', 'ppc64el': 'n'}>
>  CONFIG_USB_DWC2_PERIPHERAL                      policy<{'armhf': 'n'}>
> -CONFIG_USB_DWC2_DUAL_ROLE                       policy<{'armhf': 'n'}>
> +CONFIG_USB_DWC2_DUAL_ROLE                       policy<{'arm64': 'y', 'armhf': 'y'}>
> +
> +#
> +CONFIG_USB_DWC2_DUAL_ROLE                       note<LP:1861070>
>  
>  # Menu: Device Drivers >> USB support >> Support for Host-side USB >> DesignWare USB3 DRD Core Support
>  CONFIG_USB_DWC3                                 policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'i386': 'm', 'ppc64el': 'm'}>
> diff --git a/debian.raspi2/config/config.common.ubuntu b/debian.raspi2/config/config.common.ubuntu
> index ec0807021ad8..1a175bff319d 100644
> --- a/debian.raspi2/config/config.common.ubuntu
> +++ b/debian.raspi2/config/config.common.ubuntu
> @@ -7221,8 +7221,8 @@ CONFIG_USB_DSBR=m
>  # CONFIG_USB_DUMMY_HCD is not set
>  CONFIG_USB_DWC2=m
>  # CONFIG_USB_DWC2_DEBUG is not set
> -# CONFIG_USB_DWC2_DUAL_ROLE is not set
> -CONFIG_USB_DWC2_HOST=y
> +CONFIG_USB_DWC2_DUAL_ROLE=y
> +# CONFIG_USB_DWC2_HOST is not set
>  # CONFIG_USB_DWC2_PCI is not set
>  # CONFIG_USB_DWC2_PERIPHERAL is not set
>  # CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED: [SRU][Eoan][linux-raspi2][PATCH 0/1] set USB_DWC2_DUAL_ROLE=y

Kleber Souza
In reply to this post by Hui Wang
On 10.02.20 03:36, Hui Wang wrote:

> BugLink: https://bugs.launchpad.net/bugs/1861070
>
> [Impact]
> On the RPI4B board, the usb-c power port could also work as a USB
> OTG mode, but we set the dwc2 driver to the host mode
> unconditionally, now set it to dual_role mode, then it could work
> in host/otg/peripheal mode.
>
> [Fix]
> Set USB_DWC2_DUAL_ROLE=y, USB_DWC2_HOST=n
>
>
> [Test Case]
> set the dtoverlay=dwc2,dr_mode=[otg|peripheral] in the config.txt,
> and isnmod the g_ether or g_cdc, on the host machine, we could see
> RPI4B work as a usb device.
>
> Because physical port limitation, could test dr_mode=host.
>
> [Regression Risk]
> Low, our eoan kernel choose dwc_otg driver for this port by default,
> very very few users will choose dwc2 driver, and the dwc2 driver is
> not enabled by default in our kernel.
>
> And bug reporter and I already tested that the peripheral mode works
> after this change.
>
>
> Hui Wang (1):
>   UBUNTU: [Config] raspi2: USB_DWC2_DUAL_ROLE=y
>
>  debian.raspi2/config/annotations          | 7 +++++--
>  debian.raspi2/config/config.common.ubuntu | 4 ++--
>  2 files changed, 7 insertions(+), 4 deletions(-)
>

Applied to eoan/linux-raspi2.

Thanks,
Kleber

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team