RE: [PATCH v3 0/6] usb: host: change TPL support behaviour

2014-09-21 Thread Peter Chen
 
> 
> On Thu, Sep 11, 2014 at 07:57:12AM +0800, Peter Chen wrote:
> > On Fri, Sep 05, 2014 at 10:08:02AM -0400, Alan Stern wrote:
> > > On Fri, 5 Sep 2014, Peter Chen wrote:
> > >
> > > > On Thu, Sep 04, 2014 at 11:12:42AM -0400, Alan Stern wrote:
> > > > > On Thu, 4 Sep 2014, Peter Chen wrote:
> > > > >
> > > > > > On Wed, Sep 03, 2014 at 09:48:15PM -0400, Alan Stern wrote:
> > > > > > > On Thu, 4 Sep 2014, Peter Chen wrote:
> > > > > > >
> > > > > > > > > > > Hi Greg & Alan, any comments for this patchset?
> > > > > > > > > >
> > > > > > > > > > In patch 2/6, why did you move the !is_targeted(udev)
> > > > > > > > > > code from
> > > > > > > > > > usb_enumerate_device_otg() to usb_enumerate_device()?
> > > > > > > > > > Why not leave the code where it is?
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > TPL support is also needed for embedded host, not only otg 
> > > > > > > > > host.
> > > > > > >
> > > > > > > But usb_enumerate_device_otg() gets called for all types of
> > > > > > > host, right?  At least, it gets called whenever
> > > > > > > usb_enumerate_device() runs.
> > > > > > >
> > > > > > > Yes, it contains "#ifdef CONFIG_USB_OTG".  But your patch has "if
> (...
> > > > > > > && IS_ENABLED(CONFIG_USB_OTG))", so the behavior is the
> > > > > > > same.  Why move the code if there's no change in behavior?
> > > > > > >
> > > > > >
> > > > > > At former code, the tpl support judgement (in function
> > > > > > is_targeted) will only be called if CONFIG_USB_OTG is defined,
> > > > > > but now, we need tpl support for all targeted hosts.
> > > > > >
> > > > > > Why we need IS_ENABLED(CONFIG_USB_OTG) as last conditions at
> > > > > > if conditions, the reason is the operation which the B-device
> > > > > > may want switch to host even if it is not at A's TPL is only for 
> > > > > > OTG host.
> > > > >
> > > > > The only side effect in is_targeted() is the dev_err() message.
> > > > > Are you saying that this dev_err() message needs to appear even
> > > > > when CONFIG_USB_OTG is disabled?
> > > > >
> > > >
> > > > Yes, both embedded host and otg host CAN support TPL, if the
> > > > embedded host SHOULD support TPL, it should show an err message if
> > > > the unsupported device is on the port.
> > > >
> > > > At OTG & EH compliance test plan,
> > > >
> (http://www.usb.org/developers/onthego/otgeh_compliance_plan_1_2.p
> > > > df) page 124, the chapter 7.3.6 A-UUT Unsupported device Message
> > > > test, it needs host prints "Unsupported Device" if the attaching
> > > > device is not supported (without at Targeted Peripheral List).
> > >
> > > Okay, then I have no objections to this patch series.
> > >
> > > Alan Stern
> >
> > Hi Greg,
> >
> > Will you queue this patchset?
> 
> Ok, will do, give me a day or so, thanks,
> 

Hi Greg, will this patchset be in your usb-next tree for v3.18?
Thanks.

Peter

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 0/6] usb: host: change TPL support behaviour

