From: Apelete Seketeli Date: Thu, 19 Dec 2013 20:42:27 +0000 (+0100) Subject: usb: musb: fix setting JZ4740 gadget periphal mode on reset X-Git-Tag: v3.14-rc1~148^2~90^2~24 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23db9fd238d6ca5aa165900bf14fb42e3e2d0815;p=pandora-kernel.git usb: musb: fix setting JZ4740 gadget periphal mode on reset JZ4740 USB Device Controller is not OTG compatible and does not have DEVCTL register in silicon. During ethernet-over-usb transactions, on reset, musb driver tries to read from DEVCTL and consequently sets device as host (A-Device) instead of peripheral (B-Device), which makes it a composite device to the USB gadget driver. This induces a kernel panic during power down where the USB gadget driver does a null pointer dereference when trying to access the composite device configuration. On reset, do not rely on DEVCTL value for setting gadget peripheral mode. Use is_otg flag instead to set it to B-Device. Signed-off-by: Apelete Seketeli Signed-off-by: Felipe Balbi --- Reading git-diff-tree failed