<html><body><p><tt><font size="2">Oliver O'Halloran <oohall@gmail.com> wrote on 05/29/2019 11:36:42 PM:<br><br>> From: Oliver O'Halloran <oohall@gmail.com></font></tt><br><tt><font size="2">> To: skiboot@lists.ozlabs.org</font></tt><br><tt><font size="2">> Cc: Oliver O'Halloran <oohall@gmail.com>, Carol L Soto <clsoto@us.ibm.com></font></tt><br><tt><font size="2">> Date: 05/29/2019 11:37 PM</font></tt><br><tt><font size="2">> Subject: [EXTERNAL] [PATCH 2/2] hw/phb4: Use read/write_reg in assert_perst</font></tt><br><tt><font size="2">> <br>> While the PHB is fenced we can't use the MMIO interface to access PHB<br>> registers. While processing a complete reset we inject a PHB fence to<br>> isolate the PHB from the rest of the system because the PHB won't<br>> respond to MMIOs from the rest of the system while being reset.<br>> <br>> We assert PERST after the fence has been erected which requires us to<br>> use the XSCOM indirect interface to access the PHB registers rather than<br>> the MMIO interface. Previously we did that when asserting PERST in the<br>> CRESET path. However in b8b4c79d4419 ("hw/phb4: Factor out PERST<br>> control"). This was re-written to use the raw in_be64() accessor. This<br>> means that CRESET would not be asserted in the reset path. On some<br>> Mellanox cards this would prevent them from re-loading their firmware<br>> when the system was fast-reset.<br>> <br>> This patch fixes the problem by replacing the raw {in|out}_be64()<br>> accessors with the phb4_{read|write}_reg() functions.<br>> <br>> Reported-by: Carol L Soto <clsoto@us.ibm.com><br>> Fixes: b8b4c79d4419 ("hw/phb4: Factor out PERST control")<br>> Signed-off-by: Oliver O'Halloran <oohall@gmail.com><br>> ---<br>>  hw/phb4.c | 4 ++--<br>>  1 file changed, 2 insertions(+), 2 deletions(-)<br>> <br>> diff --git a/hw/phb4.c b/hw/phb4.c<br>> index 5ebb28ad8b0c..fb6736643ba1 100644<br>> --- a/hw/phb4.c<br>> +++ b/hw/phb4.c<br>> @@ -2924,7 +2924,7 @@ static void phb4_assert_perst(struct pci_slot <br>> *slot, bool assert)<br>>      * bit in the btctl register also works.<br>>      */<br>>     phb4_pcicfg_read16(&p->phb, 0, p->ecap + PCICAP_EXP_LCTL, &linkctl);<br>> -   reg = in_be64(p->regs + PHB_PCIE_CRESET);<br>> +   reg = phb4_read_reg(p, PHB_PCIE_CRESET);<br>>  <br>>     if (assert) {<br>>        linkctl |= PCICAP_EXP_LCTL_LINK_DIS;<br>> @@ -2934,7 +2934,7 @@ static void phb4_assert_perst(struct pci_slot <br>> *slot, bool assert)<br>>        reg |= PHB_PCIE_CRESET_PERST_N;<br>>     }<br>>  <br>> -   out_be64(p->regs + PHB_PCIE_CRESET, reg);<br>> +   phb4_write_reg(p, PHB_PCIE_CRESET, reg);<br>>     phb4_pcicfg_write16(&p->phb, 0, p->ecap + PCICAP_EXP_LCTL, linkctl);<br>>  }<br>>  <br>> -- <br>> 2.20.1<br>> </font></tt><br><tt><font size="2"><br>Tested-by</font></tt><tt><b><font size="2">: </font></b></tt><tt><font size="2">Carol L Soto <clsoto@us.ibm.com></font></tt><BR>
</body></html>