Message ID | 20190909110834.25546-2-tjaalton@ubuntu.com |
---|---|
State | New |
Headers | show |
Series | PCI: Fix wakeup from suspend on latest megaraid and mpt3sas adapters | expand |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 0925006e4449..fe43769844eb 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1413,7 +1413,7 @@ static void pci_restore_rebar_state(struct pci_dev *pdev) pci_read_config_dword(pdev, pos + PCI_REBAR_CTRL, &ctrl); bar_idx = ctrl & PCI_REBAR_CTRL_BAR_IDX; res = pdev->resource + bar_idx; - size = order_base_2((resource_size(res) >> 20) | 1) - 1; + size = ilog2(resource_size(res)) - 20; ctrl &= ~PCI_REBAR_CTRL_BAR_SIZE; ctrl |= size << PCI_REBAR_CTRL_BAR_SHIFT; pci_write_config_dword(pdev, pos + PCI_REBAR_CTRL, ctrl);