public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
To: "Emmanuel Thomé" <Emmanuel.Thome-MZpvjPyXg2s@public.gmane.org>
Cc: ole.rohne-vJEk5272eHo@public.gmane.org,
	Jon Valvatne <jon-hc6/xhmWZxdWk0Htik3J/w@public.gmane.org>,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: Suspend-to-RAM on Sony Vaios
Date: Mon, 1 Nov 2004 16:41:28 +0100	[thread overview]
Message-ID: <20041101154127.GB1056@elf.ucw.cz> (raw)
In-Reply-To: <20041101145410.GB12006-xkTd+U360DcAs8EywTwl9A@public.gmane.org>

Hi!

> The attached patch provides acpi_sleep=s3_late_bios boot option. This is
> just a trivial wrap-up of Ole's patch. It hooks into pci_default_resume
> (on X86 only and even then only when the flag is given), so you actually
> can resume the video without a framebuffer driver (and if you do have
> one, well, it should do what it takes to handle resume).

Patch looks good to me...

> +	# Fixup 16-bit CS descriptor
> +	movl	%ecx, %edx
> +	movw	%dx, go_real_cseg - wakeup_start + 2 (%eax)
> +	shrl	$16, %edx
> +	movb	%dl, go_real_cseg - wakeup_start + 4 (%eax)
> +	movb	%dh, go_real_cseg - wakeup_start + 7 (%eax)

Uff, this looks pretty ugly. But I guess it is i386 being ugly...

> --- linux.orig/drivers/pci/pci-driver.c	2004-10-26 10:19:42.000000000 +0200
> +++ linux/drivers/pci/pci-driver.c	2004-11-01 01:33:04.000000000 +0100
> @@ -336,6 +336,20 @@
>  	/* if the device was busmaster before the suspend, make it busmaster again */
>  	if (pci_dev->is_busmaster)
>  		pci_set_master(pci_dev);
> +#if	defined(CONFIG_X86) && defined(CONFIG_ACPI_SLEEP)
> +	if (((pci_dev->class ^ (PCI_CLASS_DISPLAY_VGA << 8)) & 0xffff00)==0)

The use of xor here is certainly interesting. Is it possible to say

	pci_dev->class & 0xffff00 == PCI_CLASS_DISPLAY_VGA << 8

?

