Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1270558

Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions

From Alan Stern <stern@rowland.harvard.edu>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions
Date 2015-11-16 21:40 +0100
Message-ID <qvyJb-3Ft-11@gated-at.bofh.it> (permalink)
References <qvyzw-3C8-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 16 Nov 2015, Julius Werner wrote:

> Another point to note, which I think is what prevents the flow Alan
> suggested from working, is this little snippet in DWC2's hub_control
> GetPortStatus callback:
> 
>                 if (!hsotg->flags.b.port_connect_status) {
>                         /*
>                          * The port is disconnected, which means the core is
>                          * either in device mode or it soon will be.
> Just
>                          * return 0's for the remainder of the port status
>                          * since the port register can't be read if the core
>                          * is in device mode.
>                          */
>                         *(__le32 *)buf = cpu_to_le32(port_status);
>                         break;
>                 }
> 
> This is before it actually checks the register state of the port. So
> it relies on dwc2_hcd_connect() and dwc2_hcd_disconnect() to be called
> in the right order to give the correct answer for
> USB_PORT_STAT_CONNECTION. This could maybe be improved but I don't
> know what kind of weird interactions with device mode operation made
> that snippet necessary in the first place.

Why does this test hsotg->flags.b.port_connect_status?  What it really 
needs to know is whether the core is in device mode.  It should test 
for that instead.  Then it could accurately report the true connection 
state whenever the core is in host mode, regardless of the order in 
which dwc2_hcd_connect() and dwc2_hcd_disconnect() get called.  No?

My guess would be that using the wrong test was simply a misguided 
attempt at optimization.

Alan Stern

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions Felipe Balbi <balbi@ti.com> - 2015-11-16 18:50 +0100
  Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions Doug Anderson <dianders@chromium.org> - 2015-11-16 19:20 +0100
    Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions Felipe Balbi <balbi@ti.com> - 2015-11-16 19:30 +0100
      Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions Doug Anderson <dianders@chromium.org> - 2015-11-16 19:50 +0100
        Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions Felipe Balbi <balbi@ti.com> - 2015-11-16 20:20 +0100
        Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions Alan Stern <stern@rowland.harvard.edu> - 2015-11-16 20:40 +0100
          Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions Doug Anderson <dianders@chromium.org> - 2015-11-16 20:50 +0100
            Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions Julius Werner <jwerner@chromium.org> - 2015-11-16 21:30 +0100
              Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions Alan Stern <stern@rowland.harvard.edu> - 2015-11-16 21:40 +0100
            Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions Alan Stern <stern@rowland.harvard.edu> - 2015-11-16 21:40 +0100
              Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions Doug Anderson <dianders@chromium.org> - 2015-11-17 00:20 +0100
                Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions John Youn <John.Youn@synopsys.com> - 2015-11-17 03:00 +0100
                Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions Doug Anderson <dianders@chromium.org> - 2015-11-17 03:40 +0100
                Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions Alan Stern <stern@rowland.harvard.edu> - 2015-11-17 16:50 +0100
                Re: [PATCH v2 1/2] usb: dwc2: host: Fix missing device insertions Doug Anderson <dianders@chromium.org> - 2015-11-17 17:20 +0100

csiph-web