2014-09-10 Thread Greg KH
On Thu, Sep 11, 2014 at 07:57:12AM +0800, Peter Chen wrote:
> On Fri, Sep 05, 2014 at 10:08:02AM -0400, Alan Stern wrote:
> > On Fri, 5 Sep 2014, Peter Chen wrote:
> > 
> > > On Thu, Sep 04, 2014 at 11:12:42AM -0400, Alan Stern wrote:
> > > > On Thu, 4 Sep 2014, Peter Chen wrote:
> > > > 
> > > > > On Wed, Sep 03, 2014 at 09:48:15PM -0400, Alan Stern wrote:
> > > > > > On Thu, 4 Sep 2014, Peter Chen wrote:
> > > > > > 
> > > > > > > > > > Hi Greg & Alan, any comments for this patchset?
> > > > > > > > > 
> > > > > > > > > In patch 2/6, why did you move the !is_targeted(udev) code 
> > > > > > > > > from 
> > > > > > > > > usb_enumerate_device_otg() to usb_enumerate_device()?  Why 
> > > > > > > > > not leave 
> > > > > > > > > the code where it is?
> > > > > > > > > 
> > > > > > > > 
> > > > > > > > TPL support is also needed for embedded host, not only otg host.
> > > > > > 
> > > > > > But usb_enumerate_device_otg() gets called for all types of 
> > > > > > host, right?  At least, it gets called whenever 
> > > > > > usb_enumerate_device() 
> > > > > > runs.
> > > > > > 
> > > > > > Yes, it contains "#ifdef CONFIG_USB_OTG".  But your patch has "if 
> > > > > > (... 
> > > > > > && IS_ENABLED(CONFIG_USB_OTG))", so the behavior is the same.  Why 
> > > > > > move the code if there's no change in behavior?
> > > > > > 
> > > > > 
> > > > > At former code, the tpl support judgement (in function is_targeted) 
> > > > > will
> > > > > only be called if CONFIG_USB_OTG is defined, but now, we need tpl 
> > > > > support
> > > > > for all targeted hosts.
> > > > > 
> > > > > Why we need IS_ENABLED(CONFIG_USB_OTG) as last conditions at if 
> > > > > conditions,
> > > > > the reason is the operation which the B-device may want switch to 
> > > > > host even
> > > > > if it is not at A's TPL is only for OTG host.
> > > > 
> > > > The only side effect in is_targeted() is the dev_err() message.  Are 
> > > > you saying that this dev_err() message needs to appear even when 
> > > > CONFIG_USB_OTG is disabled?
> > > > 
> > > 
> > > Yes, both embedded host and otg host CAN support TPL, if the embedded host
> > > SHOULD support TPL, it should show an err message if the unsupported 
> > > device is
> > > on the port.
> > > 
> > > At OTG & EH compliance test plan,
> > > (http://www.usb.org/developers/onthego/otgeh_compliance_plan_1_2.pdf)
> > > page 124, the chapter 7.3.6 A-UUT Unsupported device Message test, it 
> > > needs host
> > > prints "Unsupported Device" if the attaching device is not supported
> > > (without at Targeted Peripheral List).
> > 
> > Okay, then I have no objections to this patch series.
> > 
> > Alan Stern
> 
> Hi Greg,
> 
> Will you queue this patchset?

Ok, will do, give me a day or so, thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 0/6] usb: host: change TPL support behaviour

2014-09-10 Thread Peter Chen
On Fri, Sep 05, 2014 at 10:08:02AM -0400, Alan Stern wrote:
> On Fri, 5 Sep 2014, Peter Chen wrote:
> 
> > On Thu, Sep 04, 2014 at 11:12:42AM -0400, Alan Stern wrote:
> > > On Thu, 4 Sep 2014, Peter Chen wrote:
> > > 
> > > > On Wed, Sep 03, 2014 at 09:48:15PM -0400, Alan Stern wrote:
> > > > > On Thu, 4 Sep 2014, Peter Chen wrote:
> > > > > 
> > > > > > > > > Hi Greg & Alan, any comments for this patchset?
> > > > > > > > 
> > > > > > > > In patch 2/6, why did you move the !is_targeted(udev) code from 
> > > > > > > > usb_enumerate_device_otg() to usb_enumerate_device()?  Why not 
> > > > > > > > leave 
> > > > > > > > the code where it is?
> > > > > > > > 
> > > > > > > 
> > > > > > > TPL support is also needed for embedded host, not only otg host.
> > > > > 
> > > > > But usb_enumerate_device_otg() gets called for all types of 
> > > > > host, right?  At least, it gets called whenever 
> > > > > usb_enumerate_device() 
> > > > > runs.
> > > > > 
> > > > > Yes, it contains "#ifdef CONFIG_USB_OTG".  But your patch has "if 
> > > > > (... 
> > > > > && IS_ENABLED(CONFIG_USB_OTG))", so the behavior is the same.  Why 
> > > > > move the code if there's no change in behavior?
> > > > > 
> > > > 
> > > > At former code, the tpl support judgement (in function is_targeted) will
> > > > only be called if CONFIG_USB_OTG is defined, but now, we need tpl 
> > > > support
> > > > for all targeted hosts.
> > > > 
> > > > Why we need IS_ENABLED(CONFIG_USB_OTG) as last conditions at if 
> > > > conditions,
> > > > the reason is the operation which the B-device may want switch to host 
> > > > even
> > > > if it is not at A's TPL is only for OTG host.
> > > 
> > > The only side effect in is_targeted() is the dev_err() message.  Are 
> > > you saying that this dev_err() message needs to appear even when 
> > > CONFIG_USB_OTG is disabled?
> > > 
> > 
> > Yes, both embedded host and otg host CAN support TPL, if the embedded host
> > SHOULD support TPL, it should show an err message if the unsupported device 
> > is
> > on the port.
> > 
> > At OTG & EH compliance test plan,
> > (http://www.usb.org/developers/onthego/otgeh_compliance_plan_1_2.pdf)
> > page 124, the chapter 7.3.6 A-UUT Unsupported device Message test, it needs 
> > host
> > prints "Unsupported Device" if the attaching device is not supported
> > (without at Targeted Peripheral List).
> 
> Okay, then I have no objections to this patch series.
> 
> Alan Stern

Hi Greg,

Will you queue this patchset?

-- 
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 0/6] usb: host: change TPL support behaviour

