Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59EE0C678D5 for ; Tue, 7 Mar 2023 16:09:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230521AbjCGQJJ (ORCPT ); Tue, 7 Mar 2023 11:09:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229803AbjCGQIl (ORCPT ); Tue, 7 Mar 2023 11:08:41 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94D6E8F706 for ; Tue, 7 Mar 2023 08:07:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678205247; x=1709741247; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=QbkMlLN5gG1O1qHIBvT5vPDkGfTtH0GRhPyAlrPglYA=; b=UJAJavTUwEFqMQHoKDRF3jJCa3161baJA+YFDGcgU7wCwCRlYPY6b9Tg gryHC/+ujT7EzNdoMgV0sz5dKBxc9dDmJ7M8AHW2vxi9mF2CH0Xf61jtu MorAPa3oiEEu67yejscNi8cQ0SvYcdjan4AV59w+/fsgGfvfQ9c8fVT9m Hj8Pqo9YQJ365IipzSFpDnF6GGzv1QU/xRMzXrroGPqIYwKzZPvdGIvGP iy3ZU9VfnmOqT89z5dKBQhmB9naPtMP7HRoq8C4ztthxFJPvPpsW05fvx CG13VPydPv2+rtlGIl5T5ru46iNZHgwroPje9hQtw+Wr5Nj9Vxn48Twvl g==; X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="334603074" X-IronPort-AV: E=Sophos;i="5.98,241,1673942400"; d="scan'208";a="334603074" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2023 08:06:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="786744585" X-IronPort-AV: E=Sophos;i="5.98,241,1673942400"; d="scan'208";a="786744585" Received: from mcdoll-mobl.amr.corp.intel.com (HELO [10.255.36.231]) ([10.255.36.231]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2023 08:06:19 -0800 Message-ID: <4330af6a-ce97-53ed-f675-6d3d0ac8f32f@linux.intel.com> Date: Tue, 7 Mar 2023 09:28:21 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.7.1 Subject: Re: [PATCH V6 8/8] soundwire: amd: add pm_prepare callback and pm ops support Content-Language: en-US To: Vijendar Mukunda , vkoul@kernel.org Cc: alsa-devel@alsa-project.org, Basavaraj.Hiregoudar@amd.com, Sunil-kumar.Dommati@amd.com, Mario.Limonciello@amd.com, amadeuszx.slawinski@linux.intel.com, Mastan.Katragadda@amd.com, Arungopal.kondaveeti@amd.com, claudiu.beznea@microchip.com, Bard Liao , Sanyog Kale , open list References: <20230307133135.545952-1-Vijendar.Mukunda@amd.com> <20230307133135.545952-9-Vijendar.Mukunda@amd.com> From: Pierre-Louis Bossart In-Reply-To: <20230307133135.545952-9-Vijendar.Mukunda@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static int amd_resume_child_device(struct device *dev, void *data) > +{ > + struct sdw_slave *slave = dev_to_sdw_dev(dev); > + int ret; > + > + if (!slave->probed) { > + dev_dbg(dev, "skipping device, no probed driver\n"); > + return 0; > + } > + if (!slave->dev_num_sticky) { > + dev_dbg(dev, "skipping device, never detected on bus\n"); > + return 0; > + } > + if (!pm_runtime_suspended(dev)) > + return 0; > + ret = pm_request_resume(dev); I still don't get why the test above was needed. It's racy and brings limited benefits. > + if (ret < 0) > + dev_err(dev, "pm_request_resume failed: %d\n", ret); > + > + return ret; > +}