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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 25 Apr 2012 20:29:02 +1000
From:	NeilBrown <neilb@...e.de>
To:	balbi@...com
Cc:	Samuel Ortiz <sameo@...ux.intel.com>,
	Grazvydas Ignotas <notasas@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
	linux-omap@...r.kernel.org
Subject: Re: [PATCH 6/6] twl4030-usb: Don't report EVENT_ID when there is
 VBUS.

On Wed, 25 Apr 2012 11:05:27 +0300 Felipe Balbi <balbi@...com> wrote:

> Hi,
> 
> On Wed, Apr 25, 2012 at 05:33:11PM +1000, NeilBrown wrote:
> > Some USB chargers tie the ID pin low via various resistors.
> > So they can cause VBUS to be high and ID to be low.
> > 
> > The 'A' end of an OTG cable never receives VBUS, it only ever generates it.
> 
> this isn't entirely true. Have you considered Accessory Charger
> Adapters ?

I confess that I probably did get lost amid the maze of twisty standards -
all different.

Looking at http://en.wikipedia.org/wiki/USB_On-The-Go

it seems that a USB Accessory Charger Adapter can present 3 states including:

   A charger and a B-device are attached. The OTG device is allowed to charge
   and enter host mode.

which would mean that the TWL4030 would see that A end of an OTG cable, and
VBUS asserted.

However that appears to be selected if the ID resistance is 36.5Kohms, while
others are selected for 68Kohm and 124Kohm.
But the twl4030 cannot detect that distinction.  The cut-offs are
  Ground,  102K,  200K,  440K,  Floating

so it seems this is a standard that post-dates TWL4030.  It also seems to be
specific to OTG Micro plugs, and I have an OTG Mini plug (does TWL4030
support Micro plugs? Does it care?)

> 
> > So if we see VBUS and are not generating it, this must be a charger,
> > not the A end of an OTG cable, so in that case, ignore the fact that
> > ID is low.
> 
> wrong.
> 

That may well be.  However we need some way to tell twl4030_charger.c
either USB_EVENT_VBUS or USB_EVENT_CHARGER when a charger is plugged in.
I guess we could just punt to user-space: provide all the measurements
through sysfs and allow user-space to enable the charger and select the
desired current?

Or should this just go in the too-hard basket for now?


Thanks,
NeilBrown


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