Re: [PATCH] Provide refrigerator support for irda

Pavel Machek (pavel@suse.cz)
Wed, 25 Jun 2003 20:45:10 +0200


Hi!

> > > Without this patch, kIrDAd prevents my notebook from entering suspend
> > > mode.
>
> Are you talking about normal apm or acpi suspend or this swsusp
> thing?

ACPI and swsusp uses same mechanism. apm is different.

> > Wow ! I knew about microwave for 802.11b, but not about
> > refrigerator for IrDA.
>
> Inclined to say "me too".

:-).

> > The man for sir_kthread is Martin Diehl. He is much more
> > intimate with kernel tasks than me, and he has other sir_dev updates
> > in the pipeline.
>
> Admittedly I didn't care about swsusp so far. Given the big fat warning on
> top of Documentation/swsusp.txt I would not even try and i personally
> don't see what I would miss without swsusp.

That's okay... Just support your DMA-ing devices are supported.

> But of course, if we can make all parties happy, why not.
>
> > > + if (current->flags & PF_FREEZE)
> > > + refrigerator(PF_IOTHREAD);
> > > +
>
> I've tried to find some documentation about this - without success. So I
> have no idea why this might be needed and what it will do. Grepping for
> other kernel threads it looks like most of them use the same two lines.
> OTOH the irda thread is very similar to keventd's workqueue which do not
> use this. Not sure about the reason.

> Well, I'm thinking about making the irda thread using workqueue anyway, in
> which case the issue would either disappear or get shifted to
> kernel/workqueue.c.

> For the meantime, I think we should apply this if somebody would explain
> what's going on here.

We need kernel thread to sleep at defined place. Process running
userspace can be stopped any time, but processes running in kernel can
be only stopped at defined places, to avoid unexpected surprises.

If it is possible to sleep at place "a", and no locks needed for
suspend are held at "a", inserting

if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);

is the right thing to do.
Pavel

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/