Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp992839ybe; Wed, 4 Sep 2019 10:49:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvzS0w23Pdjgua9d80LNOgmNXlB6BP+mNfhI6hOekyMD56MHlpbITlN9KNZ8yHa7gtDIW1 X-Received: by 2002:aa7:8f03:: with SMTP id x3mr32219076pfr.91.1567619381580; Wed, 04 Sep 2019 10:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567619381; cv=none; d=google.com; s=arc-20160816; b=1F+NJLVVcGFXuzptW+CYmSnZKc+Dhr7S/5zNVOKgeTJzsIjfSd+J9gB7fHzGX5c5CM ofFIovNwDfWcyiVnctgQKKX0Qspsr9DtXON9DRoF5k0SLDGcIGB8ofbNylSOl1AIRYDe YJNzcmt0iPwAnr0f4CXosANLpOzMQLc2xlTws1/g+v7cyLDmLv7xpYbtlD4dj3dJAY/e PG/TD2fmSBb+fMsihgu5Azg5UUHYIqJxrlXCuwplPD20aNcU34Yjv2M5LrI863dP8PbQ oVW7XAWv9M/BuUL+fDzESCroF/3MdORf/6JQI6UHEadcCug+JFjv+XmEoVemUZARG5z+ PlbA== 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; bh=v2BWMEip5NKNXGbji6zTcx55JpRQNrKD4EBZC7zFf1o=; b=E3pO7G305UPle78PMbOPQ/K5qpc0EQXERz+JeDAGclF8yXNPNT5cLIR4BV4kBPZFW7 I78WO0hLTFnTTz88asabUQLszh8a220jqLQAJCGcZs6ECMjogkdeJKsU0yaCuydgTG4n AG26Q95RReQ/4m2W8eQ0PVpakeqPnaVwqhtbxhHZtp51GliVridmwfSbz0Qy61ZgdPX6 IJ1XpFFtyxFSxPGrAV6Ci54Qr+xVX4vYjDJKvdWbmAvEGv3ioj+tAvgF5v4nOTnSKwSw JLusSqUB6uOe3l1j7qAOJA66yEFFMx3xR6QuNRLXRPN+IV5KWobmy2ZojyKkVNYt0GeC T1jw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id d7si2783069pjw.103.2019.09.04.10.49.24; Wed, 04 Sep 2019 10:49:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1731756AbfIDRrr (ORCPT + 99 others); Wed, 4 Sep 2019 13:47:47 -0400 Received: from mga01.intel.com ([192.55.52.88]:21092 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726589AbfIDRrr (ORCPT ); Wed, 4 Sep 2019 13:47:47 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2019 10:47:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,467,1559545200"; d="scan'208";a="194814201" Received: from enagase-mobl1.amr.corp.intel.com (HELO [10.251.133.230]) ([10.251.133.230]) by orsmga002.jf.intel.com with ESMTP; 04 Sep 2019 10:47:44 -0700 Subject: Re: [alsa-devel] [RFC PATCH 3/5] ASoC: SOF: Intel: hda: add SoundWire IP support To: Vinod Koul 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, slawomir.blauciak@intel.com, Bard liao , Rander Wang , Ranjani Sridharan , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , YueHaibing , Zhu Yingjiang , Kai Vehmanen , Arnd Bergmann , Guennadi Liakhovetski , Keyon Jie , Pan Xiuli , Fred Oh , Daniel Baluta References: <20190821201720.17768-1-pierre-louis.bossart@linux.intel.com> <20190821201720.17768-4-pierre-louis.bossart@linux.intel.com> <20190904072131.GK2672@vkoul-mobl> <1897e21f-b086-8233-e96e-6024e75a2153@linux.intel.com> <20190904165129.GB2672@vkoul-mobl> From: Pierre-Louis Bossart Message-ID: <785cce2e-febe-3bbd-7590-32943fe7ac99@linux.intel.com> Date: Wed, 4 Sep 2019 12:47:44 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190904165129.GB2672@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 9/4/19 11:51 AM, Vinod Koul wrote: > On 04-09-19, 08:25, Pierre-Louis Bossart wrote: >> On 9/4/19 2:21 AM, Vinod Koul wrote: >>> On 21-08-19, 15:17, Pierre-Louis Bossart wrote: >>>> The Core0 needs to be powered before the SoundWire IP is initialized. >>>> >>>> Call sdw_intel_init/exit and store the context. We only have one >>>> context, but depending on the hardware capabilities and BIOS settings >>>> may enable multiple SoundWire links. >>>> >>>> Signed-off-by: Pierre-Louis Bossart >>>> --- >>>> sound/soc/sof/intel/hda.c | 40 +++++++++++++++++++++++++++++++++------ >>>> sound/soc/sof/intel/hda.h | 5 +++++ >>>> 2 files changed, 39 insertions(+), 6 deletions(-) >>>> >>>> diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c >>>> index a968890d0754..e754058e3679 100644 >>>> --- a/sound/soc/sof/intel/hda.c >>>> +++ b/sound/soc/sof/intel/hda.c >>>> @@ -57,6 +57,8 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) >>>> { >>>> acpi_handle handle; >>>> struct sdw_intel_res res; >>>> + struct sof_intel_hda_dev *hdev; >>>> + void *sdw; >>>> handle = ACPI_HANDLE(sdev->dev); >>>> @@ -66,23 +68,32 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) >>>> res.irq = sdev->ipc_irq; >>>> res.parent = sdev->dev; >>>> - hda_sdw_int_enable(sdev, true); >>>> - >>>> - sdev->sdw = sdw_intel_init(handle, &res); >>>> - if (!sdev->sdw) { >>>> + sdw = sdw_intel_init(handle, &res); >>> >>> should this be called for platforms without sdw, I was hoping that some >>> checks would be performed.. For example how would skl deal with this? >> >> Good point. For now we rely on CONFIG_SOUNDWIRE_INTEL to use a fallback, but >> if the kernel defines this config and we run on an older platform the only >> safety would be the hardware capabilities and BIOS dependencies, I need to >> test if it works. > > Yes I am not sure given the experience with BIOS relying on that is a > great idea ! But if that works, that would be better. I don't think it's going to be that bad, first we need to find the ACPI description for the controller, then see which links are active, and even with all links disabled nothing bad will happen. What I am more worried about are inconsistencies where e.g we have both I2C/I2S and SoundWire devices exposed at the same time. The BIOS deals with this with dynamic changes depending on user changes, and we are likely to see reports of problems due to BIOS configuration selection, not the BIOS itself.