From patchwork Thu Jan 21 05:04:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 8077621 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 B41F3BF0A9 for ; Thu, 21 Jan 2016 05:05:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C637F20374 for ; Thu, 21 Jan 2016 05:05:58 +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 A54CE205E4 for ; Thu, 21 Jan 2016 05:05:57 +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 1aM7RV-0000vh-8Z; Thu, 21 Jan 2016 05:05:57 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aM7RI-0000mm-Kr for linux-rockchip@bombadil.infradead.org; Thu, 21 Jan 2016 05:05:44 +0000 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]) by merlin.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1aM7RH-0004HF-6U for linux-rockchip@lists.infradead.org; Thu, 21 Jan 2016 05:05:43 +0000 Received: by mail-pa0-x22b.google.com with SMTP id cy9so16730953pac.0 for ; Wed, 20 Jan 2016 21:05:20 -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=uIpJONXj7M1V2IHgO0bcsIoj+wJdmff5Rk53DkYKmL8=; b=g71RKiCEHLfQpOk+s6fUV/uTlWMwAfzS0R+G9k4HEewQuFvGgAVf1T0ZCkabOLMlyn /KnptitLAbBFbb9JQJcICiL4ygeE8FrptJ++45wnRWc8YpgMhf52l4X+L0BWpUEMtggW OkAy0Dhr7UxANULuBCEmhDqySsddrOvaCVjOY= 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=uIpJONXj7M1V2IHgO0bcsIoj+wJdmff5Rk53DkYKmL8=; b=YUVYR5oRlhNLcmtDGPRX0JIHfGZirDgzadtAyM5w93+jCytImwzA8K6z8iIWQbEqbQ 2Auy/sdgaZ7Jq4oziG+MvW43fSVGjtsJbEqy0CPNeV6KB9xawl6s4zYO5SIDp97ISM/r 4cAT4Btu7sX5BHvf5V+lUatIdeODSv0LfusqVbFurhGu8qbmQuxOCTlOzG9T4C0zBIUk 55qnVi7cTjrYOyZvLqvFVAnUmHSNtzxvG8BoHMO4DpdoPDlYWbvaQU55iOiJ8anxkdqt c6CYkJcfxaAo5GzyMu049wVlcknuDq0hfu4AiSYLnIOl6Ho5c9okjXuaXpe0yEW1KdV9 J0WA== X-Gm-Message-State: ALoCoQkKGfkBwmyAGf5vwDF2/iJxCUFYn1zD4nicaoCqWvmjTECQlk9RwycKe3hFKCs/2DVd/QeTw0LxHRYG/kb99l12hI5gow== X-Received: by 10.66.141.142 with SMTP id ro14mr57385628pab.112.1453352719699; Wed, 20 Jan 2016 21:05:19 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by smtp.gmail.com with ESMTPSA id z28sm52255589pfi.19.2016.01.20.21.05.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Jan 2016 21:05:19 -0800 (PST) From: Douglas Anderson To: John Youn , balbi@ti.com, kever.yang@rock-chips.com Subject: [PATCH v4 17/21] usb: dwc2: host: Schedule periodic right away if it's time Date: Wed, 20 Jan 2016 21:04:28 -0800 Message-Id: <1453352672-27890-18-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1453352672-27890-1-git-send-email-dianders@chromium.org> References: <1453352672-27890-1-git-send-email-dianders@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160121_000543_410156_1C4ADDFC X-CRM114-Status: GOOD ( 12.89 ) 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: gregory.herrero@intel.com, =?UTF-8?q?Heiko=20St=C3=BCbner?= , 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, 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=ham 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 --- 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 f235402dfc5e..2b6e57ad2661 100644 --- a/drivers/usb/dwc2/hcd_queue.c +++ b/drivers/usb/dwc2/hcd_queue.c @@ -1078,12 +1078,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); + } } /**