From patchwork Wed Nov 1 19:49:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Wallis X-Patchwork-Id: 10037029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 96D6C603B5 for ; Wed, 1 Nov 2017 19:50:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8755D2859F for ; Wed, 1 Nov 2017 19:50:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A679289A5; Wed, 1 Nov 2017 19:50:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0623C2859F for ; Wed, 1 Nov 2017 19:50:38 +0000 (UTC) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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:In-Reply-To: References:List-Owner; bh=lOIeGKDQ7IjlWe2aQ+PUi4MsGzh6AdgQmzZiyheCZYc=; b=iaH ySCOhNDc5ElZE5o3MtRI1rRLZOne6vS9KSSdyLAkKnNJzdlikHI9W6GLwa0aO9/EaTbllPk+OzIHY EkEkByv7TrC1Uy1W+6gu8U5PE9sBnhomINJFeqmsFdUOiQWy3F0GN5XHn5gKnWgeJe/orMCLx8Oeb cLiDWNMVO1VlSuM1H10QSqk5CMcRv6p9XL6tzBnTRKZdtXKPQd0d7xSve4Qzw3S5AYv9u25zv8AwT 9V0hyT2D1RAxOEsCxH0Y88YZOinJbCUVIn2EQV9SBPvHxhHzd81LO6/DdlY6NrRrmK1thRBMW1jax zUX+YPDfrH6YltLWH3eGOPXTTSAgcaQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e9z26-0000U2-DG; Wed, 01 Nov 2017 19:50:38 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e9z22-0000RI-Kz for linux-arm-kernel@lists.infradead.org; Wed, 01 Nov 2017 19:50:36 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EAB126044E; Wed, 1 Nov 2017 19:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1509565812; bh=5SY6OzImXgK0T3rLeGAfejefhqPlFGzE3iCXNPEY99I=; h=From:To:Cc:Subject:Date:From; b=YCR/onn4/+6p+bRecQBvk89LdcGuENPeJ81wV4Z6TCGSrbk2Y+v9MmVeFuBekeWcV gZg/VWstZ4u+WjVTQResqXr8QPppCyeUrEzsKiZ7kmzJnw1k57UBnN0UomFleQLmHD 0K0NimDdWf6fwuZAT5vwt0tX6WizPluBP/tRIv2Q= Received: from chromaggus.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: awallis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id A3AC46044E; Wed, 1 Nov 2017 19:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1509565812; bh=5SY6OzImXgK0T3rLeGAfejefhqPlFGzE3iCXNPEY99I=; h=From:To:Cc:Subject:Date:From; b=YCR/onn4/+6p+bRecQBvk89LdcGuENPeJ81wV4Z6TCGSrbk2Y+v9MmVeFuBekeWcV gZg/VWstZ4u+WjVTQResqXr8QPppCyeUrEzsKiZ7kmzJnw1k57UBnN0UomFleQLmHD 0K0NimDdWf6fwuZAT5vwt0tX6WizPluBP/tRIv2Q= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A3AC46044E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=awallis@codeaurora.org From: Adam Wallis To: linux-arm-kernel@lists.infradead.org, Vinod Koul , Dan Williams , Sinan Kaya , dmaengine@vger.kernel.org Subject: [PATCH] dmaengine: dmatest: bug out when dma test times out Date: Wed, 1 Nov 2017 15:49:57 -0400 Message-Id: <1509565797-5219-1-git-send-email-awallis@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171101_125034_717506_97383B94 X-CRM114-Status: GOOD ( 13.08 ) 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: timur@codeaurora.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Commit adfa543e7314 ("dmatest: don't use set_freezable_with_signal()") introduced a bug (that is in fact documented by the patch commit text) that leaves behind a dangling pointer. Since the done_wait structure is allocated on the stack, future invocations to the DMATEST can produce undesirable results (e.g., corrupted spinlocks). Ideally, this would be cleaned up in the the thread handler, but at the very least, the kernel is left in a very precarious scenario that can lead to some long debug sessions when the crash comes later. This bug has also been captured at https://bugzilla.kernel.org/show_bug.cgi?id=197605 Signed-off-by: Adam Wallis --- drivers/dma/dmatest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index 34ff532..95c662f 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -706,7 +706,7 @@ static int dmatest_func(void *data) result("test timed out", total_tests, src_off, dst_off, len, 0); failed_tests++; - continue; + BUG(); } else if (status != DMA_COMPLETE) { dmaengine_unmap_put(um); result(status == DMA_ERROR ?