Re: [PATCH] mce: fix warning messages about static struct mce_device

From: Ingo Molnar
Date: Thu Jan 19 2012 - 07:32:47 EST



* Kay Sievers <kay.sievers@xxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/