All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] phy: rcar-gen3-usb2: fix unexpected repeat interrupts of VBUS" failed to apply to 4.6-stable tree
@ 2016-07-11 22:21 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-07-11 22:21 UTC (permalink / raw)
  To: yoshihiro.shimoda.uh, horms, kishon, stable; +Cc: stable


The patch below does not apply to the 4.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

>From 6762925df4642aec5629f7971ba477d6930f53f7 Mon Sep 17 00:00:00 2001
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Tue, 31 May 2016 21:47:17 +0900
Subject: [PATCH] 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: 1114e2d (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>

diff --git a/drivers/phy/phy-rcar-gen3-usb2.c b/drivers/phy/phy-rcar-gen3-usb2.c
index 76bb88f0700a..4be3f5dbbc9f 100644
--- a/drivers/phy/phy-rcar-gen3-usb2.c
+++ b/drivers/phy/phy-rcar-gen3-usb2.c
@@ -144,12 +144,6 @@ static void rcar_gen3_init_for_peri(struct rcar_gen3_chan *ch)
 	extcon_set_cable_state_(ch->extcon, EXTCON_USB, true);
 }
 
-static bool rcar_gen3_check_vbus(struct rcar_gen3_chan *ch)
-{
-	return !!(readl(ch->base + USB2_ADPCTRL) &
-		  USB2_ADPCTRL_OTGSESSVLD);
-}
-
 static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch)
 {
 	return !!(readl(ch->base + USB2_ADPCTRL) & USB2_ADPCTRL_IDDIG);
@@ -157,13 +151,7 @@ static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch)
 
 static void rcar_gen3_device_recognition(struct rcar_gen3_chan *ch)
 {
-	bool is_host = true;
-
-	/* B-device? */
-	if (rcar_gen3_check_id(ch) && rcar_gen3_check_vbus(ch))
-		is_host = false;
-
-	if (is_host)
+	if (!rcar_gen3_check_id(ch))
 		rcar_gen3_init_for_host(ch);
 	else
 		rcar_gen3_init_for_peri(ch);


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-11 23:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-11 22:21 FAILED: patch "[PATCH] phy: rcar-gen3-usb2: fix unexpected repeat interrupts of VBUS" failed to apply to 4.6-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.