> +	{
> +		/* This is a no-op, and returns -1, in case s3_bios_late
> +		 * hasn't been specified on the kernel command line
> +		 */
> +		int rc;
> +		rc=acpi_vgapost (pci_dev->bus->number << 8 | pci_dev->devfn);
> +		if (rc==0) {
> +			printk(KERN_INFO "resumed pci graphics adapter %s\n",
> +				pci_name(pci_dev));
> +		}

Please do it without the variable, and use 

	foo = bar(baz, xyzzy);

style of formatting.

> --- linux.orig/include/asm-i386/acpi.h	2004-10-26 10:19:50.000000000 +0200
> +++ linux/include/asm-i386/acpi.h	2004-11-01 02:15:12.000000000 +0100
> @@ -187,6 +187,9 @@
>  /* early initialization routine */
>  extern void acpi_reserve_bootmem(void);
>  
> +/* real mode excursion to post code from vga rom ; must come once pci is up. */
> +extern int acpi_vgapost (unsigned long);
                          ~-- 
                             \ kill this space.

> --- linux.orig/arch/i386/kernel/acpi/sleep_hacks.h	1970-01-01 01:00:00.000000000 +0100
> +++ linux/arch/i386/kernel/acpi/sleep_hacks.h	2004-11-01 02:53:47.000000000 +0100
> @@ -0,0 +1,16 @@
> +#ifndef ACPI_SLEEP_HACKS_H_
> +#define ACPI_SLEEP_HACKS_H_
> +
> +#ifdef	CONFIG_ACPI_SLEEP
> +
> +#define	ACPI_SLEEP_S3_BIOS	1
> +#define	ACPI_SLEEP_S3_MODE	2
> +#define	ACPI_SLEEP_S3_LATE_BIOS	4
> +#define	ACPI_SLEEP_S3_LATE_MODE	8
> +#define	ACPI_SLEEP_S3_LATE_MASK	12
> +#define ACPI_SLEEP_S3_LATE_BITS(X)	(((X)&12)>>2)
> +
> +#endif
> +
> +
> +#endif	/* ACPI_SLEEP_HACKS_H_ */

Does it really deserve its own header file? Hmm and it should probably
be common between x86-64 and i386, as we might need 64-bit version in
future...

								Pavel

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

  parent reply	other threads:[~2004-11-01 15:41 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-18  0:08 Suspend-to-RAM on Sony Vaios Jon Valvatne
     [not found] ` <20041018020816.48673359-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2004-10-18  4:15   ` Ivor Hewitt
     [not found]     ` <200410180415.59801.ivor-rtBon1mkn18@public.gmane.org>
2004-10-18 13:15       ` Jon Valvatne
2004-10-18 11:26   ` Pavel Machek
     [not found]     ` <20041018112632.GB4400-u08AdweFZfgxtPtxi4kahqVXKuFTiq87@public.gmane.org>
2004-10-20 22:13       ` Jon Valvatne
     [not found]         ` <20041021001331.69c6c965-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2004-10-20 22:53           ` Pavel Machek
     [not found]             ` <20041020225334.GC29863-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-11-01 14:54               ` Emmanuel Thomé
     [not found]                 ` <20041101145410.GB12006-xkTd+U360DcAs8EywTwl9A@public.gmane.org>
2004-11-01 15:17                   ` ole.rohne-vJEk5272eHo
2004-11-01 15:41                   ` Pavel Machek [this message]
     [not found]                     ` <20041101154127.GB1056-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-11-02 22:00                       ` Emmanuel Thomé
     [not found]                         ` <20041102220034.GA31435-xkTd+U360DcAs8EywTwl9A@public.gmane.org>
2004-11-02 22:09                           ` Pavel Machek
     [not found]                             ` <20041102220958.GF1407-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-11-03 10:51                               ` Andi Kleen
     [not found]                                 ` <20041103105106.GA4174-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2004-11-03 11:13                                   ` Pavel Machek
     [not found]                                     ` <20041103111306.GA1002-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-11-03 12:36                                       ` Andi Kleen
     [not found]                                         ` <20041103123625.GA18867-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2004-11-03 12:38                                           ` Pavel Machek
     [not found]                                             ` <20041103123830.GB1002-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-11-03 12:47                                               ` Andi Kleen
     [not found]                                                 ` <20041103124757.GE18867-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2004-11-03 12:50                                                   ` Pavel Machek
     [not found]                                                     ` <20041103125047.GD1002-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-11-03 13:08                                                       ` Andi Kleen
2004-11-03 11:31                                   ` ole.rohne-vJEk5272eHo
     [not found]                                     ` <yzoekjbgod9.fsf-vJEk5272eHo@public.gmane.org>
2004-11-03 12:41                                       ` Andi Kleen
     [not found]                                         ` <20041103124138.GC18867-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2004-11-03 13:52                                           ` ole.rohne-vJEk5272eHo
     [not found]                                             ` <yzois8n9h17.fsf-vJEk5272eHo@public.gmane.org>
2004-11-03 14:11                                               ` Andi Kleen
     [not found]                                                 ` <20041103141134.GA24195-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2004-11-03 14:49                                                   ` ole.rohne-vJEk5272eHo
2004-11-03  9:46                           ` ole.rohne-vJEk5272eHo
2004-10-21 16:19           ` Florian Hühn
2004-10-19  8:11   ` Luc Saillard
  -- strict thread matches above, loose matches on Subject: below --
2004-10-19  9:25 Li, Shaohua
     [not found] ` <16A54BF5D6E14E4D916CE26C9AD3057559A05A-4yWAQGcml66iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-10-19 10:11   ` Luc Saillard
2004-10-19 11:45 Li, Shaohua
     [not found] ` <16A54BF5D6E14E4D916CE26C9AD3057559A0A4-4yWAQGcml66iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-10-19 12:39   ` Luc Saillard
     [not found]     ` <20041019123930.GA25753-Snhs3Gxj9njPHUqn3ntIkQ@public.gmane.org>
2004-10-19 13:47       ` Matthew Garrett
2004-10-19 16:32 Pallipadi, Venkatesh
     [not found] ` <88056F38E9E48644A0F562A38C64FB600323619D-exJ48ZlmiLpQxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-10-19 16:47   ` Luc Saillard
     [not found]     ` <20041019164702.GB25753-Snhs3Gxj9njPHUqn3ntIkQ@public.gmane.org>
2004-10-20  9:45       ` Proinnsias Breathnach
2004-10-20  3:30 Li, Shaohua
2004-11-03 14:45 Pallipadi, Venkatesh
     [not found] ` <88056F38E9E48644A0F562A38C64FB60033E4DDC-exJ48ZlmiLpQxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-11-03 15:52   ` Andi Kleen
     [not found]     ` <20041103155217.GH24195-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2004-11-03 17:13       ` ole.rohne-vJEk5272eHo
     [not found]         ` <yzosm7q97q2.fsf-vJEk5272eHo@public.gmane.org>
2004-11-03 17:21           ` Andi Kleen
     [not found]             ` <20041103172120.GB18092-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2004-11-03 18:01               ` Matthew Garrett
     [not found]                 ` <1099504898.31687.31.camel-Xmbc1Sz64/5pghhO6/9/sx2eb7JE58TQ@public.gmane.org>
2004-11-04  4:15                   ` Andi Kleen
     [not found]                     ` <20041104041525.GE21211-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2004-11-04 10:39                       ` Matthew Garrett
2004-11-04 10:58                         ` Andi Kleen
2004-11-04 13:49                           ` ole.rohne-vJEk5272eHo
2004-11-04  8:29                 ` ole.rohne-vJEk5272eHo
2004-11-04  8:24               ` ole.rohne-vJEk5272eHo
     [not found]                 ` <yzo654mowci.fsf-vJEk5272eHo@public.gmane.org>
2004-11-04  9:02                   ` Andi Kleen
     [not found]                     ` <20041104090233.GD28895-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2004-11-04 11:40                       ` Pavel Machek
2004-11-04 12:14                     ` ole.rohne-vJEk5272eHo

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=20041101154127.GB1056@elf.ucw.cz \
    --to=pavel-+zi9xunit7i@public.gmane.org \
    --cc=Emmanuel.Thome-MZpvjPyXg2s@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=jon-hc6/xhmWZxdWk0Htik3J/w@public.gmane.org \
    --cc=ole.rohne-vJEk5272eHo@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