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]
Message-ID: <1432884966.6844.0.camel@mm-sol.com>
Date:	Fri, 29 May 2015 10:36:06 +0300
From:	"Ivan T. Ivanov" <iivanov@...sol.com>
To:	Roger Quadros <rogerq@...com>
Cc:	Chanwoo Choi <cwchoi00@...il.com>, balbi@...com,
	peter.chen@...escale.com, jun.li@...escale.com,
	linux-kernel@...r.kernel.org, r.baldyga@...sung.com, kishon@...com,
	cw00.choi@...sung.com, myungjoo.ham@...sung.com
Subject: Re: [PATCH v2 0/2] extcon: Inform the state of both ID and VBUS pin
 for USB

Hi, 

On Thu, 2015-05-28 at 17:23 +0300, Roger Quadros wrote:
> +Peter & Li,
> 
> Ivan,
> 
> On 28/05/15 11:45, Ivan T. Ivanov wrote:
> > Hi Chanwoo,
> > 
> > On Wed, 2015-05-27 at 21:15 +0900, Chanwoo Choi wrote:
> > > Previously, I discussed how to inform the changed state of both ID
> > > and VBUS pin for USB connector on patch-set[1].
> > > [1] https://lkml.org/lkml/2015/4/2/310
> > > 
> > > So, this patch adds the extcon_set_cable_line_state() function to inform
> > > the additional state of external connectors without additional register/
> > > unregister functions. This function uses the existing notifier chain
> > > which is registered by extcon_register_notifier() / extcon_register_interest().
> > > 
> > > The extcon_set_cable_line_state() can inform the new state of both
> > > ID and VBUS pin state through extcon_set_cable_line_state().
> > > 
> > > For exmaple:
> > > - On extcon-usb-gpio.c as extcon provider driver as following:
> > >          static void usb_extcon_detect_cable(struct work_struct *work)
> > >          {
> > >                  ...
> > >                  /* check ID and update cable state */
> > >                  id = gpiod_get_value_cansleep(info->id_gpiod);
> > >                  if (id) {
> > >                          extcon_set_cable_state_(info->edev, EXTCON_USB_HOST, false);
> > >                          extcon_set_cable_state_(info->edev, EXTCON_USB, true);
> > > 
> > >                          extcon_set_cable_line_state(info->edev, EXTCON_USB,
> > >                                                          EXTCON_USB_ID_HIGH);
> > 
> > I am getting more and more confused :-). Why EXTCON_USB is now used for ID notifications?
> > It should be EXTCON_USB_HOST, no? Why we need another function, framework already have
> > required information from the function one line above, do I miss something?
> 
> This is because the existing EXTCON_USB_HOST and EXTCON_USB do not capture all
> the 4 states of ID and VBUS pins that we need for a real USB driver to work.

Are they any producers or consumers of "USB-HOST" and "USB" which are using these
for anything different than ID and VBUS state tracking, except the user space?
If not, could we just rename in kernel definitions, keeping user space notification
strings and be done? 

Regadrs,
Ivan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