Re: [PATCH] fix tulip suspend/resume

From: Adam Belay (abelay_at_novell.com)
Date: 06/09/05

  • Next message: serue_at_us.ibm.com: "[patch 5/11] lsm stacking: actual stacker module"
    To: Pavel Machek <pavel@suse.cz>
    Date:	Wed, 08 Jun 2005 20:38:27 -0400
    
    

    On Thu, 2005-06-09 at 02:04 +0200, Pavel Machek wrote:
    > Hi!
    >
    > > > > I think we should also use the pm_message_t defines. We will need to
    > > > > add PMSG_FREEZE eventually. I decided to default to the current state
    > > > > rather than panic. Does this patch look ok?
    > > >
    > > > No.
    > >
    > > Hrm... I don't follow you anymore here ...
    > >
    > > > case PM_EVENT_ON:
    > > > return PCI_D0;
    > > > case PM_EVENT_FREEZE:
    > > > case PM_EVENT_SUSPEND:
    > > > return PCI_D3hot;
    > >
    > > What are these new PM_EVENT_* things ? I though we defined PMSG_* ?
    >
    > PMSG_* are for struct; you can't case on struct.
    >
    > > > You passed invalid argument; I see no reason why you should paper over
    > > > it and risk continuing. This happens during system suspend; it is
    > > > quite possible that user will not see your printk when machine powers
    > > > off just after that; and remember that it will not be in syslog after
    > > > resume.
    > >
    > > Crap. I don't think a BUG() makes any useful help neither in this place,
    > > and when I locally turn PMSG_FREEZE to something sane I suddenly blow up
    > > in there (and I wonder in how many other places).
    >
    > At least you can see & report that error... That would not be a case
    > for simple printk.

    Well not exactly. The video device may have already been disabled, so
    the user wouldn't see it anyway. The reason I don't like BUG() here is
    that it's very unlikely passing an invalid PMSG will have serious
    consequences. The problems are likely less significant than those
    caused by calling BUG(). Many suspend routines don't set power at all
    yet (e.g. cardbus) and it still works out fine. Defaulting to the
    current state seems like a very safe behavior. Then, after resume, we
    can see the messages. I'd like to see PM just work, and we have to be
    careful during an API change.

    >
    > This is the patch I'd like to go in. I hope it makes it
    > clear... Please base your development on top of this one...

    Yeah, I wasn't sure where those flags were coming from...

    Thanks,
    Adam

    > Pavel
    >
    > ---
    >
    > Turn pm_message_t into struct, so that it is typechecked properly (and
    > so that we can add flags field in future). This should not go in
    > before 2.6.12.

    What do you have in mind for adding to the structure in the future?

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


  • Next message: serue_at_us.ibm.com: "[patch 5/11] lsm stacking: actual stacker module"

    Relevant Pages

    • Re: AGP problem SiS 746FX Linux 2.6.5-rc3
      ... the Empire squashes the Federation like a bug. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.9bk6 msdos fs OOPS
      ... >This bug is triggered by race condition. ... Apparently my lashup doesn't trigger it. ... Copyright 2004 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch 0/3] j_state_lock, j_list_lock, remove-bitlocks
      ... BUG: Unable to handle kernel NULL pointer dereference at virtual address ... TAS_BUFFER_FNS(RevokeValid, revokevalid) ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: BUG at mm/memory.c:1501 in 2.6.0-test5
      ... >Any module running inside the kernel can destroy anything. ... A simple bug in any ... You should send your report to the vendor. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: kernel BUG at page_alloc.c
      ... Marcelo Tosatti wrote: ... > Its the third or fourth report like this I see, ... CONFIG_GRKERNSEC_PAX_MPROTECT) and i don't remember seeing such BUG... ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)