]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: renesas_usbhs: fix clearing the {BRDY,BEMP}STS condition
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Mon, 29 Aug 2016 09:00:38 +0000 (18:00 +0900)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Feb 2017 22:33:07 +0000 (23:33 +0100)
commit096a685031061eee35dac0d05c39d163898b35f2
tree34f216f2cefd1537ca1ef9a3baf9728f66990e7a
parent65c2174a9aa09d324db4122bbe2cb193dceaaf99
usb: renesas_usbhs: fix clearing the {BRDY,BEMP}STS condition

commit 519d8bd4b5d3d82c413eac5bb42b106bb4b9ec15 upstream.

The previous driver is possible to stop the transfer wrongly.
For example:
 1) An interrupt happens, but not BRDY interruption.
 2) Read INTSTS0. And than state->intsts0 is not set to BRDY.
 3) BRDY is set to 1 here.
 4) Read BRDYSTS.
 5) Clear the BRDYSTS. And then. the BRDY is cleared wrongly.

Remarks:
 - The INTSTS0.BRDY is read only.
  - If any bits of BRDYSTS are set to 1, the BRDY is set to 1.
  - If BRDYSTS is 0, the BRDY is set to 0.

So, this patch adds condition to avoid such situation. (And about
NRDYSTS, this is not used for now. But, avoiding any side effects,
this patch doesn't touch it.)

Fixes: d5c6a1e024dd ("usb: renesas_usbhs: fixup interrupt status clear method")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/usb/renesas_usbhs/mod.c