From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67EB4C47255 for ; Mon, 11 May 2020 11:41:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 409982075E for ; Mon, 11 May 2020 11:41:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589197276; bh=qVA+9DJ79+6bkSsk8R/e1V4bMq1lEKRjniVj/AiExgc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=uNScaDXh3nUppErIVZ3uXHMj+IqbzSWO/WgLXKo3F0xhk1MrLkYEz+AHSsE9q7zip IvcGvscXwHoVsoE7x5ulgShSjDQ0HnAFldS3wXtxEUoe3G60HV9M00SMVg5/jve9Fz GVgBnx1cw0pZPEobRPZ/swvCzMIy09Bkz0aL5Sn8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729634AbgEKLlP (ORCPT ); Mon, 11 May 2020 07:41:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:57094 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726068AbgEKLlP (ORCPT ); Mon, 11 May 2020 07:41:15 -0400 Received: from localhost (unknown [122.167.117.121]) (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 0B16420708; Mon, 11 May 2020 11:41:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589197274; bh=qVA+9DJ79+6bkSsk8R/e1V4bMq1lEKRjniVj/AiExgc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=x7dILyMr6XdHySREvLDzpe5C5AhgDfkT6/IMWHn2goMLLn6acGj+pM7k7VtP6x9wZ 77xc7BrxSSdZVjRgeXF/VDqfoKD3OJm0qYs8Pk6e7juqTbh3aZLFziSplI0QZ/GYLc ihYC1C3Ls3rqC5Vnqc8S5a+qrhBv1/9gn6Dpo3q8= Date: Mon, 11 May 2020 17:11:08 +0530 From: Vinod Koul To: "Liao, Bard" Cc: Bard Liao , "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" , "tiwai@suse.de" , "broonie@kernel.org" , "gregkh@linuxfoundation.org" , "jank@cadence.com" , "srinivas.kandagatla@linaro.org" , "rander.wang@linux.intel.com" , "ranjani.sridharan@linux.intel.com" , "hui.wang@canonical.com" , "pierre-louis.bossart@linux.intel.com" , "Kale, Sanyog R" , "Blauciak, Slawomir" , "Lin, Mengdong" Subject: Re: [PATCH 3/3] soundwire: bus_type: add sdw_master_device support Message-ID: <20200511114108.GU1375924@vkoul-mobl> References: <20200429185145.12891-1-yung-chuan.liao@linux.intel.com> <20200429185145.12891-4-yung-chuan.liao@linux.intel.com> <20200511063227.GS1375924@vkoul-mobl> <20200511090003.GT1375924@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11-05-20, 11:34, Liao, Bard wrote: > > > > -----Original Message----- > > From: Vinod Koul > > Sent: Monday, May 11, 2020 5:00 PM > > To: Liao, Bard > > Cc: Bard Liao ; alsa-devel@alsa-project.org; > > linux-kernel@vger.kernel.org; tiwai@suse.de; broonie@kernel.org; > > gregkh@linuxfoundation.org; jank@cadence.com; > > srinivas.kandagatla@linaro.org; rander.wang@linux.intel.com; > > ranjani.sridharan@linux.intel.com; hui.wang@canonical.com; pierre- > > louis.bossart@linux.intel.com; Kale, Sanyog R ; > > Blauciak, Slawomir ; Lin, Mengdong > > > > Subject: Re: [PATCH 3/3] soundwire: bus_type: add sdw_master_device support > > > > On 11-05-20, 08:04, Liao, Bard wrote: > > > > -----Original Message----- > > > > From: Vinod Koul > > > > Sent: Monday, May 11, 2020 2:32 PM > > > > To: Bard Liao > > > > Cc: alsa-devel@alsa-project.org; linux-kernel@vger.kernel.org; > > > > tiwai@suse.de; broonie@kernel.org; gregkh@linuxfoundation.org; > > > > jank@cadence.com; srinivas.kandagatla@linaro.org; > > > > rander.wang@linux.intel.com; ranjani.sridharan@linux.intel.com; > > > > hui.wang@canonical.com; pierre- louis.bossart@linux.intel.com; Kale, > > > > Sanyog R ; Blauciak, Slawomir > > > > ; Lin, Mengdong > > > > ; Liao, Bard > > > > Subject: Re: [PATCH 3/3] soundwire: bus_type: add sdw_master_device > > > > support > > > > > > > > On 30-04-20, 02:51, Bard Liao wrote: > > > > > @@ -24,9 +24,14 @@ int sdw_bus_master_add(struct sdw_bus *bus, > > > > > struct > > > > device *parent, > > > > > struct sdw_master_prop *prop = NULL; > > > > > int ret; > > > > > > > > > > - if (!bus->dev) { > > > > > - pr_err("SoundWire bus has no device\n"); > > > > > - return -ENODEV; > > > > > > > > This check is removed and not moved into sdw_master_device_add() > > > > either, can you add here or in patch 1 and keep checking the parent > > > > device please > > > > > > We will set bus->dev = &md->dev in the end of sdw_master_device_add(). > > > > We need to test if this is valid or not :) > > > > > That's why we remove the test. But now I am wandering does it make > > > sense to set bus->dev = &md->dev? Maybe it makes more sense to set > > > bus->dev = sdw control device. > > > A follow up question is that should slave device a child of bus device > > > or master device? I would prefer bus device if it makes sense. > > > I will check bus->dev and parent and remove bus->dev = &md->dev in the > > > next version. > > > > the parent is bus->dev and sdw_master_device created would be child of this > > and should be set as such. You can remove it from bus object and keep in > > sdw_master_device object, that is fine by me. > > Looks like we don't need the parent and fwnode parameter since we can > get them from bus->dev 😊 Quite right > > The sdw_slave is child of sdw_master_device now and looks to be set correct. > > So, it will be > bus device > -> master device > -> slave device > right? yes > > I have a question here. We have pm supported on bus and slave devices, > but not master device. Will pm work with this architecture? > Can it be > bus device > -> master device & slave device? yes it would and you should check it out. The pm (runtime_pm) works well with child devices and parents, so we need to ensure that parents are set properly. Thanks -- ~Vinod From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFFE4C47255 for ; Mon, 11 May 2020 11:42:18 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4637B20708 for ; Mon, 11 May 2020 11:42:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="gCVr33k1"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="x7dILyMr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4637B20708 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 81F6386F; Mon, 11 May 2020 13:41:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 81F6386F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1589197336; bh=qVA+9DJ79+6bkSsk8R/e1V4bMq1lEKRjniVj/AiExgc=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=gCVr33k1wqWdp3C8R083VhhhApDvBv1ADWkOKznYjsH2a1tCuwfZbg6VEvqWF/JQ1 +CZUR746reVPOspgJPmjg1rHB25kDvKgj9kPbL4z9WqLyQ/GHbqrLmTJv2vz7ZwuVX 7kKXPMqsZOvY2BXhJ6HSxBuwJ6Xo2+5YeSg4r/G8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id EA386F8014C; Mon, 11 May 2020 13:41:25 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4842AF80157; Mon, 11 May 2020 13:41:24 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 38727F80107 for ; Mon, 11 May 2020 13:41:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 38727F80107 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="x7dILyMr" Received: from localhost (unknown [122.167.117.121]) (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 0B16420708; Mon, 11 May 2020 11:41:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589197274; bh=qVA+9DJ79+6bkSsk8R/e1V4bMq1lEKRjniVj/AiExgc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=x7dILyMr6XdHySREvLDzpe5C5AhgDfkT6/IMWHn2goMLLn6acGj+pM7k7VtP6x9wZ 77xc7BrxSSdZVjRgeXF/VDqfoKD3OJm0qYs8Pk6e7juqTbh3aZLFziSplI0QZ/GYLc ihYC1C3Ls3rqC5Vnqc8S5a+qrhBv1/9gn6Dpo3q8= Date: Mon, 11 May 2020 17:11:08 +0530 From: Vinod Koul To: "Liao, Bard" Subject: Re: [PATCH 3/3] soundwire: bus_type: add sdw_master_device support Message-ID: <20200511114108.GU1375924@vkoul-mobl> References: <20200429185145.12891-1-yung-chuan.liao@linux.intel.com> <20200429185145.12891-4-yung-chuan.liao@linux.intel.com> <20200511063227.GS1375924@vkoul-mobl> <20200511090003.GT1375924@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Cc: "pierre-louis.bossart@linux.intel.com" , "alsa-devel@alsa-project.org" , "tiwai@suse.de" , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "ranjani.sridharan@linux.intel.com" , "hui.wang@canonical.com" , "broonie@kernel.org" , "srinivas.kandagatla@linaro.org" , "jank@cadence.com" , "Lin, Mengdong" , "Blauciak, Slawomir" , "Kale, Sanyog R" , Bard Liao , "rander.wang@linux.intel.com" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" On 11-05-20, 11:34, Liao, Bard wrote: > > > > -----Original Message----- > > From: Vinod Koul > > Sent: Monday, May 11, 2020 5:00 PM > > To: Liao, Bard > > Cc: Bard Liao ; alsa-devel@alsa-project.org; > > linux-kernel@vger.kernel.org; tiwai@suse.de; broonie@kernel.org; > > gregkh@linuxfoundation.org; jank@cadence.com; > > srinivas.kandagatla@linaro.org; rander.wang@linux.intel.com; > > ranjani.sridharan@linux.intel.com; hui.wang@canonical.com; pierre- > > louis.bossart@linux.intel.com; Kale, Sanyog R ; > > Blauciak, Slawomir ; Lin, Mengdong > > > > Subject: Re: [PATCH 3/3] soundwire: bus_type: add sdw_master_device support > > > > On 11-05-20, 08:04, Liao, Bard wrote: > > > > -----Original Message----- > > > > From: Vinod Koul > > > > Sent: Monday, May 11, 2020 2:32 PM > > > > To: Bard Liao > > > > Cc: alsa-devel@alsa-project.org; linux-kernel@vger.kernel.org; > > > > tiwai@suse.de; broonie@kernel.org; gregkh@linuxfoundation.org; > > > > jank@cadence.com; srinivas.kandagatla@linaro.org; > > > > rander.wang@linux.intel.com; ranjani.sridharan@linux.intel.com; > > > > hui.wang@canonical.com; pierre- louis.bossart@linux.intel.com; Kale, > > > > Sanyog R ; Blauciak, Slawomir > > > > ; Lin, Mengdong > > > > ; Liao, Bard > > > > Subject: Re: [PATCH 3/3] soundwire: bus_type: add sdw_master_device > > > > support > > > > > > > > On 30-04-20, 02:51, Bard Liao wrote: > > > > > @@ -24,9 +24,14 @@ int sdw_bus_master_add(struct sdw_bus *bus, > > > > > struct > > > > device *parent, > > > > > struct sdw_master_prop *prop = NULL; > > > > > int ret; > > > > > > > > > > - if (!bus->dev) { > > > > > - pr_err("SoundWire bus has no device\n"); > > > > > - return -ENODEV; > > > > > > > > This check is removed and not moved into sdw_master_device_add() > > > > either, can you add here or in patch 1 and keep checking the parent > > > > device please > > > > > > We will set bus->dev = &md->dev in the end of sdw_master_device_add(). > > > > We need to test if this is valid or not :) > > > > > That's why we remove the test. But now I am wandering does it make > > > sense to set bus->dev = &md->dev? Maybe it makes more sense to set > > > bus->dev = sdw control device. > > > A follow up question is that should slave device a child of bus device > > > or master device? I would prefer bus device if it makes sense. > > > I will check bus->dev and parent and remove bus->dev = &md->dev in the > > > next version. > > > > the parent is bus->dev and sdw_master_device created would be child of this > > and should be set as such. You can remove it from bus object and keep in > > sdw_master_device object, that is fine by me. > > Looks like we don't need the parent and fwnode parameter since we can > get them from bus->dev 😊 Quite right > > The sdw_slave is child of sdw_master_device now and looks to be set correct. > > So, it will be > bus device > -> master device > -> slave device > right? yes > > I have a question here. We have pm supported on bus and slave devices, > but not master device. Will pm work with this architecture? > Can it be > bus device > -> master device & slave device? yes it would and you should check it out. The pm (runtime_pm) works well with child devices and parents, so we need to ensure that parents are set properly. Thanks -- ~Vinod