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]
Message-id: <33607368.413ZH3sNbT@amdc1032>
Date:	Mon, 22 Sep 2014 18:10:04 +0200
From:	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
To:	Paul Zimmerman <Paul.Zimmerman@...opsys.com>
Cc:	Dinh Nguyen <dinguyen@...nsource.altera.com>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"balbi@...com" <balbi@...com>,
	"dinh.linux@...il.com" <dinh.linux@...il.com>,
	"swarren@...dotorg.org" <swarren@...dotorg.org>,
	"matthijs@...in.nl" <matthijs@...in.nl>,
	"r.baldyga@...sung.com" <r.baldyga@...sung.com>,
	"jg1.han@...sung.com" <jg1.han@...sung.com>,
	"sachin.kamat@...aro.org" <sachin.kamat@...aro.org>,
	"ben-linux@...ff.org" <ben-linux@...ff.org>,
	"dianders@...omium.org" <dianders@...omium.org>,
	"kever.yang@...k-chips.com" <kever.yang@...k-chips.com>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCHv4 01/12] usb: dwc2: Update Kconfig to support dual-role


Hi,

On Friday, September 19, 2014 07:02:49 PM Paul Zimmerman wrote:
> > From: Bartlomiej Zolnierkiewicz [mailto:b.zolnierkie@...sung.com]
> > Sent: Friday, September 19, 2014 7:50 AM
> > 
> > Unfortunately after second look there are even more problems with Kconfig
> > changes, please see below.
> > 
> > > >
> > > >>  if USB_DWC2
> > > >>
> > > >> +choice
> > > >> +	bool "DWC2 Mode Selection"
> > > >> +	default USB_DWC2_DUAL_ROLE if (USB && USB_GADGET)
> > > >> +	default USB_DWC2_HOST if (USB && !USB_GADGET)
> > > >> +	default USB_DWC2_PERIPHERAL if (!USB && USB_GADGET)
> > 
> > Previously it was possible to have following functionalities in
> > one kernel (for multiplatform kernels):
> > 
> > - host PCI support
> > - host platform support
> > - gadget platform support
> > 
> > Now mode selection will determine the used mode for combined
> > host+gadget platform driver.  It is no longer possible to have
> > host platform and gadget platform support in one kernel.
> 
> Why not? Why wouldn't it work if you enable USB_DWC2_DUAL_ROLE? The
> dwc3 driver uses the same scheme as this, and I have not heard any
> complaints about that not working.

Ok, it seems that this should work fine if:

- USB_DWC2_DUAL_ROLE is set

- dwc2 handles dr_mode properly

[ BTW dwc3 has the following code in its ->probe which dwc2 lacks
  (the code sets the default dr_mode value):

	if (IS_ENABLED(CONFIG_USB_DWC3_HOST))
		dwc->dr_mode = USB_DR_MODE_HOST;
	else if (IS_ENABLED(CONFIG_USB_DWC3_GADGET))
		dwc->dr_mode = USB_DR_MODE_PERIPHERAL;

	if (dwc->dr_mode == USB_DR_MODE_UNKNOWN)
		dwc->dr_mode = USB_DR_MODE_OTG;

  It seems that correspoding changes are needed for dwc2. ]

- proper dr_mode is set in the DT dwc2 entry if the board needs it

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

--
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