Re: [PATCH] ohci1394: dma_pool_destroy while in_atomic() &&irqs_disabled()

From: Andrew Morton
Date: Sun Jan 30 2005 - 18:03:54 EST


Parag Warudkar <kernel-stuff@xxxxxxxxxxx> wrote:
>
> Andrew Morton wrote:
>
> ...
> >- We'll need a flush_workqueue() in the teardown function for that data
> > structure to ensure that any pending callbacks have completed before we
> > free the storage.
> >
> >
> By saying flush_workqueue did you intend to suggest using separate work
> queue for ohci1394?

No. Using keventd and flush_scheduled_work() should be OK in this
application. rmmod isn't very common.

> > Care needs to be taken to ensure that the work_struct is suitably
> > initialised so that the flush_workqueue() will work OK even if the
> > callback has never been scheduled.
> >
> >
> Didn't understand this one - Is this about properly NULL'ing elements
> in work queue so flush_workqueue doesn't touch them? Can you elaborate
> please?

Well, it's just that the shutdown code needs to run flush_scheduled_work()
or flush_workqueue() on a work_struct which may or may not have been used.
So we need to ensure that it has sane contents. Just run INIT_WORK() on it
in the setup code.

-
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/