From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965580AbXCGQ4J (ORCPT ); Wed, 7 Mar 2007 11:56:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965587AbXCGQ4J (ORCPT ); Wed, 7 Mar 2007 11:56:09 -0500 Received: from smtp.osdl.org ([65.172.181.24]:43366 "EHLO smtp.osdl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965580AbXCGQ4G (ORCPT ); Wed, 7 Mar 2007 11:56:06 -0500 Date: Wed, 7 Mar 2007 08:52:18 -0800 (PST) From: Linus Torvalds To: Dmitry Torokhov cc: Hugh Dickins , Oliver Neukum , Maneesh Soni , Greg Kroah-Hartman , Adrian Bunk , linux-kernel@vger.kernel.org Subject: Re: 2.6.21-rc suspend regression: sysfs deadlock In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Mar 2007, Dmitry Torokhov wrote: > > ... with the exception that it will again make data associated with > sysfs attributes accessible past the point of returning from > sysfs_remove_file. And that was the point so drivers would not have to > care about handling access to extra data (such as static strings) past > the driver unload. Drivers are unloaded by stopping the whole machine (exactly because module unload is otherwise so hard to handle), so that never happens unless you actively block. In other words, if you do something as simple as if (inode->i_private_data) sysfs_flush_buffer(buffer); then there is no race with unloading (unless the driver itself does something stupid, of course - but the whole point of having a kernel buffer is so that it does *not* have to make user accesses etc). But the one thing you should *not* do is to depend on a sleeping lock, because that breaks the whole model! Linus