Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755378Ab1F2Pbm (ORCPT ); Wed, 29 Jun 2011 11:31:42 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:53911 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753085Ab1F2Pbk convert rfc822-to-8bit (ORCPT ); Wed, 29 Jun 2011 11:31:40 -0400 MIME-Version: 1.0 In-Reply-To: References: <1308640714-17961-1-git-send-email-ohad@wizery.com> <1308640714-17961-3-git-send-email-ohad@wizery.com> <20110627210007.GC20865@ponder.secretlab.ca> From: Grant Likely Date: Wed, 29 Jun 2011 09:31:19 -0600 X-Google-Sender-Auth: TZmMGJwNBS69Tho537T3WeYfpw0 Message-ID: Subject: Re: [RFC 2/8] remoteproc: add omap implementation To: Ohad Ben-Cohen Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, akpm@linux-foundation.org, Brian Swetland , Arnd Bergmann , davinci-linux-open-source , Rusty Russell , "Guzman Lugo, Fernando" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1547 Lines: 33 On Wed, Jun 29, 2011 at 9:04 AM, Ohad Ben-Cohen wrote: > On Tue, Jun 28, 2011 at 12:00 AM, Grant Likely > wrote: >> Very little for me to comment on here. ?However, something I just >> noticed. ?Why is it necessary to pass in THIS_MODULE to the >> rproc_register function? ?Having a reference to the pdev gives you the >> pointer to the driver, which has the THIS_MODULE value in it. ?That >> should be sufficient. > > Nice one, thanks ! > >> /me also isn't sure if incrementing the refcount on the module is the >> best way to prevent the rproc from going away, but I haven't dug into >> the details in the driver code to find out. ?Drivers can get unbound >> from devices without the driver being unloaded, so I imagine there is >> an in-use count on the device itself that would prevent driver >> unbinding. > > Yes, increasing the module refcount is necessary to prevent the user > from removing the driver when the rproc is used. That prevents removing the module which necessitates unbinding the device. However, I believe it is possible to unbind a driver /without/ the module being unloaded. My question (for which I don't have an answer) is whether or not there is a way to increment a refcount on users of the driver bound to the device.. g. -- 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/