Date: Mon, 16 Feb 2015 22:19:34 +0100 From: "Ranjan1018 ." <214748mv@gmail.com> To: Konstantin Belousov <kostikbel@gmail.com> Cc: Adrian Chadd <adrian@freebsd.org>, FreeBSD CURRENT <freebsd-current@freebsd.org> Subject: Re: Suspend/resume on i915 stop working between r278348 and r278741. Message-ID: <CACyC=qbdPrnP5TN%2B8ZDpAotDEK7de0RzYVJ8o9gc5J2HsHbtxQ@mail.gmail.com> In-Reply-To: <20150216095035.GG34251@kib.kiev.ua> References: <CACyC=qajpScpmYH6mEtUh9eopJMW_de34_GPYjfsuLxr8fy2nQ@mail.gmail.com> <CAJ-VmonomEoBO2moxSeGcqokBFZAzMO8HbSNmKChYcpkEH7e9Q@mail.gmail.com> <CACyC=qanWQu_v011A5OcTWLPw-t2weoBrQRkM_1vHKQjkxQMDA@mail.gmail.com> <20150215151141.GB34251@kib.kiev.ua> <CACyC=qb1z3fC8=XeSZDLf8usWR_BUzL5XJ1oobqrQ2-nSq5CQQ@mail.gmail.com> <20150215185955.GC34251@kib.kiev.ua> <CACyC=qYZr9UhVGEQNC7j40B8wT445a-pD8xpBaJkLqDDEEduvg@mail.gmail.com> <20150216095035.GG34251@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
2015-02-16 10:50 GMT+01:00 Konstantin Belousov <kostikbel@gmail.com>: > On Sun, Feb 15, 2015 at 08:43:55PM +0100, Ranjan1018 . wrote: > > 2015-02-15 19:59 GMT+01:00 Konstantin Belousov <kostikbel@gmail.com>: > > > > > On Sun, Feb 15, 2015 at 07:45:44PM +0100, Ranjan1018 . wrote: > > > > > > > > Unfortunately does not work for me. Tested with r278803. > > > > > > Does your machine resume if you boot with hw.x2apic_enable set to 0 > > > from the loader prompt ? > > > > Yes. I have added to it to loader.conf > > $ cat /boot/loader.conf | grep x2apic_enable > > hw.x2apic_enable=0 > > > > Confirm that x2apic is disabled after tunable > > > frobbing, with sysctl hw.apic.x2apic_mode. > > > > > $ sysctl hw.apic.x2apic_mode > > hw.apic.x2apic_mode: 0 > > And, does your machine resumed successfully with the tunable set ? > Yes. > > Below is the patch which seemingly worked for Gleb. > You should not set the tunable to test it properly. > > diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c > index 13c3d43..b767691 100644 > --- a/sys/amd64/amd64/mp_machdep.c > +++ b/sys/amd64/amd64/mp_machdep.c > @@ -1507,6 +1507,7 @@ cpususpend_handler(void) > vmm_resume_p(); > > /* Resume MCA and local APIC */ > + lapic_xapic_mode(); > mca_resume(); > lapic_setup(0); > > diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c > index 32b9540..a80de54 100644 > --- a/sys/i386/i386/mp_machdep.c > +++ b/sys/i386/i386/mp_machdep.c > @@ -1555,6 +1555,7 @@ cpususpend_handler(void) > cpu_ops.cpu_resume(); > > /* Resume MCA and local APIC */ > + lapic_xapic_mode(); > mca_resume(); > lapic_setup(0); > > diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/x86/acpica/acpi_wakeup.c > index 74522be..e652419 100644 > --- a/sys/x86/acpica/acpi_wakeup.c > +++ b/sys/x86/acpica/acpi_wakeup.c > @@ -270,6 +270,7 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, > int sleep_result, > initializecpu(); > PCPU_SET(switchtime, 0); > PCPU_SET(switchticks, ticks); > + lapic_xapic_mode(); > #ifdef SMP > if (!CPU_EMPTY(&suspcpus)) > acpi_wakeup_cpus(sc); > diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c > index 1809fa6..1b66674 100644 > --- a/sys/x86/x86/local_apic.c > +++ b/sys/x86/x86/local_apic.c > @@ -527,7 +527,6 @@ native_lapic_xapic_mode(void) > saveintr = intr_disable(); > if (x2apic_mode) > native_lapic_enable_x2apic(); > - native_lapic_disable(); > intr_restore(saveintr); > } > > Thank you Konstantin, it works for me too! I have commented 'hw.x2apic_enable=0' in /boot/loader.conf $ cat /boot/loader.conf | grep x2apic_enable #hw.x2apic_enable=0 the 2xapic result enabled $ sysctl hw.apic.x2apic_mode hw.apic.x2apic_mode: 1 and suspend/resume works again. Regards Maurizio
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACyC=qbdPrnP5TN%2B8ZDpAotDEK7de0RzYVJ8o9gc5J2HsHbtxQ>