Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2145605imu; Thu, 24 Jan 2019 07:58:31 -0800 (PST) X-Google-Smtp-Source: ALg8bN4fmocaNMd6dxzdevkJTkcd4C5ZzpGBrAeAYxokHAwO7pJjVJmj+aBNCxzKyjv7JmcO1mdu X-Received: by 2002:a63:9c1a:: with SMTP id f26mr6420179pge.381.1548345510964; Thu, 24 Jan 2019 07:58:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548345510; cv=none; d=google.com; s=arc-20160816; b=gUVufY1Cctb+t2dRPY1flwuaxSDNQCc4egNojU9fW7mPS2rAA8KqJ0EA7ndytQhOk3 U5MCedJWSnPCGrlMiyOxw3pZk3F6ZHKukaMtaOBAloi9lFME/PYp3efcfSil+wCzEhl/ snd5MzFHuCtLR38Z7R/85zap8gMjYUG/Pk9COSFZpMCI24V87EHH9gKFjC8Vzg4RlIMy aCVgDrEazYVLIh83j85hFaoMQgfY7fQb1k5zwff23AvXJkLFhDgEGZ7p1i+GtMaIyFzx VUTTbGgi2RmmXMcMu+TOInTt/8UJt4zAbrxXBdP0bg7XI9IgLNKS4t8kQo64voUYaegz Ud2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:message-id :date:subject:cc:to:from; bh=CCA1d88wlyttE+e3sWAPxmr4Xqb9QTlnFNTfOPlmE08=; b=artQHQe6g6JeAmOvWtf/ge4SFAto1o5bGEAGLb+FyBgwaTX1PTDr7hF0v/nZhaHcPc 2fo/8F1iz+TttrTvzIk1phzRyNFH7YTti41OVg7vkHG8FNQlkz2tDLkk/3fold4On7P6 /cwswMTVJzSYAZGSwX2/QO7v1+VVY6nZfDLpFTT5bbp3GWaEEaTr7bStaD/vWMHOlryq JU1CPeJ/cjn/HWZkXXTkq1hxnhj+QpDLlPF3bzbKcbEFn30fkHmDRHd6opu30FYrBZmP +BFcOmwWkug52/PVqg6JRIA7xzqWw5W/8oUw/xxfU+RLW695J/dxR/bEMVd/PgP2HFJ+ Wwlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=XDBBNqhm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g19si5312919pgj.358.2019.01.24.07.58.15; Thu, 24 Jan 2019 07:58:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=XDBBNqhm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728660AbfAXP5U (ORCPT + 99 others); Thu, 24 Jan 2019 10:57:20 -0500 Received: from hqemgate14.nvidia.com ([216.228.121.143]:1859 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728040AbfAXP5S (ORCPT ); Thu, 24 Jan 2019 10:57:18 -0500 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: , , CC: , , Sameer Pujar Subject: [PATCH] ALSA: hda: runtime PM is always active 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 Content-Type: text/plain 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== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.7.4