Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7150796ybi; Mon, 8 Jul 2019 15:40:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3Bqwh/o1HJDeG6yzi5cYbKL2tTzw0CPq78399lkSoElYh7IZc/PPXAUflh8mSDNN7NGvk X-Received: by 2002:a63:205f:: with SMTP id r31mr26639315pgm.159.1562625607264; Mon, 08 Jul 2019 15:40:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625607; cv=none; d=google.com; s=arc-20160816; b=M+T7G4x+zrNRIouRwD2Wpg9r7mDdeaLjfFzxxYZFTOPXWiiojI0TRGKzuQKsmXNwa5 pjrgULzQFlM/gwepcRRPMWECLI+lfTbToxCMNcWigzJDOYz/aYFQPJBxx6/fUKTuOsli ZeaOu/29C6amKhGgtLKNVHiVmkCvQ6iRGBhaRoMpFP9HvQ4QVEcHf9YNC7Nu+xfRQFev avAOraHIyEuU1jjJhrFa/qs1wFl2ySdCwpHNDGpVtfp07PMfLg9zbVw3yUvXddG1gGYG npIwbMvrL7Zo4KagIUDArdnA8a0Ty+8h3Gmik04wH2sIOjZLKNFg8Ja07loKCZoqGKQg kvfA== 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=HdHUtTUan0TMH8YHoGGuYlIub5Luq33FVXvXpKLa3YU=; b=lr64ppD1Q8+OlR3qaARnd41A9Tqc5hgHWlpvICjN0js9K6SkCGuvWPqVz4lONws5c7 30l0eAf5Tekze7spslxzvdqj9jVfz56vmmZXhuQ8PN8/OO2zomNMboZ9uOiwkCa9i+ef eQIE5c8cUDe2gqzbyaD6zgplic0qBqNA1Tw6b0KT3igjDaK8WyNA6tw0/tYFbh1hFVo5 SVhxPQw9prlupKulyCRCoOgjr6yX07QmQl5fyqo/zdJAIZqsqY13fAM1dMZFHQcUcE+8 Pw0bF5nh25y9d/2qGWqjusPDjZxXPwe9u53rR5vseYVe22ewVPkNyZ5saALO3S0RCMs1 mpvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2j3SHHCu; 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 p8si15132164pgi.6.2019.07.08.15.39.52; Mon, 08 Jul 2019 15:40:07 -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=2j3SHHCu; 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 S2390703AbfGHPfj (ORCPT + 99 others); Mon, 8 Jul 2019 11:35:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:37750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390911AbfGHPfO (ORCPT ); Mon, 8 Jul 2019 11:35:14 -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 47E1B204EC; Mon, 8 Jul 2019 15:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562600113; bh=iTSKftyqIVwrvdwu0ceOYFM/FFLEUplnkq6vr6rQeIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2j3SHHCutVqCrjAG5dWxn2lz8m1yYeVM0f9Lm+gnePXjF3d50Zy104alFJJoI/Im7 Cxs4xo2jPOvMa/pHm5EVuK011MiP0hPAimu5Dah0nyfLoE0TJC71ry9O/pVZLqPv2j caH7Q20XSch7aErezxM1+L8BsM+m9F7HAzYWJFsg= 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 5.1 93/96] dmaengine: imx-sdma: remove BD_INTR for channel0 Date: Mon, 8 Jul 2019 17:14:05 +0200 Message-Id: <20190708150531.463009320@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708150526.234572443@linuxfoundation.org> References: <20190708150526.234572443@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 @@ -703,7 +703,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; @@ -1025,7 +1025,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;