]> git.baikalelectronics.ru Git - kernel.git/commit
phy: rcar-gen3-usb2: fix unexpected repeat interrupts of VBUS change
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tue, 31 May 2016 12:47:17 +0000 (21:47 +0900)
committerKishon Vijay Abraham I <kishon@ti.com>
Fri, 17 Jun 2016 12:55:48 +0000 (18:25 +0530)
commit1e2b4c67232297d6061871c685df9572148ae458
tree6fa5ac63e1fe8515a03fa1731792d8ec03de555c
parente2254029e5028c25555bea34d4cf6e172ee104e9
phy: rcar-gen3-usb2: fix unexpected repeat interrupts of VBUS change

This patch fixes an issue that the driver is possible to cause
unexpected repeat interrupts if a board condition is wrong
(e.g. even if the ID pin is as function, a board supplies the VBUS.)

The reason why unexpected repeat interrupts happen is:
 1) The driver changed the mode to function if it detected the ID pin
    is high and the VBUS is high.
 2) After the driver changed function mode, it disabled the "VBUS control"
    feature. Then, the VBUS signal will be low.
 3) Since the VBUS change interruption happened, the driver checked
    the ID pin and VBUS.
 4) Since VBUS was low, the driver changed the mode to host and enabled
    the "VBUS control" feature. Then the VBUS signal will be high.
 5) Since the VBUS change interruption happened, the driver did 1) above.

So, this patch modified the condition in rcar_gen3_device_recognition()
to check the ID pin only.

Fixes: 43b50fc (phy: rcar-gen3-usb2: change the mode to OTG on the combined channel)
Cc: <stable@vger.kernel.org> # v4.5+
Reported-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/phy-rcar-gen3-usb2.c