2014-09-05 Thread Alan Stern
On Fri, 5 Sep 2014, Peter Chen wrote:

> On Thu, Sep 04, 2014 at 11:12:42AM -0400, Alan Stern wrote:
> > On Thu, 4 Sep 2014, Peter Chen wrote:
> > 
> > > On Wed, Sep 03, 2014 at 09:48:15PM -0400, Alan Stern wrote:
> > > > On Thu, 4 Sep 2014, Peter Chen wrote:
> > > > 
> > > > > > > > Hi Greg & Alan, any comments for this patchset?
> > > > > > > 
> > > > > > > In patch 2/6, why did you move the !is_targeted(udev) code from 
> > > > > > > usb_enumerate_device_otg() to usb_enumerate_device()?  Why not 
> > > > > > > leave 
> > > > > > > the code where it is?
> > > > > > > 
> > > > > > 
> > > > > > TPL support is also needed for embedded host, not only otg host.
> > > > 
> > > > But usb_enumerate_device_otg() gets called for all types of 
> > > > host, right?  At least, it gets called whenever usb_enumerate_device() 
> > > > runs.
> > > > 
> > > > Yes, it contains "#ifdef CONFIG_USB_OTG".  But your patch has "if (... 
> > > > && IS_ENABLED(CONFIG_USB_OTG))", so the behavior is the same.  Why 
> > > > move the code if there's no change in behavior?
> > > > 
> > > 
> > > At former code, the tpl support judgement (in function is_targeted) will
> > > only be called if CONFIG_USB_OTG is defined, but now, we need tpl support
> > > for all targeted hosts.
> > > 
> > > Why we need IS_ENABLED(CONFIG_USB_OTG) as last conditions at if 
> > > conditions,
> > > the reason is the operation which the B-device may want switch to host 
> > > even
> > > if it is not at A's TPL is only for OTG host.
> > 
> > The only side effect in is_targeted() is the dev_err() message.  Are 
> > you saying that this dev_err() message needs to appear even when 
> > CONFIG_USB_OTG is disabled?
> > 
> 
> Yes, both embedded host and otg host CAN support TPL, if the embedded host
> SHOULD support TPL, it should show an err message if the unsupported device is
> on the port.
> 
> At OTG & EH compliance test plan,
> (http://www.usb.org/developers/onthego/otgeh_compliance_plan_1_2.pdf)
> page 124, the chapter 7.3.6 A-UUT Unsupported device Message test, it needs 
> host
> prints "Unsupported Device" if the attaching device is not supported
> (without at Targeted Peripheral List).

Okay, then I have no objections to this patch series.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 0/6] usb: host: change TPL support behaviour

