From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752581AbbKPWl2 (ORCPT ); Mon, 16 Nov 2015 17:41:28 -0500 Received: from mail-pa0-f65.google.com ([209.85.220.65]:35756 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751172AbbKPWl0 (ORCPT ); Mon, 16 Nov 2015 17:41:26 -0500 Message-ID: <564A5B8D.4010905@gmail.com> Date: Tue, 17 Nov 2015 06:41:17 +0800 From: Caesar Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Yunzhi Li CC: John.Youn@synopsys.com, dianders@chromium.org, jwerner@google.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, wulf@rock-chips.com, kever.yang@rock-chips.com, frank.wang@rock-chips.com, huangtao@rock-chips.com Subject: Re: [PATCH] usb: dwc2: hcd: fix periodic transfer schedule sequence References: <1447687532-4820-1-git-send-email-lyz@rock-chips.com> In-Reply-To: <1447687532-4820-1-git-send-email-lyz@rock-chips.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, 在 2015年11月16日 23:25, Yunzhi Li 写道: > When checking dwc2 host channel interrupts, handle qh in > periodic_sched_queued list at first, then we could make sure CSPLIT > packets scheduled in the same order as SSPLIT packets. > > Signed-off-by: Yunzhi Li This patch can fix some usb issues on my hand machine. Says: (1) The usb hub can't normal work (KB, mouse ...) when SB headset/Speaker is connected to USB2.0 travel HUB. (2) The music have the wonder noise when we are use some usb speak. ...... So, you can free add my test tag: Tested-by: Caesar Wang > --- > drivers/usb/dwc2/hcd_intr.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c > index bda0b21..e8e8970 100644 > --- a/drivers/usb/dwc2/hcd_intr.c > +++ b/drivers/usb/dwc2/hcd_intr.c > @@ -2115,6 +2115,8 @@ static void dwc2_hc_intr(struct dwc2_hsotg *hsotg) > { > u32 haint; > int i; > + int hc_num; > + struct dwc2_qh *qh, *qh_tmp; > > haint = dwc2_readl(hsotg->regs + HAINT); > if (dbg_perio()) { > @@ -2123,6 +2125,26 @@ static void dwc2_hc_intr(struct dwc2_hsotg *hsotg) > dev_vdbg(hsotg->dev, "HAINT=%08x\n", haint); > } > > + /* > + * According to USB 2.0 spec section 11.18.8, a host must > + * issue complete-split transactions in a microframe for a > + * set of full-/low-speed endpoints in the same relative > + * order as the start-splits were issued in a microframe for. > + * So here we should at first picking up host channels > + * from periodic_sched_queued list and checking if there is > + * any start-split have already finished then schedule > + * complete-split in the same order. > + */ > + list_for_each_entry_safe(qh, qh_tmp, > + &hsotg->periodic_sched_queued, > + qh_list_entry) { > + hc_num = qh->channel->hc_num; > + if (haint & (1 << hc_num)) { > + dwc2_hc_n_intr(hsotg, hc_num); > + haint &= ~(1 << hc_num); > + } > + } > + > for (i = 0; i < hsotg->core_params->host_channels; i++) { > if (haint & (1 << i)) > dwc2_hc_n_intr(hsotg, i);