From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FC14C072B1 for ; Thu, 30 May 2019 04:09:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 09EE725117 for ; Thu, 30 May 2019 04:09:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559189395; bh=GfU+Vi1ysvIgwd+gKfQxbeqNXe9DP2/I+P5v4onUCyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dq4koIRQ7iSm4yvBU2BP6iKYohfuqN5PuKLiexfCzD45+oWA0PySvUMpe4J2Uq1uk t0o5tffJHXbdWRx3w2ps1YOk8UNExfVc0reVSFTNHA3B8Hrf+F0rVJ0OpF04nRKNtb rLMXnI/bOhmpDWdToiJ3V7iGxo+sVHqE0JD79mig= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726198AbfE3EJy (ORCPT ); Thu, 30 May 2019 00:09:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:44490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730909AbfE3DRF (ORCPT ); Wed, 29 May 2019 23:17:05 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (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 F2D5A24659; Thu, 30 May 2019 03:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186225; bh=GfU+Vi1ysvIgwd+gKfQxbeqNXe9DP2/I+P5v4onUCyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S2Eft74j/JhxZJG8u9xPCiq7if0FTcyIOG/fyOwky9DbA88dTOtbv/QYI/yJTKy0f wd0bXk1osxVXflpBks2tWaqQP5M2uLIB1tykWy6PR7JUNQnEEGz++J5jdMkU8GGl5p YsrAA5OMOlOUe3FWjmCp2OanilZUGb1LytufkOS4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicolas Ferre , Ludovic Desroches , Vinod Koul , Sasha Levin Subject: [PATCH 4.19 120/276] dmaengine: at_xdmac: remove BUG_ON macro in tasklet Date: Wed, 29 May 2019 20:04:38 -0700 Message-Id: <20190530030533.386730715@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit e2c114c06da2d9ffad5b16690abf008d6696f689 ] Even if this case shouldn't happen when controller is properly programmed, it's still better to avoid dumping a kernel Oops for this. As the sequence may happen only for debugging purposes, log the error and just finish the tasklet call. Signed-off-by: Nicolas Ferre Acked-by: Ludovic Desroches Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/at_xdmac.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index a75b95fac3bd5..db5b8fe1dd4ab 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -1606,7 +1606,11 @@ static void at_xdmac_tasklet(unsigned long data) struct at_xdmac_desc, xfer_node); dev_vdbg(chan2dev(&atchan->chan), "%s: desc 0x%p\n", __func__, desc); - BUG_ON(!desc->active_xfer); + if (!desc->active_xfer) { + dev_err(chan2dev(&atchan->chan), "Xfer not active: exiting"); + spin_unlock_bh(&atchan->lock); + return; + } txd = &desc->tx_dma_desc; -- 2.20.1