From patchwork Fri Jan 29 02:20:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 8158201 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BBCD9BEEE5 for ; Fri, 29 Jan 2016 02:36:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D724020375 for ; Fri, 29 Jan 2016 02:36:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0FB5820328 for ; Fri, 29 Jan 2016 02:36:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOyve-0005kh-OB; Fri, 29 Jan 2016 02:36:54 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOyvd-0005PR-9b for linux-rockchip@bombadil.infradead.org; Fri, 29 Jan 2016 02:36:53 +0000 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]) by casper.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1aOygX-00013s-P2 for linux-rockchip@lists.infradead.org; Fri, 29 Jan 2016 02:21:19 +0000 Received: by mail-pa0-x231.google.com with SMTP id yy13so32790910pab.3 for ; Thu, 28 Jan 2016 18:20:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6GS82nI5w2N4NiqChr+7PQJWzUZS2FJ3WcAhjC7sINk=; b=NG4vmQGbq1lAtIY9AfbKG3hgDFeoN5TBr934yFWpCuinfRHHtffNDg0LUtVDuLqTMi /IuqobhROa6aa77XdWEMGWrgZJx4bm+WbUOpu717jaLXsRFxfszbLWKSBDyJue6T/qYE c9G7c8+Lgl64EmRAmkd01C4+o/77GhYDlrXjM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6GS82nI5w2N4NiqChr+7PQJWzUZS2FJ3WcAhjC7sINk=; b=JVI/GXc2ZZX9tYj0yNgzI+C8XZhUuI30NKpfwdyM7Wm13g0ExkPI3O/zIN1lsX5MSa U6Y4XyuojPsNQuuiwF0mL2QpRpkmCR5sJd/MGk1bTjpKq8geugGbAHBqDjjfFSgiyIdG Uqle+ofKuQ+603moTqbxZ3sPErnHmecIolWDJUnVD76MXfQOwH8bzmgqxFgE387dXZGO ZjFb+O6YyzY6SjIKqT8+2Out5VBTwQ76UdiHtbgaZzqkstfenozapKTqwmxTg8FOt2KQ iJsyLovunPljdIdy7PMicAaanlW/pwYeye9WhIbl4dPvpBK7cEAO28Q7VV0dFCliXhQH yMJg== X-Gm-Message-State: AG10YOQlELDn/Nd6g+HZ5Iz03RsaP7yqCYJyN2Bk5lY6iftRbYCq+0tOPoKsWZirqfjmCw== X-Received: by 10.66.122.142 with SMTP id ls14mr9607005pab.113.1454034056711; Thu, 28 Jan 2016 18:20:56 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by smtp.gmail.com with ESMTPSA id ux2sm19314864pac.46.2016.01.28.18.20.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jan 2016 18:20:56 -0800 (PST) From: Douglas Anderson To: John Youn , balbi@ti.com, kever.yang@rock-chips.com Subject: [PATCH v6 18/22] usb: dwc2: host: Schedule periodic right away if it's time Date: Thu, 28 Jan 2016 18:20:09 -0800 Message-Id: <1454034013-24657-19-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1454034013-24657-1-git-send-email-dianders@chromium.org> References: <1454034013-24657-1-git-send-email-dianders@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160129_022118_091811_C10BCDB0 X-CRM114-Status: GOOD ( 13.25 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huangtao@rock-chips.com, stefan.wahren@i2se.com, heiko@sntech.de, johnyoun@synopsys.com, gregkh@linuxfoundation.org, ming.lei@canonical.com, linux-usb@vger.kernel.org, Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, yousaf.kaukab@intel.com, stern@rowland.harvard.edu, linux-rpi-kernel@lists.infradead.org, gregory.herrero@intel.com, william.wu@rock-chips.com, Julius Werner , dinguyen@opensource.altera.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In dwc2_hcd_qh_deactivate() we will put some things on the periodic_sched_ready list. These things won't be taken off the ready list until the next SOF, which might be a little late. Let's put them on right away. Signed-off-by: Douglas Anderson Tested-by: Heiko Stuebner Tested-by: Stefan Wahren --- Changes in v6: - Add Heiko's Tested-by. - Add Stefan's Tested-by. Changes in v5: None Changes in v4: - Schedule periodic right away if it's time new for v4. Changes in v3: None Changes in v2: None drivers/usb/dwc2/hcd_queue.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c index 9b3c435339ee..3abb34a5fc5b 100644 --- a/drivers/usb/dwc2/hcd_queue.c +++ b/drivers/usb/dwc2/hcd_queue.c @@ -1080,12 +1080,26 @@ void dwc2_hcd_qh_deactivate(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, * Note: we purposely use the frame_number from the "hsotg" structure * since we know SOF interrupt will handle future frames. */ - if (dwc2_frame_num_le(qh->next_active_frame, hsotg->frame_number)) + if (dwc2_frame_num_le(qh->next_active_frame, hsotg->frame_number)) { + enum dwc2_transaction_type tr_type; + + /* + * We're bypassing the SOF handler which is normally what puts + * us on the ready list because we're in a hurry and need to + * try to catch up. + */ + dwc2_sch_vdbg(hsotg, "QH=%p IMM ready fn=%04x, nxt=%04x\n", + qh, frame_number, qh->next_active_frame); list_move_tail(&qh->qh_list_entry, &hsotg->periodic_sched_ready); - else + + tr_type = dwc2_hcd_select_transactions(hsotg); + if (tr_type != DWC2_TRANSACTION_NONE) + dwc2_hcd_queue_transactions(hsotg, tr_type); + } else { list_move_tail(&qh->qh_list_entry, &hsotg->periodic_sched_inactive); + } } /**