From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758114AbbJ2XXy (ORCPT ); Thu, 29 Oct 2015 19:23:54 -0400 Received: from gloria.sntech.de ([95.129.55.99]:39860 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757092AbbJ2XXx (ORCPT ); Thu, 29 Oct 2015 19:23:53 -0400 From: Heiko Stuebner To: Douglas Anderson Cc: John Youn , balbi@ti.com, wulf@rock-chips.com, lyz@rock-chips.com, linux-rockchip@lists.infradead.org, Julius Werner , gregory.herrero@intel.com, yousaf.kaukab@intel.com, r.baldyga@samsung.com, dinguyen@opensource.altera.com, johnyoun@synopsys.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: dwc2: host: Fix remote wakeup when not in DWC2_L2 Date: Thu, 29 Oct 2015 23:49:48 +0100 Message-ID: <3334755.enVybYgnYb@phil> User-Agent: KMail/4.14.10 (Linux/4.2.0-1-amd64; KDE/4.14.13; x86_64; ; ) In-Reply-To: <1445544303-24202-1-git-send-email-dianders@chromium.org> References: <1445544303-24202-1-git-send-email-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Donnerstag, 22. Oktober 2015, 13:05:03 schrieb Douglas Anderson: > In commit 734643dfbdde ("usb: dwc2: host: add flag to reflect bus > state") we changed dwc2_port_suspend() not to set the lx_state > anymore (instead it sets the new bus_suspended variable). This > introduced a bug where we would fail to detect device insertions if: > > 1. Plug empty hub into dwc2 > 2. Plug USB flash drive into the empty hub. > 3. Wait a few seconds > 4. Unplug USB flash drive > 5. Less than 2 seconds after step 4, plug the USB flash drive in again. > > The dwc2_hcd_rem_wakeup() function should have been changed to look at > the new bus_suspended variable. > > Let's fix it. Since commit b46146d59fda ("usb: dwc2: host: resume root > hub on remote wakeup") talks about needing the root hub resumed if the > bus was suspended, we'll include it in our test. > > It appears that the "port_l1_change" should only be set to 1 if we were > in DWC2_L1 (the driver currently never sets this), so we'll update the > former "else" case based on this test. > > Fixes: 734643dfbdde ("usb: dwc2: host: add flag to reflect bus state") > Signed-off-by: Douglas Anderson I've talked with Doug a lot about that problem today and from reading this change and the referenced causing change, it looks correct and good to me, so Reviewed-by: Heiko Stuebner