linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [4.4,13/49] usb: dwc2: Fix UDC state tracking
@ 2017-12-07 13:07 Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2017-12-07 13:07 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Wei Xu, Guodong Xu, Amit Pundir,
	YongQin Liu, John Youn, Minas Harutyunyan, Douglas Anderson,
	Chen Yu, Felipe Balbi, linux-usb, Minas Harutyunyan, John Stultz,
	Sasha Levin

4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: John Stultz <john.stultz@linaro.org>


[ Upstream commit ce2b21a4e5ce042c0a42c9db8fa9e0f849427d5e ]

It has been noticed that the dwc2 udc state reporting doesn't
seem to work (at least on HiKey boards). Where after the initial
setup, the sysfs /sys/class/udc/f72c0000.usb/state file would
report "configured" no matter the state of the OTG port.

This patch adds a call so that we report to the UDC layer when
the gadget device is disconnected.

This patch does depend on the previous patch ("usb: dwc2:
Improve gadget state disconnection handling") in this patch set
in order to properly work.

Cc: Wei Xu <xuwei5@hisilicon.com>
Cc: Guodong Xu <guodong.xu@linaro.org>
Cc: Amit Pundir <amit.pundir@linaro.org>
Cc: YongQin Liu <yongqin.liu@linaro.org>
Cc: John Youn <johnyoun@synopsys.com>
Cc: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Chen Yu <chenyu56@huawei.com>
Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Acked-by: Minas Harutyunyan <hminas@synopsys.com>
Tested-by: Minas Harutyunyan <hminas@synopsys.com>
Reported-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/dwc2/gadget.c |    2 ++
 1 file changed, 2 insertions(+)



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2206,6 +2206,8 @@ void dwc2_hsotg_disconnect(struct dwc2_h
 
 	call_gadget(hsotg, disconnect);
 	hsotg->lx_state = DWC2_L3;
+
+	usb_gadget_set_state(&hsotg->gadget, USB_STATE_NOTATTACHED);
 }
 
 /**

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [4.4,13/49] usb: dwc2: Fix UDC state tracking
@ 2017-12-08  3:37 Ben Hutchings
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Hutchings @ 2017-12-08  3:37 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: stable, Wei Xu, Guodong Xu, Amit Pundir, YongQin Liu, John Youn,
	Minas Harutyunyan, Douglas Anderson, Chen Yu, Felipe Balbi,
	linux-usb, Minas Harutyunyan, John Stultz, Sasha Levin

On Thu, 2017-12-07 at 14:07 +0100, Greg Kroah-Hartman wrote:
> 4.4-stable review patch.  If anyone has any objections, please let me
> know.
> 
> ------------------
> 
> From: John Stultz <john.stultz@linaro.org>
> 
> 
> [ Upstream commit ce2b21a4e5ce042c0a42c9db8fa9e0f849427d5e ]
> 
> It has been noticed that the dwc2 udc state reporting doesn't
> seem to work (at least on HiKey boards). Where after the initial
> setup, the sysfs /sys/class/udc/f72c0000.usb/state file would
> report "configured" no matter the state of the OTG port.
> 
> This patch adds a call so that we report to the UDC layer when
> the gadget device is disconnected.
> 
> This patch does depend on the previous patch ("usb: dwc2:
> Improve gadget state disconnection handling") in this patch set
> in order to properly work.

Then you should add that (commit d2471d4a24df).

Ben.

> Cc: Wei Xu <xuwei5@hisilicon.com>
> Cc: Guodong Xu <guodong.xu@linaro.org>
> Cc: Amit Pundir <amit.pundir@linaro.org>
> Cc: YongQin Liu <yongqin.liu@linaro.org>
> Cc: John Youn <johnyoun@synopsys.com>
> Cc: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
> Cc: Douglas Anderson <dianders@chromium.org>
> Cc: Chen Yu <chenyu56@huawei.com>
> Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org
> Acked-by: Minas Harutyunyan <hminas@synopsys.com>
> Tested-by: Minas Harutyunyan <hminas@synopsys.com>
> Reported-by: Amit Pundir <amit.pundir@linaro.org>
> Signed-off-by: John Stultz <john.stultz@linaro.org>
> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/usb/dwc2/gadget.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -2206,6 +2206,8 @@ void dwc2_hsotg_disconnect(struct dwc2_h
>  
>  	call_gadget(hsotg, disconnect);
>  	hsotg->lx_state = DWC2_L3;
> +
> +	usb_gadget_set_state(&hsotg->gadget, USB_STATE_NOTATTACHED);
>  }
>  
>  /**
> 
> 
>

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [4.4,13/49] usb: dwc2: Fix UDC state tracking
@ 2017-12-09 17:12 Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2017-12-09 17:12 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: linux-kernel, stable, Wei Xu, Guodong Xu, Amit Pundir,
	YongQin Liu, John Youn, Minas Harutyunyan, Douglas Anderson,
	Chen Yu, Felipe Balbi, linux-usb, Minas Harutyunyan, John Stultz,
	Sasha Levin

On Fri, Dec 08, 2017 at 03:37:17AM +0000, Ben Hutchings wrote:
> On Thu, 2017-12-07 at 14:07 +0100, Greg Kroah-Hartman wrote:
> > 4.4-stable review patch.  If anyone has any objections, please let me
> > know.
> > 
> > ------------------
> > 
> > From: John Stultz <john.stultz@linaro.org>
> > 
> > 
> > [ Upstream commit ce2b21a4e5ce042c0a42c9db8fa9e0f849427d5e ]
> > 
> > It has been noticed that the dwc2 udc state reporting doesn't
> > seem to work (at least on HiKey boards). Where after the initial
> > setup, the sysfs /sys/class/udc/f72c0000.usb/state file would
> > report "configured" no matter the state of the OTG port.
> > 
> > This patch adds a call so that we report to the UDC layer when
> > the gadget device is disconnected.
> > 
> > This patch does depend on the previous patch ("usb: dwc2:
> > Improve gadget state disconnection handling") in this patch set
> > in order to properly work.
> 
> Then you should add that (commit d2471d4a24df).

Ah, but that patch doesn't apply :(

So, I've dropped this one, and the one after this one (which depended on
this one), so all should be back to how things were.

Sasha, can you fix this up and submit all 3 for the 4.4, 4.9 and 4.14
trees sometime in the future?

thanks,

greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [4.4,13/49] usb: dwc2: Fix UDC state tracking
@ 2017-12-12  0:27 Levin, Alexander
  0 siblings, 0 replies; 4+ messages in thread
From: Levin, Alexander @ 2017-12-12  0:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Ben Hutchings, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, Wei Xu, Guodong Xu, Amit Pundir,
	YongQin Liu, John Youn, Minas Harutyunyan, Douglas Anderson,
	Chen Yu, Felipe Balbi, linux-usb@vger.kernel.org,
	Minas Harutyunyan, John Stultz

On Sat, Dec 09, 2017 at 06:12:56PM +0100, Greg Kroah-Hartman wrote:
>On Fri, Dec 08, 2017 at 03:37:17AM +0000, Ben Hutchings wrote:
>> On Thu, 2017-12-07 at 14:07 +0100, Greg Kroah-Hartman wrote:
>> > 4.4-stable review patch.  If anyone has any objections, please let me
>> > know.
>> >
>> > ------------------
>> >
>> > From: John Stultz <john.stultz@linaro.org>
>> >
>> >
>> > [ Upstream commit ce2b21a4e5ce042c0a42c9db8fa9e0f849427d5e ]
>> >
>> > It has been noticed that the dwc2 udc state reporting doesn't
>> > seem to work (at least on HiKey boards). Where after the initial
>> > setup, the sysfs /sys/class/udc/f72c0000.usb/state file would
>> > report "configured" no matter the state of the OTG port.
>> >
>> > This patch adds a call so that we report to the UDC layer when
>> > the gadget device is disconnected.
>> >
>> > This patch does depend on the previous patch ("usb: dwc2:
>> > Improve gadget state disconnection handling") in this patch set
>> > in order to properly work.
>>
>> Then you should add that (commit d2471d4a24df).
>
>Ah, but that patch doesn't apply :(
>
>So, I've dropped this one, and the one after this one (which depended on
>this one), so all should be back to how things were.
>
>Sasha, can you fix this up and submit all 3 for the 4.4, 4.9 and 4.14
>trees sometime in the future?

Sure, I'll resend this.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-12  0:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-07 13:07 [4.4,13/49] usb: dwc2: Fix UDC state tracking Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2017-12-08  3:37 Ben Hutchings
2017-12-09 17:12 Greg Kroah-Hartman
2017-12-12  0:27 Levin, Alexander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).