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: 10038709 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 92F73602D8 for ; Thu, 2 Nov 2017 12:54:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84CB928F74 for ; Thu, 2 Nov 2017 12:54:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79B3028F76; Thu, 2 Nov 2017 12:54:19 +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 098FB28F74 for ; Thu, 2 Nov 2017 12:54:19 +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=Fyv7mzISSLvNEqvGNr2a6LV/jMjkRTNSz9GaWwBmy/w=; b=nFB nJoRe+V0PgMz4JUnM2KSrMSiPORANT1bG/SNcbfd4/4zVf7VPSuK19gI+wkV++Y+jtm9oD773XB+K j4C5tiHT7BrJNeBEN+jJmtuz5L+w7XiK2JqkiYnDxf29NTRvrf4e8Tkv+mucn/qDIpVgv+dN3hc7J kbAXPETEOPa7CAww+dK2bJZnoiO26b3+kAdFg8uLTbQZzRPgm69eg08jnOnI3QjF4KUAl/5Wm/ht3 gM3TQK5sfvErBoHCU6VQikrMoNjlD5gvyUzzY/dGLQU60ig97M19KzGL55NIboMAuw/V93lqJuID5 NfXsgVGOVMcOEY00YoqDpKyfIpDr/AA==; 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 1eAF0i-0002Tq-Ox; Thu, 02 Nov 2017 12:54:16 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eAF0e-0002Qs-1s for linux-arm-kernel@lists.infradead.org; Thu, 02 Nov 2017 12:54:14 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 63AA0600CE; 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171102_055412_177226_088D7294 X-CRM114-Status: GOOD ( 12.99 ) 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 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);