From patchwork Tue Mar 21 14:44:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Chebbi X-Patchwork-Id: 13182858 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 C7793C74A5B for ; Tue, 21 Mar 2023 14:45:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231486AbjCUOpK (ORCPT ); Tue, 21 Mar 2023 10:45:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231342AbjCUOpI (ORCPT ); Tue, 21 Mar 2023 10:45:08 -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 206016EB3 for ; Tue, 21 Mar 2023 07:45:07 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id ja10so16256839plb.5 for ; Tue, 21 Mar 2023 07:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1679409906; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=eWQ0HPYNYteMO93/M4Zikz+Lj/SeghpUU79WHXcvQPE=; b=B4z7UvEFX9AqUWEUGTvJvKiHURv3lWMhNrEjmJRFYq8qI8c1JR/4n5lNlaCRukxc3m 2T9DCyZFq9gCnsTGjnbZADvTizH86kLU08wmEY4BVOhx5tcC8OipiXdx22P6tELgLiNY cFLCfNpY40HISMkmW5P7JxBY0ncVpAsDq/ziE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679409906; 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=eWQ0HPYNYteMO93/M4Zikz+Lj/SeghpUU79WHXcvQPE=; b=R/2yaj2yDS7YyTC9d6DANwrbayfu1c3JLILlXQMKl3zlEckxVXoxl0UxCv+8Tos4nG 2Tnr4eF+r4K5Gf+5XXDayQzePs86ms/t7LwsPFfAJQE8kmtBNZxhKSgvDGuVLhIozfNw 9m8X4YQ04ainUqaX/G4v0cqKdMjoMJp6MZciDXE+DKK4aOfvXvipDGsyZ77meTtmk/yj xWZNwK7txwgrYQbfa3RtPYV55vXijKh7ky/e11F9xQc5rV2w/Q5EFb/cbwpmyW3uyUax tfqywt3Yz8M+QiI6DDEB9SrIt1YLS0KbZvZqSSosW/z+/woD7DLeEmZUPfxXFyziuiYY 3NjA== X-Gm-Message-State: AO0yUKXNQNJJuorpT3nv8ny9GLXEhoBte+pQGiD6Ocq2k11UxM2YcD1n lWfrlLhLzZBFWlToD3an/vyICQ== X-Google-Smtp-Source: AK7set+Y4/SxyEKd6+XadxAA4zPtXcnSBk3OXF7PHoQ4QdJvtcGnFYIu/ZSseTBE9w+a0xxrBWLqiQ== X-Received: by 2002:a17:90b:224d:b0:23e:fc9c:930 with SMTP id hk13-20020a17090b224d00b0023efc9c0930mr3081363pjb.36.1679409906509; Tue, 21 Mar 2023 07:45:06 -0700 (PDT) Received: from PC-MID-R740.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id h13-20020a170902f7cd00b0019d1f42b00csm8834243plw.17.2023.03.21.07.45.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 07:45:05 -0700 (PDT) From: Pavan Chebbi To: michael.chan@broadcom.com, kuba@kernel.org Cc: davem@davemloft.net, edumazet@google.com, gospo@broadcom.com, netdev@vger.kernel.org, pabeni@redhat.com, richardcochran@gmail.com, Pavan Chebbi Subject: [PATCH net-next v2 2/3] bnxt: Defer PTP initialization to after querying function caps Date: Tue, 21 Mar 2023 07:44:48 -0700 Message-Id: <20230321144449.15289-3-pavan.chebbi@broadcom.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230321144449.15289-1-pavan.chebbi@broadcom.com> References: <20230321144449.15289-1-pavan.chebbi@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Driver uses the flag BNXT_FLAG_MULTI_HOST to determine whether to use non-realtime mode PHC when running on a multi host NIC. However when ptp initializes on a NIC with shared PHC, we still don't have this flag set yet because HWRM_FUNC_QCFG is issued much later. Move the ptp initialization code after we have issued func_qcfg. The next patch will use the BNXT_FLAG_MULTI_HOST flag during PTP initialization. Signed-off-by: Pavan Chebbi Reviewed-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 +++- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index f533a8f46217..656a28ac2ff0 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -7769,7 +7769,7 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) if (flags & FUNC_QCAPS_RESP_FLAGS_WOL_MAGICPKT_SUPPORTED) bp->flags |= BNXT_FLAG_WOL_CAP; if (flags & FUNC_QCAPS_RESP_FLAGS_PTP_SUPPORTED) { - __bnxt_hwrm_ptp_qcfg(bp); + bp->fw_cap |= BNXT_FW_CAP_PTP; } else { bnxt_ptp_clear(bp); kfree(bp->ptp_cfg); @@ -12298,6 +12298,8 @@ static int bnxt_fw_init_one_p2(struct bnxt *bp) bnxt_hwrm_vnic_qcaps(bp); bnxt_hwrm_port_led_qcaps(bp); bnxt_ethtool_init(bp); + if (bp->fw_cap & BNXT_FW_CAP_PTP) + __bnxt_hwrm_ptp_qcfg(bp); bnxt_dcb_init(bp); return 0; } diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index d7eb0d244f42..0eeaed95a4ac 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -1996,6 +1996,7 @@ struct bnxt { #define BNXT_FW_CAP_HOT_RESET_IF BIT_ULL(29) #define BNXT_FW_CAP_RING_MONITOR BIT_ULL(30) #define BNXT_FW_CAP_DBG_QCAPS BIT_ULL(31) + #define BNXT_FW_CAP_PTP BIT_ULL(32) u32 fw_dbg_cap;