Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4654787ybi; Tue, 30 Jul 2019 05:58:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzawckwjAEiq7IEB8MfueAXJwk6rH8iBRVF62O+YgDr8O0DiG16+E6qvRapzqDjM38F235B X-Received: by 2002:a62:6044:: with SMTP id u65mr40942200pfb.15.1564491520097; Tue, 30 Jul 2019 05:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564491520; cv=none; d=google.com; s=arc-20160816; b=VrET4hsPBzSqKmB4nZ98zckUhQmssuNyiIQTOow7Pd+SMfXrm9vWEMpmSVWoo9hI5V oBbTSm7CaJ1tuwKLMrl6AahtFJT8mGWlAgwFqml0J2bEULdg6K/agy8TYdLzkxlfNnjo EtYkUzv6ydpq3lSxk/4k0atFMZRmB794pYC8GeOUzd0dXcuv1hCB5bxMiJSP8Xa1xdwM CeR3OxK7W9FpeFH6Tu9k0kHdg/Gnw39iJfyQ26WmsCOm2RCNXfoygqzGnAm8WyhbdJhm 835Z/q4vDmKzuMCHreG5tVBkCA/Ftv6l6Mb6usrD1TWNWJrB9LtcAhyhNaCqNBUI4nmP 1big== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=BxmkM+v1izVAhJx5/qM9Hwrs63SMmPaDI70yVndFZVY=; b=h9KtlD/R4jv4HSwy3DDtcgfEamLzw8mXjsVM4GqmgQCGjZhDsZeDFQXOuy6Nwh68ZQ jstd9Uug+vxydoXlEcWgc41m07FozPr8YTBxT1L06NERDTF2NbVuVYVJfWyxcbQcP/in 2pBaHGbOgRnQZLNvohB3mdYjEhcj9h5P/BULncFiZx3apz9bxm0VH0We8abQIFrE+ku7 5bbVKUe7bX9x1eTZbxkUOwMCnGIRrP3iLnzKScM7Qcus5QnVxXLaiggEETPOKmFtqDHv qjbFatqBNBJs1MHr0SDqBp5G72UdkqHPf9ClKl3ejGxbyGxTPNcguKvYiF/t7jNle8jW oEAQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w188si31349373pfb.175.2019.07.30.05.58.24; Tue, 30 Jul 2019 05:58:40 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729404AbfG3M5t (ORCPT + 99 others); Tue, 30 Jul 2019 08:57:49 -0400 Received: from mga04.intel.com ([192.55.52.120]:45000 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726241AbfG3M5t (ORCPT ); Tue, 30 Jul 2019 08:57:49 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jul 2019 05:57:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,326,1559545200"; d="scan'208";a="183122529" Received: from chingkai-mobl.amr.corp.intel.com (HELO [10.252.137.193]) ([10.252.137.193]) by orsmga002.jf.intel.com with ESMTP; 30 Jul 2019 05:57:47 -0700 Subject: Re: [alsa-devel] [RFC PATCH 17/40] soundwire: bus: use runtime_pm_get_sync/pm when enabled To: Andy Shevchenko Cc: alsa-devel@alsa-project.org, linux-pm@vger.kernel.org, tiwai@suse.de, gregkh@linuxfoundation.org, "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, vkoul@kernel.org, broonie@kernel.org, srinivas.kandagatla@linaro.org, jank@cadence.com, slawomir.blauciak@intel.com, Sanyog Kale References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-18-pierre-louis.bossart@linux.intel.com> <45a912c5-134b-8642-70ef-8c1060389300@linux.intel.com> <20190726190823.GD9224@smile.fi.intel.com> <5a16d9e6-0a9c-a0a8-3b11-d046247f3879@linux.intel.com> <20190730112157.GM23480@smile.fi.intel.com> From: Pierre-Louis Bossart Message-ID: Date: Tue, 30 Jul 2019 07:57:46 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190730112157.GM23480@smile.fi.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/30/19 6:21 AM, Andy Shevchenko wrote: > On Mon, Jul 29, 2019 at 05:07:39PM -0500, Pierre-Louis Bossart wrote: >> On 7/26/19 2:08 PM, Andy Shevchenko wrote: >>> On Fri, Jul 26, 2019 at 01:08:57PM -0500, Pierre-Louis Bossart wrote: > >>>> - if (ret < 0) >>>> + if (ret < 0 && ret != -EACCES) >>> >>> ...and here, the pm_runtime_put_noidle() call is missed. >> >> yes but in the example you provided, they actually do more work than just >> decrement the device usage counter: > > In their case they would like to do that. You decide what is appropriate call > in your case. > > My point is, that reference counter in case of error handling should be > returned back to its value. Agree on the reference count. I am however not clear on the next step and 'what is appropriate'. If pm_runtime_get_sync() failed, then technically the device was not resumed so marking it as last_busy+autosuspend, or using a plain vanilla put() will not result in any action. I must be missing something here.