<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/usb/dwc2, branch v3.16</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>usb: dwc2: Add function to calculate correct FIFO sizes</title>
<updated>2014-05-27T22:42:42+00:00</updated>
<author>
<name>Dinh Nguyen</name>
<email>dinguyen@altera.com</email>
</author>
<published>2014-05-07T13:31:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=112fe8e290d9b1c8651de6c7d010041f0ff44b6d'/>
<id>112fe8e290d9b1c8651de6c7d010041f0ff44b6d</id>
<content type='text'>
The dwc2 IP on the SOCFPGA cannot use the default HW configured
FIFO sizes. The total FIFO depth as read from GHWCFG3 reports 0x1f80 or 8064
32-bit words. But the GRXFSIZ, GNPTXFSIZ, and HPTXFSIZ register defaults
to 0x2000 or 8192 32-bit words. So the driver cannot just use the fifo sizes
as read from those registers.

For platforms that face the same issue, this commits sets the RX, periodic TX,
and non-periodic TX fifo size to those that are recommended v2.93a spec for
the DWC2 IP. Implements Method #2 from the Synopsys v2.93a spec for the DWC2.

Signed-off-by: Dinh Nguyen &lt;dinguyen@altera.com&gt;
Acked-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Reviewed-by: Felipe Balbi &lt;balbi@ti.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The dwc2 IP on the SOCFPGA cannot use the default HW configured
FIFO sizes. The total FIFO depth as read from GHWCFG3 reports 0x1f80 or 8064
32-bit words. But the GRXFSIZ, GNPTXFSIZ, and HPTXFSIZ register defaults
to 0x2000 or 8192 32-bit words. So the driver cannot just use the fifo sizes
as read from those registers.

For platforms that face the same issue, this commits sets the RX, periodic TX,
and non-periodic TX fifo size to those that are recommended v2.93a spec for
the DWC2 IP. Implements Method #2 from the Synopsys v2.93a spec for the DWC2.

Signed-off-by: Dinh Nguyen &lt;dinguyen@altera.com&gt;
Acked-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Reviewed-by: Felipe Balbi &lt;balbi@ti.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: Disable descriptor dma mode by default</title>
<updated>2014-05-27T22:42:41+00:00</updated>
<author>
<name>Dinh Nguyen</name>
<email>dinguyen@altera.com</email>
</author>
<published>2014-05-07T13:30:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8b3e233e8121d241a93f27a093c1440673d3a7ff'/>
<id>8b3e233e8121d241a93f27a093c1440673d3a7ff</id>
<content type='text'>
Even though the IP supports Descriptor DMA mode, it does not support SPLIT
transactions in this mode. So the driver, in its currently form, will not
support LS/FS devices when connected to a HS Hub if Descriptor DMA mode is
enabled.

So we should just default to disable descriptor dma mode.

Signed-off-by: Dinh Nguyen &lt;dinguyen@altera.com&gt;
Acked-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Even though the IP supports Descriptor DMA mode, it does not support SPLIT
transactions in this mode. So the driver, in its currently form, will not
support LS/FS devices when connected to a HS Hub if Descriptor DMA mode is
enabled.

So we should just default to disable descriptor dma mode.

Signed-off-by: Dinh Nguyen &lt;dinguyen@altera.com&gt;
Acked-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: Remove '0x' notation when using %pad format</title>
<updated>2014-05-27T22:26:29+00:00</updated>
<author>
<name>Fabio Estevam</name>
<email>fabio.estevam@freescale.com</email>
</author>
<published>2014-04-29T03:49:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0cc4cf6f3049fe174b6698016e046a233a2a6045'/>
<id>0cc4cf6f3049fe174b6698016e046a233a2a6045</id>
<content type='text'>
%pad notation automatically prints in hexadecimal format (with '0x'), so remove
the unneeded '0x' to avoid a '0x0x' string.

Signed-off-by: Fabio Estevam &lt;fabio.estevam@freescale.com&gt;
Acked-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
%pad notation automatically prints in hexadecimal format (with '0x'), so remove
the unneeded '0x' to avoid a '0x0x' string.

Signed-off-by: Fabio Estevam &lt;fabio.estevam@freescale.com&gt;
Acked-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: fix sparse warning</title>
<updated>2014-04-25T21:56:16+00:00</updated>
<author>
<name>Paul Zimmerman</name>
<email>Paul.Zimmerman@synopsys.com</email>
</author>
<published>2014-04-25T21:18:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d5dbd3f7d82223b59dc2200c0e9f4f95665a21a4'/>
<id>d5dbd3f7d82223b59dc2200c0e9f4f95665a21a4</id>
<content type='text'>
Sparse warns about the __le16 wValue from the USB SetAddress
command being used without converting it to CPU endianness. Fix
that, and also add a bit of defensive masking of the received
wValue before using it.

Reported-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sparse warns about the __le16 wValue from the USB SetAddress
command being used without converting it to CPU endianness. Fix
that, and also add a bit of defensive masking of the received
wValue before using it.

