Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1161068pxu; Fri, 27 Nov 2020 00:51:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYdRsCkYTIcDSM/CTY5YWfYfx43YcsVY8QiytB3K9bTFbyjJgKV+uLS9NKJ41SaJY/qaRW X-Received: by 2002:a17:907:3fa3:: with SMTP id hr35mr5830640ejc.71.1606467084299; Fri, 27 Nov 2020 00:51:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606467084; cv=none; d=google.com; s=arc-20160816; b=UipTRDy58jHciJUbNNaOD1qGad8GZDJyMXmA6pdp+po/MGtRy3a08IT4PD65WXZ4Ve A22ST73pppzfCU0VVjGAg3uKYQ+7GhlidNGPM7l6RRo89hTNXKIpIUfJkQCqEL6d3nhX Oe/bsl9lhyHUC1DvyOKulpmFrrQjFWezSMNZ27QisHwq27tVUfqQh5HlAT/csbuHsM/w KwbmRyH/fw46yq3QAa9mYWJpSIdmK1rr8y+VWPK3dClegYP6yFIKTi07ugcMnCsDd40j YxlODC4JcGkd4DXWRdwF4SwDTz7F+MICCxvN38lykDfzklYSEc36oIpi/0SZ9jP8gBTe Yt4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yv68V6pBiIYUcQgUdqZ2Oiq/XwesC3r1UQP9Ay1hDJQ=; b=kxCDd4k3S5o/QlU8Qm0ewcT5TP5BKa1Ap25vQwIqHdD5zidMGpWKUJ51RI7RK+KvF4 l7pPtRL5QndbVW3RA+c8YLNYhgir/t8BdoK3DOxCK/37Xrtzc8VZEmFfagUSRUfSXhJd MQseHdJ+cQtU6TEkTdF9wyN89rX2R/HXfWk0A8gUfwSTO6/4RE69bjeoEXUcSZQDb8iZ 59lMG48ZNGSlgWfs5P5Rr2wpXlLVQ/5eoJLC9XAG19YCTvifTmTQCvHuNjXAkgPhUDZM 49ZeFPVtbUVoMt+gELLDCXgGCGyqlAjMfC85qaquWhofDfqMy10+Js1Pm7CifmPsxD/u pVOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Z/HoHHKF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w3si4487043ejj.208.2020.11.27.00.51.01; Fri, 27 Nov 2020 00:51:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Z/HoHHKF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389600AbgK0GSI (ORCPT + 99 others); Fri, 27 Nov 2020 01:18:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:45726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728043AbgK0GSI (ORCPT ); Fri, 27 Nov 2020 01:18:08 -0500 Received: from localhost (unknown [122.167.146.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2ECBE221FD; Fri, 27 Nov 2020 06:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606457888; bh=Rdoi629DjicvHoCKKgi6+NxG/4/rdjkHZDIAQJ5MAJA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z/HoHHKFJX74NRjz9J8FtFtn84vPzICi+RbaYQdzpvSUqgbHYwOxh+oz1TQdL1Adn TZI3vXKLc0HpZkba6veJrNtrtHL+8WIwPUBFm4aYFTUuToZg7lZL2ZHGpZAScxv8Xh 8WCY65V8QV7qgA+Yrj0CyoqHDtsjcPXrumrTjp3Q= Date: Fri, 27 Nov 2020 11:47:58 +0530 From: Vinod Koul To: "Liao, Bard" Cc: "pierre-louis.bossart@linux.intel.com" , "alsa-devel@alsa-project.org" , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "ranjani.sridharan@linux.intel.com" , "hui.wang@canonical.com" , "srinivas.kandagatla@linaro.org" , "jank@cadence.com" , "Lin, Mengdong" , "Kale, Sanyog R" , Bard Liao , "rander.wang@linux.intel.com" Subject: Re: [PATCH] soundwire: master: use pm_runtime_set_active() on add Message-ID: <20201127061758.GK8403@vkoul-mobl> References: <20201124130742.10986-1-yung-chuan.liao@linux.intel.com> <20201125050528.GC8403@vkoul-mobl> <20201126042222.GG8403@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201126042222.GG8403@vkoul-mobl> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26-11-20, 09:52, Vinod Koul wrote: > > > > @@ -154,7 +163,12 @@ int sdw_master_device_add(struct sdw_bus *bus, > > > struct device *parent, > > > > bus->dev = &md->dev; > > > > bus->md = md; > > > > > > > > + pm_runtime_set_autosuspend_delay(&bus->md->dev, > > > SDW_MASTER_SUSPEND_DELAY_MS); > > > > + pm_runtime_use_autosuspend(&bus->md->dev); > > > > + pm_runtime_mark_last_busy(&bus->md->dev); > > > > + pm_runtime_set_active(&bus->md->dev); > > > > pm_runtime_enable(&bus->md->dev); > > > > + pm_runtime_idle(&bus->md->dev); > > > > > > I understand that this needs to be done somewhere but is the core the right > > > place. In intel case it maybe a dummy device but other controllers are real > > > devices and may not support pm. > > > > > > I think better idea would be to do this in respective driver.. that way it > > > would be an opt-in for device supporting pm. > > > > Should it be put in the same place as pm_runtime_enable? > > IMHO, pm_runtime_enable is in the core already and it seems to be harmless > > for devices which don't support pm. And pm can still be optional on md's > > parent device. > > For intel case yes, but world is not only intel, there are md which do > not have a parent like sof. they are real sdw controller devices Sorry I confused md with real master device ;-) I guess this patch should be okay then.. As the real parent will control. Thanks -- ~Vinod