usb: dwc3: gadget: make Set Endpoint Configuration macros safe
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 31 Jan 2017 11:24:54 +0000 (13:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Mar 2017 11:09:57 +0000 (19:09 +0800)
commit10af2485650387d928ad00ec7843d66b5b2a705f
tree49669b823f58a64293c3b40f090f0486311e41ed
parentf47b97f2cdaa42b211299bac93d0a2ba0f617b9e
usb: dwc3: gadget: make Set Endpoint Configuration macros safe

commit 7369090a9fb57c3fc705ce355d2e4523a5a24716 upstream.

Some gadget drivers are bad, bad boys. We notice
that ADB was passing bad Burst Size which caused top
bits of param0 to be overwritten which confused DWC3
when running this command.

In order to avoid future issues, we're going to make
sure values passed by macros are always safe for the
controller. Note that ADB still needs a fix to *not*
pass bad values.

Reported-by: Mohamed Abbas <mohamed.abbas@intel.com>
Sugested-by: Adam Andruszak <adam.andruszak@intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/gadget.h