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:   Thu, 5 Jan 2017 12:24:01 +0000
From:   Manish Narani <manish.narani@...inx.com>
To:     Felipe Balbi <balbi@...nel.org>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "catalin.marinas@....com" <catalin.marinas@....com>,
        "will.deacon@....com" <will.deacon@....com>,
        "michal.simek@...inx.com" <michal.simek@...inx.com>,
        Soren Brinkmann <sorenb@...inx.com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "mathias.nyman@...el.com" <mathias.nyman@...el.com>,
        "agraf@...e.de" <agraf@...e.de>,
        "Bharat Kumar Gogada" <bharatku@...inx.com>,
        Punnaiah Choudary Kalluri <punnaia@...inx.com>,
        "dhdang@....com" <dhdang@....com>,
        "marc.zyngier@....com" <marc.zyngier@....com>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>
CC:     Anirudha Sarangi <anirudh@...inx.com>,
        Anurag Kumar Vulisha <anuragku@...inx.com>
Subject: RE: [RFC PATCH] usb: dwc3: host: add support for OTG in DWC3 host
 driver

Hi Felipe,

> -----Original Message-----
> From: Felipe Balbi [mailto:balbi@...nel.org]
> Sent: Wednesday, January 04, 2017 7:03 PM
> 
> Hi,
> 
> Manish Narani <manish.narani@...inx.com> writes:
> > This patch adds support for OTG host mode initialization in DWC3 host
> > driver. Before the host initialization sequence begins. The driver has
> > to make sure the no OTG peripheral mode is enabled.
> >
> > Signed-off-by: Manish Narani <mnarani@...inx.com>
> > ---
> >  drivers/usb/dwc3/host.c | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >
> > diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index
> > 487f0ff..4caa3fe 100644
> > --- a/drivers/usb/dwc3/host.c
> > +++ b/drivers/usb/dwc3/host.c
> > @@ -16,6 +16,8 @@
> >   */
> >
> >  #include <linux/platform_device.h>
> > +#include <linux/usb.h>
> > +#include <linux/usb/hcd.h>
> >
> >  #include "core.h"
> >
> > @@ -111,6 +113,18 @@ int dwc3_host_init(struct dwc3 *dwc)
> >  	phy_create_lookup(dwc->usb3_generic_phy, "usb3-phy",
> >  			  dev_name(dwc->dev));
> >
> > +	if (dwc->dr_mode == USB_DR_MODE_OTG) {
> > +		struct usb_phy *phy;
> > +		/* Switch otg to host mode */
> > +		phy = usb_get_phy(USB_PHY_TYPE_USB3);
> > +		if (!IS_ERR(phy)) {
> > +			if (phy && phy->otg)
> > +				otg_set_host(phy->otg,
> > +						(struct usb_bus *)(long)1);
> > +			usb_put_phy(phy);
> > +		}
> > +	}
> 
> NAK. Don't change default mode for everybody. Default mode should actually
> be peripheral, but let's not touch whatever HW designer has set; at least for
> now.

Yes, The default mode is Peripheral. The above is to initialize the host related stuff in OTG driver before sensing the OTG ID and get to the respective mode.

- Manish

Powered by blists - more mailing lists