From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753914AbbGISZy (ORCPT ); Thu, 9 Jul 2015 14:25:54 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:54776 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753691AbbGISZq (ORCPT ); Thu, 9 Jul 2015 14:25:46 -0400 Date: Thu, 9 Jul 2015 12:25:25 -0600 From: Jason Gunthorpe To: Jens Wiklander Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Herbert Xu , valentin.manea@huawei.com, jean-michel.delorme@st.com, emmanuel.michel@st.com, javier@javigon.com, Mark Rutland , Michal Simek Subject: Re: [PATCH v4 3/5] tee: generic TEE subsystem Message-ID: <20150709182525.GA27758@obsidianresearch.com> References: <1436350592-7732-1-git-send-email-jens.wiklander@linaro.org> <1436350592-7732-4-git-send-email-jens.wiklander@linaro.org> <20150708171026.GA11740@obsidianresearch.com> <20150709124908.GA27483@ermac> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150709124908.GA27483@ermac> User-Agent: Mutt/1.5.23 (2014-03-12) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.192 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 09, 2015 at 02:49:08PM +0200, Jens Wiklander wrote: > > Generally in a scheme like this we'd see open and release get/put the > > underlying module handle to prevent driver removal while the char dev > > is open. Otherwise module removal will hang here. > > I'm perhaps misunderstanding you. While the cdev has any open file > descriptors rmmod will fail with "Resource temporarily unavailable" > because of fops_get() in chrdev_open(). Hmm, I see, you've done this: + cdev_init(&teedev->cdev, &tee_fops); + teedev->cdev.owner = teedesc->owner; And owner here is the driver module? Interesting.. Looks OK.. Jason