From patchwork Wed Oct 26 11:02:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 11189 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp193348wru; Wed, 26 Oct 2022 04:04:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7l7YPxAciC7D2bGB4Aem4IqNM4ZoByL+vfvXhJMJ+5xmC0hgUNo+9CEgvMmXtU5cyCdUui X-Received: by 2002:a17:907:c25:b0:78e:1a4:132 with SMTP id ga37-20020a1709070c2500b0078e01a40132mr37390117ejc.521.1666782287066; Wed, 26 Oct 2022 04:04:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666782287; cv=none; d=google.com; s=arc-20160816; b=WPldsA8zoj1grQhS85FX0i0ZgW4Y9jA71YGfgOXhwLwSuoF76nVbCoJkWQhYnLv+XH x2Lteo4xeSzOHYG75N/BCQhak2F5bXybi0EQQSjXxlzUZ0ct6VWqX5cIaF5z2xWbsMPA jD/DuQ5Lug3h/AJjupQd6QLC5DsNXER9MIMa/DCu42Fr3iSRJSuLn9QXqSrh7uQ6pvmF /lkd+PnNsjiuaYl69/WYcVuEeVoWKpD42CzeO5NhixWs0AEW3Qmpft7kt3blcXOjmhm9 35diana6lyORKwVQaIwDA5P7rgppscjJGEDk5cigf2YjghDMS3dN5zypmduKhMszDeKg Xstw== 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=Iq+UTjOWMyquGHaqNGU9bVUM+RbHUdDoO13dPtnzSfU=; b=QI51EOZ20f4rmiNzI6Ttc4QE0wSG+vMeRlSA+nfcdY9L5LPH9YrZegs0s3wnekTrSb ZDQLgppVZzuOHYVN4nB6524BjDvXdCKx40tJkT0swE1zLYuBhbh+jjzEHMcJ7zxPrf2I fIUxZCYC5NOo7cCez49IWPfsMlzisuTg7vlE1vJmCMUSFa7mzrs6NYrOnZiPvr2Jc0Tt Z0lzd2foOwUkNIQcdr1D3ej7wN2/IGSbplYqIimUb63CngdBk3j8seY7S+DunISIdpwW 5MXYVgQi8sQuGQ0aoHXllK7NF/bdn0M4I7LEVnWWwdnusEchs5GFLBtLB0lmdcTWSeDo S5qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kkr8je1+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga11-20020a1709070c0b00b007309e8d567fsi5988006ejc.145.2022.10.26.04.04.22; Wed, 26 Oct 2022 04:04:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kkr8je1+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S233481AbiJZLCa (ORCPT + 99 others); Wed, 26 Oct 2022 07:02:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233265AbiJZLC0 (ORCPT ); Wed, 26 Oct 2022 07:02:26 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92E3EB515E for ; Wed, 26 Oct 2022 04:02:24 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id v130-20020a1cac88000000b003bcde03bd44so1186043wme.5 for ; Wed, 26 Oct 2022 04:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Iq+UTjOWMyquGHaqNGU9bVUM+RbHUdDoO13dPtnzSfU=; b=kkr8je1+7h37yq2UCQzx7bziwp9BgRGHNSqBb7MHWFDsWbjGPduEr3Jl4E1yYfBt0Q 2rH15nIYWCvOOnIr8WyHRKxRHoqQFq1ctID5UQJJ27i0gf4/9mbP647SAxtQEEd70ciO xE+gccJPfzpgshvNKQIhRcfy0mF3ECaew3cgZz7OeL8zh2jlodY2AeFhDGYLNK4BCj7i LfgT8ODc6dk9tcQcKjJzUIq2h3A515ZhcAmRFDopXRHNoNPCnbKneJOUv34RYE1KLypw r3Ro1TF5ufrWemVsjdkN3Q9NoZsxph7y2TBCpZvSpDmSaREstiDlBhBjg5zlNyYtWRTZ zlkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Iq+UTjOWMyquGHaqNGU9bVUM+RbHUdDoO13dPtnzSfU=; b=rycNqXX98jZ7D7BMHraj3yAw7eE+QA1jFFoyapJaoPjFEtgUBVKKQRfOFBs4x7AssS AfkV8wsKkguSyMdRbZObohSRNhhIaRgDGeFq7jdmiltvi/RmhFFx2ftc099KWhIgPGvo 30WzwM+AbiizSSuijKjRS/a1DRQX8SMVSDpK1EcjB4DqxsJRfS6CTrapJubnPNTUmMP/ LmgXje5PywJkfanXG2DaxXpXS8acCy3cfZiYvHrCzjfouOTk8ptywfUBiQKm/EX2E3x4 ifRi/ypeRq3cwTID//gyn+OG+aHLRvaiUkzd7nbnziuLCmq+v5WJUfsrT7/zFyJPIt33 j5Hw== X-Gm-Message-State: ACrzQf1SJg0RlZEu2yOVk5ps5wbp3AGCDAHCLLtn6louzVIRuDs6Ukg3 d4j9U55x4FPkNdQhW9t/mCHVNa53uIYZPw== X-Received: by 2002:a05:600c:3585:b0:3c7:9f:5f87 with SMTP id p5-20020a05600c358500b003c7009f5f87mr2101249wmq.76.1666782143122; Wed, 26 Oct 2022 04:02:23 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id z7-20020a5d44c7000000b0023672104c24sm5237415wrr.74.2022.10.26.04.02.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 04:02:22 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org, yung-chuan.liao@linux.intel.com Cc: andersson@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, srinivas.kandagatla@linaro.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 1/6] soundwire: qcom: reinit broadcast completion Date: Wed, 26 Oct 2022 12:02:05 +0100 Message-Id: <20221026110210.6575-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20221026110210.6575-1-srinivas.kandagatla@linaro.org> References: <20221026110210.6575-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747747903670478284?= X-GMAIL-MSGID: =?utf-8?q?1747747903670478284?= For some reason we never reinit the broadcast completion, there is a danger that broadcast commands could be treated as completed by driver from previous complete status. Fix this by reinitializing the completion before sending a broadcast command. Fixes: ddea6cf7b619 ("soundwire: qcom: update register read/write routine") Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index b33d5db494a5..8f1a1eb017a2 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -344,6 +344,9 @@ static int qcom_swrm_cmd_fifo_wr_cmd(struct qcom_swrm_ctrl *swrm, u8 cmd_data, if (swrm_wait_for_wr_fifo_avail(swrm)) return SDW_CMD_FAIL_OTHER; + if (cmd_id == SWR_BROADCAST_CMD_ID) + reinit_completion(&swrm->broadcast); + /* Its assumed that write is okay as we do not get any status back */ swrm->reg_write(swrm, SWRM_CMD_FIFO_WR_CMD, val);