2014-09-04 Thread Peter Chen
On Thu, Sep 04, 2014 at 11:12:42AM -0400, Alan Stern wrote:
> On Thu, 4 Sep 2014, Peter Chen wrote:
> 
> > On Wed, Sep 03, 2014 at 09:48:15PM -0400, Alan Stern wrote:
> > > On Thu, 4 Sep 2014, Peter Chen wrote:
> > > 
> > > > > > > Hi Greg & Alan, any comments for this patchset?
> > > > > > 
> > > > > > In patch 2/6, why did you move the !is_targeted(udev) code from 
> > > > > > usb_enumerate_device_otg() to usb_enumerate_device()?  Why not 
> > > > > > leave 
> > > > > > the code where it is?
> > > > > > 
> > > > > 
> > > > > TPL support is also needed for embedded host, not only otg host.
> > > 
> > > But usb_enumerate_device_otg() gets called for all types of 
> > > host, right?  At least, it gets called whenever usb_enumerate_device() 
> > > runs.
> > > 
> > > Yes, it contains "#ifdef CONFIG_USB_OTG".  But your patch has "if (... 
> > > && IS_ENABLED(CONFIG_USB_OTG))", so the behavior is the same.  Why 
> > > move the code if there's no change in behavior?
> > > 
> > 
> > At former code, the tpl support judgement (in function is_targeted) will
> > only be called if CONFIG_USB_OTG is defined, but now, we need tpl support
> > for all targeted hosts.
> > 
> > Why we need IS_ENABLED(CONFIG_USB_OTG) as last conditions at if conditions,
> > the reason is the operation which the B-device may want switch to host even
> > if it is not at A's TPL is only for OTG host.
> 
> The only side effect in is_targeted() is the dev_err() message.  Are 
> you saying that this dev_err() message needs to appear even when 
> CONFIG_USB_OTG is disabled?
> 

Yes, both embedded host and otg host CAN support TPL, if the embedded host
SHOULD support TPL, it should show an err message if the unsupported device is
on the port.

At OTG & EH compliance test plan,
(http://www.usb.org/developers/onthego/otgeh_compliance_plan_1_2.pdf)
page 124, the chapter 7.3.6 A-UUT Unsupported device Message test, it needs host
prints "Unsupported Device" if the attaching device is not supported
(without at Targeted Peripheral List).

-- 
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 0/6] usb: host: change TPL support behaviour

2014-09-04 Thread Alan Stern
On Thu, 4 Sep 2014, Peter Chen wrote:

> On Wed, Sep 03, 2014 at 09:48:15PM -0400, Alan Stern wrote:
> > On Thu, 4 Sep 2014, Peter Chen wrote:
> > 
> > > > > > Hi Greg & Alan, any comments for this patchset?
> > > > > 
> > > > > In patch 2/6, why did you move the !is_targeted(udev) code from 
> > > > > usb_enumerate_device_otg() to usb_enumerate_device()?  Why not leave 
> > > > > the code where it is?
> > > > > 
> > > > 
> > > > TPL support is also needed for embedded host, not only otg host.
> > 
> > But usb_enumerate_device_otg() gets called for all types of 
> > host, right?  At least, it gets called whenever usb_enumerate_device() 
> > runs.
> > 
> > Yes, it contains "#ifdef CONFIG_USB_OTG".  But your patch has "if (... 
> > && IS_ENABLED(CONFIG_USB_OTG))", so the behavior is the same.  Why 
> > move the code if there's no change in behavior?
> > 
> 
> At former code, the tpl support judgement (in function is_targeted) will
> only be called if CONFIG_USB_OTG is defined, but now, we need tpl support
> for all targeted hosts.
> 
> Why we need IS_ENABLED(CONFIG_USB_OTG) as last conditions at if conditions,
> the reason is the operation which the B-device may want switch to host even
> if it is not at A's TPL is only for OTG host.

The only side effect in is_targeted() is the dev_err() message.  Are 
you saying that this dev_err() message needs to appear even when 
CONFIG_USB_OTG is disabled?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 0/6] usb: host: change TPL support behaviour

