Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1802269ybk; Mon, 11 May 2020 04:45:40 -0700 (PDT) X-Google-Smtp-Source: APiQypIsl1/TT1Zc7Av9DWBIz4xcBWegmy3TizFSP4OeJe+msPemvuid4jTaiffw3e333INcSkMs X-Received: by 2002:aa7:d606:: with SMTP id c6mr13388692edr.107.1589197539869; Mon, 11 May 2020 04:45:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589197539; cv=none; d=google.com; s=arc-20160816; b=DwNs2r/m7gIjUGyLNHaXslqri1ZoNkdZf0RaSqbmn75ScN0nkSR4LjDAnjWgBSUURW FVz46aUy8gerMXOQKuxdmSchF/AOQVQjQ4ik04grTW80WWb1HK8izEptsw32db0onUpF dba/rbHFdSOLFZ7ZGQ6tHD9yc5cBFdCG38Qs0YN/Jrd15zjo18wqzz4lb39ZHQwApO+2 TBNlA5J7R4237REy0rVRZk6pG0cZJD9GS6AiV4ftZVlzeRWZzb6nYRxq30Rq8HovI/st 6fzoIygjYvDvj81R/eeblFWbYpivteX0SjgUQ+yt282bOmffIdmHBhOudaGljWZnCRTm X4lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Rno/RZkQ+kkxf80kOr2kHdv9P7AVcpigSeZZAHgIYHM=; b=O2EMnerzYb+Q4fewD9FS73z+7qs+UPrDxCBJ5dB2E7Tszm7w4b5/AD9xrPsCorWy7K RdtizdJLfHy88OnShyitj2H3rO0e60TRYA+ZcOtN9yVRMiH0W0JZXz1i60iV8ckV5jg9 +CdBSCNIipXztp4xAWSiOdlgoHbquBKHvyzO1DJqwdgWnn9JOSnzzgCMswZ+p+qTtdka cddr6fqV0g6Z6CE9c2vXPnyS3vhxONfGn//rpeZdDPZMFEu19oAJqSz9HhcscTCGrlve qGtYe8BU2Nv9CAXeRA5PIwOTH8Lfgd8d47i9WvtXOWjHn4IvmKQCIq4e36o9/hi5Ng4q 3h3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=x7dILyMr; 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 j2si5747813edk.17.2020.05.11.04.45.17; Mon, 11 May 2020 04:45:39 -0700 (PDT) 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=x7dILyMr; 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 S1729610AbgEKLlP (ORCPT + 99 others); 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