public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2005-hi6Y0CQ0nG0@public.gmane.org>
To: ncunningham-jjFNsPSvq+iXDw4h08c5KA@public.gmane.org
Cc: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>,
	ACPI List
	<acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [RFC] Reliable video POSTing on resume (was: Re: Samsung P35, S3, black screen (radeon))
Date: Fri, 04 Feb 2005 03:35:39 +0100	[thread overview]
Message-ID: <4202DF7B.2000506@gmx.net> (raw)
In-Reply-To: <1107474198.5727.9.camel-r49W/1Cwd2ff0s6lnCXPXw0QcLn3kwYh@public.gmane.org>

Hi!

Nigel Cunningham wrote:
> Hi.
> 
> On Fri, 2005-02-04 at 09:54, Pavel Machek wrote:
> 
>>Hi!
>>
>>
>>>>>Are you able to use framebuffer(radeonfb,1024x768) with this
>>>>>configuration or do you need to use plain vga-console for it to work?
>>>>
>>>>No.
>>>>For a working framebuffer console you would have to perform the steps
>>>>my script does *before* the kernel tries to access the framebuffer
>>>>console after resume. Since this is not yet possible, you're out of
>>>>luck. If
>>>>- the vbestate utility was a kernel module or
>>>
>>>OK, I managed to track this down further.
>>>"vbetool post" should be equivalent to "acpi_sleep=s3_bios", but there
>>>are some differences. For me, that's easy to explain: "vbetool post"
>>>segfaults because it wants to access parts of the video bios which
>>>are no longer available. "acpi_sleep=s3_bios" suffers from the same
>>>problem, but it runs in real mode and can't recover :-(
>>>
>>>To alleviate that problem, the kernel could run the video bios in
>>>vm86 mode (like vbetool does by using lrmi). This would simplify
>>>the asm wakeup code and make video POST more reliable.
>>>
>>>Pavel, what do you think?
>>
>>Well, calling BIOS using vm86 is going to be quite a lot of code. If
>>it is self-contained and not too huge, it is probably okay. It should
>>help with quite a lot of cards, but who knows...
>>
>>Yes, it is probably worth trying.
> 
> I'd love to see it too. Pavel, even if you don't want to merge it for a
> while, we can always incorporate it in the Suspend2 patches so it gets
> some testing. I know I'd try it on my i830 based Omnibook.

Can we use call_usermodehelper at this early resume stage (before any
video access)? Calling vm86 directly is probably not going to fly
because we want to be shielded from any misbehaviour in the bios code
and it may be necessary to kill the process running the bios code.

Cases in point: My bios will cause the POSTing application to segfault.
Others have reported the POSTing application just hangs, but the
important things are done before the hang, so killing it after maybe
5 seconds would be ok.

Rough outline how to do that without adding tons of code:
We need a call_usermodehelper_from_ram_with_timeout for that.

Kernel:                          Userspace:
User wants to enter S3
init_mutex_locked(s3_sem)
call_usermodehelper("vesaposter")
                                 vesaposter calls LRMI_init
                                 vesaposter mlocks all its memory
                                 vesaposter calls into kernel
                                          and down(s3_sem)
suspend vesafb

User has triggered resume
run wakeup.S
thaw essential threads
set a timer of 5 seconds
up(s3_sem)
thaw and schedule vesaposter
wait for timer or vesaposter termination
                                 vesaposter returns from kernel
                                 vesaposter posts video card
                                 vesaposter terminates
resume vesafb
continue resume

Problems with that approach:
- vesaposter has to be locked in memory to avoid disk accesses
- vesafb has to refrain from touching video until after POST
- the vesaposter thread has to be the first unfrozen and
  scheduled and completed thread. Only after that we can resume
  vesafb and other threads
- the locking will be tricky

Advantages:
- the problems all seem to be solvable easily
- security and stability are similar to the current userspace code
- we can use vesafb on such machines
- the kernel code won't be much more than two dozen lines
- the userspace POSTing code can be upgraded without the need
  for kernel updates (no policy in the kernel)

What do you think?


