Re: edac_core: crashes on shutdown

Florian Mickler
2010-12-02T18:15:09Z

On Thu, 2 Dec 2010 18:06:10 +0100
Borislav Petkov <bp@amd64.org> wrote:

> From: Borislav Petkov <borislav.petkov@amd.com>
> Date: Thu, 2 Dec 2010 17:48:35 +0100
> Subject: [PATCH] EDAC: Fix workqueue-related crashes
>
> 00740c58541b6087d78418cebca1fcb86dc6077d changed edac_core to
> un-/register a workqueue item only if a lowlevel driver supplies a
> polling routine. Normally, when we remove a polling low-level driver,
> we go and teardown the workqueue and cancel all the queued work.
> However, the workqueue unreg happens based on the ->op_state setting,
> and edac_mc_del_mc() sets this to OP_OFFLINE _before_ we cancel the work
> item, leading to NULL ptr oops on the workqueue list.
>
> Fix it by putting the unreg stuff in proper order.

Yes. That should work. Once we stopped the workqueue and removed it
from the global list, do we actually need to set it to OP_OFFLINE?

Also 00740c585 did fix a hang in edac_mc.c... could this also
happen in the edac_device_del_device/edac_pci_del_device functions?

Regards,
Flo