Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755559AbbKCQ2a (ORCPT ); Tue, 3 Nov 2015 11:28:30 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:57350 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755079AbbKCQ2X (ORCPT ); Tue, 3 Nov 2015 11:28:23 -0500 Subject: Re: [PATCH V2 2/3] dmaselftest: add memcpy selftest support functions To: Vinod Koul , Timur Tabi References: <1446444460-21600-1-git-send-email-okaya@codeaurora.org> <1446444460-21600-3-git-send-email-okaya@codeaurora.org> <20151103041528.GS21326@localhost> <5638359D.9080507@codeaurora.org> <5638C55D.50001@codeaurora.org> <20151103161013.GE12910@localhost> Cc: dmaengine@vger.kernel.org, cov@codeaurora.org, jcm@redhat.com, Dan Williams , linux-kernel@vger.kernel.org From: Sinan Kaya Message-ID: <5638E0A5.4060401@codeaurora.org> Date: Tue, 3 Nov 2015 11:28:21 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151103161013.GE12910@localhost> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1792 Lines: 46 On 11/3/2015 11:10 AM, Vinod Koul wrote: > On Tue, Nov 03, 2015 at 08:31:57AM -0600, Timur Tabi wrote: >> Sinan Kaya wrote: >>> >>> Almost all DMA engine drivers come with some sort of selftest code >>> called from probe. I followed the same design pattern. >> >> As others have said, it appears that's outdated. >> >> Is there a real possibility that the hardware could fail the test >> without trashing the system? It seems that if the DMA engine is >> faulty, it won't "politely" fail. The whole system will crash or >> some memory will get corrupted and you won't know it. > > Failing politely would be right thing to do. If DMA starts sending data to > anywhere in system memory due to bug or wrong addresses we can't do > anything to prevent that > I have seen failures in three cases so far. These are the reasons, why I want to keep these runtime tests around. 1. Bug in ARM64 DMA subsystem. 2. Bug in IOMMU driver. 3. Bug in another newly introduced driver. The new driver would hog the CPU and won't allow HIDMA interrupts to execute. Therefore, the test times out. In my code, when test fails; I abort all transactions in flight and shutdown and deregister the HIDMA driver. Of course, there is a small window of oppurtunity; where DMA can dump data to incorrect place if HW was faulty right before I abort the transaction. -- Sinan Kaya Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/