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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 24 Nov 2020 09:57:45 +0000
From:   Peter Chen <peter.chen@....com>
To:     Roger Quadros <rogerq@...com>
CC:     "pawell@...ence.com" <pawell@...ence.com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "balbi@...nel.org" <balbi@...nel.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] Revert "usb: cdns3: core: quit if it uses role switch
 class"




Best regards,
Peter Chen

> -----Original Message-----
> From: Roger Quadros <rogerq@...com>
> Sent: 2020年11月24日 17:39
> To: Peter Chen <peter.chen@....com>
> Cc: pawell@...ence.com; gregkh@...uxfoundation.org; balbi@...nel.org;
> linux-usb@...r.kernel.org; linux-kernel@...r.kernel.org
> Subject: Re: [PATCH] Revert "usb: cdns3: core: quit if it uses role switch class"
> 
> Peter,
> 
> On 24/11/2020 08:43, Peter Chen wrote:
> > On 20-11-23 13:50:51, Roger Quadros wrote:
> >> This reverts commit 50642709f6590fe40afa6d22c32f23f5b842aed5.
> >>
> >> This commit breaks hardware based role switching on TI platforms.
> >> cdns->role_sw is always going to be non-zero as it is a pointer
> >> to the usb_role_switch instance. Some other means needs to be used if
> >> hardware based role switching is not required by the platform.
> >>
> >> Signed-off-by: Roger Quadros <rogerq@...com>
> >> ---
> >>   drivers/usb/cdns3/core.c | 4 ----
> >>   1 file changed, 4 deletions(-)
> >>
> >> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
> >> index a0f73d4711ae..4c1445cf2ad0 100644
> >> --- a/drivers/usb/cdns3/core.c
> >> +++ b/drivers/usb/cdns3/core.c
> >> @@ -280,10 +280,6 @@ int cdns3_hw_role_switch(struct cdns3 *cdns)
> >>   	enum usb_role real_role, current_role;
> >>   	int ret = 0;
> >>
> >> -	/* Depends on role switch class */
> >> -	if (cdns->role_sw)
> >> -		return 0;
> >> -
> >>   	pm_runtime_get_sync(cdns->dev);
> >>
> >>   	current_role = cdns->role;
> >> --
> >
> > Hi Roger,
> >
> > I am sorry about that. Do you use role switch /sys entry, if you have
> > used, I prefer using "usb-role-switch" property at dts to judge if SoC
> > OTG signals or external signals for role switch. If you have not used
> > it, I prefer only setting cdns->role_sw for role switch use cases.
> >
> 
> We use both hardware role switch and /sys entries for manually forcing a
> certain role.
> 
> We do not set any "usb-role-switch" property at DTS.
> 
> Currently cdns->role_sw is being always set by driver irrespective of any DT
> property, so this patch is clearly wrong and needs to be reverted.
> 
> What do you think?
> 

Could you accept below fix?

diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index 2e469139769f..fdd52e87a7b2 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -280,8 +280,8 @@ int cdns3_hw_role_switch(struct cdns3 *cdns)
        enum usb_role real_role, current_role;
        int ret = 0;

-       /* Depends on role switch class */
-       if (cdns->role_sw)
+       /* quit if switch role through external signals */
+       if (device_property_read_bool(cdns->dev, "usb-role-switch"))
                return 0;

        pm_runtime_get_sync(cdns->dev);

Peter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