lkml.org 
[lkml]   [2021]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.13 104/223] bnxt_en: dont disable an already disabled PCI device
    Date
    From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

    [ Upstream commit c81cfb6256d90ea5ba4a6fb280ea3b171be4e05c ]

    If device is already disabled in reset path and PCI io error is
    detected before the device could be enabled, driver could
    call pci_disable_device() for already disabled device. Fix this
    problem by calling pci_disable_device() only if the device is already
    enabled.

    Fixes: 6316ea6db93d ("bnxt_en: Enable AER support.")
    Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
    Signed-off-by: Michael Chan <michael.chan@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
    index aef3fccc27a9..d57fb1613cfc 100644
    --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
    +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
    @@ -13315,7 +13315,8 @@ static pci_ers_result_t bnxt_io_error_detected(struct pci_dev *pdev,
    if (netif_running(netdev))
    bnxt_close(netdev);

    - pci_disable_device(pdev);
    + if (pci_is_enabled(pdev))
    + pci_disable_device(pdev);
    bnxt_free_ctx_mem(bp);
    kfree(bp->ctx);
    bp->ctx = NULL;
    --
    2.30.2


    \
     
     \ /
      Last update: 2021-07-26 18:33    [W:6.823 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site