Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp905876rwi; Wed, 19 Oct 2022 04:34:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6eQeHdqJyZ9n0q+5y1+GXwWkJEIU0wWFjr2jbmsnLwmWz5Lt8YPlexbthxoDnOgkGM6zAi X-Received: by 2002:a17:902:7c14:b0:17f:6303:f40 with SMTP id x20-20020a1709027c1400b0017f63030f40mr7838809pll.1.1666179293479; Wed, 19 Oct 2022 04:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666179293; cv=none; d=google.com; s=arc-20160816; b=szQBrp68flI+iMNmXUbLs0bju0+nyLDuIRrOCCvEftEiNlO19jbTfdwcNlZpwCyA0q V1eppJbgcDEMr2NAKRIA3+/o5bgtLBxdVRaFIBHV3rFe34b/wSalfEXq97JiF0hVcpY2 ZmhIMbW7GCUVcK+EJ+d0EBS6NsAaAuuMLoj0ztGhWb8U9dew5aTaTD/GpBWPgkH9gO46 /RfVQ63UMxH16N1pykMtvRi69AE0OmdS99c/CU/uXF5e7de2rKhz3Z5VwD/dPlokmMps CEYeLel3bI8mLlgt2qAaNBLwozgp96cDPVu5q2LoGViyQ81tNrp+ZsLtCbQcsNUzdrx/ CIkQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j13-20020a056a00174d00b005583264623csi19931822pfc.278.2022.10.19.04.34.41; Wed, 19 Oct 2022 04:34:53 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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; } -- 2.35.1