From patchwork Wed Oct 11 06:14:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 151121 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp334879vqb; Tue, 10 Oct 2023 23:16:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFc/vlZD+wb1dNnRReaBkTLbzY0zMcLqUoRYowz23NMU6MdoQAd57AfMOPvpby6Rl8s8JUg X-Received: by 2002:a17:90b:17c3:b0:27c:f653:37b2 with SMTP id me3-20020a17090b17c300b0027cf65337b2mr2768091pjb.1.1697004966437; Tue, 10 Oct 2023 23:16:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697004966; cv=none; d=google.com; s=arc-20160816; b=fE83NYJn4p25e5KL8hrqf6/735K9NUS4/btXbAcG1EuV1OIyFivY4wMMHYimX0/NzG 3oXVo9qpZ3OZ9kJ1OdS6cMROdkW+ydEHWBf3XW3MWhbXOx52LprBkPkcHFPCyuIs4tit l2cbdrQcIpfAeSJ6QYfV+IiztXltp/aUWBsPXKsHt1Z15Qfp7R4qLPHDsetQ3jcj31dq 9cMS8fGJwYSdwe+EKHtzoPvRudYbt9B++H3oGYBLyxVnJZ53aiaLMOJRX9k/jeAxUa+y gQUMhL/srtPKA6z6Zz03c6SHL0S8ct4iZ33CNcigunFOYyDUYi/x4duTkY1uaG8ObOVD L4Rw== 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=Vsq3fcsRQ92trwLtB4WXIyAHgTZzHeLSP3hrA+1+hQo=; fh=5rCQDomVZxLXb7yR2oN4iSS3zxUnzGJP2HoQaRzhQu0=; b=Zo+yU4FTC9QMAZvhhmfZX8jjGWD739J+zcU0FyMRqNdMXyG4v9DtnMpxNyktzNaOvX Ch2reofrYK3m2ekwp+qnNl3dv+9Qf1DMznr7pVKSoJwosI3fcdQS2nm4sqgjDVpWjv4i r4CgYD8iYB4S0VgIqE7tt+QlebPskQ9zBuxP8TN76rzsKAMlOX3mUlmzN0TQP0aO9/Ay vJDbyNty6WPw02k765hlCbB+J+f1pYyCSpq0UsaHyL5MWXVWQocjM2iwXREF3KpmoE7y CmtUJKBgo5BZNMr03LA3jooSFxhAAl98YqAvcyk3y8As+en92Ldo8Nco5IflhdqeCz5w a8KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=objvKH9J; 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 kn6-20020a170903078600b001c41515c4c7si13298603plb.115.2023.10.10.23.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 23:16:06 -0700 (PDT) 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=objvKH9J; 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 05213808E3C9; Tue, 10 Oct 2023 23:15:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344526AbjJKGPK (ORCPT + 19 others); Wed, 11 Oct 2023 02:15:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344477AbjJKGPE (ORCPT ); Wed, 11 Oct 2023 02:15:04 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AF90B4; Tue, 10 Oct 2023 23:14:59 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id BFAC0E0008; Wed, 11 Oct 2023 06:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697004898; 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=Vsq3fcsRQ92trwLtB4WXIyAHgTZzHeLSP3hrA+1+hQo=; b=objvKH9JAKfLcBpFR1A6qzh+qMI3YqOrhpp3QyRrlt5oAWvEzKQ1Fwz3mKqUHHGlGbnOJH Xmw1fUSBf06Qbx7xUYwRmmDkM1xbBEmEdGWtzvscJ5jo1RnChgVmEdA0D0+OWuyt+S7+l5 I9NsmEaJIqQV68GPA22255N+7A0hqr5oEPRDxCpkQrWoSDJEJxW0ACHqBFX/5UF80JA6KH QhqFQ59yI1nMHEcauyq/bJInHL4U/DFTFXMCaFjLAdAUj+NOv4jfR+1e0kaD5Swb+S/WlS VJmqeY4nwH/DUP741qPhMd9j9LgQrbNyAX2jJjQsd8Rdhnvtg7nkiSxvnJ0qCA== From: Herve Codina To: Herve Codina , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Linus Walleij , Qiang Zhao , Li Yang , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Christophe Leroy , Randy Dunlap Cc: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Simon Horman , Christophe JAILLET , Thomas Petazzoni Subject: [PATCH v8 03/30] soc: fsl: cpm1: qmc: Fix rx channel reset Date: Wed, 11 Oct 2023 08:14:07 +0200 Message-ID: <20231011061437.64213-4-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231011061437.64213-1-herve.codina@bootlin.com> References: <20231011061437.64213-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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 10 Oct 2023 23:15:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779438679961064510 X-GMAIL-MSGID: 1779438679961064510 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 7ad0d77f1740..8dc73cc1a83b 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); }