From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756041AbbKCVHk (ORCPT ); Tue, 3 Nov 2015 16:07:40 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:46697 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755304AbbKCVHh (ORCPT ); Tue, 3 Nov 2015 16:07:37 -0500 Subject: Re: [PATCH 2/2] dma: add Qualcomm Technologies HIDMA channel driver To: Arnd Bergmann References: <1446174501-8870-1-git-send-email-okaya@codeaurora.org> <17979873.Bg2pv5SLy6@wuerfel> <56384623.80305@codeaurora.org> <4135705.fKCjnZtDgZ@wuerfel> Cc: dmaengine@vger.kernel.org, timur@codeaurora.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: <56392216.8050305@codeaurora.org> Date: Tue, 3 Nov 2015 16:07:34 -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: <4135705.fKCjnZtDgZ@wuerfel> 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 On 11/3/2015 5:43 AM, Arnd Bergmann wrote: > Ok, got it. > > Best add an explanation like the above in the interrupt handler, > to prevent this from accidentally getting 'cleaned up' to use > readl(), or copied into a driver that uses PCI ordering rules > where it is actually wrong. > I'm adding this disclaimer into the ISR routine. /* * Fine tuned for this HW... * * This ISR has been designed for this particular hardware. Relaxed read * and write accessors are used for performance reasons due to interrupt * delivery guarantees. Do not copy this code blindly and expect * that to work. */ > I think it should be done like this: > > - anything that is not performance critical, use normal readl/writel > - in the fast path, add a comment to each readl_relaxed()/writel_relaxed() > that is safe in this driver but that would not be safe in a PCI > device > - For the ones that would be safe on PCI as weel, use > readl_relaxed()/writel_relaxed() without a comment on each one, > but clarify somewhere that these are all intentional. Makes sense. -- 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