From patchwork Thu Aug 14 01:09:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 4721501 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 04512C0338 for ; Thu, 14 Aug 2014 01:10:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3159D201C8 for ; Thu, 14 Aug 2014 01:10:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 63CB220107 for ; Thu, 14 Aug 2014 01:10:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753554AbaHNBKT (ORCPT ); Wed, 13 Aug 2014 21:10:19 -0400 Received: from qmta09.emeryville.ca.mail.comcast.net ([76.96.30.96]:44266 "EHLO qmta09.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752726AbaHNBJa (ORCPT ); Wed, 13 Aug 2014 21:09:30 -0400 Received: from omta16.emeryville.ca.mail.comcast.net ([76.96.30.72]) by qmta09.emeryville.ca.mail.comcast.net with comcast id eR4s1o0071ZMdJ4A9R9V0V; Thu, 14 Aug 2014 01:09:29 +0000 Received: from mail.gonehiking.org ([50.134.149.16]) by omta16.emeryville.ca.mail.comcast.net with comcast id eR9U1o0080MU7Qa8cR9UWh; Thu, 14 Aug 2014 01:09:29 +0000 Received: from lorien.sisa.samsung.com (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id 43C40423FD; Wed, 13 Aug 2014 19:09:28 -0600 (MDT) From: Shuah Khan To: m.chehab@samsung.com, fabf@skynet.be Cc: Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] media: tuner xc5000 - try to avoid firmware load in resume path Date: Wed, 13 Aug 2014 19:09:24 -0600 Message-Id: <142647dac9ba7b1cb56f1f7ea2937d318fab2e4a.1407977791.git.shuah.kh@samsung.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1407978569; bh=7L2/tV00fDK6tsOkUI6XNZTJLcrYDqx6soPtT48Jqmg=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=Jb73KADjqhw3W0xczaJTuqAMyxLv83ECIa1P4PP4CV3nMyxbn9UtkmXH+ADFnHVjN xd0dDH/fQZ9UgBPLf+FlPvEdwvzyARZvO8rHZ6M54xA+PwFqmu6w40QKLpHOIKVs/D JEPgMsjJiqZ4cP0e1DnC5PHA2lVjsEHjmvQEG3nzvZb9Qj19/WS+A1joN2kajsuKdy sRdXMVAOvqTmaj79lS0g6UGEU3RC1BeJokiD49sl3DKX3d3wBxZYvxfWJijRCXlH95 3PcTWgIpnxfZb8ZV0tcDq5e1hZ4ZGalW8IR+Yb4DgU9tYrA4K2nEocSyNgMjXdAq79 ChFEBEKiO/Tmg== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 xc5000 doesn't load firmware at attach time instead loads it when it needs to set and change configuration from its init, frequency, digital and analog mode set interffaces. As a result, when system is suspended before firmware is loaded, firmware load can be avoided during resume. Loading formware in this scenario results in slowpath warnings during resume as it won't be in the suspend firmware cache. Signed-off-by: Shuah Khan --- drivers/media/tuners/xc5000.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c index 31b1dec..d853cb3 100644 --- a/drivers/media/tuners/xc5000.c +++ b/drivers/media/tuners/xc5000.c @@ -1293,6 +1293,20 @@ static int xc5000_suspend(struct dvb_frontend *fe) return 0; } +static int xc5000_resume(struct dvb_frontend *fe) +{ + struct xc5000_priv *priv = fe->tuner_priv; + + dprintk(1, "%s()\n", __func__); + + /* suspended before firmware is loaded. + Avoid firmware load in resume path. */ + if (!priv->firmware) + return 0; + + return xc5000_set_params(fe); +} + static int xc5000_init(struct dvb_frontend *fe) { struct xc5000_priv *priv = fe->tuner_priv; @@ -1360,7 +1374,7 @@ static const struct dvb_tuner_ops xc5000_tuner_ops = { .init = xc5000_init, .sleep = xc5000_sleep, .suspend = xc5000_suspend, - .resume = xc5000_set_params, + .resume = xc5000_resume, .set_config = xc5000_set_config, .set_params = xc5000_set_digital_params,