Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7149142ybi; Mon, 8 Jul 2019 15:37:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSvUCH2+CMlplocjk2JEYUTlz+Ad/84/RXwl7bDs+7KVKCtJ3qbBcKOlB7Tvpa7kvCVNRL X-Received: by 2002:a17:90a:17c4:: with SMTP id q62mr29106810pja.104.1562625469028; Mon, 08 Jul 2019 15:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625469; cv=none; d=google.com; s=arc-20160816; b=qZ9iFdHopgUHMZknFQnMV/rgxp4E6rfVWMntE4qdUb6vLp6gmo/PhqiptJrQyaJwz+ Bv8HwBgIwEwzwVDkaKhRydSpH9a3MFd4LzUxz1YaWuoOzH4r7F66O1Y1kjgxiTrPSFtr BWx5NMvO3z9z+Z6WvNolfgl0N/wpg/KhLWXQyduS/xioZclZj+BDTfNxEX5AbnJ5EhE2 IVCAB7EtpPQB/0+VRd8897jfszOu1eEAdMtncH5wzeZtXv1wC9qY2EKC8cWablWs6q1F 9ZmDEeZ7Qna6fQuv5Olenl7Dml6inDwYWQ4wPetT2GnhSjQzqG3qD4CczEz6/yhUZZsB 5uEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VWFETWnJ9vnwXo2Mr3XPA3YoTqDEIftSf+TI5Gy0hdQ=; b=iShGZ5Is9el+8TtRNOXK/0gPqVRiAah+BNtyMVpKC6HNkiKxwp1HwuauwBis00aZ1/ ET2kWIkjY7llFGf6K5YGBzot0cJrBnXMxnyJLi+qsXGlcvmV/uCPi8J3YDJ4FU/nEZ4A FrF1EfUIg+Swagfy1o8LGz2OCWIDmCrlBNKrEDjFvLBSH6QepGt3SIMMHRx+D5vjaKPe A7MYAf9s86R5I0cyFMz4YOaAQ2v9IbW428jGUaZqq56cU63AazoSNsgWyidrWcB7dPCl DqQ+uGzjcGMwrJ8mZo9MDXs6Nxppvbe9i2x2Deu2LphkRyz1+g1JqLD2jdhNpLqZOoQv uG4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jr7Y0Eg3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y15si20040326pfe.133.2019.07.08.15.37.33; Mon, 08 Jul 2019 15:37:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jr7Y0Eg3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388416AbfGHP0S (ORCPT + 99 others); Mon, 8 Jul 2019 11:26:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:53964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388777AbfGHP0P (ORCPT ); Mon, 8 Jul 2019 11:26:15 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1C18021738; Mon, 8 Jul 2019 15:26:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562599574; bh=7i5TIOHDCJrnRJK3is1Oicb1skMDjv9yLBrDM4cBtmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jr7Y0Eg3e8OcJDo3fVdfPM9H63TBPiBTMFq9Pp23JxtpRVQCvRvWf7fkUtwuSowgN 3RMn7QKnAf8vUkts6YXotV8+fpzIUCnXD9LxLljYhh5XzHSaOTWbSx1cC/0LVuW8zR 4P25lley9fLZzbYb4oBIVxTaUAytNAYScEF6pozY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robin Gong , Sven Van Asbroeck , Michael Olbrich , Vinod Koul Subject: [PATCH 4.14 55/56] dmaengine: imx-sdma: remove BD_INTR for channel0 Date: Mon, 8 Jul 2019 17:13:47 +0200 Message-Id: <20190708150524.291969254@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708150514.376317156@linuxfoundation.org> References: <20190708150514.376317156@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robin Gong commit 3f93a4f297961c12bb17aa16cb3a4d1291823cae upstream. It is possible for an irq triggered by channel0 to be received later after clks are disabled once firmware loaded during sdma probe. If that happens then clearing them by writing to SDMA_H_INTR won't work and the kernel will hang processing infinite interrupts. Actually, don't need interrupt triggered on channel0 since it's pollling SDMA_H_STATSTOP to know channel0 done rather than interrupt in current code, just clear BD_INTR to disable channel0 interrupt to avoid the above case. This issue was brought by commit 1d069bfa3c78 ("dmaengine: imx-sdma: ack channel 0 IRQ in the interrupt handler") which didn't take care the above case. Fixes: 1d069bfa3c78 ("dmaengine: imx-sdma: ack channel 0 IRQ in the interrupt handler") Cc: stable@vger.kernel.org #5.0+ Signed-off-by: Robin Gong Reported-by: Sven Van Asbroeck Tested-by: Sven Van Asbroeck Reviewed-by: Michael Olbrich Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/imx-sdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -632,7 +632,7 @@ static int sdma_load_script(struct sdma_ spin_lock_irqsave(&sdma->channel_0_lock, flags); bd0->mode.command = C0_SETPM; - bd0->mode.status = BD_DONE | BD_INTR | BD_WRAP | BD_EXTD; + bd0->mode.status = BD_DONE | BD_WRAP | BD_EXTD; bd0->mode.count = size / 2; bd0->buffer_addr = buf_phys; bd0->ext_buffer_addr = address; @@ -909,7 +909,7 @@ static int sdma_load_context(struct sdma context->gReg[7] = sdmac->watermark_level; bd0->mode.command = C0_SETDM; - bd0->mode.status = BD_DONE | BD_INTR | BD_WRAP | BD_EXTD; + bd0->mode.status = BD_DONE | BD_WRAP | BD_EXTD; bd0->mode.count = sizeof(*context) / 4; bd0->buffer_addr = sdma->context_phys; bd0->ext_buffer_addr = 2048 + (sizeof(*context) / 4) * channel;