From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PCI: Set device power state to PCI_D0 for device without native PM support
Date: Thu, 6 Oct 2011 11:39:49 +0100 [thread overview]
Message-ID: <alpine.DEB.2.00.1110061137120.3519@kaball-desktop> (raw)
In-Reply-To: <4E8C40A8.6080205@oracle.com>
On Wed, 5 Oct 2011, Ajaykumar Hotchandani wrote:
> During test of one IB card with guest VM, found that, msi is not initialized properly.
>
> It turns out __write_msi_msg will do nothing if device current_state is not PCI_D0.
> And, that pci device does not have pm_cap in guest VM.
>
> There is an error in setting of power state to PCI_D0 in pci_enable_device(), but error is not returned for this.
> Following is code flow:
> pci_enable_device() --> __pci_enable_device_flags() --> do_pci_enable_device() --> pci_set_power_state() --> __pci_start_power_transition()
> We have following condition inside __pci_start_power_transition():
> if (platform_pci_power_manageable(dev)) {
> error = platform_pci_set_power_state(dev, state);
> if (!error)
> pci_update_current_state(dev, state);
> } else {
> error = -ENODEV;
> /* Fall back to PCI_D0 if native PM is not supported */
> if (!dev->pm_cap)
> dev->current_state = PCI_D0;
> }
>
> Here, from platform_pci_set_power_state(), acpi_pci_set_power_state() is getting called and that is failing with ENODEV because of following condition:
> if (!handle || ACPI_SUCCESS(acpi_get_handle(handle, "_EJ0",&tmp)))
> return -ENODEV;
>
> Because of that, pci_update_current_state() is not getting called.
>
> With this patch, if device power state can not be set via platform_pci_set_power_state and that device does not have native pm support, then PCI device power state will be set to PCI_D0.
>
> Signed-off-by: Ajaykumar Hotchandani<ajaykumar.hotchandani@oracle.com>
> Signed-off-by: Yinghai Lu<yinghai.lu@oracle.com>
I had the same issue and sent a patch a while ago to fix it, adding
current_state = PCI_D0 in acpiphp_glue.c:register_slot
it is strange that this does not work for you:
http://marc.info/?l=linux-kernel&m=129891002722845&w=2
next prev parent reply other threads:[~2011-10-06 10:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-05 11:34 Ajaykumar Hotchandani
2011-10-05 19:41 ` Rafael J. Wysocki
2011-10-06 16:10 ` Yinghai Lu
2011-10-06 17:20 ` Rafael J. Wysocki
2011-10-06 10:39 ` Stefano Stabellini [this message]
2011-10-06 16:05 ` Yinghai Lu
2011-10-06 16:17 ` Stefano Stabellini
2011-10-10 12:02 ` Ajaykumar Hotchandani
2011-10-13 14:30 ` Stefano Stabellini
2011-10-18 13:52 ` Ajaykumar Hotchandani
2011-10-27 13:14 ` Stefano Stabellini
2011-10-27 14:34 ` Ajaykumar Hotchandani
2011-10-27 15:01 ` Stefano Stabellini
2011-10-28 12:06 ` Ajaykumar Hotchandani
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=alpine.DEB.2.00.1110061137120.3519@kaball-desktop \
--to=stefano.stabellini@eu.citrix.com \
--cc=ajaykumar.hotchandani@oracle.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.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
all inboxes | Powered by JetHome®