Regards,
Carl-Daniel
-- 
http://www.hailfinger.org/


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

  parent reply	other threads:[~2005-02-04  2:35 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-22 13:42 Samsung P35, S3, black screen (radeon) Nikolaus Filus
     [not found] ` <20050122134205.GA9354-u75qzGzWA6cb1SvskN2V4Q@public.gmane.org>
2005-02-03  1:46   ` Carl-Daniel Hailfinger
     [not found]     ` <4201825B.2090703-hi6Y0CQ0nG0@public.gmane.org>
2005-02-03  1:54       ` Matthew Garrett
2005-02-03  5:38       ` Stefan Schweizer
     [not found]         ` <e796392205020221387d4d8562-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-03 11:56           ` Matthew Garrett
2005-02-03 12:23           ` Carl-Daniel Hailfinger
     [not found]             ` <420217DB.709-hi6Y0CQ0nG0@public.gmane.org>
2005-02-03 22:45               ` Carl-Daniel Hailfinger
     [not found]                 ` <4202A972.1070003-hi6Y0CQ0nG0@public.gmane.org>
2005-02-03 22:54                   ` Pavel Machek
     [not found]                     ` <20050203225410.GB1110-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-02-03 23:43                       ` Nigel Cunningham
     [not found]                         ` <1107474198.5727.9.camel-r49W/1Cwd2ff0s6lnCXPXw0QcLn3kwYh@public.gmane.org>
2005-02-04  2:35                           ` Carl-Daniel Hailfinger [this message]
     [not found]                             ` <4202DF7B.2000506-hi6Y0CQ0nG0@public.gmane.org>
2005-02-04  2:51                               ` [RFC] Reliable video POSTing on resume (was: Re: [ACPI] Samsung P35, S3, black screen (radeon)) Nigel Cunningham
     [not found]                                 ` <1107485504.5727.35.camel-r49W/1Cwd2ff0s6lnCXPXw0QcLn3kwYh@public.gmane.org>
2005-02-04  7:18                                   ` [RFC] Reliable video POSTing on resume (was: " Jon Smirl
     [not found]                                     ` <9e4733910502032318460f2c0c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-04  7:44                                       ` Pavel Machek
     [not found]                                         ` <20050204074454.GB1086-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-02-04 17:38                                           ` Jon Smirl
     [not found]                                             ` <9e473391050204093837bc50d3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-05  0:52                                               ` [RFC] Reliable video POSTing on resume Carl-Daniel Hailfinger
     [not found]                                                 ` <420418C7.5010309-hi6Y0CQ0nG0@public.gmane.org>
2005-02-05  1:08                                                   ` Jon Smirl
2005-02-05  9:35                                               ` [RFC] Reliable video POSTing on resume (was: Re: Samsung P35, S3, black screen (radeon)) Pavel Machek
     [not found]                                                 ` <20050205093550.GC1158-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-02-05 11:35                                                   ` [RFC] Reliable video POSTing on resume Ondrej Zary
2005-02-06 16:02                                                   ` [RFC] Reliable video POSTing on resume (was: Re: [ACPI] Samsung P35, S3, black screen (radeon)) Alan Cox
2005-02-07  2:11                                                     ` Adam Sulmicki
     [not found]                                                       ` <Pine.BSF.4.62.0502062107000.26868-l0fCXZmbWQJ/Vb4cDf9RU/Z8FUJU4vz8@public.gmane.org>
2005-02-07 14:27                                                         ` [RFC] Reliable video POSTing on resume Paulo Marques
     [not found]                                                           ` <42077AC4.5030103-TSnNRl9vlf1Wk0Htik3J/w@public.gmane.org>
2005-02-07 14:36                                                             ` Carl-Daniel Hailfinger
     [not found]                                                               ` <42077CFD.7030607-hi6Y0CQ0nG0@public.gmane.org>
2005-02-07 15:39                                                                 ` Paulo Marques
2005-02-07 16:01                                                                 ` Pavel Machek
2005-02-07 16:20                                                                   ` Li-Ta Lo
     [not found]                                                                     ` <1107793204.2930.18.camel-fiEEBCSFsUl2jBC2uHMcnu1ftBKYq+Ku@public.gmane.org>
2005-02-11  1:47                                                                       ` Carl-Daniel Hailfinger
     [not found]                                                                         ` <420C68B3.4080509@scitechsoft.com>
     [not found]                                                                           ` <420CA2D2.6050003@gmx.net>
     [not found]                                                                             ` <420D08F2.3060505@scitechsoft.com>
     [not found]                                                                               ` <420D5481.1060402@gmx.net>
     [not found]                                                                                 ` <420D7B1B.3030503@scitechsoft.com>
     [not found]                                                                                   ` <421715EB.3020207@gmx.net>
     [not found]                                                                                     ` <42180D40.1020409@scitechsoft.com>
     [not found]                                                                                       ` <425907FC.6010504@gmx.net>
     [not found]                                                                                         ` <425907FC.6010504-hi6Y0CQ0nG0@public.gmane.org>
2005-05-10  8:36                                                                                           ` Carl-Daniel Hailfinger
     [not found]                                                                                             ` <42807289.8090003-hi6Y0CQ0nG0@public.gmane.org>
2005-05-10 16:33                                                                                               ` Kendall Bennett
     [not found]                                                                                                 ` <4280E262.9020207-uto6oM0aG36m1FQbPH9wZw@public.gmane.org>
2005-05-10 19:36                                                                                                   ` Carl-Daniel Hailfinger
2005-02-07 18:04                                                               ` [RFC] " Adam Sulmicki
2005-02-07 16:39                                                             ` Li-Ta Lo
2005-02-07 13:24                                                     ` [ACPI] Re: [RFC] Reliable video POSTing on resume (was: Re: [ACPI] Samsung P35, S3, black screen (radeon)) Matthew Garrett
2005-02-07 14:09                                                       ` Pavel Machek
     [not found]                                                         ` <20050207140937.GA8040-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-02-07 14:25                                                           ` Matthew Garrett
     [not found]                                                     ` <1107695583.14847.167.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2005-02-10 19:13                                                       ` [RFC] Reliable video POSTing on resume (was: " Bill Davidsen
     [not found]                                                         ` <420BB267.8060108-sQDSfeB7uhw@public.gmane.org>
2005-02-10 19:25                                                           ` Ville Syrjälä
     [not found]                                                             ` <20050210192554.GA15726-ORSVBvAovxo@public.gmane.org>
2005-02-10 20:08                                                               ` [RFC] Reliable video POSTing on resume (was: Re: [ACPI] " Matthew Garrett
2005-02-10 20:17                                                                 ` [RFC] Reliable video POSTing on resume (was: " Jon Smirl
2005-02-10 20:29                                                                   ` [RFC] Reliable video POSTing on resume (was: Re: [ACPI] " Matthew Garrett
2005-02-10 20:34                                                                     ` [RFC] Reliable video POSTing on resume (was: " Jon Smirl
     [not found]                                                                       ` <9e47339105021012341c94c441-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-10 20:46                                                                         ` [RFC] Reliable video POSTing on resume Kendall Bennett
     [not found]                                                                           ` <420BC814.4050102-uto6oM0aG36m1FQbPH9wZw@public.gmane.org>
2005-02-10 21:06                                                                             ` Matthew Garrett
2005-02-10 21:20                                                                               ` Kendall Bennett
2005-02-10 21:28                                                                               ` Jon Smirl
2005-02-10 22:53                                                                                 ` Matthew Garrett
     [not found]                                                                                 ` <9e47339105021013285e390e2a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-11  1:41                                                                                   ` Carl-Daniel Hailfinger
     [not found]                                                                   ` <9e473391050210121756874a84-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-10 20:32                                                                     ` [RFC] Reliable video POSTing on resume (was: Re: Samsung P35, S3, black screen (radeon)) Ville Syrjälä
2005-02-10 19:31                                                           ` Pavel Machek
2005-02-07 19:27                                                   ` Eric W. Biederman
     [not found]                                                     ` <m1lla0187m.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2005-02-07 20:59                                                       ` Pavel Machek
2005-02-04  5:03                               ` Jon Smirl
     [not found]                                 ` <9e47339105020321031ccaabb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-04  7:49                                   ` Pavel Machek
2005-02-04 12:17                                   ` [RFC] Reliable video POSTing on resume Carl-Daniel Hailfinger
     [not found]                                     ` <420367CF.7060206-hi6Y0CQ0nG0@public.gmane.org>
2005-02-04 13:51                                       ` Matthew Garrett
2005-02-04 16:30                                       ` Pavel Machek
     [not found]                                         ` <20050204163019.GC1290-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-02-04 17:31                                           ` Jon Smirl
     [not found]                                             ` <9e4733910502040931955f5a6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-04 18:10                                               ` Jesse Barnes
     [not found]                                                 ` <200502041010.13220.jbarnes-UzQTBcouhwxWk0Htik3J/w@public.gmane.org>
2005-02-04 20:29                                                   ` Jon Smirl
     [not found]                                                     ` <9e473391050204122942da8aa7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-04 22:13                                                       ` James Simmons
2005-02-04 21:56                                                   ` James Simmons
2005-02-04 22:59                                                   ` Legacy IO spaces (was Re: [RFC] Reliable video POSTing on resume) Jon Smirl
     [not found]                                                     ` <9e4733910502041459500ae8d3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-04 23:34                                                       ` Jesse Barnes
     [not found]                                                         ` <200502041534.03004.jbarnes-UzQTBcouhwxWk0Htik3J/w@public.gmane.org>
2005-02-05  0:48                                                           ` Jon Smirl
     [not found]                                                             ` <9e47339105020416486cf19738-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-05 22:42                                                               ` Benjamin Herrenschmidt
2005-02-06  0:17                                                                 ` Jon Smirl
2005-02-06  0:07                                                           ` Jon Smirl
     [not found]                                                             ` <9e47339105020516072b33a9c6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-06  0:19                                                               ` Jesse Barnes
2005-02-05  2:04                                               ` [RFC] Reliable video POSTing on resume Matthew Garrett
2005-02-05  2:09                                                 ` Jon Smirl
     [not found]                                                   ` <9e4733910502041809738017a7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-05  2:17                                                     ` Matthew Garrett
2005-02-05  2:30                                                       ` Jon Smirl
     [not found]                                                         ` <9e47339105020418306a4c2c93-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-05  8:15                                                           ` Matthew Garrett
2005-02-05 11:53                                                             ` Ondrej Zary
     [not found]                                                               ` <4204B3C1.80706-ZCIryABCsrmttCpgsWEBFmD2FQJk+8+b@public.gmane.org>
2005-02-05 12:28                                                                 ` Matthew Garrett
2005-02-05 15:47                                                                 ` Jon Smirl
     [not found]                                                                   ` <9e473391050205074769e4f10-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-05 16:48                                                                     ` Stefan Dösinger
2005-02-05 17:38                                                                       ` [ACPI] " Jon Smirl
     [not found]                                                                         ` <9e47339105020509382adbbf39-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-02-06 11:05                                                                           ` Stefan Dösinger
2005-02-07 10:20                                                                           ` Helge Hafting
     [not found]                                                                             ` <420740F1.5050609-CND4fxrytsY@public.gmane.org>
2005-02-07 14:22                                                                               ` Pavel Machek
2005-02-05 15:55                                                             ` Jon Smirl
2005-02-05  9:37                                               ` Pavel Machek
     [not found]                                                 ` <20050205093740.GD1158-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-02-05  9:49                                                   ` Nigel Cunningham
2005-02-05 15:49                                                   ` Jon Smirl
2005-02-04 22:09                                           ` James Simmons
     [not found]                                             ` <Pine.LNX.4.56.0502042206090.26459-nGpKsS7K33UUkNsaar8edxWb9i9o6OzJ@public.gmane.org>
2005-02-05  1:07                                               ` Carl-Daniel Hailfinger
2005-02-05  1:14                                           ` Carl-Daniel Hailfinger
2005-02-04 14:40                                   ` [RFC] Reliable video POSTing on resume (was: Re: [ACPI] Samsung P35, S3, black screen (radeon)) Xavier Bestel
2005-02-05  1:10                                     ` [RFC] Reliable video POSTing on resume Carl-Daniel Hailfinger
2005-02-04  7:48                               ` [RFC] Reliable video POSTing on resume (was: Re: Samsung P35, S3, black screen (radeon)) Pavel Machek
     [not found]                                 ` <20050204074802.GD1086-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-02-04 10:26                                   ` Oliver Neukum
     [not found]                                     ` <200502041126.14386.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2005-02-04 11:32                                       ` [RFC] Reliable video POSTing on resume Carl-Daniel Hailfinger
     [not found]                                         ` <42035D5A.2030703-hi6Y0CQ0nG0@public.gmane.org>
2005-02-04 12:11                                           ` David Goodenough
2005-02-04 16:15                                           ` Pavel Machek
2005-02-04  7:43                           ` Samsung P35, S3, black screen (radeon) Pavel Machek
     [not found]                             ` <20050204074302.GA1086-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-02-04 10:19                               ` Nigel Cunningham
     [not found]                                 ` <1107512396.5727.80.camel-r49W/1Cwd2ff0s6lnCXPXw0QcLn3kwYh@public.gmane.org>
2005-02-04 16:13                                   ` Pavel Machek
     [not found]                                     ` <20050204161358.GA1290-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-02-04 22:26                                       ` Nigel Cunningham
     [not found]                                         ` <1107555981.4109.3.camel-r49W/1Cwd2ff0s6lnCXPXw0QcLn3kwYh@public.gmane.org>
2005-02-05  9:31                                           ` Pavel Machek
     [not found]                                             ` <20050205093118.GA1158-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-02-05  9:44                                               ` Nigel Cunningham
     [not found]                                                 ` <1107596660.6348.6.camel-r49W/1Cwd2ff0s6lnCXPXw0QcLn3kwYh@public.gmane.org>
2005-02-05  9:45                                                   ` Pavel Machek
     [not found]                                                     ` <20050205094541.GE1158-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-02-05  9:51                                                       ` Nigel Cunningham
2005-02-05  9:32                                           ` Norbert Preining
2005-02-03 22:50               ` Pavel Machek
     [not found]                 ` <20050203225033.GA1110-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-02-04 15:50                   ` Stefan Seyfried

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=4202DF7B.2000506@gmx.net \
    --to=c-d.hailfinger.devel.2005-hi6y0cq0ng0@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ncunningham-jjFNsPSvq+iXDw4h08c5KA@public.gmane.org \
    --cc=pavel-+ZI9xUNit7I@public.gmane.org \
    /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