From patchwork Mon Nov 17 13:14:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 5318891 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E1742C11AC for ; Mon, 17 Nov 2014 13:15:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0DF802015E for ; Mon, 17 Nov 2014 13:15:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3EF9F20136 for ; Mon, 17 Nov 2014 13:15:24 +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 1XqM9L-0000sf-De; Mon, 17 Nov 2014 13:15:23 +0000 Received: from mail-pd0-x22f.google.com ([2607:f8b0:400e:c02::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XqM9J-0008Bh-8w for linux-rockchip@lists.infradead.org; Mon, 17 Nov 2014 13:15:22 +0000 Received: by mail-pd0-f175.google.com with SMTP id y10so2395672pdj.6 for ; Mon, 17 Nov 2014 05:14:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=S2IRyTMpD8N2ejYqqMRz5pMwPvbUMwDy5GwBqMB3Og0=; b=rTz0VQbAxyrITJZwCLWr7NOZyq7LEuwampqn5nhKEOCrzh9PfKMwlDW94/rmKZPxDl J4TL7onElYeOt72MoSuLx/v2KWYDxof1KRUgE3Z4hlXf83toBO2+MnyYDAZBBZRuHqEj CK8KHaNhWaQv+FCjKOo8pdGW5HcNlo4vTUt24W+JOTvcE6ZJYdIiYAcZqnOfJxMgdr+K QiqkVA6oaZpc6cqqnbXRZDegn8n6HZcafrEacU6cay0jIl2GhpSkZeO2/FN4yAk5peas p5djgrjiEkL4xFZhse82bXRCXQufgzXJMig9FlKpePBQ/OBKono2Xy6CBQ9HPkf2nJGc 7Thg== X-Received: by 10.70.88.165 with SMTP id bh5mr29436701pdb.51.1416230098181; Mon, 17 Nov 2014 05:14:58 -0800 (PST) Received: from localhost.localdomain ([173.44.135.206]) by mx.google.com with ESMTPSA id r2sm18053590pdi.60.2014.11.17.05.14.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Nov 2014 05:14:57 -0800 (PST) From: Kever Yang To: Paul Zimmerman , Felipe Balbi Subject: [PATCH] usb: dwc2: resume root hub when device detect with suspend state Date: Mon, 17 Nov 2014 21:14:37 +0800 Message-Id: <1416230077-17535-1-git-send-email-kever.yang@rock-chips.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141117_051521_425608_D0F80590 X-CRM114-Status: UNSURE ( 8.59 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: huangtao@rock-chips.com, addy.ke@rock-chips.com, Heiko Stuebner , Greg Kroah-Hartman , linux-usb@vger.kernel.org, dianders@chromium.org, Kever Yang , linux-rockchip@lists.infradead.org, cf@rock-chips.com, wulf@rock-chips.com, Dinh Nguyen , romain.perier@gmail.com, sonnyrao@chromium.org, Roy Li , linux-kernel@vger.kernel.org X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 After we implement the bus_suspend/resume, auto suspend id enabled. The root hub will be auto suspend if there is no device connected, we need to resume the root hub when a device connect detect. This patch tested on rk3288. Signed-off-by: Roy Li Signed-off-by: Kever Yang --- drivers/usb/dwc2/hcd_intr.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c index 551ba87..c8299fd 100644 --- a/drivers/usb/dwc2/hcd_intr.c +++ b/drivers/usb/dwc2/hcd_intr.c @@ -355,6 +355,13 @@ static void dwc2_port_intr(struct dwc2_hsotg *hsotg) hprt0_modify |= HPRT0_CONNDET; /* + * Check if root hub is in suspend state + * if root hub in suspend, resume it. + */ + if ((bus->root_hub) && (hcd->state == HC_STATE_SUSPENDED)) + usb_hcd_resume_root_hub(hcd); + + /* * The Hub driver asserts a reset when it sees port connect * status change flag */