From patchwork Fri Apr 17 15:24:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 6234661 Return-Path: X-Original-To: patchwork-linux-media@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 484DFBF4A6 for ; Fri, 17 Apr 2015 15:26:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8951120394 for ; Fri, 17 Apr 2015 15:26:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9CC6320395 for ; Fri, 17 Apr 2015 15:26:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933459AbbDQP0G (ORCPT ); Fri, 17 Apr 2015 11:26:06 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:36170 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932660AbbDQPZv (ORCPT ); Fri, 17 Apr 2015 11:25:51 -0400 Received: by wizk4 with SMTP id k4so25990700wiz.1; Fri, 17 Apr 2015 08:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=BWY7jICZkodwdt1jLCOA4FXxlr3+zPvpGJgzoN+g454=; b=IWgiyj0CTtSlEhrJk31Ett88L5O4OjMEk59l4xQwzWFjeIZdDdqHAHKL3RGWOdeiMF C4qyMHpm4IVBnXyHccBfXcsYoW8xutTE3oSP6H7+DnJROBcQL6byoJA2ExFs54Bdcvjl e1E6qHcMed204hCRBahQRBC0pqvij/yN/KlxzPGPfZRbWyRNZ5/4uOBc3eansCvbgdx6 ImOOGetTkvz8TaghAlyPojs/0em09IyC5/OvUwYUQI8fnpoy7NlnTFel9twtCZYvKf0u Lipn9V0AFZROYMD62yp9QVIFq8lp3QObloZxA5KovE4seCnLHJ3bK41v+0IrHAyXXrK1 yKgg== X-Received: by 10.194.81.1 with SMTP id v1mr6916004wjx.50.1429284350164; Fri, 17 Apr 2015 08:25:50 -0700 (PDT) Received: from cizrna.lan ([109.72.12.111]) by mx.google.com with ESMTPSA id eh5sm3074810wic.20.2015.04.17.08.25.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Apr 2015 08:25:49 -0700 (PDT) From: Tomeu Vizoso To: linux-pm@vger.kernel.org Cc: Laurent Pinchart , Dmitry Torokhov , Alan Stern , Tomeu Vizoso , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/2] [media] uvcvideo: Remain runtime-suspended at sleeps Date: Fri, 17 Apr 2015 17:24:50 +0200 Message-Id: <1429284290-25153-3-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1429284290-25153-1-git-send-email-tomeu.vizoso@collabora.com> References: <1429284290-25153-1-git-send-email-tomeu.vizoso@collabora.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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 When the system goes to sleep and afterwards resumes, a significant amount of time is spent suspending and resuming devices that were already runtime-suspended. By setting the power.force_direct_complete flag, the PM core will ignore the state of descendant devices and the device will be let in runtime-suspend. Signed-off-by: Tomeu Vizoso --- drivers/media/usb/uvc/uvc_driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 5970dd6..ae75a70 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -1945,6 +1945,8 @@ static int uvc_probe(struct usb_interface *intf, "supported.\n", ret); } + intf->dev.parent->power.force_direct_complete = true; + uvc_trace(UVC_TRACE_PROBE, "UVC device initialized.\n"); usb_enable_autosuspend(udev); return 0;