2014-09-03 Thread Peter Chen
On Wed, Sep 03, 2014 at 09:48:15PM -0400, Alan Stern wrote:
> On Thu, 4 Sep 2014, Peter Chen wrote:
> 
> > > > > Hi Greg & Alan, any comments for this patchset?
> > > > 
> > > > In patch 2/6, why did you move the !is_targeted(udev) code from 
> > > > usb_enumerate_device_otg() to usb_enumerate_device()?  Why not leave 
> > > > the code where it is?
> > > > 
> > > 
> > > TPL support is also needed for embedded host, not only otg host.
> 
> But usb_enumerate_device_otg() gets called for all types of 
> host, right?  At least, it gets called whenever usb_enumerate_device() 
> runs.
> 
> Yes, it contains "#ifdef CONFIG_USB_OTG".  But your patch has "if (... 
> && IS_ENABLED(CONFIG_USB_OTG))", so the behavior is the same.  Why 
> move the code if there's no change in behavior?
> 

At former code, the tpl support judgement (in function is_targeted) will
only be called if CONFIG_USB_OTG is defined, but now, we need tpl support
for all targeted hosts.

Why we need IS_ENABLED(CONFIG_USB_OTG) as last conditions at if conditions,
the reason is the operation which the B-device may want switch to host even
if it is not at A's TPL is only for OTG host.

-- 
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 0/6] usb: host: change TPL support behaviour

2014-09-03 Thread Alan Stern
On Thu, 4 Sep 2014, Peter Chen wrote:

> > > > Hi Greg & Alan, any comments for this patchset?
> > > 
> > > In patch 2/6, why did you move the !is_targeted(udev) code from 
> > > usb_enumerate_device_otg() to usb_enumerate_device()?  Why not leave 
> > > the code where it is?
> > > 
> > 
> > TPL support is also needed for embedded host, not only otg host.

But usb_enumerate_device_otg() gets called for all types of 
host, right?  At least, it gets called whenever usb_enumerate_device() 
runs.

Yes, it contains "#ifdef CONFIG_USB_OTG".  But your patch has "if (... 
&& IS_ENABLED(CONFIG_USB_OTG))", so the behavior is the same.  Why 
move the code if there's no change in behavior?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 0/6] usb: host: change TPL support behaviour

2014-09-03 Thread Peter Chen
On Thu, Sep 04, 2014 at 07:49:23AM +0800, Peter Chen wrote:
> On Wed, Sep 03, 2014 at 02:02:04PM -0400, Alan Stern wrote:
> > On Wed, 3 Sep 2014, Peter Chen wrote:
> > 
> > > On Fri, Aug 22, 2014 at 02:31:18PM +0530, Pratyush Anand wrote:
> > > > On Tue, Aug 19, 2014 at 09:51:51AM +0800, Peter Chen wrote:
> > > > > Changes for v3:
> > > > > - Add possible role switch for unsupported HNP capable OTG 
> > > > > B-peripheral,
> > > > > see USB OTG & EH 2.0 spec page 38, this feature was deleted wrongly
> > > > > at previous revision patches.
> > > > > 
> > > > > Changes for v2:
> > > > > - Move TPL support judgement out of is_target, the user can be easy to
> > > > > know if it needs to do TPL judgement. [patch 1/6]
> > > > > - Keep the unsupport device message unchange [patch 1/6]
> > > > > 
> > > > > According to On-The-Go and Embedded Host Supplement to the USB 
> > > > > Revision
> > > > > 2.0 Specification, a Targeted Host (non-PC host, OTG or Embedded host)
> > > > > is not required to support operation with all types of USB 
> > > > > peripherals.
> > > > > It is up to the manufacturer of each Targeted Host to declare which 
> > > > > peripherals
> > > > > the host will support and provide a list of those peripherals. This 
> > > > > is called
> > > > > the Targeted Host's "Targeted Peripheral List" (TPL). The TPL shall 
> > > > > accurately
> > > > > represent the device classes supported by the Targeted Host.
> > > > > 
> > > > > And the TPL support is a must for USB OTG & EH certification test, 
> > > > > and TPL
> > > > > support needs to apply for both OTG and EH, it should be decided by 
> > > > > platform
> > > > > setting.
> > > > > 
> > > > > This patchset changes TPL support behaviour like below:
> > > > > - Apply possible TPL support for all kinds of host
> > > > > - Effect TPL in code is decided by both configuration
> > > > > (CONFIG_USB_OTG_WHITELIST) and platform flag, it can avoid
> > > > > the enumeration failure by choosing TPL configuration wrongly.
> > > > > 
> > > > > Besides, TPL can be have a good supplement for authorized feature 
> > > > > supplied
> > > > > by sys, Eg, TPL can be modified to match by class using interface 
> > > > > descriptor, etc.
> > > > > It may help give some suggestions for recently badUSB report.
> > > > > http://venturebeat.com/2014/07/31/why-you-can-no-longer-trust-any-usb-device-plugged-into-your-pc/
> > > > > https://srlabs.de/badusb/
> > 
> > > Hi Greg & Alan, any comments for this patchset?
> > 
> > In patch 2/6, why did you move the !is_targeted(udev) code from 
> > usb_enumerate_device_otg() to usb_enumerate_device()?  Why not leave 
> > the code where it is?
> > 
> 
> TPL support is also needed for embedded host, not only otg host.
> 
> -- 
> Best Regards,
> Peter Chen

