From patchwork Wed Jul 26 15:01:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 126487 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp507838vqo; Wed, 26 Jul 2023 09:12:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlF5anUqEUN2QyEZBvl2ENEbOhDuvX00W7OPTcESIlvAb0uS70XbHm8RpML6nL6ATlFLJqD5 X-Received: by 2002:a17:903:284:b0:1bb:876a:abe with SMTP id j4-20020a170903028400b001bb876a0abemr2236603plr.0.1690387963898; Wed, 26 Jul 2023 09:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690387963; cv=none; d=google.com; s=arc-20160816; b=jW6/Gc5d1Za7GGgmmuRNNTYbMRvhu7u6+uQ2NOhbip3q99ZHWAw+Hh/klwTyiCX/S3 tuUCvMF1QhxkkkiPN5YNYTA4IR3YgoJUU34PR+QmAOVTZCWidBeJyLgFrXZySwrDtIRc mb39zvu4wBGsPcVnekMLM2EVgMRCD2n4Hrg6eQDnJRO2r5jrCLBwZk2jS3qoX2TzUQoe ZbNNZV6Nq72+I1HTXdR3iRDk2foVkiLijwW2BYPCKOb9Bha6hTIvXTUeIySg+AhkDAUc YfpRXdZY4sElYzqSKixcp6JudGlWJDUzyHqwMT9rbTWXSra+uGTd0cHdC40B3UYkXYk+ +Blg== 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=+d5s9323iF8ft7c8DhbJ/Jl0ODynHXS04sT7BffHRn4=; fh=OtJVFpZ5Y8/ND7g8QcUIbRSFhG4LznwcYYtG4zWKevM=; b=Fei9KRyIBeRApNaSRXRP1tP0ZsomDaMDJipbriVYN9p01B+1Vs1nnHIL9fX3xdSZs7 0uGMceLX7E2Gu18GKpIk6NX1XAA0E5QOANObwQhd9Wl3qPGlvThnBlbOLEWwB3rn4gCO wIXjzT/mo8IuNNQZ6AU9pY4oAzTjOsRYNkGprK5xtpO37KuFz44n0zb8LJghhpFWNNR9 RJ308EjWmJnFeolZFyLmWw8i7VmHVBYsOAJd7DjjGsBomw32k8VuaWPPoKwjbo0j0ZK5 hUsqMfmZ60GKDvfp0WLpkAw3LYRlngvER+nXFjbJCfgl3jpsD3ED0gxzhcgAT7jHQ2Ed JGTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=KlmSK+LV; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ko16-20020a17090307d000b001b8a60fb314si12167643plb.409.2023.07.26.09.12.28; Wed, 26 Jul 2023 09:12:43 -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=@bootlin.com header.s=gm1 header.b=KlmSK+LV; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234685AbjGZPDd (ORCPT + 99 others); Wed, 26 Jul 2023 11:03:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234615AbjGZPCx (ORCPT ); Wed, 26 Jul 2023 11:02:53 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C99A52688; Wed, 26 Jul 2023 08:02:47 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id AFCD01C0004; Wed, 26 Jul 2023 15:02:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1690383765; 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=+d5s9323iF8ft7c8DhbJ/Jl0ODynHXS04sT7BffHRn4=; b=KlmSK+LVgexPCfc9c3JZfqCZC6QOt+I2+Zl6MZ3M4QVEQy4PxkuLxKuCQ/9t7uk27STRPz /0XLckGrkPlSad1c1BhRwQhGah8OKh8xqNvY1jSrNSw7emdWDOpK1g3CAL8QNyykPEaybb oEmxpAkenkLOUB8WC/Y8JvwuV1o67bL8QWbR1ohY9BaMmbKIE3XMWBKqbgnM1yzbgS5IOU gHPlvoNhM4SLSNPxtAganjBetxyVT463g6+3faZOg8XOK8YCWryKrX95Lkwe3dzIvne2Bm icXMELd4CRyRNut+3ii6nrMXFf92HBviuL8WEHP6MjzH8lNTnAhVi3x9M7NK+A== 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, Thomas Petazzoni Subject: [PATCH v2 03/28] soc: fsl: cpm1: qmc: Fix rx channel reset Date: Wed, 26 Jul 2023 17:01:59 +0200 Message-ID: <20230726150225.483464-4-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230726150225.483464-1-herve.codina@bootlin.com> References: <20230726150225.483464-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,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: INBOX X-GMAIL-THRID: 1772500249251412805 X-GMAIL-MSGID: 1772500249251412805 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); }