lkml.org 
[lkml]   [2018]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL for 4.9 162/281] cxgb4: FW upgrade fixes
    Date
    From: Arjun Vynipadath <arjun@chelsio.com>

    [ Upstream commit 26747211486c5bc7dd014c3caab206576e00c0d0 ]

    Disable FW_OK flag while flashing Firmware. This will help to fix any
    potential mailbox timeouts during Firmware flash.

    Grab new devlog parameters after Firmware restart. When we FLASH new
    Firmware onto an adapter, the new Firmware may have the Firmware Device Log
    located at a different memory address or have a different size for it.

    Signed-off-by: Arjun Vynipadath <arjun@chelsio.com>
    Signed-off-by: Casey Leedom <leedom@chelsio.com>
    Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    ---
    drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 21 ++++++++++++++++++---
    1 file changed, 18 insertions(+), 3 deletions(-)

    diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
    index 6fd3be69ff21..24d391899730 100644
    --- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
    +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
    @@ -6185,13 +6185,18 @@ int t4_fw_upgrade(struct adapter *adap, unsigned int mbox,
    if (!t4_fw_matches_chip(adap, fw_hdr))
    return -EINVAL;

    + /* Disable FW_OK flag so that mbox commands with FW_OK flag set
    + * wont be sent when we are flashing FW.
    + */
    + adap->flags &= ~FW_OK;
    +
    ret = t4_fw_halt(adap, mbox, force);
    if (ret < 0 && !force)
    - return ret;
    + goto out;

    ret = t4_load_fw(adap, fw_data, size);
    if (ret < 0)
    - return ret;
    + goto out;

    /*
    * Older versions of the firmware don't understand the new
    @@ -6202,7 +6207,17 @@ int t4_fw_upgrade(struct adapter *adap, unsigned int mbox,
    * its header flags to see if it advertises the capability.
    */
    reset = ((be32_to_cpu(fw_hdr->flags) & FW_HDR_FLAGS_RESET_HALT) == 0);
    - return t4_fw_restart(adap, mbox, reset);
    + ret = t4_fw_restart(adap, mbox, reset);
    +
    + /* Grab potentially new Firmware Device Log parameters so we can see
    + * how healthy the new Firmware is. It's okay to contact the new
    + * Firmware for these parameters even though, as far as it's
    + * concerned, we've never said "HELLO" to it ...
    + */
    + (void)t4_init_devlog_params(adap);
    +out:
    + adap->flags |= FW_OK;
    + return ret;
    }

    /**
    --
    2.14.1
    \
     
     \ /
      Last update: 2018-03-19 17:03    [W:6.614 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site