From patchwork Thu Nov 2 12:53:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Wallis X-Patchwork-Id: 10038707 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 55388602D8 for ; Thu, 2 Nov 2017 12:53:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 456AC28F70 for ; Thu, 2 Nov 2017 12:53:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3810628F6F; Thu, 2 Nov 2017 12:53:53 +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 A2A5128F6F for ; Thu, 2 Nov 2017 12:53:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755395AbdKBMxw (ORCPT ); Thu, 2 Nov 2017 08:53:52 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:56662 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755382AbdKBMxv (ORCPT ); Thu, 2 Nov 2017 08:53:51 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 54526607B5; Thu, 2 Nov 2017 12:53:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1509627231; bh=RkgBOpwPdWN5gdKQ7Rab/mQbc5DHhftzK+V4bv11yTU=; h=From:To:Cc:Subject:Date:From; b=PLV6MWmu/7mQU03Oq3ktpBJzijJZXCkNqYat+Q39c3bp94tyo09F9k5xFsQdUxpBZ h142y6Y2fwxICjyTod8HmVrhznQc+KQWf9MfvdDjYkzRN8UHWY+ZismBmnSo7kg0m3 NHzK4fMx9KXCCFoRsBDAdnPu0do4c0+mPXwmI3Zo= 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 0F98C600CE; Thu, 2 Nov 2017 12:53:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1509627230; bh=RkgBOpwPdWN5gdKQ7Rab/mQbc5DHhftzK+V4bv11yTU=; h=From:To:Cc:Subject:Date:From; b=GZJDOT0g4mVQZSuZbYrRYr4RA1E6S98BuM4xkyn0E2U4bMeMVctebH1t/9VQIN9XP 5vfifIvWwIHTQ3ekFgEmBvcldA/f+g5jgCLGIrnDWbEIzGua+a8UMOahjpFEsxQhOo cqSo5pihJPirPduStIiFdQN3t5HRjHNKW6wi4D0c= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0F98C600CE 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 v2] dmaengine: dmatest: warn user when dma test times out Date: Thu, 2 Nov 2017 08:53:30 -0400 Message-Id: <1509627210-16904-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 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 --- changes from v1: No longer using BUG at request of Vinod drivers/dma/dmatest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index 34ff532..47edc7f 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -702,6 +702,7 @@ static int dmatest_func(void *data) * free it this time?" dancing. For now, just * leave it dangling. */ + WARN(1, "dmatest: Kernel stack may be corrupted!!\n"); dmaengine_unmap_put(um); result("test timed out", total_tests, src_off, dst_off, len, 0);