From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753255Ab2ASMcv (ORCPT ); Thu, 19 Jan 2012 07:32:51 -0500 Received: from mx3.mail.elte.hu ([157.181.1.138]:32913 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751075Ab2ASMcr (ORCPT ); Thu, 19 Jan 2012 07:32:47 -0500 Date: Thu, 19 Jan 2012 13:32:23 +0100 From: Ingo Molnar To: Kay Sievers Cc: Alan Stern , "Luck, Tony" , Greg KH , Linus Torvalds , "Rafael J. Wysocki" , "Srivatsa S. Bhat" , Sergei Trofimovich , "linux-kernel@vger.kernel.org" , Linux PM mailing list , Borislav Petkov , "tglx@linutronix.de" , "prasad@linux.vnet.ibm.com" , Ming Lei , Djalal Harouni , Borislav Petkov , Hidetoshi Seto , Andi Kleen , "gouders@et.bocholt.fh-gelsenkirchen.de" , Marcos Souza , "justinmattock@gmail.com" , Jeff Chua Subject: Re: [PATCH] mce: fix warning messages about static struct mce_device Message-ID: <20120119123223.GD3936@elte.hu> References: <3908561D78D1C84285E8C5FCA982C28F01CF24@ORSMSX104.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.3.1 -2.0 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Kay Sievers wrote: > > There's nothing special about the driver model code in this > > respect. The same restriction applies wherever object > > lifetimes are controlled by reference counting. > > Right. But it might not be obvious what 's the background > here: > > An allocated device object(memory) usually represents an > actual device(hardware). The object can have N users. Every of > the users is required to take a reference to the object, which > pins the object's memory as long as any of the N users might > need to access it. > > In a hotplug world, we deal with device-removal. On > disconnect, we usually just orphan the object, we remove it > from visibility, disconnect the device <-> object relation. > > All of the N users with a reference can still access the > memory, they just do not talk to a real device anymore. The > invalidated/orphaned state is communicated otherwise by locks > and flags in the device object. Only after all of the N users > left the object alone, the memory of the orphan if free'd. But this is not what happened here - it's a special piece of fundamental hardware that doesnt hot-plug separately from the CPU and that has just a single "user". So i'm curious, why wasn't the memset() enough? It should have resolved the bug AFAICS. Thanks, Ingo