Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753137AbbKAU12 (ORCPT ); Sun, 1 Nov 2015 15:27:28 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:41892 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751615AbbKAU1Z (ORCPT ); Sun, 1 Nov 2015 15:27:25 -0500 Subject: Re: [PATCH 2/2] dma: add Qualcomm Technologies HIDMA channel driver To: Timur Tabi , Arnd Bergmann References: <1446174501-8870-1-git-send-email-okaya@codeaurora.org> <5741892.rRLhcI7KQG@wuerfel> <5633E442.3010003@codeaurora.org> <4552697.VhjWnxQoIo@wuerfel> <56365F0D.6010508@codeaurora.org> <56367433.60806@codeaurora.org> Cc: dmaengine@vger.kernel.org, cov@codeaurora.org, jcm@redhat.com, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Vinod Koul , Dan Williams , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org From: Sinan Kaya Message-ID: <5636759A.4040506@codeaurora.org> Date: Sun, 1 Nov 2015 15:27:06 -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: <56367433.60806@codeaurora.org> 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: 1330 Lines: 37 On 11/1/2015 3:21 PM, Timur Tabi wrote: > Sinan Kaya wrote: >> However, after issuing the command; I still need to wait some amount of >> time until hardware acknowledges the commands like reset/enable/disable. >> These are relatively faster operations happening in microseconds. That's >> why, I have mdelay there. > > Can you use readl_poll_timeout()? > Yes, I'm changing them to readl_poll_timeout after looking at the workqueue vs. expected delay requirements. I decided to stick with polled read. First, I missed the point here that mdelay is discouraged. https://www.kernel.org/doc/Documentation/timers/timers-howto.txt According to same document, msleep can sleep up to 20ms which is not what I want. This code is trying to sleep 10ms maximum and treating longer durations as failures. readl_poll_timeout calls usleep_range that seems to satisfy what I'm looking for. -- 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/