From patchwork Thu Jan 24 15:57:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 10779443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1120213B5 for ; Thu, 24 Jan 2019 15:57:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F08E531520 for ; Thu, 24 Jan 2019 15:57:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E21623160D; Thu, 24 Jan 2019 15:57:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 146D731520 for ; Thu, 24 Jan 2019 15:57:27 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 33AF9267590; Thu, 24 Jan 2019 16:57:25 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id C7EC92675A6; Thu, 24 Jan 2019 16:57:22 +0100 (CET) Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com [216.228.121.143]) by alsa0.perex.cz (Postfix) with ESMTP id E760A2674A9 for ; Thu, 24 Jan 2019 16:57:19 +0100 (CET) Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 24 Jan 2019 07:57:00 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Thu, 24 Jan 2019 07:57:18 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Thu, 24 Jan 2019 07:57:18 -0800 Received: from HQMAIL106.nvidia.com (172.18.146.12) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 24 Jan 2019 15:57:17 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Thu, 24 Jan 2019 15:57:17 +0000 Received: from linux.nvidia.com (Not Verified[10.24.34.185]) by hqnvemgw01.nvidia.com with Trustwave SEG (v7, 5, 8, 10121) id ; Thu, 24 Jan 2019 07:57:16 -0800 From: Sameer Pujar To: , , Date: Thu, 24 Jan 2019 21:27:11 +0530 Message-ID: <1548345432-11449-1-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1548345420; bh=CCA1d88wlyttE+e3sWAPxmr4Xqb9QTlnFNTfOPlmE08=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Type; b=XDBBNqhmiL+ivMMiF029x2o9PHH0S+hPapcQK2xo/0CEhPPLUG+dsJ4j43WOO10kT 6DVV/BWV6WYpxINDz43/LyvuRQmhH61zLRahToWNBjLiFu8o0CE/2a6SSSOL4IHpmM Yc5UwYgPtEx/h9pp70/WPrZYSPzzTXqJRLFIQ0ad7yMlv10ACr0/75tjV2C5mezWCP wjw24xZHUw2qSBLS1lsG6RuoWQjjKdPNgdW7vGD9Ze3s/AuHDx6+qCBxlRot1qGQVf DidHOg8GKVHtbAv26vue9CX5K5YS5TuEFqrRH6tIcwsL/cJvpBFNva8NgTcnILfuux /E5bv62HAooUw== Cc: Sameer Pujar , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ALSA: hda: runtime PM is always active X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The runtime PM count is incremented and set to active during hda codec device init, but it is decremented and set to suspend during exit only. Hence the runtime PM status is always active and hda device cannot be put to runtime suspend. Keeping device usage active for entire period, though nothing really happening on the device, seems unnecessary. This patch avoides incrementing runtime PM usage count of the device. Signed-off-by: Sameer Pujar Reviewed-by: Ravindra Lokhande Reviewed-by: Mohan Kumar D --- sound/hda/hdac_device.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c index 95b073e..72aa342 100644 --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c @@ -31,9 +31,6 @@ static void default_release(struct device *dev) * * Returns zero for success or a negative error code. * - * This function increments the runtime PM counter and marks it active. - * The caller needs to turn it off appropriately later. - * * The caller needs to set the device's release op properly by itself. */ int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus, @@ -55,8 +52,6 @@ int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus, codec->bus = bus; codec->addr = addr; codec->type = HDA_DEV_CORE; - pm_runtime_set_active(&codec->dev); - pm_runtime_get_noresume(&codec->dev); atomic_set(&codec->in_pm, 0); err = snd_hdac_bus_add_device(bus, codec); @@ -123,7 +118,6 @@ EXPORT_SYMBOL_GPL(snd_hdac_device_init); */ void snd_hdac_device_exit(struct hdac_device *codec) { - pm_runtime_put_noidle(&codec->dev); snd_hdac_bus_remove_device(codec->bus, codec); kfree(codec->vendor_name); kfree(codec->chip_name);