From patchwork Sun Jun 27 17:19:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 467931 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY, SPF_HELO_NONE, SPF_PASS, T_TVD_MIME_NO_HEADERS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4782C49EA6 for ; Sun, 27 Jun 2021 17:20:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B7FD36145F for ; Sun, 27 Jun 2021 17:20:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231435AbhF0RXL (ORCPT ); Sun, 27 Jun 2021 13:23:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231430AbhF0RXF (ORCPT ); Sun, 27 Jun 2021 13:23:05 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FB21C061574 for ; Sun, 27 Jun 2021 10:20:41 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id 13-20020a17090a08cdb029016eed209ca4so8805362pjn.1 for ; Sun, 27 Jun 2021 10:20:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LjzorBCRJWZ5nbaIlBViYImwl0khnt5U2b0aPhLjp5g=; b=cTPB5r+sEo2rHcK0FTFoiIrE5mPuZ0B233m/tPzmphUFpGYniZAYpO9XW9xNB7ay0N q97AYAw0l0jw0r1F2r+UrYKmYgxHLhxqPHDYgpDe1nyJj88XXaqgXiRE969VD9gU3hTw VtflfJiUsD9mSmSkAar9+UWfdDr99Sd3mT1cw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LjzorBCRJWZ5nbaIlBViYImwl0khnt5U2b0aPhLjp5g=; b=ZpHywXSyE3M2EXC2x2cBtXomcAw12oz7kuUhSlmUO3SDlaezNDQ4PHM8dHoTA7GTvN zGQboqNxUFJSNpdJ+qkTTy7aCk1xgRUVPldqRM+eOrI9W5VwiLo6NLwq5t84pyCL89+l RrZ/77Dnj7Mx1AGRsqNb68yDofToGupJ3QeCob4FyYBy7062RYFTyG0SuLs19xslQEJL 682dOIXnPrVYmedG/gBq6CXhkZn4BqW0cvlVi6ah9JsrJLQHBPrwCNM9p5FxK1o6J1hP LMwZlh7mLl2SQqzKnHnYGCkGvWi9WQwzghC3B7oSzN1l5CVZaBwTdI3kFUYGZLqQvomY 3b9g== X-Gm-Message-State: AOAM532JmNOXO/DxVftUR6dm/mlsffF3z/RW4tiWsO6e+xq/Vv5fI9FE fj+fciyUm28m60Lit+6jhWpofg== X-Google-Smtp-Source: ABdhPJwDlqMGhRaanpCop4mioCbDknPf9sEup+8qnTUa92xgkZcvc6pyvJ/SwcC5ziEx0zMwk2HyZA== X-Received: by 2002:a17:90b:4894:: with SMTP id ii20mr7589546pjb.68.1624814440973; Sun, 27 Jun 2021 10:20:40 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id j8sm11011584pfu.60.2021.06.27.10.20.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jun 2021 10:20:40 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com, richardcochran@gmail.com, pavan.chebbi@broadcom.com, edwin.peer@broadcom.com Subject: [PATCH net-next v2 7/7] bnxt_en: Enable hardware PTP support Date: Sun, 27 Jun 2021 13:19:50 -0400 Message-Id: <1624814390-1300-8-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1624814390-1300-1-git-send-email-michael.chan@broadcom.com> References: <1624814390-1300-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Call bnxt_ptp_init() to initialize and register with the clock driver to enable PTP support. Call bnxt_ptp_free() to unregister and clean up during shutdown. Reviewed-by: Edwin Peer Reviewed-by: Pavan Chebbi Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index e198e1426551..8f185a4883d2 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -12660,6 +12660,8 @@ static void bnxt_remove_one(struct pci_dev *pdev) if (BNXT_PF(bp)) devlink_port_type_clear(&bp->dl_port); + + bnxt_ptp_clear(bp); pci_disable_pcie_error_reporting(pdev); unregister_netdev(dev); clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state); @@ -13243,6 +13245,11 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) rc); } + if (bnxt_ptp_init(bp)) { + netdev_warn(dev, "PTP initialization failed.\n"); + kfree(bp->ptp_cfg); + bp->ptp_cfg = NULL; + } bnxt_inv_fw_health_reg(bp); bnxt_dl_register(bp);