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] [day] [month] [year] [list]
Date:   Fri, 14 Apr 2017 17:38:55 +0800
From:   Peter Chen <hzpeterchen@...il.com>
To:     Niranjan Dighe <niranjan.dighe@...il.com>
Cc:     Peter.Chen@...escale.com,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] chipidea: Fix issue in reconnecing gadget without
 insmod/rmmod

On Wed, Apr 12, 2017 at 06:18:20PM +0530, Niranjan Dighe wrote:
> > Hi Niranjan,
> >
> > When working with iAP device, there are two role-switch methods
> > - Through OTG FSM, and using sysfs entries under
> > /sys/bus/platform/devices/ci_hdrc.0/inputs
> > but you may need to patch code to keep vbus always on for A-device,
> > it is not compliance with OTG spec.
> > - Using role interface under debugfs (I move it under sysfs for v4.12).
> > But you need to patch the code and let the A-device switch back to
> > host after iAP is disconnected.
> >
> > You don't need to use above two methods together, I suggest using the
> > 2nd method since OTG FSM is hard to maintain due to no mandatory use
> > case for it.
> >
> > --
> >
> > Best Regards,
> > Peter Chen
> 
> Thank you Peter for your response.
> 
> Yes, I will try to switch the role on disconnection of iAP device to Host. If
> I understand correctly I have to do something like this -
> 
>         ci_role_stop(ci); //Gadget role stop
>         ret = ci_role_start(ci, role); //Host role start
> 
Applying below patch [1] first.

- When your app detects the board needs to switch role to gadget, do
echo gadget > /sys/bus/platform/devices/ci_hdrc.0/role
- When your app detects the iAP devices is disconnected from the board, do
echo host > /sys/bus/platform/devices/ci_hdrc.0/role

[1] https://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb.git/commit/?h=ci-for-usb-next
-- 

Best Regards,
Peter Chen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