Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966219Ab3E2NnB (ORCPT ); Wed, 29 May 2013 09:43:01 -0400 Received: from mail-la0-f42.google.com ([209.85.215.42]:33011 "EHLO mail-la0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759586Ab3E2Nm6 (ORCPT ); Wed, 29 May 2013 09:42:58 -0400 MIME-Version: 1.0 In-Reply-To: <51A5DEDC.4040606@nvidia.com> References: <1369656882-25241-1-git-send-email-andriy.shevchenko@linux.intel.com> <1369656882-25241-10-git-send-email-andriy.shevchenko@linux.intel.com> <51A5DEDC.4040606@nvidia.com> Date: Wed, 29 May 2013 16:42:56 +0300 Message-ID: Subject: Re: [PATCH 09/12] tegra20-apb-dma: remove useless use of lock From: Andy Shevchenko To: Laxman Dewangan Cc: Andy Shevchenko , "linux-kernel@vger.kernel.org" , Vinod Koul , Dan Williams , Stephen Warren , "linux-tegra@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1022 Lines: 25 On Wed, May 29, 2013 at 1:56 PM, Laxman Dewangan wrote: > On Monday 27 May 2013 05:44 PM, Andy Shevchenko wrote: >> >> Accordingly to dma_cookie_status() description locking is not required. >> > I think we need lock here: > From isr handler, we call dma_cookie_complete() which is in spin-locked. > This function updates tx->chan->completed_cookie = tx->cookie; > In tegra_dma_tx_status(), we check for dma_cookie_status() which access the > chan->completed_cookie; and it decides status based on this > > As the access of chan->completed_cookie are from different context, we > need this locking. You need to have a consistent data in the cookies. This is guaranteed by memory barrier if I got it correctly. -- With Best Regards, Andy Shevchenko -- 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/