Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2833408ybk; Tue, 12 May 2020 09:11:39 -0700 (PDT) X-Google-Smtp-Source: APiQypJQW0liiSyho8Cp4O70rIC1Y6p4b/DLj40ng/F+ntOg6RkI2FqhDVS/iGbHcfepWfzVNKqa X-Received: by 2002:a17:906:808:: with SMTP id e8mr18249990ejd.372.1589299899340; Tue, 12 May 2020 09:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589299899; cv=none; d=google.com; s=arc-20160816; b=LWQmBNGvKmj3ifIAsZD4gLX+IyPedUxE8xffsp9GeUgouI4yBXq6BVLcw8IyMzYcUw Jg5sv+46T6wWXzHf1oSke3QBRC8G8Dvd0SLwaij5/pkOAIkQEmq1tMMxzWBGivTuc6sm Wd046IVEzx63pjNVQBJiG9G3R8M8eMfj4d1DQt4wbOCAFfiQlS8PXMuEyoMPiRYGNSXb 88/TATO+ZTF+lNJJu+jfTmGPQreg/70CGdX+SIWOqqNf7IPFNiakjargmd9YS9wPqlEO vx3nnW5EfKhLrAGNXjx241kQCGQdSFhwyXPm1RS1Y16rqFah3mm8TFvOs98JyPWVYHIX RBjA== 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:ironport-sdr:ironport-sdr; bh=j3FpcFL5DWQBIE1hRr6Dr9BzC8efqCrurr/llF/22xc=; b=N1Jo+bjQLVLBVcu+tPzZlKYTioI6hkSL9jcNwzDpXkdZAh7ajYLhXcYe0PnfBI+2P2 eOoPp7Pa1jeDB9lfPi7COwRr6puRmknTlpSX3GgP2yolbWtdUoTBCOlzDmuUjLc1o8Iw xakAIYo3d46yeD4j7xTBHyoGrEVNQKpwoZJnWykO7ceyyBOyWavCQdS4psBJ8Y5eZWrV YT+dtJ3gvTjEWi1mfJRmFauGBqOVk3jXhx5BHnsBElGsOeYYuCfe58TOJcsLbKL5hVx4 nPxc0SAFSQCISP8OnYEVhl2h5epX44Ww+I29vx5LKN0cHrp8vrdsiPgafLtmzcraxkXU tE9w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ck14si7652004edb.67.2020.05.12.09.11.14; Tue, 12 May 2020 09:11: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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727099AbgELQIk (ORCPT + 99 others); Tue, 12 May 2020 12:08:40 -0400 Received: from mga18.intel.com ([134.134.136.126]:26264 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725987AbgELQIj (ORCPT ); Tue, 12 May 2020 12:08:39 -0400 IronPort-SDR: U+iNjUbmpDCp9F9k2UfTFphu4TAsibtjWIiKHTEiYdAW8kw3jEKC0u3s1vxHdZOB9tXfrOHfZt MlvuekVncwtg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2020 09:08:39 -0700 IronPort-SDR: nbIPwbVM1FtOkmdF1YvWu67mvfPrzxseWx7VxXKXCiGVUa0QnxqzBkn/Wf3aF1q6kFrtsGuiva AjQFJRAdYRgQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,384,1583222400"; d="scan'208";a="409352761" Received: from bmtannen-mobl.amr.corp.intel.com (HELO [10.255.228.231]) ([10.255.228.231]) by orsmga004.jf.intel.com with ESMTP; 12 May 2020 09:08:37 -0700 Subject: Re: [PATCH 3/3] soundwire: bus_type: add sdw_master_device support To: Vinod Koul Cc: 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, mengdong.lin@intel.com, slawomir.blauciak@intel.com, sanyog.r.kale@intel.com, Bard Liao , rander.wang@linux.intel.com, bard.liao@intel.com References: <20200429185145.12891-1-yung-chuan.liao@linux.intel.com> <20200429185145.12891-4-yung-chuan.liao@linux.intel.com> <20200511063227.GS1375924@vkoul-mobl> <20200512033035.GV1375924@vkoul-mobl> <84f09843-3245-5fa4-530f-c915b28e9bc5@linux.intel.com> <20200512155927.GA4297@vkoul-mobl> From: Pierre-Louis Bossart Message-ID: <79ee2b4a-c2e3-aba7-8b67-b1a01922d089@linux.intel.com> Date: Tue, 12 May 2020 11:08:37 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200512155927.GA4297@vkoul-mobl> 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 5/12/20 10:59 AM, Vinod Koul wrote: > On 12-05-20, 09:36, Pierre-Louis Bossart wrote: >> On 5/11/20 10:30 PM, Vinod Koul wrote: >>> On 11-05-20, 14:00, Pierre-Louis Bossart wrote: >>>>>> + md = &bus->md; >>>>>> + md->dev.bus = &sdw_bus_type; >>>>>> + md->dev.type = &sdw_master_type; >>>>>> + md->dev.parent = parent; >>>>>> + md->dev.of_node = parent->of_node; >>>>>> + md->dev.fwnode = fwnode; >>>>>> + md->dev.dma_mask = parent->dma_mask; >>>>>> + >>>>>> + dev_set_name(&md->dev, "sdw-master-%d", bus->link_id); >>>>> >>>>> This give nice sdw-master-0. In DT this comes from reg property. I dont >>>>> seem to recall if the ACPI/Disco spec treats link_id as unique across >>>>> the system, can you check that please, if not we would need to update >>>>> this. >>>> Table 3 in the Disco for Soundwire 1.0 spec: "all LinkID values are relative >>>> to the immediate parent Device." >>>> >>>> There isn't any known implementation with more than one controller. >>> >>> But then it can come in "future" right. So lets try to make it future >>> proof by not using the link_id (we can expose that as a sysfs if people >>> want to know). So a global unique id needs to allocated (hint: idr or >>> equivalent) and used as master_id >> >> Can you clarify if you are asking for a global ID for Intel/ACPI platforms, >> or for DT as well? I can't figure out from the soundwire-controller.yaml >> definitions if there is already a notion of unique ID. > > If ACPI was unique, then I was planning to update the definition below > to include that. Given that it is not the case, let's make it agnostic to > underlying firmware. I am not sure I understand how this would be done. The call sequence is sdw_bus_master_add(bus) sdw_master_device_add(bus, parent, fw_node) At the bus level, we don't have any information on which controller the bus is related to. We'd need to add an argument to sdw_bus_master_add() and have the controller unique ID be allocated outside of the SoundWire core, hence my question on whether the DT definition should not be extended. > >> >> properties: >> $nodename: >> pattern: "^soundwire(@.*)?$" >> >> soundwire@c2d0000 { >> #address-cells = <2>; >> #size-cells = <0>; >> reg = <0x0c2d0000 0x2000>; >