From patchwork Tue Nov 28 14:08:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 170798 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3946471vqx; Tue, 28 Nov 2023 06:08:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IG03PRxoPOSpuSenS8RKOI6geX1u+fx7jrsIMNQkNgDDhB7mJQspncebITNKXtLLo81DwWv X-Received: by 2002:a17:90b:390e:b0:285:da91:69e8 with SMTP id ob14-20020a17090b390e00b00285da9169e8mr6856220pjb.47.1701180526102; Tue, 28 Nov 2023 06:08:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701180526; cv=none; d=google.com; s=arc-20160816; b=BIlfPHztSqDaFPHcSLV7l/o3pG+n27yHtm7HRs01gViKPQMnkA4gY+9qdMt2ishVLw U0GavkFWkJOHTo/nxUWXiiidZCRdlquuMsXgrqvUqbZQCPkyonLk+V8q6n5IdBEVPbT9 xltG6tXmLFo3O0pA4VSth2V4H+vr4c5KTbqVVc6jojQPQfc3bvA474EoS6eTJQJn13Im A2ECNtZf/bH/d7EbtzYyQ2rAFqEWGMN4EnsZtK0nNJcq5QuxRWPy5RmwZmiyQLieZirK 6SDxgCebUglpr6ffvfEWameQdaQ2tTrAhBwcj4rokP5TxLQGD8j0i8Iay4Hd5VNI7Xn/ naaA== 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=qto69Sz/uzj7vWp+LbsEsH5JgUyWqrsMlRYbgKO+Ta4=; fh=vamCZaQ7EeQQjV+Jpg1PpgbwecLJumQNdtvzT0FcvGs=; b=pEwfUNNIGjn5AG4KpnVI5MokXhHnEto609lXatQkmoUEGuCMNeadpFe85kVPi91H1R 9zEF9hDQr+QO18JOS0BpIMj1YMid8Arh/75tXlXIYIJ5VnD2B+bhDoC8wEyNsYjwkIwA 2gVmb2m3McejBlodDBgBROnIm33yAAGSYgO/Q0tFgYz/uDzKp/S5TPJO2PF65nkI3Jaq cW4tG/c7Crc2o+egQ7N6qoCe8IqxNnE82XvRtvLnCt66N3eTiF9apC5DnMc6kZzHcFm4 Yw15ovvzKs6+5MHVRzznZNIdqoHgYgPkkd58VgLi62y1oUHdLKlgivuoKfXFMais3Cxo Ystw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Ww25g59s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id x16-20020a17090aca1000b002856811a6fcsi12002177pjt.108.2023.11.28.06.08.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 06:08:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Ww25g59s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B115E8047786; Tue, 28 Nov 2023 06:08:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345632AbjK1OI1 (ORCPT + 99 others); Tue, 28 Nov 2023 09:08:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345576AbjK1OIV (ORCPT ); Tue, 28 Nov 2023 09:08:21 -0500 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBAEAD6D for ; Tue, 28 Nov 2023 06:08:27 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPA id 4563C60013; Tue, 28 Nov 2023 14:08:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701180506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qto69Sz/uzj7vWp+LbsEsH5JgUyWqrsMlRYbgKO+Ta4=; b=Ww25g59sPr1Wg8G2/+eo82WrZ6uxax9bU8yVHybpwtNwfTLCgJLf5wbu3NNaKdloqct4SN JOl71UmaiYH9SqoWEm99UYUjls414OjRBZgwcCCRyxgXM+DgHiE6WiGInOx5WCGdzHXc1F 5JutCdvL8M33BnD43l0Zh8DE7gfb/B2Jp/wei1EUp9HzqSHivwORgT3bCB+K83Yp157Knc IbPzw6Vd0r23914xtvob7oGilQ5CO/WiYAf5X4kE+y7MGAFcDlUHUdbT8gHvAQJfWnlUY7 K2lj3jmvc2L8Tb/VERzqS6pCaUHIe1CiReLbXjwgpUkt/bAlxy1311tX1O4q7g== From: Herve Codina To: Herve Codina , Qiang Zhao , Li Yang , Jakub Kicinski , Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Christophe Leroy Cc: Arnd Bergmann , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Thomas Petazzoni Subject: [PATCH 03/17] soc: fsl: cpm1: qmc: Fix rx channel reset Date: Tue, 28 Nov 2023 15:08:02 +0100 Message-ID: <20231128140818.261541-4-herve.codina@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231128140818.261541-1-herve.codina@bootlin.com> References: <20231128140818.261541-1-herve.codina@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com 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_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 28 Nov 2023 06:08:39 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783817071508345472 X-GMAIL-MSGID: 1783817071508345472 The qmc_chan_reset_rx() set the is_rx_stopped flag. This leads to an inconsistent state in the following sequence. qmc_chan_stop() qmc_chan_reset() Indeed, after the qmc_chan_reset() call, the channel must still be stopped. Only a qmc_chan_start() call can move the channel from stopped state to started state. Fix the issue removing the is_rx_stopped flag setting from qmc_chan_reset() Fixes: 3178d58e0b97 ("soc: fsl: cpm1: Add support for QMC") Signed-off-by: Herve Codina Reviewed-by: Christophe Leroy --- drivers/soc/fsl/qe/qmc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c index 3f3de1351c96..2312152a44b3 100644 --- a/drivers/soc/fsl/qe/qmc.c +++ b/drivers/soc/fsl/qe/qmc.c @@ -685,7 +685,6 @@ static void qmc_chan_reset_rx(struct qmc_chan *chan) qmc_read16(chan->s_param + QMC_SPE_RBASE)); chan->rx_pending = 0; - chan->is_rx_stopped = false; spin_unlock_irqrestore(&chan->rx_lock, flags); }