Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7149831ybi; Mon, 8 Jul 2019 15:38:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtYmkI9MGYPoQmTMnMj+25kDz5h9xHCiar1ATUAxoX64qmnJoiSl7ZMNtl9OjxKsE2ufia X-Received: by 2002:a17:90a:1785:: with SMTP id q5mr28422147pja.106.1562625528511; Mon, 08 Jul 2019 15:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625528; cv=none; d=google.com; s=arc-20160816; b=ActrqlEoGk1bN+ZR/f7PtI+VmpNBZ4sbznFdOH+Kc8RNRpo6FF5bn6pmPk/i+bkFj4 ZbOjZTtYKq442/RJRI/x9QsFcX796R2fg7tBgNiHu791IcFUoxwuetgBGVaSBCSVyGZH lypfj3T3ibDjeMes3i1b2KRShF01UJCukwfcjxcxXugS7J+qIbeHkuuSW6PniHlVrWZv Y0qdsful0BmN/ajl54RWO/mVMaLm9zfiUvwGoxMIbG1g6msH3FCa5lUo6Qzr7BaAnoUU jnX5pv8u+DtILjO7ODI9vjktyOIqJaDN3xMMoN22YKE+0vTX7EBBczJOi3hI2b/ksfjF qnOQ== 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=4EvtqBILpfu2i0wB4JiWYKJQDSvAGhCwgJiwJ2A3lSE=; b=mqKcItRrvaozauK8Ug/ClL7HkM3Pqk8DRthgN/5lNXzbCfGZBITZYbezVLt9liUQ1I n/T/RF9kMc2dUcVyYAVF03LYlGajrYW1/PTv/WAe/tmqM6VcfzWqVBAMhabMNeRHYkGH TNQtNnx8XgS0JL1Ue8fqkUOaNKrZudveVAgMKNuIbB/EIYq+FcNEUqWdRB2bqitON4LT q9CSRCftXCv9e1JMo/pnhUI5/Y1Glh0rYCRQEgCgqZ7oxokUnERISrhZ8Yiu3SvNBkAs yZlspHBlgwSRIasmBJwwzGXbeYSj+95v9ECgyDEcxQpTojxPUl4bkjhAkQ0jcjjkc3Pt M8Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oDzoFRZi; 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 a23si17975194pls.189.2019.07.08.15.38.33; Mon, 08 Jul 2019 15:38:48 -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=oDzoFRZi; 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 S2389781AbfGHPap (ORCPT + 99 others); Mon, 8 Jul 2019 11:30:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:59746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389720AbfGHPam (ORCPT ); Mon, 8 Jul 2019 11:30:42 -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 6370B20665; Mon, 8 Jul 2019 15:30:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562599841; bh=c9X+wix+KAvIOO4t20Yh0NGUFt5F9cIwciHntpSwQH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oDzoFRZia3UGBQXekZoYxflpYC7Sw68mMR1xSAhDB4r/AywMOFM+fnPT7BrEAqaZP pBSt4m4JgtsSC1rLXvgN6aXyMRrFokwhBPWmSxS/uBxz1Y5p5i6leVrkuhOJ7XbqKL bZedfhzuGcCA5NExFsPkCAjNW4MZCgBF+RH+yDIw= 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.19 90/90] dmaengine: imx-sdma: remove BD_INTR for channel0 Date: Mon, 8 Jul 2019 17:13:57 +0200 Message-Id: <20190708150527.107862575@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708150521.829733162@linuxfoundation.org> References: <20190708150521.829733162@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 @@ -681,7 +681,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; @@ -1000,7 +1000,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;