From patchwork Tue Dec 5 15:21:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 174081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3503257vqy; Tue, 5 Dec 2023 07:21:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHjrQmx1M6xdlHKVfMzE/lX10W3gACJCaUBaHyNgn+JKnvGAYGMU0lyD82wdHRHQq+M/5VD X-Received: by 2002:a05:6a00:6c98:b0:6ce:3df6:89f7 with SMTP id jc24-20020a056a006c9800b006ce3df689f7mr1378668pfb.2.1701789708359; Tue, 05 Dec 2023 07:21:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701789708; cv=none; d=google.com; s=arc-20160816; b=U+SbH73ZNtvF0k0+RRTkClbmM7nw/4Yqob05BtC2GLzMBSTBAJf5Y4WLB77YffkMbH f8H7Z8Q/PN0ttEQys5UStsYCBVa98ObFnDDq9B+9j6BXpH0CDuNDfWKgevw9HwBYf5Ol +nyXImHUIMNMWEK/y5l/FIlHUrb2Tjn5Ki0B4qAfuvkLqnDIynK9BY3RPO4bSGnnGgfs NypO052N2akF6ie5QW17rfQfmRCCX/y0JCIOfQKFcU6Hn5kmYbcIzzqG3YRtR4aLOA8d RjP5Iji2WUMC1qI+KdMQW4/ZHvQ5IplhjMdVtPURpkz/4gCbhRdwHUfJC6h0GBpL9cN8 Juxw== 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=JegQGeg9h6K3SanbpVDQgW3INV0bHYQT8tL/y6V/fI4=; fh=BUbsl/7SQr7UvgKzSUEbQiaw+ofTKYg/C9Euv9gslOA=; b=oG96s1wCovwsN+I21Q8Zn9QVME+5CRu8r9ehIwuV8ygy9h9z3DqsTkKt18dgveVSLD 69zNZxXv1vCQ2POfYOvb3pMjssWuUf2CVIjM+WHZ3fxYlUUdAXQdBF3LZqgiGhnmz76d eSGUt8Ijy1hA3citbtSdo8JxtJt2sBMWWpq6cwhCnrxVkr56AAd2WogIxievTDieXHfP Y49IQoak9aozivLfhdw2haG5KYu3EQxoK/C3JlKcGFSh5m3AggMdqnfWGb16PH3JfU/c a+HIYzKQpXCYERnH3k0B/rZyZK+u26wRwt+DJrYZHEJDV99VToJ3a2i0kPrfFIsx8yPf injg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="Z7UmF/Sx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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. [23.128.96.37]) by mx.google.com with ESMTPS id f12-20020a631f0c000000b005c67dd98afesi4438590pgf.211.2023.12.05.07.21.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 07:21:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="Z7UmF/Sx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 13DBE80B8E7C; Tue, 5 Dec 2023 07:21:46 -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 S1442418AbjLEPVa (ORCPT + 99 others); Tue, 5 Dec 2023 10:21:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442302AbjLEPVY (ORCPT ); Tue, 5 Dec 2023 10:21:24 -0500 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A554FB2; Tue, 5 Dec 2023 07:21:30 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPA id 4FC6840009; Tue, 5 Dec 2023 15:21:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701789689; 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=JegQGeg9h6K3SanbpVDQgW3INV0bHYQT8tL/y6V/fI4=; b=Z7UmF/Sx610v9Ui+3KrH/mI7zdwsmeCoVrZbR5VKLgwLW0MEgtpmghFKWVOEGn547KQNwf KBImIzahnVYXg5TP8Nv1lp1s2EkE8FjE2PmoJmwb+1oDb/vIr/pSE2zTPzHEAYoLjSrGn5 HbVtLIQsbIR857y7VCw3a6P2zpVLsLuvX6vpM5C2ScuOBppIjzbsr0FbGMMBEc0onuVg2a tSuBIy0FPBt2Ne8A0PwWOda4riIWKQtjEwWrEEoAx5jeg8nDkYXV9tZEIoVh/wXjRak3YN aE8D7Dm5KX186VlZmzY/WjnwTbrHdnEVqdr4ZjwZUa95xTJzd60C1GMm9iFHKQ== 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 , stable@vger.kernel.org Subject: [PATCH v2 03/17] soc: fsl: cpm1: qmc: Fix rx channel reset Date: Tue, 5 Dec 2023 16:21:00 +0100 Message-ID: <20231205152116.122512-4-herve.codina@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231205152116.122512-1-herve.codina@bootlin.com> References: <20231205152116.122512-1-herve.codina@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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, 05 Dec 2023 07:21:46 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784455845686367145 X-GMAIL-MSGID: 1784455845686367145 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") Cc: stable@vger.kernel.org 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); }