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.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 092A4C282CE for ; Wed, 22 May 2019 19:37:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CFE032081C for ; Wed, 22 May 2019 19:37:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558553870; bh=f00Z042OxVO1lpGglNkqwDzP9Wehwz5cJyphswOCSj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ts2ayMTRjzbWGfCYbTtY6dYnlWDqGc1Et7b/80zf+3MVICxvJIb3YfY2AS3014WHr +8ht+Gdch0VCmJN4+E/6oihqOXg23n/rIuLcAd7944wCTLUSzByD3zn7yBHnxahoIf 65mz/MFgroUIlxeV8DWDOF/FxgUzyxAdaR3ZPtUs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732291AbfEVThp (ORCPT ); Wed, 22 May 2019 15:37:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:53552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733150AbfEVTaK (ORCPT ); Wed, 22 May 2019 15:30:10 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 34042217D4; Wed, 22 May 2019 19:30:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558553410; bh=f00Z042OxVO1lpGglNkqwDzP9Wehwz5cJyphswOCSj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AjIClk0dEqX6DgKVOAdpBcoFy9bVu9UCiZ49YcPkTyjMUJrkZF3BpCm7vMXMcwvct RmB1qEyNtfqzOTPcdOKmIkHRb3I5dhx5D9rkrHZLzU3zqji8KRlMzUR14tdiKxc8vQ AUVj+Wy6Vz69ATP3OUvSUBfshF3ntCCRoKhleHjA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nicolas Ferre , Ludovic Desroches , Vinod Koul , Sasha Levin , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 058/167] dmaengine: at_xdmac: remove BUG_ON macro in tasklet Date: Wed, 22 May 2019 15:26:53 -0400 Message-Id: <20190522192842.25858-58-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190522192842.25858-1-sashal@kernel.org> References: <20190522192842.25858-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org From: Nicolas Ferre [ 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 4db2cd1c611de..22764cd30cc39 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 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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,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 66729C282CE for ; Wed, 22 May 2019 19:30:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 39F9B217D9 for ; Wed, 22 May 2019 19:30:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mdnov9tw"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="AjIClk0d" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 39F9B217D9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dt2LQvLbcyfCv2YPHOx9RQgpK9aCeTDu6iOPd1DJdAM=; b=mdnov9tw7blTGE Mm4OD74VUlquBtSZf2eRb6j1gvE+Hbrlrx3L+0/5p2cFX8lIV5qAzfYiWRSfvZsjKulEpBHoiGmmR +5zicZRUM67Nq2hainPt6ZFi5POJvyip/CbTq2XtzUhEEcS8fTN5VcSFtJYO4KLle6q+40+2UrzbM cCILrkSSq+XPFFJ3qSiIhayFHGiwYBxsvxElan2kyPxJrw+UWqm8YNvqBO1AwvTZFrMuYKttK0Ytf yvAWef7Df5QTtx+dYLABsY6hKGfAhLrk7n3j/rEqizXVKkT2plgPTZ7JOP1xT/kcv/r6llmF4pmX/ rUgcbG6fYiQxoykZFo8w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hTWwH-0006DR-DP; Wed, 22 May 2019 19:30:13 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hTWwE-0006Bg-8j for linux-arm-kernel@lists.infradead.org; Wed, 22 May 2019 19:30:11 +0000 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 34042217D4; Wed, 22 May 2019 19:30:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558553410; bh=f00Z042OxVO1lpGglNkqwDzP9Wehwz5cJyphswOCSj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AjIClk0dEqX6DgKVOAdpBcoFy9bVu9UCiZ49YcPkTyjMUJrkZF3BpCm7vMXMcwvct RmB1qEyNtfqzOTPcdOKmIkHRb3I5dhx5D9rkrHZLzU3zqji8KRlMzUR14tdiKxc8vQ AUVj+Wy6Vz69ATP3OUvSUBfshF3ntCCRoKhleHjA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 058/167] dmaengine: at_xdmac: remove BUG_ON macro in tasklet Date: Wed, 22 May 2019 15:26:53 -0400 Message-Id: <20190522192842.25858-58-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190522192842.25858-1-sashal@kernel.org> References: <20190522192842.25858-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190522_123010_319710_ABCB65A6 X-CRM114-Status: GOOD ( 11.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , Ludovic Desroches , Vinod Koul , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Nicolas Ferre [ 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 4db2cd1c611de..22764cd30cc39 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel