lkml.org 
[lkml]   [2022]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v1 06/11] PCI/PM: Write 0 to PMCSR in pci_power_up() in all cases
    Date
    From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

    Make pci_power_up() write 0 to the device's PCI_PM_CTRL register in
    order to put it into D0 regardless of the power state returned by
    the previous read from that register which should not matter.

    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    ---
    drivers/pci/pci.c | 11 +++--------
    1 file changed, 3 insertions(+), 8 deletions(-)

    Index: linux-pm/drivers/pci/pci.c
    ===================================================================
    --- linux-pm.orig/drivers/pci/pci.c
    +++ linux-pm/drivers/pci/pci.c
    @@ -1230,15 +1230,10 @@ int pci_power_up(struct pci_dev *dev)
    }

    /*
    - * If we're (effectively) in D3, force entire word to 0. This doesn't
    - * affect PME_Status, disables PME_En, and sets PowerState to 0.
    + * Force the entire word to 0. This doesn't affect PME_Status, disables
    + * PME_En, and sets PowerState to 0.
    */
    - if (state == PCI_D3hot)
    - pmcsr = 0;
    - else
    - pmcsr &= ~PCI_PM_CTRL_STATE_MASK;
    -
    - pci_write_config_word(dev, dev->pm_cap + PCI_PM_CTRL, pmcsr);
    + pci_write_config_word(dev, dev->pm_cap + PCI_PM_CTRL, 0);

    /* Mandatory transition delays; see PCI PM 1.2. */
    if (state == PCI_D3hot)



    \
     
     \ /
      Last update: 2022-05-05 20:33    [W:4.524 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site