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]
Message-ID: <SG2PR01MB2048B375B64A96654FA20DABC9A59@SG2PR01MB2048.apcprd01.prod.exchangelabs.com>
Date:   Tue, 21 Feb 2023 20:33:32 +0800
From:   Ziyang Huang <hzyitc@...look.com>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     hminas@...opsys.com, fabrice.gasnier@...s.st.com,
        amelie.delaunay@...s.st.com, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] usb: dwc2: drd: fix inconsistent mode if
 role-switch-default-mode="host"


在 2023/2/21 18:41, Greg KH 写道:
> On Tue, Feb 21, 2023 at 06:30:04PM +0800, Ziyang Huang wrote:
>> Some boards might use USB-A female connector for USB ports, however,
>> the port could be connected to a dual-mode USB controller, making it
>> also behaves as a peripheral device if male-to-male cable is connected.
>>
>> In this case, the dts looks like this:
>>
>> 	&usb0 {
>> 		status = "okay";
>> 		dr_mode = "otg";
>> 		usb-role-switch;
>> 		role-switch-default-mode = "host";
>> 	};
>>
>> After boot, dwc2_ovr_init() sets GOTGCTL to GOTGCTL_AVALOVAL and call
>> dwc2_force_mode() with parameter host=false, which causes inconsistent
>> mode - The hardware is in peripheral mode while the kernel status is
>> in host mode.
>>
>> What we can do now is to call dwc2_drd_role_sw_set() to switch to
>> device mode, and everything should work just fine now, even switching
>> back to none(default) mode afterwards.
>>
>> Fixes: e14acb876985 ("usb: dwc2: drd: add role-switch-default-node support")
>> Signed-off-by: Ziyang Huang <hzyitc@...look.com>
>> ---
>> Changes since v1
>> - Use corrent name in Signed-off-by
> Nope, still incorrect, please use your synopsys address.
>
> thanks,
>
> greg k-h


Oh, I'm not a Synopsys employee but a free developer. This is my first 
time submitting a kernel patch, please excuse me. Thank you.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