Message ID | 20221026110210.6575-3-srinivas.kandagatla@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp193402wru; Wed, 26 Oct 2022 04:04:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5CQ1iGft5LVBCPkVWAOfGEsEHIR+f0JNZAGEbR+5j4WX4On50HVa0AbXz14R8JU+4BYRbo X-Received: by 2002:a17:906:9b90:b0:78d:9704:752 with SMTP id dd16-20020a1709069b9000b0078d97040752mr35527400ejc.695.1666782293707; Wed, 26 Oct 2022 04:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666782293; cv=none; d=google.com; s=arc-20160816; b=bKniR0n/vJ6e6PMi3g3ZJn34uK0TfBfUa23rUcfUdsE9rHntD6KrUSakXvEhLFBGQ8 wcMGBBaVCb5r0ncbXwEahde0wBtSz6LDDOE/dvFpca8/VgTVDfbCAXB0bnPMZMka8+0s jfW9OMiVqKG2beiURtH+NKb3F1mcqtleHdeeJcAGyhmL7HQf0phCJRPAivDSHFmApNpX FJPAAljYNUee4FcbHYmj7YZJLyKj0CA8AE8+BgxxGtix94s3Kjn6ZWH6FGobRXZpXwwi oQOuZ19OGMfklsN0TbFeUJYJ+hvy7pjcTlDpUDvZwZCrNts/dTiAgc3VB5wLv9jprXQA C9cg== 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=y4sQJzVrHni1WLAuaAcAXcY4IxBG/K5oBIjFNgyTIGU=; b=PwthWV+4ouRYkEfg6EYNUXBXuVqpiLltrdDBp6pYxlsqUYlrHc9jN//qA6cPRjIBxN MmnxCWsbe4TUgyWkhbii3SSzjzGfllUjMM3uSqxaJ4MuHdTt5/NiTmN4fPZKE+63X/x/ XnLc+C4qzDXH2XQomT0l9Lb30r0Vj11+xnbMoqE7bfnuNkg9LerNMNpznsU0FO33AqPz 49U9Ffg9fSsMeN26qx0kh6euu2mka/nFyUWrL5pYnPdr7Th6+CTc7LGmPL0hiySVrKib MIEkQewXgoXxny5Q/G8GXTOcZw12AO3DXWmqx8Scma0qMCbpp/Vng+gX+w4Gt1BjKFPG i4cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TAx4tjE+; 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 u15-20020a17090617cf00b0072a477a55e0si4614693eje.369.2022.10.26.04.04.29; Wed, 26 Oct 2022 04:04:53 -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=TAx4tjE+; 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 S233166AbiJZLCe (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Wed, 26 Oct 2022 07:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233397AbiJZLC1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Oct 2022 07:02:27 -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 EDC8FB56DB for <linux-kernel@vger.kernel.org>; Wed, 26 Oct 2022 04:02:25 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5so2149019wmo.1 for <linux-kernel@vger.kernel.org>; Wed, 26 Oct 2022 04:02:25 -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=y4sQJzVrHni1WLAuaAcAXcY4IxBG/K5oBIjFNgyTIGU=; b=TAx4tjE+S9rXc/zlFGGPRl0uwIS/mtGtuJhj7IGSzfeIMVzaco9BF+sU98thou5Lgj C0JW8r0zxjpHDi8rzTS5doOZ8Gz3TnF3Ko47ZbObPbEtOiV/XczTTpCtT5Ba2yMs4k+B pVNYj0RW8tOCU53hk3rl0NmNgNTk52yI7qQ9ts6Ifjz2dS5epGUYe8Act0oylQB5oh8y wayfnhvtZhP+CWjdF+iHl2nGWhus+jPR+QftOAj4Kjkr93LT4qw8p5NssmqKSpWWYc9f 2xK+G3bYSycJwqnyByA0N5cIel8sF93aBKc2HqMaOr+na6uDjdvC/uMMj9ms4PKkYBBI zDPw== 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=y4sQJzVrHni1WLAuaAcAXcY4IxBG/K5oBIjFNgyTIGU=; b=lx0dLSQSHwIJgbTJJAO+/S+XWoxMq+zKrv7JwpmxHwf5cLukhTbP7ya7zH40pQ3CNh 0WCZVmkJ+HTRPkttG74aABOgy1/d5mrrUAkVaRg9cSdK5Xn5Q/d3nRisD7vrf9FOM4j1 8Kiyn2Q3emn8x6mpGzADi6Nks6isz9mx8IXB6tBTzHtug9/T23YCMGaJGxtrrRhVSngq sHhZv0R6qVKxutEjRvLkReKYoWxUyukXwAeOv/auslJY2B/a6hTZp8fcf/+Cd70Rrkwb SbxOK9IuaoUagA6tWzPLIqrsi7J/38/sqwj0gMnpaIodsq0t6+l/g6ZAsIHHEzgULxaQ A8dg== X-Gm-Message-State: ACrzQf0IblewDXZollMbeYpTAPv3p8kA5jLCFTQhb6tVkslGzZOhpDdx 2pQI5IATt0c/cBZ2irJUlfc2og== X-Received: by 2002:a05:600c:244:b0:3c6:bc2f:421b with SMTP id 4-20020a05600c024400b003c6bc2f421bmr2040804wmj.32.1666782144503; Wed, 26 Oct 2022 04:02:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 04:02:23 -0700 (PDT) From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> 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 2/6] soundwire: qcom: check for outanding writes before doing a read Date: Wed, 26 Oct 2022 12:02:06 +0100 Message-Id: <20221026110210.6575-3-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 Content-Transfer-Encoding: 8bit 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=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747747910321184901?= X-GMAIL-MSGID: =?utf-8?q?1747747910321184901?= |
Series |
soundwire: qcom: fixes and support for v1.7
|
|
Commit Message
Srinivas Kandagatla
Oct. 26, 2022, 11:02 a.m. UTC
Reading will increase the fifo count, so check for outstanding cmd wrt.
write fifo depth to avoid overflow as read will also increase
write fifo cnt.
Fixes: a661308c34de ("soundwire: qcom: wait for fifo space to be available before read/write")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/soundwire/qcom.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 8f1a1eb017a2..cee2b2223141 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -380,6 +380,12 @@ static int qcom_swrm_cmd_fifo_rd_cmd(struct qcom_swrm_ctrl *swrm, val = swrm_get_packed_reg_val(&swrm->rcmd_id, len, dev_addr, reg_addr); + /* + * Check for outstanding cmd wrt. write fifo depth to avoid + * overflow as read will also increase write fifo cnt. + */ + swrm_wait_for_wr_fifo_avail(swrm); + /* wait for FIFO RD to complete to avoid overflow */ usleep_range(100, 105); swrm->reg_write(swrm, SWRM_CMD_FIFO_RD_CMD, val);