[SRU][D/E/OEM-OSP1-B][PATCH 0/1] PCI: Fix wakeup from suspend on latest megaraid and mpt3sas adapters

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU][D/E/OEM-OSP1-B][PATCH 0/1] PCI: Fix wakeup from suspend on latest megaraid and mpt3sas adapters

Timo Aaltonen-6
BugLink: http://bugs.launchpad.net/bugs/1838751

Latest megaraid_sas and mpt3sas adapters which support Resizable BAR with 1 MB BAR size fail to
initialize during system resume from S3 sleep.

Sumit Saxena (1):
  PCI: Restore Resizable BAR size bits correctly for 1MB BARs

 drivers/pci/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.20.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/1] PCI: Restore Resizable BAR size bits correctly for 1MB BARs

Timo Aaltonen-6
From: Sumit Saxena <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1838751

In a Resizable BAR Control Register, bits 13:8 control the size of the BAR.
The encoded values of these bits are as follows (see PCIe r5.0, sec
7.8.6.3):

  Value    BAR size
     0     1 MB (2^20 bytes)
     1     2 MB (2^21 bytes)
     2     4 MB (2^22 bytes)
   ...
    43     8 EB (2^63 bytes)

Previously we incorrectly set the BAR size bits for a 1 MB BAR to 0x1f
instead of 0, so devices that support that size, e.g., new megaraid_sas and
mpt3sas adapters, fail to initialize during resume from S3 sleep.

Correctly calculate the BAR size bits for Resizable BAR control registers.

Link: https://lore.kernel.org/r/20190725192552.24295-1-sumit.saxena@...
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203939
Fixes: d3252ace0bc6 ("PCI: Restore resized BAR state on resume")
Signed-off-by: Sumit Saxena <[hidden email]>
Signed-off-by: Bjorn Helgaas <[hidden email]>
Reviewed-by: Christian K├Ânig <[hidden email]>
Cc: [hidden email] # v4.19+
(cherry-picked from linux-next d2182b2d4b71ff0549a07f414d921525fade707b)
Signed-off-by: Timo Aaltonen <[hidden email]>
---
 drivers/pci/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
--
2.20.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK/cmt / APPLIED[E]: [SRU][D/E/OEM-OSP1-B][PATCH 0/1] PCI: Fix wakeup from suspend on latest megaraid and mpt3sas adapters

Seth Forshee
In reply to this post by Timo Aaltonen-6
On Mon, Sep 09, 2019 at 02:08:33PM +0300, Timo Aaltonen wrote:
> BugLink: http://bugs.launchpad.net/bugs/1838751
>
> Latest megaraid_sas and mpt3sas adapters which support Resizable BAR with 1 MB BAR size fail to
> initialize during system resume from S3 sleep.

Simple fix from linux-next. Note that the "cherry picked from ..." line
needs to be changed so that linux-next is after the sha1; placing it in
the middle as you have done confuses some of our tooling. With that
fixed:

Acked-by: Seth Forshee <[hidden email]>

Applied to eoan/master-next, thanks!

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED [OEM-OSP1-B] Re: [SRU][D/E/OEM-OSP1-B][PATCH 0/1] PCI: Fix wakeup from suspend on latest megaraid and mpt3sas adapters

Timo Aaltonen-6
In reply to this post by Timo Aaltonen-6
On 9.9.2019 14.08, Timo Aaltonen wrote:

> BugLink: http://bugs.launchpad.net/bugs/1838751
>
> Latest megaraid_sas and mpt3sas adapters which support Resizable BAR with 1 MB BAR size fail to
> initialize during system resume from S3 sleep.
>
> Sumit Saxena (1):
>   PCI: Restore Resizable BAR size bits correctly for 1MB BARs
>
>  drivers/pci/pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

just for the record, this was applied to oem-next


--
t

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][D/E/OEM-OSP1-B][PATCH 0/1] PCI: Fix wakeup from suspend on latest megaraid and mpt3sas adapters

Connor Kuehl
In reply to this post by Timo Aaltonen-6
On 9/9/19 4:08 AM, Timo Aaltonen wrote:

> BugLink: http://bugs.launchpad.net/bugs/1838751
>
> Latest megaraid_sas and mpt3sas adapters which support Resizable BAR with 1 MB BAR size fail to
> initialize during system resume from S3 sleep.
>
> Sumit Saxena (1):
>    PCI: Restore Resizable BAR size bits correctly for 1MB BARs
>
>   drivers/pci/pci.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>

+1 for Seth's suggestion on the cherry pick line when applying.

Acked-by: Connor Kuehl <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED[D]/cmnt: [SRU][D/E/OEM-OSP1-B][PATCH 0/1] PCI: Fix wakeup from suspend on latest megaraid and mpt3sas adapters

Kleber Souza
In reply to this post by Timo Aaltonen-6
On 09.09.19 13:08, Timo Aaltonen wrote:

> BugLink: http://bugs.launchpad.net/bugs/1838751
>
> Latest megaraid_sas and mpt3sas adapters which support Resizable BAR with 1 MB BAR size fail to
> initialize during system resume from S3 sleep.
>
> Sumit Saxena (1):
>   PCI: Restore Resizable BAR size bits correctly for 1MB BARs
>
>  drivers/pci/pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Applied to disco/master-next branch. The patch was already merged to
Linus' tree, so I removed the 'linux-next' reference.

Thanks,
Kleber


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team