From patchwork Mon Apr 17 06:58:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13213360 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C441FC77B76 for ; Mon, 17 Apr 2023 06:58:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230315AbjDQG6i (ORCPT ); Mon, 17 Apr 2023 02:58:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230280AbjDQG6g (ORCPT ); Mon, 17 Apr 2023 02:58:36 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F11FA1BD2 for ; Sun, 16 Apr 2023 23:58:35 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id y6so23522883plp.2 for ; Sun, 16 Apr 2023 23:58:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1681714715; x=1684306715; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=bJr0nUKynJSjfhCdpbMNwui39LJrsOhhL2hWRXOky8s=; b=RORFeHnRbbxQYDlIAovXk0W3iScPDnVAV9oxpEY7+FuMQ2NJ8+NbS6/ZH5f0CCxFil pTRSD//5g2MRQNd3W8fCnhthqUGyXXBwLaclQl5YybQLInsfRWB0HoyZNWChAqcPotKO NjR06upEFBPWbEiSf9SjQ/HkhzEAZ71HciWLE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681714715; x=1684306715; 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=bJr0nUKynJSjfhCdpbMNwui39LJrsOhhL2hWRXOky8s=; b=jS7EPHujWNMXklCwELrVYMSXYifbipw9BB+YksPO28/LCYK4gNWxFjvMu3ggc75TFy phXKKH8RCpeuYAf3fsDJNVrhheMfxFR7CSPbzypoQRc7aMPFeByLBuGp+/ma7aFgTP9R zMVLgmlu1Z4K1yOHwTrRGS+jZhsg2cQXvzgLV8gJEjpiSFl5hSYJgyOi02mNpxhJBnub C7cSfxS78/o406WiwMD2MkX129fYk5aspGdq6EAjonflQbo3JlS8ZXA+byK7/gToCH8W 1iHruJ4dmSpWcjIcDlk8OR0HFW3a2uctlse+HZ5AKdkVUptJgUAx9eNv8qcHzMmvchTc C7Aw== X-Gm-Message-State: AAQBX9cllnQ6yWiLp3mQfiUOcqlTW2YYmjY2eANO4le/GKyxSY33vw1X Cb3ydwLKVBGz5LpIXPHFE+SMiQ== X-Google-Smtp-Source: AKy350ZH7GrA8jgz4X57m5jpW9E6pEYfe31bQYPPFCrd96bIdWKzX9nl9CQTxZr46qU5mwbg984kTg== X-Received: by 2002:a05:6a20:3d8c:b0:ee:6dc9:e794 with SMTP id s12-20020a056a203d8c00b000ee6dc9e794mr11745561pzi.56.1681714715009; Sun, 16 Apr 2023 23:58:35 -0700 (PDT) Received: from lvnvda1597.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id h15-20020a17090a050f00b00247abbb157fsm374132pjh.31.2023.04.16.23.58.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Apr 2023 23:58:34 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com Subject: [PATCH net 1/2] bnxt_en: Do not initialize PTP on older P3/P4 chips Date: Sun, 16 Apr 2023 23:58:18 -0700 Message-Id: <20230417065819.122055-2-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230417065819.122055-1-michael.chan@broadcom.com> References: <20230417065819.122055-1-michael.chan@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The driver does not support PTP on these older chips and it is assuming that firmware on these older chips will not return the PORT_MAC_PTP_QCFG_RESP_FLAGS_HWRM_ACCESS flag in __bnxt_hwrm_ptp_qcfg(), causing the function to abort quietly. But newer firmware now sets this flag and so __bnxt_hwrm_ptp_qcfg() will proceed further. Eventually it will fail in bnxt_ptp_init() -> bnxt_map_ptp_regs() because there is no code to support the older chips. The driver will then complain: "PTP initialization failed.\n" Fix it so that we abort quietly earlier without going through the unnecessary steps and alarming the user with the warning log. Fixes: ae5c42f0b92c ("bnxt_en: Get PTP hardware capability from firmware") 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 c23e3b397bcf..ef97a4190b39 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -7627,7 +7627,7 @@ static int __bnxt_hwrm_ptp_qcfg(struct bnxt *bp) u8 flags; int rc; - if (bp->hwrm_spec_code < 0x10801) { + if (bp->hwrm_spec_code < 0x10801 || !BNXT_CHIP_P5_THOR(bp)) { rc = -ENODEV; goto no_ptp; }