From patchwork Wed Oct 19 08:33:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5141 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp252074wrs; Wed, 19 Oct 2022 03:53:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4gXejwORYPLRSjhkkrNRTQ+x6l+SstrAmruekExjNU0KXGn9U2Xn3CockENsBeIYJFLilT X-Received: by 2002:a17:906:8a79:b0:78d:9c52:2196 with SMTP id hy25-20020a1709068a7900b0078d9c522196mr6304383ejc.328.1666176808744; Wed, 19 Oct 2022 03:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666176808; cv=none; d=google.com; s=arc-20160816; b=B/kCkKGbFJd1C7uHQcW9s7j8ry5QCBdB86wZbWY4QvHg1In5LEB1UbC6Ka1Yi4B326 xOPW8oysGCmW/MMNUgGNqxktPGppb2p7O0zJ/2D2a7OHN7REzgr2GqHCURyLr+A3FcdL e+xcYSrZL6Q0hqXIockYANoslqMaV45TJQIEs7zdt9azfhMQNIyQt7qY4o0rPY+h6bPv LkRnuLrhKB/FrTAWkcnC6i/h78POHGKCzhZKFnwwm0mlMeEkxrjrzBmYHSJHgZLgb6wq a1Jnjf2XyrSch/Jb0feXSO6EkZ4eWZjoHrnUZe+kTdt5AWS0EdveTL5RaLZ6fKlE0rV0 Bk5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u95MpHAAfzf6FFlDZJUXEyDup8IeV4MZHMz1A7Ogets=; b=Zch3QfPX/uTWyxG72/YikeYqLc6N+94f7UCOdIV/UZdKO+PUzLlwF/ZAdYWsDuLQGx eq68sKgp7YZqJ+FMwus5qL35gqOD3o9o7JjD3E97ymk5oga4+qmXaV+kkPGaUiZOdsu8 2uvj956lE6Q7MMntnRISptB0TabS9VWW056yJFYEkcdhih3UF6zU6Kgj1w7ROn6Cit8R TJ+5K7ouHzcaVHFHT0AVaa6Cq8JbEfCpak3s70ICdNLa5idgtQofFJWXhkltvdLWeMX+ 5gSVH8JfofrQFwARY6cb4aEYvCeuXSZhl+xyIO1ysZYBWVrckUPDKTT3O46EaY9Zlo8N SaBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TRaxY+nT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg15-20020a170907970f00b0077ccad53173si14930195ejc.277.2022.10.19.03.53.04; Wed, 19 Oct 2022 03:53:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TRaxY+nT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232253AbiJSKvo (ORCPT + 99 others); Wed, 19 Oct 2022 06:51:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234577AbiJSKtc (ORCPT ); Wed, 19 Oct 2022 06:49:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E0E511A979; Wed, 19 Oct 2022 03:22:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C1D59B824B4; Wed, 19 Oct 2022 09:11:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 275F9C433D6; Wed, 19 Oct 2022 09:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170676; bh=YHvVHIJX2HPHSLT4eGLhe20mkccL+miqWFxNvBZc7ac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TRaxY+nTAH1QeTJ8BG6T1OfZoC/RXEP5s8sVEThS9re9LYkrXGm+QEP6MucfvBNVF oSbj1/Ob+x/yAOJhIDGerHfwvyHS6vidGqFLCMEwaIIyRh5om08CoYfH1tKUfe8RoF KipfUZlf3+paDM3JYemLcfgKWAnCoBH0L1X/M47c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Richard Cochran , Vadim Fedorenko , Michael Chan , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.0 711/862] bnxt_en: replace reset with config timestamps Date: Wed, 19 Oct 2022 10:33:18 +0200 Message-Id: <20221019083321.353699696@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747113013386505536?= X-GMAIL-MSGID: =?utf-8?q?1747113013386505536?= From: Vadim Fedorenko [ Upstream commit 8db3d514e96715c897fe793c4d5fc0fd86aca517 ] Any change to the hardware timestamps configuration triggers nic restart, which breaks transmition and reception of network packets for a while. But there is no need to fully restart the device because while configuring hardware timestamps. The code for changing configuration runs after all of the initialisation, when the NIC is actually up and running. This patch changes the code that ioctl will only update configuration registers and will not trigger carrier status change, but in case of timestamps for all rx packetes it fallbacks to close()/open() sequnce because of synchronization issues in the hardware. Tested on BCM57504. Cc: Richard Cochran Signed-off-by: Vadim Fedorenko Reviewed-by: Michael Chan Link: https://lore.kernel.org/r/20220922191038.29921-1-vfedorenko@novek.ru Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c index 8e316367f6ce..2132ce63193c 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c @@ -505,9 +505,13 @@ static int bnxt_hwrm_ptp_cfg(struct bnxt *bp) ptp->tstamp_filters = flags; if (netif_running(bp->dev)) { - rc = bnxt_close_nic(bp, false, false); - if (!rc) - rc = bnxt_open_nic(bp, false, false); + if (ptp->rx_filter == HWTSTAMP_FILTER_ALL) { + rc = bnxt_close_nic(bp, false, false); + if (!rc) + rc = bnxt_open_nic(bp, false, false); + } else { + bnxt_ptp_cfg_tstamp_filters(bp); + } if (!rc && !ptp->tstamp_filters) rc = -EIO; }