From patchwork Fri Mar 12 12:00:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 398601 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1132962jai; Fri, 12 Mar 2021 04:01:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAjw7UJul9f3yGwxHXdx+f6AYTuhPu+3M9JvjXTxE7bevtG4YqDCFOBe7c2SiWi6R6JuX7 X-Received: by 2002:a17:906:144d:: with SMTP id q13mr6264066ejc.458.1615550482052; Fri, 12 Mar 2021 04:01:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615550482; cv=none; d=google.com; s=arc-20160816; b=vm5oyrYM2pZBN9zYoxBNOMlJzxp901EUMaUldGdJDiFjBWq+rOxg66gWlCByzA7EHe cWimVkSBwJOM3qoOJ3GgYv3HYS2JL/US3iNg7iJyxVaQ6HS7HeyY0fCgLOlBlzLhjOiV NnTO1JG1aAfRVGqIQKbDOSHc5+pShAK7q05Z9Csh3Wm0oQjbuQ2EAYik7NAKhYx3spbw lobWzBSANu8FjlH+hQTMDGFFmsmBCyOZ4HP3XGkCMGzEzDHw5JZ0cR8JMjmq3cMwffJA v4lMNW/m6c1cpkMSPHmCBVTQPjxSz6NvR2mtKf6Sv4ri7amT+/aLZ2s7R1LeQwvxKXbY QMCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yEstJ8fSJSpfc6e8Q0vMn1tWonCjZtnzF+5445SF5Qs=; b=GbqlfF38r8so+sBwpM8rBGKycBt1WgC/+cgPkNATwDOQHMDj2TMBPkc2ONaO8OaCEJ J9p8zoNLezf/nAqX08fTsK60XW3oCBP7mBoUvJ+iBm08+yHF0TQvI0Sa+G7+0JjseiSU RznXJapfaI9EbTQi/q8GaYSpQgkPJV13JExEBGmcHqtkrcJARQkAccNfzZj+/xhunL9W Tr8nsgyVIxJUlWo8IbwTzxEZYruyNn69FC7jWT5egH7dwBVHmv5NOHoPg7Dql4jPJZ5Y Qyg0dkAyu0oo0ZiMglNUKoRjnW4LABbX74aPk2oy7R93+A7b9gQBjCf9VZx18/L8DpCq 7PDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yXkq2KLA; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n20si3843636ejx.104.2021.03.12.04.01.21; Fri, 12 Mar 2021 04:01:22 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-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=@linaro.org header.s=google header.b=yXkq2KLA; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231317AbhCLMAy (ORCPT + 6 others); Fri, 12 Mar 2021 07:00:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231444AbhCLMAe (ORCPT ); Fri, 12 Mar 2021 07:00:34 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BB20C061574 for ; Fri, 12 Mar 2021 04:00:34 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id t9so1626586wrn.11 for ; Fri, 12 Mar 2021 04:00:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yEstJ8fSJSpfc6e8Q0vMn1tWonCjZtnzF+5445SF5Qs=; b=yXkq2KLAbC7KzixcJj2Z96/TbUF5rxrVRAuXgmyNmPkUsbt00yQDUAtePfvJpDGkBq Q9AdySyXNnOdzKSxPbO/ssZolk7JeniO5InutNFtUM0ERNxCG3ID43kJuDgkbMgNovEY mZGbxSn+fGUz3jnIQC08dXvh3eoNP8Z6850z4rizDVZe6I1LBkISACd5EbB0ag9zxyhN dWGf8DDFmDsEr94j30r1q5+PwHX7k1qnCnWBDhSMQV/EK7Tl8wcw1lvW/KarPTytmy1e kfZUWS9r00Ewl1SYyRqwDW+oxCD3VvLvvKc+eeezMk0NxU2zuKNEVYgeCcowcJVFaCzK LEGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yEstJ8fSJSpfc6e8Q0vMn1tWonCjZtnzF+5445SF5Qs=; b=I3vGVkl7VoOB0kmSpEwnWUnYe5SgX3Kf8gF5QpDuOXxPftNP+VQhHctE34vFCgmUIM YL7ccDeJUaHjZ9JlEHsKf/dqaGGLMWwuIIDqY6jNuSVRvUX4xxx/qq3eu3pvboBANaE3 dRZSSY5PKZH1F6ic8CGQPR+RsicxD+5atiE5DgJqJeJrOj5w1g3Dz1AmsDVhC4QsAIvr AqXpw8oqqm3tDaEDlEGfSgaBRSrZckjB/yLBdf251LVMEpWuDyJPkTC+frJlB7Moaiue fFzk/YHk0SH70CLAj/4usGJPcMzHxv3LwnIXkYp0AUS4w6iM0PtQqLF1ZEQq2qADIqwq r6Sw== X-Gm-Message-State: AOAM532q0qFot72h+2AtLvQs794JXzp62EvoIolJ/eNsi7Yxzyy0A5YM cExlxMQQxJZ9U1LFHDZrca7JNQ== X-Received: by 2002:a5d:4564:: with SMTP id a4mr13642592wrc.3.1615550432808; Fri, 12 Mar 2021 04:00:32 -0800 (PST) Received: from srini-hackbox.lan (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.gmail.com with ESMTPSA id h25sm2268315wml.32.2021.03.12.04.00.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 04:00:32 -0800 (PST) From: Srinivas Kandagatla To: vkoul@kernel.org Cc: yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, robh@kernel.org, devicetree@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v4 9/9] soundwire: qcom: wait for enumeration to be complete in probe Date: Fri, 12 Mar 2021 12:00:09 +0000 Message-Id: <20210312120009.22386-10-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210312120009.22386-1-srinivas.kandagatla@linaro.org> References: <20210312120009.22386-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.21.0 diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index c6c923329b15..706d44200a36 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -123,6 +123,7 @@ struct qcom_swrm_ctrl { struct regmap *regmap; void __iomem *mmio; struct completion broadcast; + struct completion enumeration; struct work_struct slave_work; /* Port alloc/free lock */ struct mutex port_lock; @@ -417,6 +418,7 @@ static int qcom_swrm_enumerate(struct sdw_bus *bus) } } + complete(&ctrl->enumeration); return 0; } @@ -1155,6 +1157,7 @@ static int qcom_swrm_probe(struct platform_device *pdev) dev_set_drvdata(&pdev->dev, ctrl); mutex_init(&ctrl->port_lock); init_completion(&ctrl->broadcast); + init_completion(&ctrl->enumeration); ctrl->bus.ops = &qcom_swrm_ops; ctrl->bus.port_ops = &qcom_swrm_port_ops; @@ -1201,6 +1204,8 @@ static int qcom_swrm_probe(struct platform_device *pdev) } qcom_swrm_init(ctrl); + wait_for_completion_timeout(&ctrl->enumeration, + msecs_to_jiffies(TIMEOUT_MS)); ret = qcom_swrm_register_dais(ctrl); if (ret) goto err_master_add;