-- 
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 0/6] usb: host: change TPL support behaviour

2014-09-03 Thread Alan Stern
On Wed, 3 Sep 2014, Peter Chen wrote:

> On Fri, Aug 22, 2014 at 02:31:18PM +0530, Pratyush Anand wrote:
> > On Tue, Aug 19, 2014 at 09:51:51AM +0800, Peter Chen wrote:
> > > Changes for v3:
> > > - Add possible role switch for unsupported HNP capable OTG B-peripheral,
> > > see USB OTG & EH 2.0 spec page 38, this feature was deleted wrongly
> > > at previous revision patches.
> > > 
> > > Changes for v2:
> > > - Move TPL support judgement out of is_target, the user can be easy to
> > > know if it needs to do TPL judgement. [patch 1/6]
> > > - Keep the unsupport device message unchange [patch 1/6]
> > > 
> > > According to On-The-Go and Embedded Host Supplement to the USB Revision
> > > 2.0 Specification, a Targeted Host (non-PC host, OTG or Embedded host)
> > > is not required to support operation with all types of USB peripherals.
> > > It is up to the manufacturer of each Targeted Host to declare which 
> > > peripherals
> > > the host will support and provide a list of those peripherals. This is 
> > > called
> > > the Targeted Host's "Targeted Peripheral List" (TPL). The TPL shall 
> > > accurately
> > > represent the device classes supported by the Targeted Host.
> > > 
> > > And the TPL support is a must for USB OTG & EH certification test, and TPL
> > > support needs to apply for both OTG and EH, it should be decided by 
> > > platform
> > > setting.
> > > 
> > > This patchset changes TPL support behaviour like below:
> > > - Apply possible TPL support for all kinds of host
> > > - Effect TPL in code is decided by both configuration
> > > (CONFIG_USB_OTG_WHITELIST) and platform flag, it can avoid
> > > the enumeration failure by choosing TPL configuration wrongly.
> > > 
> > > Besides, TPL can be have a good supplement for authorized feature supplied
> > > by sys, Eg, TPL can be modified to match by class using interface 
> > > descriptor, etc.
> > > It may help give some suggestions for recently badUSB report.
> > > http://venturebeat.com/2014/07/31/why-you-can-no-longer-trust-any-usb-device-plugged-into-your-pc/
> > > https://srlabs.de/badusb/

> Hi Greg & Alan, any comments for this patchset?

In patch 2/6, why did you move the !is_targeted(udev) code from 
usb_enumerate_device_otg() to usb_enumerate_device()?  Why not leave 
the code where it is?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 0/6] usb: host: change TPL support behaviour

