public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* Any known issues of premature suspend?
       [not found] <S1761554AbXGVXPI/20070722231508Z+217@vger.kernel.org>
@ 2007-07-23  1:26 ` TJ
  2007-07-23 13:36   ` TJ
  0 siblings, 1 reply; 2+ messages in thread
From: TJ @ 2007-07-23  1:26 UTC (permalink / raw)
  To: linux-acpi

I'm currently debugging a weird issue where the PC appears to be
attempting to S3 suspend prematurely in acpi_enter_sleep_state().

The PC is a Sony Vaio PCG-SRX51P/B notebook (Intel 850MHz, 384MB, kernel
2.6.20-16) with Ubuntu 7.04 Feisty 32-bit with CONFIG_ACPI_DEBUG.

I added some additional debug messages to acpi_enter_sleep_state() and
find that after the 1st write to "PM1B (SLP_TYP data)" but before
writing "PM1A (SLP_TYP + SLP_EN)" the PC appears to suspend prematurely,
and then instantly comes back with "Back to C!".

It doesn't seem to fail via the ACPI_FAILURE()... return_ACPI_STATUS()
logic as far as I can tell.

Here's the log entries:

kernel: [  328.044000]  hwsleep-0285 [03] enter_sleep_state     :
Entering sleep state [S3]
kernel: [  328.044000]  hwsleep-0308 [03] enter_sleep_state     :
Writing PM1A (SLP_TYP data) 1401
kernel: [  328.044000]  hwsleep-0319 [03] enter_sleep_state     :
Writing PM1B (SLP_TYP data) 1401
kernel: [  328.044000]  hwsleep-0326 [03] enter_sleep_state     : Just
written PM1B (SLP_TYP data). status=0x0
kernel: [  328.044000] Back to C!

Any ideas?

TJ.

-----drivers/acpi/hardware/hwsleep.c::acpi_enter_sleep_state()----
	/* Write #1: fill in SLP_TYP data */
 
#ifdef DEBUG_RESUME
 ACPI_DEBUG_PRINT((ACPI_DB_INIT, "Writing PM1A (SLP_TYP data) %x\n",
PM1Acontrol));
#endif

	status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
					ACPI_REGISTER_PM1A_CONTROL,
					PM1Acontrol);
	if (ACPI_FAILURE(status)) {
		return_ACPI_STATUS(status);
	}

#ifdef DEBUG_RESUME
 ACPI_DEBUG_PRINT((ACPI_DB_INIT, "Writing PM1B (SLP_TYP data) %x\n",
PM1Bcontrol));
#endif

  status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
					ACPI_REGISTER_PM1B_CONTROL,
					PM1Bcontrol);
#ifdef DEBUG_RESUME
 ACPI_DEBUG_PRINT((ACPI_DB_INIT, "Just written PM1B (SLP_TYP data).
status=0x%x\n", status));
#endif
	if (ACPI_FAILURE(status)) {
#ifdef DEBUG_RESUME
 ACPI_DEBUG_PRINT((ACPI_DB_INIT, "Failed writing PM1B (SLP_TYP data).
status=0x%x\n", status));
#endif

		return_ACPI_STATUS(status);
	}

	/* Insert SLP_ENABLE bit */

	PM1Acontrol |= sleep_enable_reg_info->access_bit_mask;
	PM1Bcontrol |= sleep_enable_reg_info->access_bit_mask;

	/* Write #2: SLP_TYP + SLP_EN */
#ifdef DEBUG_RESUME
 ACPI_DEBUG_PRINT((ACPI_DB_INIT, "About to flush CPU cache\n"));
#endif

	ACPI_FLUSH_CPU_CACHE();

#ifdef DEBUG_RESUME
 ACPI_DEBUG_PRINT((ACPI_DB_INIT, "Writing PM1A (SLP_TYP + SLP_EN) %x\n",
PM1Acontrol));
#endif
 
	status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
					ACPI_REGISTER_PM1A_CONTROL,
					PM1Acontrol);
	if (ACPI_FAILURE(status)) {
		return_ACPI_STATUS(status);
	}

#ifdef DEBUG_RESUME
 ACPI_DEBUG_PRINT((ACPI_DB_INIT, "Writing PM1B (SLP_TYP + SLP_EN) %x\n",
PM1Bcontrol));
#endif
 
	status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
					ACPI_REGISTER_PM1B_CONTROL,
					PM1Bcontrol);
	if (ACPI_FAILURE(status)) {
		return_ACPI_STATUS(status);
	}

#ifdef DEBUG_RESUME
 ACPI_DEBUG_PRINT((ACPI_DB_INIT, "Just done sleep S3\n"));
#endif



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Any known issues of premature suspend?
  2007-07-23  1:26 ` Any known issues of premature suspend? TJ
@ 2007-07-23 13:36   ` TJ
  0 siblings, 0 replies; 2+ messages in thread
From: TJ @ 2007-07-23 13:36 UTC (permalink / raw)
  To: linux-acpi

On Mon, 2007-07-23 at 02:26 +0100, TJ wrote:
> I'm currently debugging a weird issue where the PC appears to be
> attempting to S3 suspend prematurely in acpi_enter_sleep_state().

I added further debug messages to acpi_enter_sleep_state() and found
that the issue occurs when ACPI_FLUSH_CPU_CACHE() is called.

The log shows:

kernel: [  251.532000]  hwsleep-0285 [03] enter_sleep_state     :
Entering sleep state [S3]
kernel: [  251.532000]  hwsleep-0308 [03] enter_sleep_state     :
Writing PM1A (SLP_TYP data) 1401
kernel: [  251.532000]  hwsleep-0319 [03] enter_sleep_state     :
Writing PM1B (SLP_TYP data) 1401
kernel: [  251.532000]  hwsleep-0326 [03] enter_sleep_state     : Just
written PM1B (SLP_TYP data). status=0x0
kernel: [  251.532000]  hwsleep-0343 [03] enter_sleep_state     : About
to flush CPU cache
kernel: [  251.532000] Back to C!

The standard kernel build uses CONFIG_PARAVIRT so it appears that
paravirt_ops.wbinvd() is used to handle the flush.

I'm building a kernel without PARAVIRT now to see if it is the issue,
but I'm still in the dark as to why this would happen.

TJ.

---drivers/acpi/hardware/hwsleep.c::acpi_enter_sleep_state()----

	/* Write #2: SLP_TYP + SLP_EN */
#ifdef DEBUG_RESUME
 ACPI_DEBUG_PRINT((ACPI_DB_INIT, "About to flush CPU cache\n"));
#endif

	ACPI_FLUSH_CPU_CACHE();

#ifdef DEBUG_RESUME
 ACPI_DEBUG_PRINT((ACPI_DB_INIT, "Writing PM1A (SLP_TYP + SLP_EN) %x\n",
PM1Acontrol));
#endif
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-23 13:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <S1761554AbXGVXPI/20070722231508Z+217@vger.kernel.org>
2007-07-23  1:26 ` Any known issues of premature suspend? TJ
2007-07-23 13:36   ` TJ

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox