All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: nick <xerofoify@gmail.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	David Airlie <airlied@linux.ie>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: 4.0-rc6 errors when opening LID
Date: Mon, 6 Apr 2015 12:02:05 +0200	[thread overview]
Message-ID: <201504061202.05760@pali> (raw)
In-Reply-To: <1818900.MY9q0yfluC@vostro.rjw.lan>

[-- Attachment #1: Type: Text/Plain, Size: 3749 bytes --]

On Saturday 27 December 2014 21:22:56 Rafael J. Wysocki wrote:
> On Saturday, December 27, 2014 09:19:49 AM Pali Rohár wrote:
> > Hello,
> > 
> > in attachment is output of ls -l /sys/bus/acpi/devices from
> > both 3.13 and 3.19 kernels.
> > 
> > Anyway Gabriele Mazzotta wrote me that new acpi devices
> > could be created after commit faae404ebdc6bba (ACPICA: Add
> > "Windows 2013" string to _OSI support).
> > 
> > Maybe this another output could help you:
> > 
> > $ cat /sys/bus/acpi/devices/INT33C5\:00/status
> > 0
> > $ cat /sys/bus/acpi/devices/INT33C5\:00/power_state
> > (unknown)
> > 
> > Device INT33C5 is in that dmesg log:
> > acpi INT33C5:00: Cannot transition to non-D0 state from D3
> 
> The appended patch should make these messages go away, please
> test.
> 
> > And status 0 in sysnode could indicate that acpi device is
> > not present right?
> 
> That's correct.
> 
> ---
>  drivers/acpi/device_pm.c |    7 ++++---
>  include/acpi/acpi_bus.h  |    3 ++-
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> Index: linux-pm/include/acpi/acpi_bus.h
> ==============================================================
> ===== --- linux-pm.orig/include/acpi/acpi_bus.h
> +++ linux-pm/include/acpi/acpi_bus.h
> @@ -589,7 +589,8 @@ static inline u32 acpi_target_system_sta
> 
>  static inline bool acpi_device_power_manageable(struct
> acpi_device *adev) {
> -	return adev->flags.power_manageable;
> +	return adev->flags.power_manageable
> +		&& (adev->status.present || adev->status.functional);
>  }
> 
>  static inline bool acpi_device_can_wakeup(struct acpi_device
> *adev) Index: linux-pm/drivers/acpi/device_pm.c
> ==============================================================
> ===== --- linux-pm.orig/drivers/acpi/device_pm.c
> +++ linux-pm/drivers/acpi/device_pm.c
> @@ -68,7 +68,8 @@ int acpi_device_get_power(struct acpi_de
>  {
>  	int result = ACPI_STATE_UNKNOWN;
> 
> -	if (!device || !state)
> +	if (!device || !state
> +	    || !(device->status.present ||
> device->status.functional)) return -EINVAL;
> 
>  	if (!device->flags.power_manageable) {
> @@ -156,7 +157,7 @@ int acpi_device_set_power(struct acpi_de
>  	int result = 0;
>  	bool cut_power = false;
> 
> -	if (!device || !device->flags.power_manageable
> +	if (!device || !acpi_device_power_manageable(device)
> 
>  	    || (state < ACPI_STATE_D0) || (state >
>  	    || ACPI_STATE_D3_COLD))
> 
>  		return -EINVAL;
> 
> @@ -361,7 +362,7 @@ bool acpi_bus_power_manageable(acpi_hand
>  	int result;
> 
>  	result = acpi_bus_get_device(handle, &device);
> -	return result ? false : device->flags.power_manageable;
> +	return result ? false :
> acpi_device_power_manageable(device); }
>  EXPORT_SYMBOL(acpi_bus_power_manageable);

Hello Rafael,

sorry for long delay. Now I tested your patch on top of 4.0-rc6 
version and I'm still getting one acpi error message (and lot of  
others) in dmesg each time I open LID of my laptop:

kernel: [   62.016803] acpi device:41: Cannot transition to power 
state D3cold for parent in (unknown)

If it helps here is more info about that acpi "device:41":

/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/INT33C6:00/device:41
$ grep "" *
adr:0x00000001
path:\_SB_.PCI0.SDHC.WI01
power_state:D0
status:15

And here about parent ("../")

/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/INT33C6:00
$ grep "" *
adr:0x00170000
hid:INT33C6
modalias:acpi:INT33C6:PNP0D40:
path:\_SB_.PCI0.SDHC
status:0
uevent:MODALIAS=acpi:INT33C6:PNP0D40:
uid:1

It is OK, that one device has status 0 (not present) and its 
child has non zero status? Looks like here is problem...

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  parent reply	other threads:[~2015-04-06 10:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-24 18:51 3.19-rc1 errors when opening LID Pali Rohár
2014-12-24 18:51 ` Pali Rohár
2014-12-25  4:28 ` nick
2014-12-25  8:48   ` Pali Rohár
2014-12-25  8:48     ` [Intel-gfx] " Pali Rohár
2014-12-25 16:59     ` nick
2014-12-27  8:19       ` Pali Rohár
2014-12-27  8:19         ` [Intel-gfx] " Pali Rohár
2014-12-27 17:31         ` nick
2014-12-27 20:22         ` Rafael J. Wysocki
2014-12-27 20:22           ` [Intel-gfx] " Rafael J. Wysocki
2014-12-27 20:17           ` Joe Perches
2014-12-27 20:17             ` Joe Perches
2015-04-06 10:02           ` Pali Rohár [this message]
2014-12-26 15:12 ` Rafael J. Wysocki
2014-12-26 15:12   ` Rafael J. Wysocki
2014-12-26 15:52   ` Pali Rohár
2014-12-26 15:52     ` Pali Rohár

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=201504061202.05760@pali \
    --to=pali.rohar@gmail.com \
    --cc=airlied@linux.ie \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=xerofoify@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.