2014-09-02 Thread Peter Chen
On Fri, Aug 22, 2014 at 02:31:18PM +0530, Pratyush Anand wrote:
> On Tue, Aug 19, 2014 at 09:51:51AM +0800, Peter Chen wrote:
> > Changes for v3:
> > - Add possible role switch for unsupported HNP capable OTG B-peripheral,
> > see USB OTG & EH 2.0 spec page 38, this feature was deleted wrongly
> > at previous revision patches.
> > 
> > Changes for v2:
> > - Move TPL support judgement out of is_target, the user can be easy to
> > know if it needs to do TPL judgement. [patch 1/6]
> > - Keep the unsupport device message unchange [patch 1/6]
> > 
> > According to On-The-Go and Embedded Host Supplement to the USB Revision
> > 2.0 Specification, a Targeted Host (non-PC host, OTG or Embedded host)
> > is not required to support operation with all types of USB peripherals.
> > It is up to the manufacturer of each Targeted Host to declare which 
> > peripherals
> > the host will support and provide a list of those peripherals. This is 
> > called
> > the Targeted Host's "Targeted Peripheral List" (TPL). The TPL shall 
> > accurately
> > represent the device classes supported by the Targeted Host.
> > 
> > And the TPL support is a must for USB OTG & EH certification test, and TPL
> > support needs to apply for both OTG and EH, it should be decided by platform
> > setting.
> > 
> > This patchset changes TPL support behaviour like below:
> > - Apply possible TPL support for all kinds of host
> > - Effect TPL in code is decided by both configuration
> > (CONFIG_USB_OTG_WHITELIST) and platform flag, it can avoid
> > the enumeration failure by choosing TPL configuration wrongly.
> > 
> > Besides, TPL can be have a good supplement for authorized feature supplied
> > by sys, Eg, TPL can be modified to match by class using interface 
> > descriptor, etc.
> > It may help give some suggestions for recently badUSB report.
> > http://venturebeat.com/2014/07/31/why-you-can-no-longer-trust-any-usb-device-plugged-into-your-pc/
> > https://srlabs.de/badusb/
> > 
> > Peter Chen (6):
> >   usb: hcd: add TPL support flag
> >   usb: core: TPL should apply for both OTG and EH
> >   usb: core: Kconfig: TPL should apply for both OTG and EH
> >   usb: common: add API to get if the platform supports TPL
> >   usb: chipidea: add TPL support for targeted hosts
> >   doc: dt-binding: ci-hdrc-imx: add TPL support
> > 
> >  .../devicetree/bindings/usb/ci-hdrc-imx.txt|2 ++
> >  drivers/usb/chipidea/core.c|4 +++
> >  drivers/usb/chipidea/host.c|1 +
> >  drivers/usb/common/usb-common.c|   15 +
> >  drivers/usb/core/Kconfig   |   12 ++-
> >  drivers/usb/core/hub.c |   33 
> > +---
> >  drivers/usb/core/otg_whitelist.h   |   13 ++--
> >  include/linux/usb/chipidea.h   |1 +
> >  include/linux/usb/hcd.h|1 +
> >  include/linux/usb/of.h |5 +++
> >  10 files changed, 50 insertions(+), 37 deletions(-)
> 
> Reviewed-by: Pratyush Anand 
> 

Hi Greg & Alan, any comments for this patchset?

-- 
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 0/6] usb: host: change TPL support behaviour

2014-08-22 Thread Pratyush Anand
On Tue, Aug 19, 2014 at 09:51:51AM +0800, Peter Chen wrote:
> Changes for v3:
> - Add possible role switch for unsupported HNP capable OTG B-peripheral,
> see USB OTG & EH 2.0 spec page 38, this feature was deleted wrongly
> at previous revision patches.
> 
> Changes for v2:
> - Move TPL support judgement out of is_target, the user can be easy to
> know if it needs to do TPL judgement. [patch 1/6]
> - Keep the unsupport device message unchange [patch 1/6]
> 
> According to On-The-Go and Embedded Host Supplement to the USB Revision
> 2.0 Specification, a Targeted Host (non-PC host, OTG or Embedded host)
> is not required to support operation with all types of USB peripherals.
> It is up to the manufacturer of each Targeted Host to declare which 
> peripherals
> the host will support and provide a list of those peripherals. This is called
> the Targeted Host's "Targeted Peripheral List" (TPL). The TPL shall accurately
> represent the device classes supported by the Targeted Host.
> 
> And the TPL support is a must for USB OTG & EH certification test, and TPL
> support needs to apply for both OTG and EH, it should be decided by platform
> setting.
> 
> This patchset changes TPL support behaviour like below:
> - Apply possible TPL support for all kinds of host
> - Effect TPL in code is decided by both configuration
> (CONFIG_USB_OTG_WHITELIST) and platform flag, it can avoid
> the enumeration failure by choosing TPL configuration wrongly.
> 
> Besides, TPL can be have a good supplement for authorized feature supplied
> by sys, Eg, TPL can be modified to match by class using interface descriptor, 
> etc.
> It may help give some suggestions for recently badUSB report.
> http://venturebeat.com/2014/07/31/why-you-can-no-longer-trust-any-usb-device-plugged-into-your-pc/
> https://srlabs.de/badusb/
> 
> Peter Chen (6):
>   usb: hcd: add TPL support flag
>   usb: core: TPL should apply for both OTG and EH
>   usb: core: Kconfig: TPL should apply for both OTG and EH
>   usb: common: add API to get if the platform supports TPL
>   usb: chipidea: add TPL support for targeted hosts
>   doc: dt-binding: ci-hdrc-imx: add TPL support
> 
>  .../devicetree/bindings/usb/ci-hdrc-imx.txt|2 ++
>  drivers/usb/chipidea/core.c|4 +++
>  drivers/usb/chipidea/host.c|1 +
>  drivers/usb/common/usb-common.c|   15 +
>  drivers/usb/core/Kconfig   |   12 ++-
>  drivers/usb/core/hub.c |   33 
> +---
>  drivers/usb/core/otg_whitelist.h   |   13 ++--
>  include/linux/usb/chipidea.h   |1 +
>  include/linux/usb/hcd.h|1 +
>  include/linux/usb/of.h |5 +++
>  10 files changed, 50 insertions(+), 37 deletions(-)

Reviewed-by: Pratyush Anand 

> 
> -- 
> 1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 0/6] usb: host: change TPL support behaviour

2014-08-18 Thread Peter Chen
Changes for v3:
- Add possible role switch for unsupported HNP capable OTG B-peripheral,
see USB OTG & EH 2.0 spec page 38, this feature was deleted wrongly
at previous revision patches.

Changes for v2:
- Move TPL support judgement out of is_target, the user can be easy to
know if it needs to do TPL judgement. [patch 1/6]
- Keep the unsupport device message unchange [patch 1/6]

According to On-The-Go and Embedded Host Supplement to the USB Revision
2.0 Specification, a Targeted Host (non-PC host, OTG or Embedded host)
is not required to support operation with all types of USB peripherals.
It is up to the manufacturer of each Targeted Host to declare which peripherals
the host will support and provide a list of those peripherals. This is called
the Targeted Host's "Targeted Peripheral List" (TPL). The TPL shall accurately
represent the device classes supported by the Targeted Host.

And the TPL support is a must for USB OTG & EH certification test, and TPL
support needs to apply for both OTG and EH, it should be decided by platform
setting.

This patchset changes TPL support behaviour like below:
- Apply possible TPL support for all kinds of host
- Effect TPL in code is decided by both configuration
(CONFIG_USB_OTG_WHITELIST) and platform flag, it can avoid
the enumeration failure by choosing TPL configuration wrongly.

Besides, TPL can be have a good supplement for authorized feature supplied
by sys, Eg, TPL can be modified to match by class using interface descriptor, 
etc.
It may help give some suggestions for recently badUSB report.
http://venturebeat.com/2014/07/31/why-you-can-no-longer-trust-any-usb-device-plugged-into-your-pc/
https://srlabs.de/badusb/

Peter Chen (6):
  usb: hcd: add TPL support flag
  usb: core: TPL should apply for both OTG and EH
  usb: core: Kconfig: TPL should apply for both OTG and EH
  usb: common: add API to get if the platform supports TPL
  usb: chipidea: add TPL support for targeted hosts
  doc: dt-binding: ci-hdrc-imx: add TPL support

 .../devicetree/bindings/usb/ci-hdrc-imx.txt|2 ++
 drivers/usb/chipidea/core.c|4 +++
 drivers/usb/chipidea/host.c|1 +
 drivers/usb/common/usb-common.c|   15 +
 drivers/usb/core/Kconfig   |   12 ++-
 drivers/usb/core/hub.c |   33 +---
 drivers/usb/core/otg_whitelist.h   |   13 ++--
 include/linux/usb/chipidea.h   |1 +
 include/linux/usb/hcd.h|1 +
 include/linux/usb/of.h |5 +++
 10 files changed, 50 insertions(+), 37 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html