* [Resend][PATCH] pciehp: always implement resume
@ 2012-09-07 21:28 Rafael J. Wysocki
2012-09-07 23:28 ` Bjorn Helgaas
0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2012-09-07 21:28 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: LKML, Linux PM list, Greg Kroah-Hartman, Oliver Neukum, linux-pci
From: Oliver Neukum <oliver@neukum.org>
Subject: pciehp: always implement resume
The driver by default ignores resume. On some laptops
that means that interrupts are not delivered after S3.
So card removals and insertions will not be handled. Requiring
a forced load isn't right.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/pci/hotplug/pciehp_core.c | 28 ++++++++++++++--------------
drivers/pci/hotplug/pciehp_core.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
Index: linux/drivers/pci/hotplug/pciehp_core.c
===================================================================
--- linux.orig/drivers/pci/hotplug/pciehp_core.c
+++ linux/drivers/pci/hotplug/pciehp_core.c
@@ -300,24 +300,24 @@ static int pciehp_suspend (struct pcie_d
static int pciehp_resume (struct pcie_device *dev)
{
+ struct controller *ctrl;
+ struct slot *slot;
+ u8 status;
+
dev_info(&dev->device, "%s ENTRY\n", __func__);
- if (pciehp_force) {
- struct controller *ctrl = get_service_data(dev);
- struct slot *slot;
- u8 status;
+ ctrl = get_service_data(dev);
- /* reinitialize the chipset's event detection logic */
- pcie_enable_notification(ctrl);
+ /* reinitialize the chipset's event detection logic */
+ pcie_enable_notification(ctrl);
- slot = ctrl->slot;
+ slot = ctrl->slot;
- /* Check if slot is occupied */
- pciehp_get_adapter_status(slot, &status);
- if (status)
- pciehp_enable_slot(slot);
- else
- pciehp_disable_slot(slot);
- }
+ /* Check if slot is occupied */
+ pciehp_get_adapter_status(slot, &status);
+ if (status)
+ pciehp_enable_slot(slot);
+ else
+ pciehp_disable_slot(slot);
return 0;
}
#endif /* PM */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Resend][PATCH] pciehp: always implement resume
2012-09-07 21:28 [Resend][PATCH] pciehp: always implement resume Rafael J. Wysocki
@ 2012-09-07 23:28 ` Bjorn Helgaas
2012-09-07 23:33 ` Bjorn Helgaas
0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Helgaas @ 2012-09-07 23:28 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: LKML, Linux PM list, Greg Kroah-Hartman, Oliver Neukum, linux-pci
On Fri, Sep 7, 2012 at 2:28 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> From: Oliver Neukum <oliver@neukum.org>
> Subject: pciehp: always implement resume
>
> The driver by default ignores resume. On some laptops
> that means that interrupts are not delivered after S3.
> So card removals and insertions will not be handled. Requiring
> a forced load isn't right.
>
> Signed-off-by: Oliver Neukum <oneukum@suse.de>
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
I applied this (with fixed From: email address and slightly modified
changelog) to http://git.kernel.org/?p=linux/kernel/git/helgaas/pci.git;a=shortlog;h=refs/heads/pci/oliver-pciehp-resume
and will merge it to "next" after Fengguang's build/smoke tests.
Thanks!
Bjorn
> ---
> drivers/pci/hotplug/pciehp_core.c | 28 ++++++++++++++--------------
> drivers/pci/hotplug/pciehp_core.c | 28 ++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> Index: linux/drivers/pci/hotplug/pciehp_core.c
> ===================================================================
> --- linux.orig/drivers/pci/hotplug/pciehp_core.c
> +++ linux/drivers/pci/hotplug/pciehp_core.c
> @@ -300,24 +300,24 @@ static int pciehp_suspend (struct pcie_d
>
> static int pciehp_resume (struct pcie_device *dev)
> {
> + struct controller *ctrl;
> + struct slot *slot;
> + u8 status;
> +
> dev_info(&dev->device, "%s ENTRY\n", __func__);
> - if (pciehp_force) {
> - struct controller *ctrl = get_service_data(dev);
> - struct slot *slot;
> - u8 status;
> + ctrl = get_service_data(dev);
>
> - /* reinitialize the chipset's event detection logic */
> - pcie_enable_notification(ctrl);
> + /* reinitialize the chipset's event detection logic */
> + pcie_enable_notification(ctrl);
>
> - slot = ctrl->slot;
> + slot = ctrl->slot;
>
> - /* Check if slot is occupied */
> - pciehp_get_adapter_status(slot, &status);
> - if (status)
> - pciehp_enable_slot(slot);
> - else
> - pciehp_disable_slot(slot);
> - }
> + /* Check if slot is occupied */
> + pciehp_get_adapter_status(slot, &status);
> + if (status)
> + pciehp_enable_slot(slot);
> + else
> + pciehp_disable_slot(slot);
> return 0;
> }
> #endif /* PM */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Resend][PATCH] pciehp: always implement resume
2012-09-07 23:28 ` Bjorn Helgaas
@ 2012-09-07 23:33 ` Bjorn Helgaas
2012-09-08 3:01 ` Bjorn Helgaas
0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Helgaas @ 2012-09-07 23:33 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: LKML, Linux PM list, Greg Kroah-Hartman, Oliver Neukum,
linux-pci, Mark Lord, Kristen Carlson Accardi
+cc Mark & Kristen
Commit cd2fe83a815 by Mark added the code we're changing here, so this
is your chance to speak up if we're not doing the right thing :)
On Fri, Sep 7, 2012 at 4:28 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Fri, Sep 7, 2012 at 2:28 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>> From: Oliver Neukum <oliver@neukum.org>
>> Subject: pciehp: always implement resume
>>
>> The driver by default ignores resume. On some laptops
>> that means that interrupts are not delivered after S3.
>> So card removals and insertions will not be handled. Requiring
>> a forced load isn't right.
>>
>> Signed-off-by: Oliver Neukum <oneukum@suse.de>
>> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
>
> I applied this (with fixed From: email address and slightly modified
> changelog) to http://git.kernel.org/?p=linux/kernel/git/helgaas/pci.git;a=shortlog;h=refs/heads/pci/oliver-pciehp-resume
> and will merge it to "next" after Fengguang's build/smoke tests.
>
> Thanks!
>
> Bjorn
>
>> ---
>> drivers/pci/hotplug/pciehp_core.c | 28 ++++++++++++++--------------
>> drivers/pci/hotplug/pciehp_core.c | 28 ++++++++++++++--------------
>> 1 file changed, 14 insertions(+), 14 deletions(-)
>>
>> Index: linux/drivers/pci/hotplug/pciehp_core.c
>> ===================================================================
>> --- linux.orig/drivers/pci/hotplug/pciehp_core.c
>> +++ linux/drivers/pci/hotplug/pciehp_core.c
>> @@ -300,24 +300,24 @@ static int pciehp_suspend (struct pcie_d
>>
>> static int pciehp_resume (struct pcie_device *dev)
>> {
>> + struct controller *ctrl;
>> + struct slot *slot;
>> + u8 status;
>> +
>> dev_info(&dev->device, "%s ENTRY\n", __func__);
>> - if (pciehp_force) {
>> - struct controller *ctrl = get_service_data(dev);
>> - struct slot *slot;
>> - u8 status;
>> + ctrl = get_service_data(dev);
>>
>> - /* reinitialize the chipset's event detection logic */
>> - pcie_enable_notification(ctrl);
>> + /* reinitialize the chipset's event detection logic */
>> + pcie_enable_notification(ctrl);
>>
>> - slot = ctrl->slot;
>> + slot = ctrl->slot;
>>
>> - /* Check if slot is occupied */
>> - pciehp_get_adapter_status(slot, &status);
>> - if (status)
>> - pciehp_enable_slot(slot);
>> - else
>> - pciehp_disable_slot(slot);
>> - }
>> + /* Check if slot is occupied */
>> + pciehp_get_adapter_status(slot, &status);
>> + if (status)
>> + pciehp_enable_slot(slot);
>> + else
>> + pciehp_disable_slot(slot);
>> return 0;
>> }
>> #endif /* PM */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Resend][PATCH] pciehp: always implement resume
2012-09-07 23:33 ` Bjorn Helgaas
@ 2012-09-08 3:01 ` Bjorn Helgaas
0 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2012-09-08 3:01 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: LKML, Linux PM list, Greg Kroah-Hartman, Oliver Neukum,
linux-pci, Mark Lord, Kristen Carlson Accardi
[fix Kristen's email addr]
On Fri, Sep 7, 2012 at 5:33 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> +cc Mark & Kristen
>
> Commit cd2fe83a815 by Mark added the code we're changing here, so this
> is your chance to speak up if we're not doing the right thing :)
>
> On Fri, Sep 7, 2012 at 4:28 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>> On Fri, Sep 7, 2012 at 2:28 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>>> From: Oliver Neukum <oliver@neukum.org>
>>> Subject: pciehp: always implement resume
>>>
>>> The driver by default ignores resume. On some laptops
>>> that means that interrupts are not delivered after S3.
>>> So card removals and insertions will not be handled. Requiring
>>> a forced load isn't right.
>>>
>>> Signed-off-by: Oliver Neukum <oneukum@suse.de>
>>> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
>>
>> I applied this (with fixed From: email address and slightly modified
>> changelog) to http://git.kernel.org/?p=linux/kernel/git/helgaas/pci.git;a=shortlog;h=refs/heads/pci/oliver-pciehp-resume
>> and will merge it to "next" after Fengguang's build/smoke tests.
>>
>> Thanks!
>>
>> Bjorn
>>
>>> ---
>>> drivers/pci/hotplug/pciehp_core.c | 28 ++++++++++++++--------------
>>> drivers/pci/hotplug/pciehp_core.c | 28 ++++++++++++++--------------
>>> 1 file changed, 14 insertions(+), 14 deletions(-)
>>>
>>> Index: linux/drivers/pci/hotplug/pciehp_core.c
>>> ===================================================================
>>> --- linux.orig/drivers/pci/hotplug/pciehp_core.c
>>> +++ linux/drivers/pci/hotplug/pciehp_core.c
>>> @@ -300,24 +300,24 @@ static int pciehp_suspend (struct pcie_d
>>>
>>> static int pciehp_resume (struct pcie_device *dev)
>>> {
>>> + struct controller *ctrl;
>>> + struct slot *slot;
>>> + u8 status;
>>> +
>>> dev_info(&dev->device, "%s ENTRY\n", __func__);
>>> - if (pciehp_force) {
>>> - struct controller *ctrl = get_service_data(dev);
>>> - struct slot *slot;
>>> - u8 status;
>>> + ctrl = get_service_data(dev);
>>>
>>> - /* reinitialize the chipset's event detection logic */
>>> - pcie_enable_notification(ctrl);
>>> + /* reinitialize the chipset's event detection logic */
>>> + pcie_enable_notification(ctrl);
>>>
>>> - slot = ctrl->slot;
>>> + slot = ctrl->slot;
>>>
>>> - /* Check if slot is occupied */
>>> - pciehp_get_adapter_status(slot, &status);
>>> - if (status)
>>> - pciehp_enable_slot(slot);
>>> - else
>>> - pciehp_disable_slot(slot);
>>> - }
>>> + /* Check if slot is occupied */
>>> + pciehp_get_adapter_status(slot, &status);
>>> + if (status)
>>> + pciehp_enable_slot(slot);
>>> + else
>>> + pciehp_disable_slot(slot);
>>> return 0;
>>> }
>>> #endif /* PM */
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-09-08 3:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-07 21:28 [Resend][PATCH] pciehp: always implement resume Rafael J. Wysocki
2012-09-07 23:28 ` Bjorn Helgaas
2012-09-07 23:33 ` Bjorn Helgaas
2012-09-08 3:01 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).