From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932594Ab2AISDe (ORCPT ); Mon, 9 Jan 2012 13:03:34 -0500 Received: from bues.ch ([80.190.117.144]:46242 "EHLO bues.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932330Ab2AISDd (ORCPT ); Mon, 9 Jan 2012 13:03:33 -0500 Date: Mon, 9 Jan 2012 19:03:21 +0100 From: Michael =?UTF-8?B?QsO8c2No?= To: Alan Stern Cc: Joerg Roedel , Konrad Rzeszutek Wilk , Martin Schwidefsky , Dmitry Torokhov , Kernel development list Subject: Re: Incorrect uses of get_driver()/put_driver() Message-ID: <20120109190321.537038bc@milhouse> In-Reply-To: References: X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.8; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 9 Jan 2012 12:35:09 -0500 (EST) Alan Stern wrote: > drivers/ssb/main.c:146: get_driver(&drv->drv); > drivers/ssb/main.c:153: put_driver(&drv->drv); > > Michael, these are part of ssb_driver_get() and ssb_driver_put(), used > in ssb_devices_freeze() and ssb_devices_thaw(). They don't currently > do anything, but it looks as if they are meant to prevent the driver > from being unloaded. Should they be replaced with try_module_get()? > Or would it be good enough to call device_attach() in > ssb_devices_thaw()? Hm, It seems that this code is trying to pin the ssb_driver, so that it doesn't become invalid during the freeze period. So it most likely wants to protect against module unload and driver unbind here. Not sure if that actually works, though :/ -- Greetings, Michael.