From patchwork Tue Dec 13 09:22:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 87814 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp2102003qgi; Tue, 13 Dec 2016 01:22:48 -0800 (PST) X-Received: by 10.84.136.135 with SMTP id 7mr195665615pll.40.1481620967990; Tue, 13 Dec 2016 01:22:47 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 16si47464776pfj.200.2016.12.13.01.22.47; Tue, 13 Dec 2016 01:22:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753360AbcLMJWp (ORCPT + 4 others); Tue, 13 Dec 2016 04:22:45 -0500 Received: from mail-pf0-f171.google.com ([209.85.192.171]:33498 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753220AbcLMJWo (ORCPT ); Tue, 13 Dec 2016 04:22:44 -0500 Received: by mail-pf0-f171.google.com with SMTP id d2so17898714pfd.0 for ; Tue, 13 Dec 2016 01:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=OmAad9WJxdrWM376AOh2h3+NjIqj5E192ZNqglGMVWg=; b=aJozOTgnWvpDm4ffm86lBczFqYZX3Od+yASduNExYXYsbM7lXW79lTK5Q/f7BZvS79 IZ3/ilN8/w5uu00Uf5Qzs8DUUJq4oiwX43k8Gx0LPZdWwA8hiVEzHKSTihtF4n+TwlI5 B7bSCJULX9xguavuuCdrugI/YIC6rqoSoeEF0= 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; bh=OmAad9WJxdrWM376AOh2h3+NjIqj5E192ZNqglGMVWg=; b=iXYKXaz/hY3vB1riH8ZQjq1ffnPKRdJGTa3IsvjxSiFbn+Iuz5hNmSqtAFogVKPFRL bKJdT+s0nFfoDFg2CqpPK7VqdRAODRlG6s4WPlexokjIEO/Oo0iG7u3cDLJguViGAPsJ A54/57A1WTrYSmouX4EeItvtgBM450hZviwKE087XO2pP98a/07YbR3oKf+4VsE8Xy1F uWFwb1wK41SywsDHrN4TSuXm+4xHI5kujdD9i2QDM0v6/KnmXGCcnddr75o8Uz3X4+qd iPZsIN8R7bh6PLMjnhxdtEUYfK7DP1WQAPk7SV/qhjwCIaHGk2rSSS7iDeJ8C7AErWCA Ogyw== X-Gm-Message-State: AKaTC01QekxxRWgMUrTIaCshtGNj+Jx3hIkQHqklbi5SIe673iKt+SqErmpnVoNuQdTfw5FQ X-Received: by 10.84.138.3 with SMTP id 3mr75541247plo.108.1481620963514; Tue, 13 Dec 2016 01:22:43 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id s8sm79597953pfj.45.2016.12.13.01.22.40 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Dec 2016 01:22:42 -0800 (PST) From: Baolin Wang To: mathias.nyman@intel.com, gregkh@linuxfoundation.org Cc: baolu.lu@linux.intel.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, broonie@kernel.org, baolin.wang@linaro.org Subject: [PATCH] usb: host: xhci: Clean up commands when stop endpoint command is timeout Date: Tue, 13 Dec 2016 17:22:21 +0800 Message-Id: <8cd249e878a07a7b97f14a7f7aef280420522805.1481620625.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Since the stop endpoint command is timeout, we will halt the xHCI controller and issuing the usb_hc_died() to report abnormal shutdown of a host controller, but before that, we should clean up the command queue to free commands memory and complete the pending commands. Signed-off-by: Baolin Wang --- drivers/usb/host/xhci-ring.c | 1 + 1 file changed, 1 insertion(+) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index edc9ac2..92b48fe 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -904,6 +904,7 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg) xhci_kill_endpoint_urbs(xhci, i, j); } spin_unlock_irqrestore(&xhci->lock, flags); + xhci_cleanup_command_queue(xhci); xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, "Calling usb_hc_died()"); usb_hc_died(xhci_to_hcd(xhci));