Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752075AbdFMI6v (ORCPT ); Tue, 13 Jun 2017 04:58:51 -0400 Received: from mail-ua0-f180.google.com ([209.85.217.180]:36313 "EHLO mail-ua0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751753AbdFMI6s (ORCPT ); Tue, 13 Jun 2017 04:58:48 -0400 MIME-Version: 1.0 In-Reply-To: References: <1496916298-5909-1-git-send-email-binoy.jayan@linaro.org> <1496916298-5909-2-git-send-email-binoy.jayan@linaro.org> From: Binoy Jayan Date: Tue, 13 Jun 2017 14:28:47 +0530 Message-ID: Subject: Re: [PATCH 1/3] media: ngene: Replace semaphore cmd_mutex with mutex To: Arnd Bergmann Cc: Linux Kernel Mailing List , Rajendra , Mark Brown , Mauro Carvalho Chehab , Sakari Ailus , Julia Lawall , "Michael S. Tsirkin" , Cao jin , Linux Media Mailing List 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: 834 Lines: 23 Hi Arnd, On 9 June 2017 at 16:06, Arnd Bergmann wrote: >> Thank you for pointing out that. I'll check the >> concurrency part. By the way why do we need mutex_destoy? >> To debug an aberrate condition? > > At first I suspected the down() here was added for the same > purpose as a mutex_destroy: to ensure that we are in a sane > state before we free the device structure, but the way they > achieve that is completely different. > > However, if there is any way that a command may still be in > progress by the time we get to ngene_stop(), we may also > be lacking reference counting on the ngene structure here. > So far I haven't found any of those, and think the mutex_destroy() > is sufficient here as a debugging help. I've made the necessary changes. Thank you for reviewing all the patches. Regards, Binoy