From patchwork Fri Jan 22 18:18:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 8091881 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 458A5BEEE5 for ; Fri, 22 Jan 2016 18:20:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6833D204AF for ; Fri, 22 Jan 2016 18:20:27 +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 E7F05205B1 for ; Fri, 22 Jan 2016 18:20:25 +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 1aMgJt-0005Q4-Fn; Fri, 22 Jan 2016 18:20:25 +0000 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aMgJc-0003vX-L1 for linux-rockchip@lists.infradead.org; Fri, 22 Jan 2016 18:20:13 +0000 Received: by mail-pa0-x22f.google.com with SMTP id uo6so46334406pac.1 for ; Fri, 22 Jan 2016 10:19:48 -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=7NPUhaUAnZD0J0vRZygR7iHm8pAHYCZzPugfY6NXAzg=; b=NzDbn0DZOo/yzvollIgX/jJFrUCmjVaqlEvV7z9AOyD0g27+bybYhxTjX6IOsuC4Im js3oU/c/FC4N5nQCIwUQlDUwL296K6c1o7w7UKXQI8aBZHooRRpzap8Adv6to69aJ9D5 7bFFyrqtIRGl+nFlgJJLUuyKdrP1OXjW4Dras= 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=7NPUhaUAnZD0J0vRZygR7iHm8pAHYCZzPugfY6NXAzg=; b=jmmzhgShyjaxLAvkgUX9hbci+Tf8VNI5P5kAtsbvIssVqkEPGmnz+Qz/+G2sJeSOeh rPz1M5eix3JdyPRV6dOqZpVGZCdcGE6ZzYjQD2VCuvFTxoRAr0w9zbzM5wnQoHdj3EOm gAkK2PZPiHyk4KgZg9VO/yrE33cgoerq3X6hRIXqxGAOenxiJl9GJLkcztMjGh+sSsaE BpoEqvzIar/g6onDRBP4yqBFvfwPZ43EfcvdJosWaT4mDf0I49BBNAxpCNCArmtt/Q0t G2MQWqzhAPb0O8p0nftbhDjLnL/y0mUhGFWZ8hrIQkl/S8ZQME9Y8l8nJcZw/yDmImBQ oC+A== X-Gm-Message-State: AG10YOT/F5j9ZYbse03P72fqzZD0Vca12ZX4c2SeR7KpUGwnDv6Y88PwIroonHnFFSoiGQ== X-Received: by 10.66.141.109 with SMTP id rn13mr6259669pab.83.1453486787871; Fri, 22 Jan 2016 10:19:47 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by smtp.gmail.com with ESMTPSA id y86sm11276415pfa.26.2016.01.22.10.19.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jan 2016 10:19:47 -0800 (PST) From: Douglas Anderson To: John Youn , balbi@ti.com, kever.yang@rock-chips.com Subject: [PATCH v5 17/21] usb: dwc2: host: Schedule periodic right away if it's time Date: Fri, 22 Jan 2016 10:18:52 -0800 Message-Id: <1453486736-15358-18-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1453486736-15358-1-git-send-email-dianders@chromium.org> References: <1453486736-15358-1-git-send-email-dianders@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160122_102008_953026_5513AD0F X-CRM114-Status: GOOD ( 12.10 ) 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, gregory.herrero@intel.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, 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=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 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 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); + } } /**