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: 10037027 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 E2FC6603B5 for ; Wed, 1 Nov 2017 19:50:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3A792859F for ; Wed, 1 Nov 2017 19:50:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C63E7289A5; Wed, 1 Nov 2017 19:50:14 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B55F2859F for ; Wed, 1 Nov 2017 19:50:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755092AbdKATuN (ORCPT ); Wed, 1 Nov 2017 15:50:13 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:48806 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751587AbdKATuN (ORCPT ); Wed, 1 Nov 2017 15:50:13 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BFE3160600; 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 Cc: timur@codeaurora.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 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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 ?