Re: [PATCH] pci: Ensure we re-enable devices on resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks good to me. Thanks for doing this, Matthew.

Acked-by: Alex Chiang <achiang@xxxxxxxxxxxxx>

/ac

* Matthew Garrett <mjg@xxxxxxxxxx>:
> If the firmware puts a device back into D0 state at resume time, we'll
> update its state in resume_noirq and thus skip the platform resume code.
> Calling that code twice should be safe and we ought to avoid getting to
> that point anyway, so remove the check and also allow the platform pci
> code to be called for D0.
> 
> Fixes USB not being powered after resume on recent Lenovo machines.
> 
> Signed-off-by: Matthew Garrett <mjg@xxxxxxxxxx>
> ---
>  drivers/pci/pci.c |    6 +-----
>  1 files changed, 1 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 5ea587e..3749912 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -679,7 +679,7 @@ static void __pci_start_power_transition(struct pci_dev *dev, pci_power_t state)
>   */
>  int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state)
>  {
> -	return state > PCI_D0 ?
> +	return state >= PCI_D0 ?
>  			pci_platform_power_transition(dev, state) : -EINVAL;
>  }
>  EXPORT_SYMBOL_GPL(__pci_complete_power_transition);
> @@ -716,10 +716,6 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
>  		 */
>  		return 0;
>  
> -	/* Check if we're already there */
> -	if (dev->current_state == state)
> -		return 0;
> -
>  	__pci_start_power_transition(dev, state);
>  
>  	/* This device is quirked not to be put into D3, so
> -- 
> 1.7.0.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux