From patchwork Fri Apr 19 18:34:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13636733 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D1CE10A03 for ; Fri, 19 Apr 2024 18:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713551705; cv=none; b=Df1vpf93P+RCyhpH9aO+gO1iJU2wsOZNd9Z+wGwkU77n46PnjltQKBQAtX3EGdBjKDvOLQW3v9L0Fr1wHSYKWEX2GUaGMyAdQkw8yFTbcnlyL3Fxf9h3zJXLQC+pBmLT5ztVnGb2sLNfHgaP1lmxvRXm9trlrf3gYZjpgaWSCJQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713551705; c=relaxed/simple; bh=tNSpeayRP9hMqeH9ufxKp8Sll7GtVqm4Y9biatZr8xM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=b17L3cUVWDI7jLyAu1p+3P4/46lSmP5cNCsT4BesMXLgbe6uRNV6BpKLvwoZ/LSBWDa94GT2Xc3H13jopsxPoWTnrlGiHWnPKqhitdM0EFRmhb4Qf6lzwZum8SjqC5moKsO4Xi+YBfDHniOp0uaWaZ5UMAE2QuBSjMIT6JK05kc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=Zy8Mk4WK; arc=none smtp.client-ip=209.85.128.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="Zy8Mk4WK" Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-61587aa956eso26091267b3.1 for ; Fri, 19 Apr 2024 11:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1713551703; x=1714156503; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=7htb1aplR6vt9S5Qo8TMFQ/MfY1/e58bVBq6OlDUAes=; b=Zy8Mk4WKCZ+gxdFJ/E/nBgJGCTJSp+MuodqB748oG1qYXfdSck9TjXHeb5Knc4R7w1 PiMmbiILpY3P5Rpv8pp3Td2dMlRqxXKq6K2TfdDGo+4JwLltcwXnV+oJaMSMjf9XTl0R GX49kzMWke8BE2jcZrVRW+qstYHzw5k7er3BE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713551703; x=1714156503; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7htb1aplR6vt9S5Qo8TMFQ/MfY1/e58bVBq6OlDUAes=; b=g/lRh4P6RkG3IS8Maqh8vjvUp8VV+8SgW5lJiZtlzA143tNFT+7QisUZuuMj9wuwpy IUVenU0ObTQvRpJpCv7y1dtVA3bpXNzMqmJdFV8tmOAnnViK6YDjQz99uNP1412Cx2/k rg2ulNbHawraOUzQs8v5pYHH+I7xykmVwE6/pDxuDQPlFSLh2LSeipVu1b+aOVU4v9mP tbeD0P+/QPFK73lsgGvXc0pzxACyxOYgGWjXGp6MYXoSRPxkdruAvP2pVXz6RRz7BjZz eWZ/ccGW3VTyy871oIBC0BocwbR/suR2fi/5XhjPe4buks4rd/eVjoHdQZC0+ZZ1VFst X/Zw== X-Gm-Message-State: AOJu0YxPze0RTbrBb5nW1wtHGVnd8xYJib7KptFiFabJTBtXwNDE6sy1 knyjh0Iu//opeoZRzs3T3AbyKHP68sBCvQ5ieypFnXBW6HQUv7scbhzWE3IepA== X-Google-Smtp-Source: AGHT+IEuQlkNeNohQH3JHpVkifGRwfR/v946GaY/EW51WY02mTd9i6Hn45bdBdV2qfYqIcrqve8tLQ== X-Received: by 2002:a05:690c:3513:b0:61a:fe34:18b6 with SMTP id fq19-20020a05690c351300b0061afe3418b6mr3410080ywb.21.1713551702464; Fri, 19 Apr 2024 11:35:02 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id d12-20020ac851cc000000b00438527a4eb5sm547940qtn.10.2024.04.19.11.35.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Apr 2024 11:35:01 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew.gospodarek@broadcom.com, Vikas Gupta Subject: [PATCH net 1/3] bnxt_en: refactor reset close code Date: Fri, 19 Apr 2024 11:34:47 -0700 Message-Id: <20240419183449.234327-2-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20240419183449.234327-1-michael.chan@broadcom.com> References: <20240419183449.234327-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Vikas Gupta Introduce bnxt_fw_fatal_close() API which can be used to stop data path and disable device when firmware is in fatal state. Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 57e61f963167..c852f87c842f 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -13037,6 +13037,16 @@ static void bnxt_rx_ring_reset(struct bnxt *bp) bnxt_rtnl_unlock_sp(bp); } +static void bnxt_fw_fatal_close(struct bnxt *bp) +{ + bnxt_tx_disable(bp); + bnxt_disable_napi(bp); + bnxt_disable_int_sync(bp); + bnxt_free_irq(bp); + bnxt_clear_int_mode(bp); + pci_disable_device(bp->pdev); +} + static void bnxt_fw_reset_close(struct bnxt *bp) { bnxt_ulp_stop(bp); @@ -13050,12 +13060,7 @@ static void bnxt_fw_reset_close(struct bnxt *bp) pci_read_config_word(bp->pdev, PCI_SUBSYSTEM_ID, &val); if (val == 0xffff) bp->fw_reset_min_dsecs = 0; - bnxt_tx_disable(bp); - bnxt_disable_napi(bp); - bnxt_disable_int_sync(bp); - bnxt_free_irq(bp); - bnxt_clear_int_mode(bp); - pci_disable_device(bp->pdev); + bnxt_fw_fatal_close(bp); } __bnxt_close_nic(bp, true, false); bnxt_vf_reps_free(bp); From patchwork Fri Apr 19 18:34:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13636734 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FD4FA947 for ; Fri, 19 Apr 2024 18:35:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713551707; cv=none; b=Ugzgl5ACw3YYV1ctKBPOKNTYRZg8JabFcDaAzCCj4u91lr5zaIXB7YIycfjQ/bGfFq3tiLX6qWla6agb4lOsiIxsEOuxgmPidBQp8kA7jq9EeMdUMrLcy9184oyiW/iwJ/QcgDbIyPoI75LJvjr0PfXG5WCJeKR6WGT970P4g4U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713551707; c=relaxed/simple; bh=ODLBCNi+4XTn+x2Q1U9bu0/Py42RFeA0vPUT2NsUuWs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=YTx057lhZKUyJv2rGfdP40vahAQkjEQEYzxgmky95CiJEVSRukmfP4SmWm4xwVT9gvuBl8SITERSXGGBw/QfDqLNM7Z+DjugDHg5XxceapVCYyCx3acVMTJbuoVptlxBG4sc6nPDvyWfMBNdwXR0tLbu0xxbkDy1S0bGq6cgPAo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=AfZqiIGP; arc=none smtp.client-ip=209.85.222.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="AfZqiIGP" Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-78d62c1e82bso160107985a.3 for ; Fri, 19 Apr 2024 11:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1713551704; x=1714156504; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=+CnqHY/Y8Xc8FYH1/QaGZHUgrrfdXNTtT3SYEC309Bg=; b=AfZqiIGP9ClqCV1fRKLQpCmruxbwnet/UEw/DJpAKOZNqHAW1atyAvHG+V2Pl7fKso kpb/d70jVTE5NhLN6Qua7h9J/Zq+/78dV2f/N+e67RAQUk4wm9uUEQ2D+f4tQiNkEf6U /jxOnhZAV45PW+YMfbsGhP40fM3k+9Lxibalw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713551704; x=1714156504; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+CnqHY/Y8Xc8FYH1/QaGZHUgrrfdXNTtT3SYEC309Bg=; b=T0P+DPF1RphB7cQm1Dw+x2fFV/1ZMjVZU3jbHL8KRNGP1jSQGrHAsH5w+JJ6nB9b8E u4PicgJwxJHASLdZqJ3Ms5lTESl4leBuA+CZrcWWQgqVa4fpi2x7D4M9I0ZxFIQYhtox vsGs9y2BtvHI8q3LqDTgmhR9bOjZ8Y5NoTcZss4UaSf67G3tyUv1YI4EFN4HayRtRpuw jjhyzm7DkZIwUuBr7vvh13+h9la1A0qA6K5CVx81YcdwK4AFtVyh3tGOWx2cwWaNBf4r rIM3CMeHn4hjBm0JBMJhBM4ru2e5qIPjXGNxI7/xmDzRlbitS/AQ582UWweqk3kuyMJl 9Ipg== X-Gm-Message-State: AOJu0Yw4ilwHvx0zsQw59udg7X31a+F6S1iQ0Nsf/6clcw+1Py+LvHLO 4pEKlE7S5++xVQQRkf/nqqqIp+M7d+CiwQQkLRb9Z21TL1dGhEARX5uI/7lHtA== X-Google-Smtp-Source: AGHT+IGsqeFmIa9meB4mY5UWFlLAg9zbgss7Q2BgAulSfFoCMWE6cfelOEi6Glb6ay9nTwf+hO23sQ== X-Received: by 2002:a05:622a:87:b0:436:df6a:dcab with SMTP id o7-20020a05622a008700b00436df6adcabmr3632111qtw.46.1713551704240; Fri, 19 Apr 2024 11:35:04 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id d12-20020ac851cc000000b00438527a4eb5sm547940qtn.10.2024.04.19.11.35.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Apr 2024 11:35:03 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew.gospodarek@broadcom.com, Vikas Gupta Subject: [PATCH net 2/3] bnxt_en: Fix the PCI-AER routines Date: Fri, 19 Apr 2024 11:34:48 -0700 Message-Id: <20240419183449.234327-3-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20240419183449.234327-1-michael.chan@broadcom.com> References: <20240419183449.234327-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Vikas Gupta We do not support two simultaneous recoveries so check for reset flag, BNXT_STATE_IN_FW_RESET, and do not proceed with AER further. When the pci channel state is pci_channel_io_frozen, the PCIe link can not be trusted so we disable the traffic immediately and stop BAR access by calling bnxt_fw_fatal_close(). BAR access after AER fatal error can cause an NMI. Fixes: f75d9a0aa967 ("bnxt_en: Re-write PCI BARs after PCI fatal error.") Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index c852f87c842f..86c1c30c70d5 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -15378,6 +15378,7 @@ static pci_ers_result_t bnxt_io_error_detected(struct pci_dev *pdev, { struct net_device *netdev = pci_get_drvdata(pdev); struct bnxt *bp = netdev_priv(netdev); + bool abort = false; netdev_info(netdev, "PCI I/O error detected\n"); @@ -15386,16 +15387,27 @@ static pci_ers_result_t bnxt_io_error_detected(struct pci_dev *pdev, bnxt_ulp_stop(bp); - if (state == pci_channel_io_perm_failure) { + if (test_and_set_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) { + netdev_err(bp->dev, "Firmware reset already in progress\n"); + abort = true; + } + + if (abort || state == pci_channel_io_perm_failure) { rtnl_unlock(); return PCI_ERS_RESULT_DISCONNECT; } - if (state == pci_channel_io_frozen) + /* Link is not reliable anymore if state is pci_channel_io_frozen + * so we disable bus master to prevent any potential bad DMAs before + * freeing kernel memory. + */ + if (state == pci_channel_io_frozen) { set_bit(BNXT_STATE_PCI_CHANNEL_IO_FROZEN, &bp->state); + bnxt_fw_fatal_close(bp); + } if (netif_running(netdev)) - bnxt_close(netdev); + __bnxt_close_nic(bp, true, true); if (pci_is_enabled(pdev)) pci_disable_device(pdev); @@ -15479,6 +15491,7 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) } reset_exit: + clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state); bnxt_clear_reservations(bp, true); rtnl_unlock(); From patchwork Fri Apr 19 18:34:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13636735 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-yw1-f177.google.com (mail-yw1-f177.google.com [209.85.128.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2568E10A03 for ; Fri, 19 Apr 2024 18:35:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713551708; cv=none; b=UaxtKHSnrKiFTnZYu5XuzUAUQQEnihWvf6E9jwmF/7kkiwB1OqekHtGhtSQIAkHCtl3Xl7BcH5c9skno2gKBK0IoHdtiaoYDeK3OZSHDdghXqi/9LGwK6Cd4vL/rK4BJWXDpWDUOpeReKniAdoH6y6SfndeYSq8KVBmSJ0wmmuI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713551708; c=relaxed/simple; bh=Ml8/937jFhye0y3Yf/vPWhjimX4yDAH5Z7hfITWUiI0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=GQDiApy1uTOyofujRNm4G9rNFYRQEh0kHdkca1emPh07mkXv6YWz8oGMKfMJEe6SBL/qrB7lcG+vqH7QUuzmGFtTo5y7VbfK8ZBRDX2H7jRE0cukfATW6VK5B64tGzCiTXxEdBYhbNqaujWBUI1FMjVSd1zVCF3b8uYZPAwdBqQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=gA6MWDdT; arc=none smtp.client-ip=209.85.128.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="gA6MWDdT" Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-618944792c3so25597477b3.1 for ; Fri, 19 Apr 2024 11:35:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1713551706; x=1714156506; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=YuVotY1Y4abWTYP7W/0CLEsNrurxmM2C4qIEgMh1E8w=; b=gA6MWDdTs1pztH9P9sHzLC1UQlQ3BzoSLGLGtT+dKVbttxsC7QTRlIRQ5hU/wAq0RE /UkCyZLLRjAu9FKd9KcDYBaHtzZk0Wi1U8zHWWWaUAVZuRu3Gy6F/DoabIz1WUR6f5S1 Iu+BbqUOyDFnlXE0Jrf3SFNrocgEeQQrUlnsg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713551706; x=1714156506; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YuVotY1Y4abWTYP7W/0CLEsNrurxmM2C4qIEgMh1E8w=; b=wG9wm5k1hQRBzi5aKZQQEapNzLIlCHtAL6kFiTlXAUeKw+M3L3OVZxvO1UEkdR5FFY vrFsyvTV1wp5HmazaNcwsKVY7/r3Dkchhef0V3CKeJxxpW0qjaygCT9et84FFFhfQxP8 E3YH61wLmNY5yKnziIM5id+l6Vdk9rqc64QXSmdplFTCF2f4O6VWY6yvy8Pn8J7q2w49 dYA7emkZ7tYMUpQJakyozuYMJIyMdZRRdSV19e2/OQ4sW4u+5jkpbd49gKUdLkZtJO9p MVSoSQHbJQqc1HIMJ4EMVY9e4KAm6MI/UN0ir6OSFTTms9uKdcRchtCZveSEpTI3Fd2z 3YuQ== X-Gm-Message-State: AOJu0YyLYWHhV+nb1745xrWAhaRUkb7v9NXagaq1IBUkB89QjfiRf6Yk u0UQgZ567jUu9hq5JbQygMVscP26q/7jARrodN8CaWcrWrgh5f1nLuexNjf5TA== X-Google-Smtp-Source: AGHT+IF5EUhfB0YxiEUOm70nDGztNDk9kaIlemTB9vV8DA+32lu6CAAL3tC8Y8X3vRqjjDiEUSQC+g== X-Received: by 2002:a05:690c:fd6:b0:614:cd12:d55d with SMTP id dg22-20020a05690c0fd600b00614cd12d55dmr3463286ywb.10.1713551705891; Fri, 19 Apr 2024 11:35:05 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id d12-20020ac851cc000000b00438527a4eb5sm547940qtn.10.2024.04.19.11.35.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Apr 2024 11:35:05 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew.gospodarek@broadcom.com Subject: [PATCH net 3/3] bnxt_en: Fix error recovery for 5760X (P7) chips Date: Fri, 19 Apr 2024 11:34:49 -0700 Message-Id: <20240419183449.234327-4-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20240419183449.234327-1-michael.chan@broadcom.com> References: <20240419183449.234327-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org During error recovery, such as AER fatal error slot reset, we call bnxt_try_map_fw_health_reg() to try to get access to the health register to determine the firmware state. Fix bnxt_try_map_fw_health_reg() to recognize the P7 chip correctly and set up the health register. This fixes this type of AER slot reset failure: bnxt_en 0000:04:00.0: AER: PCIe Bus Error: severity=Uncorrectable (Fatal), type=Inaccessible, (Unregistered Agent ID) bnxt_en 0000:04:00.0 enp4s0f0np0: PCI I/O error detected bnxt_en 0000:04:00.0 bnxt_re0: Handle device suspend call bnxt_en 0000:04:00.1 enp4s0f1np1: PCI I/O error detected bnxt_en 0000:04:00.1 bnxt_re1: Handle device suspend call pcieport 0000:00:02.0: AER: Root Port link has been reset (0) bnxt_en 0000:04:00.0 enp4s0f0np0: PCI Slot Reset bnxt_en 0000:04:00.0: enabling device (0000 -> 0002) bnxt_en 0000:04:00.0: Firmware not ready bnxt_en 0000:04:00.1 enp4s0f1np1: PCI Slot Reset bnxt_en 0000:04:00.1: enabling device (0000 -> 0002) bnxt_en 0000:04:00.1: Firmware not ready pcieport 0000:00:02.0: AER: device recovery failed Fixes: a432a45bdba4 ("bnxt_en: Define basic P7 macros") Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 86c1c30c70d5..ed04a90a4fdd 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -9089,7 +9089,7 @@ static void bnxt_try_map_fw_health_reg(struct bnxt *bp) BNXT_FW_HEALTH_WIN_BASE + BNXT_GRC_REG_CHIP_NUM); } - if (!BNXT_CHIP_P5(bp)) + if (!BNXT_CHIP_P5_PLUS(bp)) return; status_loc = BNXT_GRC_REG_STATUS_P5 |