mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Patrick Mochel <mochel@osdl.org>,
	kernel list <linux-kernel@vger.kernel.org>,
	torvalds@transmeta.com
Subject: Messing up driver model API
Date: Wed, 11 Jun 2003 22:36:52 +0200	[thread overview]
Message-ID: <20030611203652.GA599@elf.ucw.cz> (raw)

Hi!

So you just had to mess it up... Having suspend(device *, state,
level) might be bad, but having suspend(device *, state, level) in one
piece of code and {suspend,save}(device *, state) is *way* worse. (And
I did not see any proposal on l-k. I hope I just missed it).

So are you going to revert it or convert whole driver model to use
{suspend,save}(device *, state)?
									Pavel

[driver model] Add save() and restore() methods for system device drivers. 

It turns out that at least some system device drivers need to allocate 
memory and/or sleep for one reason or another when either saving or 
restoring state. 

Instead of adding a 'level' paramter to the suspend() and resume() methods,
which I despise and think is a horrible programming interface, two new 
methods have been added to struct sysdev_driver:

        int     (*save)(struct sys_device *, u32 state);
        int     (*restore)(struct sys_device *);

that are called explicitly before and after suspend() and resume() 
respectively, with interrupts enabled. This gives the drivers the
flexibility to allocate memory and sleep, if necessary. 

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

             reply	other threads:[~2003-06-11 20:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-11 20:36 Pavel Machek [this message]
2003-06-11 21:21 ` Patrick Mochel
2003-06-12 10:41   ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030611203652.GA599@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®