Reported-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: move s3c-hsotg data structures</title>
<updated>2014-04-24T20:12:43+00:00</updated>
<author>
<name>Dinh Nguyen</name>
<email>dinguyen@altera.com</email>
</author>
<published>2014-04-14T21:13:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f7c0b14351c483bdeb86a81d609e26263cb0dd30'/>
<id>f7c0b14351c483bdeb86a81d609e26263cb0dd30</id>
<content type='text'>
This patch moves the data structures that are in the s3c-hsotg
source into core.h. This is a necessary step towards unifying
the s3c-hsotg and dwc2 into a single DRD.

Signed-off-by: Dinh Nguyen &lt;dinguyen@altera.com&gt;
[ jh,rb,fb - For gadget part only: ]
Tested-by: Jingoo Han &lt;jg1.han@samsung.com&gt;
Tested-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Acked-by: Felipe Balbi &lt;balbi@ti.com&gt;
[ pz - Tested host part only. ]
Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch moves the data structures that are in the s3c-hsotg
source into core.h. This is a necessary step towards unifying
the s3c-hsotg and dwc2 into a single DRD.

Signed-off-by: Dinh Nguyen &lt;dinguyen@altera.com&gt;
[ jh,rb,fb - For gadget part only: ]
Tested-by: Jingoo Han &lt;jg1.han@samsung.com&gt;
Tested-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Acked-by: Felipe Balbi &lt;balbi@ti.com&gt;
[ pz - Tested host part only. ]
Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2/s3c-hsotg: move s3c-hsotg into dwc2 directory</title>
<updated>2014-04-24T20:12:43+00:00</updated>
<author>
<name>Dinh Nguyen</name>
<email>dinguyen@altera.com</email>
</author>
<published>2014-04-14T21:13:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=47a1685f139271de401212bd69d17374ca5a5270'/>
<id>47a1685f139271de401212bd69d17374ca5a5270</id>
<content type='text'>
Moves the s3c-hsotg driver into the dwc2 directory and uses the
dwc2 defines in hw.h. Renames s3c-hsotg.c to gadget.c.

NOTE: You can build both host and peripheral as a dynamically
linked module, but be aware that if you insmod dwc2_gadget, then
rmmod it, then insmod dwc2 and dwc2_platform for host mode, this
will not work. As the step to rmmod dwc2_gadget.ko will turn off
the clock to the USB IP. The dwc2 host driver currently does not
look to turn on a clock yet. A patch to fix that will be coming
soon.

Signed-off-by: Dinh Nguyen &lt;dinguyen@altera.com&gt;
[ jh,rb - For gadget part only: ]
Tested-by: Jingoo Han &lt;jg1.han@samsung.com&gt;
Tested-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
[ pz: Folded Kconfig/Makefile changes, which were originally in
  a separate patch, into this one, to avoid a build breakage.
  Modified Kconfig/Makefile changes a bit. Tested host part only. ]
Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Acked-by: Felipe Balbi &lt;balbi@ti.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Moves the s3c-hsotg driver into the dwc2 directory and uses the
dwc2 defines in hw.h. Renames s3c-hsotg.c to gadget.c.

NOTE: You can build both host and peripheral as a dynamically
linked module, but be aware that if you insmod dwc2_gadget, then
rmmod it, then insmod dwc2 and dwc2_platform for host mode, this
will not work. As the step to rmmod dwc2_gadget.ko will turn off
the clock to the USB IP. The dwc2 host driver currently does not
look to turn on a clock yet. A patch to fix that will be coming
soon.

Signed-off-by: Dinh Nguyen &lt;dinguyen@altera.com&gt;
[ jh,rb - For gadget part only: ]
Tested-by: Jingoo Han &lt;jg1.han@samsung.com&gt;
Tested-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
[ pz: Folded Kconfig/Makefile changes, which were originally in
  a separate patch, into this one, to avoid a build breakage.
  Modified Kconfig/Makefile changes a bit. Tested host part only. ]
Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Acked-by: Felipe Balbi &lt;balbi@ti.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: add defines to support s3c-hsotg driver</title>
<updated>2014-04-24T20:12:43+00:00</updated>
<author>
<name>Dinh Nguyen</name>
<email>dinguyen@altera.com</email>
</author>
<published>2014-04-14T21:13:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6ab53324496dbfd9e6110539f9aa0ab108bd664b'/>
<id>6ab53324496dbfd9e6110539f9aa0ab108bd664b</id>
<content type='text'>
In preparation of combining the dwc2/s3c-hsotg driver in a single
DRD driver, the defines in dwc2/hw.h needs to get updated so that
the s3c-hsotg driver can use them.

Signed-off-by: Dinh Nguyen &lt;dinguyen@altera.com&gt;
[ jh,rb - For gadget part only: ]
Tested-by: Jingoo Han &lt;jg1.han@samsung.com&gt;
Tested-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
[ pz - Tested host part only. ]
Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In preparation of combining the dwc2/s3c-hsotg driver in a single
DRD driver, the defines in dwc2/hw.h needs to get updated so that
the s3c-hsotg driver can use them.

