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:	Sat, 23 Jan 2016 13:57:32 +0100
From:	Pali Rohár <pali.rohar@...il.com>
To:	Tony Lindgren <tony@...mide.com>
Cc:	joerg Reisenweber <joerg@...nmoko.org>,
	Felipe Balbi <balbi@...com>,
	"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-omap@...r.kernel.org,
	Ivaylo Dimitrov <ivo.g.dimitrov.75@...il.com>,
	Sebastian Reichel <sre@...nel.org>,
	Aaro Koskinen <aaro.koskinen@....fi>,
	Pavel Machek <pavel@....cz>, Nishanth Menon <nm@...com>
Subject: Re: Nokia N900: musb is in wrong state after boot

On Thursday 21 January 2016 20:21:13 Tony Lindgren wrote:
> * joerg Reisenweber <joerg@...nmoko.org> [160121 10:45]:
> > On Thu 21 January 2016 09:41:46 Tony Lindgren wrote:
> > > Then for supporting the USB host mode.. We should add regulator
> > > support to the USB PHY driver so if the ID pin is grounded, the
> > > PHY driver enables the VBUS regulator. That too seems to need
> > > some coordination between the drivers/phy/phy-twl4030-usb.c and
> > > 1707 driver if the ID pin interrupt is only detected in
> > > drivers/phy/phy-twl4030-usb.c.
> > 
> > Note that, while this is probably a good thing to do, it needs to
> > be sufficiently loose coupling to allow user to 'intercept' this
> > VBOOS regulator enabling and instead allow device charging while
> > in externally powered hostmode. There's even a spec for this in
> > USB-docs-foo iirc, something along a certain resistor value on ID
> > to GND - alas I guess the twl4030 is not capable to detect such
> > sophisticated signaling, and anyway it's always desirable to allow
> > user to manually override the VBOOST and enable VBUS-charging
> > while in hostmode.
> 
> OK, I think this is what's happening with the Motorola LapDock BTW.
> It always feeds the VBUS, well most of the time. Do you have some
> pointer to the "certain resistor value on ID to GND" spec? Is it
> maybe part of the carkit related parts of the USB spec?
> 
> > On N900 the situation is even more complex since the 1707 doesn't
> > support genuine ID detection, neither does it support emulated ID
> > grounding. And there's no other method than a ID=GND message from
> > PHY to musb core to make the musb core state engine transfer into
> > proper hostmode. Thus my H-E-N hostmode botch abuses debug flags
> > to force the musb core into a "emulated" hostmode and this mode
> > doesn't support USB speed detection. Thus speed settings are
> > forced onto musb core and PHY by software, and the musb core speed
> > bits are only effective before session enabled.
> > Bottom line: you need VBUS to try and negotiate speed with the
> > attached device in hostmode, but to actually set this speed you
> > detected by software means, you need to disable and discharge VBUS
> > again, or musb core won't care about the speed you set. To be
> > utterly clear: unconditional enabling of VBUS in ID=GND won't
> > work.
> > 
> > This is quite complex and it's questionable if it could get handled
> > reasonably in kernel space. *Very* N900 specific niche solution,
> > I'd not think it's suited for upstreaming.
> 
> Yeah OK. I think we should be able to support the aux VBUS regulator
> part with mainline kernel though.
> 
> Regards,
> 
> Tony

Hello, attached patch for musb debugfs adds option to force both 
hostmode with speed. It is just example, I tested only compilation.

Something like that will be needed for usb host mode on Nokia N900.

-- 
Pali Rohár
pali.rohar@...il.com

View attachment "0001-musb-debugfs-Add-support-in-testmode-for-forcing-hos.patch" of type "text/x-patch" (3152 bytes)

Download attachment "signature.asc " of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