Signed-off-by: Dinh Nguyen &lt;dinguyen@altera.com&gt;
[ jh,rb - For gadget part only: ]
Tested-by: Jingoo Han &lt;jg1.han@samsung.com&gt;
Tested-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
[ pz - Tested host part only. ]
Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: fix dereference before NULL check</title>
<updated>2014-02-15T20:26:14+00:00</updated>
<author>
<name>Paul Zimmerman</name>
<email>Paul.Zimmerman@synopsys.com</email>
</author>
<published>2014-02-13T01:44:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2b54fa6bbef4dbc0beabcc989625204b608d062d'/>
<id>2b54fa6bbef4dbc0beabcc989625204b608d062d</id>
<content type='text'>
In a couple of places, we were checking qtd-&gt;urb for NULL after
we had already dereferenced it. Fix this by moving the check to
before the dereference.

Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In a couple of places, we were checking qtd-&gt;urb for NULL after
we had already dereferenced it. Fix this by moving the check to
before the dereference.

Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: handle the Host Port Interrupt when it occurs in device mode</title>
<updated>2014-02-07T22:34:38+00:00</updated>
<author>
<name>Dinh Nguyen</name>
<email>dinguyen@altera.com</email>
</author>
<published>2014-02-04T23:19:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=93571adbb132c47d4d3a8e42d47276862f9635a2'/>
<id>93571adbb132c47d4d3a8e42d47276862f9635a2</id>
<content type='text'>
According to the spec for the DWC2 controller, when the PRTINT interrupt fires,
the application must clear the appropriate status bit in the Host Port Control
and Status register to clear this bit.

When disconnecting an A-cable when the dwc2 host driver, the PRTINT fires, but
only the GINTSTS_PRTINT status is cleared, no action is done with the HPRT0
register. The HPRT0_ENACHG bit in the HPRT0 must also be poked to correctly
clear the GINTSTS_PRTINT interrupt.

I am seeing this behavoir on v2.93 of the DWC2 IP. When I disconnect an OTG
A-cable adapter, the PRTINT interrupt fires when the DWC2 is in device mode
and is never cleared.

This patch adds the function to read the HPRT0 register when the PRTINT fires
and the dwc2 IP has already transitioned to device mode. This function is only
clearing the HPRT0_ENACHG bit for now, but can be modified to handle more.

Signed-off-by: Dinh Nguyen &lt;dinguyen@altera.com&gt;
[ paulz: modified patch to preserve HPRT0_ENA bit ]
Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to the spec for the DWC2 controller, when the PRTINT interrupt fires,
the application must clear the appropriate status bit in the Host Port Control
and Status register to clear this bit.

When disconnecting an A-cable when the dwc2 host driver, the PRTINT fires, but
only the GINTSTS_PRTINT status is cleared, no action is done with the HPRT0
register. The HPRT0_ENACHG bit in the HPRT0 must also be poked to correctly
clear the GINTSTS_PRTINT interrupt.

I am seeing this behavoir on v2.93 of the DWC2 IP. When I disconnect an OTG
A-cable adapter, the PRTINT interrupt fires when the DWC2 is in device mode
and is never cleared.

This patch adds the function to read the HPRT0 register when the PRTINT fires
and the dwc2 IP has already transitioned to device mode. This function is only
clearing the HPRT0_ENACHG bit for now, but can be modified to handle more.

Signed-off-by: Dinh Nguyen &lt;dinguyen@altera.com&gt;
[ paulz: modified patch to preserve HPRT0_ENA bit ]
Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: fix memory corruption in dwc2 driver</title>
<updated>2014-02-04T20:59:14+00:00</updated>
<author>
<name>Paul Zimmerman</name>
<email>Paul.Zimmerman@synopsys.com</email>
</author>
<published>2014-02-04T19:21:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=51b1b6491752ac066ee8d32cc66042fcc955fef6'/>
<id>51b1b6491752ac066ee8d32cc66042fcc955fef6</id>
<content type='text'>
The move from the staging tree to the main tree exposed a
longstanding memory corruption bug in the dwc2 driver. The
reordering of the driver initialization caused the dwc2 driver
to corrupt the initialization data of the sdhci driver on the
Raspberry Pi platform, which made the bug show up.

The error is in calling to_usb_device(hsotg-&gt;dev), since -&gt;dev
is not a member of struct usb_device. The easiest fix is to
just remove the offending code, since it is not really needed.

Thanks to Stephen Warren for tracking down the cause of this.

Reported-by: Andre Heider &lt;a.heider@gmail.com&gt;
Tested-by: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The move from the staging tree to the main tree exposed a
longstanding memory corruption bug in the dwc2 driver. The
reordering of the driver initialization caused the dwc2 driver
to corrupt the initialization data of the sdhci driver on the
Raspberry Pi platform, which made the bug show up.

The error is in calling to_usb_device(hsotg-&gt;dev), since -&gt;dev
is not a member of struct usb_device. The easiest fix is to
just remove the offending code, since it is not really needed.

Thanks to Stephen Warren for tracking down the cause of this.

Reported-by: Andre Heider &lt;a.heider@gmail.com&gt;
Tested-by: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
